about summary refs log tree commit diff stats
path: root/subx/examples/ex4.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-10-14 12:53:50 -0700
committerKartik Agaram <vc@akkartik.com>2018-10-14 12:53:50 -0700
commita9a5718d086d9df52b84b96a6ab4ee751dc26a5e (patch)
treeae28bcf9243aa220e529a1ffd8e7f67bd03041c8 /subx/examples/ex4.subx
parent0e0a90420e2e0b3a86b2fcaad08938b2feba6274 (diff)
downloadmu-a9a5718d086d9df52b84b96a6ab4ee751dc26a5e.tar.gz
4698
Diffstat (limited to 'subx/examples/ex4.subx')
-rw-r--r--subx/examples/ex4.subx10
1 files changed, 5 insertions, 5 deletions
diff --git a/subx/examples/ex4.subx b/subx/examples/ex4.subx
index 9e062cb2..6a9236eb 100644
--- a/subx/examples/ex4.subx
+++ b/subx/examples/ex4.subx
@@ -5,29 +5,29 @@
 #   $ subx run examples/ex4
 
 == code
-# read(stdin, x, 1)
+# syscall(read, stdin, x, 1)
   # fd = 0 (stdin)
 bb/copy-to-EBX  0/imm32
   # initialize x (location to write result to)
 b9/copy-to-ECX  x/imm32
   # size = 1 character
 ba/copy-to-EDX  1/imm32
-  # read(fd, x, size)
+  # syscall
 b8/copy-to-EAX  3/imm32/read
 cd/syscall  0x80/imm8
 
-# write(stdout, x, 1)
+# syscall(write, stdout, x, 1)
   # fd = 1 (stdout)
 bb/copy-to-EBX  1/imm32
   # initialize x (location to read from)
 b9/copy-to-ECX  x/imm32
   # size = 1 character
 ba/copy-to-EDX  1/imm32
-  # write(fd, x, size)
+  # syscall
 b8/copy-to-EAX  4/imm32/write
 cd/syscall  0x80/imm8
 
-# exit(EBX)
+# syscall(exit, EBX)
 b8/copy-to-EAX  1/imm32/exit
 cd/syscall  0x80/imm8