1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +00:00

Last push for tonight :)

This commit is contained in:
jede 2017-02-02 00:11:11 +01:00
parent 4b77072fed
commit 5abb40b229
3 changed files with 15 additions and 14 deletions

View File

@ -1,6 +1,8 @@
.export _open .export _open
.import addysp,popax
.importzp sp,tmp2,tmp3,tmp1 .import addysp,popax
.importzp sp,tmp2,tmp3,tmp1
.include "telestrat.inc" .include "telestrat.inc"
@ -15,17 +17,18 @@
dey ; ...checked (it generates a c compiler warning) dey ; ...checked (it generates a c compiler warning)
dey dey
dey dey
beq parmok ; Branch if parameter count ok beq parmok ; Branch if parameter count ok
jsr addysp ; Fix stack, throw away unused parameters jsr addysp ; Fix stack, throw away unused parameters
; Parameters ok. Pop the flags and save them into tmp3 ; Parameters ok. Pop the flags and save them into tmp3
parmok: jsr popax ; Get flagss parmok:
sta tmp3 ; save flags jsr popax ; Get flagss
sta tmp3 ; save flags
; Get the filename from stack and parse it. Bail out if is not ok ; Get the filename from stack and parse it. Bail out if is not ok
jsr popax ; Get name jsr popax ; Get name
ldy tmp3 ; Get flags again ldy tmp3 ; Get flags again
BRK_TELEMON XOPEN ; launch primitive ROM BRK_TELEMON XOPEN ; launch primitive ROM
rts rts
.endproc .endproc

View File

@ -2,8 +2,6 @@
; jede jede@oric.org 2017-01-22 ; jede jede@oric.org 2017-01-22
; ;
.FEATURE c_comments,labels_without_colons,pc_assignment, loose_char_term
.export _read .export _read
.import popax .import popax
@ -11,7 +9,7 @@
.include "zeropage.inc" .include "zeropage.inc"
.include "telestrat.inc" .include "telestrat.inc"
; int read (int fd, void* buf, unsigned count); ;int read (int fd, void* buf, unsigned count);
.proc _read .proc _read
sta ptr1 ; count sta ptr1 ; count

View File

@ -59,7 +59,7 @@ L2: ldy #0
ldx #$0D ldx #$0D
L3: L3:
BRK_TELEMON XWR0 ; Macro BRK_TELEMON XWR0 ; Macro
inc ptr1 inc ptr1
bne L1 bne L1