ILLEGAL instruction

ILLEGAL instruction

Post by To » Sat, 28 Jun 2003 00:38:32



Hello,

I have a few questions related to ILLEGAL and Unimplemented
instructions for MC68EC000. I'd be grateful for help.

1.)
What value of PC is placed on stack in case of ILLEGAL ($4AFC opcode)
instruction?
Does pushed PC points to ILLEGAL opcode or to the next instruction
following ILLEGAL?

2.)
What value of PC is placed on stack in case of MOVEC ($4E7B opcode)
instruction?
Does pushed PC points to MOVEC opcode or to the next instruction
following MOVEC?

3.)
What value of PC is placed on stack in case of Unimplemented pattern
instruction?

I think that in cases 2.) &3.) PC should point to the
MOVEC/Unimplemented opcode, because ILLEGAL exception
should know who called it. Beside this in case of Unimplemented opcode
there is no info how to increment PC (2,4,6 bytes?)
I'm not sure about ILLEGAL opcode because it is treated as a LEGAL
instruction to invoke ILLEGAL exception.

Let me know what do you think about it.

Thanks,
Waligora

 
 
 

ILLEGAL instruction

Post by Andreas Schwa » Sat, 28 Jun 2003 02:04:24


|> Hello,
|>
|> I have a few questions related to ILLEGAL and Unimplemented
|> instructions for MC68EC000. I'd be grateful for help.
|>
|> 1.)
|> What value of PC is placed on stack in case of ILLEGAL ($4AFC opcode)
|> instruction?
|> Does pushed PC points to ILLEGAL opcode or to the next instruction
|> following ILLEGAL?
|>
|> 2.)
|> What value of PC is placed on stack in case of MOVEC ($4E7B opcode)
|> instruction?
|> Does pushed PC points to MOVEC opcode or to the next instruction
|> following MOVEC?
|>
|> 3.)
|> What value of PC is placed on stack in case of Unimplemented pattern
|> instruction?

All three cases are in fact identical, they are all trying to execute
unknown instructions.  The ILLEGAL opcode is just named as such because it
is guaranteed to be illegal in all variants of the m68k cpus.

Andreas.

--

SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nrnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

 
 
 

ILLEGAL instruction

Post by To » Sat, 28 Jun 2003 16:47:36



> All three cases are in fact identical, they are all trying to execute
> unknown instructions.  The ILLEGAL opcode is just named as such because it
> is guaranteed to be illegal in all variants of the m68k cpus.

> Andreas.

Thanks. It means that pushed PC always points to Unknown (ILLEGAL)
OPCODE.

I have one more hardware question related to STOP instruction
Does STOP turn UDS, LDS, AS, FC, RW, ADDRESS lines into Hi-Z state
automatically freeing bus?

Thank you.

 
 
 

1. gcc optimization adds illegal operation to code...

What I have:

gcc-2.8.1 configured for m68k-coff, binutils 2.9.1 configured for
m68k-coff
compiling for a mcf5200-coldfire processor

When compiling code with the "-O2" option I get invalid instructions
(and.w ) inserted.  I have provided a sample of the "-O2" optimized code

as well as 'correct' code optimized with "-O2 -fno-force-mem"

"-O2" code snippet:
.LM108:
 move.b (%a0,%d0.w),%d0
 and.w #0xFF,%d0
 jbra .L78
 .even

"-O2 -fno-force-mem" code snippet
.LM108:
 move.w %d0,%a1
 move.l 4(%a2),%a0
 clr.w %d0
 move.b (%a1,%a0.l),%d0
 jbra .L78
 .even

I have noticed that the variables referenced are unsigned char.

I need to compile this code with a "-O2" equivalent optimization.  Does
anyone know if this is a bug in gcc, and if so is there a feasable work
around that will retain the desired level of optimization.

For most of the code a -O1 optimization produces good assembly.

Thanks in advance for any assistance.

Ryan Massengale

2. 4DOS and XP...

3. 68040 : pre-instruction & post-instruction exception

4. SAMBA and NT PDC issues

5. M68k Instructions by example?

6. Why ImportNode() ???

7. 68000 emulating 68020+ instructions

8. Samsung 1650 or 1651N printer - has anyone successfully upgraded the memory to 128MB?

9. Penalty for 68040 instruction cache misses?

10. Instructions using Read-Modify-Write cycles

11. Profiling and instruction count

12. 68020-callm instruction

13. 68K instruction set