
5-10
x86 MICROPROCESSORS
PW1 DB ‘SAMSON’ ;define PW1
PW2 DB 6 DUP(0) ;allocate space for PW2
.CODE
PUBLIC READ ;declare READ as public
.STARTUP
READ PROC FAR ;define the READ procedure
LEA BX, PW2 ;BX to point to PW2
MOV DL, 6 ;DL = 6,the number of characters
START: MOV AH,08 ;enter character without echo
INT 21H
MOV [BX], AL ;save the character in memory
INC BX ;increment memory pointer
DEC DL ;decrement the count
JNZ START ;jump if DL! = 0
RET ;return
READ ENDP ;enter the procedure
.EXIT
END
We have discussed only two examples with two modules being linked and run. The same
sequence can be tested with many ...