中山大學(xué)軟件工程(移動信息工程)專業(yè)課導(dǎo)論課件第七節(jié)_第1頁
中山大學(xué)軟件工程(移動信息工程)專業(yè)課導(dǎo)論課件第七節(jié)_第2頁
中山大學(xué)軟件工程(移動信息工程)專業(yè)課導(dǎo)論課件第七節(jié)_第3頁
中山大學(xué)軟件工程(移動信息工程)專業(yè)課導(dǎo)論課件第七節(jié)_第4頁
中山大學(xué)軟件工程(移動信息工程)專業(yè)課導(dǎo)論課件第七節(jié)_第5頁
已閱讀5頁,還剩19頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、Chapter 7Low-Level ProgrammingLanguagesChapter GoalsList the operations that a computer can performDiscuss the relationship between levels of abstraction and the determination of concrete algorithm stepsDescribe the important features of the Pep/7 virtual machineDistinguish between immediate mode ad

2、dressing and direct addressingChapter Goals Convert a simple algorithm into a machine-language programDistinguish between machine language and assembly languageDescribe the steps in creating and running an assembly-language programConvert a simple algorithm into an assembly-language programChapter G

3、oals Distinguish between instructions to the assembler and instructions to be translated Describe two approaches to testingDesign and implement a test plan for a simple assembly-language program Computer Operations A computer is a programmable electronic device that can store, retrieve, and process

4、dataData and instructions to manipulate the data are logically the same and can be stored in the same placeStore, retrieve, and process are actions that the computer can perform on data Machine Language Machine language The instructions built into the hardware of a particular computer Initially, hum

5、ans had no choice but to write programs in machine language because other programming languages had not yet been invented Machine LanguageEvery processor type has its own set of specific machine instructionsThe relationship between the processor and the instructions it can carry out is completely in

6、tegrated Each machine-language instruction does only one very low-level task Pep/7: A Virtual Computer Virtual computer A hypothetical machine designed to contain the important features of real computers that we wantto illustratePep/7designed by Stanley Warfordhas 32 machine-language instructionsWe

7、are only going to examine a fewof these instructionsFeatures in Pep/7The memory unit is made up of 4,096bytes Pep/7 Registers/Status Bits CoveredThe program counter(PC (contains the addressof the next instruction to be executedThe instruction register(IR(contains a copy of the instruction being exec

8、utedThe accumulator(A registerStatus bit N(1if A register is negative;0otherwiseStatus bit Z(1if the A register is0;and0otherwiseFeatures in Pep/7 Figure 7.1Pep/7s architectureInstruction FormatThere are two parts to an instruction The 8-bit instruction specifierAnd optionally, the 16-bit operand sp

9、ecifier Instruction Format The instruction specifier is made up ofseveral sectionsThe operation codeThe register specifierThe addressing-mode specifier Instruction FormatThe operation code specifies which instruction is to be carried outThe 1-bit register specifier is 0 if register A (the accumulato

10、r is involved, which is the case in this chapter.The 2-bit addressing-mode specifier says how to interpret the operand part of the instructionInstruction Format Some Sample Instructions Figure 7.3 Subset of Pep/7 instructionsA Program Example Lets write "Hello" on the screen Pep/7 Simulato

11、r A program that behaves just like the Pep/7 virtual machine behavesTo run a program, we enter the hexadecimal code, byte by byte with blanks between each Assembly Language Assembly languages A language thatuses mnemonic codes to representmachine-language instructionsThe programmer uses these alphan

12、umeric codes in place of binary digitsA program called an assembler reads each of the instructions in mnemonic form andtranslates it into the machine-languageequivalentPep/7 Assembly Language Figure 7.5Assembly Process A New Program 7-21 Our Completed Program 7-22 Status Bits Status bits allow a pro

13、gram to make a choice. BRLT Set the PC to the operand, if N is 1 (A register is less than zero BREQ Set the PC to operand, if Z is 1 (A register is equal to zero 7-23 Testing Test plan A document that specifies how many times and with what data the program must be run in order to thoroughly test the program A cod

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論