You are on page 1of 1

Lab 1

1. Write the following code segment in MARIE assembly language:


F= (a+b)-(c+d)
2. Write the following code segment in MARIE assembly language:
X= A +B - [C-D + E-(F+G)]

3. Translate the following C program in to a corresponding MIPS assembly


language program:
void main ( void )
{
int B[4] = { 300, 200, 100, 0 };
int i = 3;
B[i ] = B[0] + B[1] + B[2];
}
4. Write the following code segment in MARIE assembly language:
F(x) = 3x+1

You might also like