一個編寫程式的問題?請多多指教
在書上看到一個問題
題目如下: 讀取bus=0,device=30,function=0
IRQ是多少,對應的CS:IP是多少,怎麼JMP到interrupt rotting是多少?
我知道IRQ是3Ch,CS:IP這是怎麼寫呢?分別左移右移2and4bit可以實現嗎?
JMP到interrupt rotting這是怎麼線的呢?
我shr後只能讀到ip=0F03 不是正確的F03C
以下是我的code請多多指教
.model small
.386
.stack
.data
a_table DB '0123456789ABCDEF'
ven db 0dh,0ah,'plz look dev30:','$'
IP1 db 0dh,0ah,'IP:','$'
CS1 db 0dh,0ah,'CS:','$'
.code
.startup
pushad
mov ax, @data
mov ds, ax
mov dx,offset ven
call chang
mov dx,0cf8h
mov eax,8000F03ch ;bus=0 dev=3c fun=0,offset=3c
out dx,eax
mov dx,0cfch
in ax, dx
jmp $+2
call hexput
jmp $+2
mov dx,offset IP1
call chang
mov eax,8000F03Ch
mov cl,2
shr eax,cl
call hexput
mov eax,8000F03Ch
mov cl,4
shr eax,cl
call hexput
j:
mov ah,4ch
int 21h
;------------------------------------------------
hexput:
push bx
push cx
push dx
push ax
mov bx,OFFSET a_table
mov cl,04h
shr al,cl
xlatb
mov dl,al
mov ah,02h
int 21h
pop ax
push ax
and al,00001111b
xlatb
mov dl,al
mov ah,02h
int 21h
pop ax
pop dx
pop cx
pop bx
ret
;--------------------------------------
chang:
mov ah,09h ;字串
int 21h
ret
;--------------------------------------
;--------------------------------------
;--------------------------------------
.stack
.exit
end