Hi,
Has anyone successfully got self modifying code to run on a PPC. I've been having a go at it, but keep getting access violations.
Here is a snippet of code that is causing the problems
3402F764 E3833A02 orr r3, r3, #2, 20
3402F768 E1CF31B4 strh r3, [pc, #0x14]
3402F76C E38CC040 orr r12, r12, #0x40
3402F770 E1A00086 mov r0, r6, lsl #1
3402F774 E1A02586 mov r2, r6, lsl #11
3402F778 E1800002 orr r0, r0, r2
3402F77C E1A02B86 mov r2, r6, lsl #23
3402F780 E1800002 orr r0, r0, r2
3402F784 E3A02000 mov r2, #0
The code at #3402f768 is storing a count value to modify the last mov r2,#number.
Due to paging, the PC is set to #0002f768
Anyone have any ideas?
Thanks
Glen.