-
Notifications
You must be signed in to change notification settings - Fork 1
/
hello.mil
44 lines (35 loc) · 830 Bytes
/
hello.mil
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
// hello.il
<<console_input_output.min>>
<<branching.min>>
<<instructions.min>>
.assembly extern mscorlib {}
.assembly hello
{
.ver 1:0:1:0
}
.module hello.exe
.method static void main() cil managed
{
.maxstack 2
.entrypoint
.locals init (int32 x)
((write: "Input positive x: "))
((read line))
((parse it as int32))
((store it as local x))
((check if ((local x)) > ((int32 0)) ))
((if so {{
((write line: "It is positive!"))
((write: "x * 2 = "))
((load local x))
((load int32 2))
((multiply them))
((write int32))
((write: "\n"))
}}else{{
((write line: "It isn't positive."))
}}
))
((read line))
((return))
}