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.

56 lines
1.5KB

  1. 0xff00 CONSTANT RS_ADDR
  2. 0xfffa CONSTANT PS_ADDR
  3. RS_ADDR 0x80 - CONSTANT RAMSTART
  4. 750 LOAD ( 8086 asm )
  5. 262 LOAD ( xcomp )
  6. 270 LOAD ( xcomp overrides )
  7. 812 829 LOADR
  8. 353 LOAD ( xcomp core low )
  9. CODE (emit) 1 chkPS,
  10. AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
  11. ;CODE
  12. CODE (key)
  13. AH AH XORrr, 0x16 INT, AH AH XORrr, AX PUSHx,
  14. ;CODE
  15. CODE 13H08H ( driveno -- cx )
  16. DI POPx, DX PUSHx, ( protect ) DX DI MOVxx, AX 0x800 MOVxI,
  17. DI DI XORxx, ES DI MOVsx,
  18. 0x13 INT, DX POPx, ( unprotect ) CX PUSHx,
  19. DI 0x800 MOVxI, ES DI MOVsx,
  20. ;CODE
  21. CODE 13H ( ax bx cx dx -- ax bx cx dx )
  22. SI POPx, ( DX ) CX POPx, BX POPx, AX POPx,
  23. DX PUSHx, ( protect ) DX SI MOVxx, DI DI XORxx,
  24. 0x13 INT, SI DX MOVxx, DX POPx, ( unprotect )
  25. AX PUSHx, BX PUSHx, CX PUSHx, SI PUSHx,
  26. ;CODE
  27. : FDSPT 0x70 RAM+ ;
  28. : _ ( dest secno )
  29. ( AH=read sectors, AL=1 sector, BX=dest,
  30. CH=trackno CL=secno DH=head DL=drive )
  31. 0x0201 ROT ROT ( AX BX sec )
  32. FDSPT @ /MOD ( AX BX sec trk )
  33. 2 /MOD ( AX BX sec head trk )
  34. 8 LSHIFT ROT OR 1+ ( AX BX head CX )
  35. SWAP 8 LSHIFT 0x03 C@ ( boot drive ) OR ( AX BX CX DX )
  36. 13H 2DROP 2DROP
  37. ;
  38. : FD@
  39. 2 * 16 + ( blkfs starts at sector 16 )
  40. BLK( OVER _ BLK( 0x200 + SWAP 1+ _ ;
  41. : FD! DROP ;
  42. : FD$
  43. ( get number of sectors per track with command 08H. )
  44. 0x03 ( boot drive ) C@ 13H08H 0x3f AND FDSPT !
  45. ;
  46. 380 LOAD ( xcomp core high )
  47. (entry) _
  48. ( Update LATEST )
  49. PC ORG @ 8 + !
  50. ," BLK$ FD$ "
  51. ," ' FD@ BLK@* ! "
  52. ," ' FD! BLK!* ! "
  53. EOT,
  54. ORG @ 256 /MOD 2 PC! 2 PC!
  55. H@ 256 /MOD 2 PC! 2 PC!