0
13kviews
Write 8086 assembly language program to move a string of words from offset 1000h to offset 6000h. The Length of the string is 0Ch.
1 Answer
written 8.3 years ago by |
Label | Instructions | Comment |
---|---|---|
MOV AX, 0000H | Initialize data segment | |
MOV DS, AX | ||
MOV ES, AX | Initialize extra segment | |
MOV SI, 1000H | Initialize pointers | |
MOV DI, 6000H | ||
MOV CX, 03FFH | Initialize counter | |
CLD | Clear direction flag | |
AGN: | LODSB | Load data from location pointed by SI,into AL and increment SI |
MOV AH, [DI] | Load data from location pointed by,DI into AH | |
MOV [SI - 1], AH | Store data in location pointed by SI - 1 | |
STOSB | Store data in location pointed by DI and increment DI | |
LOOP AGN | Repeat until 1 KB data is transferred | |
MOV AH, 4CH | ||
INT 21H |