Files
Operating-System/Experiment/asm-exp/实验二/基础性实验3_拆字程序.asm
2026-06-25 00:09:09 +08:00

20 lines
587 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.
; 实验二基础性实验三:拆字程序
; 程序功能将16位数拆分为两个8位数
; 原始数据ABCDH拆分后高8位=ABH低8位=CDH
CODE SEGMENT
ASSUME CS:CODE
ORG 100H
START:
MOV AX, 0ABCDH ; 16位数据AX=ABCDH
MOV DL, AL ; 将AL(低8位)传给DL保存
MOV CL, 8 ; 设置移位计数
SHR AH, CL ; AH右移8位得到高8位ABH
MOV BH, AH ; 高8位存入BH
MOV BL, DL ; 低8位CDH存入BL
; 结果BH=ABH(高8位), BL=CDH(低8位)
INT 20
CODE ENDS
END START