int jiaohuan(int a,int b)
{int p;
p=a;
a=b;
b=p;
printf("%d,%d",a,b);
}
int main()
{int a=2,b=3;
jiaohuan(2,3);
}
这段最基础的两数交换程序我用W32DASM反汇编看了一下,没看明白,很多指令都不明白
//********************** Start of Code in Segment: 1 **************
:0001.0000 696E74206A imul bp, [bp+74], 6A20
:0001.0005 69616F6875 imul sp, [bx+di+6F], 7568
:0001.000A 61 popa
:0001.000B 6E outsb
:0001.000C 28696E sub [bx+di+6E], ch
:0001.000F 7420 je 0031
:0001.0011 61 popa
:0001.0012 2C69 sub al, 69
:0001.0014 6E outsb
:0001.0015 7420 je 0037
:0001.0017 6229 bound bp, [bx+di]
:0001.0019 0D0A7B or ax, 7B0A
:0001.001C 696E742070 imul bp, [bp+74], 7020
:0001.0021 3B0D cmp cx, [di]
:0001.0023 0A20 or ah, [bx+si]
:0001.0025 703D jo 0064
:0001.0027 61 popa
:0001.0028 3B0D cmp cx, [di]
:0001.002A 0A20 or ah, [bx+si]
:0001.002C 61 popa
:0001.002D 3D623B cmp ax, 3B62
:0001.0030 0D0A20 or ax, 200A
:0001.0033 623D bound di, [di]
:0001.0035 703B jo 0072
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0001.0015(C)
|
:0001.0037 0D0A20 or ax, 200A
:0001.003A 7072 jo 00AE
:0001.003C 696E746628 imul bp, [bp+74], 2866
:0001.0041 2225 and ah, [di]
:0001.0043 64 BYTE 064h
:0001.0044 2C25 sub al, 25
:0001.0046 64222C and ch, fs:[si]
:0001.0049 61 popa
:0001.004A 2C62 sub al, 62
:0001.004C 293B sub [bp+di], di
:0001.004E 0D0A7D or ax, 7D0A
:0001.0051 0D0A69 or ax, 690A
:0001.0054 6E outsb
:0001.0055 7420 je 0077
:0001.0057 6D insw
:0001.0058 61 popa
:0001.0059 696E28290D imul bp, [bp+28], 0D29
:0001.005E 0A7B69 or bh, [bp+di+69]
:0001.0061 6E outsb
:0001.0062 7420 je 0084
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0001.0025(C)
|
:0001.0064 61 popa
:0001.0065 3D322C cmp ax, 2C32
:0001.0068 623D bound di, [di]
:0001.006A 333B xor di, [bp+di]
:0001.006C 0D0A20 or ax, 200A
:0001.006F 6A69 push 0069
:0001.0071 61 popa
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0001.0035(C)
|
:0001.0072 6F outsw
:0001.0073 687561 push 6175
:0001.0076 6E outsb
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0001.0055(C)
|
:0001.0077 2832 sub [bp+si], dh
:0001.0079 2C33 sub al, 33
:0001.007B 293B sub [bp+di], di
:0001.007D 0D0A7D or ax, 7D0A
:0001.0080 0D0A00 or ax, 7D0A