Re: A83: Running Assembly Programs!


[Prev][Next][Index][Thread]

Re: A83: Running Assembly Programs!




Don't forget to update any pointers you got from the symbol table when the asm
program has returned. Failing to do this will probably be the cause of several
future errors.

Hmm. A thought strikes me. What happens to 8565? This is where ti-os stores
the number of bytes inserted at 9327. But when you call _exec_assembly, this
value would be changed. So what happens when you return from your own program?
Does _exec_assembly store the original size on the stack, restoring it at
return?

Linus

On 15-Jun-98, James Matthews wrote:

>Damn, everyone said this was so hard before...but I thought I'd try what
>Trey said since it seemed really easy, and it is!

>Here's the code...

>;ZProg.z80
>;Run ZJames (ASM Program)

>.NOLIST
>#define equ .equ
>#define EQU .equ
>#define end .end
>#include "ti83asm.inc"
>#include "tokens.inc"
>.LIST

>_exec_assembly .equ 5102h
>PROGOBJ .equ 05h

>.org 9327h

>  call _zerooop1    ;
>  ld hl,progname1   ; the name of the prog
>  ld de,op1         ; copy it to op1
>  ld bc,7           ; 8 chars in name
>  ldir              ; do the copying
>  call _chkfindsym  ; look it up
>  call _exec_assembly
>  ret

>progname1:
>  .db PROGOBJ,"ZJAMES",0

>.end
>END

>Woah...simple right!  Barely worth a tutorial...I wonder if BASIC programs
>work the same way.   I'll try, and get back to you all if it does...

>Later,

>James.



Follow-Ups: References: