HMST:
MOV DPTR,#PLK1
MOV R2,DPL
MOV R3,DPH
MOV DPTR,#PLK0
MOV R7,#(N+2)
MOVX A,@DPTR
MOV R6,A
INC DPTR
MOV R4,DPL
MOV R5,DPH
MOV DPL,R2
MOV DPH,R3
LCALL HM
MOV A,B
MOVX @ DPTR,A
INC DPTR
MOV A,R6
SWAP A
LCALL HM
MOV A,B
MOVX @ DPTR,A
INC DPTR
MOV R2,DPL
MOV R3,DPH
MOV DPL,R4
MOV DPH,R5
DJNZ R7,00D1
RET
HM:
ANL A,#0FH
CLR C
RRC A
RL A
RL A
RLC A
RL A
RL A
MOV B,A
ANL A,#54H
JNB P,HM1
SET 0F0H
HM1:
MOV A,B
ANL A,#64H
JNB P,HM2
SETB 0F1H
HM2:
MOV A,B
ANL A,#70H
JNB P,HM3
SETB 0F3H
HM3:
RET