Assuming I have a string of ascii characters such as "652+346*779=", and I want to move some characters FROM this variable TO another variable...
Buffer is the string (in this case "652+346*779=") lengthofnum is the length of the number in question (in this case 346 has length 3) A_ascii is the variable to which I'm trying to transport the string "346".
I have a loop that doesn't work at all, and I can't figure out what addressing mode I'm supposed to use. emu8086 hates everything I've tried so far, and gives me errors regarding my syntax with the MOV instruction
mov cx,lengthofnum
dumploop1:
mov bx, offset buffer
;dump the number from buffer into A_ascii
mov A_ascii[cx],[bx]+cx
loop dumploop1:
I get the following error codes:
(672) wrong parameters: MOV A_ascii[cx],[bx]+cx
(672) probably it's an undefined var: A_ascii[cx]
Contrary to (apparently) popular belief, you can do a direct mem->mem move on an x86, without (explicitly) moving to/from a register. Since you already have the length in CX, you're already started in the right direction:
mov si, offset A_ascii
mov di, offset B_ascii
rep movsb ; automatically uses length from CX