Minggu, 22 Desember 2013

KUMPULAN TUGAS MIKROPROSESOR

TUGAS 1

TUGAS MIKROPROSESOR 1





Nama  : Sabda Wiku Jati Wasesa
Kelas   : TI 11 B
NIM     : 11.11.2454

TUGAS PRAKTEK 1
LATIHAN:

1. Buatlah program untuk menampilkan LED di port 1 dengan kondisi
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Nyala
Nyala
Padam
Padam
Nyala
Padam
Padam
Padam
            Akses port 1 per bit (satu persatu spt prog 1 dan 2) 

2. Buatlah program untuk menampilkan LED di port 1 dengan kondisi 
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Nyala
Nyala
Padam
Nyala
Nyala
Padam
Padam
Nyala
             Akses port 1 per byte  (secara keseluruhan spt prog 3 atau 4)
Jawab :
1.      $mod51
CSEG
ORG 4000H
LJMP START

ORG 4100H
START :
               MOV SP, #30H
CLR P1.0
CLR P1.1
CLR P1.2
SETB P1.3
CLR P1.4
CLR P1.5
SETB P1.6
SETB P1.7
SJMP $
END

2.      $mod51
CSEG
ORG 4000H
LJMP START
ORG 4100H
START :
MOV SP, #30H
SETB P1.0
CLR P1.1
CLR P1.2
SETB P1.3
SETB P1.4
CLR P1.5
SETB P1.6
SETB P1.7
SJMP $
END