Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Xeda112358 on November 13, 2010, 12:11:04 pm

Title: Something is wrong...
Post by: Xeda112358 on November 13, 2010, 12:11:04 pm
In my latest program I am having a problem with this code:
Code: [Select]
Call ConvRStr        ;Converts a decimal string into hex and stores it to BC
ld a,c
ld (curRow),a
Call ConvRStr
ld a,c
ld (curCol),a
ret
ConvRStr converts a string of decimal digits into hex in BC. So "123" would make BC=7Bh. ConvRStr works properly, but the code isn't setting the cursor position correctly. Any ideas why?


EDIT: Okay, never mind. I have no idea why, but I decided to add the code to actually display text and it worked. I am still confused about why it didn't work before, but it works now. My problem is fixed now.
Title: Re: Something is wrong...
Post by: calcdude84se on November 14, 2010, 11:11:08 am
We probably should figure out why it wasn't working ;) (Mainly so that it doesn't happen again.)
How does ConvRStr take its arguments? Does it take a pointer in hl to a series of characters, or something different?
From how you are using it, it looks like it does. It also seems to advance hl, so you could have something like .db "64",0,"39",0 and convert two strings to hex. (Technically they aren't being converted to hex, but I can't think of a better description.)
Your problem might be that you're using curRow and curCol (for the homescreen) when you should be using penRow and penCol (for the graphscreen).
Anything I missed or got incorrect? ;D (Your code is pretty vague, so I had to assume a lot.)
Title: Re: Something is wrong...
Post by: Xeda112358 on November 14, 2010, 11:36:49 am
Well, the problem isn't there anymore, but I am still curious about what happened and I did actually want curCol and CurRow, but the penCol and penRow might be fun to play with. Any who, here is what ConvRStr does:
Code: [Select]
This is used in my BASIC ReCode project to convert real number strings into hex
Inputs:
     HL is the pointer to the real string (or the byte before)
Output:
     (86ECh) has the converted value --This will likely change, but for now it is this
     BC contains the converted value
     HL points to the byte after the string
So when I was making the "Disp " command, I would do something like Disp 1,2,HELLO and it would need to convert that 1 and put it in curCol, convert the 2 and store it it curRow, and then display HELLO. Again, it works now and before, the values were converted correctly, but before I actually added the displaying portion, it wasn't setting the cursor where I wanted it.

I am pretty sure it was because after the ReCode section (so in the BASIC part of the program), I used "Pause Ans" to check where the cursor was.
Title: Re: Something is wrong...
Post by: calcdude84se on November 14, 2010, 01:31:11 pm
Pause does change the cursor location, so I guess that might be it.
I didn't realize this was for ReCode. Good luck! :D
Title: Re: Something is wrong...
Post by: Xeda112358 on November 14, 2010, 03:35:55 pm
Okay, thanks! I think that I will post any other problems I run into, here.
Title: Re: Something is wrong...
Post by: Munchor on November 14, 2010, 03:43:18 pm
Okay, thanks! I think that I will post any other problems I run into, here.

Why don't you post them in Recode Thread, just asking :s
Title: Re: Something is wrong...
Post by: Xeda112358 on November 14, 2010, 03:48:09 pm
Okay, thanks! I think that I will post any other problems I run into, here.

Why don't you post them in Recode Thread, just asking :s

Good point... Sounds a little more intelligent :D
Title: Re: Something is wrong...
Post by: DJ Omnimaga on November 15, 2010, 12:39:13 am
Questions posted outside the help forums tend to be ignored more, so it's generally best to ask them in help section, because most helpers will not expect them to be asked elsewhere, thus, they will miss them.