cr_test.ds 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. incdir "tests"
  2. include "dsp_base.inc"
  3. ; Tests the behavior of SI, SRS, and LRS when CR is changed
  4. ; Register that is writable but with contents that doesn't matter (COEF_A1_0)
  5. TEST_REG: equ 0xFFA0 ; 0xFF00 (not writable)
  6. ; This is separate because SRS and SI currently require value 0..7f or ff80..ffff,
  7. ; though the actual behavior doesn't match that
  8. TEST_ADDR: equ 0xFFA0 ; 0x0000
  9. ; Memory addresses
  10. TEST_MEM: equ 0x00A0 ; 0x0000
  11. TEST_MEM_2: equ 0x01A0 ; 0x0100
  12. test_main:
  13. LRI $AC0.L, #0xf00f
  14. SR @TEST_REG, $AC0.L
  15. SR @TEST_MEM, $AC0.L
  16. SR @TEST_MEM_2, $AC0.L
  17. CALL send_regs
  18. ; Observed: writes to TEST_REG
  19. SI @TEST_ADDR, #0xf11f
  20. CALL send_regs
  21. LRI $AC0.L, #0xf22f
  22. ; Observed: writes to TEST_REG
  23. SRS @TEST_ADDR, $AC0.L
  24. CALL send_regs
  25. LRI $CR, #0x0000
  26. ; Observed: still writes to TEST_REG
  27. SI @TEST_ADDR, #0xf33f
  28. CALL send_regs
  29. LRI $AC0.L, #0xf44f
  30. ; Observed: writes to TEST_MEM
  31. SRS @TEST_ADDR, $AC0.L
  32. CALL send_regs
  33. LRI $CR, #0x0001
  34. ; Observed: still writes to TEST_REG
  35. SI @TEST_ADDR, #0xf55f
  36. CALL send_regs
  37. LRI $AC0.L, #0xf66f
  38. ; Observed: writes to TEST_MEM_2
  39. SRS @TEST_ADDR, $AC0.L
  40. CALL send_regs
  41. ; At this point, TEST_REG should be f55f, TEST_MEM should be f44f,
  42. ; and TEST_MEM_2 should be f66f. Test the behavior of LRS.
  43. ; Changes to prod.l are for display only.
  44. LRI $CR, #0x00ff
  45. LRI $prod.l, #0xf55f
  46. LRS $AC0.L, @TEST_ADDR
  47. CALL send_regs
  48. LRI $CR, #0x0000
  49. LRI $prod.l, #0xf44f
  50. LRS $AC0.L, @TEST_ADDR
  51. CALL send_regs
  52. LRI $CR, #0x0001
  53. LRI $prod.l, #0xf66f
  54. LRS $AC0.L, @TEST_ADDR
  55. CALL send_regs
  56. ; We're done, DO NOT DELETE THIS LINE
  57. JMP end_of_test
  58. send_regs:
  59. ; For display purposes only
  60. LRI $prod.m1, #TEST_REG
  61. LRI $prod.h, #TEST_MEM
  62. LRI $prod.m2, #TEST_MEM_2
  63. ; Actual registers
  64. LR $AC1.L, @TEST_REG
  65. LR $AC0.M, @TEST_MEM
  66. LR $AC1.M, @TEST_MEM_2
  67. CALL send_back
  68. RET