Assume a 32-bit input value contains 4 signed integers a, b, c and d in the packed format below:
a: input[31:23] b: input[22:16] c: input[15:9] d: input[8:0].
or in binary format: aaaaaaaaabbbbbbbcccccccddddddddd
A 32-bit output value contains the result composed of 2 signed integers x and y in the format below:
x: output[26:16] y: output[10:0]
or in binary format: 00000xxxxxxxxxxx00000yyyyyyyyyyy
Integers x and y are calculated according to the following formulas:
x = 4a + 9b , 1024 > x >= -1024
y = x + (c * d) , 1024 > y >= -1024
Write an assembly program to do the following:
Allocate and initialize a 32-bit variable called input. The initial value of input should be: 0x8534D67A
Allocate a 32-bit variable called output to hold the result of x and y in the packed format above.
Extract signed integers a, b, c and d from input into a separate register for each. (Remember to maintain the sign bit.)
Calculate x and y using the formulas above. (Remember to take care of saturation condition.)
Combine x and y into the packed format specified above and store to output
To verify the result, you should be getting:
Output = 0x05FC0400
I just need hints on how to start it, this is my first assembly coding project
So review the course notes, and ask the teacher about things that aren't clear to you, that's their job. Being unduly deferential and remaining confused is not what you're paying for.
If that doesn't help find a couple of books on assembly and read them.
input DCD 0x8534D67A