]> git.sur5r.net Git - cc65/blob - libsrc/lynx/exec.s
Updated to use cbm_kernal.inc. Whitespace cleanups
[cc65] / libsrc / lynx / exec.s
1 ;
2 ; Karri Kaksonen, 2010
3 ;
4 ; lynx_exec(fileno) loads a file into memory but after the read the CPU
5 ; does a jump into the loaded start address.
6 ;
7 ; lynx_exec is often used in compilation carts when you run small demos
8 ; created with various (non-cc65) compilers.
9
10 ; void lynx_exec(int fileno)
11 ;
12         .importzp       _FileDestAddr
13         .import         pushax,ldax0sp,incsp2
14         .import         _lynx_load
15         .export         _lynx_exec
16
17 ; ---------------------------------------------------------------
18 ; void __near__ __fastcall__ lynx_exec (int)
19 ; ---------------------------------------------------------------
20
21 .segment        "CODE"
22
23 .proc   _lynx_exec: near
24
25 .segment        "CODE"
26
27         jsr     pushax
28         jsr     ldax0sp
29         jsr     _lynx_load
30         jsr     incsp2
31         jmp     (_FileDestAddr)
32
33 .endproc
34