[TI ASM] See any Errors???
Moderator: MaxCoderz Staff
- nepmarauder
- Regular Member
- Posts: 119
- Joined: Thu 14 Apr, 2005 7:02 pm
- Location: Ann Arbor, MI
- Contact:
[TI ASM] See any Errors???
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.
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.
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
-
- Calc Wizard
- Posts: 680
- Joined: Wed 22 Dec, 2004 5:37 am
- Location: West Palm Beach,FL
- Contact:
- nepmarauder
- Regular Member
- Posts: 119
- Joined: Thu 14 Apr, 2005 7:02 pm
- Location: Ann Arbor, MI
- Contact:
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.
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.
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
- nepmarauder
- Regular Member
- Posts: 119
- Joined: Thu 14 Apr, 2005 7:02 pm
- Location: Ann Arbor, MI
- Contact:
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!
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!
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
- nepmarauder
- Regular Member
- Posts: 119
- Joined: Thu 14 Apr, 2005 7:02 pm
- Location: Ann Arbor, MI
- Contact:
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.
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.
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
- nepmarauder
- Regular Member
- Posts: 119
- Joined: Thu 14 Apr, 2005 7:02 pm
- Location: Ann Arbor, MI
- Contact:
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.
.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.
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
- nepmarauder
- Regular Member
- Posts: 119
- Joined: Thu 14 Apr, 2005 7:02 pm
- Location: Ann Arbor, MI
- Contact:
Dwedit sounds right. Try doing something like this:
(for mixed case)
or just for all caps:
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
Code: Select all
.db tC, t2ByteTok, tLo, t2ByteTok, tLd, t2ByteTok, tLe, tSpace . . . ; continue for "here"
or just for all caps:
Code: Select all
.db tC, tO, tD, tE, tSpace, tH, tE, tR, tE, tEnter
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
- nepmarauder
- Regular Member
- Posts: 119
- Joined: Thu 14 Apr, 2005 7:02 pm
- Location: Ann Arbor, MI
- Contact:
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.
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.
IT'S GREAT TO BE A MICHIGAN WOLVERINE!