⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pl80.asm

📁 上载的源程序是一款加油机源程序,它已在产品上使用并已经通过了测试.
💻 ASM
📖 第 1 页 / 共 5 页
字号:
;```````````````````````````````````````````````
;Program: Benzini H-Type 2 Nozzles / No SmartCard Support
;	    It Should Be Programmed On 89C55WD / KL-070-1 MainBoard
;Name...: PL-80 (UC2)
;Created in   : 1385/05/05 , 2006/07/27 , Thursday
;Last Modified: 1385/06/23 , 2006/09/14 , Thursday
;Size : 7.2 KB (36%)
;Lines: 5600 Lines
;```````````````````````````````````````````````

;========== Definition ===========
;========== Definition ===========
;========== Definition ===========
;========== Definition ===========
;========== Definition ===========

;89C52 SFR / Timer2...
T2CON    	EQU 	0C8H
TR2      	BIT 	T2CON.2
RCAP2H	EQU	0CBH
RCAP2L	EQU	0CAH

;MainBoard...
MapB1		equ	27H	;Map of Buffer1(0,0,0,PC1,Noz1,LG,GD,NOB)
MapP2		equ	28H	;Map of Port2(Led4,Led3,1,PF,LF2,VR,M,HF2)
ReliableIO	equ	0E2H	;Shows Which Bit of B1-Result is Reliable.
LED1		equ	MapP2.6	;Green
LED3		equ	MapP2.7	;Red
LED1LED	equ	0E0H	;Led1 Green Register
LED3LED	equ	0E1H	;Led2 Red Register
Speed_Blink_Leds	equ	10	;Speed of Blinking Green & Red Leds.
flag_save	equ	20H.0	;if=0 means save cannot be done,if=1 means save can done (By Noz).
Portdisp	equ	P0	;port of 8bits data for Latch1 (Display Latch).
TT1		equ	P1.4	;Inc totalizer1
TT11		equ	P1.5	;Ack of Totalizer1
Buffer1	equ	P1.0	;Enable of Buffer1 (active Low)
Latch1	equ	P1.1	;Enable of Latch1 (active High)
Latch3	equ	P3.7	;Enable of Latch3 (active High)
R1scan	equ	P3.6	;Scanning Line for Keyboard (R1S2=0 , R1S1=1)
LF2		equ	MapP2.3	;Low Flow2 to UC1
HF2		equ	MapP2.0	;High Flow2 to UC1
M2		equ	MapP2.1	;Motor2 to UC1
VR2		equ	MapP2.2	;VR2 to UC1
TP18		equ	P1.7	;Test Point for UC2 / TP28 on Fiber

;Pulser and Interrupt Rutin....
lastpls1	equ	30h	;Status of Previous Pulser - Side1
A1		bit	p1.2	;Pulse A Side 1
B1		bit	p1.3	;Pulse B Side 1
RST1		bit	p1.6	;Reset F.F Side 1
BA1		equ	31h	;Status of BA1 Pulse Now
cshort1	equ	32h	;Counter of Short or Laqqi of pulser - Side1
cleft1	equ	33h	;Counter of Left pulses of pulser - Side1
right1	equ	34h	;Lowwest Byte of Right pulses - Side1
right2	equ	35h	;Middle1 Byte of Right pulses - Side1
right3	equ	36h	;Middle2 Byte of Right pulses - Side1
right4	equ	37h	;Middle3 Byte of Right pulses - Side1
right5	equ	38h	;Middle4 Byte of Right pulses - Side1
right6	equ	39h	;Highest Byte of Right pulses - Side1
Tempr1	equ	3Ah	;Temp of Lowwest Byte of Right pulses
Tempr2	equ	3Bh	;Temp of Middle1 Byte of Right pulses
Tempr3	equ	3Ch	;Temp of Middle2 Byte of Right pulses
Tempr4	equ	3Dh	;Temp of Middle3 Byte of Right pulses
Tempr5	equ	3Eh	;Temp of Middle4 Byte of Right pulses
Tempr6	equ	3Fh	;Temp of Highest Byte of Right pulses
FlagIsta	bit	20H.1	;Shows We are in Fueling(1) or in Ista condition(0)//Internal Use.
Next_HF_ON	equ	3	;=n . after n Pulses , we turn-on HF.

;Unit-Price Location in Memory...
UPL		equ	0E3H	;Unit-Price LowByte , Decimal Format.
UPH		equ	0E4H	;Unit-Price HighByte , Decimal Format.

;Parametering Flags...
flagGD	bit	20H.2	;flag of GD (0:NC - 1:NO)
flagLG	bit	20H.3	;flag of LG (0:NC - 1:NO)
flagNOZ1	bit	20H.4	;flag of NOZX (0:NC - 1:NO)

;MULTIPLY-HEX2BCD-BCD2HEX Rutins...
HEX_BUFFER_1 	EQU     0DFH    ;LOW  BYTE OF HEX BUFFER .
HEX_BUFFER_2 	EQU     0DEH    ;MID1 BYTE OF HEX BUFFER .
HEX_BUFFER_3 	EQU     0DDH    ;MID2 BYTE OF HEX BUFFER .
HEX_BUFFER_4	EQU     0DCH    ;MID3 BYTE OF HEX BUFFER .
HEX_BUFFER_5	EQU     0DBH    ;MID4 BYTE OF HEX BUFFER .
HEX_BUFFER_6	EQU     0DAH    ;HIGH BYTE OF HEX BUFFER .
HEX_MAZROOB_1	EQU     0D9H    ;LOW  BYTE OF HEX MAZROOB (Here is LITER).
HEX_MAZROOB_2	EQU     0D8H    ;MID  BYTE OF HEX MAZROOB (Here is LITER).
HEX_MAZROOB_3	EQU     0D7H    ;HIGH BYTE OF HEX MAZROOB (Here is LITER).
HEX_MAZROOB_AID_1	 EQU    0D6H    ;LOW  BYTE OF HEX MAZROOB AID.
HEX_MAZROOB_AID_2	 EQU    0D5H    ;HIGH BYTE OF HEX MAZROOB AID.
HEX_MAZROOBONFIH_1 EQU    0D4H    ;LOW  BYTE OF HEX MAZROOBON FIH (Here is Unit.Price).
HEX_MAZROOBONFIH_2 EQU    0D3H    ;HIGH BYTE OF HEX MAZROOBON FIH (Here is Unit.Price).
NUMBER_MAZROOBONFIH_BITS  EQU     16	;Constant.
BCD_BUFFER_1  	EQU     0D2H    ;LOW  BYTE OF BCD BUFFER .
BCD_BUFFER_2  	EQU     0D1H    ;MID1 BYTE OF BCD BUFFER .
BCD_BUFFER_3  	EQU     0D0H    ;MID2 BYTE OF BCD BUFFER .
BCD_BUFFER_4  	EQU     0CFH    ;MID3 BYTE OF BCD BUFFER .
BCD_BUFFER_5  	EQU     0CEH    ;MID4 BYTE OF BCD BUFFER .
BCD_BUFFER_6  	EQU     0CDH    ;HIGH BYTE OF BCD BUFFER .

;Display...
DataS1_0	equ	0F0H	;Address of Display/Side1/Location:0
DataS1_1	equ	0F1H	;Address of Display/Side1/Location:1
DataS1_2	equ	0F2H	;Address of Display/Side1/Location:2
DataS1_3	equ	0F3H	;Address of Display/Side1/Location:3
DataS1_4	equ	0F4H	;Address of Display/Side1/Location:4
DataS1_5	equ	0F5H	;Address of Display/Side1/Location:5
DataS1_6	equ	0F6H	;Address of Display/Side1/Location:6
DataS1_7	equ	0F7H	;Address of Display/Side1/Location:7
Setpoint	equ	0EFH	;SetPoint of Display

;Preset Display...
PresetL	        equ	0F8H	;Low Figure of Preset LCD1
PresetM1	equ	0F9H	;Middle1 Figure of Preset LCD1
PresetM2	equ	0FAH	;Middle2 Figure of Preset LCD1
PresetH	        equ	0FBH	;High Figure of Preset LCD1
Preset2L	equ	0FCH	;Low Figure of Preset LCD2
Preset2M1	equ	0FDH	;Middle1 Figure of Preset LCD2
Preset2M2	equ	0FEH	;Middle2 Figure of Preset LCD2
Preset2H	equ	0FFH	;High Figure of Preset LCD2

;Parameters 1 To 9...
Par_01	equ	0C0H	;Par:01
Par_02	equ	0C1H	;Par:02
Par_03	equ	0C2H	;Par:03
Par_04	equ	0C3H	;Par:04
Par_05	equ	0C4H	;Par:05
Par_06	equ	0C5H	;Par:06
Par_07	equ	0C6H	;Par:07
Par_08	equ	0C7H	;Par:08
Par_09	equ	0C8H	;Par:09

;Flash Memory (EEPROM 24C64)...
EEPROM_DATA		EQU	07FH		;Data for writing or reading from flash.
EEPROM_ADDRESS_H	EQU	07EH		;High Byte of address for reading or writing.
EEPROM_ADDRESS_L        EQU	07DH		;Low  Byte of address for reading or writing.
FLAG_ACK_EEPROM_ERROR  	BIT	20h.5	;Flag for Programmer to sign Error: Read#Write.
FIRST_ADDR_EEPROM_H    	EQU   000H	;First Location of 24c64
FIRST_ADDR_EEPROM_L    	EQU   000H	;=0000H
END_ADDR_EEPROM_H		EQU   01FH	;Last Location of 24c64
END_ADDR_EEPROM_L		EQU   0FFH	;=1FFFH
PIN_SERIAL_CLOCK		EQU	P3.4
PIN_SERIAL_DATA		        EQU	P3.5

;Keyboard Register...
keyboard	 equ	0E5H	;Map of Keyboard (0,0,S1>K2,K3,K1,S2>K2,K3,K1)
ReliableKey	 equ	0E6H	;Shows Which Bit of Keyboard-Result is Reliable.

;Preset Setting...
Rev_UPL	equ	0BCH	;10'5/U.P - Low Byte - Decimal .
Rev_UPM	equ	0BBH	;10'5/U.P - Mid Byte - Decimal .
Rev_UPH	equ	0BAH	;10'5/U.P - High Byte - Decimal .
TP_L		equ	0B9H	;Total Price that has Preset - Low Byte.
TP_M		equ	0B8H	;Total Price that has Preset - Mid Byte.
TP_H		equ	0B7H	;Total Price that has Preset - High Byte.
Liter_L	equ	0B6H	;Liter that has Preset by Calculating - Low Byte.
Liter_M	equ	0B5H	;Liter that has Preset by Calculating - Mid Byte.
Liter_H	equ	0B4H	;Liter that has Preset by Calculating - High Byte.
Help_L	equ	0B0H	;Liter of Turning-Off HF & Delivering Just LF - Low Byte.
Help_M	equ	0B1H	;Liter of Turning-Off HF & Delivering Just LF - Midd Byte.
Help_H	equ	0B2H	;Liter of Turning-Off HF & Delivering Just LF - High Byte.
Dummy_LF	equ	0B3H	;Dummy for Help_LMH Register (Internal Using).
Counter_Trust_S1	equ	40H	;Counter of 8 Pulses for Trusting Costumers
flag_Trust_S1	equ	20H.6	;Flag of Being in 8 Pulses or no , for Trusting Costumers

;Power-Fail definitions...
PF		equ	p2.4
Die_Time	equ	180	;Seconds Which should Pass before Dieing of System.

;Serial Port / Through Timer2...
BAUDE_RATE_57600       EQU	-6
BAUDE_RATE_19200       EQU	-18
BAUDE_RATE_9600        EQU	-36
BAUDE_RATE_4800        EQU	-72
BAUDE_RATE_2400        EQU	-144
BAUDE_RATE_1200        EQU	-288
BAUDE_RATE_600         EQU	-576
BAUDE_RATE_300         EQU	-1152

;Timer0 Setting for Loop_Timing...
TIME_BASE_TIMER_0	     EQU	-46050 ;50 mSec

;Error Codes...
ERROR_CODE_1	EQU	41H	;Error Side1 / Home in Memory.
EEprom_Error_Code	equ	30H	;Any Error in Flash Cells.

;Operational Flags....
flagReset		bit 21H.0	;flag that shows : system should be reset from 1st.
flag_Blink_UP	        bit 21H.1 ;flag of Blinking(1) or Not Blinking(0) for UP Rutin.
flag_Preset_Done_S1	bit 21H.2 ;0:No Preset - 1:We Have Preset.
flag_preset_Enable	bit 21H.3 ;Shows Preset is Enable(1) or Not(0).
flag_Full_88_S1		bit 21H.4 ;flag of Full 88 Stage(1) or Not(0).
flag_Full_FF_S1		bit 21H.5 ;flag of Full Blank Stage(1) or Not(0).
flag_Nashti_Blink_S1	bit 21H.6 ;flag of Blinking in decimal-Liter(1) or Not(0).
flag_Nashti_Happend_S1	bit 21H.7 ;Shows we are in Nashti rutins(1) or Not(0).
flag_Noz1_status	bit 22H.0 ;Shows Status of Nozzle1(1:Picked Up,0:Hung Down).
flag_HF_On_S1		bit 22H.1 ;Shows HF-Valve is Open(1) or Not(0).
flag_Preset_Ending_S1	bit 22H.2 ;1:Preset is Running LF for ending preset - 0:is not in it.
flag_Error_Blink_S1	bit 22H.3 ;Shows we are in Blink of Error(1) or Not(0).
flag_Noz1_Enable	bit 22H.4 ;Shows Nozzle Side1 is Enable(1) or Not(0).
flag_1st_Pulses_S1	bit 22H.5 ;Shows we are in 1st Eight-pulses(1) or Not(0).
flag_Timer0_Lock	bit 23H.1 ;if Set, Timer0 is not allowed to Run.

;Operational Registers....
Time88_S1			Equ	42H	;Full88 Counter(x 50msec).
TimeFF_S1			Equ	43H	;Full Blank Counter(x 50msec).
Time_Nashti_Blink_S1	Equ	44H	;Counter for Blinking in Nashti Mode(x 50msec).
Time_Nashti_Taqqeh_S1	Equ	45H	;Counter for Taghgheh in nashti Mode(x 50msec).
HF10sec_S1			Equ	46H	;Counter for Turning HF-Valve Off (x 50msec).
Next_HF_ON2_S1		Equ	47H	;Value of Right3 for Turning_ON HF-Valve(+5 Pulses).
Next_HF_ON_S1		Equ	48H	;Value of Right21 for Turning_ON HF-Valve(+5 Pulses).
Time_Noz_Lock_S1		Equ	49H	;Counter for Noz(x 50msec)(Should Be in His Place).
Time_Error_Blink_S1	Equ	52H	;Counter for Blinking in Error Mode(x 50msec).
LF3min_L_S1			Equ	53H	;Counter(x50)that LF Gets Off Bcos of Non-Delivering(Low).
LF3min_H_S1			Equ	54H	;Counter(x50)that LF Gets Off Bcos of Non-Delivering(High).
Stage				Equ	7CH	;Current Stage

;2 side display...
FlagNoz1key			BIT	22H.6	;if 0 , Means Side1 Pressed-if 1 , Means Side2 Pressed

;Serial Function Variables...
Busyersal	bit	22H.7
ersalL	        bit	23H.0	;flag of ersal "S",UPL,UPH,Right12,Right34,Right56,"P"

;Optional for Electro-mechanical Totalizer...
Dectot1	        equ	4AH	;decimal of Totalizer/CTE.
Last_Dec1	equ	4BH	;Last decimal of Totalizer.
TotL		equ	4CH	;Electronic Totalizer Low/CTE.
TotM1		equ	4DH	;Electronic Totalizer Mid1/CTE.
TotM2		equ	4EH	;Electronic Totalizer Mid2/CTE.
TotM3		equ	4FH	;Electronic Totalizer Mid3/CTE.
TotH		equ	50H	;Electronic Totalizer High/CTE.
DummyTot	equ	51H	;Dummy for Electronic Tot Processing/CTE.
TotBack1	equ	0E7H	;Acknowledge of Totalizer when increments.

;========== Initialization ===========
;========== Initialization ===========
;========== Initialization ===========
;========== Initialization ===========
;========== Initialization ===========

ORG   0000H
	Ljmp STRT

ORG   0003H
	LJMP PLSR13

ORG   000BH
      Ljmp Timer0_Rurin

ORG   0013H
	LJMP PLSR13

ORG   001BH
	RETI

ORG   0023H
	Ljmp SERIAL_INTERRUPT


ORG 	0030h
STRT:
	mov IE,#00H
	mov PSW,#00H
	mov SP,#07H
	Clr Latch1
	Clr Latch3
	Setb Buffer1
	Setb R1Scan
	Setb TP18

	;initialize of MapP2
	mov MapP2,#11111111B
	mov p2,MapP2

	;initialize of MapB1 & Keyboard
	mov MapB1,#00H
	mov R1,#Keyboard
	mov @R1,#00H

	;Setting Leds
	mov R1,#Led1Led
	mov @R1,#Speed_Blink_Leds
	mov R1,#Led3Led
	mov @R1,#Speed_Blink_Leds

	;All Full "8" in displays
	mov r1,#setpoint
	mov @r1,#00111100B
	Lcall AllFull
	Lcall display
	LCALL	PAGE_FULL
	LCALL	Display2
	Lcall delay1000

	;All Blank in displays
	mov r1,#setpoint
	mov @r1,#00000000B
	Lcall AllBlank
	Lcall display
	LCALL	PAGE_BLANK
	LCALL	Display2
	Lcall delay1000

	;Splash Screen...
	Lcall Splash
	Lcall Delay1000
	Lcall Delay1000

	Lcall Noz_at_1st	;for setting Noz microswitch polarity .

	;Check Nozzle Side1 to Be in Their Place
	Lcall IO
	mov a,MapB1
	JNB ACC.3,CheckExit ;Nozzle GS11 is in his Place
	Clr flag_save
checkexit:
	;Check Keyboard for Pressed Key...
	;Just Side1...
	lcall Keycheck
	mov r1,#Keyboard
	mov a,@r1
	anl a,#00111000B
	RR a
	RR a
	RR a
KeyM:
	cjne a,#1,KeyP
	LJMP Parameter_Setting
	;---
keyP:
	cjne a,#2,KeyMin
	;Ljmp Totalizer_Show / Optional
	;jmp KeyExit
KeyMin:
	cjne a,#4,Keyall
	Ljmp UnitPrice_Setting
	;jmp KeyExit
keyall:
	cjne a,#7,KeyExit
	Ljmp Parameter_Loading
	;jmp KeyExit
keyexit:
	;No legal Key Pressed!

	Lcall AllBlank
	Lcall Display
	Lcall delay50

	Lcall Check_Max_Min
	Lcall Flash_2_Memory
	Lcall Flag_Setting

	;Preparing Reverse of U.P...
	mov r1,#UPH
	mov a,@r1
	Jnz rev_action
	mov r1,#UPL
	mov a,@r1
	Jnz rev_action
	;Means UP=00 , so we are not allowed to run REV_X rutin.
	clr flag_preset_Enable
	Lcall delay1000
	jmp Baad
rev_action:
	Lcall Rev_X

Baad:
	;Loading LastLiter & Dectot to Memory...
	Lcall LastLiter_2_Memory
	;Reset Pulser1 Registers...
	setb RST1
	nop
	clr  RST1
	mov cshort1,#00H
	mov cleft1,#00H

	mov IE,#10010000B
	setb IT0
	setb IT1

	;EEProm Check for Healthy...
	mov r1,#Error_Code_1
	mov @r1,#00H

	mov EEPROM_ADDRESS_H,#00H
	mov EEPROM_ADDRESS_L,#3DH
	mov EEPROM_Data,#55H
	Lcall Write_EEprom
	mov EEPROM_data,#0
	mov EEPROM_ADDRESS_H,#00H
	mov EEPROM_ADDRESS_L,#3DH
	Lcall Read_EEprom
	mov a,EEPROM_Data
	Inc a
	Cjne a,#56H,Error_EEprom
	Jmp Baad_2
Error_EEprom:
	mov r1,#Error_Code_1
	mov @r1,#EEPROM_ERROR_CODE
	;If Any Error Occures In Side:n , Error_Code_n Gets a Value (Except 0).

Baad_2:
	;Clearing Totalizers' Acknowledge...
	;mov R1,#Totback1
	;mov @R1,#09H

Show_EE30:
	mov a,41H	;Error_Code_1 Place
	JZ  Screen_Show
Loop_EE30:
	mov r1,#DataS1_6
	mov @r1,#0ABH
	mov r1,#DataS1_7
	mov @r1,#03H
	Lcall Display

	Lcall delay1000

	Lcall AllBlank
	Lcall Display

	Lcall delay1000

	Jmp Loop_EE30

Screen_Show:
	;Show Last Screen on LCD
	Lcall calculate
	Lcall Disp_Result

	LCALL	PAGE_Common
	LCall display2

	;Timer0 Setting...
	mov TL0,#(LOW (time_base_Timer_0))
	mov TH0,#(HIGH (time_base_Timer_0))
	mov TMOD,#11H
	MOV TCON,#05H
	Setb IE.1
	Setb TR0

	;Initialization Finished.
	;Going To Main Loop...
	;.....................
Loop_Until_Noz0:
	;Check Power-Fail...
	setb PF
	jnb pf,PF_Not_1st
	Ljmp Check_PFail
PF_NOT_1st:
	;Check Nozzle Side1 to Be in Their Place
	lcall IO
	mov r1,#ReliableIO
	mov a,@r1
	JNB acc.3,Loop_Until_Noz0
	mov a,mapB1
	JNB acc.3,Ready_to_Main_loop ;Nozzle GS11 is in his Place
	jmp Loop_Until_Noz0

Ready_to_Main_loop:
	Setb IE.4
	Ljmp Main_loop

;========== SUB-Rutins ===========
;========== SUB-Rutins ===========
;========== SUB-Rutins ===========
;========== SUB-Rutins ===========
;========== SUB-Rutins ===========

;========== Rutin ===========
Check_Max_Min:
	;This Rutin Check Parameters 1...9 & Unit Price.
	;They Should Be Between 0 (or 1) and Max_parameter.
	;If There is Any Error, P-L will Run.

	mov DPL,#8BH
	mov DPH,#10H
Loop_CM:
	Inc Dptr
	mov a,#00H
	movc a,@A+DPTR
	mov EEPROM_ADDRESS_H,#00H
	mov EEPROM_ADDRESS_L,a
	Inc Dptr
	mov a,#00H
	movc a,@A+DPTR
	mov R2,a	;Max Value of Current Parameter.
	Lcall Read_EEPROM
	mov a,EEPROM_Data
	mov R3,a	;Current Value of This Parameter.
Control_Max:
	mov a,R2
	add a,#00H
	DA a
	Clr C
	Subb a,R3	;a=Max-Value
	JZ Next_Max
	DJNZ R2,Control_Max
	;Declare Error in Parameter_Value
	jmp Continue_1

Next_Max:
	mov a,DPL
	cjne a,#9DH,Loop_CM
	;Parameters Finished! They Were between 01H....99H
	;Now Check Unit Price . This is Between 00H....99H


Loop_CM_1:
	Inc Dptr
	mov a,#00H
	movc a,@A+DPTR
	mov EEPROM_ADDRESS_H,#00H
	mov EEPROM_ADDRESS_L,a
	Inc Dptr
	mov a,#00H
	movc a,@A+DPTR
	mov R2,a	;Max Value of Current Parameter.
	Lcall Read_EEPROM
	mov a,EEPROM_Data
	mov R3,a	;Current Value of This Parameter.
Control_Max_1:
	mov a,R2
	add a,#00H
	DA a
	Clr C
	Subb a,R3	;a=Max-Value
	JZ Next_Max_1
	Dec R2
	Cjne R2,#0FFH,Control_Max_1
	;Declare Error in Parameter_Value
	jmp Continue_1

Next_Max_1:
	mov a,DPL
	cjne a,#0A1H,Loop_CM_1
	;Unit_Price Finished!
	Ret


Continue_1:
	;Because of Error in MAX & MIN Values of Para. or UP
	;We Run Parameter_Loading to Adjust in default.
	Lcall Parameter_Loading
	Ret

;========== Rutin ===========
Totalizer_Show:
	;Optional
	Ret

;========== Rutin ===========
UnitPrice_Setting:
	;This Rutin , Sets Unit-Price In Flash-Memory.
	;After Adjusting , It will Return To Main Program.

	Lcall AllBlank

	mov EEPROM_ADDRESS_H,#00H
	mov EEPROM_ADDRESS_L,#23H
	Lcall Read_EEPROM
	mov a,EEPROM_Data
	mov R2,a
	mov R3,a
	Swap a
	mov r1,#datas1_7
	mov @r1,a

	mov EEPROM_ADDRESS_H,#00H
	mov EEPROM_ADDRESS_L,#24H
	Lcall Read_EEPROM
	mov a,EEPROM_Data
	mov R4,a
	mov R5,a
	Swap a
	mov r1,#datas1_6
	mov @r1,a

	Push 02H
	Push 03H
	Push 04H
	Push 05H

	Lcall display

	Pop 05H
	Pop 04H
	Pop 03H
	Pop 02H
	;UnitPrice Displayed in Two Sides.

	;Adjusting U.P. in R5.R4.R3.R2
	anl 02H,#0FH

	mov a,03H
	swap a
	anl a,#0fH
	mov 03H,a

	anl 04H,#0FH

	mov a,05H
	swap a
	anl a,#0fH
	mov 05H,a
	;U.P. Adjusted!

	Lcall wait_to_Unpress_2

	;Right1 is Indicator of Curser...
	mov right1,#02H
	mov right2,#00H
	clr flag_Blink_UP

Key_01:
	;Check Power-Fail...
	setb PF
	jnb pf,PF_Not_US
	Ljmp Show_Ro

PF_Not_US:
	;Check Nozzle Side1 to "save U.P." or "setb flag_save"
	Lcall IO
	mov r1,#ReliableIO
	mov a,@r1
	JNB ACC.3,EXIT_IO	;Is Not Reliable
	JB  flag_save,OK_SVE
	mov a,MapB1
	JB  ACC.3,Exit_IO	;Nozzle is not in his place
	setb flag_save
	Jmp Exit_IO
OK_SVE:
	mov a,MapB1
	JNB ACC.3,Exit_IO	;Nozzle HasNot Picked-Up
	LJMP SAVE_UP

EXIT_IO:
	inc right2
	mov a,right2
	cjne a,#10D,Next_02
	mov right2,#00H
	cpl flag_Blink_UP

Next_02:
	lcall Keycheck
	mov r1,#keyboard
	mov a,@r1
	anl a,#00111000B
	RR a
	RR a
	RR a

	Cjne a,#2,KeyP_1	;+ Pressed
	mov Right2,#00H
	clr flag_Blink_UP
	Lcall wait_to_Unpress_2
	mov r1,Right1
	Inc @r1
	Cjne @r1,#0AH,Pre_Key_01
	mov @r1,#00H
	Sjmp Pre_Key_01

KeyP_1:
	Cjne a,#4,Pre_Key_01	;- Pressed
	mov Right2,#00H
	clr flag_Blink_UP
	Lcall wait_to_Unpress_2
	Inc Right1
	mov a,right1
	Cjne a,#06H,Pre_Key_01
	mov right1,#02H
	;Ljmp Pre_Key_01

Pre_Key_01:
	JB flag_Blink_UP,Blink_figure

	mov a,R3
	swap a
	orl a,R2
	swap a
	mov r1,#datas1_7
	mov @r1,a

	mov a,R5
	swap a
	orl a,R4
	swap a
	mov r1,#datas1_6
	mov @r1,a

	Push 02H
	Push 03H
	Push 04H
	Push 05H

	Lcall Display

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -