aforth

FORTH for Linux x86-64, written in assembly.
git clone git://henryandlizzy.uk/aforth
Log | Files | Refs | README

dictionary.s (425B)


      1 #	Dictionary
      2 
      3 verb	forth	LAST
      4 	variable
      5 	endword
      6 
      7 verb	forth	DICTIONARY
      8 	get	LAST
      9 2:	do	DUP
     10 	do	fetch
     11 	const	0
     12 	do	equal
     13 	if	1f
     14 		do	DUP
     15 		const	8
     16 		do	plus
     17 		do	PRINT
     18 		do	fetch
     19 		do	SPACE
     20 		goto	2b
     21 1:	do	DROP
     22 	endword
     23 
     24 verb	forth	FIND
     25 	get	LAST
     26 2:	do	dup2
     27 	const	8
     28 	do	plus
     29 	do	STRCMP
     30 	unless	1f
     31 		const	16
     32 		do	plus
     33 		do	SWAP
     34 		do	fetch
     35 		do	plus
     36 		do	TRUE
     37 		endword
     38 1:	do	fetch
     39 	do	DUP
     40 	if	2b
     41 	do	DROP
     42 	do	FALSE
     43 	endword