31 lines
931 B
C
31 lines
931 B
C
/**
|
|
********************************************************************************
|
|
* @file global.h
|
|
* @brief Defines global constants and types used in the assembler and emulator.
|
|
********************************************************************************
|
|
*/
|
|
|
|
#ifndef __GLOBAL__
|
|
#define __GLOBAL__
|
|
#include <stdint.h>
|
|
|
|
// Number of General Purpose Registers.
|
|
#define REGISTER_COUNT 31
|
|
// Register identifier interpreted as the 'zero register'
|
|
#define ZERO_REGISTER 31
|
|
// Size of the memory in bytes.
|
|
#define MEMORY_SIZE 2097152
|
|
// Length of the memory address in bits.
|
|
#define MEMORY_ADDRESS_LENGTH 21
|
|
// Length of the instruction in bits.
|
|
#define INSTRUCTION_SIZE 32
|
|
|
|
// A byte is an 8-bit unsigned integer in this architecture.
|
|
typedef uint8_t byte;
|
|
// A word is a 32-bit unsigned integer in this architecture.
|
|
typedef uint32_t word;
|
|
// Double word is a 64-bit unsigned integer.
|
|
typedef uint64_t dword;
|
|
|
|
#endif
|