Skip to content

Instantly share code, notes, and snippets.

@satokjp
satokjp / run.java
Last active December 26, 2015 07:38
//
// run.java
// Compile: javac run.java
// env LC_ALL=en javac run.java mac
// javac -J-Dfile.encoding=UTF-8 run.java mac
// Run: java run [file name] -> run mode
// java run -d [file name] -> disassemble mode
//
/*
@satokjp
satokjp / test.java
Last active December 25, 2015 18:19
java test program
//
// test.java
// Compile: javac test.java
// Run: java test -t/-b [file name]
//
// env LC_ALL=en javac test.java :mac
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
Dim strTmp,regTmp
strTmp = "/a/bb/ccc/file.txt"
Set regTmp = New RegExp
regTmp.Pattern = "(^\/.*\/)([^\/]+\.\w+$)"
Set matches = regTmp.Execute(strTmp)
@satokjp
satokjp / runrun.c
Last active December 20, 2015 14:49
x86 a.out binary C mac
/*
Compile : cc runrun.c -o runrun
Execute : ./runrun a.out -> run mode
./runrun -d a.out -> disassemble mode (not run)
*/
/*
usage: 7run [-p] [-d|-v/-s] cmd [args ...]
-p: PDP-11 mode
-8: 8086/V6 mode
-d: disassemble mode (not run)
@satokjp
satokjp / gist:6097613
Last active December 20, 2015 07:59
PDP-11 binary F# Mono Xamarin Mac
open System.IO
open System.Text
let mem = Array.zeroCreate<byte>(0x10000)
mem.[0] <- 0x10uy
mem.[1] <- byte 0x20
printfn "0:%d %02x" mem.[0] mem.[0]
printfn "1:%d %02x" mem.[1] mem.[1]
@satokjp
satokjp / header.c
Last active December 20, 2015 07:59
PDP-11 a.out binary C Mac
/*
cc header.c -o header
*/
#include <stdio.h>
#include <stdint.h>
uint8_t mem[0x10000];
/**************************************************/