Files
Operating-System/Experiment/asm-exp/实验二/加强性实验3_逻辑运算.asm
2026-06-25 00:09:09 +08:00

24 lines
641 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.
; 实验二加强性实验三逻辑运算AND和OR
; 程序功能实现AND和OR逻辑运算
; 数据AL=55H进行AND和OR运算
CODE SEGMENT
ASSUME CS:CODE
ORG 100H
START:
MOV AL, 55H ; AL=55H (01010101B)
AND AL, 0FH ; AL = AL AND 0FH = 55H AND 0FH = 05H
; 此时AL=05H (低4位保留高4位清零)
MOV BL, AL ; 保存AND结果到BL
MOV AL, 55H ; 恢复AL=55H
OR AL, 0F0H ; AL = AL OR 0F0H = 55H OR F0H = F5H
; 此时AL=F5H (高4位置1低4位不变)
; 结果BL=05H(AND结果), AL=F5H(OR结果)
INT 20
CODE ENDS
END START