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
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 07 Aug 2009 03:19:08 pm    Post subject:

Hello,

Where does the execution of a TI-83+ restart at if a battery is removed and replaced? $0000, or some other location that the boot code selects like $0053, or what?

Thanks


Last edited by Guest on 07 Aug 2009 03:19:39 pm; edited 1 time in total
Back to top
Igrek


Member


Joined: 23 Aug 2007
Posts: 151

Posted: 07 Aug 2009 05:37:58 pm    Post subject:

I believe it normally is $0000 and and $0053 when you booted while holding clear, as you probably know this is used by TI-OS to reset ram.
Back to top
FloppusMaximus


Advanced Member


Joined: 22 Aug 2008
Posts: 472

Posted: 07 Aug 2009 05:49:39 pm    Post subject:

My best guess (there's no way to be sure without some hardware hacking) is that the PC is initialized to 8000h, with ports 4 and 6 initialized to 77 and 1F respectively.

This seems odd, since all of the non-Flash calculators reset at 0000h - that is the reason page 0 is mapped there, after all! - so perhaps there is still more memory-mapping weirdness that nobody has discovered yet.
Back to top
Igrek


Member


Joined: 23 Aug 2007
Posts: 151

Posted: 07 Aug 2009 06:13:01 pm    Post subject:

That's odd, very odd it starts in mapping mode 1? Oo (And I shouldn't believe everything that's on the internet, but that's where I got my false (?) information)
Back to top
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 07 Aug 2009 09:37:06 pm    Post subject:

hmmm...
considering this section of code from a very basic operating system: (Benjamin, most of this code is from PongOS)

Code:
.org $0000
   jp Boot
;...
.org $0053
   jp Boot
;...
Boot:
   di
   ld sp,$0000  ;initialize stack
   xor a
   out (0),a  ;reset link
   dec a
   out (1),a  ;reset keyboard
   ld a,$76
   out (4),a  ;standard clock interrupt
   ld a,$41
   out (7),a  ;RAM page 1 in bank 3 (basic edition)
   in a,(2)
   and $80
   jr z,BootBE

   ld a,$81
   out (7),a  ;RAM page 1 in bank 3 (silver edition)
   dec a
   out (8),a  ;reset data bus
   xor a
   out (8),a  ;enable data bus
   out (5),a  ;RAM page 0 in bank 4
   out ($20),a  ;reset cpu clock
   ld a,$14
   out ($29),a  ;reset LCD clock
   xor a
   out ($30),a  ;clear timers
   out ($33),a
   out ($36),a
BootBE:
   ld a,$18  ;no test mode
   call LCDReadyOut
   ld a,19  ;*****contrast setting here*****
   ld (contrast),a
   add a,$D8
   call LCDReadyOut
   ld a,$40  ;0 vertical shift
   call LCDReadyOut
   ld a,$05  ;x auto-increment mode
   call LCDReadyOut
   ld a,$03  ;connect power supply
   call LCDReadyOut
   call ClrLCDBuffer
   call DispLCDBuffer

   ld a,%0001001  ;set interrupts (on-key)
   out (3),a
   ld a,1
   ld (calcOn),a
   im 1
   ei

Hang:
   jp Hang


It appears that the execution does not return to $0000 or $0053 after replacing a battery because the contrast darkens from the original setting and does not go back.
If this is the case, then where in the OS code DOES execution return after being rebooted?
I mean, it can't stay in up in the $8000's on page $1F forever. Sometime it MUST re-enter the OS code ...right? so, where?
Maybe I'm missing something about the contrast....?
Any ideas?

Thanks


Last edited by Guest on 07 Aug 2009 09:46:54 pm; edited 1 time in total
Back to top
Igrek


Member


Joined: 23 Aug 2007
Posts: 151

Posted: 08 Aug 2009 04:26:06 am    Post subject:

As far as I know page $1F is a page of the OS (in fact it's one of the privileged pages on TI-83+)
Back to top
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 08 Aug 2009 07:42:54 am    Post subject:

From what I gather at WikiTI (here) page $1F is boot code built into the calculator, and it is not a part of the OS considering that it can function even with no OS installed.
Back to top
Igrek


Member


Joined: 23 Aug 2007
Posts: 151

Posted: 08 Aug 2009 07:59:41 am    Post subject:

Yes, you're right, my bad. I assume this page eventually jumps somewhere into the OS, possibly to page 0. It actually makes sens now Smile. It jumps to the boot page to check whether there is an OS (an also check whether the user is holding DEL or CLEAR).
Back to top
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 08 Aug 2009 03:34:21 pm    Post subject:

Well, that part does seem to make sense, but it still fails to explain darkening of the contrast. Do you think it's just one of those weird unexplainable things about the calc's hardware and that there's nothing I can do about it???
Back to top
Igrek


Member


Joined: 23 Aug 2007
Posts: 151

Posted: 08 Aug 2009 04:22:10 pm    Post subject:

Does it stop at "hang: jp hang", you might want to add some test code that actually displays something.
Back to top
darkstone knight


Advanced Member


Joined: 07 Sep 2008
Posts: 438

Posted: 08 Aug 2009 04:32:25 pm    Post subject:

probaly he's waiting for an interrupt
Back to top
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 08 Aug 2009 04:56:58 pm    Post subject:

you're both right.
It does stop at the jp Hang command, but my interrupt routine allows the calc to be turned off and on via the On-key. (As I said, it is a very basic OS)

Here, with this updated code, pressing [clear] manually jumps to $0000, but still the contrast does not return to original setting after battery removal:

Code:
;from 'Hang:' forward
Hang:
   ld bc,$FDBF  ;group $FD, key $BF [CLEAR]
   call AskKey  ;returns 1 in A if key requested in BC is pressed
   cp 1
   jp nz,Hang
   jp $0000


Last edited by Guest on 08 Aug 2009 05:19:32 pm; edited 1 time in total
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