Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jedeoric committed Apr 12, 2024
1 parent dcd3620 commit d7fdd3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
20 changes: 6 additions & 14 deletions src/6502/ch395_read_recv_buf_sn.s
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,25 @@


ldy #$00
ldx #$00

@loop2:
lda CH395_DATA_PORT ; set ptr2
sta (RES),y
iny
cpy RESB
bne @loop2
tya
clc
adc RES
bcc @S1
inc RES+1

@S1:
sta RES

inx
cpx RESB+1
bne @loop2

@decrement:
ldx RESB
ldy #$00

@L1:
lda CH395_DATA_PORT
sta (RES),y
iny
dex
bpl @L1
cpy RESB
bne @L1

rts
.endproc
14 changes: 8 additions & 6 deletions src/6502/ch395_write_send_buf_sn.s
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,32 @@ entry_point_c:
stx CH395_DATA_PORT ; set length high


ldx RESB+1
beq @decrement
ldx RESB+1 ; High byte equal to 0 ?
beq @decrement ; Yes only dec Low byte

@restart:
ldx #$00
ldy #$00

@loop:
lda (RES),y
sta CH395_DATA_PORT
iny
cpy RESB
bne @loop
inx
cpx RESB+1
bne @loop


@decrement:
ldx RESB
ldy #$00

@L1:
lda (RES),y
sta CH395_DATA_PORT
iny
dex
bpl @L1
cpy RESB
bne @L1

@exit:
rts
Expand Down

0 comments on commit d7fdd3c

Please sign in to comment.