感谢看这个帖子的人,谢谢每个为我提出意见的人.
我的问题:
1.真是的DOS环境下,退不出来,中断服务子程序。(板子是intel Q35)
2.中断服务子程序的写法。(公司培训和书上有些不同)
请看看我的代码,然后指点下。
代码如下
;------------------------------------------------
;This file is used to alter 1cH function to
;dispaly 'Hello masm611!' on screen 10 times.
;
;Author: ripple.wang
;Date: 2012-12-26
;------------------------------------------------
.model small
.386
data segment
string db 'Hello masm611!', 10, 13, '$'
data ends
stack segment
db 10000 dup(0)
stack ends
code segment
assume cs:code, ds:data, ss:stack
start:
push cs
pop ds ;string code transfer to 0000:0204h
mov ax, 0
mov es, ax ;also can ues stosw do it..
mov si, offset int1c
mov di, 204h
mov cx, offset int1cend - offset int1c
cld ;set direction..
rep movsb
push es:[1ch*4]
pop es:[200h] ;save the old interupt vector...
push es:[1ch*4+2]
pop es:[202h]
cli
mov word ptr es:[1ch*4], 204h ;set the new interupt vector...
mov word ptr es:[1ch*4+2], 0h
sti
int 1ch
cli
mov word ptr es:[1ch*4], 204h ;restore interupt vector...
mov word ptr es:[1ch*4+2], 0h
sti
mov ax, 4c00h
int 21h
;----------------------------------------------------------------
;int1c is a replacement interupt
;----------------------------------------------------------------
int1c: