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.
Z80 & 68k Assembly =>
z80 & ez80 Assembly
Author |
Message |
|
thebetter1
Advanced Newbie
Joined: 09 Jul 2008 Posts: 86
|
Posted: 12 Feb 2009 10:52:01 pm Post subject: |
|
|
I've been wondering exactly what causes the calculator to crash. There is no "crash" opcode. I have also never found any specific illegal operations; for example, overflowing a register just sets the value to zero or whatever. Even if the return command is left out of the end, shouldn't the calculator just keep running the rest of the code in ram until it finds another return? |
|
Back to top |
|
|
magicdanw pcGuru()
Calc Guru
Joined: 14 Feb 2007 Posts: 1110
|
Posted: 13 Feb 2009 01:03:05 am Post subject: |
|
|
Well, generally a crash doesn't occur due to improper opcodes, or anything. The CPU usually doesn't initiate a crash. What usually happens is, a program on the calculator does something the OS doesn't like, such as try to execute code past a certain point in ram, or it overflows the stack, or it starts running rampant, hitting so many returns that eventually the stack becomes negative, or something that eventually causes either the CPU or the OS to go "hey, something's not right." The OS gets control via some error handler, and since the OS doesn't really have any error-recovery abilities (since a program can theoretically screw up all the ram) it just initiates a ram clear to start over fresh.
It's something like that. I might not have gotten all the correct things that cause a crash, but generally it's just that something causes the OS to initiate a ram clear, to prevent the calculator from going catatonic. |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 13 Feb 2009 01:03:15 am Post subject: |
|
|
Yeah, it'll keep going until it gets caught in an infinite loop or runs garbage code that makes no sense.
For those "I've hung and when I press ON I'm going to get 'RAM Cleared'", it's usually because it's gotten stuck in some sort of loop and RAM is completely corrupted/unreliable so there's no way to recover, and pressing ON will trigger an interrupt. Deep in the interrupt code, it will do a checksum on the RAM and then compare it with its stored checksum, and if they don't match, RAM reset.
Is there a specific type of crash or reset you're thinking about? There are lots. |
|
Back to top |
|
|
FloppusMaximus
Advanced Member
Joined: 22 Aug 2008 Posts: 472
|
Posted: 14 Feb 2009 11:20:43 am Post subject: |
|
|
I'd hazard a guess that in that type of crash, what usually happens is the calculator eventually jumps to a location in RAM page zero, either by "returning" to a garbage address, or simply by running off the end of page one. That causes the calculator to reset and hence turn itself off, and when it turns back on it finds that the RAM checksum is invalid, so it clears the RAM.
As obnoxious as the execution restrictions are, this does at least make many crashes easier to recover from. |
|
Back to top |
|
|
darkstone knight
Advanced Member
Joined: 07 Sep 2008 Posts: 438
|
Posted: 14 Feb 2009 01:36:07 pm Post subject: |
|
|
doesnt the CPU crash when IP (or w/e) ever exceeds $C0000? |
|
Back to top |
|
|
benryves
Active Member
Joined: 23 Feb 2006 Posts: 564
|
Posted: 14 Feb 2009 04:15:13 pm Post subject: |
|
|
RAM page 0 is mapped to $C000~$FFFF by default; so yes, if PC>=$C000 the protection hardware triggers a reset. |
|
Back to top |
|
|
darkstone knight
Advanced Member
Joined: 07 Sep 2008 Posts: 438
|
Posted: 17 Feb 2009 02:39:18 am Post subject: |
|
|
you can see RST 00h as a crash...
as well JP $0, CALL $0, and JP >$C000 |
|
Back to top |
|
|
|
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