X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;ds=sidebyside;f=macros.S;fp=macros.S;h=afde07d023ed6acc8b0840daa0929087b84201fd;hb=6cf67300c03d92a9cc0c5888b33cdb21a852eb69;hp=0000000000000000000000000000000000000000;hpb=89732d399de9007aaf2894b0c637e8cfb9ed47ac;p=sped.git diff --git a/macros.S b/macros.S new file mode 100644 index 0000000..afde07d --- /dev/null +++ b/macros.S @@ -0,0 +1,23 @@ + +%ifndef __UTILS_S__ +%define __UTILS_S__ + +%macro write_str 2 + mov eax, 4 + mov ebx, 1 + mov ecx, %1 + mov edx, %2 + int 0x80 +%endmacro + +; gets the nth string ptr in a str array +; of the form: str_offset buffer, n +; result is in eax +%macro str_offset 2 + mov eax, %2 + mov ecx, 4 + mul ecx + add eax, DWORD %1 +%endmacro + +%endif