1
0
Fork 0
mirror of https://github.com/pnx/m16vm synced 2026-06-16 03:44:55 +02:00

src/vm.c: add preprocessor macro for reg/mem debug output.

This commit is contained in:
Henrik Hautakoski 2018-11-25 11:38:40 +01:00
parent 66ea2b3b49
commit 61263f65c8
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -22,6 +22,7 @@
#include "mm.h"
#include "cpu.h"
#ifdef M16_DEBUG_MEM
void print_memory() {
int i = 0;
@ -33,7 +34,11 @@ void print_memory() {
}
printf("\n");
}
#else
#define print_memory()
#endif /* ! M16_DEBUG_MEM */
#ifdef M16_DEBUG_REG
void print_regs(uint16_t *regs) {
int i = 0;
@ -45,6 +50,9 @@ void print_regs(uint16_t *regs) {
}
printf("\n");
}
#else
#define print_regs(regs)
#endif /* ! M16_DEBUG_REG */
void run(struct program *prog) {