flat assembler
Message board for the users of flat assembler.

Index > Main > Trap Flag (single step exception)

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji
Quote:

INTEL 3A/2.3

... If an application program sets the TF flag using a POPF, POPFD, or IRET instruction,
a debug exception is generated after the instruction that follows the POPF, POPFD, or IRET

false, not in all cases.
Code:
            mov     ebx,dr7
             bts     ebx,13
              mov     dr7,ebx
             pushfd
              bts     dword[esp],8
                popfd
                       ;--(abc)--> here (single step exception)
         mov     eax,dr6
                     ;---------> NOT here

;stack at "abc"
;--------------
;        flags
;      cs
; eip -----> mov eax,dr6

;my_handler (dr6=0xFFFF6FF0)
;iret  (back to "mov eax,dr6")

;and only AFTER that ... debug register access exception.
    
In this case, the "single step exception" is triggered before
the instruction that follows the "popfd", not after.

I looked everywhere in the Intel manuals,
I found nothing about this particular case.
However, I checked it myself, and it works exactly like that.


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 21 May 2011, 19:12
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.