0% found this document useful (0 votes)
44 views19 pages

Auditor Ne 1

This document provides information about a computer architecture course including contact details, topics covered, software used, assignments, and MIPS assembly code examples. The topics covered include programming in MIPS assembly, understanding CPU components, and implementing parts of the MIPS processor. Assignments include tasks that require loading values into registers, performing arithmetic operations, storing results in memory, and analyzing memory values. MIPS assembly code solutions are provided for sample tasks involving addition, subtraction, loading from and storing to memory.

Uploaded by

rrgggg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views19 pages

Auditor Ne 1

This document provides information about a computer architecture course including contact details, topics covered, software used, assignments, and MIPS assembly code examples. The topics covered include programming in MIPS assembly, understanding CPU components, and implementing parts of the MIPS processor. Assignments include tasks that require loading values into registers, performing arithmetic operations, storing results in memory, and analyzing memory values. MIPS assembly code solutions are provided for sample tasks involving addition, subtraction, loading from and storing to memory.

Uploaded by

rrgggg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Arhitektura raunara

Auditorne vjezbe 1
Haris Hasanhodi

Osnovne informacije

Kontakt:

Email: harishasanhodzic!ictlabcomba
"eb site sa materijalima:

americtlabcomba

#iljevi

$isanje %ro&rama za '($) ()A *asembli


%ro&ramiranje+

Konvertovanje # koda u '($) asembli kod

,azumjevanje kom%onenti i im%lementacija


dijela '($) %rocesora

)oft-are

'($) simulator *'ars+

htt%:..coursesmissouristateedu.Ken/ollmar.'A,).do-nloadhtm

0o&isim

htt%:..sourcefor&enet.%rojects.circuit.

1## com%iler

2adace

3ku%no 45 bodova

)vake sedmice kratka %rovjera na


laboratoriskim vjezbama *5 min+

6edna zadaa nosi 478 boda



'A,)

$okretanje:

Ako na sistemu nije instalirana 6/' %rije


%okretanja %otrebno je instalirati 6/'

sudo a%t7&et install o%enjdk797jdk o%enjdk797jre icedtea797%lu&in

2atim %okrenuti mars kroz komandnu liniju:

java 7jar 'ars:8:1jar



'A,)
1 Edit dis%la; is indicated b; hi&hli&hted tab
<= 4 >;%ical edit and e?ecute o%erations are available throu&h
icons and menus= dimmed7out -hen unavailable or
not a%%licable
8 "@)("@1 editor for '($) assembl; lan&ua&e code
3
4
2
1

1
8
2
3
4
5
6
9
7
1 E?ecute dis%la; is indicated b; hi&hli&hted tab
< Assembl; code is dis%la;ed -ith its address= machine code= assembl; code= and the corres%ondin&
line from the source code file *)ource code and assembl; code -ill differ -hen %seudoinstructions have been used+
4 >he values stored in 'emor; are directl; editable *similar to a s%readsheet+
8 >he -indo- onto the 'emor; dis%la; is controlled in several -a;s: %revious.ne?t arro-s and a menu of
common locations *e&= to% of stack+
5 >he numeric base used for the dis%la; of data values and addresses *memor; and re&isters+ is selectable bet-een
decimal and he?adecimal
A Addresses of labels and data declarations are available >;%icall;= these are used onl; -hen sin&le7ste%%in& to
verif; that an address is as e?%ected
9 >he values stored in ,e&isters are directl; editable *similar to a s%readsheet+
B Creak%oints are set b; a checkbo? for each assembl; instruction >hese checkbo?es are al-a;s dis%la;ed and available
D )electable s%eed of e?ecution allo-s the user to E-atch the actionF instead of the assembl; %ro&ram finishin& directl;

2adatak 1
3 re&istre GsH i Gs1 smjestiti brojeve 74H i 5HH
)abrati ta dva broja i u%isati ih na memoriju na
adresu HI9JJJEJEH lokaciju kao 4<7bitni broj
,jeKenje:
74HL5HHM89H

,jesenje:

addi GsH= GH= 74H

addi Gs1= GH= 5HH

add Gs<= Gs1= GsH

lui GtH= H?9JJJ

ori GtH= GtH= H?EJJ#

s- Gs<= H*GtH+

li GvH= 1H

s;scall

$itanja

)ta ako umjesto 5HH %okusamo u%isati 4<9AB


*1HHH HHHH HHHH HHHH+ ili 74<9AD

)ta ukoliko %okusamo rezultat snimiti na


adresu HI9JJJEJJJ

2adatak <

(zraunati vrijednost izraza:

*1HH7<H+N5


,jesenje:
addi GsH= GH= 1HH
addi Gs1= GH= <H
sub Gs<= GsH= Gs1
ori Gs<= Gs<= 5
li GvH= 1H
s;scall
Koji bi bio dru&i nain za rjeKavanje dato& %roblemaO

2adatak 4

3 re&istre GsH= Gs1= Gs< smjestiti vrijednosti 1=


< i 4= a zatim vrijednosti re&istara snimiti sa
instrukcijom sb redom od adrese H?9JJJEJEH

Analizirati heksadecimalnu vrijednost


memoriske adrese H?9JJJEJEH

,jesenje:
addi GsH= GH= 1
addi Gs1= GH= <
addi Gs<= GH= 4
lui GtH= H?9JJJ
ori GtH= GtH= H?EJEH
sb GsH= H*GtH+
sb Gs1= 1*GtH+
sb Gs<= <*GtH+
li GvH= 1H
s;scall

2adatak 8:

3 re&istar GsH %ostaviti vrijednost <HH= a zatim


&a snimiti u memoriju na adresu
HI9JJJEJEH

3 re&istre Gs1= Gs< i Gs4 uitati vrijednosti sa


date adrese %omou komandi lb= lbu= lh i
analizirati vrijednosti u tim re&istrima

,jesenje:
addi GsH= GH= <HH
lui GtH= H?9JJJ
ori GtH= GtH= H?EJEH
s- GsH= H*GtH+
lb Gs1= H*GtH+
lbu Gs<= H*GtH+
lh Gs4= H*GtH+
li GvH= 1H
s;scall

2adatak 5

(zraunati vrijednost izraza i snimiti u memoriju:

1HHL8HHHHLHIJJJJJJJJ

Kako trebamo uitati vrijednost 8HHHH u re&istarO

Kako u%isati vrijednost HIJJJJJJJ u re&istarO

,edoslijed instrukcijaO

Koju instrukciju trebamo korisititi za sabiranjeO


,jesenje:
addi GsH= GH= <HH
ori Gs1= GH= 8HHHH
lui Gs4= HIJJJJ
ori Gs4= Gs4= HIJJJJ
add Gs8= GsH= Gs1
add Gs8= Gs8= Gs4
lui GtH= H?9JJJ
ori GtH= GtH= H?EJEH
s- GsH= H*GtH+
sb GsH= 8*GtH+
lb Gt1= 8*GtH+
lbu Gt<= 8*GtH+
lb Gt1= H*GtH+
lbu Gt<= H*GtH+
lh Gt1= H*GtH+
lhu Gt<= H*GtH+
li GvH= 1H
s;scall

You might also like