projects
/
ulas
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
675d2bc
)
WIP: Added register definitions
author
Lukas Krickl
<lukas@krickl.dev>
Tue, 21 Nov 2023 10:41:56 +0000
(11:41 +0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Tue, 21 Nov 2023 10:41:56 +0000
(11:41 +0100)
include/ulas.h
patch
|
blob
|
history
src/ulas.c
patch
|
blob
|
history
diff --git
a/include/ulas.h
b/include/ulas.h
index 21f15c830396f1178f4dab93c2ffbc59e9cc11e4..1783a3f0233eee8c31a6d5459aec1b66bbedad00 100644
(file)
--- a/
include/ulas.h
+++ b/
include/ulas.h
@@
-298,6
+298,22
@@
enum ulas_asmdir {
ULAS_ASMDIR_INCBIN,
};
+enum ulas_asmregs {
+ // r8
+ ULAS_REG_A = 7,
+ ULAS_REG_B = 0,
+ ULAS_REG_C = 1,
+ ULAS_REG_D = 2,
+ ULAS_REG_E = 3,
+ ULAS_REG_H = 4,
+ ULAS_REG_L = 5,
+
+ // r16
+ ULAS_REG_BC,
+ ULAS_REG_DE,
+ ULAS_REG_HL
+};
+
extern struct ulas_config ulascfg;
struct ulas_config ulas_cfg_from_env(void);
diff --git
a/src/ulas.c
b/src/ulas.c
index 14164a3739a56fa273d3d9c73703007bf44d1931..38a1b4903b16f808dc9b35381c6c9c276617425b 100644
(file)
--- a/
src/ulas.c
+++ b/
src/ulas.c
@@
-1381,12
+1381,15
@@
int ulas_asminstr(char *dst, unsigned long max, const char *line,
// TODO: check for symbol token here... if so add it
// and skip to the next token
+ // misc / control
ULAS_STATICINSTR("nop", 1, 0x00);
ULAS_STATICINSTR("halt", 1, 0x76);
ULAS_STATICINSTR("stop", 2, 0x10, 0x00);
ULAS_STATICINSTR("di", 1, 0xF3);
ULAS_STATICINSTR("ei", 1, 0xFB);
+ // 8 bit loads
+
ULASERR("Invalid instruction '%s'\n", ulas.tok.buf);
return -1;
}