Кіріспе
32 биттік RISC архитектурасы Nedeljko Parezanović NAR 2 (серб Nastavni Računar 2, en. Educational Computer 2) - Белград университетінің математика факультетінің профессоры Неделжико Парезановичтің өзінің алдыңғы NAR 1 бағдарламасын жетілдірген 32 биттік сөздік компьютердің теориялық моделі. Ассемблеризация тілі мен компьютерлік архитектура курстарында қолданылды. "Нар" сөзі серб тілінде гранат алма дегенді білдіреді. Көптеген NAR 2 тренажерлары жасалды мысалы, біреуі "Šljiva" (en. Бұл жеміс Сербияда өседі, ал "нар" - жоқ.
NAR 2 (Serbian Nastavni Računar 2, en. Educational Computer 2) is a theoretical model of a 32 bit word computer created by Faculty of Mathematics of University of Belgrade professor Nedeljko Parezanović as an enhancement to its predecessor, NAR 1. It was used for Assembly language and Computer architecture courses. The word "nar" means Pomegranate in Serbian. Many NAR 2 simulators have been created — for instance, one was named "Šljiva" (en. plum) as that fruit grows in Serbia, while "nar" does not.
Жадыға/реестрге қол жеткізу
MUA (sr. курсив = no, en. Memory Into Accumulator) деген файл AUM (sr. italic=no, en) жинақтауышына мәнді жүктейді. Accumulator Into Memory) аккумулятор PIR (sr. italic=no, en) мазмұнын сақтайды. Жүк индексі тіркелімі) Бағаны индекстік тіркелімге жүктейді
AUM (sr. italic=no, en. Accumulator Into Memory) stores the content of the accumulator
PIR (sr. italic=no, en. Load Index Register) Loads the value into the index register
Бүкіл сандар арифметикалық
Ескерту: осы топтағы барлық мнемоникалар "F" әріппен аяқталады, бұл "Fiksni zarez" (en. Белгілі нүкте) арифметикасы. Алайда, бұл тек қосу, алу және теріске шығару (белгі өзгеруі) үшін ғана дұрыс. Көбейту мен бөлу "нокта" ең аз мәнді биттің оң жағына бекітіледі деп болжайды, яғни сандар бүтін сан. SABF (sr. italic=no, en. Add, Fixed Point) аккумуляторға ODUF параметрін қосады. Subtract, Fixed Point) параметрді аккумулятор MNOF (sr. italic=no, en) -дан шығарады. Көбейту, Белгілі нүкте) Аккумуляторды DELF параметрімен көбейтеді (sr. italic=no, en. Divide, Fixed Point) Аккумуляторды PZAF параметріне бөледі (sr. italic=no, en. Аккумулятордың белгісін өзгерту, тұрақты нүкте) Аккумулятордың белгісін өзгерту (артқа бұру)
ODUF (sr. italic=no, en. Subtract, Fixed Point) subtracts the parameter from the accumulator
MNOF (sr. italic=no, en. Multiply, Fixed Point) Multiples the accumulator with the parameter
DELF (sr. italic=no, en. Divide, Fixed Point) Divides the accumulator by the parameter
PZAF (sr. italic=no, en. Change the Sign of Accumuator, Fixed Point) Changes (flips) the sign of the accumulator
Жылжымалы нүктелік арифметика
SAB (sr. italic=no, en. Add) аккумуляторға ODU (sr. italic=no, en) параметрін қосады. Subtract) аккумулятор MNO (sr. italic=no, en) параметрін шегереді. Көбейту) Аккумуляторды DEL параметрімен көбейтеді (sr. italic=no, en. Бөліну) Аккумуляторды PZA параметріне бөледі (sr. italic=no, en. Аккумулятордың белгісін өзгерту) Аккумулятордың белгісін өзгерту (артқа бұру)
ODU (sr. italic=no, en. Subtract) subtracts the parameter from the accumulator
MNO (sr. italic=no, en. Multiply) Multiples the accumulator with the parameter
DEL (sr. italic=no, en. Divide) Divides the accumulator by the parameter
PZA (sr. italic=no, en. Change the Sign of Accumuator) Changes (flips) the sign of the accumulator
Бит бойынша/логикалық
KON (sr. курсив = no, en. Conjunction) параметр мен аккумулятормен логикалық AND орындайды және нәтижені аккумулятор DIS-де сақтайды (sr. italic=no, en. Disjunction) параметр мен аккумулятормен логикалық OR орындайды және нәтижені аккумуляторда NEG (sr. italic=no, en. Негация) аккумулятордың мазмұнына логикалық НЕТ орындайды (параметрді елемеді) Ескерту: жоғарыда аталған операциялардың барлығы бит бойынша. Олардың атаулары олардың тек логикалық операциялар екенін білдіреді, бірақ оларды бит векторларында жұмыс істегендей және әр бит жұптарына логикалық операцияларды жеке қолданғандай түсіндіруге болады.
DIS (sr. italic=no, en. Disjunction) performs logical OR with the parameter and the accumulator and stores the result in the accumulator
NEG (sr. italic=no, en. Negation) performs logical NOT on the content of the accumulator (ignores the parameter)
Note: above operations are all bitwise. Their names imply that they are purely logical operations but they can be explained as if they operate on vectors of bits and separately apply logical operations on each pair of bits.
Логикалық ауысулар
POL (sr. italic=no, en. Shift Left) аккумулятордың битін сол жаққа ауыстырады POD (sr. italic=no, en. Shift Right) аккумулятордың биттерін оңға ауыстырады
POD (sr. italic=no, en. Shift Right) shifts the bits of the accumulator to the right
Ағындылықты басқару
NES (sr. курсив = no, en. Negative Jump) аккумулятордың ағымдағы мәні теріс BES (sr. italic=no, en) болса, параметрмен көрсетілген мекен-жайға шартты секіруді орындайды. Unconditional Jump) параметрі NUS (sr. italic=no, en) келтірген мекен-жайға шартты емес секіруді орындайды. Zero Jump) аккумулятордың ағымдағы мәні нөл болса, параметрмен көрсетілген мекен-жайға шартты секіруді орындайды ZAR (sr. italic=no, en. Stop the Computer) деген команда кез келген қосымша өңдеуді тоқтатады; бұл параметрді елемейтін жалғыз нұсқаулық.
BES (sr. italic=no, en. Unconditional Jump) performs an unconditional jump to the address specified by the parameter
NUS (sr. italic=no, en. Zero Jump) performs a conditional jump to the address specified by the parameter if the current value of the accumulator is zero
ZAR (sr. italic=no, en. Stop the Computer) stops any further processing; this is the only instruction that ignores the parameter.