Questions tagged as 'bitwise'

1
answer

Extract data with bitwise and bitwise operators

Well, I'm having some trouble separating parts of the date through bitwise operations. date format: yyyy-dd-mm int menor_data(int date1, int date2) { int day1 = (date1 >> 8) & 0xff; int month1 = date1 & 0xff; i...
asked by 29.11.2015 / 12:59
2
answers

Create define for 16-bit variable consisting of two 8-bit

I would like to know if there is any way to create a define for a "variable" in C that has 16 bits called PORTAB , so write: PORTAB = 0xAAFF; Be equivalent to: PORTA = 0xAA; PORTB = 0xFF; Thank you.     
asked by 03.09.2017 / 22:45
2
answers

Bitwise Right operator [duplicate]

Hello By doing some studies on PHP I came across bitwise and until then all its operations have not been anything difficult, just the right shift An example that I picked up and still did not understand was this: print(4>>6); //o...
asked by 05.08.2016 / 01:22
1
answer

How to calculate the first 4 bytes of an Address ex: 00F28758

I would like to understand how to calculate the 4 Bytes of an address and then use a ReadProcessMemory . I just wanted to understand how to calculate this because every time I try it goes wrong. Let's say I have a Address 181B...
asked by 25.10.2015 / 04:06
0
answers

C ++ - Set and remove specific bits from a single

I'm developing a Gameboy emulator and one of the tasks is to set the flags after each statement: ... //Representa pares de registradores do gameboy union RegPair { std::uint16_t reg; struct pair {...
asked by 05.09.2018 / 16:05
2
answers

How to isolate higher order bits and lower order bits in C / C ++?

I need to create two functions One receives an integer value and returns another containing only the 8 lowest-order bits of the original value, with the other bits set to zero. The other receives an integer value and returns another cont...
asked by 11.01.2018 / 15:47