From df1165e0e0eb5f395cf043b0aedaef0d7201f102 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 25 Jun 2013 01:12:11 +0200 Subject: [PATCH] move findfreeiocb function into its own object file --- libsrc/atari/fdtable.s | 26 -------------------------- libsrc/atari/findfreeiocb.inc | 23 +++++++++++++++++++++++ libsrc/atari/findfreeiocb.s | 7 +++++++ 3 files changed, 30 insertions(+), 26 deletions(-) create mode 100644 libsrc/atari/findfreeiocb.inc create mode 100644 libsrc/atari/findfreeiocb.s diff --git a/libsrc/atari/fdtable.s b/libsrc/atari/fdtable.s index 7e3325055..fd9f5021b 100644 --- a/libsrc/atari/fdtable.s +++ b/libsrc/atari/fdtable.s @@ -11,7 +11,6 @@ .import fdt_to_fdi .export clriocb .export fdtoiocb_down - .export findfreeiocb .export fddecusage .export newfd @@ -87,31 +86,6 @@ loop: sta ICHID,x .endproc -; find a free iocb -; no entry parameters -; return ZF = 0/1 for not found/found -; index in X if found -; all registers destroyed - -.proc findfreeiocb - - ldx #0 - ldy #$FF -loop: tya - cmp ICHID,x - beq found - txa - clc - adc #$10 - tax - cmp #$80 - bcc loop - inx ; return ZF cleared -found: rts - -.endproc ; findfreeiocb - - ; decrements usage counter for fd ; if 0 reached, it's marked as unused ; get fd index in tmp2 diff --git a/libsrc/atari/findfreeiocb.inc b/libsrc/atari/findfreeiocb.inc new file mode 100644 index 000000000..92140efd4 --- /dev/null +++ b/libsrc/atari/findfreeiocb.inc @@ -0,0 +1,23 @@ +; find a free iocb +; no entry parameters +; return ZF = 0/1 for not found/found +; index in X if found +; all registers destroyed + +.proc findfreeiocb + + ldx #0 + ldy #$FF +loop: tya + cmp ICHID,x + beq found + txa + clc + adc #$10 + tax + cmp #$80 + bcc loop + inx ; return ZF cleared +found: rts + +.endproc ; findfreeiocb diff --git a/libsrc/atari/findfreeiocb.s b/libsrc/atari/findfreeiocb.s new file mode 100644 index 000000000..a500b1f77 --- /dev/null +++ b/libsrc/atari/findfreeiocb.s @@ -0,0 +1,7 @@ +; +; Christian Groessler, June-2013 +; + + .include "atari.inc" + .export findfreeiocb + .include "findfreeiocb.inc" -- 2.39.5