7 #define cycle 10000 8 //#define TT double 9 #define TT float 10 \ In segment CODE, align 2, keep-with-next 11 TT test(void) \ test: 12 { \ 00000000 92BA ST -Y, R11 \ 00000002 92AA ST -Y, R10 \ 00000004 929A ST -Y, R9 \ 00000006 928A ST -Y, R8 \ 00000008 927A ST -Y, R7 \ 0000000A 926A ST -Y, R6 \ 0000000C 925A ST -Y, R5 \ 0000000E 924A ST -Y, R4 \ 00000010 93BA ST -Y, R27 \ 00000012 93AA ST -Y, R26 \ 00000014 939A ST -Y, R25 \ 00000016 938A ST -Y, R24 \ 00000018 REQUIRE ?Register_R4_is_cg_reg \ 00000018 REQUIRE ?Register_R5_is_cg_reg \ 00000018 REQUIRE ?Register_R6_is_cg_reg \ 00000018 REQUIRE ?Register_R7_is_cg_reg \ 00000018 REQUIRE ?Register_R8_is_cg_reg \ 00000018 REQUIRE ?Register_R9_is_cg_reg \ 00000018 REQUIRE ?Register_R10_is_cg_reg \ 00000018 REQUIRE ?Register_R11_is_cg_reg 13 TT a = (TT)1.0; \ 00000018 2444 CLR R4 \ 0000001A 2455 CLR R5 \ 0000001C E800 LDI R16, 128 \ 0000001E 2E60 MOV R6, R16 \ 00000020 E30F LDI R16, 63 \ 00000022 2E70 MOV R7, R16 14 TT b = (TT)1234.567; \ 00000024 E285 LDI R24, 37 \ 00000026 E592 LDI R25, 82 \ 00000028 E9AA LDI R26, 154 \ 0000002A E4B4 LDI R27, 68 15 16 for (long i = 0; i < cycle; i++) \ 0000002C 2488 CLR R8 \ 0000002E 2499 CLR R9 \ 00000030 24AA CLR R10 \ 00000032 24BB CLR R11 17 { 18 a = a + ( (TT)i / b ); \ ??test_0: \ 00000034 0184 MOVW R17:R16, R9:R8 \ 00000036 0195 MOVW R19:R18, R11:R10 \ 00000038 ........ CALL ?SL2F_L04 \ 0000003C 01AC MOVW R21:R20, R25:R24 \ 0000003E 01BD MOVW R23:R22, R27:R26 \ 00000040 ........ CALL ?F_DIV_L04 \ 00000044 01A2 MOVW R21:R20, R5:R4 \ 00000046 01B3 MOVW R23:R22, R7:R6 \ 00000048 ........ CALL ?F_ADD_L04 \ 0000004C 0128 MOVW R5:R4, R17:R16 \ 0000004E 0139 MOVW R7:R6, R19:R18 19 b = b + 0.000001; \ 00000050 018C MOVW R17:R16, R25:R24 \ 00000052 019D MOVW R19:R18, R27:R26 \ 00000054 ........ CALL ?FL2D_L11 \ 00000058 937A ST -Y, R23 \ 0000005A 936A ST -Y, R22 \ 0000005C 935A ST -Y, R21 \ 0000005E 934A ST -Y, R20 \ 00000060 933A ST -Y, R19 \ 00000062 932A ST -Y, R18 \ 00000064 931A ST -Y, R17 \ 00000066 930A ST -Y, R16 \ 00000068 .... LDI R26, LOW(__Constant_a0b5ed8d_3eb0c6f7) \ 0000006A .... LDI R27, (__Constant_a0b5ed8d_3eb0c6f7) >> 8 \ 0000006C 9628 ADIW R29:R28, 8 \ 0000006E ........ CALL ?D_ADD_L11 \ 00000072 ........ CALL ?D2FL_L11 \ 00000076 01C8 MOVW R25:R24, R17:R16 \ 00000078 01D9 MOVW R27:R26, R19:R18 20 if (a > 100000000.0) a = 1.0; \ 0000007A E241 LDI R20, 33 \ 0000007C EB5C LDI R21, 188 \ 0000007E EB6E LDI R22, 190 \ 00000080 E47C LDI R23, 76 \ 00000082 0182 MOVW R17:R16, R5:R4 \ 00000084 0193 MOVW R19:R18, R7:R6 \ 00000086 ........ CALL ?F_CMP_GE_L04 \ 0000008A F430 BRCC ??test_1 \ 0000008C 2444 CLR R4 \ 0000008E 2455 CLR R5 \ 00000090 E800 LDI R16, 128 \ 00000092 2E60 MOV R6, R16 \ 00000094 E30F LDI R16, 63 \ 00000096 2E70 MOV R7, R16 21 } \ ??test_1: \ 00000098 E001 LDI R16, 1 \ 0000009A 0E80 ADD R8, R16 \ 0000009C E000 LDI R16, 0 \ 0000009E 1E90 ADC R9, R16 \ 000000A0 1EA0 ADC R10, R16 \ 000000A2 1EB0 ADC R11, R16 \ 000000A4 E100 LDI R16, 16 \ 000000A6 1680 CP R8, R16 \ 000000A8 E207 LDI R16, 39 \ 000000AA 0690 CPC R9, R16 \ 000000AC E000 LDI R16, 0 \ 000000AE 06A0 CPC R10, R16 \ 000000B0 06B0 CPC R11, R16 \ 000000B2 F204 BRLT ??test_0 22 return(a); \ 000000B4 0182 MOVW R17:R16, R5:R4 \ 000000B6 0193 MOVW R19:R18, R7:R6 \ 000000B8 9189 LD R24, Y+ \ 000000BA 9199 LD R25, Y+ \ 000000BC 91A9 LD R26, Y+ \ 000000BE 91B9 LD R27, Y+ \ 000000C0 9049 LD R4, Y+ \ 000000C2 9059 LD R5, Y+ \ 000000C4 9069 LD R6, Y+ \ 000000C6 9079 LD R7, Y+ \ 000000C8 9089 LD R8, Y+ \ 000000CA 9099 LD R9, Y+ \ 000000CC 90A9 LD R10, Y+ \ 000000CE 90B9 LD R11, Y+ \ 000000D0 9508 RET 23 }