forked from KolibriOS/kolibrios
correction of previous revision
git-svn-id: svn://kolibrios.org@1144 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
d7d25fb0e8
commit
5d45c37af3
@ -28,8 +28,6 @@ CODE
|
|||||||
redraw: ; redraw event handler
|
redraw: ; redraw event handler
|
||||||
call draw_window ; at first create and draw the window
|
call draw_window ; at first create and draw the window
|
||||||
|
|
||||||
mcall 9, procinfo, -1
|
|
||||||
|
|
||||||
wait_event: ; main cycle
|
wait_event: ; main cycle
|
||||||
mov eax, 10
|
mov eax, 10
|
||||||
mcall
|
mcall
|
||||||
@ -90,7 +88,5 @@ end if
|
|||||||
UDATA
|
UDATA
|
||||||
sc system_colors
|
sc system_colors
|
||||||
|
|
||||||
procinfo rb 1024
|
|
||||||
|
|
||||||
MEOS_APP_END
|
MEOS_APP_END
|
||||||
; <--- end of MenuetOS application --->
|
; <--- end of MenuetOS application --->
|
68
programs/games/kosilka/doexe2.asm
Normal file
68
programs/games/kosilka/doexe2.asm
Normal file
@ -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
|
@ -25,7 +25,7 @@ START:
|
|||||||
or eax, eax
|
or eax, eax
|
||||||
jnz exit
|
jnz exit
|
||||||
|
|
||||||
; invoke sort.START, 1
|
invoke sort.START, 1
|
||||||
|
|
||||||
mov ecx, 1 ; for 15.4: 1 = tile
|
mov ecx, 1 ; for 15.4: 1 = tile
|
||||||
cmp word [@PARAMS], '\T'
|
cmp word [@PARAMS], '\T'
|
||||||
@ -540,20 +540,20 @@ load_directory:
|
|||||||
mov [eax+4], ebx
|
mov [eax+4], ebx
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz free_directory
|
jz free_directory
|
||||||
; push 0 ; sort mode
|
push 0 ; sort mode
|
||||||
; push ebx
|
push ebx
|
||||||
; add eax, 32
|
add eax, 32
|
||||||
; push eax
|
push eax
|
||||||
; call [SortDir]
|
call [SortDir]
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov edi, [directory_ptr]
|
mov edi, [directory_ptr]
|
||||||
add edi, 32 + 40
|
add edi, 32 + 40
|
||||||
.scan:
|
.scan:
|
||||||
mov esi, [last_name_component]
|
mov esi, [last_name_component]
|
||||||
inc esi
|
inc esi
|
||||||
; push edi
|
push edi
|
||||||
; invoke strcmpi
|
invoke strcmpi
|
||||||
; pop edi
|
pop edi
|
||||||
jz .found
|
jz .found
|
||||||
inc eax
|
inc eax
|
||||||
add edi, 304
|
add edi, 304
|
||||||
@ -995,8 +995,8 @@ align 4
|
|||||||
library \
|
library \
|
||||||
libio , 'libio.obj' , \
|
libio , 'libio.obj' , \
|
||||||
libgfx , 'libgfx.obj' , \
|
libgfx , 'libgfx.obj' , \
|
||||||
libimg , 'libimg.obj' ;, \
|
libimg , 'libimg.obj' , \
|
||||||
; sort , 'sort.obj'
|
sort , 'sort.obj'
|
||||||
|
|
||||||
import libio , \
|
import libio , \
|
||||||
libio.init , 'lib_init' , \
|
libio.init , 'lib_init' , \
|
||||||
@ -1022,7 +1022,7 @@ import libimg , \
|
|||||||
img.destroy , 'img_destroy', \
|
img.destroy , 'img_destroy', \
|
||||||
img.draw , 'img_draw'
|
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
|
bFirstDraw db 0
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user