Skip to content

Instantly share code, notes, and snippets.

@andydude
andydude / prog.c
Created December 31, 2018 18:00
IOCCC 2017
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
typedef unsigned char*_;
_ s,i,z,e,O,F=
#include W
"; ; } { { { { { } { { } ; } { ; ; { } ; { { } ; } ; { { { { } { { } \
; } { { { { { } { ; } { } { { } { { } { { { ; ; { { } { { } { ; } { \
} { { { { { } ; } { } { { } { { { \
@andydude
andydude / conf.c
Last active April 25, 2019 06:49
Config Reader
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void
strvec_slurp (char **envstrvec, size_t size, size_t nitems,
const char *filename)
{
FILE *fp = fopen (filename, "r");
bool btr(int *a, int b) {
int c = (*a >> b) & 1;
*a &= ~(1 << b);
return c;
}
@andydude
andydude / mbr_try1.asm
Last active July 7, 2019 03:23
First attempt at a master boot record.
[bits 16]
[org 0x7C00]
start:
cli
xor si,si
mov ss,si
mov sp,0x7DBE
popa
mov es,si