A83: Menus & ZMENULIB
[Prev][Next][Index][Thread]
A83: Menus & ZMENULIB
Hello.
The menus play a big role in the TI-83 operating system. Some would say it is
the very core of the user interface. So how come we can't use it from asm?
The answer is simple; the menu routines accept 1 byte that specifies which
menu to put up. All menu-related rom calls read this 1-byte menu code, and
look up the rest in tables found in ROM. All menu-related rom calls check
this byte to see whether they should display the reset warning message,
whether they should build a program list etc. And all menu-related rom calls
refer to these hardcoded ROM tables and cannot be fed with pointers into ram.
The BASIC menus? Well, it's indeed complicated. You have to create several
temporary string variables, push them onto the fpstack, push the names of the
BASIC labels to jump to, all with proper memory checking and error handling.
And then you still get the ugly every-other-dot run inicator turned on all
the time. And then it doesn't work either. =)
There is only one solution to this (which Pat has actually told us). To write
your own menu routines. And I've done that.
ZMENULIB is a 395 bytes big file, containing ready-to-use menu code. It is
NOT a sos library. Instead, you have to look the program up, and jump to the
beginning of it. This way, it can be used by shell-independent programs (AND
sos programs of course).
Please have a look at the attached files; try running menutest.83p (Send9),
and then look at its source code. There is also a brief description in the
readme file.
Enjoy.
Linus
MenuLib83.zip