From 0edbf6ab027b3fd1770636ccf61ad6a048db9361 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Tue, 11 Dec 2018 16:55:56 +0100 Subject: [PATCH] =?UTF-8?q?a4:=20=C3=84nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/asm/a4.asm | 63 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/src/asm/a4.asm b/src/asm/a4.asm index 8d81ce4..0199a3b 100644 --- a/src/asm/a4.asm +++ b/src/asm/a4.asm @@ -16,6 +16,7 @@ tcountv dw 100 * twait ; Impulszaehler fuer Verzoegerung * 10ms ; Rueckwaertszaehler frei db 'frei ', 0 ; Texte belegt db 'belegt ', 0 +dir db 20 ; Konstanten divider equ 0 ; Platzhalter fuer Ihre Zeitkonstante1 @@ -121,7 +122,7 @@ ifzero: ifbelowzero: mov dx, pieces << shcnt - and dx, 10000001b + and dx, 10000010b mov [status], dx @@ -194,26 +195,29 @@ init: isr_opentimer: ; Timer fuer Vereinzeler (Zeit fuer Oeffnung) push ax -; Ihr Programmcode ;Zeit abgelaufen ? - inc byte [divider] - cmp byte [divider], tcountv - jne isr_opentimer_out + mov ah, [divider] + mov al, [status] + test al, 00000010b + jz isr_opentimer_out - mov ax, [status] - and ax, 11111110b - mov [status], ax + inc ah + cmp ah, [tcountv] + jnz isr_opentimer_out - + mov ah, 0 + mov byte[dir], trechts + and al, 0xfd isr_opentimer_out: ; Ausgang aus dem Service + mov [status], al + mov [divider], ah mov al, eoi ; EOI an PIC out ocw_2_3, al pop ax iret isr_lt: ; Lichttaster -; Ihr Programmcode push ax mov al, [status] @@ -223,12 +227,25 @@ isr_lt: ; Lichttaster times shcnt shl al, 1 and byte [status], 00001111b or [status], al - + mov [status], al + + and al, 11111101b + cmp al, 0b + jz left + cmp al, 10b + je right + +left: + mov byte[dir], tlinks + jmp isr_lt_out + +right: + mov byte[dir], trechts + jmp isr_lt_out isr_lt_out: ; Ausgang aus dem Service - mov [status], al - or byte [status], 00000001b + or byte [status], 00000010b mov al, eoi ; EOI an PIC out ocw_2_3, al pop ax @@ -236,20 +253,24 @@ isr_lt_out: ; Ausgang aus dem Service isr_servotimer: ; Timer fuer Servo (Vereinzeler) push ax - push bx -; Ihr Programmcode - mov bl, [status] - and bl, 11111110b + + mov ah, [tcounts] + inc ah + cmp ah, [dir] + jnz auf + out ppi_a, al - cmp bl, 0x0 - jz auf +auf: + cmp ah, tpwm + jnz isr_servotimer_out + mov al, ppi_pa6 + out ppi_a, al - jmp isr_servotimer_out isr_servotimer_out: ; Ausgang aus dem Service mov al, eoi ; EOI an PIC out ocw_2_3, al - pop bx pop ax iret +