Go to file
jn e59e0ef83d Reset CURRENT_SIZE to Size::Word before parsing a data directive
Previously, the following program:

	push.16 0
	data.16 0

... crashed fox32asm:

	thread 'main' panicked at 'internal error: entered unreachable code', src/main.rs:620:22
	stack backtrace:
	   0: rust_begin_unwind
		     at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
	   1: core::panicking::panic_fmt
		     at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
	   2: core::panicking::panic
		     at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:48:5
	   3: fox32asm::parse_data
	   4: fox32asm::build_ast_from_expression
	   5: fox32asm::main
	note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The issue in line 620 is that parse_data expects a constant in the form
of AstNode::Immediate32, but finds an AstNode::Immediate16, because
CURRENT_SIZE was previously set to Half. Set CURRENT_SIZE to Word when
starting to parse a new data directive, in order to fix this issue.

Fixes #4
2023-02-01 21:22:24 +01:00
.github/workflows Build using GitHub Actions 2022-06-21 16:18:06 -07:00
src Reset CURRENT_SIZE to Size::Word before parsing a data directive 2023-02-01 21:22:24 +01:00
.gitignore Add .gitignore 2022-06-21 00:08:44 -07:00
build.rs fox32asm: Show version info on startup 2022-01-27 18:35:15 -08:00
Cargo.lock Add mse, mcl, and tlb instructions, bump version to 0.3.0 2022-08-15 17:22:40 -07:00
Cargo.toml Add mse, mcl, and tlb instructions, bump version to 0.3.0 2022-08-15 17:22:40 -07:00
LICENSE Add LICENSE 2022-01-31 01:51:26 -08:00
README.md Prepare for the 1st release 2022-07-31 17:20:28 -07:00

fox32asm

fox32asm is a work-in-progress assembler for fox32.

Getting Started

Stable releases are available on the Releases page.

Prebuilt binaries of the latest commit are also available on the GitHub Actions page.

Usage

fox32asm expects arguments in the following order: fox32asm <input> <output>

<output> should end in the file extension .fxf if building a relocatable FXF binary, otherwise a raw binary will be generated instead.

License

This project is licensed under the MIT license.