Skip to content

Instantly share code, notes, and snippets.

View printf_Reg.s
.globl _main
_main:
.word 0x0000
movl sp, r3
movl fp, r4
movl ap, r5
pushl r3
pushab format1
View helloVAX.s
.globl _main
_main:
.word 0x0000
pushl $11
pushab hello
pushl $1
calls $3, _write
pushl $0
calls $1, _exit
@kusabanachi
kusabanachi / VaxDisasm.java
Last active Oct 11, 2015
Disassembler for VAX binary.
View VaxDisasm.java
package mypackage;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.PushbackInputStream;
import java.util.*;
import static mypackage.OperandType.*;
public class VaxDisasm {
@kusabanachi
kusabanachi / makeList
Created Dec 7, 2014
アセンブリのトランスレートをまとめてチェックするシェルスクリプト
View makeList
#!/bin/bash
OUTFILE='list'
CODE=('mov')
SRC=('r0' 'r1' 'r2' 'r3' 'r4' 'r5' 'sp' \
'(r0)' '(r1)' '(r2)' '(r3)' '(r4)' '(r5)' '(sp)' \
'(r0)+' '(r1)+' '(r2)+' '(r3)+' '(r4)+' '(r5)+' '(sp)+' \
'-(r0)' '-(r1)' '-(r2)' '-(r3)' '-(r4)' '-(r5)' '-(sp)' \
'2(r0)' '3(r1)' '1(r2)' '-1(r3)' '0(r4)' '-2(r5)' '-1(sp)' \
View calcExpr.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
enum {
NEXPR = 256,
BUF_SIZE = 256
};
typedef enum
@kusabanachi
kusabanachi / textOnlyExe.fs
Last active Aug 29, 2015
.textセクションのみのEXEファイルを作成
View textOnlyExe.fs
open System
open System.IO
// 2byteの配列をWord値に変換
let ToWord byteArray =
BitConverter.ToUInt16(byteArray, 0)
// 4byteの配列をDWord値に変換
let ToDWord byteArray =
BitConverter.ToUInt32(byteArray, 0)