What is an Addressing Mode?

Size: px
Start display at page:

Download "What is an Addressing Mode?"

Transcription

1 Addressing Modes 1

2 2

3 What is an Addressing Mode? An addressing mode is a way in which an operand is specified in an instruction. There are different ways in which an operand may be specified in an instruction. An operand may be specified using the immediate, direct, extended, indexed, and inherent modes. Different addressing modes are required in programs for processing implied numbers, constants, variables, and arrays. 3

4 IMMEDIATE ADDRESSING MODE Example: ADDA IMM Example instruction: ADDA #$33 The addressing mode IMM is identified and distinguished from the other addressing modes by the # symbol. This instruction adds the 8-bit number $33 to ACCA. In RTL: A A + $33 The previous value of ACCA is overwritten by the result of the addition, on purpose. For example, if ACCA = $12 initially, then, after the instruction ADDA $33 executes, ACCA will have $45. ADDA #$33 Can also be written as: ADDA #51 # Signifies IMMediate addressing mode (IMM) $ Signifies Hexadecimal number Signifies Decimal number 4

5 PC MAR MEMORY OCR ADD B 1 8B ACCA IMM A + 33 A 0102 The first mop fetches the opcode. The opcode 8B conveys the following information to the CCU, that: 1. It must do an ADD operation 2. The 1 st operand is ACCA 3. The 2 nd operand is specified using the IMM addressing mode. The 2 nd mop performs the addition It gets the 2 nd operand by reading the 2 nd byte of the instruction It adds this byte to the present contents of ACCA It stores the result in ACCA, thus overwriting the previous contents of ACCA. 5

6 φ1 φ2 PC MAR MEMORY OCR B 1 8B ADD ACCA IMM A + 33 A

7 GENERAL FORMAT (TEMPLATE) ADDA IMMEDIATE PC MAR MEMORY OCR B 1 8B ADD ACCA IMM A + A 0102 Location Machine Code B Opcode of Next Instruction Note that for the general format, the actual number to be loaded into ACCA is not specified, but a symbol ( ) for it is specified. : 8-bit Immediate 2 nd Operand. Represents 2 Hex Symbols. Represents any 8-bit Data. represents one Hex symbol, i.e., 4-bits. : immediate, immediate 7

8 ADDA IMM 68HC11 Data Sheet Information (From course web site) ADDA IMM means Add memory (M) to ACCA, and store the result in ACCA: A + M A The memory term in Add memory to ACCA refers to the 2 nd byte (ii) of the instruction: 8B ii The 1 st operand is implied to be ACCA. The 2 nd operand is actually stored in the instruction, so when the μp fetches the specification of the 2 nd operand, the 2 nd operand is available immediately, hence the name IMM. 8

9 ADDA IMM 68HC11 Data Sheet Information (From course web site) The template of the complete instruction is encoded as: 8B ii Note that when you provide the machine code of an instruction, you will replace the with the actual value you want to load into ACCA. It takes 2 clock cycles to execute, and two bytes to store. The NZVC bits in the CCR are updated, as indicated by the delta symbol, which means that these bit will either be set or clear, depending on the result of the instruction. 9

10 IMM ADDRESSING MODE 2 nd OPERAND IS A CONSTANT A program (list of instructions) is stored in non-volatile memory (e.g., ROM, FLASH, or a hard disk). In the IMM addressing mode, the actual value of the 2 nd operand is stored in the instruction itself. Location Machine Code B 0101 ii 0102 Next Opcode This means that the 2 nd operand cannot be changed once the program is written into ROM. This is very clear in the case when the program is stored and run from a ROM. FLASH memories are considered ROM from the point of view of non-volatililty. Typically programs are copied from non-volatile memory (e.g., ROM, FLASH, and hard disk) to RAM because RAM has faster access times and programs run faster when they run from RAM. But, programs are never copied back to non-volatile storage. Thus, the 2 nd operand must be treated as a constant, that cannot be changed in the program stored in ROM. 10

11 IMM Mode Summary IMM General Form: ADDA #$ii From: Instruction set Manual General Assembly Language Form: For any addressing Mode Example Assembly Language ADDA #$33 # Signifies IMMediate addressing mode (IMM), and # distinguishes IMM mode from other modes. A A + $33 = A + $33 Example Machine Code 8B 33 $ Signifies Hexadecimal number General Machine Code Memory Address Data 00FF B ii 11

12 The IMM addressing mode is used when we know the value of the number we want to operate on and the value will not change, i.e., the number is a constant. The IMM addressing mode cannot be used when we require to add, subtract, or generally process variables. If we need to process variables, then we can use the Direct, Extended, or Indexed addressing modes. These addressing mode permit processing of variables. 12

13 EXTENDED ADDRESSING MODE Example: ADDA EXT Example instruction: ADDA $0133 The addressing mode EXT is identified and distinguished from the other addressing modes by the presence of a 16-bit address of the 2 nd operand, and the absence of the # symbol to distinguish it from the IMM mode. This adds the contents of memory location $0133 to ACCA. In RTL: A A + ($0133) The previous value of ACCA is overwritten by the result of the addition, on purpose. For example, if ACCA = $12 initially, and ($0133) = $10, then, after the instruction ADDA $0133 executes, ACCA will have $22. ADDA $0133 The absence of the # symbol, together with a 16-bit address, signifies EXTended addressing mode (EXT) 13

14 ADDA EXTENDED ADDA EXT (Ex: ADDA $0133) PC MAR MEMORY 1 BB OCR 1 BB ADD ACCA EXT Location Machine Code 0100 BB vv 4 A + vv Α ACC A Next Opcode 0133 Temporary holding register 4 14

15 TIMING: EXTENDED ADDRESSING MODE EXAMPLE: ADDA $0133 φ1 φ2 PC MAR MEMORY 1 BB OCR 1 BB ADD ACCA EXT vv 4 A + vv Α ACC A 0133 Temporary holding register 4 15

16 ADDA EXT Memory Access Since, the address of the 2 nd operand is specified by 16-bits, the EXT mode of addressing can access the entire memory space: 2 16 = 64K Central Processing Unit (CPU, i.e., μp) Memory: RAM, ROM, FLASH, etc, Input/Output (I/O) Controllers ABUS CBUS DBUS 64K x 8 Memory Space FE 00FF FE 01FF FEFF FF00 FF01 FFFE FFFF Entire Memory Space 16

17 ADDA EXT 68HC11 Data Sheet Information (From course web site) ADDA EXT is a general description. It means add memory to ACCA, and store the result in ACCA: A + M A memory refers to the contents of the address of the 2 nd operand. The address of the 2 nd operand is part of the instruction: BB hh ll The address of the 2 nd operand is specified by 16-bits. The complete instruction is encoded as: BB hh ll It takes 4 clock cycles to execute. The NZVC bits in the CCR are updated, as indicated by the delta symbol. 17

18 From: Instruction set Manual General Form: ADDA $hhll Assembly language Example Absence of # and presence of 16-bit address signifies EXTended addressing mode (EXT) ADDA $0133 $ Signifies Hexadecimal number A A + ($0133) = A + vv Machine code Example BB Template Memory Address Data 00FF 0100 BB vv hh ll 18

19 EXTENDED ADDRESSING MODE The EXT addressing mode permits processing of variables in any location of the memory space, since the 2 nd operand is specified by a 16-bit address. Sometimes, variables are stored in the 1 st page of memory, which requires only an 8-bit address. The DIRect addressing mode is conceptually the same as the EXT mode, except that the address of the 2 nd operand is specified using only 8-bits. The DIRect addressing mode can be used to access variables in the 1 st page of memory, only. The DIR addressing is more efficient than the EXT mode because it requires less space to store, and it runs faster FE 00FF FE 01FF FEFF FF00 FF01 FFFE FFFF 1 st Page 2 nd Page 256 th Page 19

20 DIRECT ADDRESSING MODE Example: ADDA DIR Example instruction: ADDA $33 The addressing mode DIR is identified and distinguished from the other addressing modes by the presence of an 8-bit address of the 2 nd operand, and the absence of the # symbol to distinguish it from the IMM mode. This adds the contents of memory location $0033 to ACCA. In RTL: A A + ($0033) The previous value of ACCA is overwritten by the result of the addition. For example, if ACCA = $12 and ($0033) = $10 initially, then, after the instruction ADDA $33 executes, ACCA will have $22. ADDA $33 The absence of the # symbol, together with an 8-bit address, signifies DIRect addressing mode (DIR) 20

21 ADDA DIRECT CYCLES Example: ADDA $33 PC MAR MEMORY B OCR 1 9B ADD ACCA DIR vv 3 A + vv Α ACC A Temporary holding register The 1 st mop fetches the opcode. The opcode 9B conveys the following information to the CCU, that: 1. It must do an ADD operation 2. The 1 st operand is ACCA 3. The 2 nd operand is specified by the DIR addressing mode. 21

22 ADDA DIRECT CYCLES Example: ADDA $33 PC MAR MEMORY B OCR 1 9B ADD ACCA DIR vv 3 A + vv Α ACC A Temporary holding register The 2 nd mop reads the 8-bit address (of the 2 nd operand). The 8-bit address is placed into the low byte of the THR The high byte of the THR is set to zero. Thus, the THR has generated the address of the 2 nd operand. The 3 rd mop reads the 2 nd operand (vv) from memory using the THR as the address. The 2 nd operand is added to the current contents of ACCA. 22

23 ADDA DIRECT ADDA DIR PC MAR MEMORY 1 9B dd 33 OCR 1 9B ADD ACCA DIR dd 3 vv 3 A + vv Α ACC A dd Temporary holding register Location Machine Code B 0101 dd 0102 Opcode of Next Instruction dd: 8-bit Address of 2 nd Operand dd: Represents 2 Hex Symbols dd: direct direct dd: Any 8-bit direct address 23

24 TIMING: DIRECT ADDRESSING MODE EXAMPLE: ADDA $33 φ1 φ2 PC MAR MEMORY B OCR 1 9B ADD ACCA DIR vv 3 A + vv Α ACC A Temporary holding register Fetch and execute steps for ADDA direct. Note that vv is an 8-bit variable. Note also that the address of vv is constant since it ($33) is stored in the instruction. 24

25 ADDA DIR 68HC11 Data Sheet Information (From course web site) ADDA DIR is a general description. It means add memory to ACCA, and store the result in ACCA: A + M A memory refers to the contents of the address of the 2 nd operand. The address of the 2 nd operand is stored in the instruction, as dd: 9B dd Unlike the default address size of 16-bits, the address of the 2 nd operand is specified by 8- bits. The CCU automatically converts the 8-bit address to 16-bits by prepending zeroes: 00dd. The complete instruction is encoded as: 9B dd It takes 3 clock cycles to execute. The NZVC bits in the CCR are updated, as indicated by the delta symbol. 25

26 DIRect Addressing Mode Limitation Memory Access Limitation Since, the address of the 2 nd operand is specified by 8-bits (dd); And, since the CCU automatically converts the 8- bit address to 16-bits by prepending zeroes, 00dd; The, the DIR addressing mode can access only the 1 st page of memory FE 00FF FE 01FF FEFF FF00 FF01 FFFE FFFF Memory Space 1 st Page 2 nd Page 256 th Page 26

27 From: Instruction set Manual General Form: ADDA $dd Assembly language Example Absence of # and 8- bit address signifies DIRect addressing mode (DIR). ADDA $33 $ Signifies Hexadecimal number. A A + ($0033) = A + vv Machine code Example 9B 33 Memory Address Data 0033 vv B dd 27

28 Location ADDA DIR & EXT ADDRESS OF 2 nd OPERAND IS A CONSTANT B 0101 dd Machine Code 0102 Next Opcode A program is stored in non-volatile memory (e.g., FLASH). In the DIR and EXT addressing modes, the address of the 2 nd operand is stored in the instruction itself. This means that the address of the 2 nd operand cannot be changed once the program is written into ROM (Read Only Memory). Thus, the address of the 2 nd operand is a constant. Location Machine Code 0100 BB 0101 hh 0102 ll 0103 Next Opcode Note: programs are rarely executed in ROM. Typically, a program is copied from a ROM to RAM, and then run in RAM, because RAM memories are much faster than ROM memories. However, our assertion that instructions cannot be changed (and so the 2 nd operand address cannot be changed) still holds. 28

29 COMPARISON: ADDA DIR & EXT NUMBER OF STORAGE BYTES AND CLOCK CYCLES Location B 0101 dd Machine Code 0102 Next Opcode ADDA DIR ADDA EXT Accumulator DIR instructions require 2 bytes to store 3 cycles to execute Can access only the 1 st page of the memory space. Location Machine Code 0100 BB 0101 hh 0102 ll 0103 Next Opcode Accumulator EXT instructions require 3 bytes to store 4 cycles to execute Can access the entire memory space. 29

30 PROCESSING LISTS OR ARRAYS The DIR and EXT addressing modes cannot be used when we require to change the address of variables. This is because the address of the variable is stored inside the instruction, and the instruction cannot be changed. For example, to process a list of numbers, stored in memory in sequential order, the address of the numbers needs to be incremented. In this case, we can use the INDexed addressing mode. This addressing mode permits changing the effective address of the 2 nd operand. 30

31 Indexed Addressing Mode General Form, Accumulator A Indexed X Addressing Mode: ADDA $ff,x ADDA $ff,x EA is formed by: X + 00ff $ Signifies offset is specified by a Hexadecimal number ff is the 8-bit unsigned offset $ff,x signifies INDexed addressing mode (IND). X Signifies using the Indexed X addressing mode (other is Y). The address of the 2 nd operand is also called the effective address. The effective address is computed (generated) by: Value of the index register X + the unsigned 16-bit extension of the offset. For example, if X=1000, (1080) =, then, the ADDA $80,X instruction: Effective Address 31

32 Indexed Addressing Mode Effective Address is a Variable The address of the 2 nd operand is a variable, since the value of index register X can be changed, through several different instructions. Examples of instructions that change the value of index register X: LDX #$BEEF //Load the number $BEEF into X. INX //Increment X by one. DEX //Decrement X by one. The ADDA $80,X instruction: Effective Address Note that the offset cannot be changed, since it is part of the instruction. 32

33 CYCLES of ADDA IND,X Example: ADDA $80,X PC MAR MEMORY 1 AB vv 4 Offset OCR 1 AB THR 0080 A + vv Α ACC A ADD ACCA INDEXED Location Machine Code 0100 AB Next Opcode Index Register X Effective Address (EA) 0180 THR For the above assume X=$0100, currently. The animation software shows how the effective address may be computed in the hardware. When explaining the timing, instead of using a specific example offset (i.e., $80) as in the above, we typically replace the number with a symbol, which in this case we use the symbol to denote the offset. 33

34 PC MAR AB EFAD Index Register X ADDA IND,X ADDA $ff,x MEMORY ff vv 4 Offset 0100 OCR 1 AB THR 0080 ff + 3 A + vv Α ACC A ADD ACCA INDEXED Effective Address (EA) EFAD 0180 THR Location Machine Code 0100 AB 0101 ff 0102 Next Opcode I am not specifying the contents of X, nor I am specifying the actual offset. ff: Symbol for 8-bit unsigned offset ff: Represents 2 Hex symbols ff: offset offset 00ff: 16-bit Unsigned Extension of ff EFAD: 16-bit Sum of THR + IX EFAD: Effective Address Note: EFAD means EFfective ADdress 34

35 TIMING: INDEXED ADDRESSING MODE EXAMPLE: ADDA $ff,x φ1 φ2 PC MAR MEMORY 1 AB ff EFAD OCR 1 AB ADD ACCA INDEXED vv 4 Offset THR 0080 ff A + vv Α ACC A Index Register X Effective Address (EA) EFAD 0180 THR 35

36 ADDA IND 68HC11 Data Sheet Information (From course web site) ADDA IND is a general description. It means add memory to ACCA, and store result in ACCA: A+M A memory refers to the contents of the effective address of the 2 nd operand. The effective address of the 2 nd operand is formed by adding the unsigned extension of the offset to the current value of the index register. AB ff The offset is specified by 8-bits: it is interpreted as unsigned. The complete instruction is encoded as: AB ff It takes 4 clock cycles to execute. The NZVC bits in the CCR are updated accordingly, as indicated by the delta symbol. 36

37 From: Instruction set Manual General Form: ADDA $ff,x Assembly language Example $ff,x signifies INDex X addressing mode (IND X). ADDA $01,X $ Signifies offset represented as Hexadecimal number. A A + ($1001) = A + vv Machine code Offset Example AB 01 Index register X. Assume X = 1000 currently. Memory Address Data 00FF 0100 AB vv ff 37

38 NON-MEMORY ACCESS INSTRUCTIONS Sometimes, it is required to make a register zero, increment a register, decrement a register, complement a register, negate a register, or transfer one register to another. In these cases, there are special instructions to do just that. For example: to make ACCA=0, we can use: CLRA These types of instructions use the Inherent (or Implied) addressing mode. The name Inherent or Implied was chosen because the 2 nd operand is implied by the opcode, and the 2 nd operand does not need to be specified in the instruction. 38

39 INHERENT ADDRESSING MODE Example: CLRA INH (CLRA) PC MAR MEMORY 1 4F OCR 1 4F CLEAR ACCA 00 2 $00 Α ACC A CLRA No Specification of operand means this instruction uses the INHerent addressing mode (INH) A 0 Location Machine Code F 0101 Next Opcode 39

40 INH Mode Example: CLRA Manual Assembly CLRA No Specification of operand implies INHerent addressing mode (INH) Memory Address Data 00FF F 0101 A 0 40

41 TIMING: INHERENT ADDRESSING MODE EXAMPLE: CLRA φ1 φ2 PC MAR MEMORY OCR F 1 4F LOAD ACCA A ACCA 41

42 CLRA INH 68HC11 μp Peculiarities Clearly, setting N=0 and Z=1 makes a lot of sense. But, why is the V set to zero? Moreover, why is the C set to zero? The CLRA instruction does not seem to be an arithmetic instruction. It is more like a load instruction: LDAA #$00. Sometimes, the reason for doing this is a Manufacturer s design choice. Another possible reason could be that when you clear A, you are clearing an accumulator, and so, it is like resetting the accumulation of arithmetic results; so, maybe we should reset the C and V bits as well. 42

43 EXAMPLES USES OF ADDRESSING MODES Now, let s look at some examples. 43

44 ACCUMULATOR LOAD INSTRUCTIONS INSTRUCTION COMMENT RTL LDAA #$94 This loads the number $94 into ACCA. ACCA $94 LDAA $94 This loads the data located at $0094 into ACCA. ACCA ($0094) = $13 LDAA $0094 This loads ACCA with the data located at $0094. ACCA ($0094) = $13 LDAA $01,X This loads ACCA with the data located at ($ X). Assuming X = 03FF, then, this loads the data located at 0400 into ACCA. ACCA (0001+X). ACCA (03FF+0001). ACCA 01. ADDRESS CONTENTS 0093 AB EF ADDRESS CONTENTS FE 44

45 LOAD INSTRUCTIONS QUESTIONS 1. Write down two different instructions that load accumulator B with the contents of memory location $1234. You may assume a value for X. 2. Write down three different instructions that load accumulator B with the data located at $0034. You may assume a value for X. 3. Write down four different instructions that load the number 34 into Accumulator B. You may assume a value for X and make assumptions regarding contents of memory. 4. Describe the main purpose of each one of the micro-instructions for each instruction listed above. 5. Examine each micro-instruction for each instruction above. Are there any duplicate micro-instructions? If so, what are they? 45

46 DUPLICATE MOPS OF LDAA IMM, DIR, EXT, IND MOP LDAA IMM LDAA DIR LDAA EXT LDAA IND 1 (PC) OCR (PC) OCR (PC) OCR (PC) OCR 2 (PC) A (PC) THR LB, 00 THR HB (PC) THR HB (PC) THR LB, 00 THR HB 3 (THR) A (PC) THR LB X+ THR THR 4 (THR) A (THR) A 46

47 STORE INSTRUCTION QUESTIONS 6. Write down two instructions, each of which stores the data in accumulator A to location $1234. You may assume a value for X. 7. Write down three different instructions, each of which stores the data in accumulator A to location $0012. You may assume a value for X. 8. Describe the main purpose of each one of the microinstructions for each instruction listed above. 9. Examine each micro-instruction for each instruction above. Are there any duplicate micro-instructions? If so, what are they? 47

48 ARITHMETIC AND LOGIC INSTRUCTION QUESTIONS 10.Write down an instruction that ADDs the data located at $0101 to Accumulator A. 11.Write down an instruction that ANDs the data located at $0101 to Accumulator A. 12.Describe the main purpose of each one of the microinstructions for each instruction listed above. 13.Examine each micro-instruction for each instruction above. Are there any duplicate micro-instructions? If so, what are they? How many micro-instructions are different? Which micro-instruction(s) is(are) different? 48

49 ADDRESSING MODE QUESTIONS 15.Identify all information in the following: XXXX #12 XXXX $12 XXXX $1234 XXXX $01,X XXX #1234 XXX #$1234 XXX $1234 XXX $00,X 49

50 Example: Writing a Simple Assembly Language Program Problem: count the number of occurrences of $42 in data memory from address $1000 to $2000, inclusive. Solution: Use ACCB to count the number. Use X as an memory address pointer clrb ldx #$1000 loop ldaa $0,X cmpa #$42 bne skip incb skip inx cpx #$2001 bne loop done bra done ACCA Address FFF Memory Data 7F

51 14.Write down a sequence of instructions that store the multiple byte word $ ABCDEF starting at location $0A00. Using the BIG ENDIAN format Using the LITTLE ENDIAN format 51

1. Memory Mapped Systems 2. Adding Unsigned Numbers

1. Memory Mapped Systems 2. Adding Unsigned Numbers 1 Memory Mapped Systems 2 Adding Unsigned Numbers 1 1 Memory Mapped Systems Our system uses a memory space Address bus is 16-bit locations Data bus is 8-bit 2 Adding Unsigned Numbers 2 Our system uses

More information

Exam I Review February 2017

Exam I Review February 2017 Exam I Review February 2017 Binary Number Representations Conversion of binary to hexadecimal and decimal. Convert binary number 1000 1101 to hexadecimal: Make groups of 4 bits to convert to hexadecimal,

More information

N bit is set if result of operation in negative (MSB = 1) Z bit is set if result of operation is zero (All bits = 0)

N bit is set if result of operation in negative (MSB = 1) Z bit is set if result of operation is zero (All bits = 0) Addition and Subtraction of Hexadecimal Numbers. Setting the C (Carry), V (Overflow), N (Negative) and Z (Zero) bits How the C, V, N and Z bits of the CCR are changed Condition Code Register Bits N, Z,

More information

Most of the HC12 s instructions access data in memory There are several ways for the HC12 to determine which address to access

Most of the HC12 s instructions access data in memory There are several ways for the HC12 to determine which address to access HC12 Addressing Modes Instruction coding and execution o Inherent, Extended, Direct, Immediate, Indexed, and Relative Modes o Summary of MC9S12 Addressing Modes o Using X and Y registers as pointers o

More information

UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING. Term Test #2 Solution ECE 3610 MICROPROCESSING SYSTEMS

UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING. Term Test #2 Solution ECE 3610 MICROPROCESSING SYSTEMS ECE 3610 Test 2 Solution 1 of 7 PRINT LAST NAME: STUDENT NUMBER PRINT FIRST NAME: UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING DATE: Feb. 28, 11; TIME: 6:00-8:00 P.M. Term Test

More information

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7 ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics Instructor: Professor Charles Ume LECTURE 7 Reading Assignments Reading assignments for this week and next

More information

Mark II Aiken Relay Calculator

Mark II Aiken Relay Calculator Introduction to Embedded Microcomputer Systems Lecture 6.1 Mark II Aiken Relay Calculator 2.12. Tutorial 2. Arithmetic and logical operations format descriptions examples h 8-bit unsigned hexadecimal $00

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Chapter 2 Microcontrollers Objectives Describe the difference between source code and machine code. Define opcode, operand, and address of an operand. Explain the purpose of

More information

A Simple MC9S12 Program

A Simple MC9S12 Program A Simple MC9S12 Program All programs and data must be placed in memory between address 0x1000 and 0x3BFF. For our programs we will put the first instruction at 0x2000, and the first data byte at 0x1000

More information

HC11 Instruction Set Architecture

HC11 Instruction Set Architecture HC11 Instruction Set Architecture High-level HC11 architecture Interrupt logic MEMORY Timer and counter M8601 CPU core Serial I/O A/D converter Port A Port B Port C Port D Port E CMPE12 Summer 2009 16-2

More information

HC11 Instruction Set Architecture

HC11 Instruction Set Architecture HC11 Instruction Set Architecture Summer 2008 High-level HC11 architecture Interrupt logic MEMORY Timer and counter M8601 CPU core Serial I/O A/D converter Port A Port B Port C Port D Port E CMPE12 Summer

More information

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers o How to disassemble an MC9S12 instruction sequence o Binary numbers are a code and represent what the programmer intends for the

More information

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers o How to disassemble an MC9S12 instruction sequence o Binary numbers are a code and represent what the programmer intends for the

More information

0b) [2] Can you name 2 people form technical support services (stockroom)?

0b) [2] Can you name 2 people form technical support services (stockroom)? ECE 372 1 st Midterm ECE 372 Midterm Exam Fall 2004 In this exam only pencil/pen are allowed. Please write your name on the front page. If you unstaple the papers write your name on the loose papers also.

More information

Chapter. Computer Architecture

Chapter. Computer Architecture Chapter 4 Computer Architecture Figure 4.1 Input device Central processing unit Main memory Output device Bus Data flow Control Figure 4.2 Central processing unit () Status bits ( ) Accumulator ( ) Index

More information

Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming

Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming o A simple Assembly Language Program o Assembling an Assembly Language Program o Simple 9S12 programs o Hex code generated

More information

Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming

Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming o A simple Assembly Language Program o Assembling an Assembly Language Program o Simple 9S12 programs o Hex code generated

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications Q. 3.9 of HW3 EE 37 Microcontroller Applications (a) (c) (b) (d) Midterm Review: Miller Chapter -3 -The Stuff That Might Be On the Exam D67 (e) (g) (h) CEC23 (i) (f) (j) (k) (l) (m) EE37/CC/Lecture-Review

More information

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram History of the Microprocessor ECE/CS 5780/6780: Embedded System Design Chris J. Myers Lecture 1: 68HC12 In 1968, Bob Noyce and Gordon Moore left Fairchild Semiconductor and formed Integrated Electronics

More information

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1 Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University What is Assembly Language? Assembly language is a programming language

More information

Chapter 7 Central Processor Unit (S08CPUV2)

Chapter 7 Central Processor Unit (S08CPUV2) Chapter 7 Central Processor Unit (S08CPUV2) 7.1 Introduction This section provides summary information about the registers, addressing modes, and instruction set of the CPU of the HCS08 Family. For a more

More information

MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes. Summary of HCS12 addressing modes ADDRESSING MODES

MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes. Summary of HCS12 addressing modes ADDRESSING MODES MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes o Review of Addressing Modes o Which branch instruction to use (signed vs unsigned) o Using X and Y registers

More information

538 Lecture Notes Week 1

538 Lecture Notes Week 1 538 Clowes Lecture Notes Week 1 (Sept. 6, 2017) 1/10 538 Lecture Notes Week 1 Announcements No labs this week. Labs begin the week of September 11, 2017. My email: kclowes@ryerson.ca Counselling hours:

More information

Introduction to Microcontrollers II

Introduction to Microcontrollers II Introduction to Microcontrollers II brset, brclr Indexed Addressing Example µp Laboratory #2 BUFFALO Assembling Code EECE 143 Digital Design Project Purpose: To allow students to design their own digital

More information

Lecture 6 Assembly Programming: Branch & Iteration

Lecture 6 Assembly Programming: Branch & Iteration CPE 390: Microprocessor Systems Spring 2018 Lecture 6 Assembly Programming: Branch & Iteration Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ

More information

Wednesday, September 13, Chapter 4

Wednesday, September 13, Chapter 4 Wednesday, September 13, 2017 Topics for today Introduction to Computer Systems Static overview Operation Cycle Introduction to Pep/9 Features of the system Operational cycle Program trace Categories of

More information

Wednesday, February 4, Chapter 4

Wednesday, February 4, Chapter 4 Wednesday, February 4, 2015 Topics for today Introduction to Computer Systems Static overview Operation Cycle Introduction to Pep/8 Features of the system Operational cycle Program trace Categories of

More information

ECE 372 Microcontroller Design Assembly Programming Arrays. ECE 372 Microcontroller Design Assembly Programming Arrays

ECE 372 Microcontroller Design Assembly Programming Arrays. ECE 372 Microcontroller Design Assembly Programming Arrays Assembly Programming Arrays Assembly Programming Arrays Array For Loop Example: unsigned short a[]; for(j=; j

More information

COE538 Lecture Notes Week 3 (Week of Sept 17, 2012)

COE538 Lecture Notes Week 3 (Week of Sept 17, 2012) COE538 Lecture Notes: Week 3 1 of 11 COE538 Lecture Notes Week 3 (Week of Sept 17, 2012) Announcements My lecture sections should now be on Blackboard. I've also created a discussion forum (and anonymous

More information

UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING. Term Test #1 ECE 3610 MICROPROCESSING SYSTEMS

UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING. Term Test #1 ECE 3610 MICROPROCESSING SYSTEMS ECE 3610 Test 1 1 of 8 PRINT LAST NAME: STUDENT NUMBER PRINT FIRST NAME: UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING DATE: Feb. 2015; TIME: 6:00-8:00 P.M. Term Test #1 ECE

More information

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ).

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ). AS12 Assembler Directives A Summary of 9S12 instructions Disassembly of 9S12 op codes Huang Section 1.8, Chapter 2 MC9S12 V1.5 Core User Guide Version 1.2, Section 12 o A labels is a name assigned the

More information

CS/ECE 5780/6780: Embedded System Design

CS/ECE 5780/6780: Embedded System Design CS/ECE 5780/6780: Embedded System Design John Regehr Lecture 2: 68HC12 Architecture & Lab 1 Introduction Duff s Device void foo (int x, int *y, int *z) { switch (x % 8) { case 0: do { *y++ = *z++; case

More information

Processor Design. ELEC 418 Advanced Digital Systems Dr. Ron Hayne

Processor Design. ELEC 418 Advanced Digital Systems Dr. Ron Hayne Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne 68HC11 Programming Model Motorola 68HC11 Microcomputer (CISC) 7 A 0 7 B 0 8-bit Accumulators A & B 15 D 0 16-bit Double Accumulator D 15

More information

ECE331 Handout 3- ASM Instructions, Address Modes and Directives

ECE331 Handout 3- ASM Instructions, Address Modes and Directives ECE331 Handout 3- ASM Instructions, Address Modes and Directives ASM Instructions Functional Instruction Groups Data Transfer/Manipulation Arithmetic Logic & Bit Operations Data Test Branch Function Call

More information

Introduction to Microcontrollers II

Introduction to Microcontrollers II Introduction to Microcontrollers II brset, brclr Indexed Addressing Example µp Laboratory #2 BUFFALO Assembling Code EECE 143 Digital Design Project Purpose:To allow students to design their own digital

More information

EE319 K Lecture 3. Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator. University of Texas ECE

EE319 K Lecture 3. Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator. University of Texas ECE EE319 K Lecture 3 Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator University of Texas ECE Introduction (von Neumann architecture) processor Bus Memory Mapped I/O System Input Devices

More information

Cross Assembly and Program Development

Cross Assembly and Program Development Cross Assembly and ENGG4640/3640; Fall 2004; Prepared by Radu Muresan 1 Introduction Text Editor Program Ex. DOS, Notepad, Word saved as ASCII Source Code Assembler or Cross-Assembler Object Code Machine

More information

LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz

LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz G-CPU Important Notes (see Schwartz s lecture for a general overview) - The

More information

Lecture #2 January 30, 2004 The 6502 Architecture

Lecture #2 January 30, 2004 The 6502 Architecture Lecture #2 January 30, 2004 The 6502 Architecture In order to understand the more modern computer architectures, it is helpful to examine an older but quite successful processor architecture, the MOS-6502.

More information

Harry H. Porter, 2006

Harry H. Porter, 2006 The SPARC Computer Architecture Harry Porter Portland State University 1 CS-321 Lexer Parser Type Checking Intermediate Code Generation All semantic error checking finished in this phase IR - Intermediate

More information

EE 308 Spring The HCS12 has 6 addressing modes

EE 308 Spring The HCS12 has 6 addressing modes The HCS12 has 6 addressing modes Most of the HC12 s instructions access data in memory There are several ways for the HC12 to determine which address to access Effective Address: Memory address used by

More information

Menu Computer Organization Programming Model for the an example microprocessors (the G-CPU & Motorola 68HC11) Assembly Programming Look into my...

Menu Computer Organization Programming Model for the an example microprocessors (the G-CPU & Motorola 68HC11) Assembly Programming Look into my... Menu Computer Organization Programming Model for the an example microprocessors (the G-CPU & Motorola 68HC11) Assembly Programming Look into my... See examples on web: DirAddr.asm, ExtAddr.asm, IndAddr.asm,

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (Sept. 30, 2013) 1/15 538 Lecture Notes Week 5 Answers to last week's questions 1. With the diagram shown for a port (single bit), what happens if the Direction Register is read?

More information

Decimal, Hexadecimal and Binary Numbers Writing an assembly language program

Decimal, Hexadecimal and Binary Numbers Writing an assembly language program Decimal, Hexadecimal and Binary Numbers Writing an assembly language program o Disassembly of MC9S12 op codes o Use flow charts to lay out structure of program o Use common flow structures if-then if-then-else

More information

Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12. EE383: Introduction to Embedded Systems University of Kentucky

Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12. EE383: Introduction to Embedded Systems University of Kentucky Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12 EE383: Introduction to Embedded Systems University of Kentucky Samir Rawashdeh With slides based on material by H. Huang Delmar

More information

538 Lecture Notes Week 2

538 Lecture Notes Week 2 538 Lecture Notes Week 2 (Sept. 13, 2017) 1/15 Announcements 538 Lecture Notes Week 2 Labs begin this week. Lab 1 is a one-week lab. Lab 2 (starting next week) is a two-week lab. 1 Answers to last week's

More information

CodeWarrior. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

CodeWarrior. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff CodeWarrior 1 Assembler An assembler is a program that translates assembly language into machine code. Machine code are the numbers that the CPU recognizes as instructions. $B6 $10 $00 Assembly language

More information

Programming the Motorola MC68HC11 Microcontroller

Programming the Motorola MC68HC11 Microcontroller Programming the Motorola MC68HC11 Microcontroller COMMON PROGRAM INSTRUCTIONS WITH EXAMPLES aba Add register B to register A Similar commands are abx aby aba add the value in register B to the value in

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (October 4, 2017) 1/18 538 Lecture Notes Week 5 Announements Midterm: Tuesday, October 25 Answers to last week's questions 1. With the diagram shown for a port (single bit), what

More information

Lecture #3 Microcontroller Instruction Set Embedded System Engineering Philip Koopman Wednesday, 20-Jan-2015

Lecture #3 Microcontroller Instruction Set Embedded System Engineering Philip Koopman Wednesday, 20-Jan-2015 Lecture #3 Microcontroller Instruction Set 18-348 Embedded System Engineering Philip Koopman Wednesday, 20-Jan-2015 Electrical& Computer ENGINEERING Copyright 2006-2015, Philip Koopman, All Rights Reserved

More information

Chapter 1 Microprocessor architecture ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 1.1 Computer hardware organization 1.1.1 Number System 1.1.2 Computer hardware

More information

Introduction to Microcontrollers III

Introduction to Microcontrollers III Introduction to Microcontrollers III Timing Functions Delay5u.a11, Delay1m.a11 µp Laboratory #3 Data Entry : µp Laboratory #2 Hints Use the pushbutton routine from count.a11 or count_br.a11 (WAIT0 and

More information

MOXSYN. General Description. Features. Symbol

MOXSYN. General Description. Features. Symbol MOXSYN C68MX11 CPU General Description The C68MX11 CPU core is based on the Motorola M68HC11 microcontroller controller, but has an enhanced full 16 bit architecture, thus requiring less clock cycles for

More information

CS311 Lecture: The Architecture of a Simple Computer

CS311 Lecture: The Architecture of a Simple Computer CS311 Lecture: The Architecture of a Simple Computer Objectives: July 30, 2003 1. To introduce the MARIE architecture developed in Null ch. 4 2. To introduce writing programs in assembly language Materials:

More information

Introduction to CPU architecture using the M6800 microprocessor

Introduction to CPU architecture using the M6800 microprocessor Introduction to CPU architecture using the M6800 microprocessor Basics Programs are written in binary object codes which could be understood (after the decoding process) by the designated target CPU. The

More information

Introduction to Microcomputer Systems Addressing modes

Introduction to Microcomputer Systems Addressing modes Dept. of Computer Science and Engineering Introduction to Microcomputer Systems Overview Addressing mode Source form Abbreviation Description Inherent INST (no externally supplied operands) INH Immediate

More information

COSC 243. Instruction Sets And Addressing Modes. Lecture 7&8 Instruction Sets and Addressing Modes. COSC 243 (Computer Architecture)

COSC 243. Instruction Sets And Addressing Modes. Lecture 7&8 Instruction Sets and Addressing Modes. COSC 243 (Computer Architecture) COSC 243 Instruction Sets And Addressing Modes 1 Overview This Lecture Source Chapters 12 & 13 (10 th editition) Textbook uses x86 and ARM (we use 6502) Next 2 Lectures Assembly language programming 2

More information

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017 COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface RISC-V Edition Chapter 2 Instructions: Language of the Computer These slides are based on the slides by the authors. The slides doesn t

More information

SECTION 6 CENTRAL PROCESSING UNIT

SECTION 6 CENTRAL PROCESSING UNIT SECTION 6 CENTRAL PROCESSING UNIT This section discusses the M68HC11 central processing unit (CPU), which is responsible for executing all software instructions in their programmed sequence. The M68HC11

More information

Ryerson Polytechnic University Department of Electrical Engineering COE328 Digital Systems. (2 Weeks) FORMAL REPORT - 30 Marks Due Date: Week 13

Ryerson Polytechnic University Department of Electrical Engineering COE328 Digital Systems. (2 Weeks) FORMAL REPORT - 30 Marks Due Date: Week 13 Ryerson Polytechnic University Department of Electrical Engineering COE328 Digital Systems Lab 7 - Programmable Processor Module - PPM (2 Weeks) FORMAL REPORT - 3 Marks Due Date: Week 3 Objectives: To

More information

2) [ 2 marks] Both of the following statements cause the value $0300 to be stored in location $1000, but at different times. Explain the difference.

2) [ 2 marks] Both of the following statements cause the value $0300 to be stored in location $1000, but at different times. Explain the difference. 1) [ 9 marks] Write a sequence of directives for an HCS12 assembly language program that performs all of these tasks, in this order: a) Define an array called Measurements starting from memory location

More information

ECE3120: Computer Systems Hardware & Software Development Tools

ECE3120: Computer Systems Hardware & Software Development Tools ECE3120: Computer Systems Hardware & Software Development Tools Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Using the

More information

CE-320 Microcomputers I Winter 2010 LAB 1: MINIIDE GROUP #: NAME: PARTNER: Lab 1 Page 1

CE-320 Microcomputers I Winter 2010 LAB 1: MINIIDE GROUP #: NAME: PARTNER: Lab 1 Page 1 LAB 1: MINIIDE GROUP #: NAME: PARTNER: Lab 1 Page 1 LAB 1: MINIIDE GOALS Understand Wytec s Dragon12+ evaluation board Know how to use Dragon12 commands Understand an integrated development environment

More information

Computers and Microprocessors

Computers and Microprocessors Computers and Microprocessors - Introduction Over the last few decades, computers, and microprocessors in particular, have begun to have an enormous impact upon our lives. In early stages of development,

More information

S12CPUV2. Reference Manual HCS12. Microcontrollers. S12CPUV2/D Rev. 0 7/2003 MOTOROLA.COM/SEMICONDUCTORS

S12CPUV2. Reference Manual HCS12. Microcontrollers. S12CPUV2/D Rev. 0 7/2003 MOTOROLA.COM/SEMICONDUCTORS HCS12 Microcontrollers /D Rev. 0 7/2003 MOTOROLA.COM/SEMICONDUCTORS To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed

More information

Introduction to Computers - Chapter 4

Introduction to Computers - Chapter 4 Introduction to Computers - Chapter 4 Since the invention of the transistor and the first digital computer of the 1940s, computers have been increasing in complexity and performance; however, their overall

More information

Introduction to Microcontrollers

Introduction to Microcontrollers Motorola M68HC11 Specs Assembly Programming Language BUFFALO Topics of Discussion Microcontrollers M68HC11 Package & Pinouts Accumulators Index Registers Special Registers Memory Map I/O Registers Instruction

More information

HC11 Instruction Set

HC11 Instruction Set HC11 Instruction Set Instruction classes 1. Accumulator and Memory 2. Stack and Index Register 3. Condition Code Register 4. Program control instructions CMPE12 Summer 2009 19-2 1 Accumulator and memory

More information

Problem Set 1 Solutions

Problem Set 1 Solutions CSE 260 Digital Computers: Organization and Logical Design Jon Turner Problem Set 1 Solutions 1. Give a brief definition of each of the following parts of a computer system: CPU, main memory, floating

More information

Introduction to Microcontrollers III

Introduction to Microcontrollers III Introduction to Microcontrollers III Timing Functions Delay5u.a11, Delay1m.a11 µp Laboratory #3 Data Entry : µp Laboratory #2 Hints Use the pushbutton routine from count.a11 or count_br.a11 (WAIT0 and

More information

8051 Overview and Instruction Set

8051 Overview and Instruction Set 8051 Overview and Instruction Set Curtis A. Nelson Engr 355 1 Microprocessors vs. Microcontrollers Microprocessors are single-chip CPUs used in microcomputers Microcontrollers and microprocessors are different

More information

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud. Chapter 1 Microprocessor architecture ECE 3130 Dr. Mohamed Mahmoud The slides are copyright protected. It is not permissible to use them without a permission from Dr Mahmoud http://www.cae.tntech.edu/~mmahmoud/

More information

Microcontrollers. Microcontroller

Microcontrollers. Microcontroller Microcontrollers Microcontroller A microprocessor on a single integrated circuit intended to operate as an embedded system. As well as a CPU, a microcontroller typically includes small amounts of RAM and

More information

538 Lecture Notes Week 3

538 Lecture Notes Week 3 538 Lecture Notes Week 3 (Sept. 16, 2013) 1/18 538 Lecture Notes Week 3 Answers to last week's questions 1 Write code so that the least significant bit of Accumulator A is cleared, the most significant

More information

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS The Microprocessor without Interlocked Pipeline Stages

More information

EMCH 367 Fundamentals of Microcontrollers Example7 EXAMPLE 7

EMCH 367 Fundamentals of Microcontrollers Example7 EXAMPLE 7 EXAMPLE 7 OBJECTIVE This simple example has the following objectives: Introduce 2-digit hex arithmetic with carry Introduce the lost carry concept Introduce MSB carry PROGRAM Ex7.asm program performs the

More information

CHAPTER 8. Solutions for Exercises

CHAPTER 8. Solutions for Exercises CHAPTER 8 Solutions for Exercises E8.1 The number of bits in the memory addresses is the same as the address bus width, which is 20. Thus the number of unique addresses is 2 20 = 1,048,576 = 1024 1024

More information

HCS12 Microcontroller and Embedded Systems: Using Assembly and C with CodeWarrior 1 st Edition

HCS12 Microcontroller and Embedded Systems: Using Assembly and C with CodeWarrior 1 st Edition Online Instructor s Manual to accompany HCS12 Microcontroller and Embedded Systems: Using Assembly and C with CodeWarrior 1 st Edition Muhammad Ali Mazidi Danny Causey Prentice Hall Boston Columbus Indianapolis

More information

11. A Computing Machine

11. A Computing Machine COMPUTER SCIENCE S E D G E W I C K / W A Y N E Computer Science Including Programming in Java 11. A Computing Machine Section 5.1 http://introcs.cs.princeton.edu COMPUTER SCIENCE S E D G E W I C K / W

More information

Machine Language and Assembly Language

Machine Language and Assembly Language Machine Language and Assembly Language In the following lectures, we will learn: How instructions are represented and decoded Introduction to different types of Addressing Modes Most commonly used assembly

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications EE 317 Microcontroller Applications Lecture 5 : Instruction Subset & Machine Language: Introduction to the Motorola 68HC11 - Miller 2.1 & 2.2 Based on slides for ECE317 by Profs. Davis, Kieckhafer, Tan,

More information

Chapter 3. Z80 Instructions & Assembly Language. Von Neumann Architecture. Memory. instructions. program. data

Chapter 3. Z80 Instructions & Assembly Language. Von Neumann Architecture. Memory. instructions. program. data Von Neumann Architecture The von Neumann architecture is a computer design model that uses a processing unit and a separate storage to hold both instructions and data To run a machine, program and data

More information

Chapter 2: HCS12 Assembly Programming. EE383: Introduction to Embedded Systems University of Kentucky. Samir Rawashdeh

Chapter 2: HCS12 Assembly Programming. EE383: Introduction to Embedded Systems University of Kentucky. Samir Rawashdeh Chapter 2: HCS12 Assembly Programming EE383: Introduction to Embedded Systems University of Kentucky Samir Rawashdeh With slides based on material by H. Huang Delmar Cengage Learning 1 Three Sections of

More information

ECE 3610 MICROPROCESSING SYSTEMS AN ENCRYPTED ASCII CODE DECODER

ECE 3610 MICROPROCESSING SYSTEMS AN ENCRYPTED ASCII CODE DECODER ECE 3610 MICROPROCESSIG SYSTEMS A ECRYPTED ASCII CODE DECODER 1 PROBLEM SPECIFICATIO Design a microprocessing system to decode messages which are encrypted. Each byte of the message is an encrypted ASCII

More information

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions CHAPTER 4 Operations On Data (Solutions to Odd-Numbered Problems) Review Questions 1. Arithmetic operations interpret bit patterns as numbers. Logical operations interpret each bit as a logical values

More information

A. CPU INSTRUCTION SET SUMMARY

A. CPU INSTRUCTION SET SUMMARY A. CPU INSTRUCTION SET SUMMARY This appendix summarizes the CPU instruction set. Table A-1 is a matrix of CPU instructions and addressing modes arranged by operation code. Table A-2 lists the CPU instruction

More information

ASSIGNMENT ECE514 (COMPUTER ORGANIZATION) ASSIGNMENT NO. 3

ASSIGNMENT ECE514 (COMPUTER ORGANIZATION) ASSIGNMENT NO. 3 ASSIGNMENT ECE514 (COMPUTER ORGANIZATION) ASSIGNMENT NO. 3 This is an individual assignment for ECE514. It carries a mark of 10%. The rubric of marks is given in Appendix 3. This assignment is about designing

More information

instruction 1 Fri Oct 13 13:05:

instruction 1 Fri Oct 13 13:05: instruction Fri Oct :0:0. Introduction SECTION INSTRUCTION SET This section describes the aressing modes and instruction types.. Aressing Modes The CPU uses eight aressing modes for flexibility in accessing

More information

Ryerson University Department of Electrical and Computer Engineering ELE 538 Microprocessor Systems Final Examination December 8, 2003

Ryerson University Department of Electrical and Computer Engineering ELE 538 Microprocessor Systems Final Examination December 8, 2003 Ryerson University Department of Electrical and Computer Engineering ELE 538 Microprocessor Systems Final Examination December 8, 23 Name: Student Number: Time limit: 3 hours Section: Examiners: K Clowes,

More information

It translates (converts) assembly language to machine code.

It translates (converts) assembly language to machine code. Assemblers 1 It translates (converts) assembly language to machine code. Example: LDAA $0180 Uses an instruction set manual: Tests/Final Exam. B6 01 80 Use software: Like the IDE in the Lab. 2 Assembler:

More information

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats Addressing Modes Immediate Direct Indirect Register Register Indirect Displacement

More information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science ã Cengage Learning Objectives After studying this chapter, the student should be able to: q List the three subsystems of a computer. q Describe

More information

Coe538 Final Study Guide 2016 (Questions & Answers)

Coe538 Final Study Guide 2016 (Questions & Answers) Coe538 Study Guide 1 of 8 Coe538 Final Study Guide 2016 (Questions & Answers) This version contains questions AND answers. This study guide is meant to help you review coe538 and prepare for the final.

More information

Microcomputer Architecture and Programming

Microcomputer Architecture and Programming IUST-EE (Chapter 1) Microcomputer Architecture and Programming 1 Outline Basic Blocks of Microcomputer Typical Microcomputer Architecture The Single-Chip Microprocessor Microprocessor vs. Microcontroller

More information

Using the stack and the stack pointer

Using the stack and the stack pointer Using the stack and the stack pointer o The Stack and Stack Pointer o The stack is a memory area for temporary storage o The stack pointer points to the last byte in the stack o Some instructions which

More information

COSC345 Software Engineering. Basic Computer Architecture and The Stack

COSC345 Software Engineering. Basic Computer Architecture and The Stack COSC345 Software Engineering Basic Computer Architecture and The Stack Outline Architectural models A little about the 68HC11 Memory map Registers A little bit of assembly (never did us any harm) The program

More information

Chapter 2 Instruction Set Architecture

Chapter 2 Instruction Set Architecture Chapter 2 Instruction Set Architecture Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge of mathematics, science and engineering

More information

Digital System Design Using Verilog. - Processing Unit Design

Digital System Design Using Verilog. - Processing Unit Design Digital System Design Using Verilog - Processing Unit Design 1.1 CPU BASICS A typical CPU has three major components: (1) Register set, (2) Arithmetic logic unit (ALU), and (3) Control unit (CU) The register

More information

Introduction to the 9S12 Microcontroller

Introduction to the 9S12 Microcontroller Introduction to the 9S12 Microcontroller o Harvard architecture and Princeton architecture o Memory map for a Princeton architecture microprocessor o 68HC12 Address Space o 68HC12 ALU o 68HC12 Programming

More information