2009-01-07 01:20 AM
Binary representation in IAR
2011-05-17 03:58 AM
Using IAR 5.20:
Normal representation of: Decimal: i = 30; Hex: i = 0x1E; How do you write binary variables???? Binary: i = ????????????????????? Please! -Relaxe2011-05-17 03:58 AM
You can use a macro. See:
http://cprog.tomsweb.net/binconst.txt2011-05-17 03:58 AM
In the assembler use 01010b and the like
In C/C++ I found nothing in the docs. Given that plus what I tried you may need to use standard C/C++ hex 0xABC or octal 0123.2011-05-17 03:58 AM
The standard 'C' programming language provides no way to write binary constants.
If IAR have provided some extension to allow this, then it will be in their Documentaion - but this is quite uncommon. :( Given that anything you might find is totally non-standard and, therefore, totally non-portable, I suggest that you just stick to Hex.2011-05-17 03:58 AM
Some compilers allow binary data to be represented by starting the value with ''0b'', e.g.: 0b00000000.
Steve.