1. For the simple RISC assembly language given below, write an assembly language program that calculates the sum of the numbers between 1 and N and saves this sum to the memory location RESULT. (Assume N is a memory location)
Type of Instruction Assembly Language Register Transfer Language

Description

Memory Access Load R1, Mem
Store R1, Mem Mem[Mem]
Move Move R1, R2 R1 R2
Move R1, #100 R1 100
Arithmetic Instruction

(reg. operands only)

Add R1, R2, R3 R1 R2 + R3
Sub R1, R2, R3 R1 R2 - R3
Conditional

Branch

Compare R1, R2 Sets condition codes
BGT LABEL Branch to LABEL if conditions codes are set for <
Unconditional

Branch

B LABEL Always Branch to LABEL

Assembly Language Program

  AREA DATA  
N DCD 5  
RESULT DCD 0  
     
  AREA CODE