diff --git a/programs/develop/examples/template/trunk/template.asm b/programs/develop/examples/template/trunk/template.asm index 1298cecb44..e1843ea96c 100644 --- a/programs/develop/examples/template/trunk/template.asm +++ b/programs/develop/examples/template/trunk/template.asm @@ -28,8 +28,6 @@ CODE redraw: ; redraw event handler call draw_window ; at first create and draw the window - mcall 9, procinfo, -1 - wait_event: ; main cycle mov eax, 10 mcall @@ -90,7 +88,5 @@ end if UDATA sc system_colors -procinfo rb 1024 - MEOS_APP_END ; <--- end of MenuetOS application ---> \ No newline at end of file diff --git a/programs/games/kosilka/doexe2.asm b/programs/games/kosilka/doexe2.asm new file mode 100644 index 0000000000..fb23830629 --- /dev/null +++ b/programs/games/kosilka/doexe2.asm @@ -0,0 +1,68 @@ +filename equ 'kosilka.exe' + +virtual at 0 +file filename:3Ch,4 +load pehea dword from 0 +file filename:pehea,0F8h+28h*3 +load NumberOfSections word from 4+6 +load SizeOfOptionalHeader word from 4+14h +if NumberOfSections<>3 +error Expected three sections, .text, .bss and .reloc +end if +if SizeOfOptionalHeader<>0E0h +error Nonstandard PE header +end if +load RelocsRVA dword from 4+0A0h +load RelocsSize dword from 4+0A4h +load ImageBase dword from 4+34h +load TextRVA dword from 4+0F8h+0Ch +load TextSize dword from 4+0F8h+8 +load TextOffs dword from 4+0F8h+14h +load BSSSize dword from 4+0F8h+28h+10h +load RelocRVA dword from 4+0F8h+28h*2+0Ch +load RelocOffs dword from 4+0F8h+28h*2+14h +if BSSSize +error Second section expected to be .bss +end if +if RelocRVA<>RelocsRVA +error Third section expected to be .reloc +end if +;file 'test.exe':pehea+0F8h,28h +;load physofs dword from 4+14h +;load mem dword from 4+8 +;file 'test.exe':physofs+16,4 +;load sz dword from $-4 +end virtual + +file filename:TextOffs,TextSize + +while RelocsSize>8 +virtual at 0 +file filename:RelocOffs,8 +load CurRelocPage dword from 0 +load CurRelocChunkSize dword from 4 +end virtual +RelocsSize=RelocsSize-CurRelocChunkSize +CurRelocChunkSize = CurRelocChunkSize-8 +RelocOffs=RelocOffs+8 +while CurRelocChunkSize +virtual at 0 +file filename:RelocOffs,2 +RelocOffs=RelocOffs+2 +CurRelocChunkSize=CurRelocChunkSize-2 +load s word from 0 +end virtual +CurRelocType = s shr 12 +RelocItem = CurRelocPage + (s and 0xFFF) +if CurRelocType=0 +else if CurRelocType=3 +load z dword from RelocItem-TextRVA +store dword z-(TextRVA+ImageBase) at RelocItem-TextRVA +else +error Unexpected relocation type +end if +end while +end while + +store dword TextSize at 10h +store dword RelocRVA-TextRVA at 14h diff --git a/programs/media/kiv/trunk/kiv.asm b/programs/media/kiv/trunk/kiv.asm index 53cfe70b2a..46172d8672 100644 --- a/programs/media/kiv/trunk/kiv.asm +++ b/programs/media/kiv/trunk/kiv.asm @@ -25,7 +25,7 @@ START: or eax, eax jnz exit -; invoke sort.START, 1 + invoke sort.START, 1 mov ecx, 1 ; for 15.4: 1 = tile cmp word [@PARAMS], '\T' @@ -540,20 +540,20 @@ load_directory: mov [eax+4], ebx test ebx, ebx jz free_directory -; push 0 ; sort mode -; push ebx -; add eax, 32 -; push eax -; call [SortDir] + push 0 ; sort mode + push ebx + add eax, 32 + push eax + call [SortDir] xor eax, eax mov edi, [directory_ptr] add edi, 32 + 40 .scan: mov esi, [last_name_component] inc esi -; push edi -; invoke strcmpi -; pop edi + push edi + invoke strcmpi + pop edi jz .found inc eax add edi, 304 @@ -995,8 +995,8 @@ align 4 library \ libio , 'libio.obj' , \ libgfx , 'libgfx.obj' , \ - libimg , 'libimg.obj' ;, \ -; sort , 'sort.obj' + libimg , 'libimg.obj' , \ + sort , 'sort.obj' import libio , \ libio.init , 'lib_init' , \ @@ -1022,7 +1022,7 @@ import libimg , \ img.destroy , 'img_destroy', \ img.draw , 'img_draw' -;import sort, sort.START, 'START', SortDir, 'SortDir', strcmpi, 'strcmpi' +import sort, sort.START, 'START', SortDir, 'SortDir', strcmpi, 'strcmpi' bFirstDraw db 0 ;-----------------------------------------------------------------------------