0% found this document useful (0 votes)
39 views1 page

Input Masing" Port Bilangan

This document contains code for three programs written in MASM assembly language for the 8051 microcontroller. The first program blinks an LED continuously. The second program lights different LEDs on a port based on button presses. The third program displays hexadecimal numbers on a port based on button presses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

Input Masing" Port Bilangan

This document contains code for three programs written in MASM assembly language for the 8051 microcontroller. The first program blinks an LED continuously. The second program lights different LEDs on a port based on button presses. The third program displays hexadecimal numbers on a port based on button presses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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