ILAssembler
ILAssembler copied to clipboard
ILAsm-like DSL for PowerShell
- [ ] Variables from `.locals` - [ ] Tool tips for opcodes - [ ] `calli` calling convention completion - [ ] `init` keyword completion in `.locals` - [...
e.g. `ldc.i4.s 'c'` would be translated to `ldc.i4.s 99`
Incredibly useful for testing p/invoke without having to throw together a quick `Add-Type` ~~(plus no `unsafe` with `Add-Type` afaik).~~ (**Edit:** there is)
```powershell $longToBytes = il { [byte[]]([long]) } { .locals init { [Span[byte]] $span } ldarga.s 0 sizeof { [long] } call { [Span[byte]] [Runtime.InteropServices.MemoryMarshal]::CreateSpan([g[byte]], [ref] [byte], [int]) } stloc.auto $span...