教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 学前教育 >

CodeWarrior 使用教程(4)

来源:网络收集 时间:2026-02-20
导读: Figure 2-13: Each supported operating has a Linker settings panel. Here is the x86 version. Settings for the editor can be found on the Custom Keywords panel. This panel allows you to configure the t

Figure 2-13: Each supported operating has a Linker settings panel. Here is the x86 version.

Settings for the editor can be found on the Custom Keywords panel. This panel allows you to configure the text editor to display various custom keywords in different colors. For example, if you like to use a keyword in your source code to label certain areas of the code in a different color, you can list it here. It will appear in the color you choose.

The Debugger Settings panel allows you to choose how the debugger should log data, handle watch points, etc. This is discussed in more detail in Lesson 5.

Now you can begin to see how CodeWarrior's features help make programming easier. Now go check out your homework. Yes, you will have some homework assignments in this class. Then I'll see you back here for Lesson 3.

第三课 编 译

第一步:理解编译阶段

我们的前面的课程中已经学到,源程序输入完之后的工作就是要编译它。编译源程序就是计算机把你所写(通常是用C 或 C++编写的)的源代码进行分解、分析,然后转化为机器语言。机器语言是一种计算机能够理解阿语言,而且它运行起来比 C 或 C++ 也要快得多。编译的大致过程如下:

1. 用 C 或 C++ 编写代码:

#include void main(void) { int c;

printf(\ c = getchar(); }

2. 进行编译。 CodeWarrior 编译上述代码并把它翻译成机器语言,结果如下:

符号名:

1: _main 2: _@8 3: _printf 4: ___files 5: _fwide 6: ___get_char

===============================================================

SECTION SIZE = 0x0000003C; NAME =?.text DEFINED SYMBOLS: name = _main offset = 0x00000000; type = 0x0020; class = 0x0002 00000000: 68 00 00 00 00 push offset _@8 00000005: E8 00 00 00 00 call _printf 0000000A: 59 pop ecx 0000000B: 6A FF push -1 0000000D: 68 00 00 00 00 push offset ___files 00000012: E8 00 00 00 00 call _fwide 00000017: 85 C0 test eax,eax 00000019: 59 pop ecx 0000001A: 59 pop ecx 0000001B: 7D 1E jge $+32 ; --> 0x003b 0000001D: 83 2D 2C 00 00 00 sub dword ptr ___files+44,1 00000023: 01 00000024: 72 0A jb $+12 ; --> 0x0030 00000026: FF 05 28 00 00 00 inc dword ptr ___files+40 0000002C: EB 0D jmp $+15 ; --> 0x003b 0000002E: 89 C0 mov eax,eax 00000030: 68 00 00 00 00 push offset ___files 00000035: E8 00 00 00 00 call ___get_char 0000003A: 59 pop ecx 0000003B: C3 ret near

============================================================= SECTION SIZE = 0x00000019; NAME = .data 00000000: 48 65

…… 此处隐藏:196字,全部文档内容请下载后查看。喜欢就下载吧 ……
CodeWarrior 使用教程(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/593504.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)