例5-1,段伪指令的使用 教材中列出的是一个汇编语言程序经汇编 后生成的.Ist文件,每行包含4个区域(列): Field1:((源程序)源代码行号 Field2:段指针SPc(段程序计数器) Field3:目标代码(机器码) Field4:初始源代码(源程序) Project→Properties→CCS Build-C55 00 Compiler→Advanced Options →Assembler Options→ Generate Assembly Listing Files(al)
例5-1,段伪指令的使用。 教材中列出的是一个汇编语言程序经汇编 后生成的.lst文件,每行包含4个区域(列): Field 1: (源程序)源代码行号 Field 2: 段指针SPC(段程序计数器) Field 3: 目标代码(机器码) Field 4: 初始源代码(源程序) 29 Project→Properties→CCS Build→C5500 Compiler→ Advanced Options →Assembler Options→ Generate Assembly Listing Files(al)
3,2.5 构建Build操作的参数设置 构建参数包括汇编器参数和链接籌参数对C程序还包 括编译器参数)。方法:将鼠标移至Project Explorer'”中 的当前工程文件Ex31.pit处,右击菜单选择 CCS Edit Ex3_1.pjt/Ex3_1.asm -Code Composer Studio ▣☒ “Properties' File Edit View Navigate Project Run Scripts 置indow Help 9,■呢风、给、年9,回:中、 蹈母CCS Edit Project Explorer曰每=口 Ex3 1.emd 目Ex3_1.asmX 曰SEx31pjt[kewe-nebu 白-绍Binaries New Ex3_1.pjt.out [C5500/t Copy Ctrl+C 白-Includes Curl+V D:/ti/cesv5/tools/compil 暗Este ▣Debug 其Delete Delete 甲量Ex3_1.obj-[C5500/九e] Source Ex3_1.pjt.out [C5500/b Moye 自 cesObjs.opt Ren如e,, F2 目 Ex3 1.pjt.map makefile Import.. 重@ objects.mk ☒ExP2rt., 图Frob1emsX @ sources.mk Show Build Settings... 0 items subdir_rules.mk Build Project Deseription subdir_vars.mk 曰-SE31.asm Clean Project Rebuild Project 曰回start L…L1 Refresh 白-aEx3_1.cmd C1o至e Project DARAM1 Build Configurations 回DARAM:2 Make Targets Index Add Files... Debug As T丝9狮 Licenzed Compare With Restore from Loeal Historg... Refactor Source Source Properties AlttEnter
3.2.5 构建(Build)操作的参数设置 30 ◼ 构建参数包括汇编器参数和链接器参数(对C程序还包 括编译器参数)。方法:将鼠标移至“Project Explorer” 中 的当前工程文件Ex3_1.pjt处, 右击菜单选择 “Properties”, 打开Properties窗口
3.2.5构建Build)操作的参数设置 Properties for Ex3_1.pjt ▣☒ type filter text Assembler Options Resource CCS General 日rSBi1A Configuration: Debug Active Hanage Confi gurations... 日-C5500 Compi1er Processor Options Optimization Debug Options Keep the generated assembly language asm)file (--keep_asm,-k) Include Options 白Advanced0 ptions Source interlist Advanced Debug Options ☑Generate1 isting.f1e-asm listing-】 Language Options 打钩后,再构建后会产生列表文件 Parser Preprocessing 01 ■ep1 carwlbuis1 upueou0山a1.sy5,-as) Predefined Symbols Do not generate clink for.const sections (-no_const_clink) Ex3 1.Ist Diagnostic Options Runtime Model Options Simulate source copy filename'(--copy_file,-ahc) Advanced Optimization Entry/Exit Hook Options Library Function Ass Generate listing file (--asm_listing,-al) Assenbler Options Eile Time Specifier 点击选择汇编选项 cant (-syms_ignore_case,-ac) Directory Specifier asn_undefine,-au) 园四四市 Default File Extensiont Command Files MISRA-C:2004 C5500 Linker Do not require'#on shift counts (mnem only)(--hash_optional_shift_count,-ats) Builders ⊕C/Ct+Build Pre-define assembly symbol NAME (-asm_define,-ad) 园园司行11 ⊕CfC+General Debug Project References -Run/Debug Settings Suppress all assembler warnings (--suppress_asm_warnings,-atw) -Task Tags Generate first-level assembly include file list (--asm_includes,-api) Generate assembly dependency information (--asm_dependency,-apd) Browse... Suppress identified assembler remark (--suppress_remark,-ar) 国园自个引 Simulate source 'include filenane'(--include_file,-ahi) 国园司分1 Generate cross reference file (--cross_reference,-ax) Hide advanced settings OK Cancel
3.2.5 构建(Build)操作的参数设置 31 ◼ 构建参数包括汇编器参数和链接器参数(对C程序还包 括编译器参数)。方法:将鼠标移至“Project Explorer” 中 的当前工程文件Ex3_1.pjt处, 右击菜单选择 “Properties”, 打开Properties窗口。打钩后, 再构建后会产生列表文件 Ex3_1. lst 点击选择汇编选项 Generate listing file (--asm_listing,-al)
例5-1,段伪指令的使用。列表文件(.1st): 汇编设置: 暖尾竊 汇编语言源程序 SPC (空行) 2 米**米****************************** 3 *汇编一个初始化表到.data段* 4 米*米米米米米米***米米米米米***米*米*米*米*米*****米 5 000000 data 6 000000 0011 coeff word 011h,022h,033h 7 000001 0022 米*米**米***米米*******米**米***********米 8 000002 0033 *在.bss段中为变量保留空间* 9 米******************************** 10 000000 bss buffer,10 11 *********** 12 *.bss结束后仍然在.data段中 米* 13 米********米***米**********米********米 14 000003 0123 prt word 0123h Project→Properties→CCS Build→Cc55o0 Compiler→Advanced Options 一→Assembler Options→Generate Assembly Listing Files(al)
1 (空行) 2 ********************************** 3 ** 汇编一个初始化表到.data段 ** 4 ********************************** 5 .data 6 coeff .word 011h,022h,033h 7 ********************************** 8 ** 在.bss段中为变量保留空间 ** 9 ********************************** 10 .bss buffer,10 11 ********************************** 12 ** .bss结束后仍然在.data 段中 ** 13 ********************************** 14 prt .word 0123h 32 例5-1, 段伪指令的使用。列表文件(.lst): Project→Properties→CCS Build→C5500 Compiler→ Advanced Options →Assembler Options→ Generate Assembly Listing Files(al) 汇编设置: 000000 000000 0011 000001 0022 000002 0033 源程序 的行号 段程序 计数器 目标 代码 汇编语言源程序 000000 000003 0123 SPC
源程序 汇编语言 的行 暖鑫轎 源程序 15 SPC 米米泳**米米*冰米*冰米家米米家咪米咪*米水*米冰***米*米*米 9 米* 汇编代码到.text段 ** 米冰冰米***米冰**米米米米***米*家米****米******* 18 000000 text 19 000000 A01E add: MOV OFh.AC 0 :DP直接寻址 20 000002 4210 aloop: SUB #1,AC0 21 000004 0450 BCC aloop,ACO>=#0 000006 FB 22 米米米米*米米米冰*米冰米米学**米米******米****米**家 强 ** 汇编另一个初始化表到.data段 *****米******米********米********米*** 25 000004 data 6 000004 10AA ivals word 10AAh,OBBh, 0CCh 000005 00BB 000006 000C 27 ***米*********水*米**米水**********米* 28 ** 为更多的变量定义另一个段 ** 29 ******************************** 30 000000 var2 usect “newvars'”, 31 000001 inbuf .usect “newvars”,7 33
15 ********************************** 16 ** 汇编代码到.text段 ** 17 ********************************** 18 000000 .text 19 000000 A01E add: MOV 0Fh,AC0 ;DP直接寻址 20 000002 4210 aloop: SUB #1, AC0 21 000004 0450 BCC aloop,AC0>=#0 000006 FB 22 ********************************** 23 ** 汇编另一个初始化表到.data段 24 ********************************** 25 000004 .data 26 000004 10AA ivals .word 10AAh,0BBh,0CCh 000005 00BB 000006 00CC 27 ********************************** 28 ** 为更多的变量定义另一个段 ** 29 ********************************** 30 000000 var2 .usect “newvars” ,1 31 000001 inbuf .usect “newvars” ,7 源程序 的行号 段程序 计数器 目标 代码 汇编语言 源程序 33 SPC