Created
July 17, 2013 14:52
-
-
Save AlexArchive/6021293 to your computer and use it in GitHub Desktop.
Demo: Basic Branching in MSIL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.assembly extern mscorlib {} | |
.assembly Test | |
{ | |
.ver 1:0:1:0 | |
} | |
.module test.exe | |
.method static void main() cil managed | |
{ | |
.maxstack 2 | |
.entrypoint | |
ldstr "Enter First Number" | |
call void [mscorlib]System.Console::WriteLine (string) | |
call string [mscorlib]System.Console::ReadLine() | |
call int32 [mscorlib]System.Int32::Parse(string) | |
ldstr "Enter Second Number" | |
call void [mscorlib]System.Console::WriteLine(string) | |
call string [mscorlib]System.Console::ReadLine() | |
call int32 [mscorlib]System.Int32::Parse(string) | |
ble Smaller | |
ldstr "Second Number is smaller than first." | |
call void [mscorlib]System.Console::WriteLine (string) | |
br Exit | |
Smaller: | |
ldstr "First number is smaller than second" | |
call void [mscorlib]System.Console::WriteLine (string) | |
Exit: | |
ret | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment