Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "ass-js", | ||
"description": "Assembler.js", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"keywords": [ | ||
"x86", | ||
"x64", | ||
"x86_64", | ||
"arm", | ||
"arm64", | ||
"native", | ||
"native-code", | ||
"machine-code", | ||
"asm", | ||
"compiler", | ||
"assembler" | ||
"x86", "x64", "x86_64", "arm", "arm64", | ||
"native", "native-code", "machine-code", "asm", "compiler", | ||
"assembler", "compiler", "intel", "amd", "nasm", | ||
"gasm" | ||
], | ||
@@ -22,3 +15,50 @@ "repository": { | ||
}, | ||
"main": "index.js" | ||
"main": "index.js", | ||
"devDependencies": { | ||
"mocha": "3.4.2", | ||
"chai": "4.1.0", | ||
"typescript": "2.4.2", | ||
"ts-node": "3.3.0", | ||
"gulp": "3.9.1", | ||
"gulp-typescript": "3.2.1", | ||
"source-map-support": "0.4.15", | ||
"nyc": "11.1.0", | ||
"watch": "^1.0.0", | ||
"@types/node": "^8.0.24", | ||
"@types/mocha": "^2.2.41", | ||
"@types/chai": "^4.0.3" | ||
}, | ||
"nyc": { | ||
"per-file": true, | ||
"include": [ | ||
"**/*.ts" | ||
], | ||
"exclude": [ | ||
"**/*.test.ts" | ||
], | ||
"extension": [ | ||
".ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"reporter": [ | ||
"text", | ||
"json", | ||
"lcov", | ||
"text-summary" | ||
], | ||
"sourceMap": true, | ||
"instrument": true, | ||
"cache": true | ||
}, | ||
"scripts": { | ||
"build": "npm run build-ts", | ||
"build-ts": "gulp build-ts", | ||
"test": "npm run test-basic-ts", | ||
"test-basic-ts": "mocha --require ts-node/register test/**/**/**/**/**/*.test.ts", | ||
"test-watch-ts": "mocha --require ts-node/register test/**/**/**/**/**/*.test.ts --watch", | ||
"test-coverage-ts": "nyc --per-file mocha --require ts-node/register --require source-map-support/register --full-trace --bail **/**/**/**/**/*.test.ts", | ||
"watch": "watch 'npm run build' ./src" | ||
} | ||
} |
@@ -5,29 +5,35 @@ # Assembler.js | ||
> THIS PACKAGE IS IN DEVELOPMENT, THERE ARE BUGS, SOME INSTRUCTIONS ARE MISSING. | ||
Store 25 in `RAX` register: | ||
```js | ||
import {rax, rbx} from 'ass-js/x86/operand'; // x86 registers that we will use. | ||
import {Code} from 'ass-js/x86/x64/code'; // Code object that will `.compile()` our code. | ||
import {rax} from 'ass-js/lib/x86/operand'; | ||
import {Code} from 'ass-js/lib/x86/x64/code'; | ||
var _ = Code.create(); | ||
_.mov(rax, rbx); | ||
console.log(_.compile()); | ||
console.log(_.toString()); | ||
const code = Code.create(); | ||
code._('mov', [rax, 25]); | ||
``` | ||
See supported instructions: | ||
Compile to machine code: | ||
```js | ||
_.table.createAll(); | ||
console.log(_.table.toString()); | ||
console.log(_.table.toJson()); | ||
const bin = code.compile(); | ||
console.log(bin); // [ 72, 199, 192, 25, 0, 0, 0 ] | ||
``` | ||
Goals: | ||
1. Create a generic assembler, first with `x86` support and then add `ARM` support. | ||
2. Full support for all `x86` instructions, including: *AVX*, *AVX-2* and *AVX-3* instructions. | ||
Show text representation: | ||
```js | ||
console.log(String(code)); | ||
``` | ||
## Examples | ||
See supported instructions: | ||
```js | ||
code.table.createAll(); | ||
console.log(code.table.toString()); | ||
console.log(code.table.toJson()); | ||
``` | ||
# Examples | ||
### Hello World | ||
@@ -221,8 +227,1 @@ | ||
008 db 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21, 0x0A; 00001F|00001F 13 bytes | ||
## Test | ||
mocha | ||
@@ -5,4 +5,10 @@ { | ||
"module": "commonjs", | ||
"removeComments": true | ||
} | ||
"removeComments": false, | ||
"noImplicitAny": false, | ||
"sourceMap": false | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"lib" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
326921
12
32
7600
2
1