Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #1402 > unrolled thread

Super Serial Card IRQ FIFO buffer

Started byD Finnigan <dog_cow@macgui.com>
First post2014-12-09 20:40 +0000
Last post2014-12-17 19:01 +0000
Articles 10 — 3 participants

Back to article view | Back to comp.sys.apple2.programmer


Contents

  Super Serial Card IRQ FIFO buffer D Finnigan <dog_cow@macgui.com> - 2014-12-09 20:40 +0000
    Source code for Super Serial Card IRQ FIFO buffer D Finnigan <dog_cow@macgui.com> - 2014-12-09 20:45 +0000
      Re: Source code for Super Serial Card IRQ FIFO buffer gids.rs@sasktel.net - 2014-12-10 13:07 -0800
        Re: Source code for Super Serial Card IRQ FIFO buffer D Finnigan <dog_cow@macgui.com> - 2014-12-10 21:35 +0000
          Re: Source code for Super Serial Card IRQ FIFO buffer gids.rs@sasktel.net - 2014-12-15 08:40 -0800
            Re: Source code for Super Serial Card IRQ FIFO buffer D Finnigan <dog_cow@macgui.com> - 2014-12-17 18:53 +0000
    Re: Super Serial Card IRQ FIFO buffer ol.sc@web.de (Oliver Schmidt) - 2014-12-13 23:19 +0000
      Re: Super Serial Card IRQ FIFO buffer D Finnigan <dog_cow@macgui.com> - 2014-12-17 18:53 +0000
    Updated Super Serial Card IRQ FIFO buffer D Finnigan <dog_cow@macgui.com> - 2014-12-17 18:56 +0000
      Source code for Updated Super Serial Card IRQ FIFO buffer D Finnigan <dog_cow@macgui.com> - 2014-12-17 19:01 +0000

#1402 — Super Serial Card IRQ FIFO buffer

FromD Finnigan <dog_cow@macgui.com>
Date2014-12-09 20:40 +0000
SubjectSuper Serial Card IRQ FIFO buffer
Message-ID<dog_cow-1418157658@macgui.com>
Here is some code that I put together over the summer for my own education.
Now ready to share.

This will make your Apple II a super dumb terminal using a Super Serial Card
in slot 2. The interesting thing about this program is that it uses
interrupts to process incoming data to store in a first-in-first-out (FIFO)
buffer.

I need to credit John B. Matthews because I looked at his SSC article and
that helped me write this thing. The 1981 Super Serial Card manual was also
useful to me.

The Merlin source is posted in the followup to this article.

-- 
]DF$
Apple II Book: http://macgui.com/newa2guide/
Usenet: http://macgui.com/usenet/  <-- get posts by email!
Apple II Web & Blog hosting: http://a2hq.com/

[toc] | [next] | [standalone]


#1403 — Source code for Super Serial Card IRQ FIFO buffer

FromD Finnigan <dog_cow@macgui.com>
Date2014-12-09 20:45 +0000
SubjectSource code for Super Serial Card IRQ FIFO buffer
Message-ID<ssc-fifo-irq-source-df-09Dec14@macgui.com>
In reply to#1402
I hereby surrender the following source code into the public domain.
I claim no copyright on this source code. It is free for everyone for all time.

The assembler used is Merlin.



                1    ********************************
                2    *
                3    *       FIFO BUFFER
                4    * INTENDED FOR USE WITH SSC
                5    *
                6    * D. FINNIGAN  -- 30 JUNE 2014
                7    *
                8    ********************************
                9    *
                10            ORG   $2000      
                11   *
                12   BUFLOC   EQU   $9000      ; MEMORY LOCATION OF BUFFER
                13   BUFPTR   EQU   $06        ; TWO BYTES BASE ADDRESS
                14   INPTR    EQU   $08        ; INCOMING DATA POINTER (FOR WRITES)
                15   OUTPTR   EQU   $09        ; OUTGOING DATA POINTER (FOR READS)
                16   BUFCNT   EQU   $0A        ; BUFFER CHARACTER COUNTER
                17   *
                18   SLOT     EQU   $20        ; SSC IN SLOT 2
                19   TDREG    EQU   $C088+SLOT ; TRANSMIT DATA REGISTER (WRITE)
                20   RDREG    EQU   $C088+SLOT ; READ DATA REGISTER (READ)
                21   STREG    EQU   $C089+SLOT ; STATUS REGISTER (READ)
                22   RESET    EQU   $C089+SLOT ; SOFTWARE RESET (WRITE)
                23   CMDREG   EQU   $C08A+SLOT ; COMMAND REGISTER (R/W)
                24   CTLREG   EQU   $C08B+SLOT ; CONTROL REGISTER (R/W)
                25   *
                26   IRQLOC   EQU   $3FE       
                27   HOME     EQU   $FC58      
                28   COUT     EQU   $FDED      
                29   KBD      EQU   $C000      
                30   KBDSTRB  EQU   $C010      
                31   *
                32   *
                33   START                     
2000: 58        34            CLI              
2001: 08        35            PHP              
2002: 78        36            SEI              
2003: 20 00 C3  37            JSR   $C300      ; ACTIVATE 80-COLS
2006: 20 58 FC  38            JSR   HOME       ; CLEAR SCREEN
2009: 20 48 20  39            JSR   INIT       
200C: A9 84     40            LDA   #<IRQ      
200E: 8D FE 03  41            STA   IRQLOC     
2011: A9 20     42            LDA   #>IRQ      
2013: 8D FF 03  43            STA   IRQLOC+1   
2016: 20 71 20  44            JSR   SSCINIT    
2019: 28        45            PLP              ; INTERRUPTS ON
201A: 20 62 20  46   :L       JSR   READ       
201D: B0 03     47            BCS   :L2        ; NO NEW DATA
201F: 20 ED FD  48            JSR   COUT       
2022: 2C 00 C0  49   :L2      BIT   KBD        
2025: 10 F3     50            BPL   :L         ; NO KEY PRESSED
2027: AD 00 C0  51            LDA   KBD        
202A: 20 ED FD  52            JSR   COUT       ; LOCAL ECHO
202D: 29 7F     53            AND   #$7F       ; KILL THE HI-BIT
202F: 20 BA 20  54            JSR   SEND       
2032: 98        55            TYA              
2033: C9 0D     56            CMP   #$0D       ; WAS IT A CARRIAGE RETURN?
2035: F0 08     57            BEQ   :CR         
2037: 09 80     58            ORA   #$80       
                59   :OUT                      
2039: 8D 10 C0  60            STA   KBDSTRB    
203C: 4C 1A 20  61            JMP   :L         
203F: A9 0A     62   :CR      LDA   #$0A       ; SEND LINE FEED
2041: 20 BA 20  63            JSR   SEND       
2044: A9 8D     64            LDA   #$8D       ; GET THE CR BACK
2046: 30 F1     65            BMI   :OUT       ; AND PUT IT ON THE SCREEN
                66   *
                67   INIT                      
2048: A9 00     68            LDA   #<BUFLOC   
204A: 85 06     69            STA   BUFPTR     
204C: A9 90     70            LDA   #>BUFLOC   
204E: 85 07     71            STA   BUFPTR+1   
2050: A9 00     72            LDA   #$00       
2052: 85 08     73            STA   INPTR      
2054: 85 09     74            STA   OUTPTR     
2056: 85 0A     75            STA   BUFCNT     
2058: 60        76            RTS              
                77   *
                78   WRITE                     
2059: A4 08     79            LDY   INPTR      
205B: 91 06     80            STA   (BUFPTR),Y 
205D: E6 0A     81            INC   BUFCNT     
205F: E6 08     82            INC   INPTR      
2061: 60        83            RTS              
                84   *
                85   READ                      
2062: 38        86            SEC              
2063: A5 0A     87            LDA   BUFCNT     
2065: F0 09     88            BEQ   :DONE      
2067: A4 09     89            LDY   OUTPTR     
2069: B1 06     90            LDA   (BUFPTR),Y 
206B: C6 0A     91            DEC   BUFCNT     
206D: E6 09     92            INC   OUTPTR     
206F: 18        93            CLC              
2070: 60        94   :DONE    RTS              
                95   *
                96   SSCINIT                   
2071: A9 00     97            LDA   #$00       
2073: 8D A9 C0  98            STA   RESET      
2076: A9 1E     99            LDA   #$1E       ; 1 STOP, 8 DATA, 9600 BAUD
2078: 8D AB C0  100           STA   CTLREG     
207B: A9 09     101           LDA   #$09       ; ENABLE IRQ, NO PARITY
207D: 8D AA C0  102           STA   CMDREG     
2080: AD A8 C0  103           LDA   RDREG      
2083: 60        104           RTS              
                105  *
                106  IRQ                       
2084: A5 45     107           LDA   $45        
2086: 48        108           PHA              
2087: 98        109           TYA              
2088: 48        110           PHA              
2089: AD A9 C0  111           LDA   STREG      
208C: 30 04     112           BMI   :GET       
208E: 68        113  :DONE    PLA              
208F: A8        114           TAY               
2090: 68        115           PLA              
2091: 40        116           RTI              
2092: A8        117  :GET     TAY              
2093: 29 08     118           AND   #$08       
2095: F0 F7     119           BEQ   :DONE      
2097: 98        120           TYA              
2098: 29 07     121           AND   #$07       ; ANY ERROR?
209A: F0 0D     122           BEQ   :GET2      
209C: AD A8 C0  123           LDA   RDREG      
209F: 20 59 20  124           JSR   WRITE      
20A2: A9 3F     125           LDA   #'?        
20A4: 20 59 20  126           JSR   WRITE      
20A7: D0 E5     127           BNE   :DONE      
20A9: AD A8 C0  128  :GET2    LDA   RDREG      
20AC: 09 80     129           ORA   #$80       ; SET HI-BIT
20AE: A4 08     130           LDY   INPTR      
20B0: 91 06     131           STA   (BUFPTR),Y 
20B2: E6 0A     132           INC   BUFCNT     
20B4: E6 08     133           INC   INPTR      
20B6: 68        134           PLA              
20B7: A8        135           TAY              
20B8: 68        136           PLA              
20B9: 40        137           RTI              
                138  *
                139  SEND                      
20BA: A8        140           TAY              
20BB: AD A9 C0  141  :L1      LDA   STREG      ; CLEAR TO SEND?
20BE: 29 10     142           AND   #$10       ; BIT 4 IS SET WHEN OK
20C0: F0 F9     143           BEQ   :L1        
20C2: 8C A8 C0  144           STY   TDREG      ; SEND BYTE TO ACIA
20C5: 60        145           RTS              


--End assembly, 198 bytes, Errors: 0 


Symbol table - alphabetical order:

   BUFCNT  =$0A        BUFLOC  =$9000      BUFPTR  =$06        CMDREG  =$C0AA
   COUT    =$FDED      CTLREG  =$C0AB      HOME    =$FC58      INIT    =$2048
   INPTR   =$08        IRQ     =$2084      IRQLOC  =$03FE      KBD     =$C000
   KBDSTRB =$C010      OUTPTR  =$09        RDREG   =$C0A8      READ    =$2062
   RESET   =$C0A9      SEND    =$20BA      SLOT    =$20        SSCINIT =$2071
?  START   =$2000      STREG   =$C0A9      TDREG   =$C0A8      WRITE   =$2059



Symbol table - numerical order:

   BUFPTR  =$06        INPTR   =$08        OUTPTR  =$09        BUFCNT  =$0A
   SLOT    =$20        IRQLOC  =$03FE   ?  START   =$2000      INIT    =$2048
   WRITE   =$2059      READ    =$2062      SSCINIT =$2071      IRQ     =$2084
   SEND    =$20BA      BUFLOC  =$9000      KBD     =$C000      KBDSTRB =$C010
   TDREG   =$C0A8      RDREG   =$C0A8      STREG   =$C0A9      RESET   =$C0A9
   CMDREG  =$C0AA      CTLREG  =$C0AB      HOME    =$FC58      COUT    =$FDED



== END ==

[toc] | [prev] | [next] | [standalone]


#1405 — Re: Source code for Super Serial Card IRQ FIFO buffer

Fromgids.rs@sasktel.net
Date2014-12-10 13:07 -0800
SubjectRe: Source code for Super Serial Card IRQ FIFO buffer
Message-ID<9741266e-09b0-4605-8a17-aaa2cef823e3@googlegroups.com>
In reply to#1403
On Tuesday, 9 December 2014 14:46:07 UTC-6, D Finnigan  wrote:
> I hereby surrender the following source code into the public domain.
> I claim no copyright on this source code. It is free for everyone for all time.



Nice job David.

But if I am allowed to be critical.

There is no check that the interrupt is coming from the SSC card and the buffer is only 1 page (256 bytes) and what is received through the SSC card is only printed to screen and not saved to a disk file.

Any chance for an update  :)

[toc] | [prev] | [next] | [standalone]


#1406 — Re: Source code for Super Serial Card IRQ FIFO buffer

FromD Finnigan <dog_cow@macgui.com>
Date2014-12-10 21:35 +0000
SubjectRe: Source code for Super Serial Card IRQ FIFO buffer
Message-ID<dog_cow-1418247326@macgui.com>
In reply to#1405
gids.rs wrote:
> On Tuesday, 9 December 2014 14:46:07 UTC-6, D Finnigan  wrote:
>> I hereby surrender the following source code into the public domain.
>> I claim no copyright on this source code. It is free for everyone for all
>> time.
> 
> Nice job David.
> 
> But if I am allowed to be critical.

Yes, please do. :-)

> 
> There is no check that the interrupt is coming from the SSC card

OK, I wrote this assuming it would be the only source of IRQ, but the check
is easy to add.

> and the
> buffer is only 1 page (256 bytes)

I too want to expand this buffer size, but I'm not sure if it's necessary to
expand it for incoming characters from interrupts. It don't think it would
help too much with the IIe firmware 80-column scrolling that will lock out
interrupts.

Now if you're talking about making a big buffer simply to capture everything
that's been sent in to the SSC, then yes I would agree that would be a good
idea, but not in the IRQ routine as I currently have it designed.

> and what is received through the SSC card
> is only printed to screen and not saved to a disk file.

I was thinking about adding a Control-P command to route input to a printer.
Then there could be a Control-D to save to disk.

> 
> Any chance for an update  :)
>

Yes, because I want to add slot independence, and I think some more of these
other suggestions too.

-- 
]DF$
Apple II Book: http://macgui.com/newa2guide/
Usenet: http://macgui.com/usenet/  <-- get posts by email!
Apple II Web & Blog hosting: http://a2hq.com/

[toc] | [prev] | [next] | [standalone]


#1408 — Re: Source code for Super Serial Card IRQ FIFO buffer

Fromgids.rs@sasktel.net
Date2014-12-15 08:40 -0800
SubjectRe: Source code for Super Serial Card IRQ FIFO buffer
Message-ID<c8fccc88-f1bf-412f-9171-bfba2b763cf1@googlegroups.com>
In reply to#1406
> Yes, because I want to add slot independence, and I think some more of these
> other suggestions too.


You also might want to check out Scott Alfter's code from skunkworks.  It includes slot independance, hand shaking and baud rate selection.  Although, I think you have a better FIFO since his only does 128 bytes.

mirrors.apple2.org.za/apple2.caltech.edu/8bit/comm/sscdriver.shk

[toc] | [prev] | [next] | [standalone]


#1410 — Re: Source code for Super Serial Card IRQ FIFO buffer

FromD Finnigan <dog_cow@macgui.com>
Date2014-12-17 18:53 +0000
SubjectRe: Source code for Super Serial Card IRQ FIFO buffer
Message-ID<dog_cow-1418842454@macgui.com>
In reply to#1408
gids.rs wrote:
>> Yes, because I want to add slot independence, and I think some more of
>> these
>> other suggestions too.
> 
> 
> You also might want to check out Scott Alfter's code from skunkworks.  It
> includes slot independance, hand shaking and baud rate selection. 
> Although, I think you have a better FIFO since his only does 128 bytes.
> 
> mirrors.apple2.org.za/apple2.caltech.edu/8bit/comm/sscdriver.shk
>

Found that on Mac GUI Vault over the summer, but it's worth mentioning for
other people who are reading this thread.

[toc] | [prev] | [next] | [standalone]


#1407

Fromol.sc@web.de (Oliver Schmidt)
Date2014-12-13 23:19 +0000
Message-ID<m6ihhd$sof$1@news.albasani.net>
In reply to#1402
Hi,

>This will make your Apple II a super dumb terminal using a Super Serial Card
>in slot 2. The interesting thing about this program is that it uses
>interrupts to process incoming data to store in a first-in-first-out (FIFO)
>buffer.

Maybe interesting in this context as it basically does the same:
https://github.com/cc65/cc65/blob/master/libsrc/apple2/ser/a2.ssc.s

Regards,
Oliver

[toc] | [prev] | [next] | [standalone]


#1409

FromD Finnigan <dog_cow@macgui.com>
Date2014-12-17 18:53 +0000
Message-ID<dog_cow-1418842410@macgui.com>
In reply to#1407
Oliver Schmidt wrote:
> Hi,
> 
>>This will make your Apple II a super dumb terminal using a Super Serial
>>Card
>>in slot 2. The interesting thing about this program is that it uses
>>interrupts to process incoming data to store in a first-in-first-out
>>(FIFO)
>>buffer.
> 
> Maybe interesting in this context as it basically does the same:
> https://github.com/cc65/cc65/blob/master/libsrc/apple2/ser/a2.ssc.s
> 

Thanks. And I see it's public domain too.

[toc] | [prev] | [next] | [standalone]


#1411 — Updated Super Serial Card IRQ FIFO buffer

FromD Finnigan <dog_cow@macgui.com>
Date2014-12-17 18:56 +0000
SubjectUpdated Super Serial Card IRQ FIFO buffer
Message-ID<dog_cow-1418842623@macgui.com>
In reply to#1402
OK, here is the new version that is slot independent. It will also translate
the Delete key to backspace. I checked my code, and it was already verifying
the IRQ flag on the SSC, so there was nothing to change there.

Merlin source code will be posted in the followup to this article...

-- 
]DF$
Apple II Book: http://macgui.com/newa2guide/
Usenet: http://macgui.com/usenet/  <-- get posts by email!
Apple II Web & Blog hosting: http://a2hq.com/

[toc] | [prev] | [next] | [standalone]


#1412 — Source code for Updated Super Serial Card IRQ FIFO buffer

FromD Finnigan <dog_cow@macgui.com>
Date2014-12-17 19:01 +0000
SubjectSource code for Updated Super Serial Card IRQ FIFO buffer
Message-ID<ssc-fifo-irq-source-df-16Dec14@macgui.com>
In reply to#1411
I hereby surrender the following source code into the public domain. 
I claim no copyright on this source code. It is free for everyone for all time. 

The assembler used is Merlin. 


                1    ********************************
                2    *
                3    *       FIFO BUFFER
                4    * INTENDED FOR USE WITH SSC
                5    *
                6    * D. FINNIGAN  -- 30 JUNE 2014
                7    *            UPDATED 16 DEC 14
                8    ********************************
                9    *
                10            ORG   $2000      
                11   *
                12   BUFLOC   EQU   $9000      ; MEMORY LOCATION OF BUFFER
                13   BUFPTR   EQU   $06        ; TWO BYTES BASE ADDRESS
                14   INPTR    EQU   $08        ; INCOMING DATA POINTER (FOR WRITES)
                15   OUTPTR   EQU   $09        ; OUTGOING DATA POINTER (FOR READS)
                16   BUFCNT   EQU   $0A        ; BUFFER CHARACTER COUNTER
                17   SSCSLOT  EQU   $0B        ; SSC SLOT AS $N0
                18   *
                19   RDREG    EQU   $C088      ; READ DATA REGISTER (READ)
                20   STREG    EQU   $C089      ; STATUS REGISTER (READ)
                21   RESET    EQU   $C089      ; SOFTWARE RESET (WRITE)
                22   CMDREG   EQU   $C08A      ; COMMAND REGISTER (R/W)
                23   CTLREG   EQU   $C08B      ; CONTROL REGISTER (R/W)
                24   *
                25   DOSWARM  EQU   $3D0       
                26   IRQLOC   EQU   $3FE       
                27   HOME     EQU   $FC58      
                28   COUT     EQU   $FDED      
                29   KBD      EQU   $C000      
                30   KBDSTRB  EQU   $C010      
                31   *
                32   SSCID1   EQU   $38        
                33   SSCID2   EQU   $18        
                34   SSCID3   EQU   $01        
                35   SSCID4   EQU   $31        
                36   SSCID5   EQU   $08        
                37   SSCLOC1  EQU   $05        
                38   SSCLOC2  EQU   $07        
                39   SSCLOC3  EQU   $0B        
                40   SSCLOC4  EQU   $0C        
                41   SSCLOC5  EQU   $FF        
                42   *
                43   START                     
2000: 58        44            CLI              
2001: 08        45            PHP              
2002: 78        46            SEI              
                47   * FIND SSC
2003: A9 00     48            LDA   #$00       
2005: 85 06     49            STA   BUFPTR     
2007: A9 C8     50            LDA   #$C8       
2009: 85 07     51            STA   BUFPTR+1   
200B: A2 08     52            LDX   #$08       
200D: CA        53   :LOOP1   DEX              
200E: F0 33     54            BEQ   :NOSSC     
2010: C6 07     55            DEC   BUFPTR+1   
2012: A0 05     56            LDY   #SSCLOC1   
2014: B1 06     57            LDA   (BUFPTR),Y  
                              ===== Page 2 =====
 
2016: C9 38     58            CMP   #SSCID1    
2018: D0 F3     59            BNE   :LOOP1     
201A: A0 07     60            LDY   #SSCLOC2   
201C: B1 06     61            LDA   (BUFPTR),Y 
201E: C9 18     62            CMP   #SSCID2    
2020: D0 EB     63            BNE   :LOOP1     
2022: A0 0B     64            LDY   #SSCLOC3   
2024: B1 06     65            LDA   (BUFPTR),Y 
2026: C9 01     66            CMP   #SSCID3    
2028: D0 E3     67            BNE   :LOOP1     
202A: A0 0C     68            LDY   #SSCLOC4   
202C: B1 06     69            LDA   (BUFPTR),Y 
202E: C9 31     70            CMP   #SSCID4    
2030: D0 DB     71            BNE   :LOOP1     
2032: A0 FF     72            LDY   #SSCLOC5   
2034: B1 06     73            LDA   (BUFPTR),Y 
2036: C9 08     74            CMP   #SSCID5    
2038: D0 D3     75            BNE   :LOOP1     
203A: 8A        76            TXA              ; SLOT NUMBER IN X
203B: 0A        77            ASL              
203C: 0A        78            ASL              
203D: 0A        79            ASL              
203E: 0A        80            ASL              
203F: 85 0B     81            STA   SSCSLOT    
2041: D0 18     82            BNE   :80COL     ; ALWAYS TAKEN
2043: A2 00     83   :NOSSC   LDX   #$00       
2045: BD 53 20  84   :NOSSC2  LDA   :NOSSCM,X  
2048: 20 ED FD  85            JSR   COUT       
204B: E8        86            INX              
204C: E0 07     87            CPX   #$07       
204E: D0 F5     88            BNE   :NOSSC2    
2050: 4C D0 03  89            JMP   DOSWARM    
2053: 8D CE CF  90   :NOSSCM  HEX   8DCECFA0D3D3C38D 
2056: A0 D3 D3 C3 8D 
                91   *
205B: 20 00 C3  92   :80COL   JSR   $C300      ; ACTIVATE 80-COLS
205E: 20 58 FC  93            JSR   HOME       ; CLEAR SCREEN
2061: 20 A9 20  94            JSR   INIT       
2064: A9 E7     95            LDA   #<IRQ      
2066: 8D FE 03  96            STA   IRQLOC     
2069: A9 20     97            LDA   #>IRQ      
206B: 8D FF 03  98            STA   IRQLOC+1   
206E: 20 D2 20  99            JSR   SSCINIT    
2071: 28        100           PLP              ; INTERRUPTS ON
2072: 20 C3 20  101  :L       JSR   READ       
2075: B0 03     102           BCS   :L2        ; NO NEW DATA
2077: 20 ED FD  103           JSR   COUT       
207A: AD 00 C0  104  :L2      LDA   KBD        
207D: 10 F3     105           BPL   :L         ; NO KEY PRESSED
207F: 8D 10 C0  106           STA   KBDSTRB    
2082: 29 7F     107           AND   #$7F       ; KILL THE HI-BIT
2084: 20 23 21  108           JSR   SEND       
2087: C9 0D     109           CMP   #$0D       ; WAS IT A CARRIAGE RETURN?
2089: F0 0C     110           BEQ   :CR        
208B: C9 7F     111           CMP   #$7F       ; WAS IT A DELETE?
208D: F0 11     112           BEQ   :DEL       
208F: 09 80     113           ORA   #$80       ; SET THE HI-BIT FOR DISPLAY 
                              ===== Page 3 =====
 
2091: 20 ED FD  114  :OUT     JSR   COUT       
2094: 4C 72 20  115           JMP   :L         
2097: A9 0A     116  :CR      LDA   #$0A       ; SEND LINE FEED
2099: 20 23 21  117           JSR   SEND       
209C: A9 8D     118           LDA   #$8D       ; GET THE CR BACK
209E: 30 F1     119           BMI   :OUT       ; AND PUT IT ON THE SCREEN
20A0: A9 08     120  :DEL     LDA   #$08       ; SEND BACKSPACE
20A2: 20 23 21  121           JSR   SEND       
20A5: A9 88     122           LDA   #$88       ; GET THE BS BACK
20A7: 30 E8     123           BMI   :OUT       ; AND PUT IT ON THE SCREEN
                124  *
                125  INIT                      
20A9: A9 00     126           LDA   #<BUFLOC   
20AB: 85 06     127           STA   BUFPTR     
20AD: A9 90     128           LDA   #>BUFLOC   
20AF: 85 07     129           STA   BUFPTR+1   
20B1: A9 00     130           LDA   #$00       
20B3: 85 08     131           STA   INPTR      
20B5: 85 09     132           STA   OUTPTR     
20B7: 85 0A     133           STA   BUFCNT     
20B9: 60        134           RTS              
                135  *
                136  WRITE                     
20BA: A4 08     137           LDY   INPTR      
20BC: 91 06     138           STA   (BUFPTR),Y 
20BE: E6 0A     139           INC   BUFCNT     
20C0: E6 08     140           INC   INPTR      
20C2: 60        141           RTS              
                142  *
                143  READ                      
20C3: 38        144           SEC              
20C4: A5 0A     145           LDA   BUFCNT     
20C6: F0 09     146           BEQ   :DONE      
20C8: A4 09     147           LDY   OUTPTR     
20CA: B1 06     148           LDA   (BUFPTR),Y 
20CC: C6 0A     149           DEC   BUFCNT     
20CE: E6 09     150           INC   OUTPTR     
20D0: 18        151           CLC              
20D1: 60        152  :DONE    RTS              
                153  *
                154  SSCINIT                   
20D2: A4 0B     155           LDY   SSCSLOT    ; GET SLOT $N0
20D4: A9 00     156           LDA   #$00       
20D6: 99 89 C0  157           STA   RESET,Y    
20D9: A9 1E     158           LDA   #$1E       ; 1 STOP, 8 DATA, 9600 BAUD
20DB: 99 8B C0  159           STA   CTLREG,Y   
20DE: A9 09     160           LDA   #$09       ; ENABLE IRQ, NO PARITY
20E0: 99 8A C0  161           STA   CMDREG,Y   
20E3: B9 88 C0  162           LDA   RDREG,Y    
20E6: 60        163           RTS              
                164  *
                165  IRQ                       
20E7: A5 45     166           LDA   $45        
20E9: 48        167           PHA              
20EA: 98        168           TYA              
20EB: 48        169           PHA              
20EC: A4 0B     170           LDY   SSCSLOT     
                              ===== Page 4 =====
 
20EE: B9 89 C0  171           LDA   STREG,Y    
20F1: 30 04     172           BMI   :GET       ; BIT 7 SET ON IRQ
20F3: 68        173  :DONE    PLA              
20F4: A8        174           TAY              
20F5: 68        175           PLA              
20F6: 40        176           RTI              
20F7: A8        177  :GET     TAY              
20F8: 29 08     178           AND   #$08       
20FA: F0 F7     179           BEQ   :DONE      
20FC: 98        180           TYA              
20FD: 29 07     181           AND   #$07       ; ANY ERROR?
20FF: F0 0F     182           BEQ   :GET2      
2101: A4 0B     183           LDY   SSCSLOT    
2103: B9 88 C0  184           LDA   RDREG,Y    
2106: 20 BA 20  185           JSR   WRITE      
2109: A9 3F     186           LDA   #'?        
210B: 20 BA 20  187           JSR   WRITE      
210E: D0 E3     188           BNE   :DONE      
2110: A4 0B     189  :GET2    LDY   SSCSLOT    
2112: B9 88 C0  190           LDA   RDREG,Y    
2115: 09 80     191           ORA   #$80       ; SET HI-BIT
2117: A4 08     192           LDY   INPTR      
2119: 91 06     193           STA   (BUFPTR),Y 
211B: E6 0A     194           INC   BUFCNT     
211D: E6 08     195           INC   INPTR      
211F: 68        196           PLA              
2120: A8        197           TAY              
2121: 68        198           PLA              
2122: 40        199           RTI              
                200  *
                201  SEND                      
2123: AA        202           TAX              ; SAVE OUT BYTE IN X
2124: A4 0B     203           LDY   SSCSLOT    
2126: B9 89 C0  204  :L1      LDA   STREG,Y    ; CLEAR TO SEND?
2129: 29 70     205           AND   #$70       
212B: C9 10     206           CMP   #$10       ; BIT 4 IS SET WHEN OK
212D: D0 F7     207           BNE   :L1        
212F: 98        208           TYA              
2130: 09 89     209           ORA   #$89       ; ADDRESS ACIA
2132: A8        210           TAY              
2133: 8A        211           TXA              ; GET OUT BYTE AGAIN
2134: 99 FF BF  212           STA   $BFFF,Y    ; SEND TO TDREG
2137: 60        213           RTS              ; BYTE IS LEFT IN A-REG


--End assembly, 312 bytes, Errors: 0 


Symbol table - alphabetical order:

   BUFCNT  =$0A        BUFLOC  =$9000      BUFPTR  =$06        CMDREG  =$C08A
   COUT    =$FDED      CTLREG  =$C08B      DOSWARM =$03D0      HOME    =$FC58
   INIT    =$20A9      INPTR   =$08        IRQ     =$20E7      IRQLOC  =$03FE
   KBD     =$C000      KBDSTRB =$C010      OUTPTR  =$09        RDREG   =$C088
   READ    =$20C3      RESET   =$C089      SEND    =$2123      SSCID1  =$38
   SSCID2  =$18        SSCID3  =$01        SSCID4  =$31        SSCID5  =$08
   SSCINIT =$20D2      SSCLOC1 =$05        SSCLOC2 =$07        SSCLOC3 =$0B 
                              ===== Page 5 =====
 
   SSCLOC4 =$0C        SSCLOC5 =$FF        SSCSLOT =$0B     ?  START   =$2000
   STREG   =$C089      WRITE   =$20BA   


Symbol table - numerical order:

   SSCID3  =$01        SSCLOC1 =$05        BUFPTR  =$06        SSCLOC2 =$07
   INPTR   =$08        SSCID5  =$08        OUTPTR  =$09        BUFCNT  =$0A
   SSCSLOT =$0B        SSCLOC3 =$0B        SSCLOC4 =$0C        SSCID2  =$18
   SSCID4  =$31        SSCID1  =$38        SSCLOC5 =$FF        DOSWARM =$03D0
   IRQLOC  =$03FE   ?  START   =$2000      INIT    =$20A9      WRITE   =$20BA
   READ    =$20C3      SSCINIT =$20D2      IRQ     =$20E7      SEND    =$2123
   BUFLOC  =$9000      KBD     =$C000      KBDSTRB =$C010      RDREG   =$C088
   STREG   =$C089      RESET   =$C089      CMDREG  =$C08A      CTLREG  =$C08B
   HOME    =$FC58      COUT    =$FDED   

== END ==

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.apple2.programmer


csiph-web