一個編寫程式的問題?請多多指教

tocnc111 2008-11-11 04:12:23
在書上看到一個問題
題目如下: 讀取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
...全文
74 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
tocnc111 2008-11-11
  • 打赏
  • 举报
回复
請問如果今天讀到的irq=17
相對應得Interrupt Vector Table是44h(0004:0004是這樣嗎?=44h)
通过地址访问对应的程式。這是如何實現的呢?
透過CFC CF8還是其他的呢?

感謝您的指導
masterkill 2008-11-11
  • 打赏
  • 举报
回复
这个东西应该是问的关于PCI Device和Routing Table的连接问题
每个PCI Device有4个pin,通过对其command决定使用那根pin,然后出来接到INTRx,3Ch能读出IRQ,对应的CS:IP应该是Interrupt Table指向的中断服务程式。比如说现在通过INTR0发出一个IRQ,到达CPU后返回,然后去查找终端服务程式,表项好像是4个BYTE,前两个是CS,后两个是IP,CS:IP指定了地址,通过地址访问对应的程式。

21,500

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧