计算机系统(三)CPU读并解释存储在存储器中的指令

这篇博客详细介绍了计算机系统的基本组成,包括CPU、内存、I/O设备和总线的作用。通过示例展示了编译过程,解释了CPU如何读取、解释并执行存储在主存中的指令,同时阐述了指令执行的步骤,如加载、保存、操作和跳转。最后,提到了现代CPU为了提高性能所采用的复杂机制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

TTcdeMacBook-Air:SystemCompiler TTc$ gcc -E hello.c -o hello.i
TTcdeMacBook-Air:SystemCompiler TTc$ open .
TTcdeMacBook-Air:SystemCompiler TTc$ gcc -O hello.c -o hello.o
TTcdeMacBook-Air:SystemCompiler TTc$ ls
hello.c hello.i hello.o hello.s
TTcdeMacBook-Air:SystemCompiler TTc$ open .
TTcdeMacBook-Air:SystemCompiler TTc$ ls
hello.c hello.i hello.o hello.s
TTcdeMacBook-Air:SystemCompiler TTc$ gcc -o hello hello.c
TTcdeMacBook-Air:SystemCompiler TTc$ ls
hello hello.c hello.i hello.o hello.s
TTcdeMacBook-Air:SystemCompiler TTc$ ls
hello hello.c hello.i hello.o hello.s
TTcdeMacBook-Air:SystemCompiler TTc$ ./hello
hello world
TTcdeMacBook-Air:SystemCompiler TTc$

此时 helllo.c源程序 已经经过 编译系统翻译成了 可执行目标文件 hello  (在 win上为 PE文件  在Unix下为 ELF文件)

shell 是一个命令行解释器, 这时候 shell 加载并运行 hello 程序,然后等待程序终止,hello 程序在 显示器上 输出 它的信息,然后终止。 shell 随后输出一个提示符,等待用户 的下一个输入 命令
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值