M	SET	          0
C	SET	          0
F	SET	          0
;TYPE 
;BYTE = 0..255;
;$STRING255 = STRING 255;
;
;
;PROCEDURE PROMPT (X,Y,LENGTH: BYTE; P:$STRING255;
;	         PROTECTED_FIELD_DESIRED:BOOLEAN);
;
;{procedure to position the cursor on the terminal, display a 
;prompting message, and provide underline char for an answer}
;
;VAR
;UNDERLINE: STRING 255;
;I:INTEGER;
;BEGIN
L156
	NAME PROMPT
	ENTRY PROMPT
PROMPT:
	ENTR	D,2,258
;	UNDERLINE:='_';
	STMT	D,1
	PUSH	IX
	POP	H
	DCX	H
	DCX	H
	MVI	M,1
	DCX	H
	MVI	M,95
;	FOR  I:= 1 TO LENGTH DO APPEND (UNDERLINE,'_');
	STMT	D,2
	MOV	0(IX),A
	MVI	-1(IX),1
	PUSH	IX
	MOV	H,A
	LXI	B,265
	PUSH	IX
	DADX	B
	MOV	L,0(IX)
	POP	IX
	XTHL
L177
	MOV	D,M
	DCX	H
	MOV	E,M
	XTHL
	PUSH	H
	GE	D,0
	JNC	L178
	STMT	D,3
	PUSH	IX
	POP	H
	DCX	H
	DCX	H
	PUSH	H
	LXI	H,255
	PUSH	H
	LXI	H,351
	PUSH	H
	LXI	H,2
	PUSH	H
	CALL	L137
	CTRL	M,3
	POP	H
	XTHL
	INR	M
	INX	H
	JRNZ	L197
	INR	M
	JV	L198
L197
	JMP	L177
L178
	POP	D
L198
	POP	D
;	IF PROTECTED_FIELD_DESIRED = FALSE THEN
	STMT	D,4
	MOV	H,A
	MOV	L,8(IX)
	MOV	A,L
	CMPI	D,0
	MOV	A,H
;WRITE  (CHR(27),'=',CHR(Y+31),CHR(X+31),P,UNDERLINE)
	JNZ	L200
	STMT	D,5
	LXI	H,27
	STMT	M,5
	PUSH	H
	LXI	H,769
	XTHL
	LXI	B,1
	PUSH	B
	MOV	H,L
	PUSH	H
	INX	S
	LXI	H,769
	PUSH	H
	LXI	B,1
	PUSH	B
	LXI	H,61
	MOV	H,L
	PUSH	H
	INX	S
	MO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