Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 03 Jun 2010 06:46:57 pm    Post subject:

Speaking in terms of writing a custom OS for TI-83/84(P)(SE), any ideas on what to do instead of reimplementing TI's b_call stuff? I mean, if you always developed code on a computer, you could write a macro to do the page swap and call the function, but how do you equate an identifier to 2 diff. numbers: one for the page and one for the address? Also, for developing on-calc, you would need an exhaustive list of names for all system calls to parse with. I would image TI-OS has a small one, but it only contains strings for the catalog functions, not EVERY system call--that would get pretty big. Thanks.

EDIT: fixed spelling


Last edited by Guest on 03 Jun 2010 06:48:21 pm; edited 1 time in total
Back to top
calcdude84se


Member


Joined: 09 Aug 2009
Posts: 207

Posted: 03 Jun 2010 08:02:26 pm    Post subject:

Just in general terms of system calls and off-page calling, or would this be a compatibility layer? When you do a bcall, you're only passing two bytes to the bcall routine, which selects the correct page by some-means-I-can't-remember-right-now. With more specificity I can probably answer your question.

Last edited by Guest on 03 Jun 2010 08:02:36 pm; edited 1 time in total
Back to top
fullmetalcoder


Member


Joined: 01 Aug 2009
Posts: 139

Posted: 06 Jun 2010 05:01:12 am    Post subject:

calcdude84se wrote:

Just in general terms of system calls and off-page calling, or would this be a compatibility layer? When you do a bcall, you're only passing two bytes to the bcall routine, which selects the correct page by some-means-I-can't-remember-right-now. With more specificity I can probably answer your question.

The bcall routine uses the bcall parameter to determine on which page to find the vector table and which entry of the vector table to read, then swap that page, read the routine location (page and actual address) swap the new page in and jump to the proper location. For that to work properly some messing with stack is obviously required (most notably to return to a place where page swapping can be undone before returning to the caller. For a complete implementation you can have a look at XOS code : http://code.google.com/p/8xpos/source/browse/trunk/trunk/lib/bcall.z80

This cannot be done as easily from "user-space" because the bottom 16k of memory are the only one that cannot be swapped.


Last edited by Guest on 06 Jun 2010 05:08:16 am; edited 1 time in total
Back to top
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 07 Jun 2010 05:48:17 pm    Post subject:

alright, thanks. I'll have a look.
Back to top
bobmorton


Newbie


Joined: 24 Jan 2011
Posts: 1

Posted: 24 Jan 2011 11:55:14 pm    Post subject:

Thank you for the info. I have to look for this also. Thanks again.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 25 Jan 2011 12:35:38 am    Post subject:

Pretty much, the B_Call routine works like this...
First, remember that call and rst push the PC value onto the stack. When B_Call is called, it is RST 28h, so it goes to address 0028. From there, it happens to be that it jumps to another address where the actual routine is.

From there, it uses SP to read the value of PC. That address points to the byte after EF, (the LSB). After loading the two bytes and incrementing the twice, the new PC value is stored back on the stack. Then the routine checks for what model the calc is to figure out which page has the actual address of the call. It loads that page into port 6 (membank 1) and then it gets 3 bytes at the address... the page the B_Call is on and the address. The new page is loaded into port 6 and control jumps to the address.

Yeah, it's a bit complicated... I have used a similar enough method before, though, and I have read through the OS a little in my spare time, so I have a decent understanding. If you have specific questions, I can *try* to answer them Very Happy
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 

Advertisement