Krolyxon
Commit c48ef97

Branches

Tags

Refs →

bench51examplesblink.asm

23 lines · 505 B · x86_64 Assembly

1; Blink: toggle all of P1 with a software delay loop.
2; Step with F11, or run with F5 and watch the Ports panel.
3
4 ORG 0000h
5 LJMP main
6
7 ORG 0030h
8main: MOV P1,#0FFh
9loop: CPL P1.0 ; toggle the LED on P1.0
10 MOV A,P1
11 CPL A
12 MOV P2,A ; P2 mirrors P1 inverted
13 ACALL delay
14 SJMP loop
15
16; About 2 * 50 * 250 machine cycles.
17delay: MOV R6,#50
18d1: MOV R7,#250
19d2: DJNZ R7,d2
20 DJNZ R6,d1
21 RET
22
23 END