DIN:	LXI	H,0		; ANSWER :=0;
	LXI	B,0		; SIGN := 0;NSIGN := 0;
	CALL	GET		; A := INPUT (character);
	CPI	'+'		; is A = '+'?
	JZ	DINSIGN		; if so then go save sign
	CPI	'-'		; is A = '-'?
	JNZ	DINNUMB		; if not then go to numeric tests;
	DCR	C		; SIGN := -1;
DINSIGN:MOV	B,C		; NSIGN := SIGN;
	CALL	GET		; A := INPUT (character);
DINNUMB:CPI	'0'		; is A LT '0'?
	RC			; if so then return [not numeric];
	CPI	':'		; is A LT ':'?
	RNC			; if not then return [not numeric);
	ANI	15		; A :=A & b'00001111' [mask low order];
	MOV	C,A		; VALUE := A [save input, loworder];
	MOV	A,B		; A := NSIGN;
	MVI	B,9		; CNT := 9;
	MOV	D,H		; MULTPLR := ANSWER [high order];
	MOV	E,L		; MULTPLR := ANSWER [low order];
	RAL			; is SIGN positive? [uses copy in A] ;
	JNC	DINMPYP		; if not then go to positive multipiy;
	XRA	A		; A :=0; CARRY := 0;
	SUB	C		; A := A - VALUE [negate VALUE];
	MOV	C,A		; C := A [save negated value] ;
	MOV	A,H		; A := ANSWER [high order];
	RAL			; is ANSWER negative?
	JC	DINMPYN		; if so then proceed [not first time];
	MVI	B,0		; CNT := 0 [so sign extension at DINEGATE works];
	JMP	DINEGATE	; first time add VALUE to ANSWER [initialized to zero];
DINMPYN:DAD	D		; ANSWER := ANSWER + MULTPLR [both are negsttve];
	RNC			; if no overflow then return;
	DCR	B		; CNT:= CNT-1;
	JNZ	DINMPYN		; if CNT NE 0 then reiterate;
DINEGATE:DCR	B		; CNT := CNT - 1 [now CNT := -1];
	DAD	B		; ANSWER := ANSWER + (-VALUE) [16 bit ops];
	JMP	DINSIGN		; reiterate with next numeric character;
DINMPYP:DAD	D		; ANSWER := ANSWER + MULTPLR;
	RC			; if CARRY := 1 then return [overflow];
	DCR	B		; CNT := CNT-1;
	JNZ	DINMPYP		; if CNT NE 0 then reiterate;
	DAD	B		; ANSWER := ANSWER + VALUE;
	JMP	DINSIGN		; reiterate with next numeric character;

