68k vector table: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→Vector list) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
The vector table consists of a 256 bytes long vector list specific to the [[68k]]. | |||
Each vector is a 32-bit address, meaning the table holds '''64 vectors'''. Each entry is used by the 68k in precise cases. | |||
All bootable 68k programs must have a vector table at their very beginning. The [[system ROM]] and games have their own. | |||
Is $C00426 an universal [[BIOS calls|BIOS call]] for a complete reset ? | |||
=Stack frames= | |||
See [[68k exception handling]]. | |||
==Format A== | |||
{|class="wikitable" | |||
!Offset from SP | |||
!Size | |||
!Value | |||
|- | |||
| +0 | |||
|Word | |||
|Flags:{{16BitRegister| |11|0:Write 1:Read |1|0:Instruction|1|Function code|3}} | |||
|- | |||
| +2 | |||
|Longword | |||
|Access address | |||
|- | |||
| +6 | |||
|Word | |||
|IR | |||
|- | |||
| +8 | |||
|Word | |||
|SR | |||
|- | |||
| +10 | |||
|Longword | |||
|PC | |||
|} | |||
==Format B== | |||
{|class="wikitable" | |||
!Offset from SP | |||
!Size | |||
!Value | |||
|- | |||
| +0 | |||
|Word | |||
|SR | |||
|- | |||
| +2 | |||
|Longword | |||
|PC | |||
|} | |||
=Vector list= | |||
{|class="regdef" | {|class="regdef" | ||
Line 5: | Line 61: | ||
|'''Address''' | |'''Address''' | ||
|'''Exception name''' | |'''Exception name''' | ||
|''' | |'''Trigger condition''' | ||
|'''[[68k stack frames|Stack frame]]''' | |'''[[68k stack frames|Stack frame]]''' | ||
|- | |- | ||
|0 | |0 | ||
|000000 | |000000 | ||
|Reset | |Reset SP | ||
|Not really a vector. | |Not really a vector. Used to initialize the stack pointer. | ||
| | | | ||
|- | |- | ||
Line 17: | Line 73: | ||
|000004 | |000004 | ||
|Reset PC | |Reset PC | ||
|Reset | |Reset/startup | ||
| | | | ||
|- | |- | ||
|2 | |2 | ||
|000008 | |000008 | ||
|Bus error | |Bus error | ||
|Bus cycle couldn't complete properly | |Bus cycle couldn't complete properly. | ||
| | |A | ||
|- | |- | ||
|3 | |3 | ||
|00000C | |00000C | ||
|Address error | |Address error | ||
|Misaligned word or longword memory access | |Misaligned (odd) word or longword memory access. | ||
| | |A | ||
|- | |- | ||
|4 | |4 | ||
|000010 | |000010 | ||
|Illegal instruction | |Illegal instruction | ||
| | |Tried executing an invalid opcode. | ||
| | |B | ||
|- | |- | ||
|5 | |5 | ||
|000014 | |000014 | ||
|Division by zero | |Division by zero | ||
|DIVUed or DIVSed by zero | |DIVUed or DIVSed by zero. | ||
| | |B | ||
|- | |- | ||
|6 | |6 | ||
|000018 | |000018 | ||
|CHK instruction | |CHK instruction | ||
|CHK resulted in out of bounds | |CHK resulted in "out of bounds". | ||
| | |B | ||
|- | |- | ||
|7 | |7 | ||
|00001C | |00001C | ||
|TRAPV instruction | |TRAPV instruction | ||
|TRAPV with | |TRAPV with overflow flag set. | ||
| | |B | ||
|- | |- | ||
|8 | |8 | ||
Line 60: | Line 116: | ||
|Privilege violation | |Privilege violation | ||
|Use of privileged instruction. Never happens on the NeoGeo since the 68k always runs in supervisor mode. | |Use of privileged instruction. Never happens on the NeoGeo since the 68k always runs in supervisor mode. | ||
| | |B | ||
|- | |- | ||
|9 | |9 | ||
Line 66: | Line 122: | ||
|Trace | |Trace | ||
|After each executed instruction when 68k is in trace mode (debugger function). | |After each executed instruction when 68k is in trace mode (debugger function). | ||
| | |B | ||
|- | |- | ||
|10 | |10 | ||
|000028 | |000028 | ||
|Unimplemented instruction (line A) | |Unimplemented instruction (line A) | ||
| | |Used to implement 680xx instructions in software. Not used on the NeoGeo. | ||
| | |B | ||
|- | |- | ||
|11 | |11 | ||
|00002C | |00002C | ||
|Unimplemented instruction (line F) | |Unimplemented instruction (line F) | ||
| | |Used to implement 680xx instructions in software. Not used on the NeoGeo. | ||
| | |B | ||
|- | |- | ||
|12 | |12 | ||
|000030 | |000030 | ||
|rowspan=3|Reserved | |rowspan=3|Reserved/Unused on 68000 | ||
|rowspan=3| | |rowspan=3| | ||
|rowspan=3| | |rowspan=3| | ||
Line 94: | Line 150: | ||
|15 | |15 | ||
|00003C | |00003C | ||
| | |Uninitialized interrupt vector | ||
| | |Default vector used by uninitialized peripherals. | ||
| | |B? | ||
|- | |- | ||
|16 | |16 | ||
|000040 | |000040 | ||
|rowspan=8|Reserved | |rowspan=8|Reserved | ||
|rowspan= | |rowspan=5| | ||
|rowspan=8| | |rowspan=8| | ||
|- | |- | ||
Line 118: | Line 174: | ||
|21 | |21 | ||
|000054 | |000054 | ||
|rowspan="3"|Normally reserved but used on the NeoGeo CD. See [[68k interrupts]]. | |||
|- | |- | ||
|22 | |22 | ||
Line 128: | Line 185: | ||
|000060 | |000060 | ||
|Spurious interrupt | |Spurious interrupt | ||
|No | |No acknowledge from hardware. | ||
| | | | ||
|- | |- | ||
Line 134: | Line 191: | ||
|000064 | |000064 | ||
|Level 1 [[68k interrupts|interrupt]] autovector | |Level 1 [[68k interrupts|interrupt]] autovector | ||
| | |[[68k interrupts|V-Blank]] (cart) / [[Timer interrupt]] (CD). | ||
| | | | ||
|- | |- | ||
Line 140: | Line 197: | ||
|000068 | |000068 | ||
|Level 2 interrupt autovector | |Level 2 interrupt autovector | ||
|Timer / | |Timer interrupt (cart) / V-Blank (CD). | ||
| | | | ||
|- | |- | ||
Line 146: | Line 203: | ||
|00006C | |00006C | ||
|Level 3 interrupt autovector | |Level 3 interrupt autovector | ||
|Cold boot | |Cold boot (cart). | ||
| | | | ||
|- | |- | ||
|28 | |28 | ||
|000070 | |000070 | ||
|Level 4 autovector | |Level 4 interrupt autovector | ||
| | |Not used on the NeoGeo. | ||
| | | | ||
|- | |- | ||
|29 | |29 | ||
|000074 | |000074 | ||
|Level 5 autovector | |Level 5 interrupt autovector | ||
| | |Not used on the NeoGeo. | ||
| | | | ||
|- | |- | ||
|30 | |30 | ||
|000078 | |000078 | ||
|Level 6 autovector | |Level 6 interrupt autovector | ||
| | |Not used on the NeoGeo. | ||
| | | | ||
|- | |- | ||
|31 | |31 | ||
|00007C | |00007C | ||
|Level 7 autovector | |Level 7 interrupt autovector | ||
| | |Not used on the NeoGeo. | ||
| | | | ||
|- | |- | ||
|32 | |32 | ||
|000080 | |000080 | ||
|TRAP #0 | |TRAP #0~15 | ||
|TRAP instructions. | |||
|TRAP | |||
|2 | |2 | ||
|- | |- | ||
|48~63 | |48~63 | ||
|0000C0~0000FC | |0000C0~0000FC | ||
|Reserved | |Reserved/Unused on 68000 | ||
| | | | ||
| | | | ||
Line 282: | Line 249: | ||
|} | |} | ||
= | =Templates= | ||
==For cartridge systems== | ==For cartridge systems== | ||
Line 338: | Line 305: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Base system]] | |||
[[Category:Code]] | [[Category:Code]] |
Latest revision as of 16:01, 30 July 2018
The vector table consists of a 256 bytes long vector list specific to the 68k.
Each vector is a 32-bit address, meaning the table holds 64 vectors. Each entry is used by the 68k in precise cases.
All bootable 68k programs must have a vector table at their very beginning. The system ROM and games have their own.
Is $C00426 an universal BIOS call for a complete reset ?
Stack frames
Format A
Offset from SP | Size | Value | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+0 | Word | Flags:
| ||||||||||||||||||||||||||||||||||
+2 | Longword | Access address | ||||||||||||||||||||||||||||||||||
+6 | Word | IR | ||||||||||||||||||||||||||||||||||
+8 | Word | SR | ||||||||||||||||||||||||||||||||||
+10 | Longword | PC |
Format B
Offset from SP | Size | Value |
---|---|---|
+0 | Word | SR |
+2 | Longword | PC |
Vector list
Vector # | Address | Exception name | Trigger condition | Stack frame |
0 | 000000 | Reset SP | Not really a vector. Used to initialize the stack pointer. | |
1 | 000004 | Reset PC | Reset/startup | |
2 | 000008 | Bus error | Bus cycle couldn't complete properly. | A |
3 | 00000C | Address error | Misaligned (odd) word or longword memory access. | A |
4 | 000010 | Illegal instruction | Tried executing an invalid opcode. | B |
5 | 000014 | Division by zero | DIVUed or DIVSed by zero. | B |
6 | 000018 | CHK instruction | CHK resulted in "out of bounds". | B |
7 | 00001C | TRAPV instruction | TRAPV with overflow flag set. | B |
8 | 000020 | Privilege violation | Use of privileged instruction. Never happens on the NeoGeo since the 68k always runs in supervisor mode. | B |
9 | 000024 | Trace | After each executed instruction when 68k is in trace mode (debugger function). | B |
10 | 000028 | Unimplemented instruction (line A) | Used to implement 680xx instructions in software. Not used on the NeoGeo. | B |
11 | 00002C | Unimplemented instruction (line F) | Used to implement 680xx instructions in software. Not used on the NeoGeo. | B |
12 | 000030 | Reserved/Unused on 68000 | ||
13 | 000034 | |||
14 | 000038 | |||
15 | 00003C | Uninitialized interrupt vector | Default vector used by uninitialized peripherals. | B? |
16 | 000040 | Reserved | ||
17 | 000044 | |||
18 | 000048 | |||
19 | 00004C | |||
20 | 000050 | |||
21 | 000054 | Normally reserved but used on the NeoGeo CD. See 68k interrupts. | ||
22 | 000058 | |||
23 | 00005C | |||
24 | 000060 | Spurious interrupt | No acknowledge from hardware. | |
25 | 000064 | Level 1 interrupt autovector | V-Blank (cart) / Timer interrupt (CD). | |
26 | 000068 | Level 2 interrupt autovector | Timer interrupt (cart) / V-Blank (CD). | |
27 | 00006C | Level 3 interrupt autovector | Cold boot (cart). | |
28 | 000070 | Level 4 interrupt autovector | Not used on the NeoGeo. | |
29 | 000074 | Level 5 interrupt autovector | Not used on the NeoGeo. | |
30 | 000078 | Level 6 interrupt autovector | Not used on the NeoGeo. | |
31 | 00007C | Level 7 interrupt autovector | Not used on the NeoGeo. | |
32 | 000080 | TRAP #0~15 | TRAP instructions. | 2 |
48~63 | 0000C0~0000FC | Reserved/Unused on 68000 | ||
64~255 | 000100~0003FF | User interrupt vectors |
Templates
For cartridge systems
org $0
dc.l $0010F300 ; Initial SP
dc.l $00C00402 ; Initial PC
dc.l $00C00408 ; Bus error
dc.l $00C0040E ; Address error
dc.l $00C0040E ; Illegal Instruction
dc.l $0000034C ; Divide by 0
dc.l $0000034E ; CHK Instruction
dc.l $0000034E ; TRAPV Instruction
dc.l $00C0041A ; Privilege Violation
dc.l $00C00420 ; Trace
dc.l $0000034E,$0000034E ; Emu
dc.l $00C00426,$00C00426,$00C00426 ; Reserved
dc.l $00C0042C ; Uninit. Int. Vector.
dc.l $00C00426,$00C00426,$00C00426,$00C00426 ; Reserved
dc.l $00C00426,$00C00426,$00C00426,$00C00426 ; Reserved
dc.l $00C00432 ; Spurious Interrupt
dc.l VBlank ; Level 1
dc.l IRQ2 ; Level 2
dc.l $00C00426 ; Level 3
dc.l $00C00426,$00C00426,$00C00426,$00C00426 ; Level 4~7
dc.l $0000056E,$0000056E,$0000056E,$0000056E ; Traps...
dc.l $0000056E,$0000056E,$FFFFFFFF,$FFFFFFFF
dc.l $FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
dc.l $FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
dc.l $FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
dc.l $FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
dc.l $FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
dc.l $FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF
For CD systems
org $0
dc.l $0010F300,$00C00402,$00C00408,$00C0040E
dc.l $00C00414,$00C00426,$00C00426,$00C00426
dc.l $00C0041A,$00C00420,$00C00426,$00C00426
dc.l $00C00426,$00C00426,$00C00426,$00C0042C
dc.l $00C00522,$00C00528,$00C0052E,$00C00534
dc.l $00C0053A,$00C004F2,$00C004EC,$00C004E6
dc.l $00C004E0, IRQ2, VBlank, IRQ3
dc.l Generic, Generic, Generic, Generic
dc.l Generic, Generic, Generic, Generic
dc.l Generic, Generic, Generic, Generic
dc.l Generic, Generic, Generic, Generic
dc.l Generic, Generic, Generic, Generic
dc.l $00C00426,$00C00426,$00C00426,$00C00426
dc.l $00C00426,$00C00426,$00C00426,$00C00426
dc.l $00C00426,$00C00426,$00C00426,$00C00426
dc.l $00C00426,$00C00426,$00C00426,$00C00426