From 113bae7311b63e55e55160970718d19bfeeb56c3 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 1 Jan 2020 17:23:29 -0800 Subject: 5856 --- html/examples/ex4.subx.html | 99 --------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 html/examples/ex4.subx.html (limited to 'html/examples/ex4.subx.html') diff --git a/html/examples/ex4.subx.html b/html/examples/ex4.subx.html deleted file mode 100644 index 43f5c705..00000000 --- a/html/examples/ex4.subx.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - -Mu - examples/ex4.subx - - - - - - - - - - -https://github.com/akkartik/mu/blob/master/examples/ex4.subx -
- 1 # Read a character from stdin, save it to a global, write it to stdout.
- 2 #
- 3 # To run:
- 4 #   $ ./subx translate init.linux examples/ex4.subx -o examples/ex4
- 5 #   $ ./subx run examples/ex4
- 6 
- 7 == data
- 8 
- 9 # the global variable we save to
-10 X:
-11     0/imm32  # space for read() to write to
-12 
-13 == code
-14 
-15 Entry:
-16 # read(stdin, X, 1)
-17 # . fd = 0 (stdin)
-18 bb/copy-to-ebx  0/imm32
-19 # . data = X (location to write result to)
-20 b9/copy-to-ecx  X/imm32
-21 # . size = 1 character
-22 ba/copy-to-edx  1/imm32
-23 # . syscall
-24 e8/call  syscall_read/disp32
-25 
-26 # write(stdout, X, 1)
-27 # . fd = 1 (stdout)
-28 bb/copy-to-ebx  1/imm32
-29 # . initialize X (location to read from)
-30 b9/copy-to-ecx  X/imm32
-31 # . size = 1 character
-32 ba/copy-to-edx  1/imm32
-33 # . syscall
-34 e8/call  syscall_write/disp32
-35 
-36 # exit(ebx)
-37 e8/call  syscall_exit/disp32
-38 
-39 # . . vim:nowrap:textwidth=0
-
- - - -- cgit 1.4.1-2-gfad0 >
23