首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

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

《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.

Gather ingredients

Mix ingredients

Bake

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. 英语

  • 发表于:
  • 原文链接https://page.om.qq.com/page/O_8uzSMWtzb67QK33rP7ktPQ0
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券