tc3.0 指针效率高
数组下标 用了10条指令
指针用了8条指令seg000:0291 sub_10291 proc near ; CODE XREF: start+155p
seg000:0291
seg000:0291 var_14 = byte ptr -14h
seg000:0291 var_s0 = byte ptr 0
seg000:0291
seg000:0291 push bp
seg000:0292 mov bp, sp
seg000:0294 sub sp, 14h
seg000:0297 push si
seg000:0298 push di
printf("main: 0x%X\n", main);
seg000:0299 mov ax, 291h
seg000:029C push ax
seg000:029D mov ax, 0AAh ; '
seg000:02A0 push ax
seg000:02A1 call sub_10F0A
seg000:02A4 pop cx
seg000:02A5 pop cx
for(i = 0; i < 10; ++i)
seg000:02A6 xor di, di
seg000:02A8 jmp short loc_102B8
seg000:02AA ; ---------------------------------------------------------------------------
seg000:02AA
seg000:02AA loc_102AA: ; CODE XREF: sub_10291+2Aj
seg000:02AA mov bx, di
seg000:02AC shl bx, 1
seg000:02AE lea ax, [bp+var_14]
seg000:02B1 add bx, ax
seg000:02B3 mov word ptr [bx], 0
seg000:02B7 inc di
seg000:02B8
seg000:02B8 loc_102B8: ; CODE XREF: sub_10291+17j
seg000:02B8 cmp di, 0Ah
seg000:02BB jl short loc_102AA
for(ap = a; ap < a + 10; ++ap)
seg000:02BD lea ax, [bp+var_14]
seg000:02C0 mov si, ax
seg000:02C2 jmp short loc_102CB
seg000:02C4 ; ---------------------------------------------------------------------------
seg000:02C4
seg000:02C4 loc_102C4: ; CODE XREF: sub_10291+3Fj
seg000:02C4 mov word ptr [si], 0
seg000:02C8 add si, 2
seg000:02CB
seg000:02CB loc_102CB: ; CODE XREF: sub_10291+31j
seg000:02CB lea ax, [bp+var_s0]
seg000:02CE cmp ax, si
seg000:02D0 ja short loc_102C4
return 0;
seg000:02D2 xor ax, ax
seg000:02D4 jmp short $+2
seg000:02D6 ; ---------------------------------------------------------------------------
seg000:02D6
seg000:02D6 loc_102D6: ; CODE XREF: sub_10291+43j
seg000:02D6 pop di
seg000:02D7 pop si
seg000:02D8 mov sp, bp
seg000:02DA pop bp
seg000:02DB retn
seg000:02DB sub_10291 endp
|