【www.homeworkhelp.cc整理编辑】Using only 3 ARM instructions without using any LDR or STR instructions, sh

Using only 3 ARM instructions without using any LDR or STR instructions, show how to store the current value of the frame pointer in the stack, make the frame pointer to point to the base of this frame, and create an 8-byte stack frame while the stack pointer to point to the top of the stack. Assume that an FD stack is in use, appropriate stack space is already allocated to the stack, and the stack pointer is appropriately initialized. The first instruction is The second instruction is The third instruction is
在这里插入图片描述

**Expert Solution
arrow_forward
Step 1
Frame:

The stack frame, additionally referred to as activation record is that the assortment of all information on the stack related to one subroutine decision.

The stack frame typically includes the subsequent components:

The destination
Argument variables passed on the stack
Local variables (in HLLs)
Saved copies of any registers changed by the subroutine that require to be fixed up (e.g. $s0 - $s8 in MAL).

arrow_forward
Step 2
Instructions:

Instruction:
pushw( r a ) p u s h w ( ra) pushw( ra)pushw(a0)
pushw($a1)

 popw($a1)
 popw($a0)
 popw($ra)

addi $sp, $sp, -12
sw r a , 0 ( ra, 0( ra,0(sp)
sw a 0 , 4 ( a0, 4( a0,4(sp)
sw a 1 , 8 ( a1, 8( a1,8(sp)

 lw      $a1, 8($sp)
 lw      $a0, 4($sp)
 lw      $ra, 0($sp)
 addi    $sp, $sp, 12

Address Content
 $sp --> FF00    Saved return address
  FF04    Saved value from $a0
  FF08    Saved value from $a1
 **
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值