var mos6502 = require("./src/MOS6502.js"); var asm = new mos6502.Assembler(); var src = "DEFINE TOPNT $44\n"; src += "CLRMEM:\n"; src += "LDA #$00 ;Set up zero value\n"; src += "TAY ;Initialize index pointer\n"; src += "CLRM1:\n"; src += "STA (TOPNT),Y ;Clear memory location\n"; src += "INY ;Advance index pointer\n"; src += "DEX ;Decrement counter\n"; src += "BNE CLRM1 ;Not zero, continue checking\n"; src += "RTS ;Return\n" var res = asm.compile(src).result(); console.log(res);