2 qq 24892809 qq_24892809 于 2016.04.25 18:28 提问

汇编中接管16H使得输入A显示B,输入B显示A并驻留内存,不知道怎么老报cpu错误

.386
DATA SEGMENT
DATA ENDS
STACK SEGMENT USE16 STACK
DB 200 DUP(0)
STACK ENDS
CODE SEGMENT USE16

ASSUME DS:DATA,CS:CODE,SS:STACK
OLD_INT DW ?,?

NEW16H: CALL DWORD PTR OLD_INT
CMP AL,41H
JZ L1
CMP AL,42H
JZ L2
JMP L3
L1: MOV AL,42H
JMP L3
L2: MOV AL,41H
L3:

IRET
START: XOR AX,AX
MOV DS,AX
MOV AX,DS:[16H*4]
MOV OLD_INT,AX
MOV AX,DS:[16H*4+2]
MOV OLD_INT+2,AX
CLI
MOV WORD PTR DS:[16H*4],OFFSET NEW16H
MOV DS:[16H*4+2],CS
STI
MOV AH,0
INT 16H
MOV DX,OFFSET START+15
SHR DX,4
ADD DX,10H
MOV AL,0
MOV AH,31H
INT 21H
MOV AH,4CH
INT 21H

CODE ENDS
END START

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!