Menus in Assembler
![LoopyByteloose](https://forums.parallax.com/uploads/userpics/025/nC57NMH1BTW54.gif)
I am a bit stumped.· I have enough difficulty making a menu in PBasic, but I have need to create such in SASM.
I have Guenther's multiboard with RS232 connected to one of my CANbus boards via SPI.· What I would like to do is have an SX28 present a menu on my PC via Hyperterminal and I could respond via keyboard.· I intend the setup to be full duplex.
Any suggestions? [noparse][[/noparse]I do know that SX/B would be much easier]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
I have Guenther's multiboard with RS232 connected to one of my CANbus boards via SPI.· What I would like to do is have an SX28 present a menu on my PC via Hyperterminal and I could respond via keyboard.· I intend the setup to be full duplex.
Any suggestions? [noparse][[/noparse]I do know that SX/B would be much easier]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Comments
I agree. Creating a menu for the first time would be much easier in SX/B than trying to create one from scratch in assembler! So I would start there.
Here is how I would do it. First I would create the desired logic structure in SX/B. Then, if I needed to present it in assembly language I would use CTRL-L to list the assembly output. Then I would modify the code produced to fit the rest of my assembly program.
For example, to process a single byte value as a menu selection I would use the SX/B command LookDown to check for a valid menu selection followed by a Branch statement to go to the portion of my code that handles that menu selection.
Borrowing from an example in the SX/B help files...
Becomes...
If you examine this example for a while you should be able to figure out how it works. You need to change the variables, the menu options and the branch locations to fit your program. That should not be too difficult. 90% of the menu processing work is already done for you!
- Sparks
I'll print this out and try again.
I don't know if it is just me that has trouble with the concept of menus [noparse][[/noparse]branches and pointers, etc]. If not, please jump in and ask more questions as I can't think of the right ones.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
This can be done easier with the ON...GOTO command like:
Check out the help file for command "ON", it's very handy.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
·
I am still working on this and have done a lot of searching for a tutorial with a good approach.
The fundamentals seems to have been lost in the sands of time [noparse][[/noparse]was 1980 really that long ago?]
This is an important topic as it is one of the mainstays of user interface - very revelant when handed a keyboard and a screen. {other are the GUI and the command line interface}
This time it is an SX project.· With the Propeller doing video and characters, we seem to have to go back to such topics.· (I am still ponder the cursor, the delete and the backspace for TV Terminal too.)
I really don't want to do a command line interface, but I suppose it would be easier.· In fact, it might be easier to develop in comand line and morph to a menu.
Hmmm....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
Post Edited (Kramer) : 12/8/2006 5:21:04 PM GMT
If I knew of a good user interface tutorial I would point you to it. Unfortunately, I do not. Hopefully someone else will know of a good one.
In the mean time, if you would like help or ideas on what your menu should look like and how it should behave and function, etc., why not list all of the things you want your user to be able to do?
Maybe your options will fit well under a menu and sub-menu structure such as:
1.) Operations
2.) Configuration
3.) Advanced Settings
4.) Exit
etc.
Just a thought.
- Sparks
Kramer,
Take a look at this Nuts'N'Volts article:
http://www.parallax.com/dl/docs/cols/nv/vol2/col/nv62.pdf
Maybe you could apply some of Jon's concepts outlined here.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Somehow, it just doesn't sink in. I begin to wonder if I need more keys or less keys and how do I make them tie into the LCD output, and so on....
I get dizzy.
Nonetheless, I am making progress. Starting with a 'command line interface' and later sorting them into levels with related graphic screens seems to be really the right approach. In fact, I suspect that is why many DOS menu programs also came with a command line version.
It works for me.
With GUI I can see why everyone wants C. Just call the Library and ignore the low level stuff.
[noparse][[/noparse]But I suspect there is real $$$ in the low levels and embedded systems; all those C programers have to buy an interface. Hee Hee.]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········