鱼C论坛

 找回密码
 立即注册
查看: 1941|回复: 1

汇编第16章 查表的问题

[复制链接]
发表于 2013-1-3 21:48:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 西月 于 2013-1-3 22:26 编辑
  1. assume cs:code
  2. stack  segment
  3.     db 128 dup (0)
  4. stack  ends
  5. code segment
  6.     start:  
  7.             mov ax,stack
  8.             mov ss,ax
  9.             mov sp,128
  10.             push cs
  11.                         pop ds
  12.             mov si,offset int7ch
  13.             mov ax,0
  14.             mov es,ax
  15.             mov di,200h
  16.             mov cx,offset int7chEnd - offset int7ch
  17.             cld
  18.             rep movsb
  19.                         cli
  20.             mov word ptr es:[7ch*4],200h
  21.             mov word ptr es:[7ch*4+2],0
  22.             sti
  23.             mov ah,0
  24.             int 7ch
  25.             mov ax,4c00h
  26.             int 21h
  27.     int7ch:  
  28.             jmp short set
  29.                         table dw do0,do1,do2,do3     ;主要是这里有问题,找不到正确的入口
  30.         set:        
  31.                 push bx
  32.                         cmp ah,3
  33.                         ja int7chret
  34.                         mov bl,ah
  35.                         mov bh,0
  36.                         add bx,bx
  37.                         call word ptr table[bx]
  38. int7chret:        
  39.                         pop bx
  40.                         iret
  41.      do0:   push ax
  42.             push bx
  43.             push cx
  44.             push es
  45.             push si
  46.             push di
  47.             mov ax,0b800h
  48.             mov es,ax
  49.             mov bx,0
  50.             mov cx,2000
  51.       s1:   mov byte ptr es:[bx],' '
  52.             mov byte ptr es:[bx+1],00000111b
  53.             add bx,2
  54.             loop s1
  55.             pop di
  56.             pop si
  57.             pop es
  58.             pop cx
  59.             pop bx
  60.             pop ax
  61.             ret
  62.      do1:
  63.             push ax
  64.             push bx
  65.             push cx
  66.             push es
  67.             push si
  68.             push di
  69.             mov bx,0b800h
  70.             mov es,bx
  71.             mov bx,1
  72.             mov cx,2000
  73.        s2:  
  74.             and byte ptr es:[bx],11111000b
  75.             or es:[bx],al
  76.             add bx,2
  77.             loop s2
  78.             pop di
  79.             pop si
  80.             pop es
  81.             pop cx
  82.             pop bx
  83.             pop ax
  84.             ret
  85.      do2:   
  86.             push ax
  87.             push bx
  88.             push cx
  89.             push es
  90.             push si
  91.             push di
  92.             mov cl,4
  93.             shl al,cl
  94.             mov bx,0b800h
  95.             mov es,bx
  96.             mov bx,1
  97.             mov cx,2000
  98.        s3:  
  99.             and byte ptr es:[bx],10001111b
  100.             or es:[bx],al
  101.             add bx,2
  102.             loop s3
  103.             pop di
  104.             pop si
  105.             pop es
  106.             pop cx
  107.             pop bx
  108.             pop ax
  109.             ret
  110.       do3:
  111.             push ax
  112.             push bx
  113.             push cx
  114.             push es
  115.             push si
  116.             push di
  117.             mov ax,0b800h
  118.             mov ds,ax
  119.             mov es,ax
  120.             mov si,160
  121.             mov di,0
  122.             mov cx,2000
  123.             cld
  124.             rep movsb
  125.             mov bx,0
  126.             mov cx,80
  127.        s4:  mov byte ptr es:[160*24+bx],' '
  128.             add bx,2
  129.             loop s4
  130.             pop di
  131.             pop si
  132.             pop es
  133.             pop cx
  134.             pop bx
  135.             pop ax
  136.             ret
  137. int7chEnd:
  138.             nop
  139. code ends
  140. end start            
复制代码
===========================
assume cs:code
code segment
    start:
                mov ah,0  ;测试 do0
                int 7ch
                mov ax,4c00h
                int 21h
code ends
end start

这个是我自己写的 测试程序

但是 无法找到正确的 入口

                               
登录/注册后可看大图



小甲鱼最新课程 -> https://ilovefishc.com
发表于 2013-1-4 00:07:18 | 显示全部楼层
等待大侠的指导
小甲鱼最新课程 -> https://ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-7-4 23:43

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表