[A83] Re: Using ZDS to compile programs
[Prev][Next][Index][Thread]
[A83] Re: Using ZDS to compile programs
Oh yeah...it involves a lot more than just changing the header file! :)
Firstly, after your header you need a jump table to allow the calculator to
jump between pages. Thing is, the calculator will start executing 128 bytes
into the application, so before the jump table add a jp to the start app
label (not jr, jp LABEL is a 3-byte instruction). You also need to pad out
the header so that the jump table is aligned to a byte number divisible by
3. So:
; Application Header + additional byte of padding (128/3 = 42r2)
jp StartApp
; Jump table
StartApp:
; Application code
The jump table looks like:
dw <labelname>
db <page-label-is-on>
You can see why we need to align to 3 bytes now. Note that labelname will
actually need to be preceded by an underscore mark, since you must B_CALL
across pages.
Right, NOW what you need to do is create a jump table include file to
reference the address in the jump table. So for:
dw Page1Call
db 0
dw Page2Call
db 1
You'd have this in your jump table include file:
_Page1Call equ 44*3 ; (128+1+3 / 3 = 44)
_Page2Call equ 45*3
...you also have to change the appheader 080h,081h field to reflect the
additional pages. You will also need to make sure that labels are made
global through the use of public and externs.
We also need to make some changes to the linker. Add a new overlay area:
Bank Area Name = OVERLAY
Address Space = ROM
Bounds = Range
Radix = Hexadecimal
Start address = 4000
End (address) = 7FFF
Now, add new overlays for each of your pages:
Overlay section = PAGEx
In Bank Area = Overlay
Locate at Address = nn4000
Where x is the page and nn is the page number in hex. Finally, you will need
to specify what asm files are on what page - this is done like this:
DEFINE PAGEX, SPACE=ROM
SEGMENT PAGEX
at the top of your source files.
Here is an example:
;;;;; page1.asm ;;;;;;;
DEFINE PAGE0, SPACE=ROM
SEGMENT PAGE0
EXTERN Page2Routine
include "ti83plus.inc"
include "jumptable.inc"
; Most of the header removed...
db 080h,081h
db 02h
; Most of the header removed...
jp StartApp
db 0
dw Page2Routine
db 1
StartApp:
; whatever
;;;;; page2.asm ;;;;;;;
DEFINE PAGE1, SPACE=ROM
SEGMENT PAGE1
include "ti83plus.inc"
include "jumptable.inc"
Public Page2Routine
Page2Routine:
; whatever
------------------------------
This should compile fine. Remember that you must fillapp after compilation -
even if you are running the app on the FlashSim.
Phew, well I hope that helps. If you need more help, just mail!
Later,
James.
> -----Original Message-----
> From: assembly-83-bounce@lists.ticalc.org
> [mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of R. Harper
> Maddox
> Sent: 02 December 2001 16:27
> To: assembly-83@lists.ticalc.org
> Subject: [A83] Re: Using ZDS to compile programs
>
>
>
> At 01:35 PM 12/2/01 +0000, you wrote:
>
>
> >How does Assembly Studio 8x handle multipage apps. Those are hard (but
> >doable) on ZDS.
> >
> >Regards,
> >
> >James.
>
> *How do you do a multipage app on ZDS*? I tried to do this, but
> it appears
> to involve more than changing the header.
>
> -harper
>
>
>
References: