Sprotne naloge 3
1. Zapišite ukaz v zbirniku za procesor ARM, ki v register R1 naloži konstanto 128. Uporabite takojšnje naslavljanje (ukaz MOV). Izpišite ustrezen strojni ukaz (32 – bitno število v šestnajstiški obliki). Program izvajajte po korakih in opazujte vrednosti registrov r15(PC) in R1. Kakšni sta njuni vrednosti na koncu programa?
2. Zapišite ukaz(e) v zbirniku za procesor ARM, ki v register naloži vrednost spremenljivke:
a) naloži 32-bitno vrednost 0x12345678 v register R1
b) naloži 8-bitno vrednost 128 v register R1.
c) naloži 16-bitno vrednost 0xF123 v register R1
Naloge rešite s posrednim (baznim) naslavljanjem brez odmika preko registra R0.
3. Napišite zaporedje ukazov v zbirniku za procesor ARM, ki vrednost 32-bitne spremenljivke STEV1 prepiše v 32-bitno spremenljivko STEV2. Nalogo rešite še za primer, če sta spremenljivki STEV1 in STEV2 8-bitni oziroma 16-bitni. Vse primere rešite s posrednim (baznim) naslavljanjem brez odmika preko registra R0.
----------------------------------------------------------------------------------------
1. Write down the instruction for the ARM processor, which loads the constant 128 in the R1 register. Use Immmediate Addressing (MOV instruction). Determine the appropriate machine instruction (32 - bit number in hexadecimal form). Run the program step by step and observe the content of the R15 (PC) and R1 registers. What are their values at the end of the program?
2. Write down the instructions for the ARM processor, which loads the variable value in the register R1:
a) Load 32-bit value 0x12345678 into register R1
b) loads the 8-bit value 128 into the R1 register.
c) upload 16-bit value 0xF123 to register R1
Resolve tasks with indirect (base) addressing without offset through register R0.
3. Write the sequence of instructions in the ARM processor assembly language that overwrites the 32-bit STEV1 variable to the 32-bit STEV2 variable. Solve the task also if the STEV1 and STEV2 variables are 8-bit or 16-bit. Solve all cases with indirect (base) addressing without offset through register R0.