There's no such thing as an 8-bit address.
I didn't think so either (excluding relative addresses), but that still leaves the ti83plus.inc thing unexplained.
Those are equates; in this case, that is a context which you would pass to _JError (I think).
Technically, an 8 bit address is possible, but they don't exist in the z80 aside from relative addressing, but a pure 8 bit processor would be forced to use an 8 bit address space.
_JError! That's what I needed. My error works. Laughing
Argh! There must be something wrong with this code, but I can't figure out what. It's supposed to shade some of the graph screen. Here's the original code:
Code:
21409301EEEE3EFF
77230C20010420F8C9

Let's see if I can translate it correctly:

Code:
ld hl,9340h
ld bc,EEEEh
ld a,FFh
label:
ld (hl),a
inc hl
inc c
jr NZ,next
inc b
next:
jr NZ,label
ret

I might have b and c mixed around, but I wouldn't think that would cause the program to crash.
ld hl,$4093 is translated 219340. Don't forget to switch the bytes!
I realized that a second before you posted and fixed it.
For starters, the graph buffer is DEFINITELY not at $4093 - that's in ROM. It's somewhere above $8000; double-check your tables.

Edit: no fair, you edited it. Razz
Actually, I don't think anything is at $40983. Laughing
Incorrect - there's definitely stuff there related to the TI-OS. Razz
I thought addresses only went up to $FFFF.
Kerm edited his post, the cheater... Razz
Can you find the flaws in my code, or are you still pondering?
What are the $EE's supposed to mean?
Since I couldn't think of a better way to do this (16-bit incrementing doesn't alter flags), it's supposed to increment bc (in a manual, makeshift way) until it gets to $0000, when the program will stop. $EEEE is just a random number that I put into bc, hoping that it will cause a small enough amount of loopage that my program will only shade part of the graph screen and not any other memory.
How are you people translating this? Do you just know what the asm = in hex? o.O
No, they aren't magic. Well most of them aren't.
We use what's called a z80 instruction set reference. The good ones include the instruction mnemonic and assembled hexadecimal/binary value as well as timings, size and flags.
For example, WikiTI.
Check if bc is zero:

Code:
ld a,b
or c


Edit: Also, $EEEE is not a good idea, because it will go through the loop $1112 times, and the graph buffer has only $0300 bytes in it.
calc84maniac wrote:
Kerm edited his post, the cheater... Razz
I also edited haveacalc's post to match mine, but then he edited his back. Very Happy

$EEEE is definitely a bad idea. Just load $300 into bc and run the loop, decrementing bc each time and doing calc's zero-check at each loop.
I completely forgot about "or", which is sad since that's one of the groups of instructions that I memorized the opcodes for. Wink It works now, though:
Code:
214093010003
36FF230B78B120F8C9
or:
Code:
ld hl,9340h
ld bc,300h
theplacetobe:
ld (hl),FFh
inc hl
dec bc
ld a,b
or c
jr NZ,theplacetobe
ret

Thanks again to those those who helped. I think I'll refrain from asking questions from now on; not only do think that I could figure it out eventually, but it's pretty bad for my problem-solving skills to rely on others so often.
  
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 2 of 4
» All times are UTC - 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