Class Notes (836,849)
Canada (509,929)
York University (35,328)
ITEC 1000 (85)
all (19)

lecture_7 notes.docx

7 Pages
Unlock Document

Information Technology
ITEC 1000
All Professors

Introduction to Information Technology ITEC 1000 – Winter 2010 – Peter Khaiter Lecture 7 – Instruction Addressing and Programming Tools – Feb 22 Direct, Absolute Addressing − Direct: data is reached directly from the address in the instruction − Absolute: address in the instruction field is the actual memory location being addressed Additional Addressing Modes − Programmer-accessible registers o Provide faster execution with register-based instructions − Alternatives to absolute addressing o Allow larger range of addressable memory o While using a reasonable number of bits for the address field − Alternatives to direct addressing o Facilitate writing certain types of programs o Example: loops that use index to address different entries in a table or array Register Addressing - Does not require a memory access o Contents of the source register is directly moved to the destination register o Faster execution as memory is not accessed o Practical application: frequently used data to be loaded from memory into registers and left there - Implemented directly as part of the CPU o All registers are located in the CPU (as a part of ALU or a separate register unit) Two Alternatives to Absolute Addressing - Base register addressing - Relative addressing - Both provide starting address and an offset or displacement from the starting point o Starting address in register or program counter o Offset: address in the instruction - Programming advantage: permits to move the entire program to a different location in memory without changing any of the instructions (i.e., relocatability) Base Register Addressing - Base register set to initial address o Hardware design: special/separate register or general-purpose registers o Generally large to provide large memory space, frequently gigabytes - Final address: contents of instruction address field added to the base address Relative Addressing - Value in address field added to value in program counter o Program counter used as the base register o Similar to base addressing - Constraint: address field must be able to store and manipulate positive and negative (to jump backwards in loops) numbers o Complementary representation Direct Addressing - Location of data is different from location of instructions - Benefits to programmer o Data can be changed without affecting the instruction itself o Data is available to different instructions o Variable can be assigned to a particular location in memory independent of the instructions that refer to data Alternatives to Direct Addressing - Immediate addressing - Indirect addressing - Register Indirect addressing - Indexed addressing Immediate Addressing - Store data with the instruction itself o Example:  Data is a constant - Constraint: o Address field must be able to store and manipulate positive and negative numbers o Complementary representation o Instruction must include extra bits to identify the addressing mode o Change instruction if the constant has to be changed - Advantage: o Additional memory access (to obtain the data) is not required o Faster execution Incrementing - Treat the instruction as data o Modify the address field - Pure code: does not modify itself during execution o Incrementing does not modify the instruction o Address stored in a separate data region o Advantage: program can be stored in ROM Register Indirect Addressing - Also called register deferred addressing - Address pointer is stored in a general-purpose register - Advantage: efficient o One instruction to load pointer address in register o Data accessed in the same number of fetch-execute instructions as direct addressing o Small address field required (3 or 4 bits) o Excellent for addressing large memory space with small instruction word Register Indirect Addressing: Duel Duty - Autoincrementing/autodecrementing o Direct implementation of C’s “++” and “- -” - Instruction o Performs normal functions like LOAD or ADD o Plus increments or decrements register each time instruction executed - Advantage: simplifies writing program loops Indexed Addressing - Use address in the instruction like direct addressing o But modify address by adding value from another register o General purpose or special index register o If the value in index register is 0, index addressing becomes direct addressing Indexed vs. Base Offset - Both offset address by amount stored in another register - Base offset: primarily to expand addressing range for a given address field size o Value of base address likely to be large and rarely changed during execution - Index register: primarily used as a table offset for subscripting o Value in index register most like small and frequently changing o Autoindexing: similar to autoincrementing (except that the index register is incremented) Programming Tools - Editors – entering and modifying program in text form - Assemblers, interpreters, compilers – translating a program into binary machin
More Less

Related notes for ITEC 1000

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.