move setup of stdin/stdout/stderr from crt0.s to getfd.s
git-svn-id: svn://svn.cc65.org/cc65/trunk@4472 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "atari.inc"
|
.include "atari.inc"
|
||||||
.include "_file.inc"
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; EXE header
|
; EXE header
|
||||||
@@ -101,18 +100,6 @@ L1: lda sp,x
|
|||||||
lda #$FF
|
lda #$FF
|
||||||
sta CH
|
sta CH
|
||||||
|
|
||||||
; set stdio stream handles
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
jsr getfd
|
|
||||||
sta __filetab + (0 * .sizeof(_FILE)); setup stdin
|
|
||||||
lda #0
|
|
||||||
jsr getfd
|
|
||||||
sta __filetab + (1 * .sizeof(_FILE)); setup stdout
|
|
||||||
lda #0
|
|
||||||
jsr getfd
|
|
||||||
sta __filetab + (2 * .sizeof(_FILE)); setup stderr
|
|
||||||
|
|
||||||
; Push arguments and call main
|
; Push arguments and call main
|
||||||
|
|
||||||
jsr callmain
|
jsr callmain
|
||||||
|
|||||||
@@ -7,12 +7,15 @@
|
|||||||
|
|
||||||
.include "atari.inc"
|
.include "atari.inc"
|
||||||
.include "fd.inc"
|
.include "fd.inc"
|
||||||
|
.include "_file.inc"
|
||||||
.importzp tmp1
|
.importzp tmp1
|
||||||
|
|
||||||
.export fdt_to_fdi,getfd
|
.export fdt_to_fdi,getfd
|
||||||
.export fd_table,fd_index
|
.export fd_table,fd_index
|
||||||
.export ___fd_table,___fd_index ; for test(debug purposes only
|
.export ___fd_table,___fd_index ; for test(debug purposes only
|
||||||
|
|
||||||
|
.constructor initfds,24
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
___fd_index:
|
___fd_index:
|
||||||
@@ -32,6 +35,23 @@ fd_table: ; each entry represents an open iocb
|
|||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
|
; set stdio stream handles
|
||||||
|
|
||||||
|
.proc initfds
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
jsr getfd
|
||||||
|
sta __filetab + (0 * .sizeof(_FILE)); setup stdin
|
||||||
|
lda #0
|
||||||
|
jsr getfd
|
||||||
|
sta __filetab + (1 * .sizeof(_FILE)); setup stdout
|
||||||
|
lda #0
|
||||||
|
jsr getfd
|
||||||
|
sta __filetab + (2 * .sizeof(_FILE)); setup stderr
|
||||||
|
rts
|
||||||
|
|
||||||
|
.endproc
|
||||||
|
|
||||||
; fdt_to_fdi
|
; fdt_to_fdi
|
||||||
; returns a fd_index entry pointing to the given ft_table entry
|
; returns a fd_index entry pointing to the given ft_table entry
|
||||||
; get fd_table entry in A
|
; get fd_table entry in A
|
||||||
|
|||||||
Reference in New Issue
Block a user