Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arm-assembler

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arm-assembler

translates an array of assembler instructions into arm32 machine code

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

arm-assembler

turn arm32 assembler instructions into binary machine-code

Prerequisistes

You need to have the arm-eabi-toolchain installed

Usage

var through = require('through');
var test = require('tape');
var asm = require('.');

test('shoudl assemble single instruction when given a string', function(t) {
    t.plan(4);
    asm('MOVEQ r0, r1, LSL r2', function(err, i) {
        t.equal(err, null);
        t.equal(i.toString(16), '1a00211');
    });
    asm('MOV r0, r1, LSL r2', function(err, i) {
        t.equal(err, null);
        t.equal(i.toString(16), 'e1a00211');
    });
});

test('shoudl return stream when given a stream', function(t) {
    var tr = through(function(d) {this.push(d);});
    var out = asm(tr);
    var i = 0;
    t.plan(3);
    out.on('data', function(data) {
        if (i===0) {
            t.equal(data.toString(16), '1a00211');
            i++;
        } else {
            t.equal(data.toString(16), 'e1a00211');
            i++;
        }
    }).on('end', function() {
        t.equal(i,2);
    });

    tr.write('MOVEQ r0, r1, LSL r2');
    tr.write('MOV r0, r1, LSL r2');
    tr.end();
});

Keywords

FAQs

Package last updated on 06 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc