CODES SEGMENT
ASSUME CS:CODES
START:
mov ax,0
mov ds,ax
mov word ptr ds:[0],0200h
mov word ptr da:[2],0h
mov ax,cs
mov ds,ax
mov si,offset int0
mov ax,0
mov es,ax
mov di,200h
mov cx, offset int0end - offset int0
cld
rep movsb
mov ax,1000h
mov bh,1
divbh
MOV AH,4CH
INT 21H
int0:jmp short int0start
db "hello world"
int0start mov ax,0b800h
mov es,ax
mov si,12*160+36*2
mov cx,11
mov di,202
s: mov es:[si],ds:[di]
inc di
add si,2
loop s
MOV AH,4CH
INT 21H
int0end: nop
CODES ENDS
END STAT
经过测试,代码段的段地址是0000H,db "hello world"是从0000:0200H开始写的,问题的关键是0000:0000H到0000:00FFH是中断向量表啊,那岂不是db "hello world"前面那些代码吧中断向量表给覆盖了???因为只要是写进去的代码都要编译储存啊。。。
|