1数码管.asm

来自「汇编程序」· 汇编 代码 · 共 36 行

ASM
36
字号
code segment public
assume cs:code
org 100h
start:
     mov dx,04a0h
     in al,dx
     mov si,offset  LEDsz
     mov di,offset  LEDtb 
     mov cx,10h     
     mov bx,0
ord: cmp al,byte ptr [si+bx]
     jz output
     inc bx
     loop ord
     jmp start
LEDsz:  db 0,1,2,3,4,5,6,7,8,9,0ah,0bh,0ch,0dh,0eh,0fh    
LEDtb:  db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,39h,5eh,79h,71h
output:
    mov dx,04b0h
    mov al,byte ptr [di+bx]
    out dx,al
    call delay
    mov al,0
    mov  dx, 04b0h			
    out dx, al
    call delay
    jmp start
delay proc
     push cx
     mov cx,20000
     lop: loop lop
     pop cx
     ret 
delay endp         
code ends
end start

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?