about summary refs log tree commit diff stats
path: root/html/example1.mu.html
Commit message (Collapse)AuthorAgeFilesLines
* 5485 - promote SubX to top-levelKartik Agaram2019-07-271-67/+0
|
* 4891Kartik Agaram2018-12-301-0/+1
| | | | | | | | | | | Couple more tweaks to html rendering: a) SubX definitions no longer link redundantly to themselves. This long-standing issue turns out to be tractable to solve for SubX files since the syntax is so simple. b) Fix links to SubX definitions in other directories. I forgot that I have to always generate tags from the directory of the file being linkified. c) Fix link colors. Before we lost all syntax highlighting for functions and Globals. Now they maintain their colors, just add an underline.
* 4890 - new html renderingsKartik Agaram2018-12-291-12/+7
| | | | | | | a) Switch to a light background. b) Linkify calls in .subx files. c) Keep all colorization in the Vim colorscheme, get rid of hacky special-cases in update_html.
* 4814Kartik Agaram2018-12-011-9/+12
|
* 4539Kartik Agaram2018-09-071-3/+3
|
* 4245 - fix example1.mu to actually runKartik Agaram2018-05-131-2/+6
| | | | | Thanks mahmudov on freenode IRC for the feedback! This was an embarrassing oversight right at the top of my Readme.
* 4239Kartik Agaram2018-05-081-3/+3
|
* 4200Kartik K. Agaram2018-01-271-1/+1
| | | | Forgot to set up exuberant_ctags_rc as .ctags on new laptop.
* 4199Kartik K. Agaram2018-01-251-2/+2
|
* 4161Kartik K. Agaram2017-12-151-4/+4
|
* 3764 - better colors for cross-linksKartik K. Agaram2017-03-081-3/+3
|
* 3761Kartik K. Agaram2017-03-071-1/+1
|
* 3725Kartik K. Agaram2016-12-271-1/+1
| | | | | | More improvements to cross-linking example programs. Include their own functions as well in the tags for each program, even as you share the core .mu files everywhere.
* 3716Kartik K. Agaram2016-12-261-0/+2
| | | | Make hyperlinks less salient in the rendered html since there's so many of them.
* 3710Kartik K. Agaram2016-12-261-5/+5
| | | | | Turns out we don't need to explicitly add anchors for each line. Vim's TOhtml has magic for that out of the box.
* 3709 - line numbers in htmlKartik K. Agaram2016-12-261-8/+32
| | | | | | Each line number also gets an anchor name, but I'm not hyperlinking them for now because I don't want to encourage bookmarking these links just yet. They aren't permalinks because every revision may change what's at any given line number.
* 3569Kartik K. Agaram2016-10-231-2/+2
| | | | Update syntax highlighting to not color numeric locations like literals.
* 3431Kartik K. Agaram2016-09-301-1/+1
| | | | | Improvements to syntax highlighting, particularly for Mu code in C++ files.
* 3395Kartik K. Agaram2016-09-171-1/+1
|
* 2812Kartik K. Agaram2016-03-271-7/+16
|
* 2745Kartik K. Agaram2016-03-091-1/+1
|
* 2744Kartik K. Agaram2016-03-091-1/+1
| | | | Tweak colors and font-sizes in generated html.
* 2743Kartik K. Agaram2016-03-091-17/+8
| | | | | Looks like "TOhtml | <other command>" doesn't work on Mac OS X for some reason..
* 2706 - update htmlKartik K. Agaram2016-02-251-0/+1
|
* 2430 - make room for more transformsKartik K. Agaram2015-11-131-0/+37
7d7d49044c73c8f7bdb050663d69d950dc7'>^
3fe714d3 ^
9372c16c ^
6602c82f ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
                                                                                   



                                 
 
       


                                                                                                                                               
 
       
          

                                                                                                                                                                     
                           
                                                                                                                                                                               
 

                     
                                                                                                                                                                   
                                                
                                                                                                                                                                     
                        
                                                                                                                                                                   
                       
                                                                                                                                                                   
                       
 

                       
                                                                                                                                                                   
                                          
                                                                                                                                                                     
                        
                                                                                                                                                                   
                        
                                                                                                                                                                   
                       
 
             
                                                                                                                                                                   
                       

                    
## read a character from stdin, save it to a local on the stack, write it to stdout
#
# To run:
#   $ subx translate ex5.subx ex5
#   $ subx run ex5

== code
# instruction                     effective address                                                   operand     displacement    immediate
# op          subop               mod             rm32          base        index         scale       r32
# 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

# main:
  # prolog
  55/push                                                                                                                                           # push EBP
  89/copy                         3/mod/direct    5/rm32/EBP                                          4/r32/ESP                                     # copy ESP to EBP
  # allocate x on the stack
  81          5/subop/subtract    3/mod/direct    4/rm32/ESP                                                                      4/imm32           # subtract 4 bytes from ESP

  # read(stdin, x, 1)
    # fd = 0 (stdin)
  bb/copy                                                                                                                         0/imm32           # copy 0 to EBX
    # 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
    # read(fd, x, size)
  b8/copy                                                                                                                         3/imm32/read      # copy 3 to EAX
  cd/syscall  0x80/imm8

  # write(stdout, x, 1)
    # fd = 1 (stdout)
  bb/copy                                                                                                                         1/imm32           # copy 1 to EBX
    # 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
    # write(fd, x, size)
  b8/copy                                                                                                                         4/imm32/write     # copy 4 to EAX
  cd/syscall  0x80/imm8

  # exit(EBX)
  b8/copy                                                                                                                         1/imm32/exit      # copy 1 to EAX
  cd/syscall  0x80/imm8

# vim:ft=subx:nowrap