cpu.h 1.02 KB
//
// Created by imanol on 12/25/16.
//

#ifndef SYNACORVM_CPU_H
#define SYNACORVM_CPU_H

#include <stdio.h>
#include "mem.h"
#include "stack.h"
#include "registers.h"
#include "instructions.h"

#define MAX_INT 32767

void mov(uint16_t dst, uint16_t src);
void push(uint16_t src);
void pop(uint16_t dst);
void teq(uint16_t dst, uint16_t a, uint16_t b);
void tgt(uint16_t dst, uint16_t a, uint16_t b);
void jmp(uint16_t dst);
void jnz(uint16_t cond, uint16_t dst);
void jz(uint16_t cond, uint16_t dst);
void add(uint16_t dst, uint16_t a, uint16_t b);
void mul(uint16_t dst, uint16_t a, uint16_t b);
void mod(uint16_t dst, uint16_t a, uint16_t b);
void and(uint16_t dst, uint16_t a, uint16_t b);
void or(uint16_t dst, uint16_t a, uint16_t b);
void not(uint16_t dst, uint16_t src);
void load(uint16_t dst, uint16_t src);
void stor(uint16_t dst, uint16_t src);
void call(uint16_t dst);
uint8_t ret();
void out(uint16_t src);
void in(uint16_t dst);
void nop();

void start_execution();
void core_dump();
void print_regs();

#endif //SYNACORVM_CPU_H