问题描述
- 汇编中接管16H使得输入A显示B,输入B显示A并驻留内存,不知道怎么老报cpu错误
-
.386
DATA SEGMENT
DATA ENDS
STACK SEGMENT USE16 STACK
DB 200 DUP(0)
STACK ENDS
CODE SEGMENT USE16ASSUME 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 21HCODE ENDS
END START
时间: 2024-10-07 01:44:20