These determine the assumed/default size of instruction operands, and restricts which opcodes are available, and how they are used.
Modern operating systems, booted inside Real
mode,
#include <stdio.h> | |
int ft_atoi(char *str) | |
{ | |
long long to_dec = 0; | |
int neg = 1; | |
while (!(*str ^ ' ') || (*str >= '\t' && *str <= '\r')) | |
str = (char *)-~(unsigned long long)str; // Wtff dude | |
while ((!(*str ^ '+') || !(*str ^ '-'))) |
Suppose you need to add a section to an ELF binary to contain information gathered at compile time, but to be used at link time or run time. Here's how to add a section named .okdata
and either populate it with data either after or before emitting the ELF binary.
In this case, you'll add file’s contents to an already existing binary. objcopy
copies and translates object files, such that adding a new section is a matter of writing that new section’s contents into the ELF file.
(Optional) Create a simple program’s object file.
> set PATH=C:\MinGW\bin;%PATH% | |
C:\Tools\zlib\zlib-1.2.8> C:\MinGW\bin\mingw32-make.exe -fwin32/Makefile.gcc | |
gcc -O3 -Wall -c -o adler32.o adler32.c | |
gcc -O3 -Wall -c -o compress.o compress.c | |
gcc -O3 -Wall -c -o crc32.o crc32.c | |
gcc -O3 -Wall -c -o deflate.o deflate.c | |
gcc -O3 -Wall -c -o gzclose.o gzclose.c | |
gcc -O3 -Wall -c -o gzlib.o gzlib.c | |
gcc -O3 -Wall -c -o gzread.o gzread.c |