Files
pic16f84-sim/de/darkress/pic16f84sim/microcontroller/Interrupt.java
2023-06-18 19:24:40 +02:00

15 lines
514 B
Java

package de.darkress.pic16f84sim.microcontroller;
public class Interrupt
{
private static boolean globalInterruptEnabled() {
return (Memory.getRegister(0x0B) & 0x80) == 0x80; // Check GIE
}
public static boolean checkTimerInterruptConditions() {
boolean timerInterruptEnabled = (Memory.getRegister(0x0B) & 0x20) == 0x20;
//boolean timerOverflowInterruptFlag = (Memory.getRegister(0x0B) & 0x04) == 0x04;
return globalInterruptEnabled() && timerInterruptEnabled;
}
}