gosk

module
v0.0.0-...-d5e0ede Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2025 License: GPL-3.0

README

GOSK

GOSK is an assembler project written in Go, designed to parse an assembly language similar to NASK (a language used in the "30 days self-made OS" book) and generate machine code (currently supporting COFF format). It utilizes PEG (Parsing Expression Grammar) for parsing.

Features

  • Parses NASK-like assembly code.
  • Generates COFF object files.
  • Includes a test suite for verification.

Build & Run

Requires Go and Make installed.

# Clone the repository (if you haven't already)
# git clone https://github.com/HobbyOSs/gosk.git
# cd gosk

# Build the executable
make build

# Or install directly (might require setting up GOPATH/GOBIN)
# Note: This installs the command to your $GOPATH/bin or $GOBIN
go install github.com/HobbyOSs/gosk/cmd/gosk@latest

Usage

# Display help message
./gosk --help

# Assemble a source file (e.g., input.nas) into an object file (e.g., output.o)
./gosk input.nas output.o

# Assemble and generate a listing file (e.g., output.lst)
./gosk input.nas output.o output.lst

The command-line interface is:

usage: ./gosk [--help | -v] source [object/binary] [list]
  source: Input assembly file (.nas)
  object/binary: Output object file (e.g., .o, .obj) or raw binary file (Optional, defaults based on source name)
  list:   Output listing file (Optional)
  --help: Show this help message
  -v:     Show version and license information

Contributing

Contributions are welcome! Please refer to the project's issue tracker and coding guidelines. (Details might be found in the memory-bank directory).

License

This project is licensed under the LICENSE file.

Directories

Path Synopsis
cmd
codegen command
gosk command
internal
ast
gen
pkg
cpu
// hexdump: a hexdumper utility written in Golang // // Copyright 2015 Jason E. Aten <j.e.aten -a-t- g-m-a-i-l dot c-o-m> // License: MIT
// hexdump: a hexdumper utility written in Golang // // Copyright 2015 Jason E. Aten <j.e.aten -a-t- g-m-a-i-l dot c-o-m> // License: MIT

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL