diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-10-28 12:00:37 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-10-28 12:00:37 +0200 |
commit | 8c1ba415e11adf8228d9dffa8acb922aa03b74ca (patch) | |
tree | fc5a1201ce2d9647f615371fc3de7bb5cf095012 /miniemu | |
parent | 26fb7d3a0aa8d0b0d11fefb3da494e043417806e (diff) | |
download | compilertests-8c1ba415e11adf8228d9dffa8acb922aa03b74ca.tar.gz compilertests-8c1ba415e11adf8228d9dffa8acb922aa03b74ca.tar.bz2 |
added some comments on the CPU registers
tried to build with tcc, works, added to README(s)
Diffstat (limited to 'miniemu')
-rw-r--r-- | miniemu/README | 1 | ||||
-rw-r--r-- | miniemu/cpu.h | 16 |
2 files changed, 9 insertions, 8 deletions
diff --git a/miniemu/README b/miniemu/README index 6b27b32..d757eed 100644 --- a/miniemu/README +++ b/miniemu/README @@ -88,6 +88,7 @@ Building gcc -I../minilib -g -O0 -m32 -march=i386 -ffreestanding -Werror -Wall -Wno-return-type -pedantic -std=c89 -o miniemu *.c ../minilib/*.c clang -I../minilib -g -O0 -march=i386 -fno-builtin -std=c89 -Werror -Wall -Wno-return-type -o miniemu *.c ../minilib/*.c +tcc -I../minilib -g -O0 -march=i386 -fno-builtin -std=c89 -Werror -Wall -Wno-return-type -o miniemu *.c ../minilib/*.c Usage ----- diff --git a/miniemu/cpu.h b/miniemu/cpu.h index 7a3d554..f47015f 100644 --- a/miniemu/cpu.h +++ b/miniemu/cpu.h @@ -1,18 +1,18 @@ #pragma once typedef struct Cpu { - int PC; - int AX; - int BX; - int CX; - int DX; - int SP; + int PC; /* program counter */ + int AX; /* accumulator register */ + int BX; /* base register */ + int CX; /* counter register */ + int DX; /* data register */ + int SP; /* stack pointer */ + int Z; /* zero status bit */ + int C; /* carry status bit */ struct Memory *memory; int stopped; int error; int debug; - int Z; - int C; } Cpu; extern void cpu_init( Cpu *cpu, struct Memory *memory ); |