
L decimal_			
				# num base buff from A B DI
				# pass this the END of the buffer
				# return @ $string address in A
mod=D 	buff=DI

	zero D
	= 0 to $buff					# unix/C string
	-test 10 with B					# signed if decimal
		when not zero		$crux
	zero SI
	ANDtest B from $signbit
	negate  A
		when zero		$crux
	=  0x2d  to SI					# 0x2d is ASCII hyphen
L crux
	1- $buff
	/ B
	= $digit D to D
	= byte D to byte @ $buff
	zero D
	ANDtest A  with A
		when not zero		$crux
	ANDtest $sign with $sign
		when zero		$bail
	1- $buff
	= byte SI to byte SI $buff	
L bail
	= $buff to A
				return



. data

