TSR执行后无效果

夜A千寻 2009-01-19 05:23:07
代码如下:

cseg segment
assume cs:cseg,ds:cseg
org 100h
start:
jmp Initialize

Old_Keyboard_IO dd ?

;---------------------------------------
new_keyboard_io proc far

assume cs:cseg,ds:cseg
sti
cmp ah,0
je ki0

assume ds:nothing
jmp Old_Keyboard_IO
ki0:
pushf
assume ds:nothing

cmp al,'y'
jne ki1
mov al,'Y'
jmp kidone
ki1:
cmp al,'Y'
jne kidone
mov al,'y'
kidone:
call Old_Keyboard_IO
iret
new_keyboard_io endp
;----------------------------------------------

Initialize:
assume cs:cseg,ds:cseg
mov bx,cs
mov ds,bx
mov al,16h
mov ah,35h
int 21h
mov word ptr Old_Keyboard_IO,bx
mov word ptr Old_Keyboard_IO[2],es


mov dx,offset new_keyboard_io
mov al,16h
mov ah,25h
int 21h
mov dx,offset Initialize
int 27h
cseg ends
end start

目的:将y转化为Y,将Y转化为y
但是我却没有实现它的效果,可能的问题会是什么呢?
...全文
95 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
up一下。。。
xtdumpling 2009-01-20
  • 打赏
  • 举报
回复
的确比较奇怪!
     cseg segment
assume cs:cseg,ds:cseg
org 100h
start:
jmp Initialize
Old_Keyboard_IO dd ?
new_keyboard_io proc far
assume cs:cseg,ds:cseg
sti
;Section 1
cmp ah,0
je ki0
cmp ah,10h;;;
je ki0;;;
assume ds:nothing
jmp Old_Keyboard_IO
;Section 2
ki0:
pushf
assume ds:nothing
call Old_Keyboard_IO
cmp al,'y'
jne ki1
mov al,'Y'
jmp kidone
ki1:
cmp al,'Y'
jne kidone
mov al,'y'
kidone:
iret
new_keyboard_io endp
;Section 3
Initialize:
assume cs:cseg,ds:cseg
mov bx,cs
mov ds,bx
mov al,16h
mov ah,35h
int 21h
mov word ptr Old_Keyboard_IO,bx
mov word ptr Old_Keyboard_IO[2],es
;End Section 3
mov dx,offset new_keyboard_io
mov al,16h
mov ah,25h
int 21h
mov dx,offset Initialize
int 27h
cseg ends
end start


看这里https://forum.eviloctal.com/thread-727-1-15.html

Inp.:
AH = 10h
Return: AH = BIOS scan code
AL = ASCII character
Notes: if no keystroke is available, this function waits until one is placed
in the keyboard buffer
the BIOS scan code is usually, but not always, the same as the hardware
scan code processed by INT 09. It is the same for ASCII keystrokes
and most unshifted special keys (F-keys, arrow keys, etc.), but
differs for shifted special keys.

unlike AH=00h, this function does not discard extended keystrokes
INT 16/AH=09h can be used to determine whether this function is
supported, but only on later model PS/2s
SeeAlso: AH=00h,AH=09h,AH=11h,AH=20h,MEM 0040h:0019h,MEM 0040h:001Eh
INT 16

Copied from Ralf Brown's Interrupt List
autotyx 2009-01-19
  • 打赏
  • 举报
回复
太复杂了,看不懂.
code segment
assume cs:code
org 100h
start:
mov ah,8
int 21h
cmp al,'y'
je tiao1
cmp al,'Y'
jne tiao2
mov al,'y'
jmp tiao2
tiao1:
mov al,'Y'
tiao2:
mov dl,al
mov ah,2
int 21h
jmp start
end start
这是一个输入字符,将'y'->'Y','Y'->'y',其他不变,输出到显示器

21,500

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧