
Read_Sig:
        mov dptr,#Sigbits_string
        lcall outstr                
        mov	P0,#0ffh	;make p0 an input

	setb	Vpp		; set Vpp = 5V, clr = 12V
	setb	PROG		; prog high (not pulsed)

	clr	P26		; set up programming pins
	clr	P27		; as per datasheet page 73
	clr	P36		; 
	clr	P37		;

	mov	dph,#000h	; read addresses 30h, 31h, 32h
	mov	dpl,#030h	; in 89C51, 89C52
	mov	r7,#003h	; 3 signature bytes to read

;send address high byte first
	mov	a,dph		; addrhi in dph
	orl	a,#080h		; don't interfere with p2.7(prog)
	mov	p2,a		; p2 = addrhi (only uses 6 bits)

Read_SigLp:
	mov	p1,dpl		; p1 = addrlo	
	lcall	delay10		; 10uS Delay

	MOV A,  P0          	; read byte to acc
	lcall   printchar
	inc	dptr            ; next address
	djnz	r7,Read_SigLp   ; do all three bytes

	ljmp	Main            ; back to main program
;---------------------------------------------------
Sigbits_string:
	db	0Dh,0Ah,'Signature Bits: ',0
