From 14a380525ed2df295463b1906b718cb26871df3b Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 30 Nov 2018 16:54:01 -0800 Subject: 4809 - subx: html with 5 colors for comments --- html/subx/examples/ex4.subx.html | 47 ++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'html/subx/examples/ex4.subx.html') diff --git a/html/subx/examples/ex4.subx.html b/html/subx/examples/ex4.subx.html index ed711834..4e442a60 100644 --- a/html/subx/examples/ex4.subx.html +++ b/html/subx/examples/ex4.subx.html @@ -11,13 +11,18 @@ @@ -52,7 +57,7 @@ if ('onhashchange' in window) {
- 1 ## read a character from stdin, save it to a global, write it to stdout
+ 1 # Read a character from stdin, save it to a global, write it to stdout.
  2 #
  3 # To run (from the subx directory):
  4 #   $ subx translate examples/ex4.subx -o examples/ex4
@@ -61,24 +66,24 @@ if ('onhashchange' in window) {
  7 == code
  8 
  9 # syscall(read, stdin, X, 1)
-10   # fd = 0 (stdin)
+10 # . fd = 0 (stdin)
 11 bb/copy-to-EBX  0/imm32
-12   # initialize X (location to write result to)
-13 b9/copy-to-ECX  X/imm32
-14   # size = 1 character
+12 # . data = X (location to write result to)
+13 b9/copy-to-ECX  X/imm32
+14 # . size = 1 character
 15 ba/copy-to-EDX  1/imm32
-16   # syscall
+16 # . syscall
 17 b8/copy-to-EAX  3/imm32/read
 18 cd/syscall  0x80/imm8
 19 
 20 # syscall(write, stdout, X, 1)
-21   # fd = 1 (stdout)
+21 # . fd = 1 (stdout)
 22 bb/copy-to-EBX  1/imm32
-23   # initialize X (location to read from)
-24 b9/copy-to-ECX  X/imm32
-25   # size = 1 character
+23 # . initialize X (location to read from)
+24 b9/copy-to-ECX  X/imm32
+25 # . size = 1 character
 26 ba/copy-to-EDX  1/imm32
-27   # syscall
+27 # . syscall
 28 b8/copy-to-EAX  4/imm32/write
 29 cd/syscall  0x80/imm8
 30 
@@ -88,10 +93,10 @@ if ('onhashchange' in window) {
 34 
 35 == data
 36 
-37 X:
-38   00 00 00 00  # space for read() to write to
+37 X:
+38     00 00 00 00  # space for read() to write to
 39 
-40 # vim:nowrap:textwidth=0
+40 # . . vim:nowrap:textwidth=0
 
-- cgit 1.4.1-2-gfad0