Breaking News
recent

Tugas Praktikum 2 No 1 Mikrokontroller dan Pengendali


Untuk jawaban soal diatas :
Copy Code bahasa Assembly dibawah ini dan paste ke projek atmel anda ATMEGA16A

;
; Tugas 2.asm
;
; Created: 3/16/2016 12:00:19 PM
; Author : Ahmad Akbar Mariuddin
;


; Replace with your application code

.nolist
.include "m16def.inc"
.def register1 = R3
.def register2 = R4
.def tampung = R23
.list
.org 0x00

LDI tampung, 0x24
MOV register1, tampung
LDI tampung, 0x38
MOV register2, tampung
INC register1
INC register1
INC register1
DEC register2
DEC register2
MOV tampung, register1
MOV register1, register2
MOV register2, tampung
ADD register1, tampung
ADD register2, tampung

Tabel Register
Instruksi
Isi Register
R3
R4
R23
LDI tampung, 0x24
0x00
0x00
0x24
MOV register1, tamping
0x24
0x00
0x24
LDI tampung, 0x38
0x24
0x00
0x38
MOV register2, tamping
0x24
0x38
0x38
INC register1
0x25
0x38
0x38
INC register1
0x26
0x38
0x38
INC register1
0x27
0x38
0x38
DEC register2
0x27
0x37
0x38
DEC register2
0x27
0x36
0x38
MOV tampung, register1
0x27
0x36
0x27
MOV register1, register2
0x36
0x36
0x27
MOV register2, tamping
0x36
0x27
0x27
ADD register1, tamping
0x5D
0x27
0x27
ADD register2, tamping
0x5D
0x4E
0x27

Gambar Flowchart dari Pemrograman diatas




Septiceeye2

Septiceeye2

No comments:

Post a Comment

Powered by Blogger.