80X86-Instructions--Advanced-Microcomputer-Systems80x86指令-先进的微机系统课件.ppt
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《80X86-Instructions--Advanced-Microcomputer-Systems80x86指令-先进的微机系统课件.ppt》由用户(晟晟文业)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 80 X86 Instructions Advanced Microcomputer Systems80x86 指令 先进 微机 系统 课件
- 资源描述:
-
1、 68HC11 instruction set A quick look at the programming procedure The programmers model Instruction types and formats Addressing modes A tour of the instruction set Readings for instruction set:o Spasov,Chap.2 and Appendix Ao HC11 Reference Manual,Appendix Ao HC11 Programming Reference GuideSEGMENT
2、code Soon youll write programs in assembly language for the HC11 Heres a super simple example program:;Super simple test program ORG$B600TLOOP:INCAINCB JMP TLOOP Before the HC11 can run this program,o The assembly-language code needs to be converted to machine language,and the machine-language code
3、needs to be transferred to the HC11s memoryCont.Here is the machine code that results from the assembly-lang.program given aboveAddressContents$B60001001100$B601 01011100$B602 01111110$B603 10110110$B604 00000000Cont.Cont.try1.asm is a source fileoIt is created by you,the programmer,using a text edi
4、tor on your PCoFormat:HC11 assembly language(ASCII text)try1.lst is a listing fileoIt is created by AS11.exe,the assembler/linker that runs on your PCo(Youll probably run AS11.exe from DevHC11.exe)oIts purpose of the file is to help you debug the program Format:ASCII text try1.s19 is an object fileo
5、It is created by AS11.exe,the assembler/linkeroIts purpose is to specify what bytes should be downloaded to the HC11,and to what locations in HC11 memoryoFormat:Motorola S-record(ASCII text)oSometimes this is called a hex file The object file is converted to executable machine codeoThe machine code
6、is created by DevHC11.exe,the development environment that runs on your PCCont.oIts purpose is to provide instructions and data to the HC11 Format:HC11 machine language(binary)oSometimes this is called the binary codeoThe machine code is transferred to the HC11 through the coordinated efforts of Dev
7、HC11.exe(running on your PC)and the Buffalo monitor program(running on the HC11)What features of the processor are most important to the assembly-language programmer?oRegister setoMemory organizationoInstruction setoAddressing modes Here is the register set(again):Cont.Cont.AccumulatorsoA:8-bit gene
8、ral purpose accumulatoroB:8-bit general purpose accumulatoroD:Double accumulator(concatenation of A and B for 16-bit operations)Most operations can be done using either accumulator A or B Index registersoX:16-bit index registeroY:16-bit index register X and Y are used for indexed addressingX is pref
9、erred,usually,because addressing with Y is slower and takes 1 extra byte of object code than with XOperations on index registers:oSimple operations(INC,DEC,and ADD from B)can be performed oMore complex operations are done by exchanging the index register and the D register,doing some computation,and
10、 then exchanging the values again oX or Y is often loaded with the base address of the I/O register address space($1000)Cont.SP:16-bit stack pointer Stack may be anywhere in the 64 Kbyte address space The stack grows downward in memory(i.e.,a push decrements SP)Cont.Cont PC:16-bit Program Counter CC
11、R:-bit Condition Code RegisteroH,N,Z,V,C:rithmetic status bits N:Negative result Z:Zero result V:Overflow result C:Carry out from operation H:Carry from low nibble(4 bits)of accumulatoroS:Stop bit disabled =1 disables STOP instruction=1 after processor resetoI:Interrupt mask=1 masks all maskable int
12、errupts(not XIRQ)=1 after processor reseto X:XIRQ interrupt mask=1 masks XIRQ=1 after processor reset(must be cleared just after reset)The instruction set specifies the kinds of data transfers and transformations that can occur in the machine Instructions can be grouped into 5 broad categoriesoData
13、transfers:instructions that move data to and between registersoLogical:instructions that perform logic operations on data-AND,OR,etc.oArithmetic:addition,subtraction,increment,etc.oFlow control:instructions that change the sequence of execution of a program-conditional and unconditional branches,sta
14、ck operations,etc.oInput/Output operationsCont.An instruction generally consists of an opcode and some operand(s)HC11 instructions are of different lengths(1 to 5 bytes)The instruction set is summarized in Table A.1 of the text,Appendix A of the HC11 Reference Manual,and M68HC11 E Series Programming
15、 Reference Guide oLists instruction mnemonic,brief description of the operation,addressing modes available,machine code format of the instruction,timing information,and effect on condition code registersCont.Cont.Opcode constructionoIn general,an n-bit opcode is capable of specifying any one of 2n i
16、nstructions oWith 8-bit opcodes,256 distinct instructions are possibleo68HC11 has more than 300 actual instructions 145 basic instructions plus“addressing variations”1 or 2 bytes of storage specify the opcode!1-byte opcodesoMost opcodes use just 1 byteoDownward compatible with 6801Cont.2-byte opcode
17、soMost 2-byte instructions deal with register Y,which was not present in the 6801 processor oIt takes longer to fetch and execute 2-byte opcodesoNew instructions use a pre-byte,which signals that another opcode byte follows:$18,$1A,or$CDEx.INX$08 INY$18$08Cont.Instruction formatoAn instruction is ma
18、de up of an opcode and a set of operands Opcode may be one or two bytes Instructions may use 0,1,2,or 3 operandsOperands may be 1 or 2 bytesoInstruction lengths range from 1 to 5 bytes oExample(assume this is stored at address$E000):LDAA#$FF;load ACCA with the;Value$FFMachine code:$E000$86$E001$FFCo
19、nt.Fetch/Execute operation:LDAA#$FFFirst clock cycleCont.Fetch/Execute operation:LDAA#$FFSecond clock cycle How does the instruction specify the location of data?The HC11 supports 5 different addressing modesoInherent Addressing Operands are specified implicitly in the opcode itself Operands are con
20、tained in the registers instead of memory Instruction length:or 2 bytes Examples:Register increment,clearsCLRARegister shift operationsASLARegister additionsABACont.How does the instruction specify the location of data?The HC11 supports 5 different addressing modesoInherent Addressing Operands are s
21、pecified implicitly in the opcode itself Operands are contained in the registers instead of memory Instruction length:or 2 bytes Examples:Register increment,clearsCLRARegister shift operationsASLARegister additionsABACont.Immediate addressing One operand is included as part of the instruction word O
22、ther operand(if needed)comes from an implied register Instruction length:2-4 bytes Specified operand is a constant and cannot be altered at run time Mode is denoted by a#before the operand value Example:LDAA#$05$86$05Cont.Direct addressing The operand included in the instruction word is a memory add
23、ress,specifying where the data is located Second operand is an implied register Instruction length:2-4 bytes Since an address is specified,the data value itself can be changed during program executionAddress is a constant Address included in the instruction word is only 1 byteDirect addressing can o
24、nly be used to reference locations$0000-$00FF-256 locationsExample:LDAA 05$96$05Cont.Extended addressing Same as direct addressing,but with 2 bytes of address-the full range of addresses can be specified($0000 to$FFFF)Instruction length:3 or 4 bytes Example:LDAA$0005$B6$00$05 Why have both modes?Con
25、t.Indexed addressingThe effective address of the data in memory is computed as the sum of the value contained in an index register(X or Y)and an offset(contained in the instruction word)The offset is a 1-byte unsigned quantity Useful for table and array accessEg.DAA$56,X$A6 56Cont.1.Relative address
展开阅读全文
链接地址:https://www.163wenku.com/p-4290331.html