Skip to content

Instantly share code, notes, and snippets.

model tiny
.code
org 100h
_: jmp start
m1 db 'Hello, INT!',13,10,'$'
f0 db '(func 0)',13,10,'$'
f1 db '(func 1)',13,10,'$'
fer db '(error)',13,10,'$'
v_f1 dd 0
model tiny
.code
org 100h
_: xor ah,ah
int 0F1h
mov ah,1
int 0F1h
mov ah,2
model tiny
.code
org 100h
_: jmp start
m1 db 'Hello, INT!',13,10,'$'
f0 db '(func 0)',13,10,'$'
f1 db '(func 1)',13,10,'$'
fer db '(error)',13,10,'$'
f_f1 dw f1_0
model tiny
.code
org 100h
_: jmp start
m1 db 'Hello, INT!',13,10,'$'
f0 db '(func 0)',13,10,'$'
f1 db '(func 1)',13,10,'$'
fer db '(error)',13,10,'$'
v_f1 dd 0
@ramntry
ramntry / vimrc
Created July 2, 2014 06:26
My vimrc file
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
@ramntry
ramntry / main.cpp
Created July 2, 2014 13:40
cf parser
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cctype>
#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
@ramntry
ramntry / main.cpp
Created July 4, 2014 16:59
CF template
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cctype>
#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cctype>
#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
@ramntry
ramntry / bench.sh
Last active August 29, 2015 14:04
Ordinal vs Polymorphic OCaml Variants Performance Comparison
#!/bin/bash
function bench() {
number_of_variants=$1
number_of_args=$2
echo "number_of_variants = $number_of_variants, number_of_args = $number_of_args"
./gen_bench.py $number_of_variants $number_of_args > out.ml
ocamlopt.opt -w -8 unix.cmxa out.ml
./a.out
echo
@ramntry
ramntry / aliases.hs
Last active August 29, 2015 14:04
Haskell type aliases
import qualified Data.Map as Map
import Data.Maybe (fromMaybe)
import Data.Function (on)
import Data.List
data SimpleType = SimpleType TyCon [TyVar]
data Type = Type TyCon [Type]
| TyVar TyVar