Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 881 Bytes

README.md

File metadata and controls

57 lines (36 loc) · 881 Bytes

basm

Build Status

An x86-64 assembler.

As this is primarily used by bshift, it only implements the instructions and features needed by bshift.

Downloading and compiling

You'll need git, a haskell compiler, and cabal:

git clone https://github.com/briansteffens/basm
cd basm
cabal build

Usage

Consider the following hello world style program (examples/hello.asm):

section .data

    message: db "Greetings!", 10

section .text

global _start
_start:
    mov rax, 1
    mov rdi, 1
    mov rsi, message
    mov rdx, 11
    syscall

    mov rax, 60
    mov rdi, 0
    syscall

To assemble, link, and run it:

dist/build/basm/basm examples/hello.asm
ld examples/hello.o
./a.out