summary refs log tree commit diff stats
path: root/compiler/packagehandling.nim
Commit message (Expand)AuthorAgeFilesLines
* IC: next steps (#16550)Andreas Rumpf2021-01-071-1/+2
* Correct all eggs (#15906)Miran2020-11-101-2/+2
* Big compiler Cleanup (#14777)Clyybber2020-08-281-2/+0
* fix #13150 `nim doc --project` now works reliably (#13223)Timothee Cour2020-02-061-5/+8
* Fixes #12734 (#12784)Tomohiro2019-12-011-1/+4
* fixes #12420 [backport] (#12456)Andreas Rumpf2019-10-181-8/+5
* Fix #12242, replacing ":" with "@c" in packages [backport] (#12265)Endeg2019-09-251-2/+2
* changed name mangling for generated C filesAraq2019-09-131-2/+2
* Fixed c filenames mangling (#12161)Yuriy Glukhov2019-09-111-3/+3
* fix #12130 ; improve naming scheme in fakePackageNameTimothee Cour2019-09-061-5/+3
* typoAraq2019-05-081-1/+1
* fixes #11196Araq2019-05-081-2/+2
* nicer 'CC' output messagesAraq2019-05-061-0/+4
* remove the restriction that module names need to be unique per Nimble… (#11...Andreas Rumpf2019-04-201-4/+10
* compiler refactoring; use typesafe path handing; docgen: render symbols betwe...Andreas Rumpf2018-09-071-3/+3
* even more strict isNil handling for strings/seqs in order to detect bugsAraq2018-08-221-1/+2
* guards.nim does compileAndreas Rumpf2018-05-111-15/+8
* happy new yearAraq2017-01-071-1/+1
* expr and stmt are now deprecatedAndreas Rumpf2016-07-301-1/+1
* fixes #4485; package handling works better; docgen works with --project on Ni...Andreas Rumpf2016-07-191-0/+56
af4c06'>3fe714d3 ^
12adb3da ^
431f739d ^
a6517ed8 ^



a46cfb13 ^

431f739d ^

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






                                                 
       


                                                                                                                                               
 

                          
                                                                                                                                                                   
                                                
                                                                                                                                                                 
                     
                                                                                                                                                                       
                        
                                                                                                                                                                   
                                                                                                                                                             
 
             
                                                                                                                                                                   
                                                                                                                                                             
 



                       

                                                        

                    
## print out a (global variable) string to stdout
#
# To run:
#   $ subx translate ex6.subx ex6
#   $ subx run ex6
#   Hello, world!

== 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

  # write(stdout, x, size)
    # fd = 1 (stdout)
  bb/copy                                                                                                                         1/imm32           # copy 1 to EBX
    # initialize x (location to write result to)
  b9/copy                                                                                                                         x/imm32           # copy to ECX
    # initialize size
  8b/copy                         0/mod/indirect  5/rm32/.disp32                                      2/r32/EDX   size/disp32                       # copy *size to EDX
    # write(fd, x, size)
  b8/copy                                                                                                                         4/imm32/write     # copy 4 to EAX
  cd/syscall                                                                                                                      0x80/imm8         # int 80h

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

== data
size:  # size of string
  0e 00 00 00  # 14
x:  # string to print
  48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 0a       00
# h  e  l  l  o  ,  ␣  w  o  r  l  d  !  newline  null

# vim:ft=subx:nowrap