home *** CD-ROM | disk | FTP | other *** search
/ norge.freeshell.org (192.94.73.8) / 192.94.73.8.tar / 192.94.73.8 / pub / computers / cpm / alphatronic / DRIPAK.ZIP / CPM_3-0 / SOURCES / SAVE.ASM < prev    next >
Assembly Source File  |  1982-12-31  |  14KB  |  805 lines

  1.     title    'SAVE.RSX - CP/M 3.0 save routine.  July 1982'
  2. ;    *************************************************
  3. ;    *
  4. ;    *    Title:    SAVE.RSX    Resident System eXtension       
  5. ;    *    Date:    7/28/82
  6. ;    *    Author:    Thomas J. Mason
  7. ;    *
  8. ;    *    Modified:
  9. ;    *    11/30/82 - Thomas J. Mason
  10. ;    *    Added trap for function 60 to fix PUT and SAVE
  11. ;    *    bios vector mods.
  12. ;    *
  13. ;    *********************************************************
  14. ;
  15. ;    Copyright (c) 1982
  16. ;    Digital Research
  17. ;    PO Box    579
  18. ;    Pacific Grove, Ca.  93950
  19. ;
  20. TRUE    equ    0FFFFh
  21. FALSE    equ    not TRUE
  22. ;
  23. ; BIOS and BDOS Jump vectors
  24. ;
  25. WBOOT    equ    0
  26. WBTADR    equ    1    ;address of boot in BIOS
  27. BDOS    equ    5    ;BDOS jump vector
  28. BDOSAD    equ    6    ;location of instructions
  29. DFCB    equ    05Ch    ;default FCB
  30. ;
  31. ; BDOS Function calls 
  32. ;
  33. BDOSAD    equ    6        ;BDOS jump address
  34. PSTRING    equ    9        ;print string
  35. BUFIN    equ    10        ;console buffer input
  36. CFILE    equ    16        ;file close
  37. DFILE    equ    19        ;file delete
  38. WFILE    equ    21        ;file write
  39. MFILE    equ    22        ;make file
  40. SETDMA    equ    26        ;set DMA function
  41. BDOSER    equ    45        ;Set BDOS error mode
  42. GETSCB    equ    49        ;get/set scb func #
  43. LDRSX    equ    59        ;function for RSX load
  44. CALRSX    equ    60        ;call rsx func #
  45. CONMOD    equ    109        ;GET/SET Console Mode
  46. ;
  47. ; Non Printable ASCII characters
  48. ;
  49. CTL$C    equ    03    ;CONTROL-C
  50. CR    equ    13    ;ASCII Carrige Return
  51. LF    equ    10    ;ASCII Line Feed
  52. ;
  53. VERSION    equ    30
  54. ;
  55. ; Buffer size
  56. ;
  57. CONMAX    equ    13    ;console buffer maximum
  58. STKSZE    equ    010h    ;size fo stack
  59. SCBOST    equ    068h    ;page boundary + to jmp instr
  60. RETDSP    equ    0FEh    ;RETurn and DiSPlay mode
  61. JUMP    equ    0C3h    ;opcode for jump
  62. LXIH    equ    21h    ;lxi instr to poke
  63. BSNLY    equ    07Fh    ;restore bios jump table only
  64. CMMON    equ    0F9h    ;offset of common memory base from pg. bound
  65. ;
  66. ;    *********************************
  67. ;    *                *
  68. ;    *    The Save Program    *
  69. ;    *                *
  70. ;    *********************************
  71. ;
  72.     db    0,0,0,0,0,0
  73.     jmp    PREFIX
  74. NEXTJ:
  75.     db    JUMP        ;jump
  76. NEXT:
  77.     db    0,0        ;next module in line
  78. PREV:
  79.     dw    5        ;previous, initialized to 5
  80. STKYBT:    db    00h        ;for warm start
  81.     db    0
  82.     db    'SAVE    '
  83.     ds    3
  84. ;
  85. ;
  86. ; This is the check performed every time the BDOS is
  87. ; called to see if the RSX is to be invoked
  88. ;
  89. PREFIX:
  90.     mov    a,c    ;set up for compare
  91.     cpi    CALRSX
  92.     jnz    GETGOING
  93.  
  94.     push    b
  95.     push    d
  96.     push    h
  97.     lxi    h,0000h        ;zero out HL
  98.     dad    d        ; <HL> -> RSXPB
  99.     mov    a,m        ;get the byte
  100.     cpi    160        ; sub function defined
  101.  
  102.     pop    h
  103.     pop    d
  104.     pop    b
  105.     jz    GOODBYE        ;remove this RSX
  106.  
  107. GETGOING:
  108. ;
  109.     cpi    LDRSX    ;do the compare
  110.     jz    START
  111.     lhld    NEXT        ;get address for continue
  112.     pchl            ;get going.....
  113. ;
  114. ;
  115. ;
  116. START:
  117. ;
  118. ; They are equal so get the BIOS address to point here
  119. ; in case of a Func 0 call
  120. ;
  121.     push    b        ;save state
  122.     push    d        ; of registers
  123. ;
  124. ; check for jump byte before the SCB
  125.     call    GETSET$SCB
  126.     shld    SCBADR        ;save address for later
  127. ;
  128.     mvi    l,CMMON+1    ;offset into scb to check BIOS
  129.     mov    a,m        ;get byte
  130.     ora    a        ;check for zero
  131.     mvi    a,FALSE        ;store for insurance
  132.     sta    CHGJMP        ;non-banked = FALSE
  133.     jz    NBNKED        ;high byte zero if non-banked
  134. ;
  135.     lhld    SCBADR        ;restor SCB
  136.     mvi    l,SCBOST    ;offset from page for instr
  137.     mov    a,m        ;get byte
  138.     cpi    JUMP        ;is it a jump?
  139.     jnz    MORRSX        ;we are not alone
  140.     mvi    a,TRUE
  141.     sta    CHGJMP        ;set flag
  142.     mvi    m,LXIH        ;put in lxi h,xxxx mnemonic
  143. ;
  144. MORRSX:
  145. ;    continue with processing
  146. NBNKED:
  147. ;
  148. ;
  149.     lhld    WBTADR        ;get address at 01h
  150.     inx    h        ;now points to address of jmp xxxx
  151.     mov    a,m        ;get low order byte
  152.     sta    BIOSAD
  153.     inx    h        ;next byte
  154.     mov    a,m
  155.     sta    BIOSAD+1    ;high order byte
  156. ;
  157. ; Now poke the BIOS address to point to
  158. ; the save routine.
  159. ;
  160.     lxi    d,BEGIN        ;begining of routine
  161.     mov    m,d
  162.     dcx    h        ;point back to first byte
  163.     mov    m,e        ;low order
  164. ;
  165.     mvi    c,BDOSER    ;now set BDOS errormode
  166.     mvi    e,RETDSP    ;to trap any hard
  167.     call    BDOS        ;errors
  168. ;
  169. ;
  170.     pop    d
  171.     pop    b
  172.     lhld    NEXT
  173.     pchl            ;continue on
  174. ;
  175. BEGIN:
  176. ; Start of the save routine
  177. ; Notify the user which program is running
  178. ;
  179.     lxi    sp,STACK    ;initialize stack
  180.     lxi    d,SIGNON    ;prompt
  181.     call    PSTR
  182. ;
  183. ; Get the file from the user
  184. ;
  185. FLEGET:
  186.     lxi    d,FLEPRMPT    ;ask for file name
  187.     call    PSTR
  188.     call    GETBUF
  189. ; zero at end of string for parser
  190.     lxi    h,CONBUF-1    ;address of #
  191.     mov    a,m        ;get it
  192.     cpi    0
  193.     jz    REPLCE
  194.     inx    h        ;HL->CONBUF
  195.     mvi    d,0        ;zero out high order
  196.     mov    e,a        ;fill low
  197.     dad    d        ;add to h
  198.     mvi    m,00        ;zero out byte for parse
  199.     push    h
  200. ;
  201. ;
  202.     call    PARSE
  203.     mov    a,h
  204.     cpi    0FFh
  205.     jz    FLEGET
  206. ;
  207.     pop    h        ;get end of string address back
  208.     inx    h
  209.     mvi    m,'?'        ;put in question mark
  210.     inx    h        ;bump
  211.     mvi    m,' '        ;blank in string
  212.     inx    h        ;bump
  213.     mvi    m,'$'        ;end of string
  214. ;
  215.     mvi    c,17        ;Search for first
  216.     lxi    d,DFCB
  217.     call    BDOS        ;find it
  218.     inr    a        ;bump Acc
  219.     jz    FLECLR        ;file no present skip prompt
  220. ;
  221.     lxi    d,DELFLE
  222.     call    PSTR        ;print out delete prompt
  223.     lxi    d,CONBUF    ;buffer address
  224.     call    PSTR        ;print out filename
  225.     call    GETBUF        ;get answer
  226.     call    GNC        ;get the next char
  227.     cpi    'Y'        ;is it yes
  228.     jnz    FLEGET        ;another name if not
  229. ;
  230. ; Delete any existing file, then make a new one
  231. FLECLR:
  232.     mvi    c,DFILE        ;file delete func
  233.     lxi    d,DFCB        ;default FCB
  234.     call    BDOS        ;real BDOS call
  235. ;
  236.     mvi    a,0
  237.     lxi    h,07ch        ;M -> record count in FCB
  238.     mov    m,a        ;zero out record count
  239. ;
  240.     mvi    c,MFILE        ;make file function
  241.     lxi    d,DFCB        ;default FCB
  242.     call    BDOS
  243. ; Get the address of start of write
  244. ;
  245. STRADD:
  246.     lxi    d,SPRMPT    ;first address
  247.     call    PSTR
  248.     call    GETBUF
  249. ;
  250.     lda    BUFFER+1    ;get # of chars read
  251.     cpi    0
  252.     jz    STRADD
  253. ;
  254.     call    SCANAD        ;get address
  255.     jc    STRADD
  256. ;
  257.     shld    SADDR        ;store in SADDR
  258. ;
  259. ; Get the finish address
  260. ENDADD:
  261.     lxi    d,FPRMPT    ;load prompt
  262.     call    PSTR        ;print
  263.     call    GETBUF        ;read in
  264. ;
  265.     lda    BUFFER+1
  266.     cpi    0
  267.     jz    ENDADD
  268. ;
  269.     call    SCANAD        ;get finish address
  270.     jc    ENDADD
  271. ;
  272.     shld    FADDR        ;store it
  273.     xchg
  274.     lhld    SADDR
  275.     xchg
  276. ;
  277.     call    CHECK
  278.     jc    STRADD
  279. ;
  280. ;
  281.     lhld    SADDR        ;beginning DMA address
  282.     xchg            ;DE=DMA address
  283. ;
  284. ; Write the first record then check the beginning address
  285. ; if DMA address ends up larger exit
  286. ;
  287. WLOOP:
  288.     call    WFLAG
  289.     push    d        ;save DMA address
  290.      mvi    c,SETDMA
  291.     call    BDOS        ;set DMA address
  292. ;
  293.     mvi    c,WFILE    
  294.     lxi    d,DFCB
  295.     call    BDOS        ;write
  296. ;
  297. ; Check for directory space on disk for extents
  298.     lxi    d,NODIR
  299.     cpi    01h        ;no more directory
  300.     jz    FINIS
  301. ;
  302. ; CHECK data block error
  303.     lxi    d,NOBLK
  304.     cpi    02h
  305.     jz    FINIS        ;out of disk space!
  306. ; final check
  307.     ora    a        ;if bad write occured...
  308.     jnz    REPLCE        ;restore BIOS address
  309. ;
  310. ; Write OK now check write address
  311.     pop    d        ;get DMA address
  312.     lxi    h,080h
  313.     dad    d
  314.     xchg
  315.     lhld    FADDR        ;HL=end of write
  316. ;
  317.     call    CHECK
  318. ;
  319.     lda    ONEFLG
  320.     cpi    TRUE
  321.     jnz    WLOOP        ;WLOOP if not done
  322. ;
  323. ; Else, Close file and print out ending prompt
  324. CLOSE:
  325.     mvi    c,CFILE        ;close function
  326.     lxi    d,DFCB        ;get filename
  327.     call    BDOS
  328. ;
  329.     inr    a        ;check for close error
  330.     lxi    d,CERROR
  331.     jz    FINIS        ;maybe write protected
  332. ;
  333. ;good copy
  334.     lxi    d,ENDMSG
  335. FINIS:
  336.     call    PSTR
  337. ;
  338. ; Replace the BIOS Address to correct one
  339. REPLCE:
  340.     lhld    BIOSAD    ;HL=BIOS warm jump
  341.     xchg        ;DE="     "    "
  342.     lhld    WBTADR
  343.     inx    h
  344.     mov    m,e
  345.     inx    h
  346.     mov    m,d
  347. ;
  348. GOODBYE:
  349.     mvi    a,0FFh
  350.     sta    STKYBT        ;change sticky byte for 
  351. ;                ; removal of RSX
  352. ;
  353. ; check to see if JMP changed for BANKED system
  354.     lda    CHGJMP
  355.     cpi    TRUE        ;has it been done?
  356.     jnz    CHGBIOS
  357.     lhld    SCBADR        ;retreive SCB address
  358.     mvi    l,SCBOST    ;points to page + offset
  359.     mvi    m,JUMP        ;restore original code
  360. ;
  361. CHGBIOS:
  362.     mvi    c,13        ;reset the disk system
  363.     call    BDOS
  364. ;
  365.     mvi    c,0        ;set up for wboot
  366.     call    BDOS
  367. ;****************************************
  368. ;*                    *
  369. ;*     Logical end of the program    *
  370. ;*                    *
  371. ;****************************************
  372. ;
  373. GETSET$SCB:
  374.     mvi    c,GETSCB
  375.     lxi    d,SCBPB
  376.     call    BDOS
  377.     ret
  378. ;
  379. WFLAG:
  380.     mvi    a,FALSE
  381.     sta    ONEFLG
  382.     lda    RSLT+1
  383.     cpi    00h
  384.     rnz    
  385.     lda    RSLT
  386.     cpi    080h
  387.     jc    WFLAG1
  388.     jz    WFLAG1
  389.     ret
  390. ;
  391. WFLAG1:
  392.     mvi    a,TRUE
  393.     sta    ONEFLG
  394.     ret
  395. ;
  396. ;
  397. ;
  398. CHECK:
  399. ; Subtract the two to find out if finished
  400.     mov    a,l        ;low order
  401.     sub    e        ;subtraction
  402.     sta    RSLT
  403.     mov    a,h        ;now ...
  404.     sbb    d        ;high order subtraction    
  405.     sta    RSLT+1        ;saved
  406.     ret
  407. ;
  408. GETBUF:
  409. ;buffer input routine
  410. ;
  411.     lxi    h,CONBUF    ;address of buffer
  412.     shld    NEXTCOM        ;store it
  413.     mvi    c,BUFIN
  414.     lxi    d,BUFFER
  415.     call    BDOS
  416.     ret
  417. ;
  418. PSTR:
  419. ; String output routine for messages
  420. ;
  421.     mvi    c,PSTRING
  422.     call    BDOS
  423.     ret
  424. ;
  425. PARSE:
  426. ; General purpose parser
  427. ;
  428. ; Filename = [d:]file[.type][;password]
  429. ;
  430. ; FCB assignments
  431. ;
  432. ;    0    => drive, 0=default, 1=A, 2=B
  433. ;    1-8    => file, converted to upper case,
  434. ;           padded with blanks
  435. ;    9-11    => type, converted to upper case,
  436. ;           padded with blanks
  437. ;    12-15    => set to zero
  438. ;    16-23    => passwords, converted to upper case,
  439. ;           padded with blanks
  440. ;    24-25    => address of password field in "filename",
  441. ;           set to zero if password length=0.
  442. ;    26    => length of password (0-8)
  443. ;
  444. ; Upon return, HL is set to FFFFh if BC locates
  445. ;           an invalid file name;
  446. ; otherwise, HL is set to 0000h if the delimiter
  447. ;           following the file name is a 00h (null)
  448. ;           or a 0Dh (CR);
  449. ; otherwise, HL is set to the address of the delimiter
  450. ;           following the file name.
  451. ;
  452. ;
  453.     lxi    h,0
  454.     push    h
  455.     push    h
  456.     lxi    d,CONBUF    ;set up source address
  457.     lxi    h,DFCB        ;set up dest address
  458.     call    DEBLNK        ;scan the blanks
  459.     call    DELIM        ;check for delimeter
  460.     jnz    PARSE1
  461.     mov    a,c
  462.     ora    a
  463.     jnz    PARSE9
  464.     mov    m,a
  465.     jmp    PARSE3
  466. ;
  467. PARSE1:
  468.     mov    b,a
  469.     inx    d
  470.     ldax    d
  471.     cpi    ':'
  472.     jnz    PARSE2
  473. ;
  474.     mov    a,b
  475.     sui    'A'
  476.     jc    PARSE9
  477.     cpi    16
  478.     jnc    PARSE9
  479.     inr    a
  480.     mov    m,a
  481.     inx    d
  482.     call    DELIM
  483.     jnz    PARSE3
  484.     cpi    '.'
  485.     jz    PARSE9
  486.     cpi    ':'
  487.     jz    PARSE9
  488.     cpi    ';'
  489.     jz    PARSE9
  490.     jmp    PARSE3
  491. ;
  492. PARSE2:
  493.     dcx    d
  494.     mvi    m,0
  495. PARSE3:
  496.     mvi    b,8
  497.     call    SETFLD
  498.     mvi    b,3
  499.     cpi    '.'
  500.     jz    PARSE4
  501.     call    PADFLD
  502.     jmp    PARSE5
  503. ;
  504. PARSE4:
  505.     inx    d
  506.     call    SETFLD
  507. PARSE5:
  508.     mvi    b,4
  509. PARSE6:
  510.     inx    h
  511.     mvi    m,0
  512.     dcr    b
  513.     jnz    PARSE6
  514.     mvi    b,8
  515.     cpi    ';'
  516.     jz    PARSE7
  517.     call    PADFLD
  518.     jmp    PARSE8
  519. PARSE7:
  520.     inx    d
  521.     call    PWFLD
  522. PARSE8:
  523.     push    d
  524.     call    DEBLNK
  525.     call    DELIM
  526.     jnz    PARSE81
  527.     inx    sp
  528.     inx    sp
  529.     jmp    PARSE82
  530. PARSE81:
  531.     pop    d
  532. PARSE82:
  533.     mov    a,c
  534.     ora    a
  535.     pop    b
  536.     mov    a,c
  537.     pop    b    
  538.     inx    h
  539.     mov    m,c
  540.     inx    h
  541.     mov    m,b
  542.     inx    h
  543.     mov    m,a
  544.     xchg
  545.     rnz
  546.     lxi    h,0
  547.     ret
  548. PARSE9:
  549.     pop    h
  550.     pop    h
  551.     lxi    h,0FFFFh
  552.     ret
  553. ;
  554. SETFLD:
  555.     call    DELIM
  556.     jz    PADFLD
  557.     inx    h
  558.     cpi    '*'
  559.     jnz    SETFD1
  560.     mvi    m,'?'
  561.     dcr    b
  562.     jnz    SETFLD
  563.     jmp    SETFD2
  564. SETFD1:
  565.     mov    m,a
  566.     dcr    b
  567. SETFD2:
  568.     inx    d
  569.     jnz    SETFLD
  570. SETFD3:
  571.     call    DELIM
  572.     rz
  573.     pop    h
  574.     jmp    PARSE9
  575. ;
  576. PWFLD:
  577.     call    DELIM
  578.     jz    PADFLD
  579.     inx    sp
  580.     inx    sp
  581.     inx    sp
  582.     inx    sp
  583.     inx    sp
  584.     inx    sp
  585.     push    d
  586.     push    h
  587.     mvi    l,0
  588.     xthl
  589.     dcx    sp
  590.     dcx    sp
  591. PWFLD1:
  592.     inx    sp
  593.     inx    sp
  594.     xthl
  595.     inr    l
  596.     xthl
  597.     dcx    sp
  598.     dcx    sp
  599.     inx    h
  600.     mov    m,a
  601.     inx    d
  602.     dcr    b
  603.     jz    SETFD3
  604.     call    DELIM
  605.     jnz    PWFLD1
  606. ;
  607. PADFLD:
  608.     inx    h
  609.     mvi    m,' '
  610.     dcr    b
  611.     jnz    PADFLD
  612.     ret
  613. ;
  614. DELIM:
  615.     ldax    d
  616.     mov    c,a
  617.     ora    a
  618.     rz
  619.     mvi    c,0
  620.     cpi    0Dh
  621.     rz
  622.     mov    c,a
  623.     cpi    09h
  624.     rz
  625.     cpi    ' '
  626.     jc    DELIM2
  627.     rz
  628.     cpi    '.'
  629.     rz
  630.     cpi    ':'
  631.     rz
  632.     cpi    ';'
  633.     rz
  634.     cpi    '='
  635.     rz
  636.     cpi    ','
  637.     rz
  638.     cpi    '/'
  639.     rz
  640.     cpi    '['
  641.     rz
  642.     cpi    ']'
  643.     rz
  644.     cpi    '<'
  645.     rz
  646.     cpi    '>'
  647.     rz
  648.     cpi    'a'
  649.     rc
  650.     cpi    'z'+1
  651.     jnc    DELIM1
  652.     ani    05Fh
  653. DELIM1:
  654.     ani    07Fh
  655.     ret
  656. DELIM2:
  657.     pop    h
  658.     jmp    PARSE9
  659. ;
  660. DEBLNK:
  661.     ldax    d
  662.     cpi    ' '
  663.     jz    DBLNK1
  664.     cpi    09h
  665.     jz    DBLNK1
  666.     ret
  667. DBLNK1:
  668.     inx    d
  669.     jmp    DEBLNK
  670. ; End of the Parser
  671. ;
  672. ; GET a character from the console buffer
  673. GNC:
  674.     push    h
  675.     lxi    h,CONBUF-1    ;get length
  676.     mov    a,m
  677.     ora    a        ;zero?
  678.     mvi    a,CR        ;return with CR if so
  679.     jz    GNCRET
  680.     dcr    m        ;lenght = length-1
  681.     lhld    NEXTCOM        ;next char address
  682.     mov    a,m
  683.     inx    h        ;bump to next
  684.     shld    NEXTCOM        ;update
  685. GNCRET:
  686.     pop    h
  687. TRANS:
  688.     cpi    7Fh        ;Rubout?
  689.     rz
  690.     cpi    ('A' or 0100000b)
  691.     rc
  692.     ani    1011111b    ; clear upper case bit
  693.     ret
  694. ;
  695. ;
  696. ; Scan the buffer for the address read in ASCII from the terminal
  697. ;
  698. SCANAD:
  699.     lxi    d,00h        ;zero out address
  700.     push    d        ;and save
  701. ;
  702.     lda    CONBUF-1    ;get character count
  703.     cpi    05        ;5 is too many
  704.     jc    SCAN0
  705.     stc            ;set carry for routine
  706.     jmp    SCNRET
  707. SCAN0:
  708.     call    GNC        ;get a char
  709.     cpi    CR        ;end?
  710.     jz    SCNRET        ;to scnret if so
  711.     cpi    '0'        ;is it >0?
  712.     jnc    SCAN01        ;bad character
  713.     jmp    SCNRET
  714. SCAN01:
  715.     cpi    '@'
  716.     jnz    SCAN02        ;bad character
  717.     stc
  718.     jmp    SCNRET        ;return on bad file
  719. SCAN02:
  720.     jnc    SCAN1        ;must be A-F
  721.     sui    030h        ;normalize 0-9
  722.     jmp    SCAN2
  723. SCAN1:
  724.     cpi    'G'        ;is it out of range?
  725.     jc    SCAN11
  726.     stc
  727.     jmp    SCNRET
  728. SCAN11:    
  729.     sui    037h        ;normalize
  730. SCAN2:
  731.     mov    l,a        ;character in low of DE
  732.     lda    CONBUF-1    ;get # left
  733.     adi    1        ;readjust
  734.     mov    c,a
  735.     mvi    h,00        ;zero out high order
  736. SCAN3:
  737.     dcr    c        ;dec to set flag
  738.     jz    SCAN4        ;were done
  739.     dad    h        ;shift 1bit left
  740.     dad    h        ;same
  741.     dad    h        ;same
  742.     dad    h        ;finally
  743.     jmp    SCAN3        ;back for more
  744. ;
  745. SCAN4:
  746.     pop    d        ;ready for or
  747.     mov    a,d        ;high order
  748.     ora    h        ;
  749.     mov    d,a
  750.     mov    a,e        ;low order
  751.     ora    l        ;ORed
  752.     mov    e,a        ;back
  753.     push    d        ;save
  754.     jmp    SCAN0        ;get more characters
  755. SCNRET:
  756.     pop    d        ;hl = address
  757.     xchg            ;DE->HL
  758.     ret
  759. ;
  760. ;
  761. ;    *********************************
  762. ;    *                *
  763. ;    *    Data Structures        *
  764. ;    *                *
  765. ;    *********************************
  766. ;
  767. SCBPB:
  768.     db    03Ah    ;SCB address
  769.     db    0
  770. ;
  771. SADDR:    dw    0        ;write start address
  772. FADDR:    dw    0        ;write finish address
  773. BIOSAD:    dw    0        ;WarmBOOT bios address
  774. NEXTCOM: dw    0        ;address of next character to read
  775. ONEFLG:    db    0
  776. RSLT:    dw    0
  777. CHGJMP    db    FALSE
  778. ;
  779. SCBADR:    dw    0        ;Scb address
  780. ;
  781. BIOSMD:    db    0        ;if non-zero change LXI @jmpadr to
  782.                 ;JUMP when removed.
  783. ;
  784. BUFFER:    db    CONMAX
  785.     db    0        ;# of console characters read
  786. CONBUF:    ds    CONMAX
  787. ;
  788. SIGNON:    db    CR,LF,'CP/M 3 SAVE - Version ',VERSION/10+'0','.',VERSION mod 10+'0','$'
  789. FLEPRMPT: db    CR,LF,'Enter file '
  790.     db    '(type RETURN to exit): $'
  791. DELFLE:    db    CR,LF,'Delete $'
  792. SPRMPT:    db    CR,LF,'Beginning hex address $'
  793. FPRMPT:    db    CR,LF,'Ending hex address    $'
  794. ENDMSG:    db    CR,LF,'$'
  795. ;
  796. ; Error messages......
  797. CERROR:    db    CR,LF,'ERROR: Bad close.$'
  798. NODIR:    db    CR,LF,'ERROR: No directory space.$'
  799. NOBLK:    db    CR,LF,'ERROR: No disk space.$'
  800. ;
  801. ; Stack for program
  802.     ds    STKSZE
  803. STACK:
  804.     end        ;Physical end of program
  805.