Re: A86: Re: Bars


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

Re: A86: Re: Bars




I checked the header, and I did include the necessary info:

; input: HL = menu table
; output: chosen table address jumped to
; Note: routine must be jumped to!

Here is how you use the menu routine:

 ld hl,myMenu     ; point to menu table
 jp DoMenu        ; _MUST_ be a jump!!!

The routine JUMPS to the label that is picked, so if you call the routine,
then it will screw up the stack and crash the calc.  If you don't point to
the menu table with HL, then it will crash for sure.  But your table is
fine, if you jump to the routine it should work.  Make sure all of your
labels are ready to be jumped to, and don't just have a RET at the end
(though I guess if you wanted to you could CALL the menu and have the labels
RET to where the menu was called from, but I've never done it).

-----Original Message-----
From: Bowser797@aol.com <Bowser797@aol.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Monday, November 16, 1998 10:04 PM
Subject: Re: A86: Re: Bars


>
>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