0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

paizaでilasm

Last updated at Posted at 2019-12-30

概要

paizaでilasmやってみた。

サンプルコード

import subprocess
import os

def cil():
    c_file = 'hello1.il'
    test_c = """
.assembly hello0 { 
}
.method static void Main() cil managed {
	.entrypoint
	.maxstack 	8
	ldstr 		"hello0"
	call 		void [mscorlib]System.Console::WriteLine(string)
	ret
}
.method public instance void Say(string A_1) cil managed {
	.maxstack	1
	ldarg.1
	call		void [mscorlib]System.Console::WriteLine(string)
	ret
}

"""
    with open(c_file, 'w') as f:
        f.write(test_c)
    os.system("ilasm %s" % c_file)
    os.system("mono hello1.exe")
    
if __name__ == '__main__':
  cil()


成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?