Advertisement
NewDenverCity

daily events (commented)

Dec 21st, 2015
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. .thumb
  2. @x800D is the argument, is the var to use. this uses two vars, in sucession.
  3.  
  4. start:
  5. push {r4-r5, lr}
  6. get_decrypt_var:
  7. ldr r0, last_result
  8. ldrh r0, [r0] @var number is in r0
  9. add r1, r0, #0x1 @gets second var for month/day
  10. push {r1} @second var number stored for later
  11. ldr r1, decrypt_var
  12. bl call_with_r1 @r0 now holds the offset of the first var
  13. mov r4, r0 @r4 holds a copy of that offset
  14. pop {r0} @second var in r0
  15. ldr r1, decrypt_var
  16. bl call_with_r1
  17. mov r5, r0 @r4 holds year offset, r5 holds month/day offset
  18. ldr r2, clock
  19. year_check:
  20. ldrh r0, [r4] @r0 holds the last checked year
  21. ldrh r1, [r2] @r1 holds the current year
  22. cmp r0, r1
  23. bcc checked_yesterday @if last checked year is lower than current, jumps
  24. month_check:
  25. ldrb r0, [r5, #0x1] @r0 now holds the last checked month
  26. ldrb r1, [r2, #0x3] @r1 holds current month
  27. cmp r0, r1
  28. bcc checked_yesterday
  29. day_check:
  30. ldrb r0, [r5]
  31. ldrb r1, [r2, #0x4]
  32. cmp r0, r1
  33. bcc checked_yesterday
  34. checked_today:
  35. ldr r0, last_result
  36. mov r1, #0x0
  37. strh r1, [r0]
  38. pop {r4-r5, pc}
  39. checked_yesterday:
  40. @r2 holds the rtc, r4 holds the offset for the year, r5 holds the offset for the month/day
  41. ldrh r0, [r2]
  42. strh r0, [r4] @the current year gets stored
  43. add r2, r2, #0x3
  44. ldrh r0, [r2]
  45. strh r0, [r5]
  46. ldr r0, last_result
  47. mov r1, #0x1
  48. strh r1, [r0]
  49. pop {r4-r5, pc}
  50.  
  51. call_with_r1:
  52. bx r1
  53.  
  54. .align 2
  55. last_result: .word 0x020370D0
  56. decrypt_var: .word 0x0806E454 + 1
  57. clock: .word 0x0300553C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement