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 / PROGRAMS / WSTAR / SAVESTAR.LBR / SAVEWS.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  2KB  |  115 lines

  1. ;    SAVESTAR.ASM by David Weinberger   cf Profile Feb 1986  p. 48-54
  2. ;
  3.     boot    equ    0000h
  4.     bdos    equ     0005h
  5.     deletef equ    19
  6.     makef    equ    22
  7.     writef  equ    21
  8.     closef  equ      16
  9.     ctrlZ    equ    1AH
  10.     endfill equ    0000H
  11.     FFfill  equ    00FFH
  12.     prnt    equ    9
  13.     cr    equ    13
  14.     lf    equ    10
  15.     memax    equ    00ECH
  16. ;    
  17. ;    Where text is stored in various programs: choose ONE
  18. ;        cf Profile Feb 86 for more info
  19. ;
  20.     BEGTEXT    equ    846DH    ;WS v. 3.3
  21. ;    BEGTEXT    equ    802CH    ;TURBO V. 2 with error msg.s
  22. ;    GEBTEXT equ    7474h    ;Turbo v. 2 without error msg.s
  23. ;
  24.     org    100h
  25.     lxi    sp,stack
  26. ;
  27.     lxi     d,sinon
  28.     mvi    c,prnt
  29.     call     bdos
  30. ;
  31.     lxi    d,tfcb
  32.     mvi    c,deletef
  33.     call    bdos
  34. ;
  35.     lxi    d,tfcb
  36.     mvi    c,makef
  37.     call    bdos
  38. ;
  39.     cpi    0FFh
  40.     jz    fuldir
  41. ;
  42.     lxi    h,begtext
  43. mspot:    push    h
  44. ;
  45.     xchg
  46.     mvi    c,1AH
  47.     call    bdos
  48. ;
  49.     lxi    d,tfcb
  50.     mvi    c,writef
  51.     call     bdos
  52. ;
  53.     cpi    0
  54.     jnz    filled
  55. ;
  56.     pop    h
  57.     mvi    a,memax
  58.     cmp    h
  59.     jz    finis
  60. ;
  61.     lxi    d,127
  62.     dad    d
  63.     mov    a,m
  64. ;
  65.     cpi    ctrlz
  66.     jz    finis
  67.     cpi    endfill
  68.     jz    finis
  69.     cpi    FFfill
  70.     jz    finis
  71. ;
  72.     inx    h
  73.     jmp    mspot
  74. ;
  75. FINIS:    lxi    d,donemsg
  76.     mvi    c,prnt
  77.     call    bdos
  78. ;
  79. clsf:    lxi    d,tfcb
  80.     mvi    c,closef
  81.     call     bdos
  82.     mvi    c,boot
  83.     call    bdos
  84. ;
  85. filled: lxi    d,fulldsk
  86.     mvi    c,prnt
  87.     call    bdos
  88. ;
  89.     jmp    clsf
  90. ;
  91. fuldir:    lxi    d,fuldr
  92.     mvi    c,prnt
  93.     call    bdos
  94. ;
  95.     mvi    c,boot
  96.     call    bdos
  97. ;
  98. ; MESSAGES:
  99. ;
  100. sinon    db    'SAVESTAR  mini-version for WS3.3$'
  101. donemsg db    cr,lf,'==> Saved text written to B:-SAVED$'
  102. fulldsk    db    7,'++ Disk Full.  Erase a file or use a new disk.'
  103.      db    ' Try again ++',cr,lf,'$'
  104. fuldr    db    7,'++ Directory Full.  Erase a file or use new disk.'
  105.     db    ' Try again ++',cr,lf,'$'
  106. ;  the 2 in tfcb causes -SAVED to be put on drive B:
  107. ;    1 would put it on A: and 0 for whichever drive your logged on.
  108. tfcb    db    2,'-SAVED     ',0,0,0,0,0,0,0,0,0,0,0,0,0,0
  109.     db    0,0,0,0,0,0,0,0,0,0,0,0
  110.     ds    64
  111. stack    db    0
  112. ;
  113.     end    your logged on.
  114. tfcb    db    2,'-SAVED     ',0,0,0,0,0,0,0,0,0,0,0,0,0,0
  115.     db    0,0,0,0,0,0,0,0,0,