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
Tyraniek


Member


Joined: 07 Jun 2003
Posts: 133

Posted: 12 Jun 2003 07:38:36 am    Post subject:

I just wanted to know why, during the compilation, when we call something like [font="Courier"]B_CALL(_clrlcdfull) , it is transformed to EF4045 whereas we write _clrlcdfull = 4540.
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 12 Jun 2003 08:15:20 am    Post subject:

Sometimes addresses must be reversed for certain things to work, although I thought that this didn't happen on the TI83+, but maby the compiler automatically reverses addresses, so the deffinition is reversed to compensate.
Back to top
Justin W.
Shattered Silence


Advanced Member


Joined: 24 May 2003
Posts: 429

Posted: 12 Jun 2003 08:50:50 am    Post subject:

Tasm or whatever compiler you're using will substitute it in backwards. It's all a matter of significant bytes.
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 12 Jun 2003 04:52:55 pm    Post subject:

The CPU expects the operand to have the LSB first; therefore, the assember takes care of this for you.

Another thing that may confuse you: They symbol table is wrighten backwards.
Back to top
Justin W.
Shattered Silence


Advanced Member


Joined: 24 May 2003
Posts: 429

Posted: 12 Jun 2003 06:37:50 pm    Post subject:

Yes I find the vat very interesting as you have to search through it in reverse order. Entries such as names are in reverse as well. It's kinda fun going backwards through memory.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 12 Jun 2003 09:40:04 pm    Post subject:

Laughing i wonder if people at ti are saying, "Its kinda fun making memory backwards..." that would be VERY funny! Laughing
Back to top
David
The XORcist!


Advanced Member


Joined: 20 May 2003
Posts: 268

Posted: 13 Jun 2003 02:46:21 pm    Post subject:

It seems a bit illogical that the symbol table is arranged in reversed orders, but after all it's the best and fastest way.
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 14 Jun 2003 03:04:46 am    Post subject:

I am not sure why it is the best and fastest way, but it works great Smile
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 14 Jun 2003 03:06:39 am    Post subject:

Back to top
Tyraniek


Member


Joined: 07 Jun 2003
Posts: 133

Posted: 14 Jun 2003 03:52:32 am    Post subject:

What's that ???? Confused
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 14 Jun 2003 04:46:24 am    Post subject:

The diagram above is a representation of the symbol table.

It has the following info: type of variable, address of data, number of characters in the name, the name, the page the variable is located in mem.

If you go to the address, the first two bytes are the size of the program.

e.g.

NL+9+Size Bytes=Size as shown in calcs mem menu.
Back to top
Job the GameQuitter


Member


Joined: 04 Jun 2003
Posts: 102

Posted: 14 Jun 2003 05:24:25 am    Post subject:

Sadly, not every entry is equal in length, which really complicates search routines Neutral . Check the SDK. I actually wrote a search routine once. Never used it or tested it though, so there probably still are some bugs in it. Rolling Eyes
Code:
;Input:
;IX:   01h= list 05h=Program, 15h=Appvar, 17h=Group
;IX+1: name length (include the L at the beginning of a list)
;IX+2: start of name, not zero terminated. If list, start with tVarsLst
;for example .db 001h, 4, tVarsLst, "BOB" searches a list named BOB
;Don't forget to use capital letters!

;Output:
;(HL)=ROM-page variable resides on (0 if in ram)
;(HL+1)=most significant byte of adress
;(HL+2)=least significant byte of adress
;If no variable was found DE=0


LD HL,(progPtr)
ld DE,(pTemp-1)
XOR A       ;reset carry flag
SBC HL,DE   ;find the length
LD D,H
LD E,L       ;DE= Program/List/AppVar/Group-symtable length
ADD HL,DE   ;HL points to (progPtr) again; saves two bytes on "LD HL,(progPtr)" at the price of one CC
LD BC,15
ld A,(IX)

findvarloop:
CP (HL)   ;Check if the entry matches the searched object type
jp Z,TestLength

Lengthdidnotmatch: ;to prevent confusion: this label has to do a later part of this routine, not this loop
DEC (HL)           ;lists' ST entries are 14 bytes, the other ones (in this routine) 15
jr nz,NotAList       ;so we check if this entry belongs to a list
INC (HL)             ;if so, we decrease HL by 14
DEC C                 ;if not, we jump to NotAList, were we decrease it by  15
SBC HL,BC
EX HL,DE
SBC HL,BC           ;If HL (="DE") =0, we've traversed the SymTable without finding any matches
EX HL,DE ;does not affect flags
ret z ;Z=No Match Found
INC C
jp findvarloop
NotAList:
INC (HL)
SBC HL,BC
EX HL,DE
SBC HL,BC  
EX HL,DE
ret z
jp findvarloop

TestLength:
ld E,6   ;the length of the variable's name is stored at the
OR A     ;-6th byte of it's Symbol Table entry
SBC HL,DE ;so we reset carry flag and subtract 6 from HL
INC IX
LD A,(IX)
CP (HL)
Jr NZ,LengthDoesNotMatch
LD C,A
DEC HL
INC IX
INC B
LD A,(IX)
TestName:
CP (HL)
jr nz,NameDoesNotMatch
INC B
INC IX
LD A,(IX)
DEC HL
DEC C
jp Z,NameMatches

NameDoesNotMatch:
DEC IX
INC HL
djnz NameDoesNotMatch
ld C,6
LengthDoesNotMatch:
ADD HL,BC
DEC IX
ld A,(IX)
LD BC,15
jp LengthDidnotMatch

NameMatches:
LD C,B
LD B,0
INC E
ADD HL,BC
ret


It only searches Appvars, Programs, Groups and Lists; but we have rst 10h for the other variables Wink.
Back to top
David
The XORcist!


Advanced Member


Joined: 20 May 2003
Posts: 268

Posted: 14 Jun 2003 11:39:04 am    Post subject:

Here's my way of looping through the VAT.


Code:
 ld hl,(progptr)

nextsym
 ld a,(hl);Get object type
 and 1Fh
 ld bc,-6;Move to NL field
 add hl,bc
 ld c,(hl);C = Name Length
 inc b   ;Optimization, B = 0 :)
 dec hl   ;(HL) = first char of varname

skipname
 or a   ;Clear carry flag
 sbc hl,bc;Move past the name field. You may want perform some name matching here
chk_sym
 ld de,(ptemp)
 bcall(_cpHLDE);Have we reached the end of the sym table?
 jr nz,nextsym
 ret
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 17 Jun 2003 04:34:24 pm    Post subject:

If you wish to manually display, all you have to do is copy each entry to saferam and add a 0.

Get to the NL and save it.

go to first character

copy it to a register

If <41h, add 40h to the register

copy it to saferam

continue decrementign through the symtable namelength times and copying the character to safe mem.

add a 0

set hl to safemem and use something like puts or vputs to display the name.

If it is hidded (first char <41h), add 40h before displaying and you can tell the user that it is a hidden prog if you wish.
Back to top
camaro68


Newbie


Joined: 09 Jun 2003
Posts: 13

Posted: 22 Jun 2003 02:14:39 pm    Post subject:

I just wanted to add my two cents worth in explaining why some things are listed backward. It probably has to do with the way the processor fetches and stores data. I don't know if there is a "stack", but some processors uses FIFO and some use LIFO. I don't know if this has anything to do with the z80 but it sure would make sense why it's backward if it used FIFO.
Back to top
KrYpT


Newbie


Joined: 05 Jul 2003
Posts: 3

Posted: 05 Jul 2003 11:48:49 pm    Post subject:

There is nothing FIFO about the TI83. That I know of, at least.

The only reason that I can think of for making it backward is that it grows from the end of the RAM towards the start (and there are some good speed-related and other reasons for this) and they felt that as well as creating the entries in reverse order they could also make the entries backwards themselves.
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