Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2KB

  1. 0xff00 CONSTANT RS_ADDR 0xfffa CONSTANT PS_ADDR
  2. RS_ADDR 0xa0 - CONSTANT SYSVARS
  3. 0 CONSTANT HERESTART
  4. 5 LOAD ( z80 assembler )
  5. 262 LOAD ( xcomp )
  6. 282 LOAD ( boot.z80.decl )
  7. 270 LOAD ( xcomp overrides )
  8. 283 335 LOADR ( boot.z80 )
  9. 353 LOAD ( xcomp core low )
  10. CODE (emit)
  11. A 1 LDri, 1 OUTiA, HL POP, A L LDrr, 0 OUTiA,
  12. ;CODE
  13. CODE (key?) ( TODO: make non-blocking )
  14. BEGIN, 1 INAi, A INCr, JRZ, AGAIN,
  15. A DECr, PUSHA, PUSH1,
  16. ;CODE
  17. : _sel ( sec )
  18. ( 32 sectors per track, 512 tracks per disk )
  19. 32 /MOD ( addr sec trk )
  20. 0x0a ( seltrk ) 1 PC! 0 PC! 0 0 PC! ( addr sec )
  21. 0x0b ( selsec ) 1 PC! 0 PC! ( addr ) ;
  22. : _ ( addr )
  23. ( get 512 bytes )
  24. 0x86 ( readsec ) 1 PC!
  25. 512 0 DO 0 PC@ SWAP C!+ LOOP DROP
  26. ;
  27. : FD@ 2 * DUP _sel BLK( _ 1+ _sel BLK( 512 + _ ;
  28. : _ ( addr )
  29. ( write 512 bytes )
  30. 0x0c ( writesec ) 1 PC!
  31. 512 0 DO C@+ 0 PC! LOOP DROP
  32. ;
  33. : FD! 2 * DUP _sel BLK( _ 1+ _sel BLK( 512 + _ ;
  34. : FD$ ( select disk 0 )
  35. 0x09 ( seldisk ) 1 PC! 0 0 PC! ( sel disk 0 )
  36. ;
  37. 390 LOAD ( xcomp core high )
  38. (entry) _
  39. ( Update LATEST )
  40. PC ORG @ 8 + !
  41. ," BLK$ FD$ ' FD@ ' BLK@* **! ' FD! ' BLK!* **! " EOT,
  42. ORG @ |M 2 PC! 2 PC!
  43. H@ |M 2 PC! 2 PC!