Skip to content

Commit

Permalink
Port atari cc65 sysremove (remove())
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterymath committed May 31, 2024
1 parent 8ed2b87 commit 5fcba40
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions mos-platform/atari8-common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_platform_library(atari8-common-c
open.s
oserror.s
rwcommon.s
sysremove.s
write.s
)
target_include_directories(atari8-common-c BEFORE PUBLIC .)
Expand Down
38 changes: 38 additions & 0 deletions mos-platform/atari8-common/sysremove.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
;
; Christian Groessler, Aug-2003
;
; int remove (const char* name);
;

.include "atari.inc"
.include "errno.inc"
.include "imag.inc"
.globl __sysremove

__sysremove:

jsr findfreeiocb
beq iocbok ; we found one

lda #TMOF ; too many open files
rts

iocbok: lda __rc2
sta ICBAL,x ; store pointer to filename
lda __rc3
sta ICBAH,x
lda #DELETE
sta ICCOM,x
lda #0
sta ICAX1,x
sta ICAX2,x
sta ICBLL,x
sta ICBLH,x
jsr CIOV

bmi cioerr
lda #0
rts
cioerr: tya
rts

0 comments on commit 5fcba40

Please sign in to comment.