Inizializzazione di una stringa

String initialization

;———————————————–

; String handling in assembly

;     a) String initialization

;———————————————–

       ORG 0000h

       JP   0100h      ;(link to the Hardware RESET)

       ORG 0100h

;

START : ld sp,0fff0h ; stack pointer initialization

 ld A,00h

  loop : call subprog

      ld (8000h),hl

      ld (8002h),de

      ld (8004h),A

      call subprog

      ld (9000h),hl

      ld (9002h),de

      ld (9004h),A

      call subprog

      ld (9008h),hl

      ld (900Ah),de

      ld (900Ch),A

     HALT         

subprog : ld h,55h ; this subprogram will write the string “LUCA\0″

         ld l,4ch

         ld d,41h

         ld e,43h

          RET

Lascia un commento