Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments and tests. #4

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 73 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ The assembly code is assembled in compile time, and embedded as a code generator

## supported instructions

### general register operation
### general register operations

#### quad word operation
#### quad word operations

- movq
- lea
Expand All @@ -57,19 +57,29 @@ The assembly code is assembled in compile time, and embedded as a code generator
- andq
- subq
- xorq
- cmpq
- xchgq

- negq

- imul
- idiv
- div
- cqo

- shlq
- shrq

- cmpq
- salq
- sarq
- rolq
- rorq

- testq

- lzcntq
- tzcntq
- popcntq

- seteq
- setne
- setgt
Expand All @@ -81,32 +91,85 @@ The assembly code is assembled in compile time, and embedded as a code generator
- setb
- setbe

#### double word operation
#### double word operations

- movl
- movsxl

- addl
- orl
- adcl
- sbbl
- andl
- subl
- xorl
- cmpl
- xchgl

#### word operation
#### word operations

- movw
- movzxw
- movsxw

#### byte operation
- addw
- orw
- adcw
- sbbw
- andw
- subw
- xorw
- cmpw
- xchgw

#### byte operations

- movb
- movzxb
- movsxb

- addb
- orb
- adcb
- sbbb
- andb
- subb
- xorb
- cmpb
- xchgb

- testb

### floating point operation
### conditional move operations

- cmovbq
- cmovaeq
- cmoveqq
- cmovneq
- cmovbeq
- cmovaq
- cmovsq
- cmovnsq
- cmovltq
- cmovgeq
- cmovleq
- cmovgtq

### floating point operations

- movsd
- addsd
- subsd
- mulsd
- divsd
- xorps
- cvtsi2sdq
- ucomisd

### stack operation
- sqrtpd
- sqrtsd

### stack operations

- pushq
- popq
Expand All @@ -131,6 +194,7 @@ The assembly code is assembled in compile time, and embedded as a code generator

- syscall
- leave
- int3

### constant data

Expand Down
4 changes: 2 additions & 2 deletions gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def self.make_file(inst, size)

gen(inst, size)

f = File.open "monoasm/tests/#{inst}.rs", "w"
f = File.open "monoasm/tests/gen_#{inst}.rs", "w"
f.write @monoasm + footer(inst)
f.close

Expand Down Expand Up @@ -464,4 +464,4 @@ def self.gen(inst, size)
end
`rm monoasm/tests/*.bin`
`rm monoasm/tests/*.s`
#`rm monoasm/tests/*.rs`
`rm monoasm/tests/gen_*.rs`
Loading
Loading