MVI A, 00H ; load accumulator with 00H (starting value of counter)
MOV B, 21H ; load B register with delay value (2ms)
LOOP: MOV C, A ; move counter value to C register OUT PORT ; output C register value to port INR A ; increment counter value DCR B ; decrement delay value JNZ LOOP ; jump to LOOP if delay value is not zero MVI A, 00H ; reset counter value to 0 JMP LOOP ; jump to LOOP to repeat sequence
HALT ; end program
No comments:
Post a Comment