From 37d88ce1ec8d2fffa8fe356535131185f0d6ab3d Mon Sep 17 00:00:00 2001 From: James Prevett Date: Fri, 13 Dec 2024 23:41:56 -0600 Subject: [PATCH] More assembly formatting --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9486c67..34aba66 100644 --- a/README.md +++ b/README.md @@ -66,10 +66,11 @@ import { parse } from 'xcompile'; const ast = parse({ source: `# This is AT&T assembly -mov $100, %eax # move 100 into eax -mul $2, %eax # multiply the value in eax by 2 -mov %eax,0x1000 # move eax's value into memory -nop # do nothing + +mov $100, %eax # move 100 into eax +mul $2, %eax # multiply the value in eax by 2 +mov %eax,0x1000 # move eax's value into memory +nop # do nothing `, literals: [ { name: 'number', pattern: /^(0x)?\d+/ }, @@ -169,11 +170,13 @@ const json = JSON.parse(readFileSync('asm.json', 'utf-8')); const ast = parse({ ...config.parseJSON(json), - source: `# This is AT&T assembly -mov $100, %eax # move 100 into eax -mul $2, %eax # multiply the value in eax by 2 -mov %eax,0x1000 # move eax's value into memory -nop # do nothing + source: ` +# This is AT&T assembly + +mov $100, %eax # move 100 into eax +mul $2, %eax # multiply the value in eax by 2 +mov %eax,0x1000 # move eax's value into memory +nop # do nothing `, });