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 / PMNETWRK / PCPIPM11.Z80 < prev    next >
Text File  |  2000-06-30  |  7KB  |  253 lines

  1. ; PCPIPM11.Z80  
  2. ;
  3. ; Driver for Poor Man's Network and PCPI Applicard w/SuperSerial Card
  4. ;
  5. ; POOR MAN'S NETWORK available from:
  6. ;  Anderson Techno-Products
  7. ;  613-722-0690
  8. ;
  9. ; PMN is a 2-computer CP/M networking system. It allows the sharing
  10. ; of any device DSK:, LST: PUN: etc with connection via the serial port.
  11. ;
  12. ; Revision History:
  13. ;------+---------+----------+---------------------------------------------
  14. ; Rev. |  Date   |  Author  |          Description
  15. ;------+---------+----------+---------------------------------------------
  16. ; 1.1  |08 May 87| Al       | - made ZAS assembler compatible
  17. ;      |         |Heynneman | - setup for SOROC terminal codes
  18. ;      |         |          | - default 9600 baud, cause Super Serial
  19. ;      |         |          |   won't run consistently at 19200
  20. ;------+---------+----------+---------------------------------------------
  21. ; 1.0  |13 Apr 87| Jim Lill | - created original adapting SSERIAL.ASM
  22. ;      |     |        |   and using code from MXH-AP53.ASM
  23. ;------+---------+----------+---------------------------------------------
  24.  
  25. TRUE      EQU     0FFH
  26. FALSE     EQU     0
  27. CR     EQU    13
  28. ;...............................
  29. ;
  30. ;    Apple Super Serial Card equates
  31. ;    -------------------------------
  32. ;
  33. SSCSLOT        EQU    2    ;Slot of Super Serial Card
  34. MODDATP        EQU    0C088H + [SSCSLOT*10H] ;data port of ACIA
  35. MODSTAP        EQU    0C089H + [SSCSLOT*10H] ;status port of ACIA
  36. MODCTLP        EQU    0C08BH + [SSCSLOT*10H] ;control port of ACIA
  37. MODCMDP        EQU    0C08AH + [SSCSLOT*10H] ;command port of ACIA
  38. ;
  39. ;
  40. RDBYTE        EQU    0FFE0H    ;Read a Byte from Apple (A = BYTE)
  41. WRBYTE        EQU    0FFE3H    ;Write a Byte to Apple (C = BYTE)
  42. RDWORD        EQU    0FFE6H    ;Read 2 Bytes from Apple (DE = BYTES)
  43. WRWORD        EQU    0FFE9H    ;Write 2 Bytes to Apple (DE = BYTES)
  44. ;
  45. PEEK1BYTE    EQU    6    ;Command to Peek 1 Byte in the Apple
  46. POKE1BYTE    EQU    7    ;Command to Poke 1 Byte to the Apple
  47.  
  48. ; Status bit equates for SSC serial port
  49. ;
  50. MDSNDB        EQU    10H
  51. MDSNDR        EQU    10H
  52. MDRCVB        EQU    08H
  53. MDRCVR        EQU    08H
  54.  
  55. ;---------------------------------------------------------------------
  56. ; PMN Eqautes
  57.  
  58. NETBIOS        EQU    2000H
  59. OFFSET        EQU    0F00H        
  60. ;
  61.         ORG    107H
  62.  
  63. ; MODEM COMMANDS (not used in this version)
  64. ;
  65. MATTNCDS DB    'A','T',0,0,0,0,0,0,0,0    ;ATTENTION
  66. MINTRCDS DB    '+','+','+',0,0,0,0,0,0,0 ;INTERRUPT
  67. MDIALCDS DB    'D',0,0,0,0,0,0,0,0,0    ;DIAL A NO
  68. MHANGCDS DB    'H','0',0,0,0,0,0,0,0,0    ;HANG UP LINE
  69. MINITCDS DB     'E0',CR        ;HAYES INITIALIZATION
  70.      DB     'F1',CR        ;(40 BYTES TOTAL)
  71.       DB     'Q0',CR
  72.       DB     'V1',CR
  73.       DB     'X1',CR
  74.       DB     'S0=0',CR
  75.       DB     'S7=15',CR
  76.      DB    0,0,0,0
  77.      DB    0,0,0,0,0,0,0,0,0,0
  78. ;
  79. ; BAUD RATE TABLE for Apple Super Serial Card
  80. ;
  81. BAUDCODE:
  82.     DW    06H        ;300 
  83.     DW    07H        ;600 
  84.     DW    08H        ;1200
  85.     DW    09H        ;1800
  86.     DW    0AH        ;2400
  87.     DW    0BH        ;3600
  88.     DW    0CH        ;4800
  89.     DW    0DH        ;7200 
  90.     DW    0EH        ;9600 
  91.     DW    0FH        ;19200 
  92.     DW    0        ;38400
  93. ;
  94. ERRMRK: DB    '^'            ;PARAMETER ERROR MARKER
  95. COMP:    DB    'Apple ][/Applicard/SuperSerial',CR
  96. ;         .........1.........2.........3 30 BYTES
  97.  
  98.     ORG    NETBIOS+31BH
  99. ;
  100. SCRSIZ: DB    24            ;LINES ON SCREEN
  101. SCRWID: DB    80            ;WIDTH OF SCREEN
  102. ;    
  103. CLRLIN: DB    2,27,'T',0,0,0,0,0,0,0     ;CLEAR TO EOL
  104. DIRCUR: DB    2,27,'=',0,0,0,0,0,0,0     ;DIRECT CURSOR ADDR
  105. MIDCUR: DB    0,0,0,0,0,0,0,0,0,0    ;MIDDLE STRING
  106. ENDCUR: DB    0,0,0,0,0,0,0,0,0,0     ;ENDING STRING
  107. VOFF:    DB    32            ;CURSOR ADDR OFFSET
  108. CURSTY: DB    0            ;0=Y,X; 1=X,Y
  109. ASCCUR:    DB    0            ;ASCII CURSOR ADDR
  110. VDELAY:    DB    0            ;CURS ADDR DELAY
  111. REVVID: DB    0,0,0,0,0,0,0,0,0,0     ;REVERSE VIDEO
  112. NORVID: DB    0,0,0,0,0,0,0,0,0,0     ;NORMAL VIDEO
  113. SAVECP: DB    0,0,0,0,0,0,0,0,0,0     ;SAVE CURSR POSN
  114. RSTRCP: DB    0,0,0,0,0,0,0,0,0,0     ;RESTORE CURSR POSN
  115. MSGL:    DB    0            ;WHERE TO PUT MESSAGE
  116. ;
  117.  
  118.     ORG    NETBIOS+61CH
  119.  
  120. SYSID:    DB    8        ;THIS SYSTEM ID, FOR 8MHZ APPLE
  121. ;SYSID:    DB    6        ;THIS SYSTEM ID, FOR 6MHZ APPLE
  122. FCLK:     DB    TRUE        ;4MHZ OR BETTER
  123. MSGKEY:    DB    1CH,0,0,0    ;MSG KEY SEQUENCE
  124. RELOC:    DW    0        ;WHERE TO PUT NETBIOS    
  125.     DS    8        ;reserved
  126. ;
  127. ; USART CONTROL BYTES
  128. ;
  129. USART1:    DB    0        ;GET USART'S ATTN
  130. USART2:    DB    0        ;SOFTWARE RESET
  131. FINBIT: DB    0        ;ENABLE XMIT
  132. FIXED:    DB    0        ;USART CONSTANT BITS
  133. PARITY:    DB    0BH        ;NO PARITY
  134. WORD:    DB    010H         ;8 Bits, 1 Stop
  135.       DB    0         ;
  136. BAUD:    DW    0EH         ;DEFAULT BAUD RATE (9600)
  137. ;
  138.      ORG     NETBIOS+OFFSET
  139.  
  140. DRIVER: ;FOR APPLE SUPER SERIAL CARD w/Applicard
  141.  
  142. ANYEXT: JP    DR$ANYEXT    ;is a byte at port
  143. INEXT:  JP    DR$INEXT    ;read the data port
  144. EXTRDY:    JP    DR$EXTRDY    ;check if ready to xmit
  145. OUTEXT:    JP    DR$OUTEXT    ;write to the data port
  146. RESET    JP    SETSSC        ;init the port
  147. ACTIV:    RET
  148.     NOP
  149.     NOP
  150. PBUSY:    RET
  151.     NOP
  152.     NOP
  153. ;                 E N D  of Fixed Format Area !
  154. ;===================================================================
  155. ;
  156. ; CHECK IF BYTE AT MODEM
  157. ; Z set if byte available.
  158. ; May use registers A, B, C.
  159. ;
  160. DR$ANYEXT:
  161.      CALL    RD$MODSTAP    ;returns with status in Accum.
  162.      XOR    MDRCVR
  163.      AND    MDRCVR
  164.      RET
  165. ;...............................
  166. ;
  167. ; CHECK IF MODEM PORT READY TO XMIT
  168. ; Z set if so.
  169. ; May use registers A, B, C.
  170. ;
  171. DR$EXTRDY:
  172.     CALL    RD$MODSTAP    ;returns with status in Accum.
  173.     XOR    MDSNDR        
  174.     AND    MDSNDR
  175.      RET
  176. ;...............................
  177. ;
  178. ; set baud, parity, and stop bit parameters of acia.
  179. ;
  180. setssc:    ld    a,(parity)    ;get current parity byte
  181.     or    0bh        ;enable dtr, recv irq, and rts
  182.     call    wr$modcmdp    ;send to command port
  183.     push    hl
  184.     ld    hl,baud        ;get address of current baud byte
  185.     ld    a,(word)    ;get current word length byte
  186.     or    (hl)        ;put 'em together
  187.     pop    hl
  188.     call    wr$modctlp    ;now send to control port
  189.     ret
  190. ;...............................
  191. ;
  192. ; Write to the Command Port of ACIA
  193. ;
  194. WR$MODCMDP:    PUSH    DE
  195.         LD    DE,MODCMDP
  196.         JP      POKE
  197. ;
  198. ; Write to the Control Port of the ACIA
  199. ;
  200. WR$MODCTLP:    PUSH    DE
  201.         LD    DE,MODCTLP
  202.         JP    POKE
  203.  
  204. ; Read the Status Port of the ACIA
  205. ;
  206. RD$MODSTAP:    PUSH    DE
  207.         LD    DE,MODSTAP
  208.         JP    PEEK
  209. ;
  210. ; Read Data Port of ACIA
  211. ;
  212. DR$INEXT:      PUSH    DE
  213.         LD    DE,MODDATP
  214.         JP    PEEK
  215. ;
  216. ; Write to the Serial Data Port of the ACIA
  217. ;
  218. DR$OUTEXT:     PUSH    DE
  219.         LD    DE,MODDATP
  220.         JP    POKE
  221. ;................................
  222. ;
  223. ; Peek at 1 byte from Apple 6502 address space
  224. ; ENTRY: DE = Address in Apple
  225. ; EXIT: A = Data
  226. ;
  227. PEEK:        PUSH    BC
  228.         LD    C,PEEK1BYTE
  229.         CALL    WRBYTE
  230.         CALL    WRWORD
  231.         CALL    RDBYTE
  232.         POP    BC
  233.         POP    DE
  234.         RET
  235. ;..............................
  236. ;
  237. ; Poke 1 byte to Apple 6502 address space
  238. ; ENTRY: DE = Address in Apple
  239. ; EXIT: A = Data
  240.  
  241. POKE:        PUSH    BC
  242.         LD    B,A
  243.         LD    C,POKE1BYTE
  244.         CALL    WRBYTE
  245.         CALL    WRWORD
  246.         LD    C,B
  247.         CALL    WRBYTE
  248.              POP    BC
  249.         POP    DE
  250.         RET
  251. ;................................
  252. ;
  253.     END            ;PCPISSPM.Z80