News of Cyclone, seems there is an issue (which has been temporarily patched by the Zodiac guys) on PalmOS.
r4-r11 in the ARM docs are meant to be preserved across function calls, and Cyclone used this fact to do stuff like this:
;@ ----------  ori.b #$33, (a0) uses Op0010 ----------
;@ EaCalc : Get '#$33' into r10:
ldrsb r10,[r4],#2 ;@ Fetch immediate value
;@ EaRead : Read '#$33' (address in r10) into r10:
mov r10,r10,asl #24
;@ EaCalc : Get '(a0)' into r11:
mov r2,r2,lsl #2
orr r2,r2,#0x20 ;@ A0-7
;@ EaRead : Read '(a0)' (address in r11) into r0:
ldr pc,[r7,#0x68] ;@ Call read8(r0) handler
mov r0,r0,asl #24
;@ Do arithmetic:
adds r1,r1,#0 ;@ Defines NZ, clears CV
mrs r9,cpsr ;@ r9=flags
However it seems PalmOS expects r10 to be a pointer to global data, and r9 is used for PalmOS calls. r9 isn't a big problem since memory handler won't use PalmOS calls hopefully.
But r10 it seems I can't use for Cyclone on PalmOS. Will have to have a rethink! I think the temporary fix is to use r12 on the Zodiac.
Just to let everyone know in case anyone is ARMing any chips! Dammit why did Sony have to go for another MIPS - ARMs are cool!
Ah - I have a cunning plan, r8 is used for the opcode BUT that's a slight waste of a permanent register - it doesn't really need to be, if I'm careful I could use r3 or maybe r12. And it's only used at the start of a function. I just have to make sure I don't use the opcode register r3/r12 after a handler has been called
Thus I might be able to use r8 instead of r10 with a bit of tweaking.
You learn something old everyday...