doc: update docs and sample files
This commit is contained in:
63
doc/mie/sample/Simple.3.mie
Normal file
63
doc/mie/sample/Simple.3.mie
Normal file
@@ -0,0 +1,63 @@
|
||||
meta.source-filename "Simple.im"
|
||||
|
||||
ivy.package-scope "net.doorstuck.test"
|
||||
|
||||
ivy.package-ref "std.io"
|
||||
|
||||
ivy.module {
|
||||
%cout = ivy.pool.ident @cout -> #ivy.pool-slot
|
||||
%StringBuilder = ivy.pool.ident @std.lang.StringBuilder -> #ivy.pool-slot
|
||||
|
||||
%.str.0 = ivy.pool.string "Answer: " -> #ivy.pool-slot
|
||||
|
||||
%.sel.o-append = ivy.pool.selector append -> #ivy.pool-slot
|
||||
%.sel.o-to-string = ivy.pool.selector to-string -> #ivy.pool-slot
|
||||
%.sel.o-put = ivy.pool.selector put -> #ivy.pool-slot
|
||||
|
||||
ivy.init-text {
|
||||
%0 = i32.constant 32
|
||||
%1 = i32.constant 64
|
||||
%multmp = *ivy.MUL %0, %1 : (i32, i32) -> i32
|
||||
|
||||
*ivy.PUSH %multmp : i32
|
||||
%y = ivy.bp-slot 0 -> #ivy.bp-slot
|
||||
|
||||
%2 = i32.constant 64
|
||||
%3 = i32.constant 4
|
||||
%divtmp = *ivy.DIV %2, %3 : (i32, i32) -> i32
|
||||
|
||||
*ivy.PUSH %divtmp : i32
|
||||
%z = ivy.bp-slot 1 -> #ivy.bp-slot
|
||||
|
||||
%4 = *ivy.LDR-BP %y : #ivy.bp-slot -> i32
|
||||
%5 = *ivy.LDR-BP %z : #ivy.bp-slot -> i32
|
||||
%addtmp = *ivy.ADD %4, %5 : (i32, i32) -> i32
|
||||
|
||||
*ivy.PUSH %addtmp : i32
|
||||
%x = ivy.bp-slot 2 -> #ivy.bp-slot
|
||||
|
||||
%10 = *ivy.LDR-POOL %StringBuilder : #ivy.pool-slot -> #ivy.id
|
||||
|
||||
%20 = *ivy.LDR-POOL %.sel.o-append : #ivy.pool-slot -> #ivy.id
|
||||
%21 = *ivy.LDR-POOL %.str.0 : #ivy.pool-slot -> #ivy.id
|
||||
*ivy.PUSH %21 : #ivy.id
|
||||
*ivy.MSG-I %10, %20, 1 : (#ivy.id, #ivy.id, i32) -> void
|
||||
|
||||
%7 = *ivy.LDR-BP %x : ptr -> i32
|
||||
*ivy.PUSH %7 : i32
|
||||
%22 = *ivy.LDR-POOL %.sel.o-append : #ivy.pool-slot -> #ivy.id
|
||||
*ivy.MSG-I %10, %22, 1 : (#ivy.id, #ivy.id, i32) -> void
|
||||
|
||||
%23 = *ivy.LDR-POOL %.sel.o-to-string : #ivy.pool-slot -> #ivy.id
|
||||
%8 = *ivy.MSG-I %10, %23, 0 : (#ivy.id, #ivy.id, i32) -> #ivy.id
|
||||
|
||||
%9 = *ivy.LDR-POOL %cout : #ivy.pool-slot -> #ivy.id
|
||||
%24 = *ivy.LDR-POOL %.sel.o-put : #ivy.pool-slot -> #ivy.id
|
||||
|
||||
*ivy.PUSH %8 : #ivy.id
|
||||
|
||||
*ivy.MSG-I %9, %24, 1 : (#ivy.id, #ivy.id, i32) -> void
|
||||
|
||||
*ivy.RET-N : ()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user