about summary refs log tree commit diff stats
path: root/subx/ex5.subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx/ex5.subx')
-rw-r--r--subx/ex5.subx10
1 files changed, 4 insertions, 6 deletions
diff --git a/subx/ex5.subx b/subx/ex5.subx
index 540d0315..bdbfe6f4 100644
--- a/subx/ex5.subx
+++ b/subx/ex5.subx
@@ -19,25 +19,23 @@
   ## read(stdin, x, 1)
   # fd = 0 (stdin)
   bb/copy                                                                                                                 0/imm32           # copy 0 to EBX
-  # set location to read character to
+  # initialize x (location to write result to)
   89/copy                         3/mod/direct    1/rm32/ECX                                  5/r32/EBP                                     # copy EBP to ECX
   # size = 1 character
   ba/copy                                                                                                                 1/imm32           # copy 1 to EDX
-  # syscall = read
+  # read(fd, x, size)
   b8/copy                                                                                                                 3/imm32           # copy 3 to EAX
-  # call
   cd/syscall                                                                                                              0x80/imm8         # int 80h
 
   ## write(stdout, x, 1)
   # fd = 1 (stdout)
   bb/copy                                                                                                                 1/imm32           # copy 1 to EBX
-  # set location of character to write out
+  # initialize x (location to read from)
   89/copy                         3/mod/direct    1/rm32/ECX                                  5/r32/EBP                                     # copy EBP to ECX
   # size = 1 character
   ba/copy                                                                                                                 1/imm32           # copy 1 to EDX
-  # syscall = write
+  # write(fd, x, size)
   b8/copy                                                                                                                 4/imm32           # copy 4 to EAX
-  # call
   cd/syscall                                                                                                              0x80/imm8         # int 80h
 
   ## exit(EBX)