# HG changeset patch # User telesto # Date 1681308575 -7200 # Wed Apr 12 16:09:35 2023 +0200 # Node ID 0112a303b9c48b9c12aee1227f21b3339578860b # Parent 36106531a1f04f9666a4bdf90cc1d764668d61c2 bootstrap.asm: simplify string macro so we can use it in create macros diff --git a/bootstrap.asm b/bootstrap.asm --- a/bootstrap.asm +++ b/bootstrap.asm @@ -29,11 +29,10 @@ ; pointer size for operands %define ptr qword -; %1: name, %2: string token -%macro string 2 - %strlen len %2 - %1 dq len - db %2, 0 +%macro string 1 + %strlen len %1 + dq len + db %1, 0 %endmacro %macro mpush 1-* @@ -108,15 +107,11 @@ %endif %define label fcode(name) %defstr symbol label - %strlen lend dictname - %strlen lens symbol [section .rodata] dict(label): dp dict(fprev), label - dp lend - db dictname, 0 - dp lens - db symbol, 0 + string dictname + string symbol %xdefine fprev label [section .text] label: @@ -131,15 +126,11 @@ %endif %define label mcode(name) %defstr symbol label - %strlen lend dictname - %strlen lens symbol [section .rodata] dict(label): dp dict(mprev), label - dp lend - db dictname, 0 - dp lens - db symbol, 0 + string dictname + string symbol %xdefine mprev label [section .text] label: @@ -301,7 +292,6 @@ section .rodata digits db "0123456789abcdefghijklmnopqrstuvwxyz" - ; lendigits db $ - digits section .text ; r9: base to convert to @@ -609,7 +599,7 @@ ret section .rodata - string nsw, `: no such word\n` + nsw: string `: no such word\n` section .text ; ( *str -- ) @@ -890,7 +880,7 @@ tail mode section .rodata - string closeComment, ")" + closeComment: string ")" section .text fcreate icomment, "(" @@ -918,8 +908,8 @@ tail comma1 section .rodata - string space, ' ' - string newline, `\n` + space: string ' ' + newline: string `\n` section .text ; if rsi==stack we know that there is no element on the stack, @@ -954,7 +944,7 @@ ret section .rodata - string tab, `\t` + tab: string `\t` section .text ; ( -- )