Skip to content

Commit

Permalink
[atari] Optimize findfreeiocb
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik committed Jun 14, 2024
1 parent bbe14f1 commit b21f3b7
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions mos-platform/atari8-common/findfreeiocb.s
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@
.globl findfreeiocb
findfreeiocb:

ldx #0
ldy #$FF
loop: tya
cmp ICHID,x
lda #0
loop: tax
ldy ICHID,x
cpy #$FF
beq found
txa
clc
adc #$10
tax
cmp #$80
bcc loop
inx ; return ZF cleared
adc #$10 ; C = 0
bpl loop ; repeat for $10,$20,$30,...,$70
found: rts

0 comments on commit b21f3b7

Please sign in to comment.