[A83] Re: Running Asm From Asm For Ti-83+


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

[A83] Re: Running Asm From Asm For Ti-83+




If you write your own asm program loader, you need to

1. Insert memory equvialent to the program size at UserMem
2. Copy the data of the program to UserMem
3. Run it using call usermem
4. Delete the mem that was inserted.=20

What makes this a bit hard to program, is that you have to=20
bcall(_delmem) and bcall(_insertmem) from a memory location
below usermem. In this example, I placed these routines in OP1.

Anyway, here's the source:

 #include "ti83plus.inc"
.org userMem-2=20
.db $BB,$6D=20

 ld hl,name
 rst 20h  ;Copy to OP1
 bcall(_chkfindsym)
 ex de,hl
 ld c,(hl)
 inc hl
 ld b,(hl) ;Size->BC
 inc hl  ;Skip the AsmPrgm token
 inc hl
 inc hl

 push hl
 push bc  ;Save size and address
 ld hl,insertmem
 rst 20h  ;Copy the memory insert routine
 ld de,usermem ;Where to insert mem
 pop hl   ;Size->HL
 push hl
 jp op1   ;Insert the mem

return:=20
 pop hl  =20
 add hl,bc  ;Get offset to the program
 push bc
 ld de,usermem
 ldir    ;Copy it to usermem
=20
 call usermem ;Run it
 ld hl,delmem
 pop de
 add hl,de  ;get correct pointer to the delmem routine
 push de
 rst 20h   ;Copy to to op1
 ld hl,usermem
 pop de
 jp op1   ;Done!


;These routines is run from OP1
insertmem
 bcall(_insertmem)
 pop bc
 ld hl,return
 add hl,bc
 jp (hl)

delmem:
 bcall(_delmem)
 ret
=20
name
;This is the name of the program you want to run
.db progobj,"LIVELONG",0
.end


//David Lindstr=F6m
Cirrus Programming, http://cirrus.tigalaxy.com



----- Original Message -----=20
From: "Alexandre =C9mond" <instriker@hotmail.com>
To: <assembly-83@lists.ticalc.org>
Sent: Sunday, May 26, 2002 3:39 AM
Subject: [A83] Running Asm From Asm For Ti-83+


>=20
> I read the asmguru tutorial on how to execute a program (tut. 29), but =
this=20
> one is for the ti-83-... Does someone know how to do this but on the =
ti-83+?=20
> (an example would help me a lot)
>=20
>=20
>=20
> _________________________________________________________________
> Envoyez et recevez des messages Hotmail sur votre p=E9riph=E9rique =
mobile :=20
> http://mobile.msn.com
>=20
>=20





References: