Then I should save SP's initial address at the beginning of the prog and restore it at the end? That makes perfect sense.
haveacalc wrote:
Then I should save SP's initial address at the beginning of the prog and restore it at the end? That makes perfect sense.
No... You should just not pop without pushing, and you shouldn't do math operations on the SP at all.. Remember, if you screw with the SP, all the calls and rets will be messed up, too
Seriously, go read the tutorial on it rather than asking questions that are answered *gasp* IN THE TUTORIAL
KermMartian wrote:
Since when is the pop instruction two bytes? I think you're using the wrong opcode. And yes, you have to match pushes and pops - never pop until you've pushed.
C9 = ret, and I assume D1 = pop de.
Ah, I didn't get too much sleep; I don't think I actually looked at what the numbers were. I just noticed it was 4 nibbles and went from there.
Ok, I've solidly memorized the first 256 opcodes. I fully understand them all except for DAA, which I can't find good documentation for. Is it something I should know about?
Edit: Never mind, I just found a place that described it well. It sucks.
Edit: Never mind, I just found a place that described it well. It sucks.
haveacalc wrote:
Oh. I thought it would be something like "Grassembly".
I personally thought it was Global System for Mobile Communications.
brandonw wrote:
haveacalc wrote:
Oh. I thought it would be something like "Grassembly".
I personally thought it was Global System for Mobile Communications.
its that too :p
I used daa to keep it in "decimal" so I wouldn't have to divide by 10 repeatedly to get the digits, that would delay a lot (relatively).
This makes no sense to me! I've gone over my code, but I can't find a reason for this happening. It's supposed to output 2 8x8 bitmaps (one shaded, one not) at the third LCD row and then loop endlessly on a grayscale square in the top-left hand corner of the screen. Instead, I get rectangles everywhere, the run indicator moves to the center of the screen (along with another black rectangle), and the gs square is really flickery. If anyone has free time they'd like to devote to helping me out, I'd be that much happier. Here's the code:
Code:
or (I hope I don't mess up):
Code:
I know it's horribly unoptimized, but the use for my drawing subroutine will vary slightly as the program progresses (I'm not near done with it).
Code:
AsmPrgm
180E
3E80D310CD0B007ED3112310F7C9
0608214093
36002310FB
0608
36FF2310FB
2140933E220610CD0B00D310CD979D
2140933E200608CD0B00D310CD979D
0608CD979D0000
18E8
or (I hope I don't mess up):
Code:
jr first
called:
ld a,$80
out ($10),a
call $000B
ld a,(hl)
out ($11),a
inc hl
djnz called
ret
first:
ld b,$08
ld hl,$9340
ld (hl),0
inc hl
djnz first
second:
ld b,$08
ld (hl),$FF
inc hl
djnz second
ld hl,$9340
ld a,$22
ld b,$10
call $000b
out ($10),a
call $9D97
ld hl,$9340
ld a,$20
ld b,$08
call $000B
out ($10),a
call $9D97
doom:
ld b,$08
call $9D97
nop
nop
jr doom
I know it's horribly unoptimized, but the use for my drawing subroutine will vary slightly as the program progresses (I'm not near done with it).
If the greyscale is flickering, it's because of your picture data.
use:
.db %10101010
.db %01010101
instead of:
.db %11111111
.db %00000000
use:
.db %10101010
.db %01010101
instead of:
.db %11111111
.db %00000000
Rush Hour
Version 1.3. Works completely, check it out here
Version 1.3 has support for two special cars to be removed, an on-calc level editor, and flash-memory support that actually works correctly.
Please "encourage" me to work more on Anyway you feel like (personal messages, spam, poke me with a stick, even better if it's Weregoose's stick of optimization, etc.)
Version 1.3. Works completely, check it out here
Version 1.3 has support for two special cars to be removed, an on-calc level editor, and flash-memory support that actually works correctly.
Please "encourage" me to work more on Anyway you feel like (personal messages, spam, poke me with a stick, even better if it's Weregoose's stick of optimization, etc.)
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
» Go to Registration page
» Goto page Previous 1, 2, 3, 4
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 4 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
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