Re: A86: Re: Bars


[Prev][Next][Index][Thread]

Re: A86: Re: Bars




In a message dated 11/16/1998 9:00:31 PM Mountain Standard Time,
ti_86_asm@hotmail.com writes:

<< Someing simaler happend to mine 
 after useing it i tryed to display something and it tured out as 
 grabage.  But it did display the table right.
 

 >
 >Thanks for telling me about the include file.  That cleared up my 
 errors.
 >(duh...)  However, when I tried to use the menu in my program, it 
 printed a
 >lot of garbage, and crashed my calc.  Can you explain how it should be 
 used a
 >little?  Like, how do I set up the table?  I understand the sample, but 
 how
 >exactly would I structure my real one?  In the sample, it said "example
 >table:", but how do I refer to my table?  Is it a label, or what?
 >
 >This is my table
 >
 > .db 4
 > .db "Choose",0
 > .db "New Game",0
 > .db "Help",0
 > .db "Info",0
 > .db "Quit",0
 > .dw New
 > .dw Help
 > .dw Info
 > .dw Quit	
 >
 >Thanks for any help,
 >
 >Bowser
 > >>


All right, this is what I did.  Here are 2 examples:

	ld hl,menu_table

DoMenu:
	blah,blah,blah

menu_table:
	.db 3
	.db "My menu",0
	.db "Goto label 1",0
	.db "Goto label 2",0
	.db "Goto label 3",0
	.dw label_1
	.dw label_2
	.dw label_3

label_1:
	blah,blah,blah

label_2:
	blah,blah,blah

label_3:
	blah,blah,blah

.end


This example shows the run-in to the menu.  Here is another:

	ld hl,menu_table
	call _clrLCD
	ld b,1
	ld a,1
	cp b
	jp z,DoMenu
	cp nz,ret

DoMenu:
	blah,blah,blah

menu_table:
	.db 3
	.db "My menu",0
	.db "Goto label 1",0
	.db "Goto label 2",0
	.db "Goto label 3",0
	.dw label_1
	.dw label_2
	.dw label_3

label_1:
	blah,blah,blah

label_2:
	blah,blah,blah

label_3:
	blah,blah,blah

.end


The whole point of these are that you don't call the menu.  You have to either
do a run in to it or jump to it.  Simpe enough?  If not, just reply with more
info.  I did the best I could.

Dan