diff --git a/LICENSE.TXT b/LICENSE.TXT index 2b2fc7b..f4778b3 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -1,5 +1,5 @@ -flat assembler version 1.72 +flat assembler version 1.73 Copyright (c) 1999-2017, Tomasz Grysztar. All rights reserved. diff --git a/SOURCE/ASSEMBLE.INC b/SOURCE/ASSEMBLE.INC index 8b028ff..6112808 100644 --- a/SOURCE/ASSEMBLE.INC +++ b/SOURCE/ASSEMBLE.INC @@ -148,8 +148,8 @@ create_addressing_space: init_addressing_space: mov ebx,[tagged_blocks] mov dword [ebx-4],10h - mov dword [ebx-8],20h - sub ebx,8+20h + mov dword [ebx-8],24h + sub ebx,8+24h cmp ebx,edi jbe out_of_memory mov [tagged_blocks],ebx @@ -162,6 +162,7 @@ create_addressing_space: mov [ebx+14h],eax mov [ebx+18h],edi mov [ebx+1Ch],eax + mov [ebx+20h],eax ret assemble_line: @@ -780,6 +781,8 @@ show_display_buffer: mov eax,[esi+4] mov ecx,[esi] sub esi,ecx + cmp eax,10h + je write_addressing_space test eax,eax jnz skip_block push esi @@ -790,6 +793,62 @@ show_display_buffer: jne display_messages display_done: ret + write_addressing_space: + mov ecx,[esi+20h] + jecxz skip_block + push esi + mov edi,[free_additional_memory] + mov esi,[output_file] + test esi,esi + jz addressing_space_written + xor ebx,ebx + copy_output_path: + lodsb + cmp edi,[structures_buffer] + jae out_of_memory + stosb + test al,al + jz output_path_copied + cmp al,'/' + je new_path_segment + cmp al,'\' + je new_path_segment + cmp al,'.' + jne copy_output_path + mov ebx,edi + jmp copy_output_path + new_path_segment: + xor ebx,ebx + jmp copy_output_path + output_path_copied: + test ebx,ebx + jnz append_extension + mov byte [edi-1],'.' + mov ebx,edi + append_extension: + mov edi,ebx + add ebx,ecx + inc ebx + cmp ebx,[structures_buffer] + jae out_of_memory + mov esi,[esp] + mov esi,[esi+18h] + sub esi,ecx + rep movs byte [edi],[esi] + xor al,al + stos byte [edi] + mov edx,[free_additional_memory] + call create + jc write_failed + mov esi,[esp] + mov edx,[esi+18h] + mov ecx,[esi+1Ch] + call write + jc write_failed + call close + addressing_space_written: + pop esi + jmp skip_block times_directive: lods byte [esi] @@ -882,6 +941,24 @@ virtual_directive: mov [ebx+1Ch],eax call init_addressing_space or byte [ebx+0Ah],1 + cmp byte [esi],86h + jne addressing_space_extension_ok + cmp word [esi+1],'(' + jne invalid_argument + mov ecx,[esi+3] + add esi,3+4 + add [ebx+18h],ecx + mov [ebx+20h],ecx + mov ebx,characters + get_extension: + lods byte [esi] + stos byte [edi] + xlat byte [ebx] + test al,al + jz invalid_argument + loop get_extension + inc esi + addressing_space_extension_ok: pop eax mov cl,[address_sign] not eax @@ -951,6 +1028,7 @@ virtual_directive: mov eax,edi sub eax,[ebx+18h] mov [ebx+1Ch],eax + add eax,[ebx+20h] test byte [ebx+0Ah],2 jz addressing_space_closed push esi edi ecx edx @@ -962,7 +1040,9 @@ virtual_directive: sub eax,ecx mov [tagged_blocks],eax lea edi,[eax+ecx-1] + add eax,[ebx+20h] xchg eax,[ebx+18h] + sub eax,[ebx+20h] lea esi,[eax+ecx-1] mov eax,edi sub eax,esi diff --git a/SOURCE/DOS/SYSTEM.INC b/SOURCE/DOS/SYSTEM.INC index fe616a3..474f14a 100644 --- a/SOURCE/DOS/SYSTEM.INC +++ b/SOURCE/DOS/SYSTEM.INC @@ -334,6 +334,7 @@ fatal_error: mov al,0FFh jmp exit_program assembler_error: + and [output_file],0 call display_user_messages mov ebx,[current_line] test ebx,ebx diff --git a/SOURCE/FORMATS.INC b/SOURCE/FORMATS.INC index e92f80f..179e7c4 100644 --- a/SOURCE/FORMATS.INC +++ b/SOURCE/FORMATS.INC @@ -9,13 +9,13 @@ formatter: jne output_path_ok mov esi,[input_file] mov edi,[free_additional_memory] - copy_output_path: + duplicate_output_path: lods byte [esi] cmp edi,[structures_buffer] jae out_of_memory stos byte [edi] or al,al - jnz copy_output_path + jnz duplicate_output_path dec edi mov eax,edi find_extension: diff --git a/SOURCE/LIBC/SYSTEM.INC b/SOURCE/LIBC/SYSTEM.INC index f16f92a..4f64666 100644 --- a/SOURCE/LIBC/SYSTEM.INC +++ b/SOURCE/LIBC/SYSTEM.INC @@ -131,16 +131,9 @@ lseek: push ebx movzx eax,al ccall fseek,ebx,edx,eax - test eax,eax - jnz lseek_error mov ebx,[esp] ccall ftell,ebx pop ebx - clc - ret - lseek_error: - pop ebx - stc ret display_string: @@ -227,6 +220,7 @@ fatal_error: jmp exit_program assembler_error: mov [con_handle],2 + and [output_file],0 call display_user_messages mov ebx,[current_line] test ebx,ebx diff --git a/SOURCE/LINUX/SYSTEM.INC b/SOURCE/LINUX/SYSTEM.INC index eec75fd..53cba01 100644 --- a/SOURCE/LINUX/SYSTEM.INC +++ b/SOURCE/LINUX/SYSTEM.INC @@ -186,9 +186,6 @@ lseek: mov dl,al mov eax,19 int 0x80 - cmp eax,-1 - je file_error - clc ret display_string: @@ -287,6 +284,7 @@ fatal_error: jmp exit_program assembler_error: mov [con_handle],2 + and [output_file],0 call display_user_messages mov ebx,[current_line] test ebx,ebx diff --git a/SOURCE/LINUX/X64/SYSTEM.INC b/SOURCE/LINUX/X64/SYSTEM.INC index fe7b60d..1344afc 100644 --- a/SOURCE/LINUX/X64/SYSTEM.INC +++ b/SOURCE/LINUX/X64/SYSTEM.INC @@ -220,9 +220,6 @@ lseek: syscall mov esi,r12d mov edi,r13d - cmp eax,-1 - je file_error - clc ret display_string: @@ -321,6 +318,7 @@ fatal_error: jmp exit_program assembler_error: mov [con_handle],2 + and [output_file],0 call display_user_messages mov ebx,[current_line] test ebx,ebx diff --git a/SOURCE/VERSION.INC b/SOURCE/VERSION.INC index 5028e29..fa763f7 100644 --- a/SOURCE/VERSION.INC +++ b/SOURCE/VERSION.INC @@ -1,5 +1,5 @@ -; flat assembler version 1.72 +; flat assembler version 1.73 ; Copyright (c) 1999-2017, Tomasz Grysztar. ; All rights reserved. ; @@ -33,7 +33,7 @@ ; cannot simply be copied and put under another distribution licence ; (including the GNU Public Licence). -VERSION_STRING equ "1.72" +VERSION_STRING equ "1.73.00" VERSION_MAJOR = 1 -VERSION_MINOR = 72 +VERSION_MINOR = 73 diff --git a/SOURCE/WIN32/SYSTEM.INC b/SOURCE/WIN32/SYSTEM.INC index 6d519c0..04849cb 100644 --- a/SOURCE/WIN32/SYSTEM.INC +++ b/SOURCE/WIN32/SYSTEM.INC @@ -187,9 +187,6 @@ lseek: push edx push ebx call [SetFilePointer] - cmp eax,-1 - je file_error - clc ret display_string: @@ -317,6 +314,7 @@ fatal_error: jmp exit_program assembler_error: mov [con_handle],STD_ERROR_HANDLE + and [output_file],0 call display_user_messages mov ebx,[current_line] test ebx,ebx diff --git a/WHATSNEW.TXT b/WHATSNEW.TXT index 1dfca61..a91e937 100644 --- a/WHATSNEW.TXT +++ b/WHATSNEW.TXT @@ -2,6 +2,11 @@ Visit http://flatassembler.net/ for more information. +version 1.73.00 (Nov 24, 2017) + +[+] Added "virtual as" syntax (backported from flat assembler g). + + version 1.72 (Oct 10, 2017) [+] Support for Intel AVX-512, SHA, CLFLUSHOPT, CLWB, PCOMMIT, ADX, RDSEED, SMAP