Self Modifying Code in PMode? 
Author Message
 Self Modifying Code in PMode?

Hello All,

Can anybody out there give me some help?? ;) I'm trying to write
the VESA bios into the code segment so I can execute the supplied
page flipping code etc without having to go through interrupts.
What I have done is basically reserved 512 bytes in the code
segment to copy to. I then copy the VESA functions from the bios
into dos low memory. Then I set up an alias descriptor to the
code segment which _should_ allow me to write into the code
segment using this alias descriptor. However, whenever I attempt
to put something into the alias descriptor I get an exceptions.
Some example code is below.

Any help would be greatly appreciated.




pm_code             dw  512 dup (?)


; I have copied my VESA info into a data selector
; Get Alias selector for CS

    mov     ax, 000ah
    mov     bx, cs
    int     31h
    jc      PMError

; ax now hold the selector

    lar     bx, ax    ; Load Access writes, gives Data/Write Ok
    verw    ax        ; Verify Write. Gives zf=1 Ok

    push gs
    mov  gs, ax       ; Our Alias Segment
    lea  ax, [pm_code]; Offset to reserved area for pm code
    mov  [WORD PTR gs:[ax]], ffh ; <-- CRASH- Exception

* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

Tue, 06 Aug 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Self Modifying Code

2. self modifying code in J

3. "Self modifying" code

4. Languages for self-modifying code

5. Languages for self-modifying code

6. i-net page on self-modified code

7. Languages for self-modifying code

8. Languages for self-modifying code

9. More About Self-Modifying Code

10. Self Modifying Code

11. Self-Modifying code

12. Languages for self-modifying code


Powered by phpBB® Forum Software