[z80 ASM]Building a mutlipage APP 2 to 3 pages
Moderator: MaxCoderz Staff
[z80 ASM]Building a mutlipage APP 2 to 3 pages
Ok I have like a little bit of knowledge about building a multipage APP. One question though
if page 1 = $4000, page 2 = $8000, then does page 3 = $C000 and page 4 = $FFFF?????So is it possible to build a 5 page app?
Also I know about the dummy compiling. Like by compiling the second page and adding $4000 to it. But how would I set the part of the program on the second page. Just make a second source file with .org $8000 in it?? Same question for page 3. I am in need of help!
if page 1 = $4000, page 2 = $8000, then does page 3 = $C000 and page 4 = $FFFF?????So is it possible to build a 5 page app?
Also I know about the dummy compiling. Like by compiling the second page and adding $4000 to it. But how would I set the part of the program on the second page. Just make a second source file with .org $8000 in it?? Same question for page 3. I am in need of help!
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
page 4 would be $10000 wouldn't it?
anyway: no.
new pages start at $4000 afaik
you've seen this haven't you?
anyway: no.
new pages start at $4000 afaik
you've seen this haven't you?
no I don't think so cause I did all the math and $FFFF = 65535
and that link seems easy enough but I don't really like yo use Brass. And I don't get it. How do both pages go no $4000
and that link seems easy enough but I don't really like yo use Brass. And I don't get it. How do both pages go no $4000
Last edited by Halifax on Sat 10 Mar, 2007 7:21 pm, edited 1 time in total.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
with all the F's it would be 1 less than 16k added to the last one, it would be the last byte of the page before..
anyway, use that link and knowledge will come to you
anyway, use that link and knowledge will come to you
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
What do you mean?
just define 2 pages instead of 1, and put ".page 1" on your second page.
Then add branchrules and you're ready to bcall your other page.
Alternatively you could swap your other page through port 7(right?) so it will be at $8000 (in which case you use define the second page as starting at $8000)
just define 2 pages instead of 1, and put ".page 1" on your second page.
Then add branchrules and you're ready to bcall your other page.
Alternatively you could swap your other page through port 7(right?) so it will be at $8000 (in which case you use define the second page as starting at $8000)
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
That's what I said, except you could theoretically swap in a page at $8000 if you really wanted to (disable interrupts and don't use any system routines!), you would swap away your saferam, but it might be useful for something (like storing something huge and need your other page accessible at the same time)
Far better just to use the normal way and start every page at $4000..
Every page starts at $4000 because it will be in that place, as controlled by port 6 (and 5). If you don't use Brass then give up, it will be too hard to make multypage apps anyway.
It's best to have data which is used by a routine on the same page as the routine but you could either load it in saferam or, DI and swap in the other page at $8000 (don't forget to relocate and don't use any bcalls, and like I said it would be kinda crazy)
why don't you use Brass anyway?
Far better just to use the normal way and start every page at $4000..
Every page starts at $4000 because it will be in that place, as controlled by port 6 (and 5). If you don't use Brass then give up, it will be too hard to make multypage apps anyway.
It's best to have data which is used by a routine on the same page as the routine but you could either load it in saferam or, DI and swap in the other page at $8000 (don't forget to relocate and don't use any bcalls, and like I said it would be kinda crazy)
why don't you use Brass anyway?
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
Another attempt to explain how the hardware works:
the calc refers to ti83p/84p (SE)
As you know the calc has 64kb addressable memory (?), wich start at $0000, $4000, $8000, $C000 respectively, note that they're all 16kb in size
the first 2 pages are used with the flash, the last two are ram
The calc has lots (not!...) of flash memory, they don't fit in those 64kb! so only a part (flash page) is shown, the part that is shown can be controlled using ports (see above)
That part is then drawn to the 2nd page (and only the second page!), if you're making multipage apps, each flash page is stored sequentionelly in flash memory, to access the other flash pages you can use B_CALLs or do things manually, but only one flash page is shown at the same time. So if currently page 2 of you're app is loaded, it is loaded to $4000 and the other page (ie page1) is gone!
visual:
This has far reaching implications:
- You cannot jump directly to another app page, because that page isn't loaded and you will jump to that address in the wrong page! (your calc will most likely crash)
- Don't change the page with code that is located on that page! You have to copy a routine to ram to do the trick
- ... there are probabely more things
I hope I made some stuff clear here
note that I tried to keep things simple and only write relevant stuff to not make things too complicated (because stuff above is correct but maybe too much irrelevant things)
(?) I'm not sure if this name is correct
the calc refers to ti83p/84p (SE)
As you know the calc has 64kb addressable memory (?), wich start at $0000, $4000, $8000, $C000 respectively, note that they're all 16kb in size
the first 2 pages are used with the flash, the last two are ram
The calc has lots (not!...) of flash memory, they don't fit in those 64kb! so only a part (flash page) is shown, the part that is shown can be controlled using ports (see above)
That part is then drawn to the 2nd page (and only the second page!), if you're making multipage apps, each flash page is stored sequentionelly in flash memory, to access the other flash pages you can use B_CALLs or do things manually, but only one flash page is shown at the same time. So if currently page 2 of you're app is loaded, it is loaded to $4000 and the other page (ie page1) is gone!
visual:
Code: Select all
+--------------+ $0000
| PAGE 1 | Fixed page, cannot be changed
+--------------+ $4000
| PAGE 2 | only ONE page of your app is loaded here
+--------------+ $8000
| PAGE 3 | Start of the ram, from here you can directly edit its contents
+--------------+ $C000
| PAGE 4 | more ram
+--------------+ $FFFF
- You cannot jump directly to another app page, because that page isn't loaded and you will jump to that address in the wrong page! (your calc will most likely crash)
- Don't change the page with code that is located on that page! You have to copy a routine to ram to do the trick
- ... there are probabely more things
I hope I made some stuff clear here
note that I tried to keep things simple and only write relevant stuff to not make things too complicated (because stuff above is correct but maybe too much irrelevant things)
(?) I'm not sure if this name is correct
Last edited by driesguldolf on Fri 18 May, 2007 8:24 am, edited 2 times in total.
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
well, RAM pages have high numbers (80h and up), you can map them in the same way as flash pages
port 6 can map RAM pages (and ROM as usual), and port 7 can map ROM pages (and RAM as usual), port 5 (SE/84 only) can only map RAM though.
so that is not correct, only close.the first 2 pages are used with the flash, the last two are ram
port 6 can map RAM pages (and ROM as usual), and port 7 can map ROM pages (and RAM as usual), port 5 (SE/84 only) can only map RAM though.
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
The portions of addressable memory that are switched in and out are more often referred to as Banks, a page is generally a section of memory on a particular chip.
Ram pages are can be mapped like flash, simply by setting a higher bit. However it should be avoided, since TI doesn't have as much concern reworking how ram pages work. If you wrote a program on the 83+ to map the ram at $4000 it would fail on the 84+. Further TI's paged memory routines don't like working with the ram as much. I know there's more than a few that would probably throw back an error if you tried to read through them.
Ram pages are can be mapped like flash, simply by setting a higher bit. However it should be avoided, since TI doesn't have as much concern reworking how ram pages work. If you wrote a program on the 83+ to map the ram at $4000 it would fail on the 84+. Further TI's paged memory routines don't like working with the ram as much. I know there's more than a few that would probably throw back an error if you tried to read through them.