From: Lukas Krickl Date: Fri, 20 Jun 2025 19:26:22 +0000 (+0200) Subject: macros: Added mul16 and div16 macros X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=4b7cd2408110814339f8b1616be4688d076ee783;p=gbrg%2F.git macros: Added mul16 and div16 macros --- diff --git a/src/macros.inc b/src/macros.inc index f06eed2..fcc3fe3 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -67,6 +67,16 @@ srl $1 ; / 2 srl $1 ; / 4 srl $1 ; / 8 +#endmacro + + ; divides a regiser by 16 + ; inputs: + ; $1: the register +#macro div8 + srl $1 ; / 2 + srl $1 ; / 4 + srl $1 ; / 8 + srl $1 ; / 16 #endmacro ; multiplies a regiser with 8 @@ -78,6 +88,16 @@ sla $1 ; * 8 #endmacro + ; multiplies a regiser with 16 + ; inputs: + ; $1: the register +#macro mul16 + sla $1 ; * 2 + sla $1 ; * 4 + sla $1 ; * 8 + sla $1 ; * 16 +#endmacro + ; asserts. if $1 != $2 causes a ld b, b ; inputs: ; $1: comparison (z, nz, c, nz)