Skip to content

Commit

Permalink
Merge pull request #6 from thinkbeforecoding/rename-fasmi
Browse files Browse the repository at this point in the history
Rename project to fasmi
  • Loading branch information
aloisdg authored Jul 1, 2021
2 parents 91accc9 + 98674a0 commit cf7c16e
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Project name to pack and publish
PROJECT_NAME: fasm
PROJECT_NAME: fasmi
# GitHub Packages Feed settings
GITHUB_FEED: https://nuget.pkg.github.com/d-edge/
GITHUB_USER: thinkbeforecoding
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# fasm
# fasmi

A F# to Jitted ASM / IL disassembler as a dotnet tool

![fasm demo](img/fasm-demo.gif)
![fasmi demo](img/fasmi-demo.gif)

# Getting Started

Install fasm as a global dotnet tool
Install fasmi as a global dotnet tool

``` bash
dotnet tool install fasm -g
dotnet tool install fasmi -g
```

or as a dotnet local tool

``` bash
dotnet new tool-manifest
dotnet tool install fasm
dotnet tool install fasmi
````

# Quickstart
Expand All @@ -27,9 +27,9 @@ Create a demo.fsx F# interactive script:
let inc x = x+1
```

run fasm:
run fasmi:
``` bash
dotnet fasm ./demo.fsx
dotnet fasmi ./demo.fsx
```

and open at the generated demo.asm file:
Expand All @@ -42,9 +42,9 @@ L0003: ret

## Watch mode

run fasm in watch mode:
run fasmi in watch mode:
``` bash
dotnet fasm ./demo.fsx -w
dotnet fasmi ./demo.fsx -w
```

Open the demo.fsx and demo.asm files side by side in your favorite editor, make changes to demo.fsx and save. The demo.asm file is updated on the fly.
Expand All @@ -53,7 +53,7 @@ Open the demo.fsx and demo.asm files side by side in your favorite editor, make
# Usage

```
USAGE: dotnet fasm [--help] [--console] [--output <string>] [--watch] [--platform <x86|x64>] [--language <asm|il>] <string>
USAGE: dotnet fasmi [--help] [--console] [--output <string>] [--watch] [--platform <x86|x64>] [--language <asm|il>] <string>

SOURCE:

Expand All @@ -75,7 +75,7 @@ OPTIONS:
The input can be a fsx F# script file or any dotnet .dll assemlby file. F# scripts are compiled for net 5.0.
Using a dotnet assembly as an input, you can use fasm on any dotnet language.
Using a dotnet assembly as an input, you can use fasmi on any dotnet language.
## Console
Expand All @@ -87,7 +87,7 @@ Use the `-o` flag to specifie the target file path and name.
## Watch
The `-w` flag runs fasm in watch mode. The file is recompiled and disassembled automatically when saved.
The `-w` flag runs fasmi in watch mode. The file is recompiled and disassembled automatically when saved.
## Platform
Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.2.0
* Rename project to fasmi

# 0.1.0
* x86/x64 disassembler
* IL disassembler
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ dotnet test
IF %ERRORLEVEL% NEQ 0 (
exit %ERRORLEVEL%
)
dotnet pack -c release .\src\fasm\ -o bin/nuget
dotnet pack -c release .\src\fasmi\ -o bin/nuget
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dotnet tool restore
dotnet test || exit 1
dotnet pack -c release ./src/fasm/ -o bin/nuget
dotnet pack -c release ./src/fasmi/ -o bin/nuget
13 changes: 10 additions & 3 deletions fasm.sln → fasmi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ VisualStudioVersion = 16.6.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BE1E57A8-58BB-4372-8117-0495C049AF19}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fasm", "src\fasm\fasm.fsproj", "{BB23E9C3-8766-4F75-B4C8-2A3F033613E6}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fasmi", "src\fasmi\fasmi.fsproj", "{BB23E9C3-8766-4F75-B4C8-2A3F033613E6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{478F44FE-81BE-41A8-B0D7-1FD9C7D785CD}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fasm.tests", "tests\fasm.tests\fasm.tests.fsproj", "{25B5CA7F-0025-41E1-BC58-CB8FA7888721}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fasmi.tests", "tests\fasmi.tests\fasmi.tests.fsproj", "{25B5CA7F-0025-41E1-BC58-CB8FA7888721}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fasm.tests.source", "tests\fasm.tests.source\fasm.tests.source\fasm.tests.source.fsproj", "{74A37C7F-AEDC-48DC-939B-4392BE7FA623}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fasmi.tests.source", "tests\fasmi.tests.source\fasmi.tests.source.fsproj", "{74A37C7F-AEDC-48DC-939B-4392BE7FA623}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{FB7EF8B5-BDF3-4169-8634-C6E704AE513D}"
ProjectSection(SolutionItems) = preProject
paket.dependencies = paket.dependencies
README.md = README.md
RELEASE_NOTES.md = RELEASE_NOTES.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes
Binary file renamed img/fasm.png → img/fasmi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/fasm/Program.fs → src/fasmi/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let shouldCompile = function
| Assembly _ -> false


let help = """fasm F# -> ASM disassembler
let help = """fasmi F# -> ASM disassembler
----------------------------------------------------------
copyright D-EDGE 2021
Inspired from https://sharplab.io/ code by Andrey Shchekin
Expand All @@ -47,9 +47,9 @@ Inspired from https://sharplab.io/ code by Andrey Shchekin
let getProcessName() =
let name = IO.Path.GetFileNameWithoutExtension (Diagnostics.Process.GetCurrentProcess().MainModule.FileName )
if String.Equals(name, "dotnet", StringComparison.OrdinalIgnoreCase) then
"dotnet fasm"
"dotnet fasmi"
else
"fasm"
"fasmi"

[<EntryPoint>]
let main argv =
Expand Down
12 changes: 6 additions & 6 deletions src/fasm/fasm.fsproj → src/fasmi/fasmi.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<PackAsTool>true</PackAsTool>
<ToolCommandName>fasm</ToolCommandName>
<ToolCommandName>fasmi</ToolCommandName>
<PackageOutputPath>./nuget</PackageOutputPath>
<Authors>Jérémie Chassaing</Authors>
<Company>D-Edge</Company>
<Description>F# jit disassembler</Description>
<Copyright>Copyright (c) 2021 D-EDGE</Copyright>
<RepositoryUrl>https://github.com/d-edge/fasm</RepositoryUrl>
<RepositoryUrl>https://github.com/d-edge/fasmi</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageType>DotNetCliTool</PackageType>
<PackageIcon>fasm.png</PackageIcon>
<PackageProjectUrl>https://github.com/d-edge/fasm</PackageProjectUrl>
<RepositoryUrl>https://github.com/d-edge/fasm</RepositoryUrl>
<PackageIcon>fasmi.png</PackageIcon>
<PackageProjectUrl>https://github.com/d-edge/fasmi</PackageProjectUrl>
<RepositoryUrl>https://github.com/d-edge/fasmi</RepositoryUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="FileSystem.fs" />
<Compile Include="Compilation.fs" />
<Compile Include="Disassembly.fs" />
<Compile Include="Program.fs" />
<None Include="..\..\img\fasm.png" Pack="true" PackagePath="" />
<None Include="..\..\img\fasmi.png" Pack="true" PackagePath="" />
<None Include="..\..\LICENSE" Pack="true" PackagePath="" />
<None Include="paket.references" />
</ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/fasm.tests/Tests.fs → tests/fasmi.tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ module Assert =
let EqualString(x, y) = Assert.Equal(normalizeLineEnds x, normalizeLineEnds y)


// disassemble en single method from the fasm.tests.source project
// disassemble en single method from the fasmi.tests.source project
// notice that this project is *ALWAYS* compiled in release to produce
// the same optimized IL.
let disassembleFromSourceProject methodName =
use ctx = new Disassembly.CustomAssemblyLoadContext(fun _ -> true)
let asm = ctx.LoadFromAssemblyPath(Environment.CurrentDirectory </> "fasm.tests.source.dll")
let asm = ctx.LoadFromAssemblyPath(Environment.CurrentDirectory </> "fasmi.tests.source.dll")

let mth = asm.GetType("Source").GetMethod(methodName)
if isNull mth then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<Compile Include="Tests.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\fasm\fasm.fsproj" />
<ProjectReference Include="..\fasm.tests.source\fasm.tests.source\fasm.tests.source.fsproj" />
<ProjectReference Include="..\..\src\fasmi\fasmi.fsproj" />
<ProjectReference Include="..\fasmi.tests.source\fasmi.tests.source.fsproj" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
File renamed without changes.

0 comments on commit cf7c16e

Please sign in to comment.