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.

43 lines
1.1KB

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