<s>
NAR	B-Application
2	I-Application
(	O
Serbian	O
Nastavni	O
Računar	O
2	O
,	O
en	O
.	O
</s>
<s>
Educational	O
Computer	O
2	O
)	O
is	O
a	O
theoretical	O
model	O
of	O
a	O
32-bit	O
word	O
computer	O
created	O
by	O
Faculty	O
of	O
Mathematics	O
of	O
University	O
of	O
Belgrade	O
professor	O
Nedeljko	O
Parezanović	O
as	O
an	O
enhancement	O
to	O
its	O
predecessor	O
,	O
NAR	B-Application
1	I-Application
.	O
</s>
<s>
It	O
was	O
used	O
for	O
Assembly	B-Language
language	I-Language
and	O
Computer	B-General_Concept
architecture	I-General_Concept
courses	O
.	O
</s>
<s>
Many	O
NAR	B-Application
2	I-Application
simulators	O
have	O
been	O
created	O
for	O
instance	O
,	O
one	O
was	O
named	O
"	O
Šljiva	O
"	O
(	O
en	O
.	O
</s>
<s>
The	O
NAR	B-Application
2	I-Application
processor	B-General_Concept
uses	O
32-bit	O
machine	B-Language
words	O
.	O
</s>
<s>
Each	O
Machine	B-Language
instruction	I-Language
contains	O
:	O
</s>
<s>
4	O
bits	O
(	O
16	O
to	O
19	O
)	O
containing	O
address	B-Language
mode	I-Language
flags	O
:	O
</s>
<s>
NAR	B-Application
2	I-Application
has	O
four	O
registers	O
:	O
</s>
<s>
a	O
Program	B-General_Concept
counter	I-General_Concept
called	O
BN	O
(	O
sr.	O
Brojač	O
Naredbi	O
,	O
en	O
.	O
</s>
<s>
Up	O
to	O
16	O
Index	B-General_Concept
registers	I-General_Concept
are	O
specifiable	O
,	O
X0	O
to	O
X15	O
.	O
</s>
<s>
Following	O
opcodes	B-Language
were	O
available	O
(	O
actual	O
codes	O
were	O
not	O
specified	O
,	O
only	O
mnemonics	O
)	O
:	O
</s>
<s>
The	O
NAR	B-Application
2	I-Application
assembly	B-Language
language	I-Language
syntax	O
was	O
designed	O
to	O
be	O
straightforward	O
and	O
easy	O
to	O
parse	O
.	O
</s>
<s>
Whitespace	O
,	O
if	O
instruction	O
specifies	O
any	O
index	B-General_Concept
registers	I-General_Concept
,	O
addressing	B-Language
mode	I-Language
or	O
a	O
parameter	O
and	O
then	O
comma-separated	O
:	O
</s>
<s>
With	O
four	O
address	B-Language
mode	I-Language
selection	O
bits	O
(	O
P	O
,	O
R	O
,	O
I	O
and	O
N	O
-	O
indexed	O
,	O
relative	O
,	O
indirect	O
and	O
immediate	O
)	O
,	O
NAR	B-Application
2	I-Application
instructions	O
can	O
specify	O
16	O
different	O
addressing	B-Language
modes	I-Language
but	O
not	O
all	O
make	O
sense	O
in	O
all	O
instructions	O
.	O
</s>
<s>
f( )	O
is	O
the	O
"	O
effective	O
value	O
"	O
function	O
used	O
for	O
indirect	B-Language
addressing	I-Language
(	O
see	O
details	O
below	O
)	O
:	O
</s>
<s>
Note	O
1	O
:	O
"	O
N	O
"	O
(	O
immediate	O
)	O
flag	O
has	O
no	O
effect	O
on	O
jump	O
(	O
flow	O
control	O
)	O
instructions	O
,	O
as	O
the	O
processor	B-General_Concept
can	O
not	O
jump	O
into	O
a	O
specified	O
value	O
,	O
but	O
only	O
to	O
a	O
memory	O
address	O
.	O
</s>
<s>
NAR	B-Application
2	I-Application
supports	O
multi-level	O
memory	O
indirect	B-Language
addressing	I-Language
mode	O
.	O
</s>
<s>
The	O
location	O
is	O
first	O
chosen	O
by	O
"	O
looking	O
"	O
at	O
P	O
(	O
indexed	O
)	O
and	O
R	O
(	O
relative	O
to	O
program	B-General_Concept
counter	I-General_Concept
)	O
flags	O
.	O
</s>
<s>
Then	O
,	O
if	O
I	O
(	O
indirect	O
)	O
flag	O
is	O
detected	O
,	O
a	O
32-bit	O
word	O
is	O
loaded	O
from	O
the	O
memory	O
location	O
calculated	O
so	O
far	O
and	O
the	O
calculation	O
is	O
restarted	O
(	O
including	O
all	O
addressing	B-Language
mode	I-Language
flags	O
,	O
index	B-General_Concept
register	I-General_Concept
selection	O
and	O
parameter	O
value	O
-	O
only	O
the	O
"	O
opcode	B-Language
"	O
is	O
omitted	O
)	O
.	O
</s>
<s>
...	O
will	O
freeze	O
NAR	B-Application
2	I-Application
in	O
an	O
infinite	O
address	O
calculation	O
loop	O
:	O
</s>
<s>
seems	O
more	O
generic	O
(	O
could	O
freeze	O
NAR	B-Application
2	I-Application
from	O
any	O
location	O
)	O
,	O
but	O
this	O
depends	O
on	O
when	O
BN	O
register	O
value	O
is	O
incremented/changed	O
.	O
</s>
<s>
The	O
table	O
above	O
presents	O
the	O
first	O
case	O
to	O
show	O
different	O
addressing	B-Language
modes	I-Language
achievable	O
this	O
way	O
.	O
</s>
<s>
NAR	B-Application
2	I-Application
has	O
instructions	O
to	O
initialize	O
the	O
value	O
of	O
particular	O
index	B-General_Concept
register	I-General_Concept
(	O
"	O
PIR	O
"	O
mnemonic	O
)	O
.	O
</s>
<s>
However	O
,	O
it	O
does	O
not	O
have	O
special	O
instructions	O
to	O
read	O
values	O
index	B-General_Concept
registers	I-General_Concept
.	O
</s>
<s>
This	O
is	O
achieved	O
by	O
using	O
indexed	O
and	O
immediate	O
(	O
P	O
,	O
N	O
)	O
addressing	B-Language
mode	I-Language
flags	O
,	O
such	O
as	O
:	O
</s>
<s>
...	O
which	O
essentially	O
puts	O
Xi+n	O
into	O
accumulator	B-General_Concept
.	O
</s>
<s>
For	O
n	O
=	O
0	O
,	O
this	O
turns	O
into	O
a	O
"	O
load	O
index	B-General_Concept
register	I-General_Concept
value	O
into	O
accumulator	B-General_Concept
"	O
instruction	O
.	O
</s>
