what does '0n0' mean? - windbg

What does 0n0 mean in windbg ? My windbg is showing all local variables with 0n1500 etc..

It ('0n') is the number prefix used to indicate a decimal representation in windbg. It allows the non-prefixed to be used for hexadecimal, for instance.
Happy coding.

It's MASM syntax for decimal, like 0x for hex.

Related

Is it possible to use unicodes with hex values over 0xFF with Keil uVision 5?

I am trying to print ∆ to console. I tried printf("\u0394"); but got the following error:
../Src/main.c(322): warning: #3488-D: Unicode character with hex
value 394 not representable in the system default code page.
Am I missing an #include or #pragma require to use Unicode with uVision v5?
What is the system default code page?
Your code page could be anything since you haven't described the operating environment.
One thing code pages do is map the bytes 0-255 to specific Unicode code points. Since there are at most 1,114,112 Unicode code points, you'll only be able to print the 256 characters mapped to whatever your code page is. The Unicode characters don't have to be U+0000 to U+00FF for bytes 0-255 (unless the code page is ISO-8859-1 aka latin1, where that actually is the mapping). See, for example, code page 1252.
Keil's compiler is for embedded systems, and as such the notion of a "console" is a bit limited. You need to figure out how your console really works. There are some display modules that simply have a hardcoded ASCII character set in ROM; they're not going to display ∆ no matter what you do.

Displaying Unicode Characters with Arduino

I am currently using the Keyboard.h library on Arduino
I would like to display the following characters upon pressing a button on my breadboard : ♥ ♦ ♣ ♠
I don't know much about ASCII, Unicode and Hexadecimal so I'm having a hard time figuring this out
Does someone know how to do it ?
Thanks.
See my answer at
https://arduino.stackexchange.com/a/91365/70109
for how to convert from unicode to Octal for output
The GCC compiler used by Arduino also does not accept all unicode sequences such as \u0020
Using octal avoids this problem.
Serial.print("\342\204\211");
will output ℉ provided the receiver has font for that unicode.
Try Keyboard.print("\uUNICODE_VALUE");
Unicode values can be found at: http://www.unicode.org/charts/
If that don't work on linux you can hit Ctrl+Shift+u, type the unicode value, and press enter like this:
void typeUnicode(int val, int time){
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.press('u');
delay(time);
Keyboard.releaseAll();
delay(time);
Keyboard.println(String(val, HEX));
delay(time);
}
On Windows you havel "ALT codes", and i'm not sure how they work since i'm a unix geek.

Unicode String Issue

I am storing some unicode characters "лфи" in a char array.
When I view(x/30s ) the values in gdb it show me something like:
0x80ac47c: "?\004>\004 "
0x80ac482: "A\0048\004;\004L\004D\004>\004=\004:\0045\004/"
Why it is happening so and what are these \004 representing?
You should read gdb's character set documentation, since it seems gdb is escaping these characters instead of letting the terminal display them.
See Gdb Unicode Printing. If you overload the dbg_dump function in your code, by invoking print dbg_dump("лфи") inside gdb it will hopefully invoke your overloaded function, resulting in proper UTF-8 representation. Remember, in your custon dbg_dump you may need to explicitly express that you want to display Unicode characters.

Standard radix for decimal base?

If I need to identify hex, octal, or binary numbers, I can just use prefixes 0x, 0, 0b. They aren't necessarily universal but are pretty recognizable in the programming world.
Is there an identifier like that for decimal (base 10) numbers? I would like to be able to explicitly denote a decimal base number and would like to use a somewhat standard notation if possible.
If you need a general form, then (number)b(base) is used in a couple of projects. 1b10, 1b16, 1b2, etc. can give you some standard way to express bases.
I've never seen 8x used anywhere tbh. 0 as a prefix - yes.
The standard prefix for octal is a leading "0" (in the C / C++ / Perl worlds at least). So I wouldn't recommend using "8x".

How remove the warning "large integer implicitly truncated" for sqlite/unicode support?

I use the solution of http://ioannis.mpsounds.net/2007/12/19/sqlite-native-unicode-like-support/ for my POS App for the iPhone, and work great.
However, as say in the comments:
For instance, sqlite_unicode.c line 1861 contains integral constants greater than 0xffff but are declared as unsigned short. I wonder how I should cope with that.
I'm fixing all the warnings in my project and this is the last one. The code is this:
static unsigned short unicode_unacc_data198[] = { 0x8B8A, 0x8D08, 0x8F38, 0x9072, 0x9199, 0x9276, 0x967C, 0x96E3, 0x9756, 0x97DB, 0x97FF, 0x980B, 0x983B, 0x9B12, 0x9F9C, 0x2284A, 0x22844, 0x233D5, 0x3B9D, 0x4018, 0x4039, 0x25249, 0x25CD0, 0x27ED3, 0x9F43, 0x9F8E, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF };
I don't know about this hex stuff, so what to do? I don't get a error, not know if this could cause one in the future...
Yes, 0x2284A is indeed larger than 0xFFFF, which is the largest a 16-bit unsigned integer can contain.(*)
This is a lookup table for mapping characters with diacritical marks to basic unaccented characters. For some reason, a few mappings are defined that point to characters outside the ‘Basic Multilingual Plane’ of Unicode characters that fit in 16 bits.
U+2284A and the others above are highly obscure extended Chinese characters. I'm not sure why a character in the BMP would refer to such a character as its base unaccented version. Maybe it's an error in the source data used to generate the tables, or maybe it's just another weird quirk of the Chinese writing system. Either way, it's extremely unlikely you'll ever need that mapping. So just change all the five-digit hex codes in this array to be 0xFFFF instead (which seems to be what the code is using to signify ‘no mapping’).
(*: in theory a short could be more than 16 bits, but in reality it isn't going to be. If it were it looks like this code would totally fall over anyway, as it's freely mixing short with u16 pointers.)