-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeGen.h
More file actions
37 lines (28 loc) · 961 Bytes
/
Copy pathCodeGen.h
File metadata and controls
37 lines (28 loc) · 961 Bytes
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
/* CodeGen.h
Routines to support the generation of assembly code.
*/
#include <stdio.h>
extern FILE *AssmFile;
struct InstrSeq {
char *Label;
char *OpCode;
char *Oprnd1;
char *Oprnd2;
char *Oprnd3;
struct InstrSeq *Next;
};
extern void InitCodeGen(char *AFilename);
extern struct InstrSeq * GenInstr(char *Label, char *OpCode,
char *Oprnd1, char *Oprnd2, char *Oprnd3);
extern struct InstrSeq * AppendSeq(struct InstrSeq *Seq1,
struct InstrSeq *Seq2);
extern void WriteSeq(struct InstrSeq *ASeq);
extern char * GenLabel();
extern int AvailTmpReg();
extern char * TmpRegName(int RegNum);
extern void ReleaseTmpReg(int ANum);
extern void ResetAllTmpReg();
extern struct InstrSeq * SaveSeq();
extern struct InstrSeq * RestoreSeq();
extern char * Imm(int Val);
extern char * RegOff(int Offset, char * Reg);