Comments

"MyArray times 256 db 0" will initialize and array of 256 elements to the value of 0if you want to declare a uninitialized array is should be some thing like"MyArray resw 256" in the .bss section

accessing the elements on the array is much like the stack, since essentially an array is just a section of program memory, the first element of the array will be at MyArray, you move through the array according to the size of the memory location reserved. on a 16 bit system i believe this would be 2 representing 16 bits, so moving through the array can be as simple ass "add MyArray,2" then refering to [MyArray],"[MyArray+2], [MyArray+4]..etc" also works to refer to the values, or you can use some sort of index variable or register for it[MyArray + 2*esi] assuming esi is what your using to index it.

right i have a infinite loop in GetString and i have a counter CX and what i am trying to do now is put the value of DL into the array at the position of the counter so if CX=1 is will put the value of DL in array[1].

your infinite loop is probably being caused when you call a methodmany methods actually mess with registers without preserving the valuesfixing it should be as simple as push cx before the call and pop cx after the call

its a good idea to assume a method might mess with your registers.

i believe what you want for "mov MyArray[cx], DL" should be something like:"mov [MyArray + cx], DL", unless your using cx to index through the array, then it would be something like "mov [MyArray + 2*cx], DL"

nope those 2 dont work either :( ive tried loads of other ways im stuck now need to sort this out any other ideas. Thankyou for your help so far . im using nasmide to code and compile [code]push bxlea bx, [MyArray+2*cx]mov word[bx], DLpop bx[/code]invalid effectiveness of code

[code]all Getch ; get the character stored in DLcall Putch ; output the character on screenpush bxmov bx, 2imul bx, cxmov [MyArray+bx], dlpop bx[/code]probably not the preferred way to index, but should work?not sure why it was giving an invalid memory address using the other