Sprotne naloge 4

Rok za oddajo: nedelja, 11. december 2022, 23.55

1.Napišite zaporedje ukazov v zbirniku za procesor ARM, ki zamenja vrednosti 32-bitnih spremenljivk STEV1 in STEV2. Nalogo rešite s posrednim naslavljanjem preko registra R0.

2.Rezervirajte prostor za tabelo z oznako TABELA, v kateri je 5 8-bitnih vrednosti. Nato napišite zaporedje ukazov v zbirniku za ARM, ki v vse bajte tabele zapiše vrednost 0xFF. Nalogo rešite s posrednim naslavljanjem preko registra R0 in uporabo takojšnjega odmika. Uporabite le ukaze za nalaganje konstant v registre in ukaze za shranjevanje vrednosti registrov v pomnilnik.

3.Rezervirajte prostor za tabelo z oznako TABELA, v kateri je 6 8-bitnih vrednosti. Nato napišite zaporedje ukazov v zbirniku za ARM, ki najprej v zaporedne bajte tabele zapiše števila od 1 do 6, nato pa zamenja vrstni red elementov tabele tako, da so po zamenjavi vrstnega reda števila razporejena v obratnem vrstnem redu kot na začetku. Nalogo rešite s posrednim naslavljanjem s takojšnjim odmikom preko registra R0.

4.Napišite zaporedje ukazov v zbirniku za procesor ARM, ki 32-bitno spremenljivko STEV1, ki je v pomnilniku shranjena po pravilu tankega konca, prepiše v STEV2, pri čemer naj bo STEV2 v pomnilniku shranjena po pravilu debelega konca. Uporabite posredno naslavljanje s takojšnjim odmikom preko registrov R0 in R1.

----------------------------------------------------------------------------------------------------------------------------------------------

 1. Write the sequence of instructions in the ARM assembly that exchanges the values of 32-bit STEV1 and STEV2 variables. Implement the task by using indirect base addressing mode through the base register R0.

2. Reserve the space in the memory for the table labeled TABLE, which contains 5 8-bit values. Then write the sequence of instructions in the ARM assembly, which writes the value 0xFF in all bytes of the table. Implement the task by indirect base addressing through the register R0 and the immediate offset. Use only instructions for loading constants into registers and instructions for storing registers values ​​in memory.

3. Reserve the space for a table labeled TABLE, which contains 6 8-bit values. Then, write the sequence of instructions in the ARM assembly, which first writes numbers in the order of 1 to 6 in the successive bytes of the table, and then changes the order of the table elements so that after the replacement,  the numbers are arranged in the reverse order as at the first step. Implement the task by indirect base addressing with immediate offset through the register R0.

4. Write the sequence of instructions in the ARM processor assembly that copies the STEV1 32-bit variable stored as little-endian to the STEV2 variable stored in the memory under big-endian rule. Use indirect base addressing with immediate offset through R0 and R1 registers.