bootstrap.asm 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ; Author: Frederik Noring <noring@nocrew.org>
  2. ;
  3. ; This file is subject to the terms and conditions of the GNU General Public
  4. ; License. See the file COPYING in the main directory of this archive
  5. ; for more details.
  6. ; DSP56k loader
  7. ; Host Interface
  8. M_BCR EQU $FFFE ; Port A Bus Control Register
  9. M_PBC EQU $FFE0 ; Port B Control Register
  10. M_PBDDR EQU $FFE2 ; Port B Data Direction Register
  11. M_PBD EQU $FFE4 ; Port B Data Register
  12. M_PCC EQU $FFE1 ; Port C Control Register
  13. M_PCDDR EQU $FFE3 ; Port C Data Direction Register
  14. M_PCD EQU $FFE5 ; Port C Data Register
  15. M_HCR EQU $FFE8 ; Host Control Register
  16. M_HSR EQU $FFE9 ; Host Status Register
  17. M_HRX EQU $FFEB ; Host Receive Data Register
  18. M_HTX EQU $FFEB ; Host Transmit Data Register
  19. ; SSI, Synchronous Serial Interface
  20. M_RX EQU $FFEF ; Serial Receive Data Register
  21. M_TX EQU $FFEF ; Serial Transmit Data Register
  22. M_CRA EQU $FFEC ; SSI Control Register A
  23. M_CRB EQU $FFED ; SSI Control Register B
  24. M_SR EQU $FFEE ; SSI Status Register
  25. M_TSR EQU $FFEE ; SSI Time Slot Register
  26. ; Exception Processing
  27. M_IPR EQU $FFFF ; Interrupt Priority Register
  28. org P:$0
  29. start jmp <$40
  30. org P:$40
  31. ; ; Zero 16384 DSP X and Y words
  32. ; clr A #0,r0
  33. ; clr B #0,r4
  34. ; do #64,<_block1
  35. ; rep #256
  36. ; move A,X:(r0)+ B,Y:(r4)+
  37. ;_block1 ; Zero (32768-512) Program words
  38. ; clr A #512,r0
  39. ; do #126,<_block2
  40. ; rep #256
  41. ; move A,P:(r0)+
  42. ;_block2
  43. ; Copy DSP program control
  44. move #real,r0
  45. move #upload,r1
  46. do #upload_end-upload,_copy
  47. movem P:(r0)+,x0
  48. movem x0,P:(r1)+
  49. _copy movep #4,X:<<M_HCR
  50. movep #$c00,X:<<M_IPR
  51. and #<$fe,mr
  52. jmp upload
  53. real
  54. org P:$7ea9
  55. upload
  56. movep #1,X:<<M_PBC
  57. movep #0,X:<<M_BCR
  58. next jclr #0,X:<<M_HSR,*
  59. movep X:<<M_HRX,A
  60. move #>3,x0
  61. cmp x0,A #>1,x0
  62. jeq <$0
  63. _get_address
  64. jclr #0,X:<<M_HSR,_get_address
  65. movep X:<<M_HRX,r0
  66. _get_length
  67. jclr #0,X:<<M_HSR,_get_length
  68. movep X:<<M_HRX,y0
  69. cmp x0,A #>2,x0
  70. jeq load_X
  71. cmp x0,A
  72. jeq load_Y
  73. load_P do y0,_load_P
  74. jclr #0,X:<<M_HSR,*
  75. movep X:<<M_HRX,P:(r0)+
  76. _load_P jmp next
  77. load_X do y0,_load_X
  78. jclr #0,X:<<M_HSR,*
  79. movep X:<<M_HRX,X:(r0)+
  80. _load_X jmp next
  81. load_Y do y0,_load_Y
  82. jclr #0,X:<<M_HSR,*
  83. movep X:<<M_HRX,Y:(r0)+
  84. _load_Y jmp next
  85. upload_end
  86. end