Krolyxon
Commit fa3bbf2

Branches

Tags

Refs →

bench51exampleslookup_movc.asm

20 lines · 493 B · x86_64 Assembly

1; Count 0..9 on a common-cathode 7-segment display connected to P2,
2; using a MOVC lookup table. The digit is also kept in R2.
3
4 ORG 0000h
5 LJMP main
6
7 ORG 0030h
8main: MOV DPTR,#segs
9again: MOV R2,#0
10next: MOV A,R2
11 MOVC A,@A+DPTR ; table lookup
12 MOV P2,A
13 INC R2
14 CJNE R2,#10,next
15 SJMP again
16
17; 0 1 2 3 4 5 6 7 8 9
18segs: DB 3Fh, 06h, 5Bh, 4Fh, 66h, 6Dh, 7Dh, 07h, 7Fh, 6Fh
19
20 END