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

📄 双色点阵.asm

📁 此程序为接口实验箱上如何使用双色点阵来显示年字初学者可以根据这个程序来模仿输出各种文字
💻 ASM
字号:
;***********************11588-1.ASM*************************
proth    equ      280h
protlr    equ       288h
protly    equ      290h
   
DATA      SEGMENT
MESS      DB  'Strike any key,return to DOS!',0AH,0DH,'$'
min1      DB  00h,01h,02h,03h,04h,05h,06h,07h
min2      db  08h,09h,10h,11h,12h,13h,14h,15h
min3      db  16h,17h,18h,19h,20h,21h,22h,23h
min4      db  24h,25h,26h,27h,28h,29h,30h,31h
count     db  0
buff1     DB  9eh,92h,92h,0feh,0feh,82h,82h,0feh
buff2     db  0feh,82h,82h,0feh,0feh,92h,92h,92h
buff3     db  0feh,82h,82h,0feh,0f2h,92h,92h,9eh
buff4     db  0f2h,92h,92h,9eh,0f2h,92h,92h,9eh
DATA      ENDS
;-----------------------------------------------------------
CODE      SEGMENT
ASSUME    CS:CODE,DS:DATA
;------------------------------------------------------------
START:    MOV   AX,DATA
          MOV   DS,AX
          MOV   DX,OFFSET MESS
          MOV   AH,09
          INT   21H                      ;显示提示信息
;------------------------------------------------------------
show1  macro  a,b   ;show1 为显示红色
local d2,next,delay2
      mov    cx,80h
d2:   mov    ah,01h
      push    cx
      mov    cx,0008h
      mov    si,offset a
next:     mov    al,[si]
      mov    bx,offset b
      xlat                             ;得到第一行码
      mov    dx,proth
      out    dx,al
      mov    al,ah
      mov    dx,protlr
      out    dx,al                       ;显示第一行红
      mov al,0
      out dx,al
      shl    ah,01
      inc    si
      push    cx
      mov    cx,0ffh
delay2:      loop  delay2                       ;延时

      pop    cx
      loop    next
      pop    cx
      call    delay
      loop    d2
      mov    al,00
      mov    dx,protlr
      out    dx,al
      mov    ah,01                       ;有无键按下
      int    16h
      jnz    a2
      endm
      
      show2 macro c,d       ;show2为显示黄色
      local next1,delay1,delay3,d1
      mov    cx,80h                     
d1:   mov    si,offset c

      mov    ah,01
      push    cx
      mov    cx,0008h
next1:      mov    al,[si]
      mov    bx,offset d
      xlat
      mov    dx,proth
      out    dx,al
      mov    al,ah
      mov    dx,protly
      out    dx,al
      mov al,0
      out dx,al
      shl    ah,01
      inc    si
      push    cx
      mov    cx,0ffh;ffh
delay1:      loop  delay1
      mov    cx,0ffh;ffh
delay3:      loop  delay3
      pop    cx
      loop    next1
      pop    cx
      call    delay
      loop    d1
      mov    al,00
      mov    dx,protly
      out    dx,al
      mov    ah,01
      int    16h
      jnz    a2
      endm
      
t:
show1 min1,buff1
show2 min2,buff2
show1 min3,buff3
show2 min4,buff4
jmp  t   ;黄色红色交替显示
 

                             
;----------------------------------------------------------------      
DELAY      PROC    NEAR                           ;延迟子程序
      push    cx
      mov    cx,0ffh;ffh
ccc:      loop    ccc
      pop    cx
      ret
DELAY      ENDP      
;---------------------------------------------------------------------

a2:      MOV   AH,4CH                    ;返回
          INT   21H
CODE      ENDS
END       START
;----------------------------------------------------------

⌨️ 快捷键说明

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