马上就要进入对象系统的实现了 感觉美妙
VC6对template的支持真是太一般了, VC7.1到VC6的移植工作几乎全受到template的影响
.entry void Fun(f32 a, f64 b)
{
st.0
st.1
st.2
st.3
ldc.s 3
add
ret
}
void SunjingisBaobao()
{
ldstr "yes"
prts
ret
}
f32 IWillWin()
{
ldc.s 1
ret
}
得到的ListFile:
=========================== File Header ===========================
Num of Methods: 3
Num of Fields: 2
Num of Instruction: 12
Size of StringPool: 37
=========================== Methods Meta ===========================
Method (1):
Return Type: void
Special: This is the entry method of the Program
Name: 0(str index in Pool) == Fun
Start Address = 0
Parameter (1):
Index of Field: 0
Parameter (2):
Index of Field: 1
Method (2):
Return Type: void
Name: 8(str index in Pool) == SunjingisBaobao
Start Address = 22
Method (3):
Return Type: float32
Name: 28(str index in Pool) == IWillWin
Start Address = 36
=========================== Fields Meta ===========================
Field (1):
Name: 4(str index in Pool) == a
Type: float32
Field (2):
Name: 6(str index in Pool) == b
Type: float64
======================= String Pool Dump =======================
Fun a b SunjingisBaobao yes IWillWin
======================= IL Code Dump ========================
IL000 st.0
IL002 st.1
IL004 st.2
IL006 st.3
IL008 ldc.s 3
IL0018 add
IL0020 ret
IL0022 ldstr 24
IL0032 ptrs
IL0034 ret
IL0036 ldc.s 1
IL0046 ret
总觉得自己好象剽窃了大量关于MSIL的东西