From 0aa2c30f62e6ec53f2e21b4039abeb1581d460d8 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Thu, 29 Nov 2018 14:49:47 +0100 Subject: [PATCH] a4: Bearbeitung im Praktikum --- src/asm/a4.asm | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/src/asm/a4.asm b/src/asm/a4.asm index 074ecdc..7474e00 100644 --- a/src/asm/a4.asm +++ b/src/asm/a4.asm @@ -85,14 +85,14 @@ start: again: ; Ihr Programmcode... - ;Ausgabe der Zähler Variable - mov ax, [count] + ;Ausgabe der Status Variable + mov ax, [status] + out leds, ax - cmp ax, 0x0 - jz ifzero + times shcnt shr ax, 1 - mov al, [count] - out leds, al + ;cmp ax, 0x0 + ;jbe ifzero jmp again @@ -100,10 +100,11 @@ again: ifzero: mov ah, 2 mov dl, 7 - mov bx, offset frei + mov bx, frei int 6 - mov ax, [pieces] - mov [count], ax + mov byte [status], pieces << shcnt + + ret @@ -171,36 +172,47 @@ init: ;------------------------ Serviceroutinen ----------------------------------- isr_opentimer: ; Timer fuer Vereinzeler (Zeit fuer Oeffnung) - + push ax ; Ihr Programmcode + isr_opentimer_out: ; Ausgang aus dem Service mov al, eoi ; EOI an PIC out ocw_2_3, al + pop ax iret isr_lt: ; Lichttaster - mov ax, [count];Zählen - dec ax - mov [count], ax - iret - - ; Ihr Programmcode + push ax + + mov al, [status] + times shcnt shr al, 1 + dec al + + times shcnt shl al, 1 + and byte [status], 00001111b + or [status], al + + isr_lt_out: ; Ausgang aus dem Service mov [status], al + or byte [status], 00000001b mov al, eoi ; EOI an PIC out ocw_2_3, al + pop ax iret isr_servotimer: ; Timer fuer Servo (Vereinzeler) - + push ax ; Ihr Programmcode + isr_servotimer_out: ; Ausgang aus dem Service mov al, eoi ; EOI an PIC out ocw_2_3, al + pop ax iret