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

📄 picnic.lst

📁 PIC单片机实现的一种网络单片机
💻 LST
📖 第 1 页 / 共 5 页
字号:
  0000002D            00199                 remote_adr:2                    ; Remote
  0000002F            00200                 remote_len:2
                      00201 
  00000031            00202                 curr                            ; Current page address
                      00203 
  00000032            00204                 val:4
  00000036            00205                 val_m                           ; for DECIMAL
  00000037            00206                 val_cn:0
  00000037            00207                 proto                           ; Protcol Number
  00000038            00208                 state                           ; TCP Flag
                      00209 
                      00210 ;-----------------------------------------------------------------------------------
                      00211 ;
                      00212 ;               IP Protocol
                      00213 ;
  00000039            00214 ip_header:0
  00000039            00215 ip_ver_len      ; VERSION:4,DATA SIZE:5
  0000003A            00216 ip_tos          ; service type
  0000003B            00217 ip_length:2     ; データ長
  0000003D            00218 ip_ident:2
  0000003F            00219 ip_flagment:2
  00000041            00220 ip_ttl          ; 生存期
  00000042            00221 ip_proto        ; Protocol 1:ICMP,6:TCP,17:UDP
  00000043            00222 ip_sum:2        ; Header Checksum
  00000045            00223 ip_src:4
  00000049            00224 ip_dest:4
                      00225 
                      00226 
                      00227 ;-----------------------------------------------------------------------------------
                      00228 ;               TCP Protocol
                      00229 ;
  0000004D            00230 tcp_header:0
  0000004D            00231 tcp_src_port:2
  0000004F            00232 tcp_tar_port:2
  00000051            00233 tcp_seq_no:4
  00000055            00234 tcp_ack_no:4
  00000059            00235 tcp_header_size
  0000005A            00236 tcp_flags
  0000005B            00237 tcp_window:2
  0000005D            00238 tcp_sum:2
  0000005F            00239 tcp_:2
                      00240         ENDC
                      00241 
                      00242 #define TCP_URG tcp_flags,5
                      00243 #define TCP_ACK tcp_flags,4
                      00244 #define TCP_PSH tcp_flags,3
                      00245 #define TCP_RST tcp_flags,2
                      00246 #define TCP_SYN tcp_flags,1
                      00247 #define TCP_FIN tcp_flags,0
MPASM 03.20 Released           PICNIC.ASM   2-9-2003  15:33:59         PAGE  6


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00248 
                      00249 ;-----------------------------------------------------------------------------------
                      00250 ;               UDP Protocol
                      00251 ;
  0000004D            00252 udp_header      equ     tcp_header
  0000004D            00253 udp_src_port    equ     tcp_header+0
  0000004F            00254 udp_tar_port    equ     tcp_header+2
  00000051            00255 udp_length      equ     tcp_header+4
  00000053            00256 udp_sum         equ     tcp_header+6
  00000055            00257 udp_data        equ     tcp_header+8
                      00258 
                      00259 
                      00260 ;-----------------------------------------------------------------------------------
                      00261 ;               ARP Protocol
                      00262 ;
  00000039            00263 arp_header      equ     ip_header
  00000039            00264 arp_hard_type   equ     ip_header+0
  0000003B            00265 arp_prot_type   equ     ip_header+2
  0000003D            00266 arp_hard_len    equ     ip_header+4
  0000003E            00267 arp_prot_len    equ     ip_header+5
  0000003F            00268 arp_ope         equ     ip_header+6
  00000041            00269 arp_src_mac     equ     ip_header+8
  00000047            00270 arp_src_ip      equ     ip_header+14
  0000004B            00271 arp_dest_mac    equ     ip_header+18
  00000051            00272 arp_dest_ip     equ     ip_header+24
                      00273 ;               =       ip_header+28
                      00274 
                      00275 
                      00276 ;-----------------------------------------------------------------------------------
                      00277 ;               ICMP Protocol
                      00278 ;
  0000004D            00279 icmp_header     equ     tcp_header
  0000004D            00280 icmp_type       equ     tcp_header+0
  0000004E            00281 icmp_code       equ     tcp_header+1
  0000004F            00282 icmp_sum        equ     tcp_header+2
  00000051            00283 icmp_mes        equ     tcp_header+4
                      00284 
                      00285 
                      00286 ;-----------------------------------------------------------------------------------
                      00287 ;               DHCP Protocol
                      00288 ;
  00000055            00289 dhcp_header     equ     udp_data
  00000055            00290 dhcp_ope        equ     udp_data+0
  00000056            00291 dhcp_type       equ     udp_data+1
  00000057            00292 dhcp_phylen     equ     udp_data+2
  00000058            00293 dhcp_hop        equ     udp_data+3
  00000059            00294 dhcp_trans      equ     udp_data+4
  0000005D            00295 dhcp_sec        equ     udp_data+8
  0000005F            00296 dhcp_dummy      equ     udp_data+10
  00000061            00297 dhcp_client_ip  equ     udp_data+12
  00000065            00298 dhcp_user_ip    equ     udp_data+16
  00000069            00299 dhcp_server_ip  equ     udp_data+20
  0000006D            00300 dhcp_router_ip  equ     udp_data+24
MPASM 03.20 Released           PICNIC.ASM   2-9-2003  15:33:59         PAGE  7


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00301 
                      00302 ;-----------------------------------------------------------------------------------
                      00303 ;               环境设定用变量
                      00304 ;
                      00305 ;               ■PAGE 1
                      00306 ;               org     0a0h
                      00307         CBLOCK  0xa0
  000000A0            00308 this_ip:4       ; 自己的IP地址
  000000A4            00309 mymac:6         ; 自己的MAC地址
  000000AA            00310 seq_no:4        ; 自己的序列号
  000000AE            00311 ident:2
                      00312 
  000000B0            00313 timer
  000000B1            00314 timer_cn
  000000B2            00315 dhcp_done
                      00316 
  000000B3            00317 http_port:2     ; 将EEPROM中的Port号拷贝在这里
  000000B5            00318 lcd_port:2
  000000B7            00319 para_port:2
  000000B9            00320 serial_port:2
                      00321 
                      00322 
  000000BB            00323 fifo_poi        ; Routing Used Get Pointer
  000000BC            00324 fifo_buff       ; 中断使用的SET Pointer
  000000BD            00325 fifo_cn         ; 收信Byte数
  000000BE            00326 fifo_top:30     ; 缓冲区
  000000DC            00327 fifo_bottom:0
                      00328 
  000000DC            00329 fifo_line
  000000DD            00330 fifo_line_cn
                      00331 
                      00332 
                      00333 
                      00334 ;-----------------------------------------------------------------------------------
                      00335 ;               Ethernet Header
                      00336 ;
  000000DE            00337 ne_header:0     ; NE2000 Status
  000000DE            00338 ne_stat         ; 收信状态(RSR)
  000000DF            00339 ne_next         ; Next Boundary
  000000E0            00340 ne_cn_l         ; Data Size(L)
  000000E1            00341 ne_cn_h         ; Data Size(H)
                      00342 
  000000E2            00343 eth_header:0    ; Ethernet Header
  000000E2            00344 eth_dest:6      ; Dest MAC Address
  000000E8            00345 eth_src:6       ; Source MAC Address
  000000EE            00346 eth_type:2      ; Packet Type
  000000F0            00347 null:0
                      00348         ENDC
                      00349 
                      00350 
  000000DE            00351 bs_ptr          equ     ne_header
  000000DF            00352 bs_ptr2         equ     ne_header+1
  000000E0            00353 save_line       equ     ne_header+2
MPASM 03.20 Released           PICNIC.ASM   2-9-2003  15:33:59         PAGE  8


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

  000000E1            00354 save_cn         equ     ne_header+3
                      00355 
                      00356 
                      00357 
                      00358 
                      00359 ;-----------------------------------------------------------------------------------
                      00360 ;       10进制变换区
                      00361 ;-----------------------------------------------------------------------------------
                      00362 ;               ■PAGE 2
                      00363 ;               org     110h
                      00364         CBLOCK  0x110
                      00365 ;               ds      16              ; 2进制→10进制变换用
  00000110            00366 dummy:16
  00000120            00367 decimal_top:0
                      00368         ENDC
                      00369 
                      00370 ;-----------------------------------------------------------------------------------
                      00371 ;       RS232送信数据
                      00372 ;-----------------------------------------------------------------------------------
                      00373 ;               ■PAGE 3
0190                  00374                 org     190h
                      00375         CBLOCK  0x190
  00000190            00376 on_ether:6      ; 收信方的Ethernet地址
  00000196            00377 on_ip:4         ; 收信方的IP地址
  0000019A            00378 on_port:2       ; 收信方的端口号
  0000019C            00379 on_rate         ; 设置的波特率
  0000019D            00380 on_flow         ; 0=NONE, 1=HARDWARE
  0000019E            00381 transmitted     ; 发送完的Byte数
                      00382         ENDC
                      00383 
                      00384 ;               org     1a0h
                      00385         CBLOCK  0x1A0
  000001A0            00386 skb:16          ; 16*SOCKETS
                      00387         ENDC
                      00388 ;-----------------------------------------------------------------------------------
                      00389 ;               ■共通变量
                      00390 ;
                      00391 
0070                  00392                 org     70h             ; COMMON MEMORY PAGE
                      00393         CBLOCK  0x70
  00000070            00394 w_save
  00000071            00395 pclath_save
  00000072            00396 status_save
  00000073            00397 fsr_save
  00000074            00398 save_fsr
                      00399 ; END
                      00400 
  00000075            00401 mul10:0
  00000075            00402 getmes_wk:2
  00000077            00403 com_cn
  00000078            00404 byte_cn:0
  00000078            00405 com_fsr
  00000079            00406 ind
MPASM 03.20 Released           PICNIC.ASM   2-9-2003  15:33:59         PAGE  9


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

  0000007A            00407 dest:2
  0000007C            00408 mdata           ; a data for transmit to ethernet chip
  0000007D            00409 wk:2
  0000007F            00410 common
                      00411         ENDC
                      00412 
                      00012 ;
0000                  00013         ORG     0x0000
                      00014 ;
0000                  00015 Begin:
0000   300B           00016         MOVLW   HIGH Start
0001   008A           00017         MOVWF   PCLATH
0002   2BDB           00018         GOTO    Start & 0x7ff
                      00019 ;

⌨️ 快捷键说明

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