端口的读写
assume cs:code,ds:data,ss:stack
data segment
dw 0123H,0456H,0789H,0abcH,0defH,0cbaH,0987H
data ends
stack segment
dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
stack ends
code segment
start:mov ax,stack
mov ss,ax
mov sp,20h
mov ax,data
mov ds,ax
mov bx,0
mov cx,8
s:push [bx]
add bx,2
loop s
mov bx,0
mov cx,8
s0:pop [bx]
add bx,2
loop s0
mov ax,4c00h
int 21h
code ends
end start
操作CMOS RAM芯片
assume cs:code
code segment
start:mov al,8;取得月份数据
out 70h,al
in al,71h
mov ah,al ;分离月份的十、个位
mov cl,4
shr ah,cl
and al,00001111b
add ah,30h;转换为ASCLL码
add al,30h
mov bx,0b800h;//显示
mov es,bx
mov byte ptr es:[160*12+40*2],ah
mov byte ptr es:[160*12+40*2+2],al
mov ax,4c00h
int 21h
code ends
end start