This file contains 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
#include <stdio.h> | |
int sum(int a, int b); | |
int main(void) | |
{ | |
int a = 1; | |
int b = 3; | |
printf("1 + 3 = %i\n", sum(a, b)); | |
return (0); |
This file contains 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
// Header | |
#define MAX_FLAG 0xe | |
typedef struct s_printf t_printf; | |
struct s_printf | |
{ | |
const char flag; | |
int (*cb)(const char *, int); | |
}; |
This file contains 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
jmp $ | |
times 510-($-$$) db 0 | |
dw 0xaa55 |
This file contains 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
; if (bx <= 4) | |
; mov al, 'A' | |
; else if (bx < 40) | |
; mov al, 'B' | |
; else | |
; mov al, 'C' | |
mov bx, 40 | |
cmp bx, 4 |
This file contains 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
;main.asm | |
[org 0x7c00] | |
global _start | |
_start: | |
mov bx, HELLO_MSG | |
call print | |
mov ah, 0x0e | |
mov al, bl | |
int 0x10 |
This file contains 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
#include<stdio.h> | |
#define TLIST(T,L) \ | |
struct _List##L { \ | |
struct _List##L * _next; \ | |
struct _List##L * _prev; \ | |
T _data; \ | |
} L = {&(L), &(L)} | |
#define TOTO(T, L) T L |