[TI ASM] See any Errors???

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

[TI ASM] See any Errors???

Post by nepmarauder »

Hey,
This is code that I took from "Learn Assembly in 28 Days" for writing into a BASIC program.

Is there anything missing, because it crashes my calc every time.

NOTE: I used cz80 to compile it, cz80 doesn't use b_calls, this is the shortened version, no beginning or end, don't think that I am just a total idiot...


call CLEARSCREEN
LD HL, prog_name
call _mov9toop1
call _chkfindsym
JR C, IsOkay
call _delvararc
IsOkay:
LD HL, prog_data_end - prog_data
call _createprog
INC DE
INC DE
LD HL, prog_data
LD BC, prog_data_end - prog_data
LDIR
RET
prog_name:
.DB ProgObj, "TOSTRING"
prog_data:
#define tok2(token) t2ByteTok, token
.DB tLBrace, tX, tComma, t0, tRBrace, tStore, tListName, "TEMP1", tEnter
.DB tLBrace, t0, tComma, tX, tRBrace, tStore, tListName, "TEMP2", tEnter
.DB tLR, tListName, "TEMP1", tComma, tListName, "TEMP2", tComma, tVarEqu, tY1, tEnter
.DB tok2(tEquToStrng), tVarEqu, tY1, tComma, tVarStrng, tStr1, tRParen, tEnter
.DB tok2(tSubStrng), tVarStrng, tStr1, tComma, t1, tComma, tok2(tLength)
.DB tVarStrng, tStr1, tRParen, tSub, t4, tRParen, tStore, tVarStrng, tStr1, tEnter
.DB tok2(tDelVar), tListName, "TEMP1", tEnter
.DB tok2(tDelVar), tListName, "TEMP2", tEnter
.DB tok2(tDelVar), tVarEqu, tY1
prog_data_end:
; ClearScreen
call CLEARSCREEN
; EndExec
;END
CLEARSCREEN:
;clears the home screen
ld hl, VIDEOBUFF
ld de, VIDEOBUFF+1
ld (hl),0
ld bc, NUMSCREENBYTES-1
ldir
jp ionFastCopy
TI_CP16:
push hl
or a
sbc hl,de
pop hl
ret
;After about three hours of tweaking, I found this to be the most
;stable and effective way to read keys through the hardware (twice)
TI_GETKEY:
ld a, $ff
out (1), a
ld a, b
out (1), a
in a, (1)
and c
ret z
ld a, $ff
out (1), a
ld a, b
out (1), a
in a, (1)
and c
ret

It should work, right out of the tutorial, but it doesn't.
It could be cz80.

Could some one else compile the code, to see if it even works.

Thanks for your help.
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

You cant just shorten it to call if you intend to run it on the 83+.

You need to change it to rst 28h \ .dw XXXX Where XXXX is the entry point.

So instead of bcall(_mov9toop1) you could do rst 28h \ .dw _mov9toop1
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
lloydkirk1989
Calc Wizard
Posts: 680
Joined: Wed 22 Dec, 2004 5:37 am
Location: West Palm Beach,FL
Contact:

Post by lloydkirk1989 »

Why don't you just use TASM?
User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

Post by nepmarauder »

See, I started with Asm on TIPower. This was a good BASIC language for me to understand Asm. But, now I picking up more and more information and understanding of the coding system, from tutorials and from this forum page.

Scorbase for TI, I started writing on TIPower. I figured, instead of messing with the huge Asm file, I'll just add to the .TIP file (TIPower extension).

If this doesn't work, I'll just go ahead and use TASM.
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

Post by nepmarauder »

Holy sh**, OMFG, ahhhh buhhhhh.

I clicked on my prog in Mirage, screen flashed, went to Basic prog list, and TOSTRING was there.

Holy crap.

This makes my coding a whole lot easier.

Its funny how something as simple as rst 28h \ .dw _mov9toop1 can make programming so much easier.

Thanks Once Again!
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Mov9toop1 is also rst 20h (with nothing after it).
You know your hexadecimal output routine is broken when it displays the character 'G'.
User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

Post by nepmarauder »

Do you have any idea in how I could display .db variables in the BASIC program?

I tried this:

.db (LINE1A), tEnter

and:

.db LINE1A, tEnter

where:

LINE1A:
.db "code here"

Instead of displaying the text, it displays numbers and BASIC commands. My question is, how could I get just the value to display, like:

.db "code here", tEnter

Because that would work.
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Actual lowercase letters are not the same as lowercase letter tokens. You will need to replace each letter with the appropriate 3 byte (?) token, or just use uppercase.
You know your hexadecimal output routine is broken when it displays the character 'G'.
Andy_J
Calc Master
Posts: 1110
Joined: Mon 20 Dec, 2004 10:01 pm
Location: In the state of Roo Fearing
Contact:

Post by Andy_J »

Lowercase letters are two byte tokens.

I had typed a long-winded reply earlier, but my computer crashed, and I don't have the time to type it up again, or I would... Basically, you can't do it like that, you'll either have to do a couple copies or dereference it on the fly.
ImageImage
Image
User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

Post by nepmarauder »

Do you mean this:

.db (LINE1A), tenter

LINE1A:
.db "CODE HERE"

Because I already tried that and it did not work.

All I got was a few numbers and BASIC commands.

I will try couple more things.

P.S. I don't need lowercase, just uppercase. That is what I intended on doing from the start.
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
Andy_J
Calc Master
Posts: 1110
Joined: Mon 20 Dec, 2004 10:01 pm
Location: In the state of Roo Fearing
Contact:

Post by Andy_J »

No, I'm saying you CAN'T do that. You have to copy that first string over, then copy your tEnter.
ImageImage
Image
User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

Post by nepmarauder »

I understand what you are saying, but I am unsure exactly how it is done.

When you copy the .db variable, would it be in the same .db group as before, like this:

.db (LINETEST1)
.db tenter
.db (LINETEST2)
.db tenter

Or is this just wrong again.
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
jbshaler
Maxcoderz Staff
Posts: 22
Joined: Fri 17 Dec, 2004 8:35 pm
Location: Michigan

Post by jbshaler »

Dwedit sounds right. Try doing something like this:

Code: Select all

.db tC, t2ByteTok, tLo, t2ByteTok, tLd, t2ByteTok, tLe, tSpace . . . ; continue for "here"
(for mixed case)

or just for all caps:

Code: Select all

.db tC, tO, tD, tE, tSpace, tH, tE, tR, tE, tEnter
I'm not sure if it will work, but you should try it. I got this just from looking at ti83plus.inc.

I'm don't know what all the fuss is about having tEnter separate, maybe I'm missing something...

Edit: Oops...i just checked an ascii table and found that tC == 'C', so you should just be able to write .db "CODE HERE", tEnter and do a ldir
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

tSpace is not " " (20h), it's actually ")". (29h)
You know your hexadecimal output routine is broken when it displays the character 'G'.
User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

Post by nepmarauder »

See, that would work, but that is not what I am trying to do.

I already know that you can write:

.db "CODEHERE", tenter

To display CODEHERE in a BASIC program.

But, I need to do this: (I know this isn't right, but you get the idea)

.db LABEL, tenter


LABEL:
.db "CODEHERE"

See, I am trying to copy over whole .db variables to a BASIC program.

P.S. Sorry Dwedit for the mistake, again. I replied to this to bump it up, but still no one replied. I wasn't sure if just know one knew the answer or they just thought the "case was closed". So I posted another topic with a link to gain the attention.
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
Post Reply