The content of AC in the basic computer is hexadecimal A937 and the initial value of E is 1. Determine the contents of AC, E, PC, AR and IR in hexadecimal after the execution of the CLA instruction. The initial value of PC is hexadecimal 021.

Determine whether instruction is memory reference, register or I/O.
Because D1 was set to 1, all other decoder outputs Dn are set to 0
(see figure 5-6). Therefore the instruction is a memory-reference
instruction.

Remember that SC (Sequence Counter) is incremented on every clock
pulse Tn.

b)

Because we are already in the instruction cycle, the current
instruction is performed as in a). After the execution of the
instruction is completed, the computer branches to interrupt cycle (R
= 1). R is the interrupt request signal.

First in the interrupt cycle, the return address of the current
program is saved to memory location 0.

RT0: AR <- 0, TR <- PC
RT1: M[AR] <- TR, PC <- 0 ; M[0] = 191

The interrupts are disabled and the program flow continues at memory
location 1 which contains the branch instruction to the interrupt
subroutine.

RT2: PC <- PC + 1 , IEN <- 0,
R <- 0, SC <- 0

At the beginning of the next instruction cycle (R = 0), fetching the
branch instruction to the first instruction of the interrupt
subroutine may begin.

The content of PC in the basic computer is 3AF (all numbers are in hexadecimal). The content of AC is 7EC3. The content of memory at address 3AF is 932E. The content of memory at address 32E is 09AC. The content of memory at address 9AC is 8B9F.

If you haven't done so yet, read the AtMega32 instruction set summary from the AtMega32 data sheet available from the course website. Write, in assembly, a loop program that should take exactly one millisecond to execute. Do not use counters this time, but only loops. The system clock has been set to run at 8MHz. HINT: next to each instruction, you see how many clock cycles a single instruction takes.

Remember the 8086 instruction set from the first exercise? Find it, and create a similar delay loop structure as in the first assignment. As the data sheet does not provide required clock cycles of each instruction, no exact requirement for amount of time is set. Just create a delay loop that loops for some arbitrary amount of cycles.