Files
Operating-System/Experiment/asm-exp/实验六/实验六-1_字符输出宏.asm
2026-06-25 00:09:09 +08:00

33 lines
470 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.
; 实验六-1: 宏定义与调用一 - 字符输出宏
; 功能: 定义宏实现字符输出功能
DATAS SEGMENT
CHAR DB 'A'
DATAS ENDS
STACKS SEGMENT
DB 64 DUP(?)
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES, DS:DATAS, SS:STACKS
; 宏定义
; 功能:输出一个字符
; 参数DL=字符
OUTPUT MACRO
MOV AH,02H
INT 21H
ENDM
START:
MOV AX, DATAS
MOV DS, AX
MOV DL, CHAR
OUTPUT
MOV AH, 4CH
INT 21H
CODES ENDS
END START