Files
Microcomputer_System_and_In…/Lab/Lab4/material/task3/code.asm
2025-05-27 16:03:52 +08:00

29 lines
968 B
NASM
Executable File
Raw 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.

DATA SEGMENT
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA
MOV DS, AX
MOV DX, 283H ; 命令口
MOV AL, 00110100B ; 00(0号计数器)|11(读写2字节)|010(2方式工作)|0(计数值为2进制)
OUT DX, AL
MOV DX, 280H ; 0号计数器
MOV AL, 11101000B ; (1000)_D的2进制的低8位
OUT DX, AL
MOV AL, 00000011B ; (1000)_D的2进制的高8位
OUT DX, AL
MOV DX, 283H ; 命令口
MOV AL, 01010110B ; 01(1号计数器)|01(读写低字节高字节为0)|011(3方式工作)|0(计数值为2进制)
OUT DX, AL
MOV DX, 281H ; 1号计数器
MOV AL, 00001010B ; (10)_D的2进制
OUT DX, AL
CODE ENDS
END START