home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pgxos / xtlcm3.src < prev    next >
Text File  |  2006-10-19  |  4KB  |  173 lines

  1. ;**************************************
  2. ;*        XTLCM3.CO                   *
  3. ;*           by Paul Globman          *
  4. ;*        Copyright (C) 1988          *
  5. ;**************************************
  6. ;
  7. BEEP:    EQU 4F45H
  8. BYTES:    EQU 9AFDH
  9. CLS:    EQU 20301
  10. CRLF:    EQU 4F3EH
  11. FILES:    EQU 2A2AH
  12. FRAME:    EQU 65196
  13. GONE:    EQU 9CA8H
  14. HOOK28:    EQU F53DH
  15. INSERT:    EQU 82A8H
  16. NEWBNK:    EQU EEF5H
  17. POINT:    EQU 4F96H
  18. POKE:    EQU 9BB0H
  19. STAT:    EQU EF3CH
  20. TEL6:    EQU F53FH
  21. TEL7:    EQU F541H
  22. TERM:    EQU 638BH
  23. TLCOM:    EQU 24573
  24. TRAP:    EQU EF34H
  25. X:    EQU 63600-62474
  26. ;
  27.     ORG 63600    ;ALT LCD buffer
  28. ;==================
  29. FLAG:    DB 255        ;end of dir flg
  30. F6:    call crlf
  31.     lda 64790    ;shift?
  32.     rar
  33.     jnc shofil-x    ;no shift=FILES
  34. ;
  35.     LXI H,GETFIL-x    ;set error trap
  36.     SHLD TRAP    ;for TEXT entry
  37. ;
  38. GETFIL:    CNZ BEEP
  39.     CALL 29003
  40.     LXI H,29124    ;'FILE TO EDIT'
  41.     CALL 13591    ;PRINT IT
  42.     CALL 21744    ;'?' & GET LINE
  43.     RST 2        ;GOOD FILENAME?
  44.     JZ PRETRM-x    ;NO, GO TO TERM
  45.     CALL 11635
  46.     PUSH H
  47.     LXI H,0
  48.     SHLD 61394
  49.     MVI A,1
  50.     LXI H,PRETRM-x
  51.     JMP 29479    ;TO TEXT
  52. ;
  53. PRETRM:    CALL POINT    ;POSITION CURSR
  54.     JMP TERM    ;TO TELCOM/TERM
  55. ;==================
  56. SHOFIL:    CALL FILES    ;display files
  57.     CALL BYTES    ;and bytes free
  58.     JMP CRLF    ;CRLF and ret.
  59. ;======================================
  60. F7:    di        ;BANK SWITCHING
  61.     lda 64790    ;shift?
  62.     rar
  63.     in d8h        ;get this bank
  64.     cc nxt-x    ;backward
  65.     lxi h,cont-x    ;continue after
  66.     push h        ;next return!
  67. ;
  68. nxt:    adi 4        ;forward
  69.     ani 0ch
  70.     cpi 0ch
  71.     jz nxt-x    ;ret withdest
  72.     ret        ;bank in Acc
  73. ;
  74. cont:    sta bm-x+2    ;set dest bank
  75.     lxi h,newbnk    ;and poke bank
  76.     mvi b,0        ;#1 with new
  77.     mov d,a        ;active bank
  78.     call poke
  79. ;
  80.     lxi h,stat    ;copy stat to
  81.     mov d,h        ;destination
  82.     mov e,l        ;bank
  83.     lxi b,7
  84.     call bm-x    ;move it!
  85. ;
  86.     lhld frame
  87.     lda bm+2-x    ;switch
  88.     out d8h        ;banks
  89. ;
  90.     shld frame    ;adj frame shft
  91.     lxi sp,63900
  92.     call 4c47h    ;reset sp
  93.     call cls
  94. ;
  95.     xra a        ;clear keyboard
  96.     sta 64798    ;buffer
  97.     JMP tlcom
  98. ;======================================
  99. ;The following code will move a block
  100. ;of memory in current bank to any
  101. ;location in destination bank.
  102. ;Destination bank poked to bm+2 by
  103. ;earlier code.
  104. ;BC=len, HL=source adrs, DE=dest adrs
  105. ;
  106. bm:    push b        ;save counter
  107.     mvi b,0        ;dest bank in B
  108.     push d        ;store dest adr
  109.     mov d,m        ;data byte in D
  110.     xthl        ;dest adr in HL
  111.     call poke    ;POKE it!
  112.     pop d        ;restore DE and
  113.     xchg        ;HL registers
  114.     pop b        ;restore BC:len
  115. ;
  116.     inx h        ;increment ptrs
  117.     inx d        ;to do next.
  118.     dcx b        ;decrement len
  119.     mov a,c        ;and test if B
  120.     ora b        ;and C are 0
  121.     jnz bm-x    ;done if BC = 0
  122.     ret
  123. ;======================================
  124.     ENTRY        ;load prev code
  125. begin:    di
  126.     xra a        ;do bank 1
  127.     call b1
  128.     mvi a,4        ;do bank 2
  129.     call b1
  130.     mvi a,8        ;do bank 3
  131.     call b1
  132.     jmp tlcom    ;for immediate!
  133. ;================
  134. data:    dw F6-x,F7-x    ;Fkey hook data
  135. ;==================
  136. b1:    sta blkmov+2    ;set dest bank
  137. ;
  138.     lxi h,data    ;get hook data
  139.     lxi d,tel6    ;get hook loc
  140.     lxi b,4        ;put the 4 byte
  141.     call blkmov    ;in dest bank
  142. ;
  143.     lxi h,FLAG    ;get hook code
  144.     lxi d,62474    ;dest location
  145.     lxi b,begin-FLAG;len of code
  146. ;    jmp blkmov    ;move it!
  147. ;======================================
  148. ;The following code will move a block
  149. ;of memory in current bank to any
  150. ;location in destination bank.
  151. ;Destination bank poked to blkmov+2 by
  152. ;earlier code.
  153. ;BC=len, HL=source adrs, DE=dest adrs
  154. ;
  155. blkmov:    push b        ;save counter
  156.     mvi b,0        ;dest bank in B
  157.     push d        ;store dest adr
  158.     mov d,m        ;data byte in D
  159.     xthl        ;dest adr in HL
  160.     call poke    ;POKE it!
  161.     pop d        ;restore DE and
  162.     xchg        ;HL registers
  163.     pop b        ;restore BC:len
  164. ;
  165.     inx h        ;increment ptrs
  166.     inx d        ;to do next.
  167.     dcx b        ;decrement len
  168.     mov a,c        ;and test if B
  169.     ora b        ;and C are 0
  170.     jnz blkmov    ;done if BC = 0
  171.     ret
  172. ;======================================
  173.