From 2fa8c15b44d501a758869f31656205acc9dbd55c Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Mon, 30 Sep 2024 18:19:07 +0200 Subject: [PATCH] Added simple push and pop macro --- src/jmp.inc | 13 +++---------- src/macros.inc | 13 +++++++++++++ src/main.s | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 src/macros.inc diff --git a/src/jmp.inc b/src/jmp.inc index 8197685..2a8501d 100644 --- a/src/jmp.inc +++ b/src/jmp.inc @@ -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 index 0000000..b4e7f0c --- /dev/null +++ b/src/macros.inc @@ -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 diff --git a/src/main.s b/src/main.s index 2fb530a..178016c 100644 --- a/src/main.s +++ b/src/main.s @@ -1,4 +1,5 @@ #include "hw.inc" +#include "macros.inc" .org 0x0 #include "jmp.inc" -- 2.30.2