.386
STACK SEGMENT USE32
DB 200 DUP(0)
STACK ENDS
DATA SEGMENT USE16
NUM DB 11H,22H,33H,44H
NEND DB 0
LEN EQU NEND-NUM;不能直接用LEN EQU LEN-NUM,会导致宏嵌套太深
DATA ENDS
CODE SEGMENT USE16
ASSUME CS:CODE,DS:DATA,SS:STACK
START:
MOV AX,DATA
MOV DS,AX
;
MOV AX,WORD PTR NUM
MOV EAX,DWORD PTR NUM
;
MOV ESI,OFFSET NUM;
ADD BYTE PTR 2[SI],LEN
MOV BYTE PTR 2[ESI],'A'
INC BYTE PTR [SI]
DEC BYTE PTR [SI]
MOV AH,4CH
INT 21H
CODE ENDS
END START
标签:P52Demo3.1,MOV,LEN,NUM,BYTE,DATA,PTR
From: https://blog.51cto.com/gjwrxz/6539583