First off, in a multipage app, is this even necessary?

If so, can someone teach me how to create a routine lookup table in a flash app, then how to get and return from a routine, using the data from this table. And what is the code to switch flash pages? Is it a b_call or a hack?
It actually depends. I prefer to use my own routines to swap tables because it's usually faster. Essentially, you have the routine used to swap the pages outside the 0x4000-0x7FFF range, which IIRC writes to port 6 to actually swap the pages.

You could either use a look up table on first page (requires swapping in the first page if you are on any other page before going to the actual routine. ie. slower) or you could have it in ram.

Basically, a lookup table isn't all that necessary. You could, for example, load the address to jump to in DE, and a page offset (0-X) into the c register. (I just used those registers, but you can use different ones if you need/want to) That causes more code per each call (I think 8 or so bytes), and is also more difficult if you change the name of a routine, or the page it's on. For a look up table, you change the page location in one spot, but with calling it directly, it's harder.

Of course, that could be mitigated by making the program slightly more complex, by having something like this:

Function1Address: dw Function1 ; I don't remember, is dw correct?
Function1Page: db Page1 ; Where Page1 is defined to be 1

So basically, you have a few options.
Yes, this is necessary. If you are just bcall'ing around your own application, and you're using Brass and/or the Doors CS SDK, all you need is, for example:


Code:
.branch FileSaveAs


If you want programs or apps to use your routines, then you put a jp to a bcall() somewhere in a fixed location on the first page.
And what does .branch do?
ACagliano wrote:
And what does .branch do?
It generates a page_offset:address vector for that particular call inside the app, so that the bcall() call itself (rst 28h) will know what page and address to jump to when you bcall that routine from inside your app.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement