Professional Documents
Culture Documents
MP-Lab Sheet #2
MP-Lab Sheet #2
Sheet #2
The Code:
.MODEL SMALL
.STACK 100H
.DATA
str DB 30 DUP('$')
NL DB 0Dh,0Ah,’$’
.CODE
START:
MOV AX,@DATA
MOV DS,AX
LEA SI,str ; same as MOV SI, offset str1
MOV AH,0AH
MOV DX,SI
INT 21H
MOV AH,09H
LEA DX,NL ; same as MOV SI, offset NL
INT 21H ; to print newline
MOV AH,4CH
INT 21H
END START
When you run the code, the output will be as shown below:
Now try to modify the code to look like the code listed below:
.MODEL SMALL
.STACK 100H
.DATA
.CODE
START:
MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,str1
INT 21H
MOV AH,0AH
MOV DX,str3
INT 21H
MOV AH,09H
LEA DX,str2
INT 21H
LEA DX,str3+2
INT 21H
MOV AH,4CH
INT 21H
END START
When you run the code, the output will look like the picture below:
Entry: DS:DX
Notes: