1 / 8

Using the Location Counter

2. Referencing the Location Counter. The location counter (in the PSW) always points at the next instruction.Can directly reference the location counter in commands, using *E.g., * 8 would refer to 8 bytes past the current location counter.Can actually use the location counter directly for bra

donald
Télécharger la présentation

Using the Location Counter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    1. 1 Using the Location Counter

    2. 2 Referencing the Location Counter The location counter (in the PSW) always points at the next instruction. Can directly reference the location counter in commands, using * E.g., * + 8 would refer to 8 bytes past the current location counter. Can actually use the location counter directly for branching...

    3. 3 Referencing the Location Counter CLI 0(R1), C' ' BE *+12 LA R1,1(R1) B *-12 … add arrows??? Check address

    4. 4 Referencing the Location Counter Advantage: avoids cluttering program with unnecessary labels. Disadvantage: must be very careful about later inserting commands that would change the spacing between the referenced locations. Unless you have a very good reason to use this, don’t.

    5. 5 ORG Command Doesn't just reference location counter value; actually alters it. Allows you to reuse/redefine areas of storage (like REDEFINES in COBOL). ORG command at end is highly recommended to reset to the location counter again; omitting this is a common cause of problems.

    6. 6 ORG Command location counter 000280 INPUT DS CL80 ORG INPUT 000280 TYPE DS CL1 000281 NAME DS CL40 0002A9 STREET DS CL39 ORG INPUT+1 (or NAME) 000281 CITY DS CL20 000295 STATE DS CL20 0002A9 ZIP DS CL10 0002B3 CNTRY DS CL20 ORG important! 002D0 ...…

    7. 7 ORG Command

    8. 8 ORG Command location counter 000280 INPUT DC CL80 ORG INPUT 000280 TYPE DS CL1 000281 NAME DS CL40 0002A9 STREET DS CL39 ORG INPUT+1 (or NAME) 000281 CITY DS CL20 000295 STATE DS CL20 0002A9 ZIP DS CL10 0002B3 CNTRY DS CL20 ORG 002D0 ...…

More Related