The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => RadAsm Support Forum => Topic started by: lamer on June 25, 2005, 12:08:11 PM

Title: BitMask add-in
Post by: lamer on June 25, 2005, 12:08:11 PM
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]
Title: Re: BitMask add-in
Post by: KetilO on June 26, 2005, 08:12:35 PM
Nice improvements.

KetilO
Title: Re: BitMask add-in
Post by: lamer on August 21, 2006, 08:18:00 PM
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
Title: Re: BitMask add-in
Post by: Mark Jones on August 21, 2006, 09:55:59 PM
Nice job Lamer! Thanks. :bg
Title: Re: BitMask add-in
Post by: donkey on August 22, 2006, 12:43:48 AM
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
Title: Re: BitMask add-in
Post by: lamer on August 22, 2006, 04:07:21 AM
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).
Title: Re: BitMask add-in
Post by: lamer on August 22, 2006, 05:52:18 PM
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.
Title: Re: BitMask add-in
Post by: 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'))
i have small problem, i dont know what is:
this &&, and this  ||

thanks.

Title: Re: BitMask add-in
Post by: Mark Jones on August 22, 2006, 08:00:13 PM
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
Title: Re: BitMask add-in
Post by: lamer on August 22, 2006, 08:07:34 PM
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
Title: Re: BitMask add-in
Post by: trodon on August 22, 2006, 08:52:49 PM
ok, i understand now, thank you for explaining me :U
Title: Re: BitMask add-in
Post by: P1 on August 22, 2006, 09:08:39 PM
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)