Guest User

Untitled

a guest
May 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. # not-incredibly-bloated exi code copied from kenobiwii.s (which is for PPC).
  2. # If I use this code with the custom ios toolkit (i.e. from c: exisendbuf(4, "hello")), it randomly either works or sends crap to the gecko.
  3. # The old thumb version was a lot more reliable, for some reason. Maybe just because it was slower? that doesn't really make sense
  4. .globl _main
  5. .arm
  6. _main:
  7. exisendbuf:
  8. cmp r0, #4
  9. bxne lr
  10. mov r3, r1
  11. # r3 is the string...
  12. loop:
  13. ldrb r0, [r3] ;# ldrsb doesn't do what I think
  14. add r3, r3, #1 ;# but this could be a postindex
  15. cmp r0, #0
  16. bxeq lr
  17. exisendbyte:
  18. # r0 should be the byte.
  19. # r0..r2 get clobbered
  20. mov r2, #0xB0000000
  21. orr r2, r2, r0, LSL #20
  22. # r2 is now 0xB0000000 + (sendbyte<<20)
  23. mov r1, #0x0d000000 ;# s/d0/d8 fails, but according to Starlet_Memory_Map it should be the same
  24. add r1, r1, #0x6800
  25. # r1 is 0x0d006800
  26. mov r0, #0xd0
  27. str r0, [r1, #0x14]
  28. str r2, [r1, #0x24]
  29. mov r0, #0x19
  30. str r0, [r1, #0x20]
  31. exicheckreceivewait:
  32. ldr r0, [r1, #0x20]
  33. and r0, r0, #1
  34. cmp r0, #0
  35. bne exicheckreceivewait
  36.  
  37. ldr r2, [r1, #0x24]
  38. str r0, [r1, #0x14]
  39. lsl r2, r2, #26 ;#did it work?
  40. and r0, r2, #1
  41. b loop
Add Comment
Please, Sign In to add comment