-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port atari cc65 sysremove (remove())
- Loading branch information
1 parent
8ed2b87
commit 5fcba40
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|