Files
Operating-System/Experiment/asm-exp/实验二/基础性实验1_数据传送和加法.asm
2026-06-25 00:09:09 +08:00

19 lines
485 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.
; 实验二基础性实验一:数据传送和加法运算
; 程序功能X=25H, Y=30H, Z=X+Y
; 计算25H + 30H = 55H结果存入Z
CODE SEGMENT
ASSUME CS:CODE
ORG 100H ; 程序装入地址
START:
MOV AL, 25H ; X=25H传送到AL
MOV BL, 30H ; Y=30H传送到BL
ADD AL, BL ; AL = AL + BL = 25H + 30H = 55H
MOV Z, AL ; 结果55H存入Z
INT 20 ; 退出程序
Z DB ? ; 定义变量Z
CODE ENDS
END START