changeset 1465:ebe9d1daa70c

port finished by Robert Gault
author boisy
date Mon, 15 Dec 2003 14:02:37 +0000
parents eeaf8ff6420d
children 4c7a8b10c153
files level2/modules/sacia.asm
diffstat 1 files changed, 104 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/level2/modules/sacia.asm	Mon Dec 15 04:23:16 2003 +0000
+++ b/level2/modules/sacia.asm	Mon Dec 15 14:02:37 2003 +0000
@@ -169,6 +169,7 @@
 Wrk.Type   rmb   1              type work byte (MUST immediately precede Wrk.Baud)
 Wrk.Baud   rmb   1              baud work byte (MUST immediately follow Wrk.Type)
 Wrk.XTyp   rmb   1              extended type work byte
+regWbuf    rmb   2              substitute for regW
 RxBufDSz   equ   256-.          default Rx buffer gets remainder of page...
 RxBuff     rmb   RxBufDSz       default Rx buffer
 MemSize    equ   .
@@ -271,6 +272,9 @@
            IFNE  H6309
            tim   #ForceDTR,<Wrk.XTyp
            ELSE
+* lines seemed to be missing here. RG
+           lda   #ForceDTR
+           bita  <Wrk.XTyp
            ENDC
            beq   NoDTR          no, don't enable DTR yet
            orb   #Cmd.DTR       set (enable) DTR bit
@@ -319,6 +323,10 @@
            tfr   u,w            setup our DP
            tfr   e,dp
            ELSE
+* missing lines
+           stu   <regWbuf
+           lda   <regWbuf
+           tfr   a,pd
            ENDC
            ldx   <V.PORT
            lda   CmdReg,x       get current Command register contents
@@ -382,6 +390,10 @@
            tfr   u,w            setup our DP
            tfr   e,dp
            ELSE
+*missing lines
+           stu   <regWbuf
+           lda   <regWbuf
+           tfr   a,dp
            ENDC
 ReadLoop   orcc  #IntMasks      disable IRQs while checking Rx flow control
 ReadChk    lda   <FloCtlRx      get Rx flow control flags
@@ -402,7 +414,7 @@
            tim   #Stat.TxE,StatReg,x
            ELSE
            pshs  a
-           lda   StatReg,x
+           lda   StatRegx
            bita  #Stat.TxE
            puls  a
            ENDC
@@ -481,6 +493,11 @@
            tfr   e,dp
            tfr   a,e
            ELSE
+*missing lines
+           stu   <regWbuf
+           ldb   <regWbuf
+           tfr   b,dp
+           sta   <regWbuf
            ENDC
            orcc  #IntMasks      disable IRQs during error and Tx disable checks
            bra   WritChr
@@ -526,6 +543,9 @@
            IFNE  H6309
            ste   DataReg,x      write Tx character
            ELSE
+*missing lines
+           ldb   <regWbuf
+           stb   DataReg,x
            ENDC
            clr   <WritFlag      clear "initial write attempt" flag
            puls  cc,dp,pc       recover IRQ/Carry status, Tx character, system DP, return
@@ -536,6 +556,10 @@
            tfr   u,w            setup our DP
            tfr   e,dp
            ELSE
+*missing lines
+           stu   <regWbuf
+           ldb   <regWbuf
+           tfr   b,dp
            ENDC
            ldx   PD.RGS,y       caller's register stack pointer
            cmpa  #SS.EOF
@@ -594,6 +618,10 @@
            tfr   u,w            setup our DP
            tfr   e,dp
            ELSE
+*missing lines
+           stu   <regWbuf
+           ldb   <regWbuf
+           tfr   b,dp
            ENDC
            ldx   PD.RGS,y
            cmpa  #SS.HngUp
@@ -708,24 +736,38 @@
            IFNE  H6309
            tfr   b,e            save it temporarily
            ELSE
+*missing line
+           stb   <regWbuf
            ENDC
            ldb   <Wrk.Baud      get baud info again
            andb  #^(Ctl.RxCS!Ctl.Baud) clear clock source + baud rate code bits
            IFNE  H6309
            orr   e,b            mask in clock source + baud rate and clean up stack
            ELSE
+*missing lines
+           pshs  b
+           orb   <regWbuf
+           stb   <regWbuf
+           puls  b
            ENDC
            ldx   <V.PORT        get port address
            anda  #Cmd.Par       clear all except parity bits
            IFNE  H6309
            tfr   a,e            save new command register contents temporarily
            ELSE
+*missing line
+           sta   <regWbuf
            ENDC
            lda   CmdReg,x       get current command register contents
            anda  #^Cmd.Par      clear parity control bits
            IFNE  H6309
            orr   e,a            mask in new parity
            ELSE
+*missing lines
+           pshs  a
+           ora   <regWbuf
+           sta   <regWbuf
+           puls  a
            ENDC
            std   CmdReg,x       set command+control registers
            puls  cc,pc          recover IRQ enable and Carry status, return...
@@ -735,6 +777,10 @@
            tfr   u,w            setup our DP
            tfr   e,dp
            ELSE
+*missing lines
+           stu   <regWbuf
+           ldb   <regWbuf
+           tfr   b,dp
            ENDC
            ldx   <V.PORT
            ldb   StatReg,x      get current Status register contents
@@ -764,6 +810,9 @@
            IFNE  H6309
            stf   <SigSent       clear signal sent flag
            ELSE
+*missing lines
+           ldb   <regWbuf+1
+           stb   <SigSent
            ENDC
            cmpa  <V.INTR        interrupt?
            bne   Chk.Quit       no, go on...
@@ -791,6 +840,10 @@
            IFNE  H6309
            tim   #TxSwFlow,<Wrk.Type Tx data software flow control enabled?
            ELSE
+           pshs  a
+           lda   #TxSwFlow
+           bita  <Wrk.Type
+           puls  a
            ENDC
            beq   SavRxDat       no, go save Rx data...
            cmpa  <V.XON         XON?
@@ -798,6 +851,12 @@
            IFNE  H6309
            aim   #^FCTxXOff,<FloCtlTx clear XOFF received bit
            ELSE
+*missing lines
+           pshs  a
+           lda   #^FCTxXOff
+           anda  <FloCtlTx
+           sta   <FloCtlTx
+           puls  a
            ENDC
            bra   SetTxFlo       go save new Tx flow control flags...
 
@@ -811,17 +870,33 @@
            IFNE  H6309
            aim   #^FCRxSend,<FloCtlRx clear possible pending XOFF flag
            ELSE
+*missing lines
+           pshs  a
+           lda   #^FCRxSend
+           anda  <FloCtlRx
+           sta   <FloCtlRx
+           puls  a 
            ENDC
            ldx   <RxBufPut      get Rx buffer input pointer
            IFNE  H6309
            ldw   <RxDatLen      Rx get Rx buffer data length
            cmpw  <RxBufSiz      Rx buffer already full?
            ELSE
+*missing lines
+           pshs  d
+           ldd   <RxDatLen
+           std   <regWbuf
+           cmpd  <RxBufSiz
+           puls  d
            ENDC
            blo   NotOvFlo       no, go skip overflow error...
            IFNE  H6309
            oim   #OvrFloEr,<V.ERR mark RX buffer overflow error
            ELSE
+*missing lines
+           ldb   #OvrFloEr
+           orb   <V.ERR
+           stb   <V.ERR
            ENDC
            bra   DisRxFlo       go ensure Rx is disabled (if possible)
 
@@ -835,6 +910,14 @@
            stw   <RxDatLen      save new Rx data length
            cmpw  <RxBufMax      at or past maximum fill point?
            ELSE
+*missing lines
+           pshs  d
+           ldd   <regWbuf
+           addd  #1
+           std   <regWbuf
+           std   <RxDatLen
+           cmpd  <RxBufMax
+           puls  d
            ENDC
            blo   SgnlRxD        no, go check Rx data signal...
 DisRxFlo   ldx   <V.PORT
@@ -842,32 +925,52 @@
            IFNE  H6309
            tim   #ForceDTR,<Wrk.XTyp forced DTR?
            ELSE
+*missing lines
+           lda   #ForceDTR
+           bita  <Wrk.XTyp
            ENDC
            bne   DisRxRTS       yes, go check RTS disable...
            IFNE  H6309
            tim   #DSRFlow,<Wrk.Type DSR/DTR Flow control?
            ELSE
+*missing lines
+           lda   #DSRFlow
+           bita  <Wrk.Type
            ENDC
            beq   DisRxRTS       no, go check RTS disable
            IFNE  H6309
            oim   #FCRxDTR,<Wrk.Type mark RX disabled due to DTR
            ELSE
+*missing lines
+           lda   #FCRxDTR
+           ora   <Wrk.Type
+           sta   <Wrk.Type
            ENDC
            andb  #^Cmd.DTR      clear (disable) DTR bit
 DisRxRTS   equ   *
            IFNE  H6309
            tim   #RTSFlow,<Wrk.Type
            ELSE
+*missing lines
+           lda   #RTSFlow
+           bita  <Wrk.Type
            ENDC
            beq   NewRxFlo       no, go set new Rx flow control...
            IFNE  H6309
            tim   #DSRFlow,<Wrk.Type line break?
            ELSE
+*missing lines
+           lda   #DRSFlow
+           bita  <Wrk.Type
            ENDC
            bne   NewRxFlo       yes, go set new Rx flow control...
            IFNE  H6309
            oim   #FCRxRTS,<FloCtlRx
            ELSE
+*missing lines
+           lda   #FCRxRTS
+           ora   <FloCtlRx
+           sta   <FloCtlRx
            ENDC
            andb  #^Cmd.TIRB     clear Tx IRQ/RTS/Break control bits (disable RTS)
 NewRxFlo   stb   CmdReg,x       set/clear DTR and RTS in Command register