flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 14 Dec 2018, 16:35
I think the best place to see how the x86 debug registers are used is in the official Intel and AMD documents.
|
|||
![]() |
|
Fulgurance 15 Dec 2018, 13:28
I just use Intel. I have search on Intel Book, i have found section about Debug Register, but i don't understand when this register are writting by processor and how.
How i use this interrupt? It's not very clear https://software.intel.com/sites/default/files/managed/a4/60/325384-sdm-vol-3abcd.pdf Is it with stack only ? I don't understand very well |
|||
![]() |
|
revolution 15 Dec 2018, 14:20
You can use the MOV instruction read and write the debug registers.
Code: mov dr0,eax mov ebx,dr1 |
|||
![]() |
|
Fulgurance 15 Dec 2018, 17:32
Okay. And how I interpret value of this register ? And when ?
|
|||
![]() |
|
revolution 16 Dec 2018, 00:55
The layout of DR0..7 is quite complicated. Some registers enable various features with bit settings, and others hold linear breakpoint addresses.
Your code would write to the registers and the CPU will fault/trap when all the conditions are met. Then you catch the fault/trap with the normal exception mechanisms in your OS and show the user a breakpoint was reached. |
|||
![]() |
|
Fulgurance 17 Dec 2018, 10:09
No example ?
![]() Without example, it's quite difficult, this fonction isn't very documented... |
|||
![]() |
|
revolution 17 Dec 2018, 10:33
I assume you are writing your own OS based upon the forum you selected. So any example will rely upon how your OS works when exceptions happen, and how you interface with applications to allow setting the DR registers.
At the CPU level it is just a matter of setting the registers and waiting for the triggers to fire. Everything else is handled by the OS/debugger/application code. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.