-
Notifications
You must be signed in to change notification settings - Fork 0
/
assemblygenerate.h
46 lines (31 loc) · 1.26 KB
/
assemblygenerate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef ASSEMBLYGENERATE_H
#define ASSEMBLYGENERATE_H
#include "codegenerate.h"
typedef enum {string, number} fieldType;
typedef enum {ADC, ADCI, AND, ANDI, ASL, CMP, CPI, CPX, CPY,
EOR, EORI, LSR, ORA, ORAI, SBC, SBCI,
MULP, MULPI, DIVS, DIVSI, LDA, LDAI, LDX, LDXI,
LDY, LDYI, STA, STX, STY, PHA, PHP, PLA, PLP,
TSX, TXS, BEQ, BMI, BNE, BPL, JMP, JSR, RTS,
CLZ, CLN, CLV, DEX, DEY, INX, INY, TAX, TAY, TXA, TYA,
BRK, NOP, INPT, OUP, TABR, CPF, PHPC, PLPC, SFF,
TXAX, TAXX, SPC} instructionType;
typedef struct assemblyListT *assemblyListS;
typedef struct assemblyListT{
instructionType instruction;
fieldType fT;
union {
int num;
char *name;
}field;
assemblyListS next;
}assemblyListT;
assemblyListS createAssemblyList(instructionType instruction, fieldType fT, char *name, int num);
void insertAssemblyLine(assemblyListS A, instructionType instruction, fieldType fT, char *name, int num);
void pushScopeNameStack(char *name);
void popScopeNameStack(void);
void printQList(QuadrupleList QList);
void printBinary(assemblyListS AList);
char *decimalToBinary(int K);
char *printBinInstruct(instructionType instruction);
#endif