s502 assembler
A very simple assembler for the 6502 line of processors written in C
Enumerations | Variables
addressmode.h File Reference

AddressMode enum and related data. More...

Go to the source code of this file.

Enumerations

enum  AddressMode {
  ADRM_ACC = 0, ADRM_ABS, ADRM_ABS_X, ADRM_ABS_Y,
  ADRM_IMM, ADRM_IMP, ADRM_IND, ADRM_IND_X,
  ADRM_IND_Y, ADRM_REL, ADRM_ZPG, ADRM_ZPG_X,
  ADRM_ZPG_Y, ADRM_COUNT
}
 Possible address modes of an instruction. More...
 

Variables

int ADRM_SIZES [ADRM_COUNT+1]
 operand sizes of addressmodes More...
 
const char * ADRM_NAMES [ADRM_COUNT+1]
 Human-readable names of address modes. More...
 

Detailed Description

AddressMode enum and related data.

Definition in file addressmode.h.

Enumeration Type Documentation

◆ AddressMode

Possible address modes of an instruction.

Enumerator
ADRM_ACC 

Accumulator.

ADRM_ABS 

Absolute addressing.

ADRM_ABS_X 

Absolute, X indexed.

ADRM_ABS_Y 

Absolute, Y indexed.

ADRM_IMM 

Immidiate.

ADRM_IMP 

Implied (no operand)

ADRM_IND 

Indirect (16 bit)

ADRM_IND_X 

Indirect (8 bit), X indexed.

ADRM_IND_Y 

Indirect (8 bit), Y indexed.

ADRM_REL 

Relative (8bit, signed 2's complement)

ADRM_ZPG 

Zeropage.

ADRM_ZPG_X 

Zeropage, X indexed.

ADRM_ZPG_Y 

Zeropage, Y indexed.

ADRM_COUNT 

Total number of addressing modes.

Definition at line 10 of file addressmode.h.

10  {
12  ADRM_ACC = 0,
13 
15  ADRM_ABS,
16 
18  ADRM_ABS_X,
19 
21  ADRM_ABS_Y,
22 
24  ADRM_IMM,
25 
27  ADRM_IMP,
28 
30  ADRM_IND,
31 
33  ADRM_IND_X,
34 
36  ADRM_IND_Y,
37 
39  ADRM_REL,
40 
42  ADRM_ZPG,
43 
45  ADRM_ZPG_X,
46 
48  ADRM_ZPG_Y,
49 
52 };

Variable Documentation

◆ ADRM_NAMES

const char* ADRM_NAMES[ADRM_COUNT+1]
extern

Human-readable names of address modes.

Can be used to pretty print if indexed by enum value

Definition at line 16 of file addressmode.c.

Referenced by instruction_print(), pass_one(), and token_analyze_instruction().

◆ ADRM_SIZES

int ADRM_SIZES[ADRM_COUNT+1]
extern

operand sizes of addressmodes

Definition at line 37 of file addressmode.c.

Referenced by token_analyze_instruction().

ADRM_ZPG_X
@ ADRM_ZPG_X
Zeropage, X indexed.
Definition: addressmode.h:45
ADRM_REL
@ ADRM_REL
Relative (8bit, signed 2's complement)
Definition: addressmode.h:39
ADRM_ZPG
@ ADRM_ZPG
Zeropage.
Definition: addressmode.h:42
ADRM_IND_X
@ ADRM_IND_X
Indirect (8 bit), X indexed.
Definition: addressmode.h:33
ADRM_IND
@ ADRM_IND
Indirect (16 bit)
Definition: addressmode.h:30
ADRM_COUNT
@ ADRM_COUNT
Total number of addressing modes.
Definition: addressmode.h:51
ADRM_ZPG_Y
@ ADRM_ZPG_Y
Zeropage, Y indexed.
Definition: addressmode.h:48
ADRM_ACC
@ ADRM_ACC
Accumulator.
Definition: addressmode.h:12
ADRM_IMM
@ ADRM_IMM
Immidiate.
Definition: addressmode.h:24
ADRM_IND_Y
@ ADRM_IND_Y
Indirect (8 bit), Y indexed.
Definition: addressmode.h:36
ADRM_ABS_Y
@ ADRM_ABS_Y
Absolute, Y indexed.
Definition: addressmode.h:21
ADRM_ABS_X
@ ADRM_ABS_X
Absolute, X indexed.
Definition: addressmode.h:18
ADRM_IMP
@ ADRM_IMP
Implied (no operand)
Definition: addressmode.h:27
ADRM_ABS
@ ADRM_ABS
Absolute addressing.
Definition: addressmode.h:15