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

📄 cgi.s

📁 uIP是免费的TCP/IP协议栈,我们将它移植到我们的AVR以太网开发板中
💻 S
📖 第 1 页 / 共 2 页
字号:
;      particular file (given as an argument to the function in the
;      script). We then use uip_send() to actually send the data. */
;   if(next) {
	tst R10
	breq L21
	.dbline 165
	.dbline 166
;     return 1;
	ldi R16,1
	xjmp L20
L21:
L23:
	.dbline 168
	.dbline 168
	lds R2,_uip_appdata
	lds R3,_uip_appdata+1
	sts _uip_sappdata+1,R3
	sts _uip_sappdata,R2
	.dbline 168
	lds R30,_hs
	lds R31,_hs+1
	ldd R16,z+5
	ldd R17,z+6
	subi R16,252  ; offset = 4
	sbci R17,255
	xcall _fs_count
	std y+1,R17
	std y+0,R16
	ldi R18,<L26
	ldi R19,>L26
	lds R16,_uip_appdata
	lds R17,_uip_appdata+1
	xcall _sprintf
	sts _uip_slen+1,R17
	sts _uip_slen,R16
	.dbline 168
L24:
	.dbline 168
;   }
;   uip_send(uip_appdata, sprintf((char *)uip_appdata, "%5u", fs_count(&hs->script[4])));  
	.dbline 169
;   return 0;
	clr R16
	.dbline -2
L20:
	adiw R28,2
	xcall pop_gset3x
	.dbline 0 ; func end
	ret
	.dbsym r next 10 c
	.dbend
	.dbfunc s tcp_stats _tcp_stats fc
	.dbstruct 0 35 uip_conn
	.dbfield 0 ripaddr A[4:2]s
	.dbfield 4 lport s
	.dbfield 6 rport s
	.dbfield 8 rcv_nxt A[4:4]c
	.dbfield 12 snd_nxt A[4:4]c
	.dbfield 16 len s
	.dbfield 18 mss s
	.dbfield 20 initialmss s
	.dbfield 22 sa c
	.dbfield 23 sv c
	.dbfield 24 rto c
	.dbfield 25 tcpstateflags c
	.dbfield 26 timer c
	.dbfield 27 nrtx c
	.dbfield 28 appstate A[7:7]c
	.dbend
;           conn -> R10,R11
;           next -> R10
	.even
_tcp_stats:
	xcall push_gset4x
	mov R10,R16
	sbiw R28,20
	.dbline -1
	.dbline 174
; }
; /*-----------------------------------------------------------------------------------*/
; static u8_t
; tcp_stats(u8_t next)
; {
	.dbline 177
;   struct uip_conn *conn;  
; 
;   if(next) {
	tst R10
	breq L28
	.dbline 177
	.dbline 180
;     /* If the previously sent data has been acknowledged, we move
;        forward one connection. */
;     if(++hs->count == UIP_CONNS) {
	lds R24,_hs
	lds R25,_hs+1
	adiw R24,1
	movw R30,R24
	ldd R24,z+0
	ldd R25,z+1
	adiw R24,1
	movw R4,R24
	std z+1,R5
	std z+0,R4
	cpi R24,10
	ldi R30,0
	cpc R25,R30
	brne L30
	.dbline 180
	.dbline 183
;       /* If all connections has been printed out, we are done and
; 	 return 1. */
;       return 1;
	ldi R16,1
	xjmp L27
L30:
	.dbline 185
;     }
;   }
L28:
	.dbline 187
;   
;   conn = &uip_conns[hs->count];
	lds R30,_hs
	lds R31,_hs+1
	ldd R18,z+1
	ldd R19,z+2
	ldi R16,35
	ldi R17,0
	xcall empy16s
	movw R10,R16
	ldi R24,<_uip_conns
	ldi R25,>_uip_conns
	add R10,R24
	adc R11,R25
	.dbline 188
;   if((conn->tcpstateflags & TS_MASK) == CLOSED) {
	movw R30,R10
	ldd R24,z+25
	andi R24,15
	breq X3
	xjmp L32
X3:
	.dbline 188
L34:
	.dbline 189
;     uip_send(uip_appdata, sprintf((char *)uip_appdata,
	.dbline 189
	lds R2,_uip_appdata
	lds R3,_uip_appdata+1
	sts _uip_sappdata+1,R3
	sts _uip_sappdata,R2
	.dbline 189
	movw R30,R10
	ldd R2,z+25
	sbrs R2,4
	rjmp L38
	ldi R24,33
	ldi R25,0
	movw R12,R24
	xjmp L39
L38:
	ldi R24,32
	ldi R25,0
	movw R12,R24
L39:
	std y+7,R13
	std y+6,R12
	movw R30,R10
	ldd R2,z+16
	ldd R3,z+17
	tst R2
	brne X1
	tst R3
	breq L40
X1:
	ldi R24,42
	ldi R25,0
	movw R12,R24
	xjmp L41
L40:
	ldi R24,32
	ldi R25,0
	movw R12,R24
L41:
	std y+5,R13
	std y+4,R12
	movw R30,R10
	ldd R2,z+26
	clr R3
	std y+3,R3
	std y+2,R2
	movw R30,R10
	ldd R2,z+27
	clr R3
	std y+1,R3
	std y+0,R2
	ldi R18,<L37
	ldi R19,>L37
	lds R16,_uip_appdata
	lds R17,_uip_appdata+1
	xcall _sprintf
	sts _uip_slen+1,R17
	sts _uip_slen,R16
	.dbline 189
	.dbline 189
	.dbline 195
	xjmp L33
L32:
	.dbline 195
; 				  "<tr align=\"center\"><td>-</td><td>-</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
; 				  conn->nrtx,
; 				  conn->timer,
; 				  (uip_outstanding(conn))? '*':' ',
;     				  (uip_stopped(conn))? '!':' '));
;   } else {
L42:
	.dbline 196
;     uip_send(uip_appdata, sprintf((char *)uip_appdata,
	.dbline 196
	lds R2,_uip_appdata
	lds R3,_uip_appdata+1
	sts _uip_sappdata+1,R3
	sts _uip_sappdata,R2
	.dbline 196
	movw R30,R10
	ldd R16,z+0
	ldd R17,z+1
	xcall _htons
	movw R2,R16
	movw R30,R10
	ldd R16,z+0
	ldd R17,z+1
	push R2
	push R3
	xcall _htons
	pop R3
	pop R2
	movw R4,R16
	movw R30,R10
	ldd R16,z+2
	ldd R17,z+3
	push R4
	push R5
	push R2
	push R3
	xcall _htons
	pop R3
	pop R2
	pop R5
	pop R4
	movw R6,R16
	movw R30,R10
	ldd R16,z+2
	ldd R17,z+3
	push R6
	push R7
	push R4
	push R5
	push R2
	push R3
	xcall _htons
	pop R3
	pop R2
	pop R5
	pop R4
	pop R7
	pop R6
	movw R8,R16
	movw R30,R10
	ldd R16,z+6
	ldd R17,z+7
	push R8
	push R9
	push R6
	push R7
	push R4
	push R5
	push R2
	push R3
	xcall _htons
	pop R3
	pop R2
	pop R5
	pop R4
	pop R7
	pop R6
	pop R9
	pop R8
	movw R24,R16
	movw R30,R10
	adiw R30,25
	ldd R30,z+0
	sbrs R30,4
	rjmp L46
	ldi R30,33
	ldi R31,0
	movw R12,R30
	xjmp L47
L46:
	ldi R30,32
	ldi R31,0
	movw R12,R30
L47:
	std y+19,R13
	std y+18,R12
	movw R30,R10
	ldd R26,z+16
	ldd R27,z+17
	cpi R26,0
	cpc R26,R27
	breq L48
X2:
	ldi R30,42
	ldi R31,0
	movw R12,R30
	xjmp L49
L48:
	ldi R30,32
	ldi R31,0
	movw R12,R30
L49:
	std y+17,R13
	std y+16,R12
	movw R30,R10
	adiw R30,26
	ldd R30,z+0
	clr R31
	std y+15,R31
	std y+14,R30
	movw R30,R10
	adiw R30,27
	ldd R30,z+0
	clr R31
	std y+13,R31
	std y+12,R30
	movw R30,R10
	adiw R30,25
	ldd R30,z+0
	andi R30,15
	ldi R31,2
	mul R31,R30
	movw R30,R0
	ldi R26,<_states
	ldi R27,>_states
	add R30,R26
	adc R31,R27
	ldd R26,z+0
	ldd R27,z+1
	std y+11,R27
	std y+10,R26
	std y+9,R25
	std y+8,R24
	movw R30,R8
	andi R31,0
	std y+7,R31
	std y+6,R30
	movw R30,R6
	mov R30,R31
	clr R31
	std y+5,R31
	std y+4,R30
	movw R30,R4
	andi R31,0
	std y+3,R31
	std y+2,R30
	movw R30,R2
	mov R30,R31
	clr R31
	std y+1,R31
	std y+0,R30
	ldi R18,<L45
	ldi R19,>L45
	lds R16,_uip_appdata
	lds R17,_uip_appdata+1
	xcall _sprintf
	sts _uip_slen+1,R17
	sts _uip_slen,R16
	.dbline 196
L43:
	.dbline 196
	.dbline 208
; 				  "<tr align=\"center\"><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
; 				  htons(conn->ripaddr[0]) >> 8,
; 				  htons(conn->ripaddr[0]) & 0xff,
; 				  htons(conn->ripaddr[1]) >> 8,
; 				  htons(conn->ripaddr[1]) & 0xff,
; 				  htons(conn->rport),
; 				  states[conn->tcpstateflags & TS_MASK],
; 				  conn->nrtx,
; 				  conn->timer,
; 				  (uip_outstanding(conn))? '*':' ',
;     				  (uip_stopped(conn))? '!':' '));
;   }
L33:
	.dbline 209
;   return 0;
	clr R16
	.dbline -2
L27:
	adiw R28,20
	xcall pop_gset4x
	.dbline 0 ; func end
	ret
	.dbsym r conn 10 pS[uip_conn]
	.dbsym r next 10 c
	.dbend
	.area data(ram, con, rel)
	.dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
L45:
	.blkb 97
	.area idata
	.byte 60,'t,'r,32,'a,'l,'i,'g,'n,61,34,'c,'e,'n,'t,'e
	.byte 'r,34,62,60,'t,'d,62,37,'u,46,37,'u,46,37,'u,46
	.byte 37,'u,58,37,'u,60,47,'t,'d,62,60,'t,'d,62,37,'s
	.byte 60,47,'t,'d,62,60,'t,'d,62,37,'u,60,47,'t,'d,62
	.byte 60,'t,'d,62,37,'u,60,47,'t,'d,62,60,'t,'d,62,37
	.byte 'c,32,37,'c,60,47,'t,'d,62,60,47,'t,'r,62,13,10
	.byte 0
	.area data(ram, con, rel)
	.dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
L37:
	.blkb 83
	.area idata
	.byte 60,'t,'r,32,'a,'l,'i,'g,'n,61,34,'c,'e,'n,'t,'e
	.byte 'r,34,62,60,'t,'d,62,45,60,47,'t,'d,62,60,'t,'d
	.byte 62,45,60,47,'t,'d,62,60,'t,'d,62,37,'u,60,47,'t
	.byte 'd,62,60,'t,'d,62,37,'u,60,47,'t,'d,62,60,'t,'d
	.byte 62,37,'c,32,37,'c,60,47,'t,'d,62,60,47,'t,'r,62
	.byte 13,10,0
	.area data(ram, con, rel)
	.dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
L26:
	.blkb 4
	.area idata
	.byte 37,53,'u,0
	.area data(ram, con, rel)
	.dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
L15:
	.blkb 6
	.area idata
	.byte 37,53,'u,13,10,0
	.area data(ram, con, rel)
	.dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
	.area func_lit
PL_tcp_stats:	.word `_tcp_stats
PL_file_stats:	.word `_file_stats
PL_print_stats:	.word `_print_stats

⌨️ 快捷键说明

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