Indirizzamento di memoria indiretto

Memory indirect addressing

; Memory indirect addressing

VAL1 EQU 37H      ;DECIMAL VALUE = 55

VAL2 EQU 2CH      ;DECIMAL VALUE = 44

LOC1 EQU 0C350H

        ORG 0000h

        JP   0100h

        ORG 0100h

PROG :     LD HL,LOC1      ;initialize the register HL at the value LOC1

           LD A,VAL1       ;load the value VAL1 in the accumulator A

           LD   (HL),A      ;load the value of A in the address of the register HL

           INC HL          ;increment HL

           LD   (HL),A      ;load the value of A in the address of the register HL

           INC HL          ;increment HL

           LD A,VAL2       ;load the value VAL2 in the accumulator A

           LD   (HL),A      ;load the value of A in the address of the register HL

HALT

Lascia un commento