From 98c8ddf1b8646ca17b33da5ae87b72c35cd79fb4 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Wed, 28 Nov 2018 13:29:15 +0100 Subject: [PATCH] =?UTF-8?q?a4:=20r=C3=BCckw=C3=A4rts=20z=C3=A4hlen=20und?= =?UTF-8?q?=20ausgeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/asm/a4.asm | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/asm/a4.asm b/src/asm/a4.asm index 39fc754..ff9fdc7 100644 --- a/src/asm/a4.asm +++ b/src/asm/a4.asm @@ -13,7 +13,7 @@ status db 00000000b ; Statusbyte tcounts db 0 ; Impulszaehler fuer Servo, Vorwaertszaehler tcountv dw 100 * twait ; Impulszaehler fuer Verzoegerung * 10ms - ; Rueckwaertszaehler +count db 8 ; Rueckwaertszaehler frei db 'frei ', 0 ; Texte belegt db 'belegt ', 0 @@ -85,9 +85,26 @@ start: again: ; Ihr Programmcode... + ;Ausgabe der Zähler Variable + mov ax, [count] + + cmp ax, 0x0 + jz ifzero + + mov al, [count] + out leds, al jmp again - + + +ifzero: + mov al, 0x3F + out sseg7, al + mov ax, [pieces] + mov [count], ax + ret + + ; Initialisierung Controller und Interruptsystem init: @@ -161,6 +178,11 @@ isr_opentimer_out: ; Ausgang aus dem Service iret isr_lt: ; Lichttaster + mov ax, [count];Zählen + dec ax + mov [count], ax + iret + ; Ihr Programmcode @@ -179,3 +201,4 @@ isr_servotimer_out: ; Ausgang aus dem Service out ocw_2_3, al iret +