Input Masing" Port Bilangan

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Input masing port bilangan

$mod51
CSEG
ORG 4000H
LJMP MULAI
ORG 4100H
MULAI: MOV P0,#15D
SJMP mulai
RET
END
Led Berjalan
$mod51
org 0h
tombol0 : jb p1.0,tombol1
mov p0,#1110000b
tombol1 : jb p1.1,tombol2
mov p0,#11111001b
tombol2 : jb p1.2,padam
mov p0,#0100100b
padam : mov p0,#1111111b
sjmp tombol0
RET
End
Input hexa
$mod51
org 0h

tombol0 : jb p1.0,tombol1
mov p0,#1000000b
tombol1 : jb p1.1,tombol2
mov p0,#1111001b
tombol2 : jb p1.2,tombol3
mov p0,#0100100b
tombol3 : jb p1.3,tombol4
mov p0,#0110000b
tombol4 : jb p1.4,tombol5
mov p0,#0011001b
tombol5 : jb p1.5,tombol6
mov p0,#0010010b
tombol6 : jb p1.6,tombol7
mov p0,#0000010b
tombol7 : jb p1.7,tombol8
mov p0,#1111000b
tombol8 : jb p2.0,tombol9
mov p0,#0000000b
tombol9 : jb p2.1,tombol10
mov p0,#0010000b
tombol10 : jb p2.2,tombol11
mov p0,#0001000b
tombol11 : jb p2.3,tombol12
mov p0,#0000011b
tombol12 : jb p2.4,tombol13
mov p0,#1000110b

tombol13 : jb p2.5,tombol14
mov p0,#0100001b
tombol14 : jb p2.6,tombol15
mov p0,#0000110b
tombol15 : jb p2.7,padam
mov p0,#0001110b
padam : mov p0,#1111111b
sjmp tombol0
RET
End

You might also like