libc8
CHIP-8 utility library
|
#include "c8/private/instruction.h"
#include "c8/decode.h"
#include "c8/defs.h"
#include "c8/font.h"
#include "c8/private/exception.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Macros | |
#define | VERBOSE(c) (c->flags & C8_FLAG_VERBOSE) |
#define | SCHIP_EXCLUSIVE(c) |
#define | XOCHIP_EXCLUSIVE(c) |
#define | QUIRK_BITWISE(c) |
#define | QUIRK_DRAW(c) |
#define | QUIRK_LOADSTORE(c) |
#define | QUIRK_SHIFT(c) |
#define | BORROWS(x, y) ((((int) x) - y) < 0) |
#define | CARRIES(x, y) ((((int) x) + y) > UINT8_MAX) |
Functions | |
int | parse_instruction (c8_t *c8) |
Execute the instruction at c8->pc | |
This file contains the implementation of the instruction parsing and execution for the CHIP-8 interpreter.
#define BORROWS | ( | x, | |
y | |||
) | ((((int) x) - y) < 0) |
#define CARRIES | ( | x, | |
y | |||
) | ((((int) x) + y) > UINT8_MAX) |
#define QUIRK_BITWISE | ( | c | ) |
#define QUIRK_DRAW | ( | c | ) |
#define QUIRK_LOADSTORE | ( | c | ) |
#define QUIRK_SHIFT | ( | c | ) |
#define SCHIP_EXCLUSIVE | ( | c | ) |
#define VERBOSE | ( | c | ) | (c->flags & C8_FLAG_VERBOSE) |
#define XOCHIP_EXCLUSIVE | ( | c | ) |
int parse_instruction | ( | c8_t * | c8 | ) |
Execute the instruction at c8->pc
This function parses and executes the instruction at the current program counter.
If verbose flag is set, this will print the instruction to stdout
as well.
c8 | the c8_t to execute the instruction from |