|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
这是一个关于MC145158的编成 其中是用的51芯片组
ORG 0000H
RCOUNT EQU 256
NCOUNT EQU 724
ACOUNT EQU 0
CLOCK BIT P1.0
DATA1 BIT P1.1
LOCK BIT P1.2
SJMP START
START: AJMP 0040H
ORG 0040H
MOV DPTR,#RCOUNT
MOV 24H,DPH
MOV 23H,DPL
ACALL RSOUT1
MOV DPTR,#NCOUNT
NACCESS: MOV 22H.DPH
MOV 21H,DPL
MOV 20,#ACOUNT
MOV R0,#20H
CLR LOCK
NATATOUT: ACALL NASOUT1
ACALL DELTIME1
INC 20H
CJNE @R0,#127,NADATOUT
ACALL DELTIME1
MOV R1,#1
NINCREAS: INC DPTR
DJNC R1,NINCREAS
MOV B,DPH
JNB B 0,NACCESS
NOP
AJMP 0000H
ORG 0100H
RSOUT1: MOV R2,#9
MOV A,24H
CYRIN1: DJNZ R2,CYROUT2
SJMP RSOUT2
CYROUT1: RLC A
MOV DATA1,C
NOP
SETB CLOCK
NOP
NOP
CLR CLOCK
NOP
SJMP CYRIN1
RSOUT2: MOV R3,#9
MOV A,23H
CYRIN2: DJNZ R3,CYROUT2
SJMP RSOUT3
CYROUT2: RLC A
MOV DATA1,C
NOP
SETB CLOCK
NOP
NOP
CLR CLOCK
NOP
SJMP CYRIN2
RSOUT3: SETB DATA1
NOP
SETB CLOCK
NOP
NOP
CLR CLOCK
NOP
SETB LOCK
NOP
NOP
NOP
NOP
CLT LOCK
RET
ORG 0200H
NASOUT1: MOV R2,#9
MOV A,22H
CYLIN1: DJNZ R2,CYLOUT1
SJMP NASOUT2
CYLOUT1: RLC A
MOV DATA1,C
NOP
SETB CLOCK
NOP
NOP
CLR CLOCK
NOP
SJMP CYLIN1
MASOUT2: MOV R3,#9
MOV A,21H
CYLIN2: DJNZ R3,CYLOUT2
SJMP NASOUT3
CYLOUT2: RLC A
MOV DATA1,C
NOP
SETB CLOCK
NOP
NOP
CLR CLOCK
NOP
SJMP CYLIN2
NASOUT3: MOV R4,#8
MOV A,20H
RL A
CYLIN3: DJNZ R4,CYLOUT3
SJMP RETURN
CYLOUT3: RLC A
MOV DATA1,C
NOP
SETB CLOCK
NOP
NOP
CLR CLOCK
NOP
SJMP CYLIN3
RETURN: CLR DATA1
NOP
SETB CLOCK
NOP
NOP
CLR CLOCK
NOP
SETB LOCK
NOP
NOP
NOP
NOP
CLR LOCK
RET
ORG 0300H
DELTIME1: MOV 40H,#15
MOV 41H,#25
DELTIME2: CLR LOCK
NOP
DJNZ 40H,DELTIME3
NOP
RET
DELTIME3: CLR LOCK
NOP
NOP
DJNZ 41H,DELTIME3
SJMP DELTIME2
END
|
|