This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 02 Nov 2003 01:56:28 am    Post subject:

ok, here was my attempt:

Code:
.nolist
#define end .end
#define END .end
#define equ .equ
#define EQU .equ
#define FindSym 10h
#define Mov9ToOp1 20h
#include "ti83plus.inc"
.list
.org 9D95h
   ld   hl,AppBackUpScreen;pointer to free RAM
   ld   (hl),text;copy text to ram
   ld   hl,str1;put string pointers into HL
   rst Mov9ToOp1;copy HL to Op1
   rst FindSym;Check to see if it exists
   jr C,Exists;if does, good
   b_call(_DelVarArc);else, delete it
Exists:;it exists!
   bcall(_CreateStrng);create Str1
   inc DE
   inc DE;bypass the size bytes
   ld HL,AppBackUpScreen;put address into HL
   ld BC,10;copy 10 bytes
   ldir;copy them to Str1
   ret

text:
   .db "~`!@#$%&_ƒ",0

str1:
   .db StrngObj,tVarStrng,tStr1,$00
.end
.end


couldnt even get it to compile! plz help
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 02 Nov 2003 03:25:59 pm    Post subject:

Ok, this is fairly simple, but I havent seen it in any tutorial...


Code:
   ld hl,str1
   rst 20h;same as mov9toOp1, but faster,less size
   bcall(_ChkFindSym)
   jp nc,exists;if it exists, then go to exists
   
   ld hl,100
   bcall(_CreateStrng);create the string, we already have OP1
   
exists:
   ld hl,str1
   rst 20h
   bcall(_chkFindSym)
   push de
   ld a,b
   cp 0;b held the rom page, it was zero if in ram
   jp z,gonow
   
   bcall(_arc_unarc);unarchive it

gonow:
   pop de
   inc de
   inc de   

   ld hl,text
   ld bc,10;length of string
   ldir  ;copy

   ret
   
   
text:
.db "ABCDEFGHJ",0


str1:
.db StrngObj,tVarStrng,tStr1,$00


Ok, an explanation, line by line:


Code:
   ld hl,str1
   rst 20h;same as mov9toOp1, but faster,less size
   bcall(_ChkFindSym)
   jp nc,exists;if it exists, then go to exists
   
   ld hl,100
   bcall(_CreateStrng);create the string, we already have OP1


The ld hl,str1 loads the name of string 1 into hl

Next the "rst 20h" is the optomized form of mov9toOp1, so now we have hl in OP1

We then run Chk Find sym

If String one exists, then hump to the exists label

Otherwise continue on. Load 100 into hl. 100 is the size in bytes of the string

Create a new string


Code:
exists:
   ld hl,str1
   rst 20h
   bcall(_chkFindSym)
   push de
   ld a,b
   cp 0;b held the rom page, it was zero if in ram
   jp z,gonow
   
   bcall(_arc_unarc);unarchive it


The exists label

Do the same thing as above, using chkfind sym

Save "de" for later, as it will get trashed

Check find sym returns whether the string is archived or not in b, so for comparing load b into a.

Compare to 0

If it is zero, then it is in RAM, so go to "gonow"

Otherwise, unarchive it.


Code:
gonow:
   pop de
   inc de
   inc de   

   ld hl,text
   ld bc,10;length of string
   ldir  ;copy

   ret
   
   
text:
.db "ABCDEFGHJ",0


str1:
.db StrngObj,tVarStrng,tStr1,$00


GoNow label

Pop de off the stack to be used. Remember de is the beginning of the variable's data area.

Increase twice to get by all the size data,etc

load into hl the location of the text

load into bc the size of the text (remember the 0 terminator)

ldir to copy

return to system

____________________________________________________

Its not too hard, and my code is unoptomized so that makes it a little easier to underdstand. Remember that we set the new string's size to 100 bytes, so there will be ? marks in the end of the string when you run this program!

If you need anymore help just ask. I know very little ASM, but am willing to teach what I know. Just PM me if that is the case.


Last edited by Guest on 02 Nov 2003 03:28:44 pm; edited 1 time in total
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 02 Nov 2003 06:25:24 pm    Post subject:

ok, thx!

and i can specify different vars by chaging the stuff at label str1?

sweeetttt....
thx again!
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 02 Nov 2003 08:37:00 pm    Post subject:

um, small problem. tried to compile. got 3533 errors, most with my include file...
here is final code:

Code:
#define end .end
#define END .end
#define equ .equ
#define EQU .equ
#include "ti83plus.inc"
.list
.org 9D95h
   ld hl,str1
   rst 20h;same as mov9toOp1, but faster,less size
   bcall(_ChkFindSym)
   jp nc,exists;if it exists, then go to exists

   ld hl,100
   bcall(_CreateStrng);create the string, we already have OP1

exists:
   ld hl,str1
   rst 20h
   bcall(_chkFindSym)
   push de
   ld a,b
   cp 0;b held the rom page, it was zero if in ram
   jp z,gonow

   bcall(_arc_unarc);unarchive it

gonow:
   pop de
   inc de
   inc de

   ld hl,text
   ld bc,12;length of string
   ldir ;copy

ret


text:
.db "~`@#$%&_|\/;",0


str1:
.db StrngObj,tVarStrng,tStr1,$00
.end
.end


any ideas? im using the sdk from asm in 28 days, i know it worked at one point, got another program of mine to compile, though all of a sudden it doesnt like my ti83plus.inc file. hmmm...
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 02 Nov 2003 09:23:43 pm    Post subject:

Well, it sounds like the include file, as you said.

I compiled my code and it worked fine, so it must be your include file. There are different ways of writing your asm code, and I use the cirrus include file. You can find it here.

I always use that for my ASM.

If that doesnt work, just download the whole SDK from the cirrus website, it has always worked for me, the only problems I have had have been with compiling applications, and I fixed that.
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 03 Nov 2003 12:09:39 am    Post subject:

thx, i got that, and it finnaly worked

um, how come i cant put @#$%& chars in the string? i cant even put lowercase Sad
TESTING does fine, but testing returns RadianDegreeFix Radian...

any clue how i can get around this?

edit: could i use the hex values?


Last edited by Guest on 03 Nov 2003 12:15:06 am; edited 1 time in total
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 03 Nov 2003 11:36:30 am    Post subject:

I think you could use the hex values, though I am not entirely sure. Try enabling lowercase.
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 03 Nov 2003 02:45:58 pm    Post subject:

Darth Android wrote:
um, how come i cant put @#$%& chars in the string? i cant even put lowercase Sad
TESTING does fine, but testing returns RadianDegreeFix Radian...

That's because the TI's string variables are considered by TIOS to contain tokens, as it happens, the vaules for 't' 'e' 's' etc. happen to match the token values for 'Radian' 'Degree' 'Fix', etc. As for actual lowercase letters, Those are two byte tokens. Try

.db t2ByteTok, 't'
.db t2ByteTok, 'e'

If that doesn't work, experiment. CalcSys can be useful in this situation.
Back to top
John Barrus


Member


Joined: 25 May 2003
Posts: 131

Posted: 03 Nov 2003 03:32:25 pm    Post subject:

Ticalc.org has a new file for today for the TI-83+. It's called 'Token Viewer'. It gives the hex symbols for every token. That might prove useful.
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 03 Nov 2003 05:44:55 pm    Post subject:

ah, thank you all!
now as i asked earlyer, can most other variables be accesed by changing the stuff at label str?

edit: coudl i use .db t2ByteTok,$OD or somthing?


Last edited by Guest on 03 Nov 2003 06:49:51 pm; edited 1 time in total
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 03 Nov 2003 07:23:29 pm    Post subject:

Yeah, for the most part. Things like appvars: AppvarObj,"NAME",0
or programs: ProgObj,"NAME".0
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 12 Nov 2003 09:15:01 am    Post subject:

ok, simple enough, i guess
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement