- 5
- 0
- 约5.72千字
- 约 31页
- 2017-03-09 发布于上海
- 举报
Welcome to CMPE 12C University of California, Santa 欢迎来到加利福尼亚大学CMPE 12C圣诞老人
LC-3 Assembly Language Patt and Patel Ch. 7 LC-3 is a load/store RISC architecture Has 8 general registers Has a flat 16-bit addressing range Has a 16-bit word size Load variables from memory to register Syntax of LC-3 One instruction, declaration per line Comments are anything on a line following “;” Comments may not span lines LC-3 has 2 basic data types Integer Character Both are take 16-bits of space (a word) though a character is only 8-bits in size. Labels Symbolic names that are used to identify memory locations Location for target of a branch or jump Location for a variable for loading and storing Can be 1-20 characters in size .ORIG Tells simulator where to put your code in memory Only one allowed per program PC gets set to this address at start up Similar to the “main” in “C” .FILL One declaration per line Always declaring 16-bits, the word size of LC-3 .BLKW Tells assembler to set aside some number of sequential memory locations Useful for arrays Can be initialized Examples of .BLKW: ;set aside 3 locations .BLKW 3 ;set aside 1 location and label it. Bob .BLKW 1 ;set aside 1 location, label and init to 4. Num .BLKW 1 #4 .STRINGZ Used to declare a string of characters Is terminated by x0000 Example:hello .STRINGZ “Hello World!” .END Tells the assembler where your program ends Only one per allowed in your program Simple LC-3 program What does this program do? What is in “Result” at the end? Assembler translates to executable – machine language Linker combines multiple LC-3 files – if any Loader puts executable into memory and makes the CPU jump to first instruction, .ORIG. Executes When executing is done returns control to OS Or simulator or monitor Load again to run again with different data In this case, assemble again, too, since data is in program. HLL – if/else statements… Procedure Calls “LC-3” LD R0, a AND R1, R1, #0 ; init I to zero ADD R1, R1, #3 ; now make 3 for ADD R2, R1, #-8 BRp endfor ADD R0, R0, R1
您可能关注的文档
- VSIPL+ FPGA Design MethodologyVSIPL FPGA的设计方法.ppt
- VV. Nonlinear Motion mrsj.exofire.net.ppt
- W A T K I N S Chabot CollegeW K i n s沙博学院.ppt
- W A T K I N S J O H N S O N C O M P A N Y 我是一个不在地上的我是一个氮氧的氮氧的氮氧的氮氧的一个氮的.ppt
- W2 ECM Motivation dcfW2 ECM 动机 DCF.wisconsin.gov.ppt
- WAGA XCountry Lectures James Cooperwaga x国家讲座杰姆斯库珀.ppt
- Wagner and German Culture History 323 February 瓦格纳和德国文化史323二月.ppt
- Wake Me Up Before You Go Go” WHAM!我叫醒你去”之前砰.ppt
- WAL MART University of Maine System沃尔玛缅因大学系统.ppt
- WAKE UP THE SLEEPING GIANT University of Pittsburgh唤醒沉睡的巨人匹兹堡大学.ppt
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
原创力文档

文档评论(0)