RE: A86: Re: _getkey


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

RE: A86: Re: _getkey




Actually, TASM doesn't know what getky does or what results it will
yield.  It just switches all the aliases (like ld,jp,call) with hex
code.  Then it does some other funky stuff to make it TI-86 friendly (with
the help of string86 or whatever, hey i just use sm studio 86).  Anyway,
it's only going to tell you something's wrong if there is an unidentified
instruction, an instruction used in a way the z80 doesn't allow, etc.  It
doesn't care what getky does, that's the programmer's job.  If you write
this: (it's just an example, probably doesn't work, the calls are probably
named wrong, etc.)

checkkey:
	call _reset_mem
	cp K_ENTER
	jp z,enterwaspressed
	cp K_GRAPH
	jp z,graphwaspressed
	cp K_EXIT
	jp z,exitwaspressed
	jr checkkey

enterwaspressed:
;code goes here
	jp checkkey
graphwaspressed:
;code
	jp checkkey
exitwaspressed:
;code
	jp checkkey

and you try to assemble that, it should work fine.  TASM ain't gonna
complain that _reset_mem doesn't check keypresses...

So I think you should definitely check to make sure you have spaces before
each line of a code (not before labels) and any labels that you refer to
actually exist somewhere in the source.

Hope that helps


Diego

 On Sun, 6 Feb 2000, Brian Deuel
wrote:

> 
> 
> >I think the problem may (NOTE: may) be that you do not have spaces before
> >your ASM directives. e.g.:<snip>
> 
> Actually, other programs I've written have assembled just fine using the
> layout I've been using. I use TASM as my assembler.
> 
> Taking another look at my program, I assume if _getkey were to return
> anything, it would be a value in the accumulator to compare to the label
> (i.e. cp K_ENTER ;if a-K_ENTER=0) then jump if zero (jp z, ENTER). In other
> words, K_ENTER would equal 1, and _getkey would return 1 in the accumulator
> if enter was pressed. Again, I assume that this is not the correct behavior.
> _getkey returns no such value, based on the assembly errors. Does _getkey
> even contain these function labels? Is there a document that describes all
> of the ROM routines anywhere?
> 
> >ASM Studio might work for you, but TASM will screw up if you don't do that.
> >Otherwise, should work, though I recommend putting a HALT instruction in
> the
> >key loop to save battery power.
> 
> Thanks for the advise.
> 
> Brian
> 
> 
> 



Follow-Ups: References: