《Programming from the Ground Up》閱讀筆記:p75-p87

codists發表於2024-07-24

《Programming from the Ground Up》學習第4天,p75-p87總結,總計13頁。

一、技術總結

1.persistent data

p75, Data which is stored in files is called persistent data, because it persists in files that remain on disk even when the program isn't running.

儲存在檔案中的資料稱為persistent data,因為即使程式每頁執行,資料仍保留在磁碟上的檔案裡。

2.buffer

p76, A buffer is a continuous block of bytes used for bulk data transfer. When you request to read a file, the operating system needs to have a place to store the data it reads. That place is called a buffe.

Another thing to note is that buffers are a fixed size, set by the programmer.

3.equ指令

這是本書有一個不大好的地方,很多指令首次引入的時候缺少定義。例如p80, For example, if you did .equ LINUX_SYSCALL, 0x80, any time after that you wrote LINUX_SYSCALL, the assembler would susbstitue 0x80 for that。

這裡作者應該介紹下equ是什麼?參考《x64 Assembly Language Step-by-Step: Programming with Linux》p211, A statement contianing the directive EQU is called an equate. An equate is a way of associating a values with a label。這樣我們就知道了equ這三個字母來自於equate,這樣也方便了初學者記憶。

4.constant(常量)

p88, In programming, a constant is a value that is assigned when a program assembles or compiles, and is never changed.在程式設計中,constant(常量)是在程式彙編或者程式編譯時分配的值,分配後就不再改變。

二、英語總結

1.tedious

(1)tedious < tedium < taedium。

(2)taed-: feelings of being weary of tired。

(3)tedium: u. the quality of being boring for a long time。

(4)tedious: adj. If you describe sth shuch as a job, task, or situation as tedious, you mean it is boring and rather frustrating。片語:be tedious to do sth。

p77, First, it is tedios to type. You would have to type 500 numbers after the .byte declaration, and they wouldn't be used for anything but to take up space.

2.meat

p80, That's a useful trick in writing complex programs-first decide the meat of what is being done.

"meat"用的最多的意思是“u.the flesh of animals(肉)”。這裡是一種比喻意義的用法,meat在這裡的意思是“n. the core part of sth.”,所以,上沒這句話的意思就是“首先決定主要目標這種技巧在編寫複雜程式時很有用”。

3.help out/help (someone) out

p80,In this program we will also introduce a new directive, .equ which should help out。

在這句話中,help out把賓語省略了,應該是help us out, 或者help you out,這樣更容易理解,即.equ指令會對我們有所幫助。

三、其它

p77,Second, it uses up space in the executable.這句話翻譯成中文的意思是“其次,它會用盡可執行檔案中的空間”,不是很理解這裡為什麼使用use up來描述,感覺和use的意思更接近。

四、參考資料

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)

相關文章