doc: update docs and sample files
This commit is contained in:
62
doc/mie/sample/Simple.4.mie
Normal file
62
doc/mie/sample/Simple.4.mie
Normal file
@@ -0,0 +1,62 @@
|
||||
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 %y : #ivy.bp-slot -> i32
|
||||
%5 = *ivy.LDR %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 %StringBuilder : #ivy.pool-slot -> #ivy.id
|
||||
|
||||
%20 = *ivy.LDR %.sel.o-append : #ivy.pool-slot -> #ivy.id
|
||||
%21 = *ivy.LDR %.str.0 : #ivy.pool-slot -> #ivy.id
|
||||
*ivy.PUSH %21 : #ivy.id
|
||||
*ivy.MSG %10, %20, 1 : (#ivy.id, #ivy.id, i32) -> void
|
||||
|
||||
%7 = *ivy.LDR %x : ptr -> i32
|
||||
*ivy.PUSH %7 : i32
|
||||
*ivy.MSG %10, %20, 1 : (#ivy.id, #ivy.id, i32) -> void
|
||||
|
||||
%23 = *ivy.LDR %.sel.o-to-string : #ivy.pool-slot -> #ivy.id
|
||||
%8 = *ivy.MSG %10, %23, 0 : (#ivy.id, #ivy.id, i32) -> #ivy.id
|
||||
|
||||
%9 = *ivy.LDR %cout : #ivy.pool-slot -> #ivy.id
|
||||
%24 = *ivy.LDR %.sel.o-put : #ivy.pool-slot -> #ivy.id
|
||||
|
||||
*ivy.PUSH %8 : #ivy.id
|
||||
|
||||
*ivy.MSG %9, %24, 1 : (#ivy.id, #ivy.id, i32) -> void
|
||||
|
||||
*ivy.RET-N : ()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user