about summary refs log blame commit diff stats
path: root/apps/ex1.subx
blob: d1968415331378fa05154fc037845607e832e769 (plain) (tree)
akkartik.com> 2018-11-30 11:13:36 -0800 4802' href='/akkartik/mu/commit/subx/examples/ex1.subx?h=hlt&id=ee9a9237d6324f1de1bb7150083eacf7b9af5f70'>ee9a9237 ^
1
2
3
4
5
6
7
8
9
                                                                                       
                 
 
         
                                                                
                              


                  
 
       
 
      
          
                                       
                            
 
                            
# First program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
# Just return 42.
#
# To run:
#   $ ./bootstrap translate init.linux apps/ex1.subx -o apps/ex1
#   $ ./bootstrap run apps/ex1
# Expected result:
#   $ echo $?
#   42

== code

Entry:
# exit(42)
bb/copy-to-ebx  0x2a/imm32  # 42 in hex
e8/call  syscall_exit/disp32

# . . vim:nowrap:textwidth=0