npm package: @nirguna/plugin-fasm
Description: 🐊nirguna plugin adds ability to optimize fasm
Author: coderaiser
Latest version: 1.5.5

## putout-plugin-fasm

Transforms:

- ✅[`add-label-refix`](https://putout.cloudcmd.io/#/gist/2123b2e3a71354a60f65e11e5f809c24/19c063b0fd95f2198f76daf43c466c3ad846e37a);
- ✅[`apply-cmp`](https://putout.cloudcmd.io/#/gist/d1520a4277ef2149bfc98d777108d400/99853b56f55c65c8e965d06740127d78288f5aa7);
- ✅[`apply-include`](https://putout.cloudcmd.io/#/gist/ad5ac3ef4892c5d8365163fb6adc8547/e186cc7911b5b407bf824ea850074950c15a9e19);
- ✅[`apply-registers`](https://putout.cloudcmd.io/#/gist/7219eaf624623d9a80d3e8f90bb3a498/8f2606c8f5ef483ed9ec5cecbaaa041e6e327455);
- ✅[`apply-inc`](https://putout.cloudcmd.io/#/gist/467983456ef5496f892e74d0972f56a7/f1836597cb21bd7955f6fd62412ff360ad2cafc8);
- ✅[`move-vars-to-bottom`](https://putout.cloudcmd.io/#/gist/3e3b83e6e23650d819e56b88f961051c/89ef3eafd926e14736ddc244d044de47709c8b69);
- ✅[`move-equ-to-bottom`](https://putout.cloudcmd.io/#/gist/de37a39902edaa97b981d7484dd67052/70c423b9d177774482bd4dacbafd8723defb2f3a);
- ✅[`convert-equ-call-to-member`](https://putout.cloudcmd.io/#/gist/94c8110db310e6979c2fdc1c9311337a/6a17fab68cdf7adbd17952b7fead658599489c9c);
- ✅[`convert-assign-to-member`](https://putout.cloudcmd.io/#/gist/7624d8ad5507586ba4ba25f30a9ae26b/085ae7ea6a1c449013fd5806c390ac1ce5eb1c17);
- ✅[`convert-assign-to-add`](https://putout.cloudcmd.io/#/gist/043e2fec17734c5671a8528091d1275b/f200da1222cdd86fee5fd3125a67f2d0703391d7);
- ✅[`convert-assign-to-sub`](https://putout.cloudcmd.io/#/gist/6543aba90ae4ac95b5fb7a79c0314f25/9eb8259ffa611b714ebd4b2e7be5ca124aae7e18);
- ✅[`convert-assign-to-mov`](https://putout.cloudcmd.io/#/gist/1e4a2f439d20fe7cad91d75881bce08a/e5dc7cad875e4be3faafb47f384115cf28a62d25);
- ✅[`convert-assign-to-xor`](https://putout.cloudcmd.io/#/gist/1e4a2f439d20fe7cad91d75881bce08a/e5dc7cad875e4be3faafb47f384115cf28a62d2);
- ✅[`convert-assign-to-shl`](https://putout.cloudcmd.io/#/gist/e7b609200727bb78cfa073c0c1220c46/da0309ac125855533f7e0baa332b0670fd46f6b2);
- ✅[`convert-assign-to-add`](https://putout.cloudcmd.io/#/gist/0e35a6cf08cb74aafa30810133bfa062/91f9cdf97b3884747e1c0a0b9521a8fc6cd067b2);
- ✅[`convert-assign-to-or`](https://putout.cloudcmd.io/#/gist/a456caa9f956fdb8b19f21065de96209/c411fb6937fd37d5d97cd72a2740b897b0c30092);
- ✅[`convert-args-to-regs`](https://putout.cloudcmd.io/#/gist/7d76d789c35b33dfacc149e32214537f/c35a2f0fe80b6a4c00bbb99249562069d072fc64);
- ✅[`convert-bios-clear-screen-to-int-10`](https://putout.cloudcmd.io/#/gist/602d579a76cf38b5927f0207ee4bcf98/a31a08ce34e4a83ca909a9afc2ec76533ded8c82);
- ✅[`convert-bios-print-line-to-int-10`](https://putout.cloudcmd.io/#/gist/d87efe4df8f505162e7d922c4fbacd9b/24b97107a50d00df0f012fed507d47aafb5109e2);
- ✅[`convert-bios-read-char-to-int-16`](https://putout.cloudcmd.io/#/gist/d87efe4df8f505162e7d922c4fbacd9b/af89e4d564811f38b703f482469f5d874a17bad0);
- ✅[`convert-bios-read-sector-int-13`](https://putout.cloudcmd.io/#/gist/6ae8820756ba1af043f93f3bdb49360e/a575cf6f5432ca215838795c2617c161f2b981cb);
- ✅[`convert-bios-scroll-to-int-10`](https://putout.cloudcmd.io/#/gist/d87efe4df8f505162e7d922c4fbacd9b/95520a650428a2defd77a65ffc255a073540d902);
- ✅[`convert-bios-reboot-to-jmp-far`](https://putout.cloudcmd.io/#/gist/44a87987c4d6d3130b5004f8818a3454/4c6dd61184b46c60b8d8dc653232d567238ea865);
- ✅[`convert-linux-write-to-syscall`](https://putout.cloudcmd.io/#/gist/f036440b0d8c59b32af823511cfea395/b4483ea5a2731c3cff571ce7a6cf45e77f8b49be);
- ✅[`convert-linux-exit-to-syscall`](https://putout.cloudcmd.io/#/gist/f94a1ce412b33d8e259a9024a0666600/926ae2e4906f6bcacce61725055d429a840d7d3d);
- ✅[`convert-const-to-equ`](https://putout.cloudcmd.io/#/gist/c0d18aa7138e0e238d41051a2929311a/b45ad43ce7738390f6af9479536b145fdaebf84c);
- ✅[`convert-strncmp-to-repe-cmsb`](https://putout.cloudcmd.io/#/gist/397388e71e71442d3dd5bebd3a424da6/8eb60aaaf4b5afb85f87ddcd0af51266db158263);
- ✅[`convert-ternary-to-if`](https://putout.cloudcmd.io/#/gist/4a48fb3a515ef5947032f344b65a0db3/18cf1b250156953febbb8ac5652ce8f40b1192b7);
- ✅[`convert-function-to-label`](https://putout.cloudcmd.io/#/gist/415829430c67b2824c26901b2cc89fb0/ed8a2186889a0135302bbb64fee0a9ce2d084800);
- ✅[`convert-if-to-jmp`](https://putout.cloudcmd.io/#/gist/415829430c67b2824c26901b2cc89fb0/ed8a2186889a0135302bbb64fee0a9ce2d084800);
- ✅[`convert-return-to-eax`](https://putout.cloudcmd.io/#/gist/72dfce2332d04829b70703b389464840/75d1d02c87506a2125e44ee24797240293a3a27b);
- ✅[`convert-await-to-call`](https://putout.cloudcmd.io/#/gist/0ec93b79f05e36b8ed54e79acd5813d1/e1210ac63069d81dd5f679b324ad82b49a2f25ad);
- ✅[`convert-do-while-to-jnz`](https://putout.cloudcmd.io/#/gist/fe11c0afb23c53585fcb55189593a07a/f194c349cd774d5ab49e0e198c2855e1bb8be6ac);
- ✅[`convert-while-to-jz`](https://putout.cloudcmd.io/#/gist/6be739dd8e167c8a1b1a72a1830a4920/c24d22911ea61d74fb5391c4cc31821da4055116);
- ✅[`convert-ureg-to-reg`](https://putout.cloudcmd.io/#/gist/794275bc0cf83432615333b1e41f1975/bac80042b461cb09d8f83402de6fd1f1dafb465c);
- ✅[`convert-mov-to-add`](https://putout.cloudcmd.io/#/gist/2f03076ac9a794c880fcbadcc1cd502d/145f3e930f9514b79adc47076354f2203476607f);
- ✅[`convert-declaration-to-mov`](https://putout.cloudcmd.io/#/gist/184b75da1a92ae554b522d004c520017/689ff370e4b20204957a22f499d6f963614b7afb);
- ✅[`extract-labeled-block`](https://putout.cloudcmd.io/#/gist/033921790a761eef2361aa8b4708e29e/e0e0eb1aa41791c2c01e858f7c198f1a408c6418);
- ✅[`split-stack-operations`](https://putout.cloudcmd.io/#/gist/e7b609200727bb78cfa073c0c1220c46/da0309ac125855533f7e0baa332b0670fd46f6b2);
- ✅[`split-assign-await-with-assign-eax`](https://putout.cloudcmd.io/#/gist/ad1520cf5e626eb1cc01befa9e900cd1/9392f49641b09d50ea2d29d514b3ab253b21897c);
- ✅[`split-includes-to-if-sequence`](https://putout.cloudcmd.io/#/gist/c4bb3027d59f8944bf74497c29748e11/b02931a656b047aec9618fe1fbc03fcf08ef81af);
- ✅[`remove-useless-declarations`](https://putout.cloudcmd.io/#/gist/9045b99fbb58a53047dec060d3f143cf/d858e357b7b1e01f366943ed8887e8dc26bb37d8);
- ✅[`remove-useless-braces`](https://putout.cloudcmd.io/#/gist/140689014540d48d501c1fa50b3694ca/e1521db4f951c38c17a6c3af46456c47f1f3a1a8);
- ✅[`remove-useless-promise`](https://putout.cloudcmd.io/#/gist/d21eb87bc77b53e54c28b1ae8442a403/1b35064142068e623a564f578517c2aace55ceba);
- ✅[`switch-cmp-operands`](https://putout.cloudcmd.io/#/gist/cdf71331f1024c9c966d4756c6159684/9d3f2ebeb41cd096de7919f0c39bc75cbaf5ce0c);
- ✅[`insert-target`](https://putout.cloudcmd.io/#/gist/e7e3f495fdfde1b065117fc0ae41873c/b6fe3dc81d33c81d332ce5d551b8a2fb40b63d70);

## convert-ureg-to-reg

Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/794275bc0cf83432615333b1e41f1975/bac80042b461cb09d8f83402de6fd1f1dafb465c).

### ❌ Example of incorrect code

```ts
'use 64';

function getStringLength(str): ureg {
    const usi = str;
    let ucx = 0;
    const al = 1;
    
    while (al) {
        lodsb();
        ++ucx;
    }
    
    return ucx;
}
```

### ✅ Example of correct code

```ts
function getStringLength(str): i64 {
    const rsi = str;
    let rcx = 0;
    const al = 1;
    
    while (al) {
        lodsb();
        ++rcx;
    }
    
    return rcx;
}
```

## License

MIT