Skip to content

Commit c5d361c

Browse files
authored
Update code in README
1 parent 39f09be commit c5d361c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ git clone https://github.com/quickwrite/luasm.git
2323
Or, if you just need the file:
2424

2525
```lua
26-
-- In your project directory
27-
luasm.lua # <-- the file you just saw
28-
```
29-
30-
No external libraries are required; the code runs on any Lua interpreter (5.1, 5.2, 5.3, LuaJIT, etc.).
26+
local LuASM = require("luasm")
3127

32-
## Quick Start
33-
```lua
3428
-- 1. Define the instruction set
3529
local instructions = {
3630
LuASM.instruction("mov", {"imm", "reg"}, {}),
@@ -48,7 +42,7 @@ start: mov 10 r0
4842
add r0 r1
4943
jmp start
5044
]]
51-
local tokenizer = LuASM.string_tokenizer(src)
45+
local tokenizer = asm:string_tokenizer(src)
5246

5347
-- 4. Parse
5448
local result = asm:parse(tokenizer)

0 commit comments

Comments
 (0)