Mario Isidoro

MCF5206 privilege violation

Discussion created by Mario Isidoro on Nov 22, 2007
Latest reply on Nov 24, 2007 by Mario Isidoro
Hi

I've encontered a strange problem when trying to change privilege level on a MCF5206e
Using the simple code below:

Code:
  move.l   #PROCESS_STACK_TOP,d0 //PROCESS_STACK_TOP points to ram
     //full read,write and execute permissions
  move.l   d0,SP
  move.l   #0x00002700,d0
  move     d0,SR
  jsr      test
  move.l   #0x00000700,d0
  move.w   d0,SR   //after the execution of the move.w
  move.l   #1,d0   //all instructions generate a privilege
  move.l   #1,d1   //violation
  add.l    d1,d0
  jsr      test
  trap     #15

test:
    rts
I'm not sure why this is happening, but the most likely awnser is that I'm forgeting something.
Can any one help me?

Thanks

Mário Isidoro
 


Outcomes