Translate f g A4 to ARM Assume f and g are in registers X9

Translate f = g - A[4] to ARM. Assume f and g are in registers X9, X10, the base address of array A is in X11, and A contains 64 bit double words. You may also use any other registers.

Solution

The LDRD command is used to load double word.

And since it is 64-bit architecture the registers to use X0-X30.

The required instruction set is:

LDRD X12, [X11, #32]   ; Temporarily Stores A[4] into X12

; As it is double word, offset is

; 8*4 = 32

SUB X9, X10, X12 ; f = g – A[4]

 Translate f = g - A[4] to ARM. Assume f and g are in registers X9, X10, the base address of array A is in X11, and A contains 64 bit double words. You may also

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site