
 1000  *--------------------------------
 1010  *
 1020  *          S-C CAPTURE
 1030  *
 1040  *   A COMMUNICATIONS MODULE FOR
 1050  *     THE S-C WORD PROCESSOR
 1060  *
 1070  *          BY JIM CHURCH
 1080  *
 1090  *--------------------------------
 1100  * FULL DUPLEX CAPTURE PROGRAM
 1110  * WORKS WITH MICROMODEM II
 1120  * AND S-C WORD PROCESSOR
 1130  *
 1140  * GO INTO EDITOR W/EMPTY BUFFER
 1150  * ENTER COMMANDS AS FOLLOW:
 1160  *
 1170  * !pr2
 1180  * Q*367-6021    THE "Q" IS A CONTROL-Q
 1190  * !pr768
 1200  *
 1210  * LEAVE EDITOR, CHOOSE P ON MENU
 1220  *--------------------------------
 1230         .OR $300
 1240         .TF B.SC.CAPTURE
 1250  
 1260  SLOT   .EQ $02
 1270  SLOT16 .EQ SLOT*16
 1280  
 1290  PTR    .EQ $00
 1300  WNDTOP .EQ $22  
 1310  CH     .EQ $24
 1320  
 1330  HOOK   .EQ $3EA
 1340  
 1350  BUFFER .EQ $2000
 1360  
 1370  KEYBOARD  .EQ $C000
 1380  STROBE    .EQ $C010
 1390  MM.CR2    .EQ $C085+SLOT16
 1400  MM.STATUS .EQ $C086+SLOT16
 1410  MM.DATA   .EQ $C087+SLOT16
 1420  
 1430  PRNTAX .EQ $F941
 1440  INIT   .EQ $FB2F
 1450  VTAB   .EQ $FC22
 1460  VTABZ  .EQ $FC24
 1470  HOME   .EQ $FC58
 1480  COUT1  .EQ $FDF0
 1490  SETKBD .EQ $FE89
 1500  SETVID .EQ $FE93
 1510  *--------------------------------
 1520  SC.CAPTURE
 1530         JSR INIT     FIX SCREEN
 1540         JSR HOME     CLEAR SCREEN
 1550         LDA #1       RESERVE TOP LINE
 1560         STA WNDTOP    FOR LOCATION COUNTER
 1570         JSR SETVID   PR#0
 1580         JSR SETKBD   IN#0
 1590         JSR HOOK     TELL DOS
 1600         LDX #0       WORD PROCESSOR
 1610         STX BUFFER    NEEDS 0 AT $2000
 1620         INX
 1630         STX PTR      START POINTER
 1640         LDA /BUFFER   AT $2001
 1650         STA PTR+1
 1660  
 1670  TERMINAL
 1680         LDA KEYBOARD KEY DOWN?
 1690         BPL MODEM    NO, CHECK MODEM
 1700         STA STROBE   YES, CLEAR STROBE
 1710         CMP #$9A     CONTROL Z?
 1720         BEQ QUIT     YES, LEAVE
 1730         PHA          SAVE KEYPRESS
 1740  .1     LDA MM.STATUS CHECK IF THE TRANSMIT
 1750         AND #$02       REGISTER EMPTY BIT IS SET
 1760         BEQ .1       NO, WAIT FOR IT
 1770         PLA          YES, GET KEY BACK
 1780         STA MM.DATA  SEND IT
 1790         BMI TERMINAL  AND LOOP AGAIN
 1800  
 1810  MODEM  LDA MM.STATUS CHECK IF THE RECEIVER
 1820         AND #$01       REGISTER FULL BIT IS SET
 1830         BEQ TERMINAL NO, LOOP AGAIN
 1840         LDA MM.DATA  YES, GET CHARACTER
 1850         ORA #$80     SET HI BIT
 1860         CMP #$8A     CONTROL J?
 1870         BEQ TERMINAL IGNORE IT
 1880         JSR COUT1    PRINT CHAR
 1890         LDY #0
 1900         STA (PTR),Y  CAPTURE IT IN BUFFER
 1910  
 1920  INCR   INC PTR      BUMP POINTER LO
 1930         BNE COUNT     NOT 0
 1940         INC PTR+1    BUMP POINTER HI
 1950         LDA PTR+1    CHECK IF
 1960         CMP #$96      BUFFER END?
 1970         BCS QUIT     FULL BUFFER, LEAVE
 1980  
 1990  COUNT  LDA CH       SAVE CH
 2000         PHA           ON STACK
 2010         LDA #0       TOP LINE
 2020         JSR VTABZ     FOR LOCATION COUNTER
 2030         LDA #$14     COL 20
 2040         STA CH        IN CH
 2050         LDA PTR+1    HI BYTE OF LOCATION
 2060         LDX PTR      LO BYTE
 2070         JSR PRNTAX   PRINT ADDRESS
 2080         PLA          GET OLD CH AND RETURN
 2090         STA CH        TO WHERE WE WERE
 2100         JSR VTAB     OLD LINE
 2110         BCC TERMINAL START OVER
 2120  
 2130  QUIT   LDA #$00     END-OF-TEXT MARKER
 2140         STA (PTR),Y   FOR WORD PROCESSOR
 2150         LDA #$05     HANG UP PHONE
 2160         STA MM.CR2    AT CONTROL REGISTER
 2170         JMP $803     COLDSTART WORD PROCESSOR
 2190         .LIF

