OLD | NEW |
1 /* m68hc11.h -- Header file for Motorola 68HC11 & 68HC12 opcode table | 1 /* m68hc11.h -- Header file for Motorola 68HC11 & 68HC12 opcode table |
2 Copyright 1999, 2000, 2002, 2003, 2010 Free Software Foundation, Inc. | 2 Copyright 1999, 2000, 2002, 2003, 2010, 2012 |
| 3 Free Software Foundation, Inc. |
3 Written by Stephane Carrez (stcarrez@nerim.fr) | 4 Written by Stephane Carrez (stcarrez@nerim.fr) |
4 | 5 |
5 This file is part of GDB, GAS, and the GNU binutils. | 6 This file is part of GDB, GAS, and the GNU binutils. |
6 | 7 |
7 GDB, GAS, and the GNU binutils are free software; you can redistribute | 8 GDB, GAS, and the GNU binutils are free software; you can redistribute |
8 them and/or modify them under the terms of the GNU General Public | 9 them and/or modify them under the terms of the GNU General Public |
9 License as published by the Free Software Foundation; either version 3, | 10 License as published by the Free Software Foundation; either version 3, |
10 or (at your option) any later version. | 11 or (at your option) any later version. |
11 | 12 |
12 GDB, GAS, and the GNU binutils are distributed in the hope that they | 13 GDB, GAS, and the GNU binutils are distributed in the hope that they |
(...skipping 17 matching lines...) Expand all Loading... |
30 #define M6811_N_BIT 0x08 /* Negative */ | 31 #define M6811_N_BIT 0x08 /* Negative */ |
31 #define M6811_Z_BIT 0x04 /* Zero */ | 32 #define M6811_Z_BIT 0x04 /* Zero */ |
32 #define M6811_V_BIT 0x02 /* Overflow */ | 33 #define M6811_V_BIT 0x02 /* Overflow */ |
33 #define M6811_C_BIT 0x01 /* Carry */ | 34 #define M6811_C_BIT 0x01 /* Carry */ |
34 | 35 |
35 /* 68HC11 register address offsets (range 0..0x3F or 0..64). | 36 /* 68HC11 register address offsets (range 0..0x3F or 0..64). |
36 The absolute address of the I/O register depends on the setting | 37 The absolute address of the I/O register depends on the setting |
37 of the M6811_INIT register. At init time, the I/O registers are | 38 of the M6811_INIT register. At init time, the I/O registers are |
38 mapped at 0x1000. Address of registers is then: | 39 mapped at 0x1000. Address of registers is then: |
39 | 40 |
40 0x1000 + M6811_xxx | 41 0x1000 + M6811_xxx. */ |
41 */ | |
42 #define M6811_PORTA 0x00 /* Port A register */ | 42 #define M6811_PORTA 0x00 /* Port A register */ |
43 #define M6811__RES1 0x01 /* Unused/Reserved */ | 43 #define M6811__RES1 0x01 /* Unused/Reserved */ |
44 #define M6811_PIOC 0x02 /* Parallel I/O Control register */ | 44 #define M6811_PIOC 0x02 /* Parallel I/O Control register */ |
45 #define M6811_PORTC 0x03 /* Port C register */ | 45 #define M6811_PORTC 0x03 /* Port C register */ |
46 #define M6811_PORTB 0x04 /* Port B register */ | 46 #define M6811_PORTB 0x04 /* Port B register */ |
47 #define M6811_PORTCL 0x05 /* Alternate latched port C */ | 47 #define M6811_PORTCL 0x05 /* Alternate latched port C */ |
48 #define M6811__RES6 0x06 /* Unused/Reserved */ | 48 #define M6811__RES6 0x06 /* Unused/Reserved */ |
49 #define M6811_DDRC 0x07 /* Data direction register for port C */ | 49 #define M6811_DDRC 0x07 /* Data direction register for port C */ |
50 #define M6811_PORTD 0x08 /* Port D register */ | 50 #define M6811_PORTD 0x08 /* Port D register */ |
51 #define M6811_DDRD 0x09 /* Data direction register for port D */ | 51 #define M6811_DDRD 0x09 /* Data direction register for port D */ |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 #define M6812_ACC_OFFSET 0x00400000 /* A,r B,r D,r */ | 357 #define M6812_ACC_OFFSET 0x00400000 /* A,r B,r D,r */ |
358 #define M6812_ACC_IND 0x00800000 /* [D,r] */ | 358 #define M6812_ACC_IND 0x00800000 /* [D,r] */ |
359 #define M6812_PRE_INC 0x01000000 /* n,+r n = -8..8 */ | 359 #define M6812_PRE_INC 0x01000000 /* n,+r n = -8..8 */ |
360 #define M6812_PRE_DEC 0x02000000 /* n,-r */ | 360 #define M6812_PRE_DEC 0x02000000 /* n,-r */ |
361 #define M6812_POST_INC 0x04000000 /* n,r+ */ | 361 #define M6812_POST_INC 0x04000000 /* n,r+ */ |
362 #define M6812_POST_DEC 0x08000000 /* n,r- */ | 362 #define M6812_POST_DEC 0x08000000 /* n,r- */ |
363 #define M6812_INDEXED_IND 0x10000000 /* [n,r] n = 16-bits */ | 363 #define M6812_INDEXED_IND 0x10000000 /* [n,r] n = 16-bits */ |
364 #define M6812_INDEXED 0x20000000 /* n,r n = 5, 9 or 16-bits */ | 364 #define M6812_INDEXED 0x20000000 /* n,r n = 5, 9 or 16-bits */ |
365 #define M6812_OP_IDX_P2 0x40000000 | 365 #define M6812_OP_IDX_P2 0x40000000 |
366 | 366 |
| 367 /* XGATE defines. |
| 368 These overlap with HC11/12 as above but not used at the same time. */ |
| 369 #define M68XG_OP_NONE 0x0001 |
| 370 #define M68XG_OP_IMM3 0x0002 |
| 371 #define M68XG_OP_R 0x0004 |
| 372 #define M68XG_OP_R_R 0x0008 |
| 373 #define M68XG_OP_R_IMM4 0x0010 |
| 374 #define M68XG_OP_R_R_R 0x0020 |
| 375 #define M68XG_OP_REL9 0x0040 |
| 376 #define M68XG_OP_REL10 0x0080 |
| 377 #define M68XG_OP_R_R_OFFS5 0x0100 |
| 378 #define M68XG_OP_RD_RB_RI 0x0200 |
| 379 #define M68XG_OP_RD_RB_RIp 0x0400 |
| 380 #define M68XG_OP_RD_RB_mRI 0x0800 |
| 381 #define M68XG_OP_R_IMM8 0x1000 |
| 382 #define M68XG_OP_R_IMM16 0x2000 |
| 383 #define M68XG_OP_REG 0x4000 /* Register operand 1. */ |
| 384 #define M68XG_OP_REG_2 0x8000 /* Register operand 2. */ |
| 385 #define M68XG_MAX_OPERANDS 3 /* Max operands of triadic r1, r2, r3.
*/ |
| 386 |
367 /* Markers to identify some instructions. */ | 387 /* Markers to identify some instructions. */ |
368 #define M6812_OP_EXG_MARKER 0x01000000 /* exg r1,r2 */ | 388 #define M6812_OP_EXG_MARKER 0x01000000 /* exg r1,r2 */ |
369 #define M6812_OP_TFR_MARKER 0x02000000 /* tfr r1,r2 */ | 389 #define M6812_OP_TFR_MARKER 0x02000000 /* tfr r1,r2 */ |
370 #define M6812_OP_SEX_MARKER 0x04000000 /* sex r1,r2 */ | 390 #define M6812_OP_SEX_MARKER 0x04000000 /* sex r1,r2 */ |
371 | 391 |
372 #define M6812_OP_EQ_MARKER 0x80000000 /* dbeq/ibeq/tbeq */ | 392 #define M6812_OP_EQ_MARKER 0x80000000 /* dbeq/ibeq/tbeq */ |
373 #define M6812_OP_DBCC_MARKER 0x04000000 /* dbeq/dbne */ | 393 #define M6812_OP_DBCC_MARKER 0x04000000 /* dbeq/dbne */ |
374 #define M6812_OP_IBCC_MARKER 0x02000000 /* ibeq/ibne */ | 394 #define M6812_OP_IBCC_MARKER 0x02000000 /* ibeq/ibne */ |
375 #define M6812_OP_TBCC_MARKER 0x01000000 | 395 #define M6812_OP_TBCC_MARKER 0x01000000 |
376 | 396 |
| 397 /* XGATE markers. */ |
| 398 #define M68XG_OP_B_MARKER 0x04000000 /* bXX rel9 */ |
| 399 #define M68XG_OP_BRA_MARKER 0x02000000 /* bra rel10 */ |
| 400 |
377 #define M6812_OP_TRAP_ID 0x80000000 /* trap #N */ | 401 #define M6812_OP_TRAP_ID 0x80000000 /* trap #N */ |
378 | 402 |
379 #define M6811_OP_HIGH_ADDR 0x01000000 /* Used internally by gas. */ | 403 #define M6811_OP_HIGH_ADDR 0x01000000 /* Used internally by gas. */ |
380 #define M6811_OP_LOW_ADDR 0x02000000 | 404 #define M6811_OP_LOW_ADDR 0x02000000 |
381 | 405 |
382 #define M68HC12_BANK_VIRT 0x010000 | 406 #define M68HC12_BANK_VIRT 0x010000 |
383 #define M68HC12_BANK_MASK 0x00003fff | 407 #define M68HC12_BANK_MASK 0x00003fff |
384 #define M68HC12_BANK_BASE 0x00008000 | 408 #define M68HC12_BANK_BASE 0x00008000 |
385 #define M68HC12_BANK_SHIFT 14 | 409 #define M68HC12_BANK_SHIFT 14 |
386 #define M68HC12_BANK_PAGE_MASK 0x0ff | 410 #define M68HC12_BANK_PAGE_MASK 0x0ff |
387 | 411 |
388 | 412 |
389 /* CPU identification. */ | 413 /* CPU identification. */ |
390 #define cpu6811 0x01 | 414 #define cpu6811 0x01 |
391 #define cpu6812 0x02 | 415 #define cpu6812 0x02 |
392 #define cpu6812s 0x04 | 416 #define cpu6812s 0x04 |
| 417 #define cpu9s12x 0x08 /* 9S12X main cpu. */ |
| 418 #define cpuxgate 0x10 /* The XGATE module itself. */ |
393 | 419 |
394 /* The opcode table is an array of struct m68hc11_opcode. */ | 420 /* The opcode table is an array of struct m68hc11_opcode. */ |
395 struct m68hc11_opcode { | 421 struct m68hc11_opcode |
396 const char* name; /* Op-code name */ | 422 { |
| 423 const char * name; /* Op-code name. */ |
397 long format; | 424 long format; |
398 unsigned char size; | 425 unsigned char size; |
399 unsigned char opcode; | 426 unsigned int opcode; |
400 unsigned char cycles_low; | 427 unsigned char cycles_low; |
401 unsigned char cycles_high; | 428 unsigned char cycles_high; |
402 unsigned char set_flags_mask; | 429 unsigned char set_flags_mask; |
403 unsigned char clr_flags_mask; | 430 unsigned char clr_flags_mask; |
404 unsigned char chg_flags_mask; | 431 unsigned char chg_flags_mask; |
405 unsigned char arch; | 432 unsigned char arch; |
| 433 unsigned int xg_mask; /* Mask with zero in register place for xgate. */ |
406 }; | 434 }; |
407 | 435 |
408 /* Alias definition for 68HC12. */ | 436 /* Alias definition for 68HC12. */ |
409 struct m68hc12_opcode_alias | 437 struct m68hc12_opcode_alias |
410 { | 438 { |
411 const char* name; | 439 const char* name; |
412 const char* translation; | 440 const char* translation; |
413 unsigned char size; | 441 unsigned char size; |
414 unsigned char code1; | 442 unsigned char code1; |
415 unsigned char code2; | 443 unsigned char code2; |
416 }; | 444 }; |
417 | 445 |
418 /* The opcode table. The table contains all the opcodes (all pages). | 446 /* The opcode table. The table contains all the opcodes (all pages). |
419 You can't rely on the order. */ | 447 You can't rely on the order. */ |
420 extern const struct m68hc11_opcode m68hc11_opcodes[]; | 448 extern const struct m68hc11_opcode m68hc11_opcodes[]; |
421 extern const int m68hc11_num_opcodes; | 449 extern const int m68hc11_num_opcodes; |
422 | 450 |
423 /* Alias table for 68HC12. It translates some 68HC11 insn which are not | 451 /* Alias table for 68HC12. It translates some 68HC11 insn which are not |
424 implemented in 68HC12 but have equivalent translations. */ | 452 implemented in 68HC12 but have equivalent translations. */ |
425 extern const struct m68hc12_opcode_alias m68hc12_alias[]; | 453 extern const struct m68hc12_opcode_alias m68hc12_alias[]; |
426 extern const int m68hc12_num_alias; | 454 extern const int m68hc12_num_alias; |
427 | 455 |
428 #endif /* _OPCODE_M68HC11_H */ | 456 #endif /* _OPCODE_M68HC11_H */ |
OLD | NEW |