Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 516 Addressing Modes. Addressing modes are how our programs get to data Multiple addressing modes created for specific uses Function.

Similar presentations


Presentation on theme: "Computer Science 516 Addressing Modes. Addressing modes are how our programs get to data Multiple addressing modes created for specific uses Function."— Presentation transcript:

1 Computer Science 516 Addressing Modes

2 Addressing modes are how our programs get to data Multiple addressing modes created for specific uses Function calls Array processing Pep8 has eight Other processors have less or more IBM mainframe – basically three Intel – thirteen

3 Pep8 Storage Access Purpose of addressing mode is to develop the address of data in storage Memory registers Memory Address Register (MAR) Gets address of data to be retrieved or stored Memory Data Register (MDR) Holds actual data from memory, or data to be stored Neither MAR nor MDR are programmer visible

4 Pep8 Storage Access Diagram

5 Pep8 Direct Addressing (001)

6 Pep8 Immediate Addressing (000)

7 Pep8 Indexed Addressing Mode (101)

8 Pep8 Indirect Addressing Mode (010)

9 Pep8 Stack-Relative Addressing

10 Pep8 Stack-Relative Deferred Addressing Mode (100)

11 Pep8 Stack Indexed Addressing Mode (110)

12 Pep8 Stack-Relative Indexed Deferred Addressing Mode (111)

13 Some Useful Pep8 Pseudo-Operations Pep8 has no Load Address instruction Instead, the.ADDRSS pseudo-operation will create a word holding the address of some label Use in index register to provide address, leave operand specifier zero. Pep8 has no equivalent for the C/C++ struct The.EQUATE pseudo-operation lets us specify a value to be used as a displacement. See example, next slide.

14 Example Of.EQUATE Here is a commonly used C struct: struct tm { int tm_sec; //seconds after the minute 0-61 int tm_min; //minutes after the hour0-59 int tm_hour; //hours since midnight 0-23 int tm_mday; //day of the month 1-31 int tm_mon; //months since January 0-11 int tm_year; //years since 1900 int tm_wday; //days since Sunday 0-6 int tm_yday; //days since January 1 0-365 int tm_isdst; //Daylight Saving Time flag };

15 Example of Equate (continued) tm_sec:.EQUATE 0 //seconds after the minute 0-61 tm_min:.EQUATE 2 //minutes after the hour 0-59 tm_hour:.EQUATE 4 //hours since midnight 0-23 tm_mday:.EQUATE 6 //day of the month 1-31 tm_mon:.EQUATE 8 //months since January 0-11 tm_year:.EQUATE 10 //years since 1900 tm_wday:.EQUATE 12 //days since Sunday 0-6 tm_yday:.EQUATE 14 //days since January 1 0-365 tm_isdst:.EQUATE 16 //Daylight Saving Time flag

16 Using Equate With The Index Register LDX Timeval,d STRO Label1,d DECO tm_year,x Label1:.ASCII “The year is:\x00” Timeval:.ADDRSS Tm Tm.BLOCK 18 ;where tm struct values are This assumes that the Tm area was filled for us somehow.


Download ppt "Computer Science 516 Addressing Modes. Addressing modes are how our programs get to data Multiple addressing modes created for specific uses Function."

Similar presentations


Ads by Google