[A83] Re: ASM program space alocation
[Prev][Next][Index][Thread]
[A83] Re: ASM program space alocation
Yeah, on the 83+ programs are used to userMem, which equals 9D95h... Because
asm programs are "org" at 9D95h (at least normal, no shell ones) they must be
copied to this location. I am assuming that the free memory on the calculator
must at least equal the size of the assembly program to run, and since the
assembly program is copied to 9D95h, you probably could use this for some
temporary storage. Of course you would have to run your assembly program from
somewhere else...
To go a little off topic, I found a neat little trick for those of you who wish
to run multiple assembly program from within one assembly program...see,
normally you can't do ChkFindSym and call DE after increasing it a few times,
but you can copy the entire program to 9D95h manually, assuming that the main
program is much larger than the program to be called, and you are doing this
from the end of the program. After copying, call 9D95h...then find the original
program in RAM and copy it back! I know that sounded a little
confusing...here's a small example...there may be a bug or two...this is just
to give an idea.
org 9D95h
StartOfProg:
Lots and lots of code...
...
... ;the size of this section (RunAnotherProg-StartOfProg) must be greater
... than the size of PROG2
...
RunAnotherProg:
ld hl,ProgDef
rst rMOV9TOOP1
B_CALL ChkFindSym
ret c ;return if not found
ld a,(de)
ld c,a
inc de
ld a,(de)
ld b,a
inc de
inc de
inc de
dec bc
dec bc ;there is a two byte token at the beginning of asm progs...i think
push bc ;save so we can restore faster
;we need to skip it
ld hl,9D95h
ex hl,de
ldir
call 9D95h ;execute the other program
ld hl,OriginalProg
rst rMOV9TOOP1
B_CALL ChkFindSym
inc de
inc de
inc de
inc de
pop bc
ld hl,9D95h
ex hl,de
ldir ;running program restored...
ld (yourMother),me ;continue the rest of your program
ProgDef: db ProtProgObj,"PROG2",0
OriginalProg: db ProtProgObj,"ORIG",0
Quoting Jimmy Pardey <j_pardey@hotmail.com>:
>
> Greetings and Salutations,
>
> When a program is executed on the calculator, the calculator moves
> it to
> a location (6346h or something) in ram. what space is allocated for this
>
> purpose? As far as I can see, the extra space would not be used, as that
>
> woud lead to the neccesity of major VAT shuffling, so it coud be used by
>
> programs for tempory data storage. Is that possible?
>
> Jimmy Pardey
>
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
Follow-Ups:
References: