Subversion Repositories Kolibri OS

Rev

Rev 484 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                   ;;
  3. ;;    POP CLIENT for MenuetOS                        ;;
  4. ;;    - Modified from IRC client                     ;;
  5. ;;                                                   ;;
  6. ;;    License: GPL / See file COPYING for details    ;;
  7. ;;    Copyright 2002 (c) Ville Turjanmaa             ;;
  8. ;;                                                   ;;
  9. ;;    Compile with FASM for Menuet                   ;;
  10. ;;                                                   ;;
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12. include '..\..\..\macros.inc'
  13. version equ '0.1'
  14.  
  15. use32
  16.  
  17.                 org     0x0
  18.  
  19.                 db      'MENUET01'              ; 8 byte id
  20.                 dd      0x01                    ; required os
  21.                 dd      START                   ; program start
  22.                 dd      I_END                   ; program image size
  23.                 dd      0x200000                ; required amount of memory
  24.                 dd      0xffff0
  25.                 dd      0,0
  26.  
  27. START:                          ; start of execution
  28.  
  29.     mov  [file_start],0x100000
  30.  
  31.     mov  eax,70
  32.     mov  ebx,filel
  33.     mcall
  34.  
  35.     test eax,eax
  36.     jz   @f
  37.     cmp  eax,6
  38.     jnz  notfound
  39. @@:
  40.     add  [file_start],ebx
  41.   notfound:
  42.  
  43.     mov  edi,I_END
  44.     mov  ecx,60*120
  45.     mov  al,32
  46.     cld
  47.     rep  stosb
  48.  
  49.     mov  eax,[rxs]
  50.     imul eax,11
  51.     mov  [pos],eax
  52.  
  53.     mov  ebp,0
  54.     mov  edx,I_END
  55.  
  56. redraw:                         ; redraw
  57.     call draw_window            ; at first, draw the window
  58.  
  59. still:
  60.  
  61.     mov  eax,5
  62.     mov  ebx,1
  63.     mcall
  64.  
  65.     mov  eax,11                 ; wait here for event
  66.     mcall
  67.  
  68.     cmp  eax,1                  ; redraw
  69.     je   redraw
  70.     cmp  eax,2                  ; key
  71.     je   key
  72.     cmp  eax,3                  ; button
  73.     je   button
  74.  
  75.     cmp  [I_END+120*60],byte 1
  76.     jne  no_main_update
  77.     mov  [I_END+120*60],byte 0
  78.     mov  edx,I_END
  79.     call draw_server_data
  80.   no_main_update:
  81.  
  82.     cmp  [server_active],0
  83.     je   noread
  84.     call read_incoming_data
  85.   noread:
  86.  
  87.     call print_status
  88.  
  89.     cmp  [status],4
  90.     je   send_request
  91.  
  92.     jmp  still
  93.  
  94.  
  95. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  96. ;;
  97. ;;  Save the fetched mails
  98. ;;
  99.  
  100.  
  101. save_file:
  102.  
  103.    pusha
  104.  
  105.    mov  ebx,files
  106.    mov  eax,[file_start]
  107.    sub  eax,0x100000
  108.    mov  [ebx+12],eax
  109.  
  110.    mov  eax,70
  111.    mcall
  112.  
  113.    popa
  114.  
  115.    ret
  116.  
  117.  
  118. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  119. ;;
  120. ;;  Send user id/passwd/mailrq
  121. ;;
  122.  
  123.  
  124. send_request:
  125.  
  126.     inc  [mcounter]
  127.  
  128.     cmp  [mcounter],1000
  129.     jbe  no_send
  130.  
  131.     mov  eax,[ccounter]
  132.     imul  eax,32
  133.     add  eax,getmail
  134.     mov  esi,eax
  135.  
  136.     inc  [ccounter]
  137.  
  138.     mov  edx,32
  139.  
  140.     cmp  [ccounter],1
  141.     jne  no1
  142.     mov  edx,5+2
  143.     add  edx,[l2]
  144.   no1:
  145.  
  146.     cmp  [ccounter],2
  147.     jne  no2
  148.     mov  edx,5+2
  149.     add  edx,[l3]
  150.   no2:
  151.  
  152.     mov  eax,53
  153.     mov  ebx,7
  154.     mov  ecx,[socket]
  155.     mcall
  156.     mov  [mcounter],0
  157.  
  158.     cmp  [esi],dword 'quit'
  159.     je   close_fetch
  160.  
  161.  
  162.   no_send:
  163.  
  164.     jmp  still
  165.  
  166.  
  167. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  168. ;;
  169. ;;  Close connection to server
  170. ;;
  171.  
  172.  
  173. close_fetch:
  174.  
  175.     mov  eax,53
  176.     mov  ebx,7
  177.     mov  ecx,[socket]
  178.     mov  edx,14
  179.     mov  esi,quitc
  180.     mcall
  181.     mov  [mcounter],0
  182.  
  183.     mov  eax,5
  184.     mov  ebx,150
  185.     mcall
  186.  
  187.     call read_incoming_data
  188.  
  189.     mov  eax,53
  190.     mov  ebx,8
  191.     mov  ecx,[socket]
  192.     mcall
  193.  
  194.     mov  eax,5
  195.     mov  ebx,2
  196.     mcall
  197.  
  198.     mov  eax,53
  199.     mov  ebx,8
  200.     mov  ecx,[socket]
  201.     mcall
  202.  
  203.     mov  [server_active],0
  204.  
  205.     jmp  still
  206.  
  207.  
  208. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  209. ;;
  210. ;;  User input processing
  211. ;;
  212.  
  213.  
  214. key:
  215.  
  216.     mov  eax,2
  217.     mcall
  218.  
  219.     jmp  still
  220.  
  221.  
  222. button:                         ; button
  223.  
  224.     mov  eax,17                 ; get id
  225.     mcall
  226.  
  227.     cmp  ah,60
  228.     jne  no_open
  229.         mov     eax, 70
  230.         mov     ebx, tinypad_start
  231.         mcall
  232.     jmp  still
  233.   no_open:
  234.  
  235.     cmp  ah,1                   ; close program
  236.     jne  noclose
  237.     mov  eax,-1
  238.     mcall
  239.   noclose:
  240.  
  241.     cmp  ah,51
  242.     je   read_string
  243.     cmp  ah,52
  244.     je   read_string
  245.     cmp  ah,53
  246.     je   read_string
  247.  
  248.     call socket_commands
  249.  
  250.     jmp  still
  251.  
  252.  
  253. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  254. ;;
  255. ;;  Socket open & close
  256. ;;
  257.  
  258. socket_commands:
  259.  
  260.     cmp  ah,22       ; open socket
  261.     jnz  tst3
  262.  
  263.     mov  [server_active],1
  264.  
  265.     mov  [mcounter],900
  266.     mov  [ccounter],0
  267.  
  268.     mov  eax,3
  269.     mcall
  270.  
  271.     mov  eax,3
  272.     mcall
  273.     mov  ecx,eax
  274.     and  ecx,0xffff
  275.  
  276.     mov  eax,53
  277.     mov  ebx,5
  278.     mov  edx,110
  279.     mov  esi,dword [ip]
  280.     mov  edi,1
  281.     mcall
  282.     mov  [socket], eax
  283.  
  284.     ret
  285.   tst3:
  286.  
  287.  
  288.     cmp  ah,24     ; close socket
  289.     jnz  no_24
  290.     mov  eax,53
  291.     mov  ebx,8
  292.     mov  ecx,[socket]
  293.     mcall
  294.     mov  [header_sent],0
  295.     mov  [mail_rp],0
  296.     mov  [server_active],0
  297.  
  298.     ret
  299.   no_24:
  300.  
  301.     ret
  302.  
  303.  
  304.  
  305. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  306. ;;
  307. ;;  Display connection status
  308. ;;
  309.  
  310. old_status dd 0x0
  311.  
  312. print_status:
  313.  
  314.     pusha
  315.  
  316.     mov  eax,53
  317.     mov  ebx,6
  318.     mov  ecx,[socket]
  319.     mcall
  320.  
  321.     mov  [status],eax
  322.  
  323.     cmp  eax,[old_status]
  324.     je   nopr
  325.  
  326.     mov  [old_status],eax
  327.  
  328.     push eax
  329.  
  330.     mov  eax,13
  331.     mov  ebx,200*65536+30
  332.     mov  ecx,160*65536+10
  333.     mov  edx,0xffffff
  334.     mcall
  335.  
  336.     pop  ecx
  337.  
  338.     cmp  [server_active],1
  339.     jne  nopr
  340.  
  341.     mov  eax,47
  342.     mov  ebx,3*65536
  343.     mov  edx,200*65536+160
  344.     mov  esi,0x000000
  345.     mcall
  346.  
  347.   nopr:
  348.  
  349.     popa
  350.  
  351.     ret
  352.  
  353.  
  354.  
  355.  
  356.  
  357. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  358. ;;
  359. ;;  Read data from server
  360. ;;
  361.  
  362.  
  363. read_incoming_data:
  364.  
  365.     pusha
  366.  
  367.   read_new_byte:
  368.  
  369.     call read_incoming_byte
  370.     cmp  ecx,-1
  371.     je   no_data_in_buffer
  372.  
  373.     mov  eax,[file_start]
  374.     mov  [eax],bl
  375.     inc  [file_start]
  376.  
  377.     cmp  bl,10
  378.     jne  no_start_command
  379.     mov  [cmd],1
  380.   no_start_command:
  381.  
  382.     cmp  bl,13
  383.     jne  no_end_command
  384.     mov  eax,[cmd]
  385.     mov  [eax+command-2],byte 0
  386.     call save_file
  387.     call analyze_data
  388.     mov  edi,command
  389.     mov  ecx,250
  390.     mov  eax,0
  391.     cld
  392.     rep  stosb
  393.     mov  [cmd],0
  394.   no_end_command:
  395.  
  396.     mov  eax,[cmd]
  397.     cmp  eax,250
  398.     jge  still
  399.  
  400.     mov  [eax+command-2],bl
  401.     inc  [cmd]
  402.  
  403.     jmp  read_new_byte
  404.  
  405.   no_data_in_buffer:
  406.  
  407.     popa
  408.  
  409.     ret
  410.  
  411.  
  412. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  413. ;;
  414. ;;  Read user input for ip/user/passwd
  415. ;;
  416.  
  417.  
  418. read_string:
  419.  
  420.     shr  eax,8
  421.     sub  eax,51
  422.     mov  ebx,eax
  423.     imul eax,12
  424.     add  eax,181
  425.  
  426.     mov  [len],ebx
  427.     shl  [len],2
  428.     add  [len],l1
  429.  
  430.     imul ebx,50
  431.     add  ebx,input1
  432.  
  433.     mov  [addr],ebx
  434.     mov  [ya],eax
  435.  
  436.     mov  edi,[addr]
  437.     mov  eax,0
  438.     mov  ecx,30
  439.     cld
  440.     rep  stosb
  441.  
  442.     call print_input_text
  443.  
  444.     mov  edi,[addr]
  445.  
  446.   f11:
  447.     mov  eax,10
  448.     mcall
  449.     cmp  eax,2
  450.     jne  read_done
  451.     mov  eax,2
  452.     mcall
  453.     shr  eax,8
  454.     cmp  eax,13
  455.     je   read_done
  456.     cmp  eax,8
  457.     jnz  nobsl
  458.     cmp  edi,[addr]
  459.     jz   f11
  460.     sub  edi,1
  461.     mov  [edi],byte 32
  462.     call print_text
  463.     jmp  f11
  464.   nobsl:
  465.     mov  [edi],al
  466.  
  467.     call print_input_text
  468.  
  469.     add  edi,1
  470.     mov  esi,[addr]
  471.     add  esi,30
  472.     cmp  esi,edi
  473.     jnz  f11
  474.  
  475.   read_done:
  476.  
  477.     push edi
  478.  
  479.     mov  ecx,40
  480.     mov  eax,32
  481.     cld
  482.     rep  stosb
  483.  
  484.     call print_input_text
  485.  
  486.     pop  edi
  487.     sub  edi,[addr]
  488.     mov  eax,[len]
  489.     mov  [eax],edi
  490.  
  491.     cmp  [len],l1
  492.     jne  noip
  493.     mov  esi,input1
  494.     mov  edi,ip_text+15
  495.     mov  ecx,16
  496.     cld
  497.     rep  movsb
  498.     call ip_set
  499.    noip:
  500.  
  501.     cmp  [len],l2
  502.     jne  nol2
  503.     mov  esi,input2
  504.     mov  edi,l2_text+15
  505.     mov  ecx,22
  506.     cld
  507.     rep  movsb
  508.     mov  esi,input2
  509.     mov  edi,getmail+5
  510.     mov  ecx,[l2]
  511.     cld
  512.     rep  movsb
  513.     mov  al,13
  514.     stosb
  515.     mov  al,10
  516.     stosb
  517.    nol2:
  518.  
  519.     cmp  [len],l3
  520.     jne  nol3
  521.     mov  esi,input3
  522.     mov  edi,getmail+32+5
  523.     mov  ecx,[l3]
  524.     cld
  525.     rep  movsb
  526.     mov  al,13
  527.     stosb
  528.     mov  al,10
  529.     stosb
  530.    nol3:
  531.  
  532.     call draw_window
  533.  
  534.     jmp  still
  535.  
  536.  
  537.  
  538. print_input_text:
  539.  
  540.     pusha
  541.  
  542.     mov  eax,13
  543.     mov  ebx,95*65536+23*6
  544.     mov  ecx,[ya]
  545.     shl  ecx,16
  546.     mov  cx,9
  547.     mov  edx,0xffffff
  548.     mcall
  549.  
  550.     cmp  [len],l3
  551.     je   noprt
  552.  
  553.     mov  eax,4
  554.     mov  edx,[addr]
  555.     mov  ebx,95*65536
  556.     add  ebx,[ya]
  557.     mov  ecx,0x000000
  558.     mov  esi,23
  559.     mcall
  560.  
  561.   noprt:
  562.  
  563.     popa
  564.     ret
  565.  
  566.  
  567. ip_set:
  568.  
  569.     mov   esi,input1-1
  570.     mov   edi,ip
  571.     xor   eax,eax
  572.    ip1:
  573.     inc   esi
  574.     cmp   [esi],byte '0'
  575.     jb    ip2
  576.     cmp   [esi],byte '9'
  577.     jg    ip2
  578.     imul  eax,10
  579.     movzx ebx,byte [esi]
  580.     sub   ebx,48
  581.     add   eax,ebx
  582.     jmp   ip1
  583.    ip2:
  584.     mov   [edi],al
  585.     xor   eax,eax
  586.     inc   edi
  587.     cmp   edi,ip+3
  588.     jbe   ip1
  589.     ret
  590.    no_read_ip:
  591.  
  592.     ret
  593.  
  594.  
  595. analyze_data:
  596.  
  597.     pusha
  598.  
  599.     mov  [text_start],I_END
  600.     mov  ecx,[rxs]
  601.     imul ecx,11
  602.     mov  [pos],ecx
  603.  
  604.     mov  bl,13
  605.     call print_character
  606.     mov  bl,10
  607.     call print_character
  608.  
  609.     cmp  [cmd],2
  610.     jbe  nott
  611.     mov  ecx,[cmd]
  612.     sub  ecx,2
  613.     mov  esi,command+0
  614.   newcmdc:
  615.     mov  bl,[esi]
  616.     call print_character
  617.     inc  esi
  618.     loop newcmdc
  619.  
  620.    nott:
  621.  
  622.     mov   edx,I_END
  623.     call  draw_server_data
  624.  
  625.   cmd_len_ok:
  626.  
  627.     cmp  [command],dword '-ERR'
  628.     je   close_fetch
  629.  
  630.     cmp  [command],word '+O'
  631.     jne  nook
  632.     mov  [mcounter],990
  633.   nook:
  634.  
  635.     popa
  636.  
  637.     ret
  638.  
  639.  
  640.  
  641. draw_data:
  642.  
  643.     push eax
  644.  
  645.     add  eax,[text_start]
  646.     mov  [eax],bl
  647.  
  648.     pop  eax
  649.     ret
  650.  
  651.  
  652.  
  653. print_text:
  654.  
  655.     pusha
  656.  
  657.     mov  ecx,command-2
  658.     add  ecx,[cmd]
  659.  
  660.   ptr2:
  661.     mov  bl,[eax]
  662.     cmp  bl,dl
  663.     je   ptr_ret
  664.     cmp  bl,0
  665.     je   ptr_ret
  666.     call print_character
  667.     inc  eax
  668.     cmp  eax,ecx
  669.     jbe  ptr2
  670.  
  671.   ptr_ret:
  672.  
  673.     mov  eax,[text_start]
  674.     mov  [eax+120*60],byte 1
  675.  
  676.     popa
  677.     ret
  678.  
  679.  
  680.  
  681. print_character:
  682.  
  683.     pusha
  684.  
  685.     cmp  bl,13     ; line beginning
  686.     jne  nobol
  687.     mov  ecx,[pos]
  688.     add  ecx,1
  689.   boll1:
  690.     sub  ecx,1
  691.     mov  eax,ecx
  692.     xor  edx,edx
  693.     mov  ebx,[rxs]
  694.     div  ebx
  695.     cmp  edx,0
  696.     jne  boll1
  697.     mov  [pos],ecx
  698.     jmp  newdata
  699.   nobol:
  700.  
  701.     cmp  bl,10     ; line down
  702.     jne  nolf
  703.    addx1:
  704.     add  [pos],dword 1
  705.     mov  eax,[pos]
  706.     xor  edx,edx
  707.     mov  ecx,[rxs]
  708.     div  ecx
  709.     cmp  edx,0
  710.     jnz  addx1
  711.     mov  eax,[pos]
  712.     jmp  cm1
  713.   nolf:
  714.   no_lf_ret:
  715.  
  716.  
  717.     cmp  bl,15    ; character
  718.     jbe  newdata
  719.  
  720.     mov  eax,[irc_data]
  721.     shl  eax,8
  722.     mov  al,bl
  723.     mov  [irc_data],eax
  724.  
  725.     mov  eax,[pos]
  726.     call draw_data
  727.  
  728.     mov  eax,[pos]
  729.     add  eax,1
  730.   cm1:
  731.     mov  ebx,[scroll+4]
  732.     imul ebx,[rxs]
  733.     cmp  eax,ebx
  734.     jb   noeaxz
  735.  
  736.     mov  esi,[text_start]
  737.     add  esi,[rxs]
  738.  
  739.     mov  edi,[text_start]
  740.     mov  ecx,ebx
  741.     cld
  742.     rep  movsb
  743.  
  744.     mov  esi,[text_start]
  745.     mov  ecx,[rxs]
  746.     imul ecx,61
  747.     add  esi,ecx
  748.  
  749.     mov  edi,[text_start]
  750.     mov  ecx,[rxs]
  751.     imul ecx,60
  752.     add  edi,ecx
  753.     mov  ecx,ebx
  754.     cld
  755.     rep  movsb
  756.  
  757.     mov  eax,ebx
  758.     sub  eax,[rxs]
  759.   noeaxz:
  760.     mov  [pos],eax
  761.  
  762.   newdata:
  763.  
  764.     mov  eax,[text_start]
  765.     mov  [eax+120*60],byte 1
  766.  
  767.     popa
  768.     ret
  769.  
  770.  
  771.  
  772. read_incoming_byte:
  773.  
  774.     mov  eax, 53
  775.     mov  ebx, 2
  776.     mov  ecx, [socket]
  777.     mcall
  778.  
  779.     mov  ecx,-1
  780.  
  781.     cmp  eax,0
  782.     je   no_more_data
  783.  
  784.     mov  eax, 53
  785.     mov  ebx, 3
  786.     mov  ecx, [socket]
  787.     mcall
  788.  
  789.     mov  ecx,0
  790.  
  791.   no_more_data:
  792.  
  793.     ret
  794.  
  795.  
  796. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  797. ;;
  798. ;;  Window definitions
  799. ;;
  800.  
  801.  
  802.  
  803. draw_window:
  804.  
  805.     pusha
  806.  
  807.     mov  eax,12
  808.     mov  ebx,1
  809.     mcall
  810.  
  811.     mov  eax,0                     ; draw window
  812.     mov  ebx,5*65536+435
  813.     mov  ecx,5*65536+232
  814.     mov  edx,0x13ffffff
  815.     mov  edi,labelt
  816.     mcall
  817.  
  818.     mov  [old_status],300
  819.  
  820.     mov  eax,8                     ; button: open socket
  821.     mov  ebx,23*65536+22
  822.     mov  ecx,155*65536+10
  823.     mov  edx,22
  824.     mov  esi,0x44cc44
  825.     mcall
  826.  
  827. ;    mov  eax,8                     ; button: close socket
  828.     mov  ebx,295*65536+22
  829.     mov  ecx,155*65536+10
  830.     mov  edx,24
  831.     mov  esi,0xcc4444
  832.     mcall
  833.  
  834. ;    mov  eax,8                     ; button: text entries
  835.     mov  ebx,243*65536+8
  836.     mov  ecx,180*65536+8
  837.     mov  edx,51
  838.     mov  esi,0x4488dd
  839.   newi:
  840.     mcall
  841.     inc  edx
  842.     add  ecx,12*65536
  843.     cmp  edx,53
  844.     jbe  newi
  845.  
  846. ;    mov  eax,8                     ; open inbox
  847.     mov  ebx,295*65536+102
  848.     mov  ecx,190*65536+14
  849.     mov  edx,60
  850.     mov  esi,0x5577dd
  851.     mcall
  852.  
  853.     mov  eax,38                    ; line
  854.     mov  ebx,5*65536+430
  855.     mov  ecx,114*65536+114
  856.     mov  edx,0x000000
  857.     mcall
  858.  
  859.     mov  ebx,5*65536+133          ; info text
  860.     mov  ecx,0x000000
  861.     mov  edx,text
  862.     mov  esi,70
  863.   newline:
  864.     mov  eax,4
  865.     mcall
  866.     add  ebx,12
  867.     add  edx,70
  868.     cmp  [edx],byte 'x'
  869.     jne  newline
  870.  
  871.     mov  edx,I_END                ; text from server
  872.     call draw_server_data
  873.  
  874.     mov  eax,12
  875.     mov  ebx,2
  876.     mcall
  877.  
  878.     popa
  879.  
  880.     ret
  881.  
  882.  
  883. draw_server_data:
  884.  
  885.     pusha
  886.  
  887.     mov   eax,4
  888.     mov   ebx,10*65536+26
  889.     mov   ecx,8
  890.     mov   esi,[rxs]
  891.   dct:
  892.     pusha
  893.     mov   ecx,ebx
  894.     shl   ecx,16
  895.     mov   cl,9
  896.     mov   eax,13
  897.     mov   ebx,10*65536
  898.     mov   bx,word [rxs]
  899.     imul  bx,6
  900.     mov   edx,0xffffff
  901.     mcall
  902.     popa
  903.     push  ecx
  904.     mov   eax,4
  905.     mov   ecx,0
  906.     mcall
  907.     add   edx,[rxs]
  908.     add   ebx,10
  909.     pop   ecx
  910.     loop  dct
  911.  
  912.     popa
  913.     ret
  914.  
  915.  
  916.  
  917. text:
  918.  
  919. db '   Incoming mails are written to /rd/1/popc.txt                       '
  920. db '                                                                      '
  921. db '        Check for mail.                               Force close     '
  922. db '                                                                      '
  923. ip_text:
  924. db '   Server IP : 192.168.1.200            <                             '
  925. l2_text:
  926. db '   User      :                          <         Open popc.txt       '
  927.  l3_text:
  928. db '   Password  : (not shown)              <                             '
  929.  
  930. db 'x' ; <- END MARKER, DONT DELETE
  931.  
  932. file_start      dd      0x100000
  933.  
  934. ; max size is 0x100000 bytes, read to/write from 0x100000
  935. files:
  936.        dd  2,0,0,?,0x100000
  937.        db  0
  938.        dd  pr
  939. filel:
  940.        dd  0,0,0,0x100000,0x100000
  941. pr db  '/rd/1/popc.txt',0
  942.  
  943. ip     db 192,168,1,200
  944.  
  945. socket  dd  0x0
  946.  
  947. posx             dd  0x0
  948. incoming_pos     dd  0x0
  949. incoming_string: times 128 db 0
  950. pos          dd  0x0
  951.  
  952. text_start   dd  I_END
  953. print        db  0x0
  954. cmd          dd  0x0
  955. rxs          dd  66
  956.  
  957. res:         db  0,0
  958. command:     times  256  db 0x0
  959.  
  960. command_position  dd 0
  961. counter           dd 0
  962.  
  963. numtext      db  '                     '
  964. labelt       db  'POP client v ',version,0
  965. scroll:      dd 1,8
  966.  
  967. tinypad_start:
  968.         dd      7
  969.         dd      0
  970.         dd      pr
  971.         dd      0
  972.         dd      0
  973.         db      '/RD/1/TINYPAD',0
  974.  
  975. getmail:
  976.        db  'user xyz                      ',13,10
  977.        db  'pass xyz                      ',13,10
  978.        db  'retr 1                        ',13,10
  979.        db  'retr 2                        ',13,10
  980.        db  'retr 3                        ',13,10
  981.        db  'retr 4                        ',13,10
  982.        db  'retr 5                        ',13,10
  983.        db  'retr 6                        ',13,10
  984.        db  'retr 7                        ',13,10
  985.        db  'retr 8                        ',13,10
  986.        db  'retr 9                        ',13,10
  987.  
  988. quitc:
  989.        db  'quit        ',13,10
  990.  
  991. mcounter dd 900
  992. ccounter dd 0
  993.  
  994. ld   db 13,10
  995.  
  996. server_active db 0
  997.  
  998. header_sent db 0
  999.  
  1000. close_connection   dd 0x0
  1001.  
  1002. mail_rp      dd  0
  1003.  
  1004. irc_data   dd  0x0
  1005. addr       dd  0x0
  1006. ya         dd  0x0
  1007. len        dd  0x0
  1008.  
  1009. input1:  times 50 db 32
  1010. input2:  times 50 db 32
  1011. input3:  times 50 db 32
  1012.  
  1013. l1 dd 0
  1014. l2 dd 3
  1015. l3 dd 3
  1016.  
  1017. status  dd  0x0
  1018.  
  1019. I_END:
  1020.