Skip to content

Commit

Permalink
Merge pull request #3 from fourstix/b_xsb_update
Browse files Browse the repository at this point in the history
B xsb update
  • Loading branch information
fourstix authored Jun 7, 2021
2 parents 4f77159 + e593b39 commit e55114b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Binary file modified bin/stg/xsb.bin
Binary file not shown.
Binary file modified lbr/stg_utils.lbr
Binary file not shown.
24 changes: 12 additions & 12 deletions src/stg/xsb.asm
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ include kernel.inc
br start

; Build date
date: db 80h+4, ; Month, 80h offset means extended info
db 4 ; Day
date: db 80h+6, ; Month, 80h offset means extended info
db 6 ; Day
dw 2021 ; year = 2021

; Current build number
build: dw 4 ; build
build: dw 5 ; build

; Must end with 0 (null)
db 'Copyright 2021 Gaston Williams',0
Expand Down Expand Up @@ -155,7 +155,7 @@ xopenw: push rf ; save consumed register
ani 0feh
phi re ; put it back
xopenw1: sep scall ; read a byte from the serial port
dw f_uread
dw f_read
smi nak ; need a nak character
lbnz xopenw1 ; wait until a nak is received
pop rf ; recover rf
Expand Down Expand Up @@ -209,7 +209,7 @@ xsend: push rf ; save consumed registers
xsendnak: ldi soh ; need to send soh character
phi rc ; initial value for checksum
sep scall ; send it
dw f_utype
dw f_tty
mov rf,block ; need current block number
ldn rf ; get block number
str r2 ; save it
Expand All @@ -218,7 +218,7 @@ xsendnak: ldi soh ; need to send soh character
phi rc ; put it back
ldn r2 ; recover block number
sep scall ; and send it
dw f_utype
dw f_tty
ldn rf ; get block number back
sdi 255 ; subtract from 255
str r2 ; save it
Expand All @@ -227,7 +227,7 @@ xsendnak: ldi soh ; need to send soh character
phi rc ; put it back
ldn r2 ; recover inverted block number
sep scall ; send it
dw f_utype
dw f_tty
ldi 128 ; 128 bytes to write
plo rc ; place into counter
mov rf,txrx ; point rf to data block
Expand All @@ -238,15 +238,15 @@ xsend1: lda rf ; retrieve next byte
phi rc ; save checksum
ldn r2 ; recover byte
sep scall ; and send it
dw f_utype
dw f_tty
dec rc ; decrement byte count
glo rc ; get count
lbnz xsend1 ; jump if more bytes to send
ghi rc ; get checksum byte
sep scall ; and send it
dw f_utype
dw f_tty
xsend2: sep scall ; read byte from serial port
dw f_uread
dw f_read
str r2 ; save it
smi nak ; was it a nak
lbz xsendnak ; resend block if nak
Expand Down Expand Up @@ -287,9 +287,9 @@ xclosew1: ldi csub ; character to put into buffer
dw xsend
xclosewd: ldi eot ; need to send eot
sep scall ; send it
dw f_utype
dw f_tty
sep scall ; read a byte
dw f_uread
dw f_read
smi 06h ; needs to be an ACK
lbnz xclosewd ; resend EOT if not ACK
mov rf,baud ; need to restore baud constant
Expand Down

0 comments on commit e55114b

Please sign in to comment.