Added simple push and pop macro
authorLukas Krickl <lukas@krickl.dev>
Mon, 30 Sep 2024 16:19:07 +0000 (18:19 +0200)
committerLukas Krickl <lukas@krickl.dev>
Mon, 30 Sep 2024 16:19:07 +0000 (18:19 +0200)
src/jmp.inc
src/macros.inc [new file with mode: 0644]
src/main.s

index 819768561ba3cb8f4fc19d897c02fd296addef8b..2a8501d1acc8cccceee4cf1c9fd480498cf0ae21 100644 (file)
@@ -14,15 +14,8 @@ rst_panic:
 ; vblank 0x40
 ;=============
 vec_vblank:
-  push af
-  push bc
-  push de
-  push hl
-
-
-  pop hl
-  pop de
-  pop bc
-  pop af
+  push_all 
+  
+  pop_all
 
   reti
diff --git a/src/macros.inc b/src/macros.inc
new file mode 100644 (file)
index 0000000..b4e7f0c
--- /dev/null
@@ -0,0 +1,13 @@
+#macro push_all
+  push af
+  push bc
+  push de
+  push hl
+#endmacro
+
+#macro pop_all
+  pop hl
+  pop de
+  pop bc
+  pop af
+#endmacro
index 2fb530a79637e543e7fcece601f5ddb0a506356e..178016c222eb81a7bcd79626a8b4296fd9ca28ad 100644 (file)
@@ -1,4 +1,5 @@
 #include "hw.inc"
+#include "macros.inc"
 
 .org 0x0
 #include "jmp.inc"