Subversion Repositories Kolibri OS

Rev

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

  1. use32
  2.         db      'MENUET01'
  3.         dd      1
  4.         dd      start
  5.         dd      i_end
  6.         dd      mem, mem
  7.         dd      0, 0
  8.  
  9. start:
  10.         push    70
  11.         pop     eax
  12.         mov     ebx, fileinfo
  13.         int     0x40
  14.         cmp     ebx, max_file_size
  15.         jz      exit
  16.         cmp     ebx, -1
  17.         jnz     @f
  18. exit:
  19.         or      eax, -1
  20.         int     0x40
  21. @@:
  22.         mov     esi, filebuf
  23.         xor     ecx, ecx
  24. scan1l1:
  25.         or      edi, -1
  26. scan1:
  27.         inc     edi
  28.         lodsb
  29.         test    al, al
  30.         jz      scan1done
  31.         cmp     al, 13
  32.         jz      newline
  33.         cmp     al, 10
  34.         jnz     scan1
  35. newline:
  36.         test    edi, edi
  37.         jz      scan1l1
  38.         inc     ecx
  39.         jmp     scan1l1
  40. scan1done:
  41.         test    edi, edi
  42.         jz      @f
  43.         inc     ecx
  44. @@:
  45.         jecxz   exit
  46.         push    3
  47.         pop     eax
  48.         int     0x40
  49.         ror     eax, 16
  50.         mov     edx, 1024
  51. @@:
  52.         sub     eax, 0x43ab45b5
  53.         ror     eax, 1
  54.         xor     eax, 0x32c4324f
  55.         ror     eax, 1
  56.         dec     edx
  57.         jnz     @b
  58.         div     ecx
  59. ; use edx as random index
  60.         mov     esi, filebuf
  61. scan2l1:
  62.         push    esi
  63.         or      edi, -1
  64. scan2:
  65.         inc     edi
  66.         lodsb
  67.         test    al, al
  68.         jz      newline2
  69.         cmp     al, 13
  70.         jz      newline2
  71.         cmp     al, 10
  72.         jnz     scan2
  73. newline2:
  74.         pop     eax
  75.         test    edi, edi
  76.         jz      scan2l1
  77.         dec     edx
  78.         jns     scan2l1
  79.         mov     byte [esi-1], 0
  80. ; set eax (-> ASCIIZ string) as skin
  81.         mov     [eax-4], esi
  82.         lea     ecx, [eax-20]
  83.         push    48
  84.         pop     eax
  85.         mov     bl, 8
  86.         int     0x40
  87.         jmp     exit
  88.  
  89. fileinfo:
  90.         dd      0
  91.         dq      0
  92.         dd      max_file_size
  93.         dd      filebuf
  94.         db      '/rd/1/skinsel.dat',0
  95. i_end:
  96. max_file_size = 0x1000 - 0x40 - $
  97. filebuf:
  98.         rb      max_file_size
  99. ; stack
  100.         rb      0x40
  101. mem:
  102.