Fantasy 8Bit system (F8), is a fantasy 8bit console and a set of libraries for creating fantasy 8bit consoles.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
550B

  1. var mos6502 = require("./src/chip/MOS6502");
  2. var asm = new mos6502.Assembler();
  3. var src = "DEFINE TOPNT $44\n";
  4. src += "CLRMEM:\n";
  5. src += "LDA #$00 ;Set up zero value\n";
  6. src += "TAY ;Initialize index pointer\n";
  7. src += "CLRM1:\n";
  8. src += "STA (TOPNT),Y ;Clear memory location\n";
  9. src += "INY ;Advance index pointer\n";
  10. src += "DEX ;Decrement counter\n";
  11. src += "BNE CLRM1 ;Not zero, continue checking\n";
  12. src += "RTS ;Return\n"
  13. var res = asm.compile(src).result();
  14. console.log(res);