From e167e59b548426a0dde34df1d87c5562fba462f8 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 22 Dec 2021 20:19:48 +0000 Subject: [PATCH] FASM: fixed by Prohor Nikiforov an issue reported by Vaicheslav97; update to version 1.73.29 git-svn-id: svn://kolibrios.org@9459 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/eng/settings/menu.dat | 2 +- data/rus/settings/menu.dat | 2 +- programs/cmm/appearance/compile_en.bat | 2 +- programs/cmm/appearance/compile_ru.bat | 2 +- programs/cmm/lib/kolibri.h | 7 ++ programs/cmm/misc/install.c | 7 -- programs/develop/fasm/1.73/core/assemble.inc | 2 +- programs/develop/fasm/1.73/core/avx.inc | 6 +- programs/develop/fasm/1.73/core/errors.inc | 2 +- programs/develop/fasm/1.73/core/exprcalc.inc | 6 +- programs/develop/fasm/1.73/core/exprpars.inc | 22 +++-- programs/develop/fasm/1.73/core/formats.inc | 2 +- programs/develop/fasm/1.73/core/messages.inc | 2 +- programs/develop/fasm/1.73/core/parser.inc | 2 +- programs/develop/fasm/1.73/core/preproce.inc | 88 ++++++++++++++++++- programs/develop/fasm/1.73/core/symbdump.inc | 2 +- programs/develop/fasm/1.73/core/tables.inc | 15 +++- programs/develop/fasm/1.73/core/variable.inc | 2 +- programs/develop/fasm/1.73/core/version.inc | 4 +- programs/develop/fasm/1.73/core/x86_64.inc | 42 ++++----- programs/develop/fasm/1.73/fasm.asm | 4 +- programs/develop/fasm/1.73/fasm.inc | 2 + programs/develop/fasm/1.73/system.inc | 20 +++-- programs/develop/fasm/1.73/traslations.inc | 42 ++++++--- .../develop/fasm/{ => tags}/1.71/Tupfile.lua | 0 .../develop/fasm/{ => tags}/1.71/assemble.inc | 0 programs/develop/fasm/{ => tags}/1.71/avx.inc | 0 .../develop/fasm/{ => tags}/1.71/build_en.bat | 0 .../develop/fasm/{ => tags}/1.71/build_ru.bat | 0 .../develop/fasm/{ => tags}/1.71/errors.inc | 0 .../develop/fasm/{ => tags}/1.71/exprcalc.inc | 0 .../develop/fasm/{ => tags}/1.71/exprpars.inc | 0 .../develop/fasm/{ => tags}/1.71/fasm.asm | 0 .../develop/fasm/{ => tags}/1.71/fasm.inc | 0 .../develop/fasm/{ => tags}/1.71/fasm.txt | 0 .../develop/fasm/{ => tags}/1.71/formats.inc | 0 .../develop/fasm/{ => tags}/1.71/license.txt | 0 .../develop/fasm/{ => tags}/1.71/messages.inc | 0 .../develop/fasm/{ => tags}/1.71/parser.inc | 0 .../develop/fasm/{ => tags}/1.71/preproce.inc | 0 .../develop/fasm/{ => tags}/1.71/symbdump.inc | 0 .../develop/fasm/{ => tags}/1.71/system.inc | 0 .../develop/fasm/{ => tags}/1.71/tables.inc | 0 .../develop/fasm/{ => tags}/1.71/variable.inc | 0 .../develop/fasm/{ => tags}/1.71/version.inc | 0 .../develop/fasm/{ => tags}/1.71/whatsnew.txt | 0 .../develop/fasm/{ => tags}/1.71/x86_64.inc | 0 programs/system/end/light/end.asm | 6 +- 48 files changed, 210 insertions(+), 83 deletions(-) rename programs/develop/fasm/{ => tags}/1.71/Tupfile.lua (100%) rename programs/develop/fasm/{ => tags}/1.71/assemble.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/avx.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/build_en.bat (100%) rename programs/develop/fasm/{ => tags}/1.71/build_ru.bat (100%) rename programs/develop/fasm/{ => tags}/1.71/errors.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/exprcalc.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/exprpars.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/fasm.asm (100%) rename programs/develop/fasm/{ => tags}/1.71/fasm.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/fasm.txt (100%) rename programs/develop/fasm/{ => tags}/1.71/formats.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/license.txt (100%) rename programs/develop/fasm/{ => tags}/1.71/messages.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/parser.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/preproce.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/symbdump.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/system.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/tables.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/variable.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/version.inc (100%) rename programs/develop/fasm/{ => tags}/1.71/whatsnew.txt (100%) rename programs/develop/fasm/{ => tags}/1.71/x86_64.inc (100%) diff --git a/data/eng/settings/menu.dat b/data/eng/settings/menu.dat index 5d4856b592..44cda0b7f9 100644 --- a/data/eng/settings/menu.dat +++ b/data/eng/settings/menu.dat @@ -48,7 +48,7 @@ 11 Fplay Video * |/kolibrios/media/fplay #5 **** DEV 54 Flat Assembler |develop/fasm -03 Example.asm |example.asm +27 Example.asm |example.asm 49 Debugger |develop/mtdbg 13 Debug Board |develop/board 09 KPack Archiver |kpack diff --git a/data/rus/settings/menu.dat b/data/rus/settings/menu.dat index f651cb67f7..637df2cf3b 100644 --- a/data/rus/settings/menu.dat +++ b/data/rus/settings/menu.dat @@ -48,7 +48,7 @@ 11 Видеоплеер Fplay * |/kolibrios/media/fplay #5 **** Разработка 54 Flat Assembler |develop/fasm -03 Example.asm |example.asm +27 Example.asm |example.asm 09 Упаковщик KPack |kpack 49 Отладчик |develop/mtdbg 13 Доска отладки |develop/board diff --git a/programs/cmm/appearance/compile_en.bat b/programs/cmm/appearance/compile_en.bat index de8fa61bad..3fbb82c954 100644 --- a/programs/cmm/appearance/compile_en.bat +++ b/programs/cmm/appearance/compile_en.bat @@ -2,4 +2,4 @@ @del *. @rename *.com *. @del warning.txt -@pause +if not exist appearance ( @pause ) diff --git a/programs/cmm/appearance/compile_ru.bat b/programs/cmm/appearance/compile_ru.bat index 81a378de93..90732a0c2a 100644 --- a/programs/cmm/appearance/compile_ru.bat +++ b/programs/cmm/appearance/compile_ru.bat @@ -2,4 +2,4 @@ @del *. @rename *.com *. @del warning.txt -@pause \ No newline at end of file +if not exist appearance ( @pause ) \ No newline at end of file diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index d3f8ddae88..b1cb07681d 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -232,6 +232,13 @@ inline fastcall void ActivateWindow( ECX) //ECX - slot $int 0x40 } +:void ActivateWindow_Self() +{ + proc_info Form; + GetProcessInfo(#Form, SelfInfo); + ActivateWindow(GetProcessSlot(Form.ID)); +} + :void RefreshWindow(dword ID_REFRESH,ID_ACTIVE) { ActivateWindow(ID_REFRESH); diff --git a/programs/cmm/misc/install.c b/programs/cmm/misc/install.c index 3cffc4b33b..f36b817244 100644 --- a/programs/cmm/misc/install.c +++ b/programs/cmm/misc/install.c @@ -123,11 +123,4 @@ void EventInstall() ActivateWindow_Self(); } -void ActivateWindow_Self() -{ - proc_info Form; - GetProcessInfo(#Form, SelfInfo); - ActivateWindow(GetProcessSlot(Form.ID)); -} - void Operation_Draw_Progress(dword filename) { } \ No newline at end of file diff --git a/programs/develop/fasm/1.73/core/assemble.inc b/programs/develop/fasm/1.73/core/assemble.inc index 8e67b0f342..605b2d922a 100644 --- a/programs/develop/fasm/1.73/core/assemble.inc +++ b/programs/develop/fasm/1.73/core/assemble.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. assembler: diff --git a/programs/develop/fasm/1.73/core/avx.inc b/programs/develop/fasm/1.73/core/avx.inc index 97c6b6d52b..70968c3a70 100644 --- a/programs/develop/fasm/1.73/core/avx.inc +++ b/programs/develop/fasm/1.73/core/avx.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. avx_single_source_pd_instruction_er_evex: @@ -1431,9 +1431,9 @@ vzeroupper_instruction: and [displacement_compression],0 call store_vex_instruction_code jmp instruction_assembled -vldmxcsr_instruction: +vstmxcsr_instruction: or [vex_required],2 - jmp fxsave_instruction + jmp stmxcsr_instruction avx_perm2f128_instruction: or [vex_required],2 diff --git a/programs/develop/fasm/1.73/core/errors.inc b/programs/develop/fasm/1.73/core/errors.inc index 5ec088c08b..c4e345873a 100644 --- a/programs/develop/fasm/1.73/core/errors.inc +++ b/programs/develop/fasm/1.73/core/errors.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. out_of_memory: diff --git a/programs/develop/fasm/1.73/core/exprcalc.inc b/programs/develop/fasm/1.73/core/exprcalc.inc index 8e3804c750..dab2c7b8ab 100644 --- a/programs/develop/fasm/1.73/core/exprcalc.inc +++ b/programs/develop/fasm/1.73/core/exprcalc.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. calculate_expression: @@ -1875,7 +1875,9 @@ calculate_logical_expression: jne invalid_value call get_value_for_comparison mov bh,[value_sign] - push eax edx [symbol_identifier] ebx ecx + push eax edx + push [symbol_identifier] + push ebx ecx mov al,[esi] or al,al jz logical_number diff --git a/programs/develop/fasm/1.73/core/exprpars.inc b/programs/develop/fasm/1.73/core/exprpars.inc index 05ad83e4f5..bca5c3d5dc 100644 --- a/programs/develop/fasm/1.73/core/exprpars.inc +++ b/programs/develop/fasm/1.73/core/exprpars.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. convert_expression: @@ -135,8 +135,11 @@ convert_number: subexpression_closed: ret symbol_value: - cmp [source_start],0 - je preprocessor_value + mov eax,[source_start] + test eax,eax + jz preprocessor_value + cmp eax,-1 + je invalid_value push edi esi lods word [esi] cmp al,1Ah @@ -192,8 +195,6 @@ convert_number: ret preprocessor_value: dec edi - cmp [hash_tree],0 - je invalid_value lods byte [esi] cmp al,1Ah jne invalid_value @@ -202,6 +203,8 @@ convert_number: mov ch,10b call get_preprocessor_symbol jc invalid_value + test edx,edx + jz special_preprocessor_value push esi mov esi,[edx+8] push [current_offset] @@ -209,6 +212,15 @@ convert_number: pop [current_offset] pop esi ret + special_preprocessor_value: + cmp eax,preprocessed_line_value + jne invalid_value + call get_current_line_from_file + mov al,4 + stos byte [edi] + mov eax,[ebx+4] + stos dword [edi] + ret get_number: xor ebp,ebp diff --git a/programs/develop/fasm/1.73/core/formats.inc b/programs/develop/fasm/1.73/core/formats.inc index 827232bd69..ee932a553c 100644 --- a/programs/develop/fasm/1.73/core/formats.inc +++ b/programs/develop/fasm/1.73/core/formats.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. formatter: diff --git a/programs/develop/fasm/1.73/core/messages.inc b/programs/develop/fasm/1.73/core/messages.inc index 489096bb0b..d5f90e6ac2 100644 --- a/programs/develop/fasm/1.73/core/messages.inc +++ b/programs/develop/fasm/1.73/core/messages.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. _out_of_memory db 'out of memory',0 diff --git a/programs/develop/fasm/1.73/core/parser.inc b/programs/develop/fasm/1.73/core/parser.inc index 8042d105a9..4035a59791 100644 --- a/programs/develop/fasm/1.73/core/parser.inc +++ b/programs/develop/fasm/1.73/core/parser.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. parser: diff --git a/programs/develop/fasm/1.73/core/preproce.inc b/programs/develop/fasm/1.73/core/preproce.inc index 8210b85a85..e9599cc4de 100644 --- a/programs/develop/fasm/1.73/core/preproce.inc +++ b/programs/develop/fasm/1.73/core/preproce.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. preprocessor: @@ -686,6 +686,8 @@ preprocess_line: mov ch,10b call get_preprocessor_symbol jc struc_name_ok + test edx,edx + jz reserved_word_used_as_symbol mov ecx,[edx+12] add ecx,3 lea ebx,[edi+ecx] @@ -745,6 +747,8 @@ preprocess_line: inc esi jmp preprocess_instruction symbolic_constant_in_label: + test edx,edx + jz reserved_word_used_as_symbol mov ebx,[edx+8] mov ecx,[edx+12] add ecx,ebx @@ -806,7 +810,32 @@ get_preprocessor_symbol: push ebp edi esi mov ebp,ecx shl ebp,22 + mov al,ch + and al,11b movzx ecx,cl + cmp al,10b + jne no_preprocessor_special_symbol + cmp cl,4 + jbe no_preprocessor_special_symbol + mov ax,'__' + cmp ax,[esi] + jne no_preprocessor_special_symbol + cmp ax,[esi+ecx-2] + jne no_preprocessor_special_symbol + add esi,2 + sub ecx,4 + push ebp + mov edi,preprocessor_special_symbols + call get_directive + pop ebp + jc preprocessor_special_symbol_not_recognized + add esi,2 + xor edx,edx + jmp preprocessor_symbol_found + preprocessor_special_symbol_not_recognized: + add ecx,4 + sub esi,2 + no_preprocessor_special_symbol: mov ebx,hash_tree mov edi,10 follow_hashes_roots: @@ -1333,6 +1362,8 @@ restore_equ_constant: mov cl,al call get_preprocessor_symbol jc no_symbol_to_restore + test edx,edx + jz symbol_restored mov dword [edx+4],0 jmp symbol_restored no_symbol_to_restore: @@ -1383,6 +1414,8 @@ process_equ_constants: jc no_replacing mov [current_section],edi replace_symbolic_constant: + test edx,edx + jz replace_special_symbolic_constant mov ecx,[edx+12] mov edx,[edx+8] xchg esi,edx @@ -1451,6 +1484,53 @@ process_equ_constants: stos word [edi] call move_data jmp process_after_replaced + replace_special_symbolic_constant: + jmp near eax + preprocessed_file_value: + call get_current_line_from_file + test ebx,ebx + jz process_after_replaced + push esi edi + mov esi,[ebx] + mov edi,esi + xor al,al + or ecx,-1 + repne scas byte [edi] + add ecx,2 + neg ecx + pop edi + lea eax,[edi+1+4+ecx] + cmp eax,[memory_end] + ja out_of_memory + mov al,22h + stos byte [edi] + mov eax,ecx + stos dword [edi] + rep movs byte [edi],[esi] + pop esi + jmp process_after_replaced + preprocessed_line_value: + call get_current_line_from_file + test ebx,ebx + jz process_after_replaced + lea eax,[edi+1+4+20] + cmp eax,[memory_end] + ja out_of_memory + mov ecx,[ebx+4] + call store_number_symbol + jmp process_after_replaced + get_current_line_from_file: + mov ebx,[current_line] + find_line_from_file: + test ebx,ebx + jz line_from_file_found + test byte [ebx+7],80h + jz line_from_file_found + mov ebx,[ebx+8] + jmp find_line_from_file + line_from_file_found: + ret + process_macro_operators: xor dl,dl mov ebp,edi @@ -1809,7 +1889,9 @@ use_macro: pop [free_additional_memory] jmp line_preprocessed use_instant_macro: - push edi [current_line] esi + push edi + push [current_line] + push esi mov eax,[error_line] mov [current_line],eax mov [macro_line],eax @@ -2023,6 +2105,8 @@ do_irp: mov ch,10b call get_preprocessor_symbol jc instant_macro_finish + test edx,edx + jz invalid_use_of_symbol push edx mark_variable_value: inc [counter_limit] diff --git a/programs/develop/fasm/1.73/core/symbdump.inc b/programs/develop/fasm/1.73/core/symbdump.inc index 282ade69b7..fdd3cc29ac 100644 --- a/programs/develop/fasm/1.73/core/symbdump.inc +++ b/programs/develop/fasm/1.73/core/symbdump.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. dump_symbols: diff --git a/programs/develop/fasm/1.73/core/tables.inc b/programs/develop/fasm/1.73/core/tables.inc index 5eba15e550..ef2d76cccb 100644 --- a/programs/develop/fasm/1.73/core/tables.inc +++ b/programs/develop/fasm/1.73/core/tables.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. include_variable db 'INCLUDE',0 @@ -48,6 +48,13 @@ macro_directives: dw reverse_block-directive_handler db 0 +preprocessor_special_symbols: + db 4,'file' + dw preprocessed_file_value-directive_handler + db 4,'line' + dw preprocessed_line_value-directive_handler + db 0 + operators: db 1,'+',80h db 1,'-',81h @@ -457,7 +464,7 @@ instructions: dw instructions_14-instructions,(instructions_15-instructions_14)/(14+3) dw instructions_15-instructions,(instructions_16-instructions_15)/(15+3) dw instructions_16-instructions,(instructions_17-instructions_16)/(16+3) - dw instructions_17-instructions,(instructions_end-instructions_17)/(16+3) + dw instructions_17-instructions,(instructions_end-instructions_17)/(17+3) instructions_2: db 'bt',4 @@ -2811,7 +2818,7 @@ instructions_8: db 'vfmsubss',6Eh dw fma4_instruction_ss-instruction_handler db 'vldmxcsr',10b - dw vldmxcsr_instruction-instruction_handler + dw vstmxcsr_instruction-instruction_handler db 'vmlaunch',0C2h dw simple_instruction_0f_01-instruction_handler db 'vmovddup',12h @@ -3073,7 +3080,7 @@ instructions_8: db 'vrsqrtss',52h dw avx_ss_instruction_noevex-instruction_handler db 'vstmxcsr',11b - dw vldmxcsr_instruction-instruction_handler + dw vstmxcsr_instruction-instruction_handler db 'vucomisd',2Eh dw avx_comisd_instruction-instruction_handler db 'vucomiss',2Eh diff --git a/programs/develop/fasm/1.73/core/variable.inc b/programs/develop/fasm/1.73/core/variable.inc index 7c3497cabc..bfad8becc0 100644 --- a/programs/develop/fasm/1.73/core/variable.inc +++ b/programs/develop/fasm/1.73/core/variable.inc @@ -1,6 +1,6 @@ ; flat assembler core variables -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. ; Variables which have to be set up by interface: diff --git a/programs/develop/fasm/1.73/core/version.inc b/programs/develop/fasm/1.73/core/version.inc index 90d489aea9..2ca470c9e2 100644 --- a/programs/develop/fasm/1.73/core/version.inc +++ b/programs/develop/fasm/1.73/core/version.inc @@ -1,6 +1,6 @@ ; flat assembler version 1.73 -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. ; ; This programs is free for commercial and non-commercial use as long as @@ -33,7 +33,7 @@ ; cannot simply be copied and put under another distribution licence ; (including the GNU Public Licence). -VERSION_STRING equ "1.73.24" +VERSION_STRING equ "1.73.29" VERSION_MAJOR = 1 VERSION_MINOR = 73 diff --git a/programs/develop/fasm/1.73/core/x86_64.inc b/programs/develop/fasm/1.73/core/x86_64.inc index 0c300dde01..4c16051457 100644 --- a/programs/develop/fasm/1.73/core/x86_64.inc +++ b/programs/develop/fasm/1.73/core/x86_64.inc @@ -1,6 +1,6 @@ ; flat assembler core -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. simple_instruction_except64: @@ -228,7 +228,9 @@ basic_instruction: mov ecx,edx cdq cmp ecx,edx - jne value_out_of_range + je simm32_range_ok + call recoverable_overflow + simm32_range_ok: cmp [value_type],4 jne get_simm32_ok mov [value_type],2 @@ -468,9 +470,7 @@ mov_instruction: jnz mov_mem_address16_al test ch,44h jnz mov_mem_address32_al - test ch,88h - jnz mov_mem_address64_al - or ch,ch + test ch,not 88h jnz invalid_address_size call check_mov_address64 cmp al,0 @@ -504,6 +504,8 @@ mov_instruction: check_mov_address64: cmp [code_type],64 jne no_address64 + test ch,88h + jnz address64_required mov eax,[address_high] or eax,eax jz no_address64 @@ -517,6 +519,8 @@ mov_instruction: mov al,-1 ret no_address64: + test ch,08h + jnz invalid_address_size xor al,al ret mov_mem_address64_al: @@ -531,9 +535,7 @@ mov_instruction: jnz mov_mem_address16_ax test ch,44h jnz mov_mem_address32_ax - test ch,88h - jnz mov_mem_address64_ax - or ch,ch + test ch,not 88h jnz invalid_address_size call check_mov_address64 cmp al,0 @@ -733,9 +735,7 @@ mov_instruction: jnz mov_al_mem_address16 test ch,44h jnz mov_al_mem_address32 - test ch,88h - jnz mov_al_mem_address64 - or ch,ch + test ch,not 88h jnz invalid_address_size call check_mov_address64 cmp al,0 @@ -764,9 +764,7 @@ mov_instruction: jnz mov_ax_mem_address16 test ch,44h jnz mov_ax_mem_address32 - test ch,88h - jnz mov_ax_mem_address64 - or ch,ch + test ch,not 88h jnz invalid_address_size call check_mov_address64 cmp al,0 @@ -3031,7 +3029,8 @@ jmp_instruction: cmp al,'(' jne invalid_operand mov al,[value_type] - push eax [symbol_identifier] + push eax + push [symbol_identifier] cmp byte [esi],'.' je invalid_value mov al,[operand_size] @@ -3052,7 +3051,8 @@ jmp_instruction: call mark_relocation stos word [edi] jmp_far_segment: - pop [symbol_identifier] eax + pop [symbol_identifier] + pop eax mov [value_type],al pop eax call mark_relocation @@ -6400,7 +6400,8 @@ bndstx_instruction: cmp al,'(' jne invalid_operand mov al,[address_sign] - push eax ebx ecx edx [address_symbol] + push eax ebx ecx edx + push [address_symbol] call get_address_component lods byte [esi] cmp al,']' @@ -6410,7 +6411,8 @@ bndstx_instruction: or edx,[address_high] jnz invalid_address mov [address_register],bh - pop [address_symbol] edx ecx ebx eax + pop [address_symbol] + pop edx ecx ebx eax mov [address_sign],al or bl,bl jz mib_place_index @@ -7314,9 +7316,9 @@ store_instruction: sub eax,[current_offset] add eax,5 sub edx,eax - jno @f + jno address_relative_ok call recoverable_overflow - @@: + address_relative_ok: mov al,101b mov cl,[postbyte_register] shl cl,3 diff --git a/programs/develop/fasm/1.73/fasm.asm b/programs/develop/fasm/1.73/fasm.asm index 7cd13820c6..ee42de6751 100644 --- a/programs/develop/fasm/1.73/fasm.asm +++ b/programs/develop/fasm/1.73/fasm.asm @@ -1,6 +1,6 @@ ; flat assembler source -; Copyright (c) 1999-2020, Tomasz Grysztar. +; Copyright (c) 1999-2021, Tomasz Grysztar. ; All rights reserved. ; KolibriOS port by KolibriOS Team @@ -122,7 +122,7 @@ START: ; Start of execution mcall SF_SYS_MISC,SSF_MEM_ALLOC,$1000 mov [file_io_notify.flags],eax - call LoadLibraries +unresolved_proc_termination: call LoadLibraries mcall SF_SET_EVENTS_MASK,EVM_MOUSE_FILTER or EVM_MOUSE or EVM_BUTTON or EVM_KEY or EVM_REDRAW;0x80000027 ; filter events: 80000000h - don`t receive mouse events if wnd nonactive , 7 - allowed events: redraw,keypresses, button presses invoke init_checkbox,ch1_dbg diff --git a/programs/develop/fasm/1.73/fasm.inc b/programs/develop/fasm/1.73/fasm.inc index 1c037d04d6..9e3762ec1d 100644 --- a/programs/develop/fasm/1.73/fasm.inc +++ b/programs/develop/fasm/1.73/fasm.inc @@ -6,6 +6,8 @@ ID_OPENDLG_BTN = 5 NORMAL_MODE = 8 CONSOLE_MODE = 32 +MAGIC1 = 6*(text.line_size-1)+14 +MAGIC2 = (14*3+16)/3+1 APP_MEMORY = 0x00800000 diff --git a/programs/develop/fasm/1.73/system.inc b/programs/develop/fasm/1.73/system.inc index ae7aa8d3b2..3e8773089f 100644 --- a/programs/develop/fasm/1.73/system.inc +++ b/programs/develop/fasm/1.73/system.inc @@ -1,10 +1,10 @@ ; flat assembler -; Copyright (c) 1999-2020, Tomasz Grysztar +; Copyright (c) 1999-2021, Tomasz Grysztar ; All rights reserved. init_memory: -; mov ecx, 16*1024*1024 +; mov ecx, 16*1024*1024 ; ; allocate_memory: mcall SF_SYSTEM, SSF_GET_FREE_RAM @@ -33,8 +33,12 @@ exit_program: cmp [_mode],NORMAL_MODE jne @f mcall SF_SYS_MISC, SSF_MEM_FREE, [memblock] + mov edi, file_IO_slots + mov ecx, (file_IO_end-file_IO_slots)/4 + or eax, -1 + rep stosd mov esp,[processing_esp] - jmp still + ret;jmp still @@: or eax,-1 mcall @@ -287,7 +291,7 @@ get_environment_variable: cld rep movsb .finish: -; stc +; stc retn alloc_handle: @@ -412,7 +416,7 @@ make_fullpaths: loopnz copy_edxpath mov esi,path ; open -; DEBUGF " '%s'",esi +; DEBUGF " '%s'",esi mov edi,fullpath_open cld newc1: @@ -422,10 +426,10 @@ make_fullpaths: mov esi,[esp] cmp byte[esi],'/' - je abs_path + je absolute_path cmp byte[esi],'\' - jne @f - abs_path: + jne @F + absolute_path: mov edi,fullpath_open @@: diff --git a/programs/develop/fasm/1.73/traslations.inc b/programs/develop/fasm/1.73/traslations.inc index ec05516d10..9839623d3a 100644 --- a/programs/develop/fasm/1.73/traslations.inc +++ b/programs/develop/fasm/1.73/traslations.inc @@ -2,20 +2,14 @@ include 'lang.inc' if lang eq ru - text db ' ВхФайл:','ВыхФайл:',' Путь:' - .line_size = ($-text)/3 - s_compile db 'Компил.' - s_run db ' Пуск ' - s_debug db 'Отладка' - s_dbgdescr db 'Создавать отладочную информацию',0 -else - text db ' InFile:','OutFile:',' Path:' - .line_size = ($-text)/3 - s_compile db 'COMPILE' - s_run db ' RUN ' - s_debug db ' DEBUG ' - s_dbgdescr db 'Generate debug information',0 -end if + +text db ' ВхФайл:','ВыхФайл:',' Путь:' + .line_size = ($-text)/3 + +s_compile db 'Компил.' +s_run db ' Пуск ' +s_debug db 'Отладка' +s_dbgdescr db 'Создавать отладочную информацию',0 sz_EPnotFound db 'Not found entry point to ',0 sizeof.sz_EPnotFound = $-sz_EPnotFound @@ -26,4 +20,24 @@ sizeof.sz_cantLL = $-sz_cantLL sz_system_error db 'System error: ',0 sizeof.sz_system_error = $-sz_system_error +else + +text db ' InFile:','OutFile:',' Path:' + .line_size = ($-text)/3 + +s_compile db 'COMPILE' +s_run db ' RUN ' +s_debug db ' DEBUG ' +s_dbgdescr db 'Generate debug information',0 + +sz_EPnotFound db 'Not found entry point to ',0 +sizeof.sz_EPnotFound = $-sz_EPnotFound + +sz_cantLL db 'Can not load library ',0 +sizeof.sz_cantLL = $-sz_cantLL + +sz_system_error db 'System error: ',0 +sizeof.sz_system_error = $-sz_system_error + +end if diff --git a/programs/develop/fasm/1.71/Tupfile.lua b/programs/develop/fasm/tags/1.71/Tupfile.lua similarity index 100% rename from programs/develop/fasm/1.71/Tupfile.lua rename to programs/develop/fasm/tags/1.71/Tupfile.lua diff --git a/programs/develop/fasm/1.71/assemble.inc b/programs/develop/fasm/tags/1.71/assemble.inc similarity index 100% rename from programs/develop/fasm/1.71/assemble.inc rename to programs/develop/fasm/tags/1.71/assemble.inc diff --git a/programs/develop/fasm/1.71/avx.inc b/programs/develop/fasm/tags/1.71/avx.inc similarity index 100% rename from programs/develop/fasm/1.71/avx.inc rename to programs/develop/fasm/tags/1.71/avx.inc diff --git a/programs/develop/fasm/1.71/build_en.bat b/programs/develop/fasm/tags/1.71/build_en.bat similarity index 100% rename from programs/develop/fasm/1.71/build_en.bat rename to programs/develop/fasm/tags/1.71/build_en.bat diff --git a/programs/develop/fasm/1.71/build_ru.bat b/programs/develop/fasm/tags/1.71/build_ru.bat similarity index 100% rename from programs/develop/fasm/1.71/build_ru.bat rename to programs/develop/fasm/tags/1.71/build_ru.bat diff --git a/programs/develop/fasm/1.71/errors.inc b/programs/develop/fasm/tags/1.71/errors.inc similarity index 100% rename from programs/develop/fasm/1.71/errors.inc rename to programs/develop/fasm/tags/1.71/errors.inc diff --git a/programs/develop/fasm/1.71/exprcalc.inc b/programs/develop/fasm/tags/1.71/exprcalc.inc similarity index 100% rename from programs/develop/fasm/1.71/exprcalc.inc rename to programs/develop/fasm/tags/1.71/exprcalc.inc diff --git a/programs/develop/fasm/1.71/exprpars.inc b/programs/develop/fasm/tags/1.71/exprpars.inc similarity index 100% rename from programs/develop/fasm/1.71/exprpars.inc rename to programs/develop/fasm/tags/1.71/exprpars.inc diff --git a/programs/develop/fasm/1.71/fasm.asm b/programs/develop/fasm/tags/1.71/fasm.asm similarity index 100% rename from programs/develop/fasm/1.71/fasm.asm rename to programs/develop/fasm/tags/1.71/fasm.asm diff --git a/programs/develop/fasm/1.71/fasm.inc b/programs/develop/fasm/tags/1.71/fasm.inc similarity index 100% rename from programs/develop/fasm/1.71/fasm.inc rename to programs/develop/fasm/tags/1.71/fasm.inc diff --git a/programs/develop/fasm/1.71/fasm.txt b/programs/develop/fasm/tags/1.71/fasm.txt similarity index 100% rename from programs/develop/fasm/1.71/fasm.txt rename to programs/develop/fasm/tags/1.71/fasm.txt diff --git a/programs/develop/fasm/1.71/formats.inc b/programs/develop/fasm/tags/1.71/formats.inc similarity index 100% rename from programs/develop/fasm/1.71/formats.inc rename to programs/develop/fasm/tags/1.71/formats.inc diff --git a/programs/develop/fasm/1.71/license.txt b/programs/develop/fasm/tags/1.71/license.txt similarity index 100% rename from programs/develop/fasm/1.71/license.txt rename to programs/develop/fasm/tags/1.71/license.txt diff --git a/programs/develop/fasm/1.71/messages.inc b/programs/develop/fasm/tags/1.71/messages.inc similarity index 100% rename from programs/develop/fasm/1.71/messages.inc rename to programs/develop/fasm/tags/1.71/messages.inc diff --git a/programs/develop/fasm/1.71/parser.inc b/programs/develop/fasm/tags/1.71/parser.inc similarity index 100% rename from programs/develop/fasm/1.71/parser.inc rename to programs/develop/fasm/tags/1.71/parser.inc diff --git a/programs/develop/fasm/1.71/preproce.inc b/programs/develop/fasm/tags/1.71/preproce.inc similarity index 100% rename from programs/develop/fasm/1.71/preproce.inc rename to programs/develop/fasm/tags/1.71/preproce.inc diff --git a/programs/develop/fasm/1.71/symbdump.inc b/programs/develop/fasm/tags/1.71/symbdump.inc similarity index 100% rename from programs/develop/fasm/1.71/symbdump.inc rename to programs/develop/fasm/tags/1.71/symbdump.inc diff --git a/programs/develop/fasm/1.71/system.inc b/programs/develop/fasm/tags/1.71/system.inc similarity index 100% rename from programs/develop/fasm/1.71/system.inc rename to programs/develop/fasm/tags/1.71/system.inc diff --git a/programs/develop/fasm/1.71/tables.inc b/programs/develop/fasm/tags/1.71/tables.inc similarity index 100% rename from programs/develop/fasm/1.71/tables.inc rename to programs/develop/fasm/tags/1.71/tables.inc diff --git a/programs/develop/fasm/1.71/variable.inc b/programs/develop/fasm/tags/1.71/variable.inc similarity index 100% rename from programs/develop/fasm/1.71/variable.inc rename to programs/develop/fasm/tags/1.71/variable.inc diff --git a/programs/develop/fasm/1.71/version.inc b/programs/develop/fasm/tags/1.71/version.inc similarity index 100% rename from programs/develop/fasm/1.71/version.inc rename to programs/develop/fasm/tags/1.71/version.inc diff --git a/programs/develop/fasm/1.71/whatsnew.txt b/programs/develop/fasm/tags/1.71/whatsnew.txt similarity index 100% rename from programs/develop/fasm/1.71/whatsnew.txt rename to programs/develop/fasm/tags/1.71/whatsnew.txt diff --git a/programs/develop/fasm/1.71/x86_64.inc b/programs/develop/fasm/tags/1.71/x86_64.inc similarity index 100% rename from programs/develop/fasm/1.71/x86_64.inc rename to programs/develop/fasm/tags/1.71/x86_64.inc diff --git a/programs/system/end/light/end.asm b/programs/system/end/light/end.asm index 7e0723c181..ff3f7b7da0 100644 --- a/programs/system/end/light/end.asm +++ b/programs/system/end/light/end.asm @@ -152,7 +152,7 @@ draw_window: mcall SF_DRAW_RECT, <2,WIN_W-4>, <2,WIN_H-BOT_PANEL_H-2>, 0x202020 mcall SF_DRAW_RECT, <2,WIN_W-4>, , 0x4B4B4B - mcall SF_DRAW_TEXT, <30,27>, 0x91FFFfff, TEXT_WTITLE + mcall SF_DRAW_TEXT, <30,21>, 0x91FFFfff, TEXT_WTITLE mcall SF_DRAW_TEXT, <55,70>, 0x90FFFfff, TEXT_RDSAVE1 mcall SF_DRAW_TEXT, <55,86>, 0x90FFFfff, TEXT_RDSAVE2 mcall SF_DRAW_TEXT, , 0x81FFFfff, TEXT_CANCEL @@ -167,7 +167,7 @@ draw_window: call draw_checkbox_flag stdcall EndButton, 20, 0x4E91C5, HOME_BUTTON_ID, TEXT_KERNEL, TEXT_HOME - stdcall EndButton, 160, 0x55C891, REBOOT_BUTTON_ID, TEXT_REBOOT, TEXT_ENTER + stdcall EndButton, 160, 0x41C166, REBOOT_BUTTON_ID, TEXT_REBOOT, TEXT_ENTER stdcall EndButton, 300, 0xC75C54, POWEROFF_BUTTON_ID, TEXT_OFF, TEXT_END mcall SF_REDRAW,SSF_END_DRAW @@ -178,7 +178,7 @@ proc EndButton x, bgcol, id, but_text, hotkey_text BUTW = 116 mov ebx,[x] sub ebx,3 - mcall SF_DRAW_RECT, , , 0x202020 + mcall SF_DRAW_RECT, , , 0x202020 mcall SF_DEFINE_BUTTON, <[x],BUTW>, , [id], [bgcol] ; -strlen(but_text)*8 + BUTW / 2 + x, BUTY+8 stdcall string.length, [but_text]