汇编网首页登录博客注册
zwz_good的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
学习动态
好友圈
友情链接

[2009-10-13 21:01] 16.3直接定址表 例题 以十六进制的形式在屏幕中间显示给定的字节型数据

assume cs:code, ds:data
data segment
  db 'zwz_good'
data ends

code segment
start:
  mov ax, data
  mov ds, ax
  mov si, 0
  mov cx, 8
s:
  mov al, [si]
  call showbyte
  call delay
  inc si
  loop s
  mov ax, 4c00h
  int 21h
delay:
  push ax
  push dx
  mov ax, 0h
  mov dx, 1000h
delay0:
  sub ax, 1
  sbb dx, 0
  cmp ax, 0
  jne delay0
  cmp dx, 0
  jne delay0
  pop dx
  pop ax
  ret
;用al传送要显示的数据
showbyte:
  jmp short show
  table db '0123456789ABCDEF'
show:
  push bx
  push es
  mov ah, al
  shr ah, 1
  shr ah, 1
  shr ah, 1
  shr ah, 1
  and al, 00001111b
  
  mov bl, ah
  mov bh, 0
  mov ah, table[bx]
  mov bx, 0b800h
  mov es, bx
  mov es:[160*12+40*2], ah

  mov bl, al
  mov bh, 0
  mov al, table[bx]
  mov es:[160*12+40*2+2], al
  
  pop es
  pop bx
  ret
code ends
end start
评论次数(0)  |  浏览次数(438)  |  类型(汇编作业) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码