1
0
mirror of https://github.com/cc65/cc65.git synced 2026-04-22 01:16:54 +00:00

Allow "mode" argument to open() to be passed from 6502 code.

Implements this suggestion:
https://github.com/cc65/cc65/pull/719#issuecomment-413809096
This commit is contained in:
Patrick Pelletier
2018-08-17 10:43:14 -07:00
committed by Oliver Schmidt
parent d602572bbe
commit aba320eade
4 changed files with 81 additions and 5 deletions
+5 -1
View File
@@ -15,6 +15,7 @@
.include "errno.inc"
.include "fcntl.inc"
.include "_file.inc"
.include "stat.inc"
; ------------------------------------------------------------------------
@@ -82,7 +83,10 @@ modeok: ldy #$00
tya
iny
sta (sp),y
ldy #4 ; Size of arguments in bytes
lda #<(S_IREAD|S_IWRITE)
ldx #>(S_IREAD|S_IWRITE)
jsr pushax ; Push the "mode" argument onto the stack
ldy #6 ; Size of arguments in bytes
jsr _open ; Will cleanup the stack
; Check the result of the open() call