Inizializzazione di un registro

;Register Initialization

          

  VAL1 EQU 0E6h   ;direttive EQU (vengono ignorate dall’assemblatore

  VAL2 EQU 2Dh

  VAL3 EQU 30F0h

  ORG    0000h     ;questa direttiva permette di scrivere la prima istruzione al reset hardware

  JP     0100h     ;questa istruzione fa saltare le locazioni di memoria ROM riservate

  ORG    0100h

PROG :     LD A, VAL1       ;load the value 250 in exadecimal = 0E6(VAL1) in A accumulator

            LD B, VAL2       ;load the value 45 in exadecimal = 2D(VAL2) in the B register

           LD HL, VAL3       ;load the value 30F0h in the coupled HL register (16bit)

HALT

Lascia un commento