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 / NUBYE / NUKMD111.ARK / NUNEW10.ASM < prev   
Assembly Source File  |  1987-02-02  |  15KB  |  731 lines

  1. ;
  2. ; NUNEW  v1.0
  3. ;  02/01/87
  4. ;
  5. ; NuNEW is an RCP/M utility which displays your log of file transfer
  6. ; activity (i.e. NUKMD.LOG, LOG.SYS, etc) in various formats.  Normal
  7. ; users are only able to view current uploads, while the sysop (and
  8. ; someone with WHEEL access) has a command line choice of 5 additional
  9. ; display options:
  10. ;
  11. ;   WHEEL Option        Description
  12. ;   ------------        -----------
  13. ;     E        Show *all*  uploads and downloads
  14. ;     D        Show *all*  downloads
  15. ;     A        Show *only* .ARK/.ARC file member downloads
  16. ;     L        Show *only* .LBR file member downloads
  17. ;     P        Show *only* private uploads
  18. ;
  19. ;
  20. ; NuNEW offers a number of enhancements which make it a perfect companion
  21. ; utility for those of you logging your file transfer activity via NUKMD
  22. ; or other remote file transfer utilities.  Regardless of your log file's
  23. ; size, display of requested information begins with virtually no delay.
  24. ;
  25. ; (Note: NEW.ASM was copyrighted and released to public domain [1985] by
  26. ;     Irv Hoff -- NuNEW is a direct upgrade.)
  27. ;
  28. ;    Tom Brady
  29. ;    Decibel PBBS
  30. ;    (404) 288-6858
  31. ;    300/1200/2400 bps
  32. ;
  33. ; -----
  34. ;
  35. ; Remove the apostrophe from before the ASEG instruction, if using
  36. ; Microsoft's macro-assembler MACRO-80 (known as M80).    Everyone
  37. ; else can ignore the next line.
  38. ;
  39. ;    ASEG            ; Required by M80
  40. ;
  41. ; -----
  42. ;
  43. NO    EQU    0
  44. YES    EQU    NOT NO
  45. ;
  46. ; User choices
  47. ;
  48. WHEEL    EQU    3EH        ; Location of your WHEEL byte
  49. CLOCK    EQU    yes        ; Yes, if .LOG/.SYS contains TIME xfrs
  50.                 ;   took place
  51. LOGSYS    EQU    no        ; Yes, if your log file is stored as LOG.SYS,
  52.                 ;   rather than *.LOG (i.e. MBBS systems).
  53. LOGDRV    EQU    'C'        ; .LOG/.SYS stored on this drive
  54. LOGUSR    EQU    15        ; .LOG/.SYS stored in this user area
  55. ;
  56. PGPAWS:    EQU    yes        ; Yes, page pausing wanted
  57. ;
  58. ; =======
  59. ;
  60. ; Program starts here
  61. ;
  62.     ORG    100H
  63. ;
  64.     LXI    H,0
  65.     DAD    SP
  66.     SHLD    STACK        ; Save current return to CCP address
  67.     LXI    SP,STACK    ; Reset the stack
  68. ;
  69. ; If WHEEL is on, check for command line option requests.
  70. ;
  71.     LDA    WHEEL
  72.     ORA    A        ; Ok to check?
  73.     JZ    START        ; No, skip rest
  74.     LXI    H,FCB+1
  75.     MOV    A,M        ; Get the show option
  76.     ORA    A        ; Anything?
  77.     JZ    START        ; No, show uploads only, else...
  78.     STA    OPTION        ; Save it
  79. ;
  80. ; Show program name and version number
  81. ;
  82. START:    CALL    ILPRT
  83.     DB    CR,LF,'NuNEW v',MAIN+'0','.',VERS+'0',' - '
  84.     DB    MONTH/10+'0',MONTH MOD 10+'0','/'
  85.     DB    DAY/10+'0',DAY MOD 10+'0','/'
  86.     DB    YEAR/10+'0',YEAR MOD 10+'0',' '
  87.     DB    CR,LF,LF,0
  88. ;
  89.     LDA    4        ; Get current drive/user
  90.     STA    DRUSER        ; Store it
  91.     MVI    E,LOGUSR    ; Set to user area of .LOG file
  92.     MVI    C,SETUSR
  93.     CALL    BDOS
  94.     MVI    A,LOGDRV    ; Set to drive of .LOG file
  95.     SUI    41H
  96.     MOV    E,A
  97.     MVI    C,SELDSK
  98.     CALL    BDOS
  99. ;
  100. ; Open source file
  101. ;
  102.     LXI    D,FILE
  103.     MVI    C,OPEN
  104.     CALL    BDOS
  105.     INR    A        ; Check for no open
  106.     JZ    NONE        ; No file, exit
  107.     CALL    ILPRT
  108.     DB    '[ ^S = pause /  ^C, ^X or ^K = abort ]',CR,LF,LF,0
  109.     LXI    D,FILE
  110.     MVI    C,35        ; Determine end-of-file
  111.     CALL    BDOS
  112.     LXI    D,BUFFER+81
  113.     MVI    A,CR        ; Force first line through
  114.     STAX    D
  115.     DCR    E
  116.     LDA    OPTION
  117.     CPI    'P'        ; Uploads?
  118.     JZ    HEADU
  119.     CPI    ' '        ; Uploads?
  120.     JZ    HEADU
  121. ;
  122. HEAD:    CALL    ILPRT
  123.     DB    'd/u    Filename     Parent     Size  Speed     Date   '
  124. ;
  125.      IF    CLOCK
  126.     DB    'Time  '
  127.      ENDIF
  128. ;
  129.     DB    0
  130.     LDA    OPTION
  131.     CPI    'E'        ; Everything?
  132.     JNZ    HEADD        ; No
  133.     CALL    ILPRT
  134.     DB    'Xfer by',0
  135.     JMP    READX
  136. ;
  137. HEADD:    CALL    ILPRT
  138.     DB    'Downloaded by',LF,CR,0
  139.     JMP    READX
  140. ;
  141. HEADU:    CALL    ILPRT
  142.     DB    'D/U    Filename   Size  Speed     Date   '
  143. ;
  144.      IF    CLOCK
  145.     DB    'Time  '
  146.      ENDIF
  147. ;
  148.     DB    'Uploaded by',LF,CR,0
  149. ;
  150. READX:    PUSH    D
  151.     LXI    H,RECORD    ; Decrement record counter
  152.     MOV    E,M        ; Get 16 bit number into DE
  153.     INX    H
  154.     MOV    D,M
  155.     DCX    D        ; Now that we have the number, decrement
  156.     MOV    M,D        ; And now store it again
  157.     DCX    H
  158.     MOV    M,E
  159.     MOV    A,E        ; Now lets see if we are at the end
  160.     CPI    0FFH        ; First check high #
  161.     JNZ    READLP        ; Ok, go on - else, check low number
  162.     MOV    A,D
  163.     CPI    0FFH        ; One past zero, so get last record
  164.     JZ    TDONE        ; At the end, so finished
  165. ;
  166. ; Read sector from source file
  167. ;
  168. READLP:    LXI    D,TBUF        ; Set the DMA for our read
  169.     MVI    C,STDMA
  170.     CALL    BDOS        ; And do it now
  171.     LXI    D,FILE        ; Now read the record
  172.     MVI    C,READ
  173.     CALL    BDOS
  174.     POP    D        ; Restore register
  175.     ORA    A        ; Read ok?
  176.     JNZ    RDERR        ; No, abort
  177.     LXI    H,TBUF+127    ; Set up end of buffer
  178.     MVI    B,128        ; The buffer will be filled up backwards
  179. ;
  180. ONEMOR:    MOV    A,M        ; Get character
  181.     ANI    7FH
  182.     CPI    LF        ; Check for end of line -- LF is our marker
  183.     JZ    WRDISK        ;  that we'll use to determine each line
  184.     CPI    7FH
  185.     JZ    NXTONE
  186.     CPI    1AH        ; Check for CTRL-Z, end-of-file marker
  187.     JZ    NXTONE
  188.     XCHG
  189.     MOV    M,A        ; Store character in our working buffer
  190.     XCHG
  191.     DCR    E        ; Decrement counters (DE=work buffer)
  192. ;
  193. NXTONE:    DCR    L        ;   (HL=DMA)
  194.     DCR    B        ;   (B=Counter for number of char.)
  195.     JZ    READX        ; If zero, go read another record
  196.     JMP    ONEMOR
  197. ;
  198. ; Write sector to output file (with buffering)
  199. ;
  200. WRDISK:    DCR    B        ; Decrement our counter
  201.     PUSH    PSW        ; As well as the flags
  202.     DCR    L        ; Decrement our DMA buffer
  203.     PUSH    H        ; Save it
  204.     PUSH    B        ; Save counter
  205.     XCHG            ; HL will now be our working buffer
  206.     MOV    M,A        ; Go save CR
  207.     LDA    OPTION
  208.     CPI    'E'        ; Show all?
  209.     JZ    WRDLOP        ; Yes, else...
  210.     INR    L        ; See if it is an upload
  211.     MOV    A,M
  212.     STA    STORE2        ; Store this away for later
  213.     DCR    L
  214. ;
  215. ; Check xfr types
  216. ;
  217.     CPI    'S'        ; Send?
  218.     JNZ    CKOPT        ; No
  219.     LDA    OPTION
  220.     CPI    'D'        ; Downloads?
  221.     JZ    WRDLOP        ; Ok
  222.     JMP    SENDX        ; Yes, skip incorrect
  223. ;
  224. CKOPT:    CPI    'L'        ; .LBR?
  225.     JNZ    CKOPT1        ; No
  226.     LDA    OPTION        ; Get command option
  227.     CPI    'L'        ; .LBR?
  228.     JZ    WRDLOP        ; Ok
  229.     CPI    'D'        ; Downloads?
  230.     JZ    WRDLOP        ; Ok
  231.     JMP    SENDX        ; No, skip
  232. ;
  233. CKOPT1:    CPI    'A'        ; .ARK/.ARC?
  234.     JNZ    CKOPT2        ; No
  235.     LDA    OPTION
  236.     CPI    'A'        ; .ARK/.ARC?
  237.     JZ    WRDLOP        ; Ok
  238.     CPI    'D'        ; Downloads?
  239.     JZ    WRDLOP        ; Ok
  240.     JMP    SENDX        ; No, skip
  241. ;
  242. CKOPT2:    CPI    'P'        ; Private?
  243.     JNZ    CKOPT3        ; No
  244.     LDA    OPTION
  245.     CPI    'P'        ; Private?
  246.     JZ    WRDLOP        ; Ok
  247.     JMP    SENDX        ; No, skip
  248. ;
  249. CKOPT3:    CPI    'R'        ; Upload?
  250.     JNZ    SENDX        ; No
  251.     LDA    OPTION
  252.     CPI    ' '        ; Anything else?
  253.     JNZ    SENDX        ; Yes, no good
  254. ;
  255. WRDLOP:    MOV    A,M        ; Get byte from read buffer
  256.     MOV    B,A        ; Save the character for now
  257.     CPI    CR        ; CR?
  258.     JZ    SENDLF        ; Yes, send it and start over
  259.     CPI    LF        ; LF?
  260.     JNZ    WRDL0        ; No, continue output
  261. ;
  262.      IF    PGPAWS
  263.     PUSH    PSW        ; Save LF
  264.     LDA    LINECT
  265.     CPI    20        ; Page yet?
  266.     CZ    MORE        ; Yes, pause
  267.     POP    PSW        ; Restore LF or CR
  268.      ENDIF
  269. ;
  270.     JMP    SEND        ; Continue next line
  271. ;
  272. ; Will show entire .LOG in reverse if requested
  273. ;
  274. WRDL0:    LDA    COLUMN
  275.     CPI    79        ; End of display?
  276.     JZ    WRD2        ; Yes
  277.     ORA    A        ; First column?
  278.     JNZ    WRDL3        ; If not, exit
  279.     INR    A
  280.     STA    COLUMN        ; Won't be in first column any longer
  281. ;
  282. ; Shows "P" entries only if wheel byte is set for SYSOP's use
  283. ;
  284.     MOV    A,B        ; Get the character back
  285.     STA    STORE
  286.     CPI    'P'        ; This line a private upload?
  287.     JNZ    WRDL1        ; If not, exit
  288.     LDA    OPTION
  289.     CPI    'E'        ; Everything?
  290.     JNZ    WRDL00        ; No
  291.     STA    PRIVT        ; Mark '*'
  292.     JMP    WRDL4
  293. ;
  294. WRDL00:    CPI    'P'        ; Private?
  295.     JNZ    WRDL13        ; No
  296.     STA    PRIVT        ; Mark '*'
  297.     JMP    WRDL4
  298. ;
  299. WRDL1:    CPI    'S'        ; Download?
  300.     JNZ    WRDL11
  301.     LDA    OPTION
  302.     CPI    'D'
  303.     JZ    WRDL4
  304.     JMP    WRDL13        ; Yes, incorrect
  305. ;
  306. WRDL11:    CPI    'L'
  307.     JNZ    WRDL12        ; No
  308.     LDA    OPTION
  309.     CPI    'D'
  310.     JZ    WRDL4
  311.     CPI    'L'
  312.     JZ    WRDL4
  313.     JMP    WRDL13
  314. ;
  315. WRDL12:    CPI    'A'
  316.     JNZ    WRDL14        ; No
  317.     LDA    OPTION
  318.     CPI    'D'
  319.     JZ    WRDL4
  320.     CPI    'A'
  321.     JZ    WRDL4
  322. ;
  323. WRDL13:    CPI    'E'        ; Everything?
  324.     JZ    WRDL4        ; Yes, no skip
  325.     XRA    A
  326.     STA    STORE
  327.     STA    COLUMN
  328.     JMP    NEXT
  329. ;
  330. WRDL14:    CPI    'R'        ; Upload?
  331.     JNZ    WRDL13        ; No
  332.     LDA    OPTION
  333.     CPI    'P'
  334.     JNZ    WRDL4
  335.     JMP    WRDL13
  336. ;
  337. WRD2:    XRA    A
  338.     STA    STORE        ; Otherwise reset flag to zero
  339. ;
  340. WRDL3:    LDA    STORE        ; Storing into memory?
  341.     ORA    A
  342.     JZ    NEXT        ; If not, exit
  343. ;
  344. WRDL4:    LDA    COLUMN        ; Increment the column counter
  345.     INR    A
  346.     STA    COLUMN
  347.     LDA    COLUMN        ; Get the column count back
  348.     CPI    3        ; User's modem speed is in column 2
  349.     JNZ    WR1        ; If not column 2, continue
  350.     MOV    A,B        ; Otherwise get the character
  351.     STA    STORE        ; Store it for conversion to baud rate
  352.     JMP    NEXT        ; Do not print the "MSPEED" number
  353. ;
  354. WR1:    CPI    11
  355.     JC    NEXT        ; Skip everything through column 9
  356.     CPI    14
  357.     JC    SEND        ; Print everything through column 12
  358.     JNZ    WR4
  359.     LDA    PRIVT        ; Going to distinguish a "P" line?
  360.     ORA    A
  361.     JZ    WR2
  362.     XRA    A
  363.     STA    PRIVT
  364.     MVI    B,'*'
  365.     CALL    SEND1
  366.     JMP    WR3
  367. ;
  368. WR2:    MVI    B,':'        ; Stick in a colon after column 12
  369.     CALL    SEND1
  370. ;
  371. WR3:    MVI    B,' '        ; Send a space
  372.     JMP    SEND
  373. ;
  374. WR4:    CPI    22        ; Print through column 20
  375.     JC    SEND
  376.     JNZ    WR5
  377.     CALL    SEND1        ; Send character in colum 21
  378.     MVI    B,'.'        ; Add a period after the file name
  379.     JMP    SEND
  380. ;
  381. WR5:    CPI    27
  382.     JC    SEND        ; Print file type and some spaces
  383.     LDA    OPTION
  384.     CPI    ' '        ; Uploads?
  385.     LDA    COLUMN
  386.     JZ    WR5B        ; Yes, an orphan...
  387.     LDA    OPTION
  388.     CPI    'P'        ; Uploads?
  389.     LDA    COLUMN
  390.     JZ    WR5B        ; More orphans...
  391.     CPI    34        ; Parent possible, print through column 34
  392.     JC    SEND
  393.     JNZ    WR5A        ; Done here, print type
  394.     CALL    SEND1        ; Send character in column 33
  395.     MVI    B,'.'        ; Add a period after the file name
  396.     JMP    SEND
  397. ;
  398. WR5A:    CPI    39
  399.     JC    SEND        ; Print file type
  400.     JMP    WR5C
  401. ;
  402. WR5B:    CPI    39
  403.     JC    NEXT        ; Ignore the "big gap"
  404. ;
  405. WR5C:    CPI    43
  406.     JC    SEND        ; Print the file size
  407.     JZ    WR6
  408.     JMP    WR7        ; Continue with date
  409. ;
  410. WR6:    CALL    SEND1        ; Print space
  411.     CALL    BAUD        ; Print the baud rate and a space
  412.     JMP    NEXT
  413. ;
  414. WR7:    CPI    52
  415.     JC    SEND        ; Print the date
  416.     JNZ    WR8
  417.     JMP    SEND        ; Add a space
  418. ;
  419. WR8:     IF    CLOCK
  420.     CPI    58
  421.     JC    SEND        ; Print the time program was sent
  422.     JNZ    SEND        ; If not column 57, continue
  423.      ENDIF
  424. ;
  425.     CALL    SEND1        ; Add two spaces
  426.     JMP    NEXT        ; Continue with rest of line (name)
  427. ;
  428. SEND:    PUSH    H        ; Keep buffer address
  429.     MOV    A,B        ; Get the character back
  430.     CALL    OUTCHR
  431.     POP    H        ; Get input buffer address back
  432. ;
  433. NEXT:    INR    L        ; Done with sector?
  434.     JMP    WRDLOP        ; No, get another byte
  435. ;
  436. SEND1:    PUSH    H        ; Keep buffer address
  437.     MOV    A,B        ; Get the character back
  438.     CALL    OUTCHR
  439.     POP    H        ; Get input buffer address back
  440.     RET
  441. ;
  442. SENDLF:    XRA    A
  443.     STA    COLUMN        ; Othewise in column 0 now
  444.     CALL    ABORT        ; Want to quit already?
  445. ;
  446. SENDL1:     IF    PGPAWS
  447.     LDA    LINECT
  448.     INR    A
  449.     STA    LINECT        ; Increment line counter
  450.      ENDIF
  451. ;
  452.     CALL    ILPRT
  453.     DB    CR,0
  454. ;
  455. SENDX:    XRA    A        ; Now restore everything so
  456.     STA    COLUMN        ; We can get on with our business
  457.     LXI    D,BUFFER+80
  458.     POP    B
  459.     POP    H
  460.     POP    PSW
  461.     JZ    READX        ; If out of character in DMA buffer,
  462.     JMP    ONEMOR        ;  go read a sector
  463. ;
  464. ; -----------
  465. ; SUBROUTINES
  466. ; -----------
  467. ;
  468. ; Display message and pause for user input
  469. ;
  470.      IF    PGPAWS
  471. MORE:    PUSH    H        ; Save TBUF address
  472.     PUSH    D
  473.     PUSH    B
  474.     XRA    A
  475.     STA    LINECT        ; Clear counter
  476.     POP    PSW
  477.     MVI    A,CR        ; Only need CR
  478.     PUSH    PSW
  479.     CALL    ILPRT
  480.     DB    CR,LF,' [Hit any key to continue]',CR,0
  481.     JMP    ABORT0
  482.      ENDIF
  483. ;
  484. ; Aborts the display when requested, but only at end of line
  485. ;
  486. ABORT:    PUSH    H        ; Save the TBUF address
  487.     PUSH    D
  488.     PUSH    B
  489.     MVI    C,CONST        ; Check to see if key pressed
  490.     CALL    BDOS
  491.     ORA    A
  492.     JZ    ABORT3        ; If no key pressed, then continue
  493. ;
  494. ABORT0:    MVI    C,RDCON        ; Otherwise wait for another character
  495.     CALL    BDOS
  496.     ANI    7FH        ; Remove parity, insure upper-case
  497. ;
  498. ABORT1:    CPI    'C'-40H        ; ^C?
  499.     JZ    ABORT2
  500.     CPI    'K'-40H        ; ^K?
  501.     JZ    ABORT2
  502.     CPI    'X'-40H        ; ^X?
  503.     JZ    ABORT2
  504.     ANI    5FH        ; Convert to upper case
  505.     CPI    'C'
  506.     JZ    ABORT2
  507.     CPI    'K'
  508.     JZ    ABORT2
  509.     CPI    'X'
  510.     JNZ    ABORT3
  511. ;
  512. ABORT2:    POP    B        ; Reset the stack
  513.     POP    D
  514.     POP    H
  515.     POP    H        ; Clear CALL from stack
  516.     CALL    EXIT
  517.     DB    CR,LF,LF,'++ ABORTED ++','$'
  518. ;
  519. ABORT3:    POP    B
  520.     POP    D
  521.     POP    H
  522.     RET
  523. ;
  524. ; Shows the received baud rate
  525. ;
  526. BAUD:    LDA    STORE
  527.     CPI    '0'
  528.     JZ    B110
  529.     CPI    '1'
  530.     JZ    B300
  531.     CPI    '5'
  532.     JZ    B1200
  533.     CPI    '6'
  534.     JZ    B2400
  535.     MVI    B,' '
  536.     CALL    SEND1
  537.     CALL    SEND1
  538.     CALL    SEND1
  539.     CALL    SEND1
  540.     JMP    BFIN2
  541. ;
  542. B110:    MVI    B,' '
  543.     CALL    SEND1
  544.     MVI    B,'1'
  545.     CALL    SEND1
  546.     MVI    B,'1'
  547.     CALL    SEND1
  548.     JMP    BFIN1
  549. ;
  550. B300:    MVI    B,' '
  551.     CALL    SEND1
  552.     MVI    B,'3'
  553.     JMP    BFINSH
  554. ;
  555. B1200:    MVI    B,'1'
  556.     CALL    SEND1
  557.     MVI    B,'2'
  558.     JMP    BFINSH
  559. ;
  560. B2400:    MVI    B,'2'
  561.     CALL    SEND1
  562.     MVI    B,'4'
  563. ;
  564. BFINSH:    CALL    SEND1
  565.     MVI    B,'0'
  566.     CALL    SEND1
  567. ;
  568. BFIN1:    MVI    B,'0'
  569.     CALL    SEND1
  570. ;
  571. BFIN2:    MVI    B,' '
  572.     CALL    SEND1
  573.     MVI    B,'b'
  574.     CALL    SEND1
  575.     MVI    B,'p'
  576.     CALL    SEND1
  577.     MVI    B,'s'
  578.     CALL    SEND1
  579.     MVI    B,' '
  580.     JMP    SEND1
  581. ;
  582. ; Print message then exit to CP/M
  583. ;
  584. EXIT:    POP    D        ; Get message address
  585.     MVI    C,PRINT        ; Print message
  586.     CALL    BDOS
  587.     CALL    ILPRT        ; Print CRLF before quitting
  588.     DB    CR,LF,0
  589.     LDA    DRUSER        ; Get original drive/user area back
  590.     RAR
  591.     RAR
  592.     RAR
  593.     RAR
  594.     ANI    0FH        ; Just look at the user area
  595.     MOV    E,A
  596.     MVI    C,SETUSR    ; Restore original user area
  597.     CALL    BDOS
  598.     LDA    DRUSER        ; Get the original drive/user back
  599.     ANI    0FH        ; Just look at the drive for now
  600.     MOV    E,A
  601.     MVI    C,SELDSK    ; Restore original drive
  602.     CALL    BDOS
  603.     LHLD    STACK
  604.     SPHL
  605.     RET
  606. ;
  607. ; Inline print routine - prints string pointed to by stack until a zero
  608. ; is found.  Returns to caller at the next address after the zero ter-
  609. ; minator.
  610. ;
  611. ILPRT:    XTHL            ; Save HL, get message address
  612. ;
  613. ILPLP:    MOV    A,M        ; Get the character
  614.     CALL    TYPE        ; Show on the CRT
  615.     INX    H        ; Next character location
  616.     MOV    A,M        ; Get the character
  617.     ORA    A        ; If Zero, all done
  618.     JNZ    ILPLP        ; Else keep going
  619.     XTHL            ; Restore HL, ret address
  620.     RET            ; Return past the end of the message
  621. ;
  622. ; Output a character to the new file buffer - first, see if there is
  623. ; room in the buffer for this character.
  624. ;
  625. OUTCHR:    PUSH    PSW        ; Store the character for now
  626.     CALL    TYPE
  627.     POP    PSW
  628.     RET
  629. ;
  630. ; Transfer is done - close destination file
  631. ;
  632. TDONE:    MVI    C,CLOSE
  633.     LXI    D,FILE
  634.     CALL    BDOS
  635. TDONE2:    CALL    EXIT
  636.     DB    CR,LF,LF,'[End of listing]','$'
  637. ;
  638. ; Send character in A register to console
  639. ;
  640. TYPE:    PUSH    B
  641.     PUSH    D
  642.     PUSH    H
  643.     MOV    E,A        ; Character to 'E' for CP/M
  644.     MVI    C,WRCON        ; Write to console
  645.     CALL    BDOS
  646.     POP    H
  647.     POP    D
  648.     POP    B
  649.     RET
  650. ;
  651. ; Error messages
  652. ;
  653. RDERR:    CALL    EXIT
  654.     DB    CR,LF,'++ File read error ++','$'
  655. ;
  656. NONE:    CALL    EXIT
  657.     DB    CR,'++ No transfer log file found ++','$'
  658. ;
  659. ; .LOG file definition -- no need to define, since it looks for
  660. ; wild-card matching of your .LOG file.  If LOGSYS is YES, your log
  661. ; file is normally stored as LOG.SYS and defined as such below.
  662. ;
  663. FILE:    DB    0
  664. ;
  665.      IF    NOT LOGSYS
  666.     DB    '????????LOG'
  667.      ENDIF
  668. ;
  669.      IF    LOGSYS
  670.     DB    'LOG     SYS'
  671.      ENDIF
  672. ;
  673.     DB    0,0,0,0,0
  674.     DB    0,0,0,0,0
  675.     DB    0,0,0,0,0
  676.     DB    0,0,0,0,0,0
  677. ;
  678. RECORD:    DB    0,0,0
  679. ;
  680. COLUMN:    DB    0        ; Column of .LOG line
  681. DRUSER:    DB    0        ; Original drive/user, for return
  682. LENGTH:    DB    0        ; Maximum length of useable memory
  683. LINECT:    DB    0        ; Line counter
  684. OPTION:    DB    ' '        ; Option flag
  685. PRIVT:    DB    0        ; Flag for private uploads
  686. STORE:    DB    0
  687. STORE2:    DB    0
  688. ;
  689. ; -----
  690. ;
  691. ; Equates
  692. ;
  693. CR    EQU    0DH        ; Carriage return
  694. EOF    EQU    1AH        ; End of file - ^Z
  695. FCB    EQU    5CH        ; Command buffer
  696. LF    EQU    0AH        ; Line feed
  697. TBUF    EQU    80H        ; Default buffer address
  698. ;
  699. MAIN    EQU    1
  700. VERS    EQU    0
  701. MONTH    EQU    2
  702. DAY    EQU    1
  703. YEAR    EQU    87
  704. ;
  705. ; -----
  706. ;
  707. ; BDOS equates
  708. ;
  709. BDOS    EQU    5        ; CP/M BDOS entry address
  710. RDCON    EQU    1        ; Get character from console
  711. WRCON    EQU    2        ; Write character to console
  712. PRINT    EQU    9        ; Print string (DE) until '$'
  713. CONST    EQU    11        ; Get console status function
  714. SELDSK    EQU    14        ; Select requested disk drive
  715. OPEN    EQU    15        ; Open disk file
  716. CLOSE    EQU    16        ; Close disk file
  717. READ    EQU    33        ; Read random file
  718. STDMA    EQU    26        ; Set DMA address
  719. SETUSR    EQU    32        ; Set user area on disk
  720. ;
  721. ; -----
  722. ;
  723.     DS    100        ; Room for 50-level stack
  724. ;
  725. ; Set write buffer to even page boundry
  726. ;
  727. BUFFER    DS    81        ; Write buffer starts here
  728. STACK    EQU    BUFFER-2
  729. ;
  730.     END
  731.