2 ; Oliver Schmidt, 15.09.2009
4 ; ProDOS 8 I/O buffer management for memory between
5 ; location $0800 and the cc65 program start address
9 .export iobuf_alloc, iobuf_free
13 .include "zeropage.inc"
15 .include "filedes.inc"
20 ; Convert end address highbyte to table index
27 ; Mark all remaining table entries as used
36 ; ------------------------------------------------------------------------
41 ; Get and save "memptr"
47 ; Search table for free entry
57 ; Mark table entry as used
61 ; Convert table index to address hibyte
68 ; Store address in "memptr"
77 ; Convert address hibyte to table index
84 ; Mark table entry as free
90 ; ------------------------------------------------------------------------