
PROGRAMMING CONCEPTS III 145
LEA DI, AREA ;address AREA with DI
MOV CX, 50 ;load count in CX
CLD ;clear direction fl ag
MOV AX, 0001 ;load AX with 0
REP STOSW ;repeat until CX = 0
.EXIT ;exit to DOS
END ;end of program
It is obvious that the STOS instruction is used to fi ll up an area in memory with the same data.
ii) LODS
e last of the string instructions is LODS. is is an instruction for ‘loading’. Loading always
means the act of taking data from memory and putting it into a register. Here, the source
memory is the data segment and the pointer to it is SI. e data segment is the source segment
and the destination register ...