⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ip.lis

📁 AVR单片机系统开发经典实例部分源程序
💻 LIS
📖 第 1 页 / 共 5 页
字号:
 006E           ;       sprintf((char*)ScratchPad, "[%04x] %d-bytes\n", PPP_IP, TotalBytes);
 006E           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 006E           ; }
 006E           ; 
 006E           ; void IP_DisplayHeader(int HeaderIdx, int TotalBytes)
 006E           ; {
 006E                   .dbline 146
 006E           ;       int     i, j;
 006E           ;       u8      type, len;
 006E           ; /*
 006E           ;        0                   1                   2                   3
 006E           ;        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 006E           ;       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 006E           ;       |Ver= 4 |IHL= 5 |Type of Service|        Total Length = 21      |
 006E           ;       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 006E           ;       |      Identification = 111     |Flg=0|   Fragment Offset = 0   |
 006E           ;       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 006E           ;       |   Time = 123  |  Protocol = 1 |        header checksum        |
 006E           ;       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 006E           ;       |                         source address                        |
 006E           ;       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 006E           ;       |                      destination address                      |
 006E           ;       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 006E           ;       |                    Options                    |    Padding    | < optional
 006E           ;       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 006E           ; */
 006E           ;       // display the header
 006E           ; 
 006E           ;       if (!SendDebugRStr(ip_str3)) return;
 006E 00E0              ldi R16,<_ip_str3
 0070 10E0              ldi R17,>_ip_str3
 0072 0E940000          xcall _SendDebugRStr
 0076 0023              tst R16
 0078 09F4              brne L14
 007A                   .dbline 146
 007A E9C1              xjmp L13
 007C           L14:
 007C                   .dbline 147
 007C           ;       sprintf((char*)ScratchPad, "%u", (IP_Header->VerLen & 0xf0) >> 4);
 007C E0910000          lds R30,_IP_Header
 0080 F0910100          lds R31,_IP_Header+1
 0084 8081              ldd R24,z+0
 0086 9927              clr R25
 0088 807F              andi R24,240
 008A 9070              andi R25,0
 008C 9595              asr R25
 008E 8795              ror R24
 0090 9595              asr R25
 0092 8795              ror R24
 0094 9595              asr R25
 0096 8795              ror R24
 0098 9595              asr R25
 009A 8795              ror R24
 009C 9983              std y+1,R25
 009E 8883              std y+0,R24
 00A0 20E0              ldi R18,<L16
 00A2 30E0              ldi R19,>L16
 00A4 00E0              ldi R16,<_ScratchPad
 00A6 10E0              ldi R17,>_ScratchPad
 00A8 0E940000          xcall _sprintf
 00AC                   .dbline 148
 00AC           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 00AC 00E0              ldi R16,<_ScratchPad
 00AE 10E0              ldi R17,>_ScratchPad
 00B0 0E940000          xcall _SendDebugStr
 00B4 0023              tst R16
 00B6 09F4              brne L17
 00B8                   .dbline 148
 00B8 CAC1              xjmp L13
 00BA           L17:
 00BA                   .dbline 150
 00BA           ; 
 00BA           ;       if (!SendDebugRStr(ip_str4)) return;
 00BA 00E0              ldi R16,<_ip_str4
 00BC 10E0              ldi R17,>_ip_str4
 00BE 0E940000          xcall _SendDebugRStr
 00C2 0023              tst R16
 00C4 09F4              brne L19
 00C6                   .dbline 150
 00C6 C3C1              xjmp L13
 00C8           L19:
 00C8                   .dbline 151
 00C8           ;       sprintf((char*)ScratchPad, "%u", IP_Header->VerLen & 0x0f);
 00C8 E0910000          lds R30,_IP_Header
 00CC F0910100          lds R31,_IP_Header+1
 00D0 8081              ldd R24,z+0
 00D2 9927              clr R25
 00D4 8F70              andi R24,15
 00D6 9070              andi R25,0
 00D8 9983              std y+1,R25
 00DA 8883              std y+0,R24
 00DC 20E0              ldi R18,<L16
 00DE 30E0              ldi R19,>L16
 00E0 00E0              ldi R16,<_ScratchPad
 00E2 10E0              ldi R17,>_ScratchPad
 00E4 0E940000          xcall _sprintf
 00E8                   .dbline 152
 00E8           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 00E8 00E0              ldi R16,<_ScratchPad
 00EA 10E0              ldi R17,>_ScratchPad
 00EC 0E940000          xcall _SendDebugStr
 00F0 0023              tst R16
 00F2 09F4              brne L21
 00F4                   .dbline 152
 00F4 ACC1              xjmp L13
 00F6           L21:
 00F6                   .dbline 154
 00F6           ; 
 00F6           ;       if (!SendDebugRStr(ip_str5)) return;
 00F6 00E0              ldi R16,<_ip_str5
 00F8 10E0              ldi R17,>_ip_str5
 00FA 0E940000          xcall _SendDebugRStr
 00FE 0023              tst R16
 0100 09F4              brne L23
 0102                   .dbline 154
 0102 A5C1              xjmp L13
 0104           L23:
 0104                   .dbline 155
 0104           ;       sprintf((char*)ScratchPad, "%02X", IP_Header->TOS);
 0104 E0910000          lds R30,_IP_Header
 0108 F0910100          lds R31,_IP_Header+1
 010C 2180              ldd R2,z+1
 010E 3324              clr R3
 0110 3982              std y+1,R3
 0112 2882              std y+0,R2
 0114 20E0              ldi R18,<L25
 0116 30E0              ldi R19,>L25
 0118 00E0              ldi R16,<_ScratchPad
 011A 10E0              ldi R17,>_ScratchPad
 011C 0E940000          xcall _sprintf
 0120                   .dbline 156
 0120           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 0120 00E0              ldi R16,<_ScratchPad
 0122 10E0              ldi R17,>_ScratchPad
 0124 0E940000          xcall _SendDebugStr
 0128 0023              tst R16
 012A 09F4              brne L26
 012C                   .dbline 156
 012C 90C1              xjmp L13
 012E           L26:
 012E                   .dbline 158
 012E           ; 
 012E           ;       if (!SendDebugRStr(ip_str6)) return;
 012E 00E0              ldi R16,<_ip_str6
 0130 10E0              ldi R17,>_ip_str6
 0132 0E940000          xcall _SendDebugRStr
 0136 0023              tst R16
 0138 09F4              brne L28
 013A                   .dbline 158
 013A 89C1              xjmp L13
 013C           L28:
 013C                   .dbline 159
 013C           ;       sprintf((char*)ScratchPad, "%u", ntohs(IP_Header->TotalLength));
 013C E0910000          lds R30,_IP_Header
 0140 F0910100          lds R31,_IP_Header+1
 0144 0281              ldd R16,z+2
 0146 1381              ldd R17,z+3
 0148 0E940000          xcall _ntohs
 014C 1983              std y+1,R17
 014E 0883              std y+0,R16
 0150 20E0              ldi R18,<L16
 0152 30E0              ldi R19,>L16
 0154 00E0              ldi R16,<_ScratchPad
 0156 10E0              ldi R17,>_ScratchPad
 0158 0E940000          xcall _sprintf
 015C                   .dbline 160
 015C           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 015C 00E0              ldi R16,<_ScratchPad
 015E 10E0              ldi R17,>_ScratchPad
 0160 0E940000          xcall _SendDebugStr
 0164 0023              tst R16
 0166 09F4              brne L30
 0168                   .dbline 160
 0168 72C1              xjmp L13
 016A           L30:
 016A                   .dbline 162
 016A           ; 
 016A           ;       if (!SendDebugRStr(ip_str7)) return;
 016A 00E0              ldi R16,<_ip_str7
 016C 10E0              ldi R17,>_ip_str7
 016E 0E940000          xcall _SendDebugRStr
 0172 0023              tst R16
 0174 09F4              brne L32
 0176                   .dbline 162
 0176 6BC1              xjmp L13
 0178           L32:
 0178                   .dbline 163
 0178           ;       sprintf((char*)ScratchPad, "%u", ntohs(IP_Header->ID));
 0178 E0910000          lds R30,_IP_Header
 017C F0910100          lds R31,_IP_Header+1
 0180 0481              ldd R16,z+4
 0182 1581              ldd R17,z+5
 0184 0E940000          xcall _ntohs
 0188 1983              std y+1,R17
 018A 0883              std y+0,R16
 018C 20E0              ldi R18,<L16
 018E 30E0              ldi R19,>L16
 0190 00E0              ldi R16,<_ScratchPad
 0192 10E0              ldi R17,>_ScratchPad
 0194 0E940000          xcall _sprintf
 0198                   .dbline 164
 0198           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 0198 00E0              ldi R16,<_ScratchPad
 019A 10E0              ldi R17,>_ScratchPad
 019C 0E940000          xcall _SendDebugStr
 01A0 0023              tst R16
 01A2 09F4              brne L34
 01A4                   .dbline 164
 01A4 54C1              xjmp L13
 01A6           L34:
 01A6                   .dbline 166
 01A6           ; 
 01A6           ;       if (!SendDebugRStr(ip_str8)) return;
 01A6 00E0              ldi R16,<_ip_str8
 01A8 10E0              ldi R17,>_ip_str8
 01AA 0E940000          xcall _SendDebugRStr
 01AE 0023              tst R16
 01B0 09F4              brne L36
 01B2                   .dbline 166
 01B2 4DC1              xjmp L13
 01B4           L36:
 01B4                   .dbline 167
 01B4           ;       sprintf((char*)ScratchPad, "%04X", ntohs(IP_Header->Fragment));
 01B4 E0910000          lds R30,_IP_Header
 01B8 F0910100          lds R31,_IP_Header+1
 01BC 0681              ldd R16,z+6
 01BE 1781              ldd R17,z+7
 01C0 0E940000          xcall _ntohs
 01C4 1983              std y+1,R17
 01C6 0883              std y+0,R16
 01C8 20E0              ldi R18,<L38
 01CA 30E0              ldi R19,>L38
 01CC 00E0              ldi R16,<_ScratchPad
 01CE 10E0              ldi R17,>_ScratchPad
 01D0 0E940000          xcall _sprintf
 01D4                   .dbline 168
 01D4           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 01D4 00E0              ldi R16,<_ScratchPad
 01D6 10E0              ldi R17,>_ScratchPad
 01D8 0E940000          xcall _SendDebugStr
 01DC 0023              tst R16
 01DE 09F4              brne L39
 01E0                   .dbline 168
 01E0 36C1              xjmp L13
 01E2           L39:
 01E2                   .dbline 170
 01E2           ; 
 01E2           ;       if (!SendDebugRStr(ip_str9)) return;
 01E2 00E0              ldi R16,<_ip_str9
 01E4 10E0              ldi R17,>_ip_str9
 01E6 0E940000          xcall _SendDebugRStr
 01EA 0023              tst R16
 01EC 09F4              brne L41
 01EE                   .dbline 170
 01EE 2FC1              xjmp L13
 01F0           L41:
 01F0                   .dbline 171
 01F0           ;       sprintf((char*)ScratchPad, "%u", IP_Header->TTL);
 01F0 E0910000          lds R30,_IP_Header
 01F4 F0910100          lds R31,_IP_Header+1
 01F8 2084              ldd R2,z+8
 01FA 3324              clr R3
 01FC 3982              std y+1,R3
 01FE 2882              std y+0,R2
 0200 20E0              ldi R18,<L16
 0202 30E0              ldi R19,>L16
 0204 00E0              ldi R16,<_ScratchPad
 0206 10E0              ldi R17,>_ScratchPad
 0208 0E940000          xcall _sprintf
 020C                   .dbline 172
 020C           ;       if (!SendDebugStr((char*)ScratchPad)) return;
 020C 00E0              ldi R16,<_ScratchPad
 020E 10E0              ldi R17,>_ScratchPad
 0210 0E940000          xcall _SendDebugStr
 0214 0023              tst R16
 0216 09F4              brne L43
 0218                   .dbline 172
 0218 1AC1              xjmp L13
 021A           L43:
 021A                   .dbline 174
 021A           ; 
 021A           ;       switch (IP_Header->Protocol)
 021A E0910000          lds R30,_IP_Header
 021E F0910100          lds R31,_IP_Header+1
 0222 4185              ldd R20,z+9
 0224 5527              clr R21
 0226 4630              cpi R20,6
 0228 E0E0              ldi R30,0
 022A 5E07              cpc R21,R30
 022C E9F0              breq L54
 022E 86E0              ldi R24,6
 0230 90E0              ldi R25,0
 0232 8417              cp R24,R20
 0234 9507              cpc R25,R21
 0236 2CF0              brlt L58
 0238           L57:
 0238 4130              cpi R20,1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -