|
libc8
CHIP-8 utility library
|
#include "instruction.h"#include "../common.h"#include "../decode.h"#include "../font.h"#include "exception.h"#include <stdlib.h>#include <string.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 | c8_parse_instruction (C8 *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 c8_parse_instruction | ( | C8 * | 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 to execute the instruction from |