Commit 36cecaf1 authored by Tomasz Buchert's avatar Tomasz Buchert

New upstream version 1.73.01

parent edb39549
No preview for this file type
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
; ,''''; '''', ; ; ; ; ,''''; '''', ; ; ;
; ',,,,;, ,,,,,' ; ; ; ; ',,,,;, ,,,,,' ; ; ;
flat assembler 1.72 flat assembler 1.73
Programmer's Manual Programmer's Manual
...@@ -3673,6 +3673,15 @@ For example this code: ...@@ -3673,6 +3673,15 @@ For example this code:
loads the single byte from offset 10h in file "a.txt" into the "char" loads the single byte from offset 10h in file "a.txt" into the "char"
constant. constant.
Instead of or in addition to an "at" argument, "virtual" can also be followed
by an "as" keyword and a string defining an extension of additional file where
the initialized content of the block is going to be stored at the end of
a successful assembly.
virtual at 0 as 'asc'
times 256 db %-1
end virtual
Any of the "section" directives described in 2.4 also begins a new Any of the "section" directives described in 2.4 also begins a new
addressing space. addressing space.
It is possible to declare a special kind of label that marks the current It is possible to declare a special kind of label that marks the current
...@@ -3699,6 +3708,19 @@ specify addressing space that has not been assembled yet, just as it is not ...@@ -3699,6 +3708,19 @@ specify addressing space that has not been assembled yet, just as it is not
allowed to specify an address in the current addressing space that exceeds allowed to specify an address in the current addressing space that exceeds
the current offset. The addresses in any other addressing space are also the current offset. The addresses in any other addressing space are also
limited by the boundaries of the block. limited by the boundaries of the block.
The "virtual" directive can have a previously definen addressing space
label as the only argument. This variant allows to extend a previously defined
and closed block with additional data. Any definition of data within
an extending block is going to have the same effect as if that definition was
present in the original "virtual" block.
virtual at 0 as 'log'
Log::
end virtual
virtual Log
db 'Hello!',13,10
end virtual
2.2.5 Other directives 2.2.5 Other directives
......
No preview for this file type
flat assembler version 1.71 flat assembler version 1.73
Copyright (c) 1999-2017, Tomasz Grysztar. Copyright (c) 1999-2017, Tomasz Grysztar.
All rights reserved. All rights reserved.
......
...@@ -334,6 +334,7 @@ fatal_error: ...@@ -334,6 +334,7 @@ fatal_error:
mov al,0FFh mov al,0FFh
jmp exit_program jmp exit_program
assembler_error: assembler_error:
and [output_file],0
call display_user_messages call display_user_messages
mov ebx,[current_line] mov ebx,[current_line]
test ebx,ebx test ebx,ebx
......
...@@ -284,6 +284,7 @@ fatal_error: ...@@ -284,6 +284,7 @@ fatal_error:
jmp exit_program jmp exit_program
assembler_error: assembler_error:
mov [con_handle],2 mov [con_handle],2
and [output_file],0
call display_user_messages call display_user_messages
mov ebx,[current_line] mov ebx,[current_line]
test ebx,ebx test ebx,ebx
......
...@@ -318,6 +318,7 @@ fatal_error: ...@@ -318,6 +318,7 @@ fatal_error:
jmp exit_program jmp exit_program
assembler_error: assembler_error:
mov [con_handle],2 mov [con_handle],2
and [output_file],0
call display_user_messages call display_user_messages
mov ebx,[current_line] mov ebx,[current_line]
test ebx,ebx test ebx,ebx
......
...@@ -314,6 +314,7 @@ fatal_error: ...@@ -314,6 +314,7 @@ fatal_error:
jmp exit_program jmp exit_program
assembler_error: assembler_error:
mov [con_handle],STD_ERROR_HANDLE mov [con_handle],STD_ERROR_HANDLE
and [output_file],0
call display_user_messages call display_user_messages
mov ebx,[current_line] mov ebx,[current_line]
test ebx,ebx test ebx,ebx
......
...@@ -148,8 +148,8 @@ create_addressing_space: ...@@ -148,8 +148,8 @@ create_addressing_space:
init_addressing_space: init_addressing_space:
mov ebx,[tagged_blocks] mov ebx,[tagged_blocks]
mov dword [ebx-4],10h mov dword [ebx-4],10h
mov dword [ebx-8],20h mov dword [ebx-8],24h
sub ebx,8+20h sub ebx,8+24h
cmp ebx,edi cmp ebx,edi
jbe out_of_memory jbe out_of_memory
mov [tagged_blocks],ebx mov [tagged_blocks],ebx
...@@ -162,6 +162,7 @@ create_addressing_space: ...@@ -162,6 +162,7 @@ create_addressing_space:
mov [ebx+14h],eax mov [ebx+14h],eax
mov [ebx+18h],edi mov [ebx+18h],edi
mov [ebx+1Ch],eax mov [ebx+1Ch],eax
mov [ebx+20h],eax
ret ret
assemble_line: assemble_line:
...@@ -642,10 +643,6 @@ load_directive: ...@@ -642,10 +643,6 @@ load_directive:
mov ax,[current_pass] mov ax,[current_pass]
mov [ebx+18],ax mov [ebx+18],ax
or byte [ebx+8],8 or byte [ebx+8],8
cmp [symbols_file],0
je get_addressing_space
cmp [next_pass_needed],0
jne get_addressing_space
call store_label_reference call store_label_reference
get_addressing_space: get_addressing_space:
mov ebx,[ebx] mov ebx,[ebx]
...@@ -780,6 +777,8 @@ show_display_buffer: ...@@ -780,6 +777,8 @@ show_display_buffer:
mov eax,[esi+4] mov eax,[esi+4]
mov ecx,[esi] mov ecx,[esi]
sub esi,ecx sub esi,ecx
cmp eax,10h
je write_addressing_space
test eax,eax test eax,eax
jnz skip_block jnz skip_block
push esi push esi
...@@ -790,6 +789,62 @@ show_display_buffer: ...@@ -790,6 +789,62 @@ show_display_buffer:
jne display_messages jne display_messages
display_done: display_done:
ret 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: times_directive:
lods byte [esi] lods byte [esi]
...@@ -834,6 +889,8 @@ times_directive: ...@@ -834,6 +889,8 @@ times_directive:
virtual_directive: virtual_directive:
lods byte [esi] lods byte [esi]
cmp al,'('
je continue_virtual_area
cmp al,80h cmp al,80h
jne virtual_at_current jne virtual_at_current
lods byte [esi] lods byte [esi]
...@@ -848,6 +905,7 @@ virtual_directive: ...@@ -848,6 +905,7 @@ virtual_directive:
jmp set_virtual jmp set_virtual
virtual_at_current: virtual_at_current:
dec esi dec esi
virtual_fallback:
mov ebp,[addressing_space] mov ebp,[addressing_space]
mov al,[ds:ebp+9] mov al,[ds:ebp+9]
mov [value_type],al mov [value_type],al
...@@ -869,19 +927,29 @@ virtual_directive: ...@@ -869,19 +927,29 @@ virtual_directive:
shl ecx,16 shl ecx,16
mov cx,bx mov cx,bx
push ecx eax push ecx eax
call allocate_structure_data call allocate_virtual_structure_data
mov word [ebx],virtual_directive-instruction_handler
mov ecx,[addressing_space]
mov [ebx+12],ecx
mov [ebx+8],edi
mov ecx,[current_line]
mov [ebx+4],ecx
mov ebx,[addressing_space]
mov eax,edi
sub eax,[ebx+18h]
mov [ebx+1Ch],eax
call init_addressing_space call init_addressing_space
or byte [ebx+0Ah],1 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
push ebx
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
pop ebx
addressing_space_extension_ok:
pop eax pop eax
mov cl,[address_sign] mov cl,[address_sign]
not eax not eax
...@@ -924,6 +992,82 @@ virtual_directive: ...@@ -924,6 +992,82 @@ virtual_directive:
no_such_structure: no_such_structure:
stc stc
ret ret
allocate_virtual_structure_data:
call allocate_structure_data
mov word [ebx],virtual_directive-instruction_handler
mov ecx,[addressing_space]
mov [ebx+12],ecx
mov [ebx+8],edi
mov ecx,[current_line]
mov [ebx+4],ecx
mov ebx,[addressing_space]
mov eax,edi
sub eax,[ebx+18h]
mov [ebx+1Ch],eax
ret
continue_virtual_area:
cmp byte [esi],11h
jne invalid_argument
cmp byte [esi+1+4],')'
jne invalid_argument
inc esi
lods dword [esi]
inc esi
cmp eax,0Fh
jbe reserved_word_used_as_symbol
mov edx,undefined_symbol
test byte [eax+8],1
jz virtual_area_unavailable
mov edx,symbol_out_of_scope
mov cx,[eax+16]
cmp cx,[current_pass]
jne virtual_area_unavailable
mov edx,invalid_use_of_symbol
test byte [eax+9],4
jz virtual_area_unavailable
mov ebx,eax
mov ax,[current_pass]
mov [ebx+18],ax
or byte [ebx+8],8
call store_label_reference
mov ebx,[ebx]
test byte [ebx+0Ah],4
jz virtual_area_unavailable
and byte [ebx+0Ah],not 4
mov edx,ebx
call allocate_virtual_structure_data
mov [addressing_space],edx
push esi
mov esi,[edx+18h]
mov ecx,[edx+1Ch]
mov eax,[edx+20h]
sub esi,eax
add ecx,eax
lea eax,[edi+ecx]
cmp eax,[tagged_blocks]
jae out_of_memory
mov eax,esi
sub eax,edi
sub [edx+18h],eax
sub [edx],eax
sbb dword [edx+4],0
sbb byte [edx+8],0
mov al,cl
shr ecx,2
rep movs dword [edi],[esi]
mov cl,al
and cl,11b
rep movs byte [edi],[esi]
pop esi
jmp instruction_assembled
virtual_area_unavailable:
cmp [error_line],0
jne virtual_fallback
push [current_line]
pop [error_line]
mov [error],edx
mov [error_info],eax
jmp virtual_fallback
end_virtual: end_virtual:
call find_structure_data call find_structure_data
jc unexpected_instruction jc unexpected_instruction
...@@ -951,8 +1095,10 @@ virtual_directive: ...@@ -951,8 +1095,10 @@ virtual_directive:
mov eax,edi mov eax,edi
sub eax,[ebx+18h] sub eax,[ebx+18h]
mov [ebx+1Ch],eax mov [ebx+1Ch],eax
add eax,[ebx+20h]
test byte [ebx+0Ah],2 test byte [ebx+0Ah],2
jz addressing_space_closed jz addressing_space_closed
or byte [ebx+0Ah],4
push esi edi ecx edx push esi edi ecx edx
mov ecx,eax mov ecx,eax
mov eax,[tagged_blocks] mov eax,[tagged_blocks]
...@@ -962,7 +1108,9 @@ virtual_directive: ...@@ -962,7 +1108,9 @@ virtual_directive:
sub eax,ecx sub eax,ecx
mov [tagged_blocks],eax mov [tagged_blocks],eax
lea edi,[eax+ecx-1] lea edi,[eax+ecx-1]
add eax,[ebx+20h]
xchg eax,[ebx+18h] xchg eax,[ebx+18h]
sub eax,[ebx+20h]
lea esi,[eax+ecx-1] lea esi,[eax+ecx-1]
mov eax,edi mov eax,edi
sub eax,esi sub eax,esi
......
...@@ -179,12 +179,7 @@ calculate_expression: ...@@ -179,12 +179,7 @@ calculate_expression:
got_label: got_label:
test byte [ebx+9],4 test byte [ebx+9],4
jnz invalid_use_of_symbol jnz invalid_use_of_symbol
cmp [symbols_file],0
je label_reference_ok
cmp [next_pass_needed],0
jne label_reference_ok
call store_label_reference call store_label_reference
label_reference_ok:
mov al,[ebx+11] mov al,[ebx+11]
mov [edi-8+12],al mov [edi-8+12],al
mov eax,[ebx+12] mov eax,[ebx+12]
...@@ -1011,6 +1006,10 @@ calculate_expression: ...@@ -1011,6 +1006,10 @@ calculate_expression:
mov [esi+13],bl mov [esi+13],bl
ret ret
store_label_reference: store_label_reference:
cmp [symbols_file],0
je label_reference_ok
cmp [next_pass_needed],0
jne label_reference_ok
mov eax,[tagged_blocks] mov eax,[tagged_blocks]
mov dword [eax-4],2 mov dword [eax-4],2
mov dword [eax-8],4 mov dword [eax-8],4
...@@ -1019,6 +1018,7 @@ calculate_expression: ...@@ -1019,6 +1018,7 @@ calculate_expression:
jbe out_of_memory jbe out_of_memory
mov [tagged_blocks],eax mov [tagged_blocks],eax
mov [eax],ebx mov [eax],ebx
label_reference_ok:
ret ret
convert_fp: convert_fp:
inc esi inc esi
......
...@@ -9,13 +9,13 @@ formatter: ...@@ -9,13 +9,13 @@ formatter:
jne output_path_ok jne output_path_ok
mov esi,[input_file] mov esi,[input_file]
mov edi,[free_additional_memory] mov edi,[free_additional_memory]
copy_output_path: duplicate_output_path:
lods byte [esi] lods byte [esi]
cmp edi,[structures_buffer] cmp edi,[structures_buffer]
jae out_of_memory jae out_of_memory
stos byte [edi] stos byte [edi]
or al,al or al,al
jnz copy_output_path jnz duplicate_output_path
dec edi dec edi
mov eax,edi mov eax,edi
find_extension: find_extension:
...@@ -326,14 +326,9 @@ public_directive: ...@@ -326,14 +326,9 @@ public_directive:
mov dx,[current_pass] mov dx,[current_pass]
mov [eax+18],dx mov [eax+18],dx
or byte [eax+8],8 or byte [eax+8],8
cmp [symbols_file],0
je public_reference_ok
cmp [next_pass_needed],0
jne public_reference_ok
mov ebx,eax mov ebx,eax
call store_label_reference call store_label_reference
mov eax,ebx mov eax,ebx
public_reference_ok:
mov ebx,[free_additional_memory] mov ebx,[free_additional_memory]
lea edx,[ebx+10h] lea edx,[ebx+10h]
cmp edx,[structures_buffer] cmp edx,[structures_buffer]
......
...@@ -220,6 +220,7 @@ fatal_error: ...@@ -220,6 +220,7 @@ fatal_error:
jmp exit_program jmp exit_program
assembler_error: assembler_error:
mov [con_handle],2 mov [con_handle],2
and [output_file],0
call display_user_messages call display_user_messages
mov ebx,[current_line] mov ebx,[current_line]
test ebx,ebx test ebx,ebx
......
; flat assembler version 1.71 ; flat assembler version 1.73
; Copyright (c) 1999-2017, Tomasz Grysztar. ; Copyright (c) 1999-2017, Tomasz Grysztar.
; All rights reserved. ; All rights reserved.
; ;
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
; cannot simply be copied and put under another distribution licence ; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence). ; (including the GNU Public Licence).
VERSION_STRING equ "1.72" VERSION_STRING equ "1.73.01"
VERSION_MAJOR = 1 VERSION_MAJOR = 1
VERSION_MINOR = 72 VERSION_MINOR = 73
...@@ -2,6 +2,20 @@ ...@@ -2,6 +2,20 @@
Visit http://flatassembler.net/ for more information. Visit http://flatassembler.net/ for more information.
version 1.73.01 (Nov 25, 2017)
[+] Added virtual block continuation syntax (backported from flat assembler g).
[+] Documentation update.
[-] Fixed a bug in addressing data of the "virtual as" block.
version 1.73.00 (Nov 24, 2017)
[+] Added "virtual as" syntax (backported from flat assembler g).
version 1.72 (Oct 10, 2017) version 1.72 (Oct 10, 2017)
[+] Support for Intel AVX-512, SHA, CLFLUSHOPT, CLWB, PCOMMIT, ADX, RDSEED, SMAP [+] Support for Intel AVX-512, SHA, CLFLUSHOPT, CLWB, PCOMMIT, ADX, RDSEED, SMAP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment