flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > RTC 1024Hz interrupt |
Author |
|
poupougne 07 Mar 2011, 08:16
Hi edfed,
IRQ8 is present on the 2nd controler : you must send EOI to 0x20 AND 0xA0 port. STI is not required in handler : IRET will do it For unmasking, send 0 to both 0x21 and 0xA1 port |
|||
07 Mar 2011, 08:16 |
|
Madis731 07 Mar 2011, 13:32
I recommend this http://wiki.osdev.org/PIC as reference. I converted it to asm and it worked. No reinventing the wheel.
|
|||
07 Mar 2011, 13:32 |
|
edfed 07 Mar 2011, 14:25
i think i will need to start from scratch as the code i've made is under fool, it can be better to just test in standalone.
i've tested the advice of poupougne, and give nothing. madis, i will try from your link and let you know if it work |
|||
07 Mar 2011, 14:25 |
|
SeproMan 29 Aug 2011, 22:35
inc [.cnt] is missing a cs: segment override.
Code: interruption: cli push eax ecx inc [.cnt] or al,0ch out 70h,al in al,71h ;read even if don't care mov al,20h out 20h,al pop ecx eax sti iret align 4 .cnt dd 0 _________________ Real Address Mode. |
|||
29 Aug 2011, 22:35 |
|
asmdev 30 Aug 2011, 01:02
Code: or al,0ch out 70h,al in al,71h I always imagined that one should go for "mov al, 0ch" Code: mov al,0bh out 70h,al ror ax,8 in al,71h ; preserve AL here in some register ror ax,8 out 70h,al or al,40h ; <<<<<<<<< restore AL from the register (0x0b is not gonna cut) out 71h,al you are not clearing bits [6-4], so value in these bits is unknown and may easily be not "100b". Do preserve bit 7,3,2,1,0. Also, personally I do ACK right before "sti" Code: ... ... or al,40h out 71h,al ; your ACK, same as in interrupt handler sti Do read this file http://www.sat.dundee.ac.uk/~psc/pctim003.txt . Its alot but worth reading. Section about CMOS starts at chapter 7. Stop using obfuscated code like "ror ax, 8" when asking for help Also keep in mind that while inside the interrupt either "alert" or/and "update" bits can be set even if you did not request for those interrupts. For example, it can happen when "periodic" event happens at the same time as "update" event. Alsways check if "periodic" flag is set. |
|||
30 Aug 2011, 01:02 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.