1
0
mirror of https://github.com/emkay/parser-6502.git synced 2024-12-03 17:50:10 +00:00

docs: fixing example and updating readme

This commit is contained in:
Michael Matuzak 2016-10-12 20:19:46 -07:00
parent 58794c50c6
commit a34eed5bd1
2 changed files with 41 additions and 3 deletions

View File

@ -1,6 +1,44 @@
# parser-6502
Parser for 6502 assembler
This is a parser written in javascript that will parse assembler written for the [6502 8-bit microprocessor](https://en.wikipedia.org/wiki/MOS_Technology_6502).
[![Build Status](https://travis-ci.org/emkay/parser-6502.svg?branch=master)](https://travis-ci.org/emkay/parser-6502)
[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
## Usage
```javascript
const fs = require('fs')
const parser = require('parser-6502')
const input = fs.readFileSync('./asm.s', 'utf-8')
const result = parser(input)
console.log(result)
```
## API
### result = parser(input)
```javascript
[
{
"directive": ".db",
"args": [
{
"binary": "00000001"
}
]
}
]
```
## Installation
`npm i paser-6502`
## License
MIT

View File

@ -1,5 +1,5 @@
const fs = require('fs')
const parser = require('.')
const input = fs.readFileSync('./example.s', 'utf-8')
const parser = require('..')
const input = fs.readFileSync(`${__dirname}/example.s`, 'utf-8')
const r = parser(input)
console.log(r)
console.log(r[102].args)