Forth 12.2: small preparing

git-svn-id: svn://kolibrios.org@4869 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2014-04-21 20:32:30 +00:00
parent 154d1426af
commit 3b7c0f7388

View File

@ -1,7 +1,5 @@
; KolSPForth v12 ; KolSPForth v12
SYSTEM equ EMUL
;Memory Map ;Memory Map
; ;
;0 ;0
@ -99,12 +97,8 @@ cfa_#F_CFA:
dd I_END ; size of image dd I_END ; size of image
MEMS: dd EM ; memory for app MEMS: dd EM ; memory for app
dd SPP ; esp dd SPP ; esp
if SYSTEM eq MEOS dd params
dd FINFO.path dd cur_dir_path
else
dd 0
end if
dd 0x0 ; I_Param , I_Icon
lang fix ru lang fix ru
include 'MACROS.INC' include 'MACROS.INC'
@ -113,30 +107,30 @@ end if
align 4 align 4
proc strncmp stdcall, s1:dword, s2:dword, n:dword proc strncmp stdcall, s1:dword, s2:dword, n:dword
push esi push esi
push edi push edi
mov ecx, [n] mov ecx, [n]
test ecx, ecx ; Max length is zero? test ecx, ecx ; Max length is zero?
je .done je .done
mov esi, [s1] ; esi = string s1 mov esi, [s1] ; esi = string s1
mov edi, [s2] ; edi = string s2 mov edi, [s2] ; edi = string s2
cld cld
.compare: .compare:
cmpsb ; Compare two bytes cmpsb ; Compare two bytes
jne .done jne .done
cmp byte [esi-1], 0 ; End of string? cmp byte [esi-1], 0 ; End of string?
je .done je .done
dec ecx ; Length limit reached? dec ecx ; Length limit reached?
jne .compare jne .compare
.done: .done:
seta al ; al = (s1 > s2) seta al ; al = (s1 > s2)
setb ah ; ah = (s1 < s2) setb ah ; ah = (s1 < s2)
sub al, ah sub al, ah
movsx eax, al ; eax = (s1 > s2) - (s1 < s2), i.e. -1, 0, 1 movsx eax, al ; eax = (s1 > s2) - (s1 < s2), i.e. -1, 0, 1
pop edi pop edi
pop esi pop esi
ret ret
endp endp
align 4 align 4
@ -472,22 +466,16 @@ cfa_AHEADER 0,'READ_GIF',READ_GIF ;( gif_ptr, out_ptr -- result )
include 'amain.asm' include 'amain.asm'
header db 'Kolibri Forth v12.1',0 header db 'Kolibri Forth v12.1',0
params: rb 256
cur_dir_path: rb 4096
FINFO: FINFO:
.mode dd 0 .mode dd 0
dd 0 dd 0
.blk dd 1 .blk dd 1
.buf dd 0 .buf dd 0
.work dd os_work .work dd os_work
.path:
db '/RD/1/AUTOLOAD.F'
; db '/RD/1/EXAMPLE.F'
; db '/RD/1/PICTURE.F'
db 0
.end_path:
rb 256-($-.path)
lastcur dd 0,0 lastcur dd 0,0