Hello all,
First I want to thank everyone who answer my previous question. I think that's the fastest response I ever had on the web.
Well I'm back again with more questions for this class assignment. We have to write a function to do a so-called "memory dump" (but instead of a text file, we are just dumping straight into the command prompt)
so we need to produce an output like this:
Code:
0x3000: 2c39 e03a f022 da01 0e03 000b 5020 c1c0 ,9.:."......P ..
0x3008: 1b61 2031 1140 0cd9 f025 6200 0423 72c0 .a 1.@...%b..#r.
0x3010: 1021 16e1 0ffa 1dbf 7f80 2056 2220 1009 .!........ V" ..
and instead I get this:
Code:
0x3000: 2c39 ffffe03a fffff022 ffffda01 0e03 000b 5020 ffffc1c0 9,:."....... P..
0x3008: 1b61 2031 1140 0cd9 fffff025 6200 0423 72c0 a.1 @...%..b#..r
0x3010: 1021 16e1 0ffa 1dbf 7f80 2056 2220 1009 !.........V "..
So you can see the negative hex numbers are sign-extended... which looks bad. currently I'm using this code to print out each hex number:
printf("%04x ",*shortPointer);
any simple way to force it not to sign extend?
Thanks,
Kairos