EASy68K
http://www.easy68k.com/EASy68Kforum/

Exception handling - Bus and Address errors
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=5&t=160
Page 1 of 1

Author:  lee [ Wed Dec 07, 2005 7:35 am ]
Post subject:  Exception handling - Bus and Address errors

When Sim 68K encounters a bus or address error it pushes the address of the instruction that caused that error. A real 68000 is a little different. From MC68000UM.pdf ..

"[b]The value saved for the program counter is advanced 2

Author:  profkelly [ Mon Dec 12, 2005 2:02 am ]
Post subject: 

Does it really matter? I don't think a bus or address error is the type of thing you should try to continue from. Better to restart from the beginning, yes/no. :error:

Author:  kkeeley [ Mon Dec 12, 2005 3:20 am ]
Post subject: 

It does matter to some degree as the 68000 is designed with the address/bus error vectors so that it can recover from miner errors. I would like to see the simulator behave just like the real proccessors. That way we get validated software results.

P.S. I still think that Easy68K is the best software around for developing 68K software with. Keep up the great work. :D

Author:  lee [ Mon Dec 12, 2005 4:38 am ]
Post subject: 

Quote:
Does it really matter?

It does if you're trying to write exception code. 8^)=

Ok, if it's not a bug can you document it and put it on the wish list?

Lee.

Author:  profkelly [ Mon Dec 12, 2005 1:17 pm ]
Post subject: 

From "68000 Family Assembly Language" by: Alan Clements: "The information stored on the stacck by a bus error exception (or an address error) is to be regarded as diagnostic information only, and should not be used to institute a return from exception"

Bus Error is an external input to the 68000 processor. As such, it may result in different stack frames on different systems. If you write code to attempt to do an RTE from a bus error that code will only be valid for the hardware system it was designed for.

Author:  lee [ Mon Dec 12, 2005 2:28 pm ]
Post subject: 

Quote:
If you write code to attempt to do an RTE from a bus error that code will only be valid for the hardware system it was designed for.

Not 100% true. On top of the usual program counter and status word is four words of additional information, this is the same across the 680x0 family. Different is the data stacked before the program counter which, for the 68010 and up, is the format word, processor specific, and up to 29 additional words, this is cleared from the stack by the RTE and need not be handled by the exception code. The 68000 of course does not use a format word or stack any extra words before the program counter.

So you could write code to back up and retry, or skip the offending instruction, that would work on all the 680x0 family.

Lee.

Author:  profkelly [ Mon Dec 12, 2005 4:33 pm ]
Post subject: 

Because Bus Error is an external input to the 68000 it is totally up to the hardware design as to when it is asserted. It may also result in other changes to hardware, such as write protecting memory, etc. I would recommend always treating Bus Error as a catastrophic event. On the industrial inspection equipment I worked on for years, we incremented a count each time a bus error occurred then used a hardware watchdog circuit to do a hard reset on the entire computer system. Each time the watchdog reset the system it also turned on a flashing beacon on the unit. This was a signal to the maintenance people to visually inspect the system and make sure everything was still working correctly.

Author:  profkelly [ Mon Dec 12, 2005 7:31 pm ]
Post subject: 

If I do change the bus error behavior of EASy68K it will be patterned after the 68000 Educational Computer Board.

Author:  profkelly [ Fri Nov 21, 2008 5:18 pm ]
Post subject: 

Sim68K v4.1.2 creates an exception stack frame that more closely matches the stack frame created by the Motorola Educational Computer Board (MECB).

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/