T.I.M | Toolchain Documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
asm_emit.c File Reference
#include "asm.h"

Functions

int asm_emit_opcode_LOADR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_LOADI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_STORI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_STORR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_PUSH (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_POP (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_MOVR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_MOVI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_JUMPR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_JUMPI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_CALLR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_CALLI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_RETURN (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_TEST (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_HALT (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_ANDR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_NANDR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_ORR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_NORR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_XORR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_LSLR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_LSRR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_NOTR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_ANDI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_NANDI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_ORI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_NORI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_XORI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_LSLI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_LSRI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IADDI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_ISUBI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IMULI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IDIVI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IALSI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IASRI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IADDR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_ISUBR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IMULR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IDIVR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IASLR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_IASRR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FADDI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FSUBI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FMULI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FDIVI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FASLI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FASRI (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FADDR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FSUBR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FMULR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FDIVR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FASLR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_FASRR (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_SLEEP (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_opcode_NOT_EMITTED (asm_statement *statement, FILE *file, asm_format format)
 
int asm_emit_instructions (asm_statement *statements, FILE *file, asm_format format)
 Responsible for writing all statements to the supplied file. More...
 

Function Documentation

int asm_emit_instructions ( asm_statement *  statements,
FILE *  file,
asm_format  format 
)

Responsible for writing all statements to the supplied file.

Parameters
statements- Linked list of statements to emit binary code for.
file- The file to write the code too.
format- Whether to emit the code as raw bytes or ascii binary strings. This is used to feed the VHDL testbenches.
Returns
An integer representing the number of errors encountered, if any.

References ANDI, ANDR, asm_emit_opcode_ANDI(), asm_emit_opcode_ANDR(), asm_emit_opcode_CALLI(), asm_emit_opcode_CALLR(), asm_emit_opcode_FADDI(), asm_emit_opcode_FADDR(), asm_emit_opcode_FASLI(), asm_emit_opcode_FASLR(), asm_emit_opcode_FASRI(), asm_emit_opcode_FASRR(), asm_emit_opcode_FDIVI(), asm_emit_opcode_FDIVR(), asm_emit_opcode_FMULI(), asm_emit_opcode_FMULR(), asm_emit_opcode_FSUBI(), asm_emit_opcode_FSUBR(), asm_emit_opcode_HALT(), asm_emit_opcode_IADDI(), asm_emit_opcode_IADDR(), asm_emit_opcode_IALSI(), asm_emit_opcode_IASLR(), asm_emit_opcode_IASRI(), asm_emit_opcode_IASRR(), asm_emit_opcode_IDIVI(), asm_emit_opcode_IDIVR(), asm_emit_opcode_IMULI(), asm_emit_opcode_IMULR(), asm_emit_opcode_ISUBI(), asm_emit_opcode_ISUBR(), asm_emit_opcode_JUMPI(), asm_emit_opcode_JUMPR(), asm_emit_opcode_LOADI(), asm_emit_opcode_LOADR(), asm_emit_opcode_LSLI(), asm_emit_opcode_LSLR(), asm_emit_opcode_LSRI(), asm_emit_opcode_LSRR(), asm_emit_opcode_MOVI(), asm_emit_opcode_MOVR(), asm_emit_opcode_NANDI(), asm_emit_opcode_NANDR(), asm_emit_opcode_NORI(), asm_emit_opcode_NORR(), asm_emit_opcode_NOT_EMITTED(), asm_emit_opcode_NOTR(), asm_emit_opcode_ORI(), asm_emit_opcode_ORR(), asm_emit_opcode_POP(), asm_emit_opcode_PUSH(), asm_emit_opcode_RETURN(), asm_emit_opcode_SLEEP(), asm_emit_opcode_STORI(), asm_emit_opcode_STORR(), asm_emit_opcode_TEST(), asm_emit_opcode_XORI(), asm_emit_opcode_XORR(), CALLI, CALLR, error, FADDI, FADDR, FASLI, FASLR, FASRI, FASRR, FDIVI, FDIVR, FMULI, FMULR, FSUBI, FSUBR, HALT, IADDI, IADDR, IALSI, IASLR, IASRI, IASRR, IDIVI, IDIVR, IMULI, IMULR, ISUBI, ISUBR, JUMPI, JUMPR, LOADI, LOADR, LSLI, LSLR, LSRI, LSRR, MOVI, MOVR, NANDI, NANDR, NORI, NORR, NOT_EMITTED, NOTR, opcode, ORI, ORR, POP, PUSH, RETURN, SLEEP, STORI, STORR, TEST, XORI, and XORR.

Referenced by main().

int asm_emit_opcode_ANDI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_ANDR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_CALLI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_CALLR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FADDI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FADDR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FASLI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FASLR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FASRI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FASRR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FDIVI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FDIVR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FMULI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FMULR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FSUBI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_FSUBR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_HALT ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IADDI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IADDR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IALSI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IASLR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IASRI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IASRR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IDIVI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IDIVR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IMULI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_IMULR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_ISUBI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_ISUBR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_JUMPI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_JUMPR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_LOADI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_LOADR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_LSLI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_LSLR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_LSRI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_LSRR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_MOVI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_MOVR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_NANDI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_NANDR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_NORI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_NORR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_NOT_EMITTED ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

Referenced by asm_emit_instructions().

int asm_emit_opcode_NOTR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_ORI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_ORR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_POP ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_PUSH ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_RETURN ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_SLEEP ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_STORI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_STORR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_TEST ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_XORI ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().

int asm_emit_opcode_XORR ( asm_statement *  statement,
FILE *  file,
asm_format  format 
)

References opcode.

Referenced by asm_emit_instructions().