s502 assembler
A very simple assembler for the 6502 line of processors written in C
addressmode.c
Go to the documentation of this file.
1 #include "addressmode.h"
2 
16 const char* ADRM_NAMES[] = {
17  "Accumulator",
18  "Absolute",
19  "Absolute, X",
20  "Absolute, Y",
21  "Immidiate",
22  "Implied",
23  "Indirect",
24  "Indirect, X",
25  "Indirect, Y",
26  "Relative",
27  "Zeropage",
28  "Zeropage, X",
29  "Zeropage, Y",
30  "ERROR! OVERINDEX!",
31 };
32 
33 
37 int ADRM_SIZES[ADRM_COUNT + 1] = {
38  0, // ACC
39  2, // ABS
40  2, // ABS_X
41  2, // ABS_Y
42  1, // IMM
43  0, // IMP
44  2, // IND
45  1, // IND_X
46  1, // IND_Y
47  1, // REL
48  1, // ZPG
49  1, // ZPG_X
50  1, // ZPG_Y
51  -1,
52 };
object
Conventions Naming everything in snake_case functions should start with module name Structure Objects no one should possess a direct instance of any object
Definition: CONVENTIONS.txt:10
ADRM_NAMES
const char * ADRM_NAMES[]
Human-readable names of address modes.
Definition: addressmode.c:16
ADRM_COUNT
@ ADRM_COUNT
Total number of addressing modes.
Definition: addressmode.h:51
destructors
Conventions Naming everything in snake_case functions should start with module name Structure Objects no one should possess a direct instance of any only pointers constructors should return with a or NULL destructors(named free) should free ALL memory associated with the object - deleting an object should always be at MOST 2 lines - calling object_free and setting the ptr to NULL(later can be omitted) Error handling - functions should return 0 to indicate success
ADRM_SIZES
int ADRM_SIZES[ADRM_COUNT+1]
operand sizes of addressmodes
Definition: addressmode.c:37
Map
Simple key->value map (str->int)
Definition: map.h:34
addressmode.h
AddressMode enum and related data.
TokensListElement
An element of a TokensList.
Definition: tokenslist.h:16
pointer
Conventions Naming everything in snake_case functions should start with module name Structure Objects no one should possess a direct instance of any only pointers constructors should return with a pointer
Definition: CONVENTIONS.txt:11
TokensList
A doubly-linked list for storing Tokens.
Definition: tokenslist.h:29
better
Questions to Szkup object model ok pass Tokens by ref possily better logging modular or macro commandline would be better
Definition: questions.txt:4
possibly
Questions to Szkup object model ok pass Tokens by ref possily better logging modular or macro possibly
Definition: questions.txt:4
resources
Conventions Naming everything in snake_case functions should start with module name Structure Objects no one should possess a direct instance of any only pointers constructors should return with a or NULL or negative to indicate error most errors should cause the program to end error handling should still free all allocated resources(memory, files) - all functions should signal their failed state on receiving an error