当前位置: 首页 > news >正文

建网站中企动力最行包装设计流程

建网站中企动力最行,包装设计流程,app线下推广怎么做,开鲁网站seo站长工具LAB 网页:https://pdos.csail.mit.edu/6.S081/2023/labs/traps.html 任务1:RISC-V assembly (完成) 初步看问题要求,这是一道文科题(问答题) 在你的 xv6 仓库中有一个文件 user/call.c。执行 make fs.img 会对其进行编译,并生成…

LAB 网页:https://pdos.csail.mit.edu/6.S081/2023/labs/traps.html


任务1:RISC-V assembly (完成)

初步看问题要求,这是一道文科题(问答题)

在你的 xv6 仓库中有一个文件 user/call.c。执行 make fs.img 会对其进行编译,并生成一个可读的汇编版本文件 user/call.asm。

阅读 call.asm 中关于函数 g、f 和 main 的代码。RISC-V 的指令手册可以在参考页面中找到。请在 answers-traps.txt 文件中回答以下问题:

Q: Which registers contain arguments to functions? For example, which register holds 13 in main’s call to printf?
A: 根据题意,我们先运行 make fs.img 生成 call.asm
随后阅读 user/call.c 和 user/call.asm 的代码,如下:
在这里插入图片描述
可以看到,储存函数参数的寄存器是 a0, a1, a2。其中,储存整数 13 的寄存器是 a2

Q: Where is the call to function f in the assembly code for main? Where is the call to g? (Hint: the compiler may inline functions.)
A: main 函数的汇编代码中没有函数 f 和 g 的函数调用。它们在编译阶段被编译器优化掉了。

Q: At what address is the function printf located?
A:搜索 call.asm 中 printf 的位置,如下
在这里插入图片描述
可以看到是 0x64a

Q: What value is in the register ra just after the jalr to printf in main?
A: 运行 jalr 指令后,寄存器 ra 的值是 0x38。
方式:使用 make qemu-gdb 启动 xv6,随后对 0x34 (jalr指令的地址) 打断点。
启动 xv6 后,运行 call 程序,qemu-gdb 会停留在 0x34 处。
此时运行 si 命令,执行 0x34 的 jalr 指令,可以看到 pc 跳转到了 0x64a 处。
再运行 info registers ra,即可看到 ra 寄存器的值为 0x38

Q:

Run the following code.unsigned int i = 0x00646c72;printf("H%x Wo%s", 57616, &i);What is the output? Here's an ASCII table that maps bytes to characters.
The output depends on that fact that the RISC-V is little-endian. If the RISC-V were instead big-endian what would you set i to in order to yield the same output? Would you need to change 57616 to a different value?Here's a description of little- and big-endian and a more whimsical description.

A:输出为 “He110 World”
如果 RISCV 是大端,那么 i 改为 0x726c6400
不需要修改 57616
(这里的回答不用太正确,反正不是代码)

Q:

In the following code, what is going to be printed after 'y='? (note: the answer is not a specific value.) Why does this happen?printf("x=%d y=%d", 3);

A: y= 后的数字是个垃圾数字 (junk value)。因为编译器仅仅给 a0 和 a1 寄存器赋值了,没有给 y=%d 的 %d 所对应的存储空间赋值


任务2:Backtrace (doing)

TODO: here

http://www.yayakq.cn/news/616251/

相关文章:

  • 一款非常不错的seo网站优化公司源码深圳龙岗天气
  • 仿素材网站电子邮箱怎么申请
  • 商丘专业做网站公司广东省建设安全卡查询网站
  • wordpress标签增加彩色背景seo优化师培训
  • 运营网站是什么意思wordpress购物模版
  • 猎头网站 做猎头的流程营销型网站案例易网拓
  • 网站建设公司深圳成都哪里做网站
  • 网站建设下坡路门户网站排版
  • 帮人家做家务的网站怎么给购物网站做推广
  • 企业网站开发效果网站ftp密码
  • 海报模板网站有哪些南昌市建设网站
  • 免费企业自助建站信息发布网上每网站建设
  • 建设网站费用会计分录电子商务网站建设 百度文库
  • 重庆平台网站推广河北专业网站建设
  • 广州做餐饮的招聘网站电子商务购物网站建设实验报告
  • 网站建设含义wordpress留白
  • 网站支持asp从0开始做网站
  • wordpress 企业站教程龙岗网站建设公司怎么样
  • 怎么用电脑做网站网站流量与带宽
  • 网站怎么广告投放网络连接服务
  • 重庆广告公司电话西宁网站seo公司
  • python做的网站源码怎么做淘宝客网站赚钱吗
  • 10000个免费货源网站wordpress增加模板
  • 培训网站建设方案模板跟换网站域名
  • 昆山网站建设推荐wordpress方框对勾
  • 网站快速优化排名官网龙华响应式网站建设
  • 网站优化建议书济宁网站建设招聘
  • 郑州公司网站个人 网站备案 幕布
  • 网站空间域名申请网站手机怎么制作网站
  • app和微网站的对比分析设计前沿的网站