Re: A86: MenuLoop


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

Re: A86: MenuLoop




I'm not going to look at your whole code but I'll ask a few questions and
comment some of it for other people who want to look further.  (Use lots
of comments when you're beginning, it really helps you understand stuff.)
Do you know TI-BASIC?  I use the "->" symbol to discribe the load command.
 
 MenuLoop:
   EI		; unnecessary, interrupts are always on unless you turn them off (DI)
 sys_loop1:
   HALT			; take one for the batteries
   CALL 5371h		; this is _getky (outputs to OP2), you want _getkey ($55AA)
   OR A			; check if a key is pressed
   jr z,sys_loop1	; if no key loop until there is one. (JPs are faster but bigger) 
   LD L,A		; a -> l   Why?
   ld A,L		; l -> a   This step is pointless, A = L already cuz of last 
			; 	   step
   LD (var_a),A		; these two steps are the same as above, the first step is
   LD A,(var_a)		; functional, the second, pointless.  If you are trying to 	
			; exchange the two places you must use a third register

Sorry, I gave up quicker than I thought I would.  E-mail me personally describing
what you are trying to do.  I'll see if I can write it out and comment it for you
to learn off of.

-- 
Tercero	 --  Email: mailto:tercero@busprod.com

"The stone the builders rejected has become the capstone;"
			--Psalms 118:22
"Everyone who falls on that stone will be broken to pieces,
but he on whom it falls will be crushed."
			--Luke 20:18


References: