首页 > 其他分享 >《Programming from the Ground Up》阅读笔记:p19-p48

《Programming from the Ground Up》阅读笔记:p19-p48

时间:2024-07-07 09:30:35浏览次数:13  
标签:movl items edi Programming Up eax p48 data loop

《Programming from the Ground Up》学习第2天,p19-p48总结,总计30页。

一、技术总结

1.object file

p20, An object file is code that is in the machine's language, but has not been completely put together。

之前在很多地方都看到object file这个概念,但都没有看到起定义,这次终于搞清楚了——object文件就是包含机器语言的文件。

2.汇编语言实现求最大值

#PURPOSE: This program finds the maximum number of a
#         set of data items.

#VARIABLES: The registers have the following uses:
#
# %edi - Holds the index of the data item being examined
# %ebx - Largest data item found
# %eax - Current data item
#
# The following memory locations are used:
#
# data_items - contains the item data. A 0 is used
#              to terminate the data
#
.section .data
data_items:
  .long 3,67,34,222,45,75,54,34,44,33,22,11,66,0

  .section .text

  .global _start
_start:
  movl $0, %edi
  movl data_items(,%edi,4),%eax
  movl %eax, %ebx
start_loop:
  cmpl $0,%eax
  je loop_exit
  incl %edi
  movl data_items(,%edi,4),%eax
  cmpl %ebx, %eax
  jle start_loop

  movl %eax, %ebx
  jmp start_loop
loop_exit:
  movl $1,%eax
  int $0x81

这里作者花了大量的篇幅做解释,但个人觉得在“使用哪种寄存器,为什么使用这种寄存器?”这点上作者没有解释清楚,可能会在后面介绍,先继续往下读。

二、英语总结

1.overwhelm

(1)over-: above, higher in power, above normal...

(2)whelm: turn upside down。

vt. to cause sb to feel strong emotion。

2.diligence

(1)dis-:apart。

(2)*leg-: to collect, gather。

以上两个组合起来的意思是“to pick out, select”, u. the quality of working carefully and with a lot of effort。

3.tinker

vi. to make small change to sth。tinker around with sth和tinker with sth意思一样。

4.process vs processing

A process is a series of steps taken to achieve something, such as the process of making cake.

  1. Gather ingredients
  2. Mix ingredients
  3. Bake
  4. Decorate cake

Processing is when you do things to a substance in order to change it. For example: the processing of oil into gasoline.
process的意思是“步骤”,processing的意思是“处理”。

三、其它

工作中一位很合得来的同事过完这个月就离职了,有点舍不得。这位同事平时说话温和,情绪稳定,做事沉稳,中正平和,在工作上算得上是一位良好的合作者,祝他未来一切顺遂。

四、参考资料

1. 编程

(1)Jonathan Bartlett,《Programming From The Ground Up》:https://book.douban.com/subject/1787855/

2. 英语

(1)Etymology Dictionary:https://www.etymonline.com

(2) Cambridge Dictionary:https://dictionary.cambridge.org

欢迎搜索及关注:编程人(a_codists)

标签:movl,items,edi,Programming,Up,eax,p48,data,loop
From: https://www.cnblogs.com/codists/p/18288213

相关文章

  • Denso Create Programming Contest 2024(AtCoder Beginner Contest 361)
    DensoCreateProgrammingContest2024(AtCoderBeginnerContest361)\(A\)Insert\(AC\)循环结构。点击查看代码inta[200];intmain(){intn,k,x,i;cin>>n>>k>>x;for(i=1;i<=n;i++){cin>>a[i];cout......
  • pdfplumber vs PyMuPDF:PDF文本、图像和表格识别的比较
    pdfplumbervsPyMuPDF:PDF文本、图像和表格识别的比较1.文本提取pdfplumberPyMuPDF2.图像提取pdfplumberPyMuPDF3.表格提取pdfplumberPyMuPDF总结在处理PDF文件时,提取文本、图像和表格是常见的需求。本文将比较两个流行的PythonPDF处理库:pdfplumber和PyMuP......
  • UFCFVQ-15-M Programming for Data Science
     CollegeofArts,TechnologyandEnvironmentaCADEMICYEAR2023/24 ResitAssessmentBriefSubmissionandfeedbackdatesSubmissiondeadline:Before14:00on15thJuly2024 Thisassessmentiseligiblefor48-hourlatesubmissionwindow.MarksandFeedb......
  • Java--Super
    1.super调用父类的构造方法,必须在构造方法的第一个2.super必须只能出现在子类的方法或者构造方法中3.super和this不能同时调用构造该方法和this差别1.代表的对象不同    this():代指本身调用者这个对象    super():代表父类对象的应用2.前提    this......
  • 「杂题乱刷2」CF402D Upgrading Array
    题目链接CF402DUpgradingArray(luogu)CF402DUpgradingArray解题思路首先有一个很显然的结论,就是你一旦在第\(i\)个位置上做了一次操作后,那么你之后所有在第\(j(i\lej)\)个位置做的操作都无效了,因为此时前缀的公因数为\(1\)了。因此有个很显然的结论就是操作需要......
  • 如何参与 Sleeping Cup 的筹备工作?
    SleepingCup公开赛的筹备工作中需要以下各方参与:出题人(单人或团体)提供原创题目idea。出题人的最低资质要求暂时为5级勾及以上。在出题人中,需有一名负责人。请注意,负责人必须全程切实对整场比赛负责、对每道赛题负责,而不能仅仅只是挂名。审核员将主要与负责人进行对接和......
  • P9384 [THUPC 2023 决赛] 着色
    P9384[THUPC2023决赛]着色思维题+构造三元环还可以,五元环有点抽象,考虑将其全归为奇环,那么题目就变成:求一种设边权的方案,使得只用边权\(i\)无法构成奇环。那么这个限制等价于只保留边权为\(i\)的边的图是二分图,那么一条边的两个端点得是不同属性。考虑怎么构造二分图,看......
  • Puppeteer node 瞬秒安装 亲测可用!
    Puppeteernode瞬秒安装亲测可用!Puppeteer最难得不是如何自动化,而是安装,这个包你就装不上,后面还看什么~~今天看了一篇文章,非常好,走了一遍流程,瞬秒能用,赶紧放上来建立目录myPuppeteernpminit-ynpmipuppeteer--ignore-scriptshttps://download-chromium.appspot.com......
  • mainCRTStartup WinMainCRTStartup
    assumecs:codesg,ds:datas;str字符必须是13位,所以中间加了两个空格,网上很多代码也避开了这个问题,都是通过加空格,拼写错误,反正加个占位符;否则会输出一堆乱码,实在想不明白是什么原因datassegmentstrdb'HelloWorld!','$'datasendscodesgsegmentmovax,datas......
  • opnEuler下使用xtrabackup报错libgcrypt.so.11
    环境:OS:openEuler2203sp4xtrabackup:2.4.7 [root@19copt]#/opt/xtrabackup-2.4.7/bin/innobackupex--defaults-file=/opt/mysql57/conf/my.cnf--user=root--password=mysql--socket=/tmp/mysql.sock--stream=tar/tmp|gzip>/tmp/mydb.tar.gz/opt/xtrabackup-2.......