Files
Operating-System/Experiment/asm-exp/实验六/实验六-2_数值显示宏.asm
2026-06-25 00:09:09 +08:00

34 lines
513 B
NASM
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; 实验六-2: 宏定义与调用二 - 数值显示宏
; 功能: 定义宏实现数值显示功能
DATAS SEGMENT
NUM DB 5
DATAS ENDS
STACKS SEGMENT
DB 64 DUP(?)
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES, DS:DATAS, SS:STACKS
; 宏定义
; 功能显示数字0-9
; 参数DL=数字
DISP_NUM MACRO
ADD DL, 30H ; 转换为ASCII码
MOV AH, 02H
INT 21H
ENDM
START:
MOV AX, DATAS
MOV DS, AX
MOV DL, NUM
DISP_NUM
MOV AH, 4CH
INT 21H
CODES ENDS
END START