risc-and-cisc-computes

Write a RISC & CISC-style program that computes the expression SUM = 580 + 68400 + 80000

RISC-style program:

A RISC-style program that computes SUM = 580 + 68400 + 80000

 MoveR2, #NUMBERSGet the address of the numbers.
 LoadR3, (R2)Load 580
 LoadR4, 4(R2)Load 68400
 AddR3, R3, R4Generate 580 + 68400
 LoadR4, 8(R2)Load 80000
 AddR3, R3, R4Generate the final sum
 StoreR3, 12(R2)Store the sum
 Next instruction  
 ORIGIN0 * 500 
NUMBERS:DATA WORD580, 68400, 80000Numbers to be added
SUM:RESERVE4Space for the sum

 

CISC-style program:

A CISC-style program that computes SUM = 580 + 68400 + 80000

 MoveR2, #NUMBERSGet the address of the numbers.
 MoveR3, (R2)+Load 580
 AddR3, (R2)+Generate 580 + 68400
 AddR3, (R2)Generate the final sum
 MoveSUM, R3Store the sum
 Next instruction  
 ORIGIN0 * 500 
NUMBERS:DATA WORD580, 68400, 80000Numbers to be added
SUM:RESERVE4Space for the sum

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top