MCS6500

Microcomputer Family

Programming Manual


APPENDIX E SUMMARY OF ADDRESSING MODES This appendix is to serve the user in providing a reference for the MCS650X addressing modes. Each mode of address is shown with a symbolic illustration of the bus status at each cycle during the instruction fetch and execution. The example number as found in the text is provided for reference purposes. E.1 IMPLIED ADDRESSING Example 5.3: Illustration of implied addressing Clock Cycle Address Bus Program Counter Data Bus Comments 1 PC PC + 1 OP CODE Fetch OP CODE 2 PC + 1 PC + 1 New Ignore New OP CODE OP CODE; Decode Old OP CODE 3 PC + 1 PC + 2 New Fetch New OP CODE OP CODE; Execute Old OP CODE E.2 IMMEDIATE ADDRESSING Example 5.4: Illustration of immediate addressing Clock Cycle Address Bus Program Counter Data Bus Comments 1 PC PC + 1 OP CODE Fetch OP CODE 2 PC + 1 PC + 2 Data Fetch Data, Decode OP CODE 3 PC + 2 PC + 3 New Fetch New OP CODE OP CODE, Execute Old OP CODE E.3 ABSOLUTE ADDRESSING Example 5.5: Illustration of absolute addressing Clock Cycle Address Bus Program Counter Data Bus Comments 1 PC PC + 1 OP CODE Fetch OP CODE 2 PC + 1 PC + 2 ADL Fetch ADL, Decode OP CODE 2 PC + 2 PC + 3 ADH Fetch ADH, Hold ADL 3 ADH, ADL PC + 3 Data Fetch Data 4 PC + 3 PC + 4 New Fetch New OP CODE OP CODE, Execute Old OP CODE E.4 ZERO PAGE ADDRESSING Example 5.6: Illustration of zero page addressing Clock Cycle Address Bus Program Counter Data Bus Comments 1 PC PC + 1 OP CODE Fetch OP CODE 2 PC + 1 PC + 2 ADL Fetch ADL, Decode OP CODE 3 00, ADL PC + 2 Data Fetch Data 4 PC + 2 PC + 3 New Fetch New OP CODE OP CODE, Execute Old OP CODE E.5 RELATIVE ADDRESSING - (Branch Positive, no crossing of page boundaries) Example 5.8: Illustration of relative addressing branch positive taken, no crossing of page boundaries External Internal Cycle Address Bus Data Bus Operation Operation 1 0100 OP CODE Fetch Finish Previous Operation, OP CODE Increment Program Counter to 101 2 0101 +50 Fetch Interpret Instruction, Offset Increment Program Counter to 102 3 0102 Next Fetch Next Check Flags, Add Relative OP CODE OP CODE to PCL, Increment Program Counter to 103 3 0152 Next Fetch Next Transfer Results to OP CODE OP CODE PCL, Increment Program Counter to 153 E.6 ABSOLUTE INDEXED ADDRESSING - (with page crossing) Step 5 is deleted and the data in step 4 is valid when no page crossing occurs. Example 6.7: Absolute Indexed; With Page Crossing Address Data External Internal Cycle Bus Bus Operation Operation 1 0100 OP CODE Fetch OP CODE Finish Previous Operation Increment PC to 101 2 0101 BAL Fetch BAL Interpret Instruction Increment PC to 102 3 0102 BAH Fetch BAH Add BAL + Index Increment PC to 103 4 BAH,BAL Data Fetch Data Add BAH + Carry +X (Ignore) (Data is ignored) 5 BAH+1, Data Fetch Data BAL+X 6 103 Next OP Fetch Next Finish Operation CODE OP CODE E.7 ZERO PAGE INDEXED ADDRESSING Example 6.8: Illustration of Zero Page Indexing Address Data External Internal Cycle Bus Bus Operation Operation 1 0100 OP CODE Fetch OP CODE Finish Previous Operation, 0101 → PC 2 0101 BAL Fetch Base Interpret Instruct- Address Low ion, 0102 → PC (BAL) 3 00,BAL Data Fetch Add: BAL + X (Dis- Discarded carded Data 4 00,BAL Data Fetch Data +X 5 0102 Next OP Fetch Next OP Finish Operation CODE CODE E.8 INDEXED INDIRECT ADDRESSING Example 6.10: Illustration of Indexed Indirect Addressing Address Data External Internal Cycle Bus Bus Operation Operation 1 0100 OP CODE Fetch OP CODE Finish Previous Operation 2 0101 BAL Fetch BAL Interpret Instruction 3 00,BAL DATA (Dis- Fetch Discard- Add BAL + X carded) ed Data 4 00,BAL ADL Fetch ADL Add 1 to BAL + X + X 5 00,BAL ADH Fetch ADH Hold ADL + X + 1 6 ADH,ADL DATA Fetch DATA 7 0102 Next OP Fetch Next OP Finish Operation CODE E.9 INDIRECT INDEXED ADDRESSING (with page crossing) Step 6 is deleted and the data in step 5 is valid when no page crossing occurs. Example 6.12: Indirect Indexed Addressing (With Page Crossing) Address Data External Internal Cycle Bus Bus Operation Operation 1 0100 OP CODE Load OP CODE Finish Previous Operation 2 0101 IAL Fetch IAL Interpret In- struction 3 00,IAL BAL Fetch BAL Add 1 to IAL 4 00,IAL BAH Fetch BAH Add BAL to Y + 1 5 BAH,BAL DATA (Dis- Fetch Data Add 1 to BAH + Y carded) (Discarded) 6 BAH + 1 DATA Fetch Data BAL + Y 7 0102 Next OP Fetch Next OP Finish This CODE CODE Operation