⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 6-2.asm

📁 TCP_USB试验平台下的几个常见的实验的相应要求与代码
💻 ASM
字号:
;8路采集 芯片0809
data segment
t0 equ 280h
t1 equ 281h
t2 equ 282h
ctl53 equ 283h
pa equ 288h
pb equ 289h
pc equ 28ah
ctl55 equ 28bh
table db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,39h,5eh,79h,71h
;40h,79h,14h,30h,29h,22h,02h,78h,00h,20h,08h,0h,46h,40h,6h,0eh
dat db (?)
addrr dw (?)
data ends
code segment
assume ds:data,cs:code
start:
    mov ax,data
    mov ds,ax
   ; mov cx,100

    mov dx,ctl53
    mov al,00100101b
    out dx,al
    mov dx,t0
    mov al,10h
    out dx,al
    mov dx,ctl53
    mov al,01100111b
    out dx,al
    mov dx,t1
    mov al,10h
    out dx,al
    mov dx,ctl55
    mov al,10001000b
    out dx,al
L0: mov addrr,290h
L1:
   call led8
   mov dx,pc
   in al,dx
   test al,40h
   jnz L1 
   
  mov dx,addrr
  out dx,al
L2:
   mov dx,pc
   in al,dx
   test al,40h
   jz L2
   
   mov dx,addrr
   in al,dx
   mov dat,al
   mov dx,pa
   out dx,al
  call screen
  cmp addrr,297H
  jz L0
  add addrr,1
  jmp L1       
 mov ah,4ch
 int 21h

led8 proc near
    mov al,dat
    and al,0fh
    mov bx,offset table
    xlat
    mov dx,pb
    out dx,al
    mov dx,pc
    mov al,01h
    out dx,al
    mov dx,pb
    mov al,00h
    out dx,al
    mov dx,pc
    mov al,00h
    out dx,al
    mov al,dat
    push cx
    mov cl,4
    sar al,cl
    and al,0fh
    xlat
    mov dx,pb
    out dx,al
    mov dx,pc
    mov al,02h
    out dx,al
    mov dx,pb
       mov al,00h
    out dx,al
    mov dx,pc
    mov al,00h
    out dx,al
    pop cx
ret
led8 endp
    
screen proc near
    mov bl,dat
    push cx
    mov ch,2
rotate:
    mov cl,4
    rol bl,cl
    mov al,bl
    and al,0fh
    add al,30h
    cmp al,3ah
    jl printit
    add al,7h
printit:
    mov dl,al
    mov ah,2h
    int 21h
    dec ch
    jnz rotate
    pop cx
ret
screen endp
code ends
end start


    
    























    
    
    

⌨️ 快捷键说明

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