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
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 04 Nov 2003 09:37:27 pm    Post subject:

Does anyone have any source code that demostrates finding and displaying the names of programs on the calculator, or reading single characters from an appvar? If so, please do reply!
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 05 Nov 2003 12:42:34 am    Post subject:

To read a single character, find the appvar, go past the size bytes and then use bcall(_PutC)

Essentially, an ascii character is simply a hex value. For example 41h is 'A'
Back to top
Justin W.
Shattered Silence


Advanced Member


Joined: 24 May 2003
Posts: 429

Posted: 05 Nov 2003 12:58:05 am    Post subject:

Sorry JBirk but you forgot. After incrementing twice to get past the size bytes you must

ld a,(de)

before using bcall(_PutC)

I know you know this, I'm just clearing up any confusion that might be caused.


bcall(_PutC) will display the ascii char of the value in A
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 05 Nov 2003 01:29:39 pm    Post subject:

Yeah, register A is the curucial input for _PutC

You should also set the currow and curcol values. You can do this by loading hl and lading currow.

I.e

ld hl, 7*256+1 ;load h with 7 and L with 1
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 05 Nov 2003 04:26:09 pm    Post subject:

Thanks. Anyone have source for listing programs?
Back to top
JacobdeHaan


Member


Joined: 10 Jul 2003
Posts: 165

Posted: 05 Nov 2003 11:09:14 pm    Post subject:

Yes, you would find what you're looking for in Ti 83 plus in 28 days:


Code:
   RES   AppTextSave,(IY + AppFlags)
   b_call(_ClrLCDFull)
   LD   HL,(ProgPtr); Start of Symbol Table for programs

MainLoop:
   LD   DE,0
   LD   (CurRow),DE
   LD   C,7   ; Counter. We can display 7 variables per screen
FindLoop:
   LD   DE,(PTemp); Check to see if we're at the end of the symbol table
   OR   A
   SBC   HL,DE
   JR   Z,Done
   JR   C,Done
   ADD   HL,DE   ; Restore HL

   LD   A,(HL)   ; Check the [T] of entry, take appropriate action
   AND   $1F   ; Bitmask off bits 7-5 to get type only.
   CP   ProgObj
   JR   Z,IsProgram
   CP   ProtProgObj
   JR   NZ,Skip

IsProgram:
   CP   ProgObj
   JR   Z,IsNormalProg

   LD   A,'#'   ; We'll use a hash to signify a protected program...
   JR   DispStatus

IsNormalProg:
   LD   A,' '   ; ...or space padding for a normal program

DispStatus:
   b_call(_PutC)   ; Display protection status

; At this point, HL -> [T], so we'll move back six bytes to [NL]
   LD   DE,-6
   ADD   HL,DE
   LD   B,(HL)   ; Store number of characters in name for DJNZ

DispNameLoop:
   DEC   HL
   LD   A,(HL)
   b_call(_PutC)
   DJNZ   DispNameLoop

   DEC   HL   ; Move back one byte so HL -> [T] of next entry

   LD   A,(CurRow); Move to next line. Can't use _NewLine because it
   INC   A   ;  destroys all registers
   LD   (CurRow),A
   XOR   A
   LD   (CurCol),A

   DEC   C   ; Subtract counter
   JR   NZ,FindLoop

   PUSH   HL
   b_call(_GetKey)   ; Press any key...
   b_call(_ClrLCDFull)
   POP   HL

   JR   MainLoop

Skip:
; Skip an entry
   OR   A
   LD   DE,6
   SBC   HL,DE
   LD   E,(HL)   ; Put name length in E to skip
   INC   E   ; Add 1 to go to [T] of next entry
   SBC   HL,DE
   JR   FindLoop

Done:
   b_call(_GetKey)
   SET   AppTextSave,(IY + AppFlags)
   RET  ; That's all folks!
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 06 Nov 2003 04:13:34 pm    Post subject:

Doesnt findalphaup do the same thing? How do you use that?
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 06 Nov 2003 04:52:29 pm    Post subject:

That one works the same only it goes through the list in the reverse order.
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 06 Nov 2003 05:19:49 pm    Post subject:

Jeffrey wrote:
Doesnt findalphaup do the same thing? How do you use that?

I hear that it is one helluva slow routine. There's also SrchVListUp.
Back to top
David
The XORcist!


Advanced Member


Joined: 20 May 2003
Posts: 268

Posted: 07 Nov 2003 06:13:37 am    Post subject:

FindAlphaUp/dn is not so 'helluva' slow as you think. When you can accomplish the same with a single bcall as with one page of assembly code, then choose the first method. Another advantage is that you get the names sorted in alphabetical order.
Back to top
AlienCC
Creative Receptacle!


Know-It-All


Joined: 24 May 2003
Posts: 1927

Posted: 07 Nov 2003 06:24:43 am    Post subject:

I have some source code that does just that for the Ti-85, but we all know it operates a bit differently then the ti-83/83p.

Anyways, I did release the source code to the lite version of probably the most impressive program I ever wrote (FutureOS) for the Ti-85 which is not at all an OS, but rather a shell so to speak.

(Lite) (Full)

Feel free to browse through the code and perhaps learn a trick or two :)

The Source Code!


--AlienCC
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