关于汇编语言int9中断的问题?
本帖最后由 wwwzuocom 于 2020-2-2 20:37 编辑assume cs:code
stack segment
db 128 dup (0)
stack ends
data segment
dw 0,0
data ends
code segment
start:mov ax,stack
mov ss,ax
mov sp,128
mov ax,data
mov ds,ax
mov ax,0
mov es,ax
push es:
pop ds:
push es:
pop ds:
mov word ptr es:,offset int9
mov es:,cs
mov ax,0b800h
mov es,ax
mov ah,"a"
s:mov es:,ah
call delay
inc ah
cmp ah,"z"
jna s
mov ax,0
mov es,ax
push ds:
pop es:
push ds:
pop es:
mov ax,4c00h
int 21h
int9:push ax
push bx
push es
;in al,60h
;pushf
;pushf 在上面显视字母时只要按ESC不就产生中断把IF和TF设为0标志和CS 和IP 入栈吗
;pop bx 此处屏弊为什么字母的颜色只变一下不能多变?
;and bh,11111100b 不是应该每按一下ESC都要进到这里颜色都要变一下吗?
;push bx
;popf
;call dword ptr ds:
;cmp al,1
;jne int9ret
mov ax,0b800h
mov es,ax
inc byte ptr es:
int9ret:pop es
pop bx
pop ax
iret 上面按下ESC标志和CS 和IP 入栈到这里iret出栈不对吗?
delay:push ax 也不知我说的清楚不求大神指点迷津
push dx
mov ax,0
mov dx,1000h
s1:sub ax,1
sbb dx,0
cmp ax,0
jne s1
cmp dx,0
jne s1
pop dx
pop ax
ret
code ends
end start
江编语言?? zltzlt 发表于 2020-1-30 12:33
江编语言??
assume cs:code
stack segment
db 128 dup (0)
stack ends
data segment
dw 0,0
data ends
code segment
start:mov ax,stack
mov ss,ax
mov sp,128
mov ax,data
mov ds,ax
mov ax,0
mov es,ax
push es:
pop ds:
push es:
pop ds:
mov word ptr es:,offset int9
mov es:,cs
mov ax,0b800h
mov es,ax
mov ah,"a"
s:mov es:,ah
call delay
inc ah
cmp ah,"z"
jna s
mov ax,0
mov es,ax
push ds:
pop es:
push ds:
pop es:
mov ax,4c00h
int 21h
int9:push ax
push bx
push es
in al,60h
;pushf
;pushf
;pop bx
;and bh,11111100b
;push bx
;popf 我是想问把加分号的地方屏弊了为什么不能正常显视在进入int9时标志硬件自动保存了IF,TF也设0了CS和IP也入栈了最后用的iretr反回为什么不能正长显视呢
;call dword ptr ds:
cmp al,1
jne int9ret
mov ax,0b800h
mov es,ax
inc byte ptr es:
int9ret:pop es
pop bx
pop ax
iret 上面按下ESC标志和CS 和IP 入栈到这里iret出栈不对吗?
delay:push ax 也不知我说的清楚不求大神指点迷津
push dx
mov ax,0
mov dx,1000h
s1:sub ax,1
sbb dx,0
cmp ax,0
jne s1
cmp dx,0
jne s1
pop dx
pop ax
ret
code ends
end start
{:7_144:}
页:
[1]