home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / BDOS / DOSPLSOR.ARK / TESTDOS.MAC < prev    next >
Text File  |  1986-12-06  |  3KB  |  105 lines

  1. ;
  2. reboot    equ    0;        std. bios/warmboot connector
  3. @bdos    equ    reboot+6;    std. bdos connector
  4. ;
  5. ; For testing DOS+ system.  Loaded ahead of system to lock in.
  6. ; Files to link:
  7. ;  /a:7700        (puts test dos at 8000 up, ccp at 7800)
  8. ; or
  9. ;  /a:ba00        (max, when DEBUG under existing DOS)
  10. ;    This            (puts DOS+ @ C300 up, ccp @ bb00)
  11. ;    ccp+
  12. ;    dos+        (under test)
  13. ; /p:f600        (use existing bios, my system)
  14. ;    dos+bios    (use existing bios)
  15. ;
  16. ; Install with DDTZ by:
  17. ;    DDTZ    testdos.cim    (assumes SLR linker makes .CIM)
  18. ;    -g100
  19. ; Note that DDTZ, on initialization, locks itself to the existing DOS,
  20. ; independant of further changes in the connector at 1.  It can then
  21. ; be re-entered by "GODDT" where GODDT holds only a RST 7 instruction.
  22. ; If further operations in DDT use only device i/o (i.e. no loading or
  23. ; storing of files) TESTDOS system can then be debugged.
  24. ;
  25. ;
  26. ; -----------------------------------------
  27. ;
  28. ; The following "lock-in" mechanism intercepts the BDOS call vector,
  29. ; and protects the system from being over-written.
  30. ;
  31. begin:    jmp    moveup;        Patched on init
  32.     jmp    remove;        Used to kill. At @bdos^+3
  33. ;
  34. ; This routine simulates the disk reset actions of a normal
  35. ; reboot.  Note that some poor bios implementations do not
  36. ; reset disks properly (original Kaypro) and thus cannot 
  37. ; change disk formats without a real reboot or cold load.
  38. doboot:    lxi    h,begin;    refresh the connectors
  39.     shld    @bdos
  40. boot0:    lxi    h,$-$;        patched at init
  41.     shld    reboot+1
  42.     lda    reboot+4
  43.     mov    c,a
  44.     jmp    ccpwarm
  45. ;
  46. ; Remove the locked in system
  47. remove:    lxi    h,$-$;        patched at init
  48. oldbt    equ    $-2
  49.     xchg
  50.     lhld    reboot+1
  51.     inx    h
  52.     mov    m,e
  53.     inx    h
  54.     mov    m,d;        restore entry version
  55.     lxi    h,$-$;        patched at init
  56. oldos    equ    $-2
  57.     shld    @bdos
  58.     jmp    reboot
  59. ;
  60. ; The following space may be re-used after system is running.
  61. init:    lxi    h,sysfnc
  62.     shld    begin+1;    fix the intercept
  63.     lhld    @bdos
  64.     shld    oldos;        save old value
  65.     lxi    h,begin
  66.     shld    @bdos;        and hook up
  67.     lhld    reboot+1
  68.     shld    boot0+1
  69.     lxi    d,doboot
  70.     inx    h
  71.     mov    a,m
  72.     mov    m,e
  73.     mov    e,a
  74.     inx    h
  75.     mov    a,m
  76.     mov    m,d;        Patch bios reboot entry
  77.     mov    d,a
  78.     xchg
  79.     shld    oldbt
  80.     lda    reboot+4
  81.     mov    c,a
  82.     jmp    ccpcold
  83. ;
  84.     .phase    ($-begin) + 0100h
  85. moveup:
  86.     lxi    d,begin
  87.     lxi    h,0100h
  88.     lxi    b,1700h;    wired in system size
  89. mv:    mov    a,m
  90.     stax    d
  91.     inx    h
  92.     inx    d
  93.     dcx    b
  94.     mov    a,b
  95.     ora    c
  96.     jnz    mv
  97.     .dephase
  98.     jmp    init;        Goes to moved code
  99. ;
  100.     ds    0100h - ($-begin),0
  101. ccpcold    equ    $;        describe CCP
  102. ccpwarm    equ    $+3
  103. sysfnc    equ    $+0806h;    DOS+ entry
  104.     end
  105. GÆ