0 Members and 1 Guest are viewing this topic.
/* Mod */Info: Performs the operation R1 Mod R2 12 bytes 7 cycles Unsigned Can operate in both processing modes Inline function Registers Destroyed: R1 R2 R3 MACHSH3 Hex: 6133321432150009010A3138
/* Arbitrary precision addition (unsigned) */Info: Performs the unsigned operation R1+R2 30 bytes 12*(# of bytes in operands)+4 cycles Inline function Registers Destroyed: R0 R1 R2 R3 R4 R5 R6 R7 SROther notes: Don't let R2 be greater than R1! R1 and R2 are pointers to the locations of the least significant bytes (highest addresses) of the operands in memory. R3 hold the number of bytes of the operands. If the operands differ in size, zero extend the shorter one. Must be greater than 0. R4 holds a pointer to the least significant byte (highest address) of the output location. The output location must have at most R3+1 bytes available for the answer.SH3 Hex: E000400455106620365E070233008D05246441104210470EAFF406292460
/* Arbitrary precision subtraction (unsigned) */Info: Performs the unsigned operation R1-R2 28 bytes 13*((# of bytes in operands)-1)+9 cycles Inline function Registers Destroyed: R0 R1 R2 R3 R4 R5 R6 R7 SR Other notes: Don't let R2 be greater than R1! R1 and R2 are pointers to the locations of the least significant bytes (highest addresses) of the operands in memory. R3 hold the number of bytes of the operands. If the operands differ in size, zero extend the shorter one. Must be greater than 0. R4 holds a pointer to the least significant byte (highest address) of the output location. The output location must have at most R3+1 bytes available for the answer.SH3 Hex: E000400465106620365A070233008D05246441104210470EAFF47001
/* Linear Congruential Random Number Generator */R1 == R4*R1 mod R3Info: 40 bytes Subroutine, not an inline function. Other info: The routine automatically loads a constant seed. If you would like to seed it yourself, then set the least significant bit of R0 and put the seed in R1. The output is returned in R5. If you call this routine multiple times, then you are responsible for seeding the RNG in R1 with the results of the previous computation from R5.SH3 Hex: 40058F0D73173415D304010A6513335433550009050A3518000B000905F5E101AFF1D10002D63A86
Info: Takes R1, R2, and R3 as arguments[ R1 is y coordinate. R2 is x coordinate $B4000000 is the current pointer to PlotScreen R3 is pointer to location of the sprite 50 bytes Too many cycles to count by handRegisters Destroyed: R0 R1 R2 R3 R4 R5 R6 R7 R8Memory Destroyed:PlotScreenSH3 Hex:D0080017302CD409304CE503E6076736207645108BFBD506308CE50346108BF6000B00090000030000000000B4000000000002FCSH3 ASM:00000000: MOV.L @($08*4+PC),R0 = #0000030000000002: MUL.L R1,R000000004: ADD R2,R000000006: MOV.L @($09*4+PC),R4 = #B400000000000008: ADD R4,R00000000A: MOV $03, R50000000C: MOV $07, R60000000E: MOV.L @R3+,R700000010: MOV.L R7,@-R000000012: DT R500000014: BF $E00000016: MOV.L @($06*4+PC),R5 = #000002FC00000018: ADD R8,R00000001A: MOV $03, R50000001C: DT R60000001E: BF $E00000020: RTS00000022: NOP00000024: .data 00000300 dword ref:000000028: 0000 ?0000002A: 0000 ?0000002C: .data b4000000 dword ref:600000030: .data 000002fc dword ref:16/code]
Hex: D008 0017 D409 000A 302C 304C E503 E607 6736 2075 4510 8B0E D506 E503 8B0E 308C 000B 4610SH3 ASM:MOV.L @($08*4+PC),R0 = #00000300MUL.L R1,R0MOV.L @($09*4+PC),R4 = #B4000000STS MACL, R0ADD R2,R0ADD R4,R0MOV $03, R5MOV $07, R6MOV.L @R3+,R7MOV.L R7,@-R0DT R5BF $EMOV.L @($06*4+PC),R5 = #000002FCMOV $03, R5BF $EADD R8,R0RTSDT R6.data 00000300 dword ref:0.data b4000000 dword ref:6.data 000002fc dword ref:16
for(;P("\n"),R-;P("|"))for(e=C;e-;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);