Last active
August 31, 2017 05:14
-
-
Save atiq-cs/56ba65b7b5cfbdd487d854efa9db4940 to your computer and use it in GitHub Desktop.
C program for format specifier. This experiment was done to verify the sparc disassembler functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Example output (on sparc), | |
| 1969772169 | |
| 1969772169 | |
| 0x75685689 | |
| 75685689 | |
| 016532053211 | |
| 16532053211 | |
| */ | |
| #include <stdio.h> | |
| typedef unsigned long long ulnglng_t; | |
| int main() { | |
| char out_buf[100]; | |
| int value = 0x75685689; | |
| sprintf ( out_buf, "%#llu", (ulnglng_t) value ); | |
| printf("%s\n", out_buf); | |
| sprintf ( out_buf, "%llu", (ulnglng_t) value ); | |
| printf("%s\n", out_buf); | |
| sprintf( out_buf, "%#llx", (ulnglng_t) value); | |
| printf("%s\n", out_buf); | |
| sprintf( out_buf, "%llx", (ulnglng_t) value); | |
| printf("%s\n", out_buf); | |
| sprintf( out_buf, "%#llo", (ulnglng_t) value); | |
| printf("%s\n", out_buf); | |
| sprintf( out_buf, "%llo", (ulnglng_t) value); | |
| printf("%s\n", out_buf); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment