bootstrap.asm: simplify string macro so we can use it in create macros
1 files changed, 13 insertions(+), 23 deletions(-)

M bootstrap.asm
M bootstrap.asm +13 -23
@@ 29,11 29,10 @@ global _start
 ; 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 @@ global _start
 	%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 @@ global label
 	%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 @@ fcreate write
 
 section .rodata
 	digits db "0123456789abcdefghijklmnopqrstuvwxyz"
-	; lendigits db $ - digits
 section .text
 
 ; r9: base to convert to

          
@@ 609,7 599,7 @@ fcreate find, "(find)"
 	ret
 
 section .rodata
-	string nsw, `: no such word\n`
+	nsw: string `: no such word\n`
 section .text
 
 ;	( *str -- )

          
@@ 890,7 880,7 @@ fcreate mcolon, 'm:'
 	tail mode
 
 section .rodata
-	string closeComment, ")"
+	closeComment: string ")"
 section .text
 
 fcreate icomment, "("

          
@@ 918,8 908,8 @@ mcreate semi, ";;"
 	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 @@ fcreate printstack, `.s`
 	ret
 
 section .rodata
-	string tab, `\t`
+	tab: string `\t`
 section .text
 
 ; ( -- )