DOC PREVIEW
UNCC ECGR 4101 - Instruction Set Architecture

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Mitsubishi M16C Instruction Set ArchitectureTodayReading for Next WeekSimple Memory OrganizationSlide 5Memory OrganizationEndiannessBig Endian-What does it look like?Little Endian -What does it look like?Big Endian vs. Little EndianData Formats for the M30626Review of the M30626 ArchitectureGeneral Memory MapMemory Map for QSK62P Plus microcontrollerM16C RegistersSpecial RegistersAddressing ModesAddress Register IndirectAddress Register RelativeStatic Base Pointer RelativeFrame Base/Stack Pointer RelativeInstruction ClassesData Transfer InstructionsArithmetic and Logic InstructionsControl TransferFlag Register and ConditionsConditional JumpsOther Instructions2-1Embedded SystemsMitsubishi M16C Instruction Set ArchitectureLecture 2Embedded Systems 2-2TodayLearn about Mitsubishi (Renesas) processor–Lecture covers ISA, derived from Assembler Language Programming Manual (M16C_Assembler.pdf MALPM Ch. 1, 2)•Registers: General Purpose, Control•Instruction Set •Addressing Modes•Memory MapEmbedded Systems 2-3Reading for Next WeekSoftware Manual (M16C_Software_Manual.pdf): pp.1-32–Use chapter 3 as a reference. You are responsible for this material – not memorizing it, but instead being able to figure out what an instruction does, or finding an instruction to do somethingData Sheet (M16C62_Hardware_Manual_rev1.20.pdf)–pp. 1-27Embedded Systems 2-4Simple Memory Organizationk x m array of stored bits (k is usually 2n)Address–unique (n-bit) identifier of locationContents–m-bit value stored in locationBasic Operations:LOAD–read a value from a memory locationSTORE–write a value to a memory location•••00000001001000110100010101101101111011110010110110100010Embedded SystemsSimple Memory OrganizationViewed as a large, single-dimensional arrayA memory address is an index into the array"Byte addressing" means that the index points to a byte of memory0123456...8 bits of data8 bits of data8 bits of data8 bits of data8 bits of data8 bits of data8 bits of dataEmbedded SystemsMemory OrganizationBytes are nice, but most data items use larger "words"–For M30626, a word is 16 bits or 2 bytes.216 bytes with byte addresses from 0, 1, 2 to 216-1215 words with byte addresses 0, 2, 4, ... 216-20246...16 bits of data16 bits of data16 bits of data16 bits of data(registers also hold 16 bits of data)Embedded SystemsEndiannessBig endian: most significant byte is stored at the lowest byte addressEx: 68000, PowerPC, Sun SPARC12345678ABCDEF0101234567BOTH store:word 12345678 is atlocation 0,word ABCDEF01 is atlocation 4Little endian: least significant byte is stored at the lowest addressEx: x86, DEC VAX, Alpha12345678ABCDEF0101234567Most of the time we will avoid this issue in class by only loading/storing words or loading/storing bytesIf two processors with different conventions use a local area network, a disk drive, etc., YOU need to pay attention to endiannessEmbedded SystemsBig Endian-What does it look like?Imagine you have the following hexadecimal values:–0x11 22 33 44 –0x55 66 77 88–0xAA BB CC DD –0xEE FF 00 99–0x01 23 45 67 . . . . . .And we put them in memory, starting at memory address 0x10000000. What would it look like? 0x1000 0000 11 22 33 44 Shown0x1000 0004 55 66 77 88 as0x1000 0008 AA BB CC DD ‘‘Big0x1000 000C EE FF 00 99 Endian’’0x1000 0010 01 23 45 670x1000 0014Embedded SystemsLittle Endian -What does it look like?Imagine you have the following hexadecimal values:–0x11 22 33 44 –0x55 66 77 88–0xAA BB CC DD –0xEE FF 00 99–0x01 23 45 67 And we put them in memory, starting at memory address 0x10000000. What would it look like? 0x1000 0000 44 33 22 11 Shown0x1000 0004 88 77 66 55 as0x1000 0008 DD CC BB AA ‘‘Little0x1000 000C 99 00 FF EE Endian’’0x1000 0010 67 45 23 010x1000 0014Embedded SystemsBig Endian vs. Little Endian0x1000 0000 11 22 33 44 Shown0x1000 0004 55 66 77 88 as0x1000 0008 AA BB CC DD ‘‘Big0x1000 000C EE FF 00 99 Endian’’0x1000 0010 01 23 45 670x1000 0000 44 33 22 11 Shown0x1000 0004 88 77 66 55 as0x1000 0008 DD CC BB AA ‘‘Little0x1000 000C 99 00 FF EE Endian’’0x1000 0010 67 45 23 01Embedded Systems 2-11Data Formats for the M30626Byte–8 bits–signed & unsigned–.B suffix for instructionWord–16 bits–signed & unsigned–.W suffixAddress & longword–Limited to specific instructionsIs the M30626 big or little endian?Embedded Systems 2-12Review of the M30626 ArchitectureMicrocontroller has:–General Purpose Registers–RAM–Flash–EEPROM–Digital Ports–Analog Ports–Timers–Oscillator–DMA Controller–Reliability and safetyEmbedded Systems 2-13General Memory MapEmbedded Systems 2-14Memory Map for QSK62P Plus microcontrollerEmbedded Systems 2-15M16C Registers 4 16-bit data registers R0-R3–Can also access high and low bytes of R0 and R1: R0H, R0L–Can also access pairs of registers as 32-bit registers: R2R0, R3R12 16-bit address registers A0 & A1–Can also access pair of registers as 32-bit register: A1A0Embedded Systems 2-16Special RegistersSP: Stack Pointer – for accessing call stack–USP: User code–ISP: Interrupt codeFB: Frame Base – for accessing frame on call stack SB: Static BaseINTB: Interrupt table pointerEmbedded Systems 2-17Addressing ModesSee Ch. 2 of Software Manual for detailsImmediate – provide the 8, 16 or 20 bit valueRegister Direct – provide the name of the register–MOV.B #-29, R0HAbsolute – provide the address of the operand–MOV.W R3, 213AH–MOV.W 81A8H, R3 81A6H0017H81A8H22AAH81AAH4413HR13210HR26001HR30150HR02119H22AAH22AAHAEmbedded Systems 2-18 Address Register IndirectAddress Register Indirect – provide the name of the address register which points to the operand–MOV.W [A0], R3Constraints–Can use address registers A0 and A181A6H0017H81A8H22AAH81AAH4413HR13210HR26001HR30150HR02119H0017H0017HA081A6HA11116HAEmbedded Systems 2-19Address Register RelativeAddress Register Relative – as with ARI, but also provide a displacement (offset) from the address register–MOV.W 4[A1], R3Constraints–Can use address registers A0 or A1–Displacement can range from 0 to FFFFH1110H0017H1112H22AAH1114H4413HR13210HR26001HR30150HR02119H4413H4413HA081A6HA11110H+4AEmbedded Systems 2-20Static Base Pointer Relative – as with ARR, but use the SB as the base– MOV.W 2[SB], R3Constraints–Can only use SB–Displacement can range from 0 to FFFFHStatic Base Pointer


View Full Document

UNCC ECGR 4101 - Instruction Set Architecture

Documents in this Course
Load more
Download Instruction Set Architecture
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Instruction Set Architecture and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Instruction Set Architecture 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?