From: Lukas Krickl Date: Mon, 30 Sep 2024 16:19:07 +0000 (+0200) Subject: Added simple push and pop macro X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=2fa8c15b44d501a758869f31656205acc9dbd55c;p=gbrg%2F.git Added simple push and pop macro --- 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"