CSAPP: Chapter1.3~Chapter1.4

1.3 It Pays to Understand How compilation System Work

1)Reasons for why programmers need to understand how compilation systems work

Optimizing program performance.

Don’t need to know the inner workings of the compiler in order to write effective codes. However, in order to make good coding decisions in our C programs, we do need a basic understanding of machine-level code and how the compiler translates different C statements into machine code. 

Understanding link-time errors.

Realize running errors

Avoiding security holes.

Buffer overflow vulnerabilities.(The majority )

 

1.4 Processors Read the Interpret Instructions Stored in Memory

1)Hardware Organization of a System

2)Hardware Element Details

Buses

word(several bytes(8 bits))

I/O

controller, chip sets int the device itself or on the system’s main printed circuit board(often called the motherboard)

adapter, a card that plugs into a slot on the motherboard.

Samilarly, transfer information back and forth between th I/O bus and an I/O device.

Main Memory

Temporary storage device that holds both a program and the data.

DRAM(Dynamic Random Access Memmory)

Processor

Register, such as PC(Program Counter)

ISA(Instruction Set Architecture)

Load,Store,Operate,Jump

3)How hello.c runs

disk——>memory——>register file——>memory——>    display device

4)DMA

direct memory access

Data to memory directly,do not need processor

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值