2010-12-29 10:37:57 +00:00
|
|
|
;
|
|
|
|
; Karri Kaksonen, 2010
|
|
|
|
;
|
|
|
|
; lynx_exec(fileno) loads a file into memory but after the read the CPU
|
|
|
|
; does a jump into the loaded start address.
|
|
|
|
;
|
|
|
|
; lynx_exec is often used in compilation carts when you run small demos
|
|
|
|
; created with various (non-cc65) compilers.
|
|
|
|
;
|
|
|
|
; void lynx_exec(int fileno)
|
|
|
|
;
|
2013-05-09 11:56:54 +00:00
|
|
|
.importzp _FileDestAddr
|
|
|
|
.import pushax,ldax0sp,incsp2
|
|
|
|
.import _lynx_load
|
|
|
|
.export _lynx_exec
|
2010-12-29 10:37:57 +00:00
|
|
|
|
|
|
|
; ---------------------------------------------------------------
|
|
|
|
; void __near__ __fastcall__ lynx_exec (int)
|
|
|
|
; ---------------------------------------------------------------
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.segment "CODE"
|
2010-12-29 10:37:57 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _lynx_exec: near
|
2010-12-29 10:37:57 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.segment "CODE"
|
2010-12-29 10:37:57 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr pushax
|
|
|
|
jsr ldax0sp
|
|
|
|
jsr _lynx_load
|
|
|
|
jsr incsp2
|
|
|
|
jmp (_FileDestAddr)
|
2010-12-29 10:37:57 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|