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-09-01 23:03:50 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-01 23:03:50 -0700
commita6517ed821ff39fa56eb3b975799d22497d78a48 (patch)
treeb934f09748be6c9dce80d4caf926d0f8dd2c9916 /subx/examples/ex4.subx
parentf39c01128dfc6e46828cbab992d4b9e0ba1cb1e5 (diff)
downloadmu-a6517ed821ff39fa56eb3b975799d22497d78a48.tar.gz
4535 - support for global variable names
Diffstat (limited to 'subx/examples/ex4.subx')
-rw-r--r--subx/examples/ex4.subx7
1 files changed, 4 insertions, 3 deletions
diff --git a/subx/examples/ex4.subx b/subx/examples/ex4.subx
index 2f5b0e73..89b3bdc9 100644
--- a/subx/examples/ex4.subx
+++ b/subx/examples/ex4.subx
@@ -13,7 +13,7 @@
   # fd = 0 (stdin)
   bb/copy                                                                                                                         0/imm32           # copy 0 to EBX
   # initialize x (location to write result to)
-  b9/copy                                                                                                                         0x080490a7/imm32  # copy to ECX
+  b9/copy                                                                                                                         x/imm32           # copy to ECX
   # size = 1 character
   ba/copy                                                                                                                         1/imm32           # copy 1 to EDX
   # read(fd, x, size)
@@ -24,7 +24,7 @@
   # fd = 1 (stdout)
   bb/copy                                                                                                                         1/imm32           # copy 1 to EBX
   # initialize x (location to read from)
-  b9/copy                                                                                                                         0x080490a7/imm32  # copy to ECX
+  b9/copy                                                                                                                         x/imm32           # copy to ECX
   # size = 1 character
   ba/copy                                                                                                                         1/imm32           # copy 1 to EDX
   # write(fd, x, size)
@@ -35,7 +35,8 @@
   b8/copy                                                                                                                         1/imm32           # copy 1 to EAX
   cd/syscall                                                                                                                      0x80/imm8         # int 80h
 
-== 0x080490a7  # data segment
+== data
+x:
 00 00 00 00  # space for read() to write to
 
 # vim:ft=subx:nowrap