Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Hey, I'm just asking for some help with some ez80 asm programming.

Basically what I want the program to do is take in two values, one in the X variable, and the other in the Y variable, so I can use it as a subroutine in some other programs. It loads X into curCol, Y into curRow, then displays a character at that location.

I've done something, but it doesn't work, which I'm thinking is because I don't fully understand how _RclX and _RclY work:

call _homeup
call _ClrScrnFull
call _RclX
pop hl
ld (curCol), hl
call _RclY
pop hl
ld (curRow), hl
ld hl,Character
call _PutS
ret

Character:
.db $DD,0
You just need to issue a call to _ConvOP1:


Code:
call _HomeUp
call _ClrScrnFull
call _RclY
call _ConvOP1
ld (curRow), a
call _RclX
call _ConvOP1
ld (curCol), a
ld a, $dd
jp _PutC


Hope this helps Smile Also, you should really be using fasmg: https://github.com/CE-Programming/documentation
Yup, that probably crashes hard. What made you think doing POP HL was a good idea? The raw OS routines aren't C; they pass information via registers, not the stack. So you're clobbering your stack and will (probably) end up RETing into garbage.

Unfortunately, documentation on the TI-84 Plus CE is lacking. When it comes to the OS, in most cases, the only documentation you'll be able to find is the documentation for the TI-83 Plus. Fortunately, there are few radical changes between the two, so the TI-83 Plus documentation usually still applies.

Take _RclX, for example. The documentation says that the contents of X are copied to OP1, an 11-byte area of RAM with a fixed location. Before you can use the value in your own code, you'll have to convert it to a format you can use. For your purposes, the routine you want is _ConvOP1. There's no documentation on _ConvOP1 for the TI-84 Plus CE, but it's very likely that the TI-83 Plus documentation still applies.

curCol and curRow are 1-byte variables. Writing a 3-byte register to them is not going to have the intended effect---it'll clobber whatever is next in memory.
One more thing, if I wanted to use Ans to decide which character I wanted displayed to the screen, could I do it like this:

call _HomeUp
call _ClrScrnFull
call _RclAns
call _ConvOP1
ld b,a
call _RclY
call _ConvOP1
ld (curRow), a
call _RclX
call _ConvOP1
ld (curCol), a
ld a, b
jp _PutC

Last thing, actually, how do you make a "code" block?
No, because the other calls will destroy whatever is stored in the b register. You should just move it to the bottom.

I use this format:


Code:
[code]<code here>[/code]
Also, the source code to TextLib might help you.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement