Updated 'fasm':

1) he now uses a library 'box_lib.obj'
2) Russification

git-svn-id: svn://kolibrios.org@1361 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2010-01-04 17:51:09 +00:00
parent 2c8ac9de16
commit 05c7a5c29f
5 changed files with 191 additions and 227 deletions

View File

@ -1,5 +1,8 @@
@fasm.exe -m 16384 ..\..\..\develop\libraries\box_lib\trunk\box_lib.asm box_lib.obj
@kpack box_lib.obj
@erase lang.inc
@echo lang fix en >lang.inc
@fasm fasm.asm fasm
@erase lang.inc
@kpack fasm
@pause

View File

@ -1,3 +1,5 @@
@fasm.exe -m 16384 ..\..\..\develop\libraries\box_lib\trunk\box_lib.asm box_lib.obj
@kpack box_lib.obj
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm fasm.asm fasm

View File

@ -29,16 +29,31 @@ use32
dd program_end ; program image size
dd stacktop ; required amount of memory
dd stacktop ; stack
dd params,0x0 ; parameters,icon
dd params,cur_dir_path ; parameters,icon
include 'lang.inc'
include '..\..\..\macros.inc'
purge add,sub ; macros.inc does incorrect substitution
include 'fasm.inc'
include '..\..\..\develop\libraries\box_lib\trunk\editbox.mac'
include '..\..\..\develop\libraries\box_lib\load_lib.mac'
@use_library
center fix true
START: ; Start of execution
sys_load_library library_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
cmp eax,-1
jne @f
mcall -1 ;exit if not open box_lib.obj
@@:
mcall 40,0x27 ;¬ áª  á¨á⥬­ëå ᮡë⨩
mov edi, fileinfos
mov ecx, (fileinfos_end-fileinfos)/4
or eax, -1
@ -98,6 +113,10 @@ still:
push 10 ; Wait here for event
pop eax
mcall
cmp al,6
jne @f
call mouse
@@:
dec eax
je red ; Redraw request
dec eax
@ -106,6 +125,14 @@ still:
key: ; Key
mov al,2 ; Read it and ignore
mcall
push dword edit1
call [edit_box_key]
push dword edit2
call [edit_box_key]
push dword edit3
call [edit_box_key]
jmp still
button: ; Button in Window
@ -142,12 +169,6 @@ noclose:
mov ecx,5
mov [ya],ecx
cmp ah,11 ; Infile
je f1
cmp ah,12 ; Outfile
je f2
cmp ah,13 ; Path
je f3
cmp ah,14
je f4
@ -159,8 +180,16 @@ f4:
call draw_checkbox
jmp still
draw_window:
mouse:
push dword edit1
call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword edit3
call [edit_box_mouse]
ret
draw_window:
pusha
mcall 12,1 ; Start of draw
@ -181,35 +210,12 @@ draw_window:
mov ebx,[pinfo.box.width]
sub ebx,10
push ecx
madd ecx, 14*3+16+2, 14*3+16+2
mcall 38,,,[sc.work_graph]
pop ecx
sub ebx,MAGIC1+3
mcall
madd ecx, 14, 14
mcall
madd ecx, 14, 14
mcall
madd ecx, 14, 14
mcall
push ebx
mpack ebx,MAGIC1,MAGIC1
sub ecx, 14*3
mcall
mov ebx,[esp-2]
pop bx
mcall
add esp,2
mpack ebx,0,MAGIC1-1
mpack ecx,1+1, 14-2
mcall 8,,,0x4000000B ; Button: Enter Infile
mov eax,8
mov edx,0x4000000B
madd ecx, 14,0
mcall ,,,0x4000000C ; Button: Enter Outfile
; mcall ,,,0x4000000C ; Button: Enter Outfile
madd ecx, 14,0
mcall ,,,0x4000000D ; Button: Enter Path
; mcall ,,,0x4000000D ; Button: Enter Path
mpack ebx,[pinfo.box.width],MAGIC1
msub ebx,MAGIC1+10+1,0
@ -229,7 +235,7 @@ draw_window:
mov eax,4
newline:
mcall
add ebx, 14
add ebx, 16 ;14
add edx,text.line_size
cmp byte[edx],'x'
jne newline
@ -255,16 +261,17 @@ draw_window:
jbe @f
mov al,MAX_PATH
@@: movzx esi,al
mcall 4,,[sc.work_text],infile
add ebx,14
mcall ,,,outfile
add ebx,14
mcall ,,,path
call draw_checkbox
call draw_messages
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword edit3
call [edit_box_draw]
mcall 12,2 ; End of Draw
popa
@ -328,101 +335,29 @@ _sx = 6
pop ecx ebx
ret
; read string
f1: mov [addr],infile
add [ya], 14*0
jmp rk
f2: mov [addr],outfile
add [ya], 14*1
jmp rk
f3: mov [addr],path
add [ya], 14*2
rk:
mov edi,[addr]
mov al,0
mov ecx,MAX_PATH
add edi,ecx
dec edi
std
repe scasb
sub ecx,MAX_PATH
neg ecx
mov al,$1C ; ''
add edi,2
push edi
cld
rep stosb
call print_text
pop edi
f11:mcall 10
cmp eax,2
jne read_done
mcall; 2
shr eax,8
cmp al,13
je read_done
cmp al,8
jne nobs
cmp edi,[addr]
je f11
sub edi,1
mov byte[edi],$1C ; '_'
call print_text
jmp f11
nobs:
movzx ebx,al
sub ebx,$20
jle f11
sub al,[sub_table+ebx]
keyok:
mov ecx,[addr]
add ecx,MAX_PATH
cmp edi,ecx
jae f11
mov [edi],al
call print_text
inc edi
jmp f11
read_done:
mov ecx,[addr]
add ecx,MAX_PATH
sub ecx,edi
mov al,0;' '
cld
rep stosb
call print_text
jmp still
print_text:
mpack ebx,MAGIC1+6,[pinfo.box.width]
sub ebx,MAGIC1*2+19
movzx esi,bx
mov ecx,[ya-2]
mov cx,8
mcall 13,,,[sc.work]
mpack ebx,MAGIC1+6,[ya]
mov eax,esi
mov cl,6
div cl
cmp al,MAX_PATH
jbe @f
mov al,MAX_PATH
@@: movzx esi,al
mcall 4,,[sc.work_text],[addr]
ret
; DATA
if lang eq ru
text:
db ' ‚å” ©«:'
.line_size = $-text
db '‚ëå” ©«:'
db ' <20>ãâì:'
db 'x'
s_compile db 'Š®¬¯¨«.'
s_run db ' <20>ã᪠'
s_debug db 'Žâ« ¤ª '
s_dbgdescr db '‘®§¤ ¢ âì ®â« ¤®ç­ãî ¨­ä®à¬ æ¨î',0
err_message_import db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠box_lib.obj',0
err_message_found_lib db 'Žè¨¡ª  ¯à¨ ¯®¨áª¥ box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ­­®¬ ®ª­¥, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ¡ã¤¥â ­ ©¤¥­ 
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
else
text:
db ' INFILE:'
.line_size = $-text
@ -430,11 +365,45 @@ text:
db ' PATH:'
db 'x'
s_compile db 'COMPILE'
s_run db ' RUN '
s_debug db ' DEBUG '
s_compile db 'COMPILE'
s_run db ' RUN '
s_debug db ' DEBUG '
s_dbgdescr db 'Generate debug information',0
s_dbgdescr db 'Generate debug information',0
err_message_import db 'Error on load import library box_lib.obj',0
err_message_found_lib db 'Sorry I cannot found library box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ­­®¬ ®ª­¥, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ¡ã¤¥â ­ ©¤¥­ 
head_f_i:
head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
end if
myimport:
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
;version_ed dd aVersion_ed
;check_box_draw dd aCheck_box_draw
;check_box_mouse dd aCheck_box_mouse
;version_ch dd aVersion_ch
dd 0,0
aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
;aVersion_ed db 'version_ed',0
;aCheck_box_draw db 'check_box_draw',0
;aCheck_box_mouse db 'check_box_mouse',0
;aVersion_ch db 'version_ch',0
edit1 edit_box 153, 56, 1, 0xe0ffff, 0xff, 0x80ff, 0, 0xa000, MAX_PATH+$, infile, mouse_dd, 0, 11,11
edit2 edit_box 153, 56, 17, 0xe0ffff, 0xff, 0x80ff, 0, 0xa000, MAX_PATH+$, outfile, mouse_dd, 0, 7,7
edit3 edit_box 153, 56, 33, 0xe0ffff, 0xff, 0x80ff, 0, 0xa000, MAX_PATH+$, path, mouse_dd, 0, 6,6
mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox
infile db 'example.asm'
times MAX_PATH+$-infile db 0
@ -579,10 +548,13 @@ times $08 db $00
;include_debug_strings
params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
program_end:
rb 1000h
params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
cur_dir_path rb 4096
library_path rb 4096
program_end:
rb 1000h
align 4
include 'variable.inc'

View File

@ -1,13 +0,0 @@
if not exist bin mkdir bin
@fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj
@kpack bin\box_lib.obj
@fasm.exe -m 16384 t_edit.asm bin\t_edit.kex
@kpack bin\t_edit.kex
@copy ..\..\develop\libraries\box_lib\trunk\tl_sys_16.bmp bin\tl_sys_16.bmp
@copy ..\..\develop\libraries\box_lib\trunk\tl_nod_16.bmp bin\tl_nod_16.bmp
@copy msgbox.obj bin\msgbox.obj
@copy te_icon.bmp bin\te_icon.bmp
if not exist bin\info mkdir bin\info
copy info\* bin\info\*
pause

Binary file not shown.