News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

BitMask add-in

Started by lamer, June 25, 2005, 12:08:11 PM

Previous topic - Next topic

lamer

The second one - BitMask. Thanks to Donkey for his BitMask add-in as idea. This add-in is enhanced and allows to perform various bitwise operations on destination and source and see the result.
Fill free to feedback :bg

[attachment deleted by admin]

KetilO

Nice improvements.

KetilO

lamer

Hi all!
New upload of raBitMask - one per year, not bad :green2
1. Added left and right shifts
2. NOT button for both destination and source
3. Improved GUI - a bit "colorized"
4. The source included (rewritten)

Just replace the old one DLL with in AddIns directory with this one from attachment

Regards

P.S.
Attachment in the first post

Mark Jones

Nice job Lamer! Thanks. :bg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

donkey

Excellent work !!

I long ago replaced my bitmask generator with yours and this is a nice improvement, and no, once a year isn't that bad.

But credit where credit is due I can't remember who originally had the idea ("Delight" I beliieve) for a bitmask generator, I remember helping someone out with his stand-alone package and thought to write my own for RadASM but it was not my idea originally.

Donkey
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

lamer

Thank you, guys!

Donkey, the fact remains - I thought to write it when I saw your BitMask. :thumbu
BTW, the standalone package may be found on my web-site (for those who code with Notepad  :bg).

lamer

I am sorry, there was a little bug (I forgot to set boolean to initial FALSE) which allowed to type any characters and not hex characters only. :( Repaired. New upload.

trodon

Sorry for inconvenience, but can someone explain me what is this exactly in mathematic:
.elseif nOutput==IDRB_HEX && ((al >= '0' && al <= '9')||(al >= 'A' && al <= 'F')||(al >= 'a' && al <= 'f'))
i have small problem, i dont know what is:
this &&, and this  ||

thanks.


Mark Jones

Quote from: trodon on August 22, 2006, 06:46:13 PM
Sorry for inconvenience, but can someone explain me what is this exactly in mathematic:

.elseif nOutput == IDRB_HEX && ((al >= '0' && al <= '9') || (al >= 'A' && al <= 'F') || (al >= 'a' && al <= 'f'))



Hello Trodon. Those are logical operators - AND, OR. To understand how this works, replace "&&" with the word AND, and "||" with the word OR and read it aloud. The whole thing translates to "if nOutput == the hex digit in AL"...  :wink
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

lamer

Hi, trodon!
&& means AND
|| means OR
nOutput is a variable shows how the input should be treated(hex or decimal)
al stores charachter code wich has been sent to edit control
so the line of code means:
Quoteelse if we should treat the input as hexadecimal and one of the following is true: current input character is between 0 and 9, or between A and F, or between a and f, then...

Hi Mark, you are quicker than me :bg :bg :bg

trodon

ok, i understand now, thank you for explaining me :U

P1

Quote from: trodon on August 22, 2006, 06:46:13 PMthis &&, and this  ||
Comparison run-time operators

     Operator      Meaning

     ==            Equal
     !=            Not equal
     >             Greater than
     >=            Greater than or equal to
     <             Less than
     <=            Less than or equal to
     &             Bit test (format: expression & bitnumber)
     !             Logical NOT
     &&            Logical AND

     ||            Logical OR

     CARRY?        Carry bit set
     OVERFLOW?     Overflow bit set
     PARITY?       Parity bit set
     SIGN?         Sign bit set
     ZERO?         Zero bit set

     The comparison run-time operators are used to make comparisons
     between variables, registers, and constants as the program is
     being executed. Use these operators to give conditions for
     conditional-control directives (.IF, .UNTIL, .WHILE). These

     operators can be combined with other run- time operators and
     parentheses to form complex conditions.

     The conditional-control directives (.IF, .UNTIL, .WHILE) can also
     check the state of processor flags. The CARRY?, OVERFLOW?,
     PARITY?, SIGN?, and ZERO? flags can be used directly in a C-style
     expression.

     For example:

       .IF   !PARITY? || ( AX == 0 ) ;Execute body of block if parity
             -                       ;flag is clear or if the AX

             -                       ;register is zero
             -
       .ENDIF

     Note: The expression is evaluated from left to right, so in this
           example, the state of the parity flag is checked before the
           AX comparison.


Help files are useful.  Please take some time and get familiar with them.

Regards,  P1  :8)