主题:求汇编程序
mouseking13
[专家分:0] 发布于 2006-01-09 20:44:00
求助:那位做过或见过接口设计中以8255控制模拟交通灯这一题目(六支灯),求其汇编源程序,谢谢了!
回复列表 (共1个回复)
沙发
dingpinru [专家分:0] 发布于 2006-07-04 10:29:00
程序: 端口各灯的设置:1红,1黄,1绿,00 ,2红,2黄,2绿
data segment
poctc1 db 24h,44h,04h,44h,04h,44h,04h
db 81h,82h,80h,82h,80h,82h,80h
db offh
data ends
code segment
assume cs:code, ds:datd
start:
mov ax, data
mov ds, ax
mov dx,28bh
mov al, 90h
out dx, al
mov dx, 28ah
re_on:
mov bx,0
on:
mov al,portc1[bx]
cmp al,offh
jz re_on
out dx,dl
inc bx
mov, cx20
test al,21h
jz del
mov cx,2000
del:
mov di,9000
deo:
del di
jnz deo
ioop del
push dx
mov ah ,06h
mov dl, offh
int 21h
pop dx
jz on
exit:
mov ah,4ch
int 21h
code ends
end start
我来回复