Skip to content

Commit d27d095

Browse files
committed
Refactors, bump to 0.1.2
Added "hello" example, essentially dasm's hello world. Added "print" function and returning expressions to tinylisp. Refactored function generator to use a build folder rather than a single file. This was done since some x86 functions are indeed incompatible with amd64, and it's nicer to split up the code regardless since it would be needed with future architectures anyway. Also fixed my incorrect register names in the examples (rsp/rbp used instead of rsi/rdi). Apologies for the giant commit, will try to avoid this in the future.
1 parent 64ed409 commit d27d095

File tree

19 files changed

+471
-430
lines changed

19 files changed

+471
-430
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
name = "dasm"
33
authors = ["David Cruz <[email protected]>"]
44
description = "A tiny, zero dependency assembler"
5-
version = "0.1.1"
5+
version = "0.1.2"
66
edition = "2021"
77
keywords = ["assembler", "jit", "dasm", "x86", "codegen"]
88
categories = ["os", "no-std", "no-std::no-alloc"]
99
repository = "https://github.com/DvvCz/dasm"
1010
license = "GPL-3.0"
11+
build = "build/main.rs"
1112

1213
[features]
1314
default = ["std", "mmap"]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ Despite how it sounds, it is pretty nice to use on its own.
4040

4141
```rust
4242
let rax = 0;
43-
let rsp = 6; // Argument 2
44-
let rbp = 7; // Argument 1
43+
let rsi = 6; // Argument 2
44+
let rdi = 7; // Argument 1
4545

4646
let asm = [
47-
&dasm::tier::raw::amd64::mov_r64_r64(rax, rbp) as &[u8],
48-
&dasm::tier::raw::amd64::add_r64_r64(rax, rsp),
47+
&dasm::tier::raw::amd64::mov_r64_r64(rax, rdi) as &[u8],
48+
&dasm::tier::raw::amd64::add_r64_r64(rax, rsi),
4949
&dasm::tier::raw::amd64::ret()
5050
].concat();
5151

0 commit comments

Comments
 (0)