《Programming from the Ground Up》阅读笔记:p95-p102

《Programming from the Ground Up》学习第6天,p95-p102总结,总计8页。

一、技术总结

1.directive(伪指令)

很多资料喜欢把directive和instruction都翻译成“指令”,这样在看到指令这个词时就不知道到底指的是什么?这里参考其它人的做法,将directive称为“伪指令”。

2.rept & .endr

语法:

.rept count

...

.endr

(1).rept: rept是"repeat"的缩写,表示.rept和.endr之间的内容重复count次。

(2).endr: endr是“end repeat”的缩写。

record2:
 .ascii "Marilyn\0"
 .rept 32 #Padding to 40 bytes
 .byte 0
 .endr

如上所示,"Marilyn\0"长度是8,占8个bytes, 重复0 byte 32次,所以是“Padding to 40 bytes”。

3.bit、byte、word

(1)bit

bit就是0或者1,即0是一个bit,1也是一个bit。01是两个bit,00000000是八个bit。

(2)byte

1 byte = 8 bit。

(3)word

word由多少个byte构成取决于电脑是多少位的:

16-bit architecture: A word is 2 bytes (16 bits).

32-bit architecture: A word is 4 bytes (32 bits).

64-bit architecture: A word is 8 bytes (64 bits).

(4)示例

《programming from the ground up》:p96, In this, everything is character data except for the age, which is simply a numeric field, using a standard 4-byte word(we could just use a single byte for this, but keeping it at word makes it easier to process)。

二、英语总结

1.open back up

p95, You can shut down the program and open it back up, and you are back where you started.

在上面这句话中“open it back up”的意思是“re-open, open again”。

2.be off with

p95, Structured data can contain variable-length fields, but at that point you are usually better off with a database.

在这句话话中“be better off with database”翻译过是“最好使用数据库”。

3.have sth down vs have sth down pat

have sth down的意思是“know it”,have sth down pat的意思是“know it perfectly”。示例:

p100,Now that we have our basic definitions down, we are ready to write oure programs.

三、其它

《Progromming From The Ground Up》p104写着:as write-record.s -o write-record.o,但前面都没有提到哪里定义了write-record.s这个文件,整本书翻遍了都没有找到。此时转到Github上去找,发现了别人写的write-record.s文件。

书上没有写哪段代码是写在这个文档,为什么别人知道呢?个人猜测是看到了as write-record.s -o write-record.o 这句命令,知道放到这里。这种灵活转换是我目前需要学习的。根据已有的条件去实现目标,不纠结于问题或错误。

四、参考资料

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)

  • 18
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值