1
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?

ilasmでstack machine その31

Posted at

概要

ilasmでstack machineやってみた。
練習問題やってみた。

練習問題

ilasmでWindows.Formsを使え。

方針

  • 窓にボタンを作る。

写真

image.png

サンプルコード


.assembly extern System.Windows.Forms {
	.publickeytoken = (B7 7A 5C 56 19 34 E0 89) .ver 2:0:0:0
}
.assembly extern mscorlib {
	.publickeytoken = (B7 7A 5C 56 19 34 E0 89) .ver 2:0:0:0
}
.assembly 'form1' {}
.class private auto ansi beforefieldinit form1 extends [System.Windows.Forms]System.Windows.Forms.Form {
.field private class [System.Windows.Forms]System.Windows.Forms.Button btnHello
	.method public hidebysig static void Main() cil managed {
		.entrypoint
		newobj instance void form1::.ctor()
		call void [System.Windows.Forms]System.Windows.Forms.Application::Run(class [System.Windows.Forms]System.Windows.Forms.Form)
		ret
	}
	.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
		ldarg.0
		call instance void [System.Windows.Forms]System.Windows.Forms.Form::.ctor()
		ldarg.0
		ldstr "form1"
		callvirt instance void [System.Windows.Forms]System.Windows.Forms.Control::set_Text(string)
		ldarg.0
		newobj instance void [System.Windows.Forms]System.Windows.Forms.Button::.ctor()
		stfld class [System.Windows.Forms]System.Windows.Forms.Button form1::btnHello
		ldarg.0
		ldfld class [System.Windows.Forms]System.Windows.Forms.Button form1::btnHello
		ldstr "Hello"
		callvirt instance void [System.Windows.Forms]System.Windows.Forms.Control::set_Text(string)
		ldarg.0
		call instance class [System.Windows.Forms]System.Windows.Forms.Control/ControlCollection [System.Windows.Forms]System.Windows.Forms.Control::get_Controls()
		ldarg.0
		ldfld class [System.Windows.Forms]System.Windows.Forms.Button form1::btnHello
		callvirt instance void [System.Windows.Forms]System.Windows.Forms.Control/ControlCollection::Add(class [System.Windows.Forms]System.Windows.Forms.Control)
		ret
	}
}






以上

1
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
1
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?