Guest User

Untitled

a guest
Jul 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. void Task_Init() {
  2. // AX operates in this context all the time
  3. // 0010 1302 sbset #0x02
  4. // 0011 1303 sbset #0x03
  5. // 0012 1204 sbclr #0x04
  6. // 0013 1305 sbset #0x05
  7. // 0014 1306 sbset #0x06
  8. // 0015 8e00 set16
  9. // 0016 8c00 clr15
  10. // 0017 8b00 m0
  11. // 0018 0092 00ff lri $CR, #0x00ff
  12.  
  13. // 001a 8100 clr $ACC0
  14. // 001b 8900 clr $ACC1
  15. // 001c 009e 0e80 lri $AC0.M, #0x0e80
  16. // 001e 00fe 0e1b sr @0x0e1b, $AC0.M
  17. // 0020 8100 clr $ACC0
  18. // 0021 00fe 0e31 sr @0x0e31, $AC0.M
  19. ACC0 = ACC1 = 0
  20. *0x0e1b = 0xe80
  21. *0x0e31 = 0
  22.  
  23. // Send DSP_INIT mail
  24. // 0023 16fc dcd1 si @DMBH, #0xdcd1
  25. // 0025 16fd 0000 si @DMBL, #0x0000
  26. // 0027 16fb 0001 si @DIRQ, #0x0001
  27. DMB = 0xdcd10000
  28. // 0029 26fc lrs $AC0.M, @DMBH
  29. // 002a 02a0 8000 andf $AC0.M, #0x8000
  30. // 002c 029c 0029 jlnz 0x0029
  31. while (DMBH & 0x8000 != 0);
  32.  
  33. // 002e 029f 0045 jmp 0x0045
  34. goto GetNextCommand;
  35. }
  36.  
  37. void Task_Resume() {
  38. // Ensure sane context
  39. // 0030 1302 sbset #0x02
  40. // 0031 1303 sbset #0x03
  41. // 0032 1204 sbclr #0x04
  42. // 0033 1305 sbset #0x05
  43. // 0034 1306 sbset #0x06
  44. // 0035 8e00 set16
  45. // 0036 8c00 clr15
  46. // 0037 8b00 m0
  47. // 0038 0092 00ff lri $CR, #0x00ff
  48.  
  49. // Send DSP_RESUME mail
  50. // 003a 16fc dcd1 si @DMBH, #0xdcd1
  51. // 003c 16fd 0001 si @DMBL, #0x0001
  52. // 003e 16fb 0001 si @DIRQ, #0x0001
  53. DMB = 0xdcd10001
  54. // 0040 26fc lrs $AC0.M, @DMBH
  55. // 0041 02a0 8000 andf $AC0.M, #0x8000
  56. // 0043 029c 0040 jlnz 0x0040
  57. while (@DMBH & 0x8000 != 0);
  58.  
  59. GetNextCommand:
Add Comment
Please, Sign In to add comment