STEPPER EQU P1
KEY EQU P2
KEY_1 EQU P2.0
KEY_2 EQU P2.1
KEY_3 EQU P2.2
KEY_4 EQU P2.3
Org 0h
Ljmp Main
Org 0200h
Main: Mov A, #00h
Mov Stepper, A
Mov Key, A
Setb Key_1
Mov A, Key
Jnz Ant_clk
clk_wise:mov Stepper, #0ch
Acall Delay_1ms
Mov Stepper, #06h
Acall Delay_1ms
Mov Stepper, #03h
Acall Delay_1ms
Mov Stepper, #09h
Acall Delay_1ms
Sjmp Main
Ant_clk:mov Stepper, #09h
Acall Delay_1ms
Mov Stepper, #03h
Acall Delay_1ms
Mov Stepper, #06h
Acall Delay_1ms
Mov Stepper, #0ch
Acall Delay_1ms
Ret
DELAY_1MS: MOV R6, #231D ; 1 MILLISECONDS DELAY
GOTO: NOP
NOP
DJNZ R6, GOTO
RET