use32
macro dispnum text,what {
	local d1,d2,d3,d4
	d1='0'+what shr 12 and 0fh
	d2='0'+what shr 8 and 0fh
	d3='0'+what shr 4 and 0fh
	d4='0'+what and 0fh
	if d1>'9'
		d1 = d1 + 'A'-'9'-1
	end if
	if d2>'9'
		d2 = d2 + 'A'-'9'-1
	end if
	if d3>'9'
		d3 = d3 + 'A'-'9'-1
	end if
	if d4>'9'
		d4 = d4 + 'A'-'9'-1
	end if
	display text,d1,d2,d3,d4,13,10
}

macro show it {
	if it eqtype BYTE
		dispnum "BYTE: ",it
	else if it eqtype WORD
		dispnum "WORD: ",it
	else if it eqtype DWORD
		dispnum "DWORD: ",it
	else if it eqtype STRING
		display "STRING: ",it
	else
		display "UNKNOWN: ",it
	end if
	display 13,10
}

b  equ ""

mylink equ 0

macro table [xt,nm]
{
forward
local us,eos
	ALIGN 4
label us
	dd link			; link to prior entry
	dd xt		; XT of this entry
	db (eos-$)
	db nm
label eos
mylink equ us		; for next entry
}


macro addtolist [num,nam]
{ 
	show num
	show nam

	b equ b, num, nam
}


addtolist 8,'hi'
addtolist 7,'mama'

table b

