Skip to content

Instantly share code, notes, and snippets.

View Lerc's full-sized avatar

Neil Graham Lerc

  • New Zealand
  • 18:56 (UTC +13:00)
View GitHub Profile
switch (instruction & 0xf000) {
case 0x0000: { //nop movw muls mulsu fmul fmuls fmulsu cpc sbc add
switch (instruction & 0x0c00) {
case 0x0000: {
switch (instruction & 0xff00) {
case 0x0000: { //nop
}
case 0x0100: { //movw
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
void sig_handler(int sig) {exit(0);};
int main () {
signal(SIGTERM,sig_handler);
pid_t pid_v;
@Lerc
Lerc / jmpabuse.c
Created March 24, 2012 20:19
A simple string unscrabler using a turing machine inside a single expression.
#include <stdio.h>
#include <setjmp.h>
int J(jmp_buf x, int y) {
longjmp(x,y);
return 0;
}
int main(int argc, char **argv)
{