Questions tagged [flag]

Programming flag is a bit or value that, a program uses to remember something

Although this term could have several meanings, most of the times in EE context, it refers to values inside registers.

A flag is a bit or binary value. Typically, a program uses flags for these purposes:

  • to remember something
  • or to control and monitor state and behavior of hardware
  • or to leave a sign for another program
12 questions
3
votes
1 answer

Are flags strictly related to interrupts or not?

If we want to some flag to be set when true (for example FIFO is full), does that mean that we have to enable the interrupts? Whether it will be set if interrupts are not enabled? Are that flags always triggered, but it is on us to chose the way…
Patrick
  • 79
  • 9
3
votes
3 answers

How was the Zero Flag implemented on Z80 ALU?

Z80 was a popular 8-bit processor with a 4-bit ALU. Implementing a zero flag for a register should be straight forward, it would be a logical NOR of all the bits on the register. Something like that would work for a small number of inputs. As for…
GabrielOshiro
  • 211
  • 4
  • 11
2
votes
4 answers

Interrupts in microprocessors

This might be a very trivial question, but I was unable to find a concise answer to it. For non maskable interrupts, are the interrupts handled immediately while the current instruction is getting executed? Or it waits for the current instruction to…
Kashish
  • 31
  • 3
2
votes
1 answer

The same flag for an interrupt

I think I'm mixed up a bit in NVIC of stm32 MCUs. I took a look in the SPI.h of the STM32F10x standard peripheral library. I don't know that why while there is SPI_I2S_IT_RXNE for checking the status of recieved buffer we have SPI_I2S_FLAG_RXNE flag…
Roh
  • 4,598
  • 6
  • 41
  • 86
0
votes
1 answer

Flash memory to hold flags

I'm trying to write bootloader code and I needed to be able to use an address in flash memory as a flag to the bootloader to let it know if it should enter bootloader or the application. I'm able to write a value into the flash address but I'm…
doge
  • 63
  • 1
  • 7
0
votes
1 answer

PCA9956A How to set AIF bit

I am using the https://www.nxp.com/docs/en/data-sheet/PCA9956A.pdf chip to control LEDs. To set the autoincrement mode three beets are needed, But the AIF bit is marked as read-only. Is it a mistake or there is another way of changing it but I am…
0___________
  • 2,458
  • 10
  • 25
0
votes
2 answers

How to read flag register in datasheet?

I'm having troubles deciphering the datasheet for the DS3231 RTC. The below table shows that 0x02 bit 6 is the flag to operate in 12- or 24-hour mode. But which one correspond to the bit being low or high? I assume the line above the 24 must tell…
Antoine
  • 139
  • 5
0
votes
3 answers

Overflow results into wrong sign-flag bit set in 8085 microprocessor .

In case of 8085 microprocessor when the MSB bit of accumulator is 1 then sign flag becomes 1 ( simply copy the result's msb) , my question is that : When we add two positive numbers say 44H(01000100) and 43H(01000011) , the result would be 10000111…
Minion
  • 101
  • 2
0
votes
1 answer

Assembler language basics parity flag

I am a beginner in assembler language I was reading some stuff online(belongs to a university) and I saw that the P bit in psw after executing this instruction mov a,#03h A=0000 0011B so P=0 first it was difficult to know what is p bit after some…
whyyoucare
  • 29
  • 2
  • 6
0
votes
2 answers

8080 assembly comparing which of the numbers is greater etc

In my 8080 assembly project I need to check if user entered digits and if so do some stuff on it, otherwise display some error and close app. Normally i would do it like that CPI '0';if below '0' JS ERR CPI 58D;if over '9' JNS ERR but there's no JN…
Rotek
  • 3
  • 2
-1
votes
1 answer

Parity flag in 8085 microprocessor

What happens to the parity flag of an Intel 8085 microprocessor when there is no '1' bit in the accumulator? For example, if the following instruction executes, MVI A, 05H MVI B, 05H SUB B the result will be A= 00H, in which there is no '1' bit. In…
Durgesh
  • 3
  • 4
-2
votes
1 answer

DLW-1 and DLW-2 flags

What are the various flags in DLW-1 and DLW-2 microprocessors? I have read about sign flag, overflow flag and zero flag but im not sure Also it will be really helpful if you know a source from where i can read more about these two microprocessors
Muskan
  • 1