	title	Module from library BASE_2 : SGNOUT
	name	('SGNOUT')
	maclib	baselib.lib

; Convert signed hex number to ASCII decimal string

; Copyright (C)	Werner Cirsovius
;		Hohe Weide 44
;		D-20253 Hamburg
;		Tel.: +49-40-4223247

;		Version 1.2, July 1987

; ENTRY	HL holds hex number
;	DE points to string
;	B holds character to be stored at the end
;	(Usually $ or zero)
; EXIT	Decimal string closed by charcter in B

	entry	sgnout

	extrn	decout,neghl

sgnout:
	ld	a,h		; Test MSB
	rla
	jp	nc,decout	; Not set, positive
	ld	a,'-'
	ld	(de),a		; Set sign
	inc	de
	call	neghl		; Negate number
	jp	decout

	end

