Added support for cc65 program arguments.
This commit is contained in:
16
libsrc/sim6502/mainargs.s
Normal file
16
libsrc/sim6502/mainargs.s
Normal file
@@ -0,0 +1,16 @@
|
||||
;
|
||||
; Oliver Schmidt, 2013-05-16
|
||||
;
|
||||
|
||||
.constructor initmainargs, 24
|
||||
.import __argc, __argv, args
|
||||
|
||||
.segment "INIT"
|
||||
|
||||
initmainargs:
|
||||
lda #<__argv
|
||||
ldx #>__argv
|
||||
jsr args
|
||||
sta __argc
|
||||
stx __argc+1
|
||||
rts
|
||||
@@ -7,10 +7,11 @@
|
||||
; int __fastcall__ write (int fd, const void* buf, unsigned count);
|
||||
;
|
||||
|
||||
.export exit, _open, _close, _read, _write
|
||||
.export args, exit, _open, _close, _read, _write
|
||||
|
||||
exit := $FFF0
|
||||
_open := $FFF1
|
||||
_close := $FFF2
|
||||
_read := $FFF3
|
||||
_write := $FFF4
|
||||
args := $FFF0
|
||||
exit := $FFF1
|
||||
_open := $FFF2
|
||||
_close := $FFF3
|
||||
_read := $FFF4
|
||||
_write := $FFF5
|
||||
|
||||
Reference in New Issue
Block a user