📄 ppp.s
字号:
; type = MainBuffer[i + 0];
ldi R24,<_MainBuffer
ldi R25,>_MainBuffer
ldd R30,y+10
ldd R31,y+11
add R30,R24
adc R31,R25
ldd R12,z+0
.dbline 299
; len = MainBuffer[i + 1];
ldd R30,y+10
ldd R31,y+11
adiw R30,1
add R30,R24
adc R31,R25
ldd R10,z+0
.dbline 300
; if (len < 2) len = 2;
mov R24,R10
cpi R24,2
brsh L85
.dbline 300
ldi R24,2
mov R10,R24
L85:
.dbline 301
; sprintf((char*)ScratchPad, " type:%u len:%u", type, len);
mov R2,R10
clr R3
std y+3,R3
std y+2,R2
mov R2,R12
clr R3
std y+1,R3
std y+0,R2
ldi R18,<L87
ldi R19,>L87
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _sprintf
.dbline 302
; if (Protocol == PPP_IPCP)
movw R24,R14
cpi R24,33
ldi R30,128
cpc R25,R30
breq X15
xjmp L88
X15:
.dbline 303
; {
.dbline 304
; if (type == 2)
mov R24,R12
cpi R24,2
brne L90
.dbline 305
; {
.dbline 306
; if (len >= 2)
mov R24,R10
cpi R24,2
brsh X16
xjmp L89
X16:
.dbline 307
; {
.dbline 308
; strcat((char*)ScratchPad, " comp-prot: ");
ldi R18,<L94
ldi R19,>L94
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 309
; j = ntohs(*(u16*)(MainBuffer + i + 2));
ldi R24,<_MainBuffer+2
ldi R25,>_MainBuffer+2
ldd R30,y+10
ldd R31,y+11
add R30,R24
adc R31,R25
ldd R16,z+0
ldd R17,z+1
xcall _ntohs
movw R22,R16
.dbline 310
; sprintf((char*)ScratchPad + strlen((char*)ScratchPad), "%04X", j);
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strlen
std y+1,R23
std y+0,R22
ldi R18,<L96
ldi R19,>L96
ldi R24,<_ScratchPad
ldi R25,>_ScratchPad
add R16,R24
adc R17,R25
xcall _sprintf
.dbline 311
; }
.dbline 312
; }
xjmp L89
L90:
.dbline 314
; else
; if ((type == 3) || (type == 129) || (type == 130) || (type == 131) || (type == 132))
mov R24,R12
cpi R24,3
breq L102
cpi R24,129
breq L102
cpi R24,130
breq L102
cpi R24,131
breq L102
cpi R24,132
breq X17
xjmp L89
X17:
L102:
.dbline 315
; {
.dbline 316
; if (len >= 4)
mov R24,R10
cpi R24,4
brsh X18
xjmp L89
X18:
.dbline 317
; {
.dbline 318
; strcat((char*)ScratchPad, " ip: ");
ldi R18,<L105
ldi R19,>L105
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 319
; dw = *(u32*)(MainBuffer + i + 2);
ldi R24,<_MainBuffer+2
ldi R25,>_MainBuffer+2
ldd R30,y+10
ldd R31,y+11
add R30,R24
adc R31,R25
ldd R2,z+0
ldd R3,z+1
ldd R4,z+2
ldd R5,z+3
movw R30,R28
std z+6,R2
std z+7,R3
std z+8,R4
std z+9,R5
.dbline 320
; IP_Str((char*)ScratchPad + strlen((char*)ScratchPad), dw);
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strlen
movw R30,R28
ldd R2,z+6
ldd R3,z+7
ldd R4,z+8
ldd R5,z+9
std y+0,R4
std y+1,R5
movw R18,R2
ldi R24,<_ScratchPad
ldi R25,>_ScratchPad
add R16,R24
adc R17,R25
xcall _IP_Str
.dbline 321
; }
.dbline 322
; }
.dbline 323
; }
xjmp L89
L88:
.dbline 325
; else
; if (Protocol == PPP_LCP)
movw R24,R14
cpi R24,33
ldi R30,192
cpc R25,R30
breq X19
xjmp L107
X19:
.dbline 326
; {
.dbline 327
; switch (type)
mov R20,R12
clr R21
cpi R20,1
ldi R30,0
cpc R21,R30
breq L112
cpi R20,2
ldi R30,0
cpc R21,R30
brne X20
xjmp L116
X20:
cpi R20,3
ldi R30,0
cpc R21,R30
brne X21
xjmp L119
X21:
cpi R20,5
ldi R30,0
cpc R21,R30
brne X22
xjmp L123
X22:
cpi R20,7
ldi R30,0
cpc R21,R30
brne X23
xjmp L127
X23:
cpi R20,8
ldi R30,0
cpc R21,R30
brne X24
xjmp L129
X24:
xjmp L109
X2:
.dbline 328
; {
L112:
.dbline 329
; case LCP_MRU : strcat((char*)ScratchPad, " MRU: ");
ldi R18,<L113
ldi R19,>L113
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 330
; j = ntohs(*(u16*)(MainBuffer + i + 2));
ldi R24,<_MainBuffer+2
ldi R25,>_MainBuffer+2
ldd R30,y+10
ldd R31,y+11
add R30,R24
adc R31,R25
ldd R16,z+0
ldd R17,z+1
xcall _ntohs
movw R22,R16
.dbline 331
; sprintf((char*)ScratchPad + strlen((char*)ScratchPad), "%u", j);
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strlen
std y+1,R23
std y+0,R22
ldi R18,<L115
ldi R19,>L115
ldi R24,<_ScratchPad
ldi R25,>_ScratchPad
add R16,R24
adc R17,R25
xcall _sprintf
.dbline 332
; break;
xjmp L110
L116:
.dbline 333
; case LCP_ACCM : strcat((char*)ScratchPad, " ACCM: ");
ldi R18,<L117
ldi R19,>L117
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 334
; dw = ntohl(*(u32*)(MainBuffer + i + 2));
ldi R24,<_MainBuffer+2
ldi R25,>_MainBuffer+2
ldd R30,y+10
ldd R31,y+11
add R30,R24
adc R31,R25
ldd R16,z+0
ldd R17,z+1
ldd R18,z+2
ldd R19,z+3
xcall _ntohl
movw R30,R28
std z+6,R16
std z+7,R17
std z+8,R18
std z+9,R19
.dbline 335
; bin2bstr(ScratchPad + strlen((char*)ScratchPad), dw, 32);
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strlen
ldi R24,32
ldi R25,0
std y+3,R25
std y+2,R24
movw R30,R28
ldd R2,z+6
ldd R3,z+7
ldd R4,z+8
ldd R5,z+9
std y+0,R4
std y+1,R5
movw R18,R2
ldi R24,<_ScratchPad
ldi R25,>_ScratchPad
add R16,R24
adc R17,R25
xcall _bin2bstr
.dbline 336
; break;
xjmp L110
L119:
.dbline 337
; case LCP_AP : strcat((char*)ScratchPad, " AP: ");
ldi R18,<L120
ldi R19,>L120
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 338
; j = ntohs(*(u16*)(MainBuffer + i + 2));
ldi R24,<_MainBuffer+2
ldi R25,>_MainBuffer+2
ldd R30,y+10
ldd R31,y+11
add R30,R24
adc R31,R25
ldd R16,z+0
ldd R17,z+1
xcall _ntohs
movw R22,R16
.dbline 339
; sprintf((char*)ScratchPad + strlen((char*)ScratchPad), "%02X", j);
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strlen
std y+1,R23
std y+0,R22
ldi R18,<L122
ldi R19,>L122
ldi R24,<_ScratchPad
ldi R25,>_ScratchPad
add R16,R24
adc R17,R25
xcall _sprintf
.dbline 340
; break;
xjmp L110
L123:
.dbline 341
; case LCP_MN : strcat((char*)ScratchPad, " MN: ");
ldi R18,<L124
ldi R19,>L124
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 342
; dw = ntohl(*(u32*)(MainBuffer + i + 2));
ldi R24,<_MainBuffer+2
ldi R25,>_MainBuffer+2
ldd R30,y+10
ldd R31,y+11
add R30,R24
adc R31,R25
ldd R16,z+0
ldd R17,z+1
ldd R18,z+2
ldd R19,z+3
xcall _ntohl
movw R30,R28
std z+6,R16
std z+7,R17
std z+8,R18
std z+9,R19
.dbline 343
; sprintf((char*)ScratchPad + strlen((char*)ScratchPad), "%lu", dw);
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strlen
movw R30,R28
ldd R2,z+6
ldd R3,z+7
ldd R4,z+8
ldd R5,z+9
std y+0,R2
std y+1,R3
std y+2,R4
std y+3,R5
ldi R18,<L126
ldi R19,>L126
ldi R24,<_ScratchPad
ldi R25,>_ScratchPad
add R16,R24
adc R17,R25
xcall _sprintf
.dbline 344
; break;
xjmp L110
L127:
.dbline 345
; case LCP_PFC : strcat((char*)ScratchPad, " PFC");
ldi R18,<L128
ldi R19,>L128
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 346
; break;
xjmp L110
L129:
.dbline 347
; case LCP_ACFC : strcat((char*)ScratchPad, " ACFC");
ldi R18,<L130
ldi R19,>L130
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 348
; break;
xjmp L110
L109:
.dbline 349
; default : strcat((char*)ScratchPad, " .. ");
ldi R18,<L131
ldi R19,>L131
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 350
ldi R22,2
ldi R23,0
xjmp L135
L132:
.dbline 350
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strlen
ldd R30,y+10
ldd R31,y+11
add R30,R22
adc R31,R23
ldi R24,<_MainBuffer
ldi R25,>_MainBuffer
add R30,R24
adc R31,R25
ldd R4,z+0
clr R5
std y+1,R5
std y+0,R4
ldi R18,<L136
ldi R19,>L136
ldi R24,<_ScratchPad
ldi R25,>_ScratchPad
add R16,R24
adc R17,R25
xcall _sprintf
L133:
.dbline 350
subi R22,255 ; offset = 1
sbci R23,255
L135:
.dbline 350
; for (j = 2; j < len; j++) sprintf((char*)ScratchPad + strlen((char*)ScratchPad), "%02X ", (u16)((u8)MainBuffer[i + j]));
mov R2,R10
clr R3
cp R22,R2
cpc R23,R3
brlo L132
.dbline 351
; break;
L110:
.dbline 353
; }
; }
L107:
L89:
.dbline 354
; strcat((char*)ScratchPad, "\n");
ldi R18,<L137
ldi R19,>L137
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _strcat
.dbline 355
; if (!SendDebugStr((char*)ScratchPad)) return false;
ldi R16,<_ScratchPad
ldi R17,>_ScratchPad
xcall _SendDebugStr
tst R16
brne L138
.dbline 355
clr R16
xjmp L34
L138:
.dbline 356
mov R2,R10
clr R3
ldd R0,y+10
ldd R1,y+11
add R0,R2
adc R1,R3
std y+11,R1
std y+10,R0
.dbline 357
L83:
.dbline 296
ldd R24,y+10
ldd R25,y+11
adiw R24,2
ldd R0,y+22
ldd R1,y+23
cp R0,R24
cpc R1,R25
brlo X25
xjmp L82
X25:
.dbline 358
; i += len;
; }
; }
L77:
.dbline 359
; }
L74:
.dbline 363
;
; // ********************
;
; return true;
ldi R16,1
.dbline -2
L34:
adiw R28,12
xcall pop_gset5
adiw R28,2
.dbline 0 ; func end
ret
.dbsym l dw 6 l
.dbsym r j 22 s
.dbsym r CodeHeader 20 pS[TCodeHeader]
.dbsym r type 12 c
.dbsym r Protocol 14 s
.dbsym r len 10 c
.dbsym l i 10 s
.dbsym l Bytes 22 s
.dbsym r Tx 20 c
.dbend
.dbfunc e PPP_DisplayStage _PPP_DisplayStage fc
.even
_PPP_DisplayStage::
xcall push_gset1
.dbline -1
.dbline 367
; }
;
; bool PPP_DisplayStage(void)
; {
.dbline 368
; if(!SendDebugRStr(PPPStageStr1)) return false;
ldi R16,<_PPPStageStr1
ldi R17,>_PPPStageStr1
xcall _SendDebugRStr
tst R16
brne L141
.dbline 368
clr R16
xjmp L140
L141:
.dbline 369
; switch (PPP.Stage)
lds R20,_PPP+9
clr R21
cpi R20,0
cpc R20,R21
breq L147
X26:
cpi R20,1
ldi R30,0
cpc R21,R30
breq L148
cpi R20,2
ldi R30,0
cpc R21,R30
breq L149
cpi R20,3
ldi R30,0
cpc R21,R30
breq L150
cpi R20,4
ldi R30,0
cpc R21,R30
breq L151
cpi R20,5
ldi R30,0
cpc R21,R30
breq L152
cpi R20,6
ldi R30,0
cpc R21,R30
breq L153
xjmp L143
X27:
.dbline 370
; {
L147:
.dbline 371
; case PPPS_None : return SendDebugRStr(PPPStageStr2);
ldi R16,<_PPPStageStr2
ldi R17,>_PPPStageStr2
xcall _SendDebugRStr
xjmp L140
L148:
.dbline 372
; case PPPS_Start : return SendDebugRStr(PPPStageStr3);
ldi R16,<_PPPStageStr3
ldi R17,>_PPPStageStr3
xcall _SendDebugRStr
xjmp L140
L149:
.dbline 373
; case PPPS_LCP : return SendDebugRStr(PPPStageStr4);
ldi R16,<_PPPStageStr4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -