Files
Operating-System/Experiment/asm-exp/实验一/实验一_程序.asm
2026-06-25 00:09:09 +08:00

20 lines
647 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.
; 实验一加强性实验程序
; 程序功能将内存2000:0000和2000:0001处的两个字节相加结果存入2000:0002
; 在DEBUG中使用A命令输入以下代码
; 代码段
CODE SEGMENT
ASSUME CS:CODE
ORG 2000H ; 指定程序装入地址
START:
MOV AX, 2000H ; 设置数据段地址
MOV DS, AX ; 将2000H传送到DS段寄存器
MOV AL, [0000] ; 将DS:0000处的字节传送到AL
MOV BL, [0001] ; 将DS:0001处的字节传送到BL
ADD AL, BL ; AL = AL + BL
MOV [0002], AL ; 将AL的内容传送到DS:0002
INT 20 ; 退出程序返回DOS
CODE ENDS
END START