EE357 Lecture 6

EE357 Lecture 6 - Recap: Instruction Format Instructions...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
EE 357 Lecture 6 Assembler Directives Compare and Branch Instructions Branch Translation Recap: Instruction Format • Instructions can range from 1 to 5 words •1 st word is always the instruction word – Indicates the operation and addressing modes •2 nd –5 th word are extension words – Only used with certain addressing modes Instruction Word Src. Constant Src. Constant (cont.) Dest. Constant Dest. Constant (cont.) 1 2 3 4 5 extension words Recap: Instruction Cycle • Computer performs the following steps in an infinite loop: – Fetch next instruction – Decode instruction – Execute instruction – Access Memory – Write back results I/O Devices Processor Memory inst. 0 Processor requests instruction at address 0 and memory returns it Processor requests instruction at address 0 and memory returns it 1 address 0 inst. Recap: Condition Codes (Flags) • 5 tests w/ results stored as 1=true/0=false – X = eXtended Flag • Used for Extended Precision Arithmetic • Usually set the same as the C flag – N = Negative Flag • Tests if the result is negative • Just a copy of the MSB of result –Z = Ze ro F lag • Tests if the result is equal to 0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Recap: M68000 Processor M68000 PC: IR: D0±-D7 A0±-A7 ALU 32 32 32 Control 32 32 Data Registers – Hold data operands Address Registers – Act like pointers to data in memory Special Registers – PC: Program Counter (24- bits) • Holds the address of the next instruction to be executed – IR: Instruction Reg. (16-bits) • Holds the current instruction as it executes – SR: Status Reg. (16-bits) • Holds control bits and state of the processor Special Registers SR: Assembler Syntax • In Easy68k each line of the assembly program may be one of three possible options – Comment – Instruction – Assembler Directive Comments • In Easy68k an entire line can be marked as a comment by starting it with an asterisk (*) character: • Example: * This line will be ignored by the assembler MOVE.L D2,D3 ADD.L (A0),D3 ... Instructions • In Easy68k each instruction is written on a separate line and has the following syntax: Comment Operands Instruc. Op. (Label) • Example: ; Initialize D2 D3,D2 MOVE.L START Notes: – Label is optional and is a text identifier for the address where the instruction is placed in memory. (These are normally used to identify the target of a branch or jump instruction.)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

EE357 Lecture 6 - Recap: Instruction Format Instructions...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online