Skip to content

Commit 53bf089

Browse files
committed
Major reworking of layout and purpose
1 parent 9cafeaf commit 53bf089

File tree

167 files changed

+113485
-150451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+113485
-150451
lines changed

.idea/modules.xml

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/assembler-runtime.xml

-12
This file was deleted.

.idea/runConfigurations/gen_check.xml

-11
This file was deleted.

.idea/vcs.xml

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

COPYRIGHT

+345-706
Large diffs are not rendered by default.

README.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
# assembler
22

3-
[assembler] provides a fast, build-time assembler for x86-64 instructions using a NASM-similar dialect. It provides an ability to embed the assembled machine code instructions as templates inside Rust code, so as to make specialized code generation as fast as possible. Relocation can then happen at runtime.
3+
[assembler] provides a fast, run-time assembler for x86-64 instructions using function calls for Rust. In using a design that Rust's Release build optimizations can work effectively with, it provides the ability to embed the assembled machine code instructions as templates inside Rust code, so as to make specialized code generation as fast as possible. Relocation can then happen at runtime.
44

55
Since it is very brittle to try to parse or integrate with Rust code at compile time, this crate tries to generate code at build time (or at runtime, if used lazily) by parsing strings. This allows one to keep assembler logic outside of Rust files, so enabling the use of regular assembler tools.
66

7-
8-
## Origin and Credits
9-
10-
[assembler] partly forks [dynasm] as of version 0.2.2 but with different goals and needs. [dynasm] is a superb Rust crate but is orientated around compile type code generation using compiler plugins.
11-
12-
[assembler] would not be possible with the extensive efforts of the authors of [dynasm], Alexander Stocko and CensoredUsername, for which the authors of this crate are extremely grateful. For the avoidance of doubt these authors retain copyright in their original and derived code.
13-
14-
157
## Licensing
168

17-
The license for this project is Mozilla Public License Version 2.0 (MPL-2.0), as it was for the source code of [dynasm] from which it was forked.
9+
The license for this project is Affero GNU Public License 3.0 (AGPL-3.0). Note that very early, unreleased versions of used source code forked from the [dynasm] project; this code is no longer in use within the code base. However, the authors of [assembler] are grateful to the authors of [dynasm] for the inspiration behind this work.
1810

1911

2012
[assembler]: https://github.com/lemonrock/assembler "assembler GitHub page"

workspace/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@
55
[workspace]
66
members = [
77
"assembler",
8-
"assembler-runtime",
9-
"gen"
108
]

workspace/assembler-runtime/.cargo

-1
This file was deleted.

workspace/assembler-runtime/src/Assembler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// A stateful assembler of the current stream of x64 instructions, labels and relocations.

workspace/assembler-runtime/src/ExecutableAnonymousMemoryMap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// Represents an executable memory map that can be used to generate program code into.

workspace/assembler-runtime/src/Label.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]

workspace/assembler-runtime/src/PushValue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// A value that can be made little-endian; wraps use if `u8.to_le()` and related values that, in the Rust standard library, are not defined using a trait.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
pub(crate) type AssemblyOffset = usize;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
pub(crate) type RelocationOffset = u8;

workspace/assembler-runtime/src/relocations/long/LongModeRelocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// A relocation suitable for long (64-bit) mode.

workspace/assembler-runtime/src/relocations/long/LongModeRelocationLocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
#[derive(Debug)]

workspace/assembler-runtime/src/relocations/long/LongModeRelocationSize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// A size suitable for a relocation in long (64-bit) mode.

workspace/assembler-runtime/src/relocations/long/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
use super::*;

workspace/assembler-runtime/src/relocations/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55

workspace/assembler-runtime/src/relocations/protected/ProtectedModeRelocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// A relocation suitable for protected (32-bit) mode.

workspace/assembler-runtime/src/relocations/protected/ProtectedModeRelocationKind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// The kind of relocation for protected (32-bit) mode.

workspace/assembler-runtime/src/relocations/protected/ProtectedModeRelocationLocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
#[derive(Debug)]

workspace/assembler-runtime/src/relocations/protected/ProtectedModeRelocationSize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
/// A size suitable for a relocation in protected (32-bit) mode.

workspace/assembler-runtime/src/relocations/protected/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of assembler. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2-
// Copyright © 2017 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
2+
// Copyright © 2018 The developers of assembler. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/assembler/master/COPYRIGHT.
33

44

55
use super::*;

workspace/assembler/Cargo.toml

+5-12
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,15 @@
44

55
[package]
66
name = "assembler"
7-
description = "assembler"
8-
keywords = ["assembler"]
9-
license = "MPL-2.0"
10-
authors = ["Raphael Cohn <[email protected]>", "Alexander Stocko <[email protected]>", "CensoredUsername <[email protected]>"]
7+
description = "An efficient run-time assembler for X86-64 code that is intended to be immediately executed"
8+
keywords = ["assembler", "X86", "AMD64"]
9+
categories = ["encoding", "hardware-support"]
10+
license = "AGPL-3.0"
11+
authors = ["Raphael Cohn <[email protected]>"]
1112
homepage = "https://github.com/lemonrock/assembler"
1213
repository = "https://github.com/lemonrock/assembler.git"
1314
exclude = ["*"]
1415
include = ["README.md", "LICENSE", "COPYRIGHT", "src/**/*.rs", "Cargo.toml", "rustfmt.toml", "clippy.toml"]
15-
# Relative to Cargo.toml
1616
readme = "README.md"
1717
publish = false
1818
version = "0.0.0"
19-
20-
[dependencies]
21-
arrayvec = "^0.4"
22-
bitflags = "^1.0"
23-
either = "^1.5"
24-
phf = "^0.7"
25-
phf_macros = "^0.7"

0 commit comments

Comments
 (0)