Skip to content

begoon/asm8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asm8

A generic Intel 8080 assembler written in TypeScript. Runs with Bun.

Built primarily to assemble the Radio-86RK monitor ROM, but works with any Intel 8080 source.

Usage

Assemble a source file:

bun run asm8.ts <source.asm> [--one|--split]
  • --one (default) — produces a single 64 KB file 0000-FFFF.bin with sections placed at their addresses
  • --split — produces one file per section, named SSSS-EEEE.bin

A section map is printed to stdout:

F800-FFFF  2048 bytes

Assembler features

  • Two-pass assembly (forward references resolved automatically)
  • Case-insensitive mnemonics, registers, and symbols
  • All documented Intel 8080 instructions
  • Directives: org, db, dw, equ, end
  • Number formats: decimal (255), hex with h suffix (0FFh)
  • Character literals: 'A' (usable anywhere a byte value is expected)
  • Strings in db: db "hello" or db 'hello'
  • Expressions with + and -: lxi h, base + offset - 1

Tests

bun test
  • tests/asm8.test.ts — assembles monitor.asm and verifies byte-identical output against mon32.bin
  • tests/asm8-instructions.test.ts — exercises all 8080 instruction encodings, directives, expressions, labels, and edge cases

Reference files

  • target/monitor.asm — Radio-86RK monitor ROM source (1494 lines)
  • target/mon32.bin — expected binary output (2048 bytes, F800-FFFF)

About

Intel 8080 assembler in Typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors