so in if with hex i got to 19 it would stay as 19 but then once i got to 20 it would b a then after alphabet it would switch to 20.
$20 = 2*[16^1] + 0*[16^0] = 32 decimal
20/16 = 1 rem 4 = $14
True. I was trying to explain this to him last night on the SAX, but it seemed like either the SAX was the best media for this, I was inept at explaining, or he was inept at learning. In the end, it looks like I failed to get the point across. To make amends for wasting your time, here's how the code should go, in two versions. One avoids hex, the other is a fixed version of your method:


Code:
#include "begin.inc"
.LIST
.org 9327h
 ld hl,$0000
 ld (pencol),hl
 ld hl,str
 call _vputs
 ld hl,$0600
 ld (pencol),hl
 call _vputs
 ld hl,$0C00
 ld (pencol),hl
 ld hl,str
 call _vputs
 ret
str:
 .db "Hello World",0
.end
END



Code:
#include "begin.inc"
.LIST
.org 9327h
 ld hl,0
 ld (pencol),hl
 ld hl,str
 call _vputs
 ld hl,6*256+0  ;row*256 + column, I left the zero on just to show you
 ld (pencol),hl
 call _vputs
 ld hl,12*256+0
 ld (pencol),hl
 ld hl,str
 call _vputs
 ret
str:
 .db "Hello World",0
.end
END


The reason the *256 trick works is, after you multiply it by 256, you have essentially bit shifted it 8 digits so that it now exists in the beginning of H. The other one is added in, and therefore stored to L.
well i found another way to do it. all i have to do is use the calculator in the acessories menu and switch it to scientific the type a decimal number than push hex and it is converted.
The thing I don't understand is why he's doing this:


Code:
 ld hl,6*256+0  ;row*256 + column, I left the zero on just to show you
 ld (pencol),0
 ld hl,12*256+0
 ld (pencol),hl
wtf? There's absolutely no point to that, unless a ld hl and a vputs are missing.
that is exactly what is missing.
lafferjm wrote:
that is exactly what is missing.
Aha, now it makes perfect sense to me. And Chip, I thought that was an excellent explanation of hex. Smile
Sorry, I copied from his code, and assumed that I didn't have to check for such error (I was just filling in the correct hex values).

Thanks Kerm Very Happy
/me gives Chipmaster a high-five. Cemetech tech support!

Heh. Heheh. Anyway...
I fixed my above code, so it should work now (unless I missed something else).
There you go, bugfree now. Hmm, should Cemetech make ASM tutorials...?
Hmm, perhaps. I'd help out as much as I could. Perhaps we could make it cover even more than asmin28days does. Like include how to use all the bcalls, and go more indepth about certain areas.

Either that, or we can continue our excellent ASM tech support (which I love doing), and one day gain a reputation as the great ASM teachers! Smile
Chipmaster wrote:
Hmm, perhaps. I'd help out as much as I could. Perhaps we could make it cover even more than asmin28days does. Like include how to use all the bcalls, and go more indepth about certain areas.

Either that, or we can continue our excellent ASM tech support (which I love doing), and one day gain a reputation as the great ASM teachers! Smile
That sounds like a plan for now, given how many projects we all have anyway.
  
Page 2 of 2
» 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