From 5a158da69d98b3ba26bd95a75e2b8d2259a75802 Mon Sep 17 00:00:00 2001 From: Vichingo455 Date: Mon, 31 Mar 2025 06:42:59 +0000 Subject: [PATCH] Upload files to "/" --- esercizio_stack.asm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/esercizio_stack.asm b/esercizio_stack.asm index f33b9b3..eeeda1f 100644 --- a/esercizio_stack.asm +++ b/esercizio_stack.asm @@ -1,21 +1,26 @@ ; Manuel Vichi 3^AIN ; Realizzare una routine che usa come parametri di ingresso i registri HL, B, C ; La routine riempie con valori progressivi a partire dal valore contenuto in C, B celle di memoria a partire dall'indirizzo contenuto in HL. + org 100h fill_memory: - push hl - push bc ld hl, 200h ld c, 01h ld b, 4h ld a, c + ld sp, 300h + call loop_fill + halt loop_fill: + push af + push bc + push hl +ciclo: ld (hl), a inc hl inc a dec b - jr nz, loop_fill - pop bc + jr nz, ciclo pop hl -finish: - halt - end \ No newline at end of file + pop bc + pop af + ret \ No newline at end of file