Binary representation in IAR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2009-01-07 1:20 AM
Binary representation in IAR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:58 AM
Using IAR 5.20:
Normal representation of: Decimal: i = 30; Hex: i = 0x1E; How do you write binary variables???? Binary: i = ????????????????????? Please! -Relaxe- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:58 AM
You can use a macro. See:
http://cprog.tomsweb.net/binconst.txt- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3: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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3: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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:58 AM
Some compilers allow binary data to be represented by starting the value with ''0b'', e.g.: 0b00000000.
Steve.