Re: A92: Divide by Zero Trap


[Prev][Next][Index][Thread]

Re: A92: Divide by Zero Trap




>Hey all,
>
>I have some code that forces a divide by zero, apparently to allow you to
>fix the denominator.  Here is the best I can come up with to change the
>vector for the Divide By Zero error:
>
>...
>    move.l    $14,olddivbyzero            ; Store old vector
>    bclr.b    #2,$600001                  ; Unprotect memory
>    move.l    #_divbyzero,$14             ; Change vector
>    bset.b    #2,$600001                  ; Protect memory
>...
>
>...
>    bclr.b    #2,$600001                  ; Unprotect memory
>    move.l    olddivbyzero(pc),$14        ; Restore old vector
>    bset.b    #2,$600001                  ; Protect memory
>...
>
>...
>_divbyzero:
>    ; ERROR HANDLE
>    rte
>...
>
>...
>olddivbyzero    dc.l    0
>...
>
>This code produces an Illegal Instruction (along with other stuff around
>it).  What am I doing wrong?

	I don't see in this code what could be wrong. Maybe is the error in an
other part of the program, you should see it with the debugger DB92.



Xavier VASSOR
---The Doors Team
doors@mail.dotcom.fr
http://doorshome.home.ml.org
ICQ:10241721


References: