From 1e02d840e8ba63be0f41d7db278bb39b7141d4fd Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 29 Dec 2020 21:19:41 -0800 Subject: [PATCH] 7471 --- README.md | 7 +++++++ baremetal/ex2.mu | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2db68db8..6d241c68 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,13 @@ Here's an example program in Mu: ex2.mu +To reproduce it: + +```sh +$ ./translate_mu_baremetal baremetal/ex2.mu # emit disk.img +$ qemu-system-i386 disk.img +``` + [More details on Mu syntax →](mu.md) Here's an example program in SubX: diff --git a/baremetal/ex2.mu b/baremetal/ex2.mu index 091cb1d0..4e0f20ae 100644 --- a/baremetal/ex2.mu +++ b/baremetal/ex2.mu @@ -15,12 +15,12 @@ fn main { { compare y, 0x300 # 768 break-if->= - var color/ecx: int <- copy y - color <- and 0xff var x/edx: int <- copy 0 { compare x, 0x400 # 1024 break-if->= + var color/ecx: int <- copy x + color <- and 0xff pixel 0, x, y, color x <- increment loop