View Single Post
Old 06-22-2018, 02:17 PM   #7
James Slanger
Human being with feelings
 
Join Date: Feb 2018
Posts: 24
Default

Thank you again Micheal!

How do we get a bitwise NOT in EEL? While working out my bit masks, ! ing my masks results in all 0's.
Some of the masks, binary print function, and test calls:
Code:
ZERO_MASK = $x00;
FULL_MASK = $~32;

Q_NUMBER_MASK = $xFFF00000; 
COLOR_MASK = $x000FF000; 

function printAsBinary(memSlot) (

	MSB_MASK = $x80000000;
	
	loop(32,
		memSlot & MSB_MASK ? printf("1") : printf("0");
		MSB_MASK = MSB_MASK >> 1;
	);
	printf( " \n");
);

printAsBinary(Q_NUMBER_MASK);
printAsBinary(!Q_NUMBER_MASK);
printAsBinary(COLOR_MASK);
printAsBinary(!COLOR_MASK);
Results:
Code:
11111111111100000000000000000000 
00000000000000000000000000000000 
00000000000011111111000000000000 
00000000000000000000000000000000
Any tips on what I'm missing?
James Slanger is offline   Reply With Quote