forked from KolibriOS/kolibrios
FASM: Remove SVN tagged versions (#268)
- Delete SVN tagged versions `1.68` and `1.71`. We do not need to retain historic FASM versions in KolibriOS source code. (Work towards #75, point 1) Reviewed-on: KolibriOS/kolibrios#268 Reviewed-by: Burer <burer@noreply.localhost> Co-authored-by: Andrew <dent.ace@gmail.com> Co-committed-by: Andrew <dent.ace@gmail.com>
This commit is contained in:
@@ -1,200 +0,0 @@
|
||||
|
||||
Visit http://flatassembler.net/ for more information.
|
||||
|
||||
|
||||
version 1.68 (Jun 13, 2009)
|
||||
|
||||
[+] Added SSSE3 (Supplemental SSE3), SSE4.1, SSE4.2 and SSE4a instructions.
|
||||
|
||||
[+] Added the AMD SVM and Intel SMX instructions.
|
||||
|
||||
[+] Added "rdmsrq", "wrmsrq", "sysexitq" and "sysretq" mnemonics for the
|
||||
64-bit variants of respective instructions.
|
||||
|
||||
[+] Added "fstenvw", "fstenvd", "fsavew", "fsaved", "frstorw" and "frstord"
|
||||
mnemonics to allow choosing between 16-bit and 32-bit variants of
|
||||
structures used by the "fstenv", "fsave" and "frstor" instructions.
|
||||
|
||||
[+] Added "plt" operator for the ELF output format.
|
||||
|
||||
[+] Allowed "rva" operator to be used in MS COFF object format, and also
|
||||
added "static" keyword for the "public" directive.
|
||||
|
||||
[+] Added Intel-style aliases for the additional long mode 8-bit registers.
|
||||
|
||||
[-] The PE formatter now automatically detects whether relocatable labels
|
||||
should be used, depending on whether the fixups directory is placed
|
||||
somewhere into executable by programer, or not. This makes possible the
|
||||
more flexible use of the addressing symbols in case of PE executable fixed
|
||||
at some position.
|
||||
|
||||
[-] Added support for outputting the 32-bit address relocations in case of
|
||||
64-bit object formats and PE executable. This makes some specific
|
||||
instructions compilable, but it also forces linker to put such
|
||||
generated code into the low 2 gigabytes of addressing space.
|
||||
|
||||
[+] Added "EFI", "EFIboot" and "EFIruntime" subsystem keywords for PE format.
|
||||
|
||||
[-] Corrected the precedence of operators of macroinstruction line maker.
|
||||
The symbol escaping now has always the higher priority than symbol conversion,
|
||||
and both have higher precedence than concatenation.
|
||||
|
||||
[+] Allowed to check "@b" and "@f" symbols with "defined" operator.
|
||||
|
||||
[+] Allowed "as" operator to specify the output file extension when
|
||||
placed at the end of the "format" directive line.
|
||||
|
||||
[-] Definition of macro with the same name as one of the preprocessor's directives
|
||||
is no longer allowed.
|
||||
|
||||
[+] Allowed single quote character to be put inside the number value,
|
||||
to help improve long numbers readability.
|
||||
|
||||
[+] Added optional symbolic information output, and a set of tools that extract
|
||||
various kinds of information from it.
|
||||
|
||||
[+] Added "err" directive that allows to signalize error from the source.
|
||||
|
||||
|
||||
version 1.66 (May 7, 2006)
|
||||
|
||||
[+] Added "define" directive to preprocessor, which defines symbolic constants,
|
||||
the same kind as "equ" directive, however there's an important difference
|
||||
that "define" doesn't process symbolic constants in the value before
|
||||
assigning it. For example:
|
||||
|
||||
a equ 1
|
||||
a equ a+a
|
||||
|
||||
define b 1
|
||||
define b b+b
|
||||
|
||||
defines the "a" constant with value "1+1", but the "b" is defined with
|
||||
value "b+b". This directive may be useful in some advanced
|
||||
macroinstructions.
|
||||
|
||||
[-] Moved part of the conditional expression processing into parser,
|
||||
for slightly better performance and lesser memory usage by assembler.
|
||||
The logical values defined with "eq", "eqtype" and "in" operators are now
|
||||
evaluated by the parser and if they are enough to determine the condition,
|
||||
the whole block is processed accordingly. Thus this block:
|
||||
|
||||
if eax eq EAX | 0/0
|
||||
nop
|
||||
end if
|
||||
|
||||
is parsed into just "nop" instruction, since parser is able to determine
|
||||
that the condition is true, even though one of the logical values makes no
|
||||
sense - but since this is none of the "eq", "eqtype" and "in" expressions,
|
||||
the parser doesn't investigate.
|
||||
|
||||
[-] Also the assembler is now calculating only as many logical values as it
|
||||
needs to determine the condition. So this block:
|
||||
|
||||
if defined alpha & alpha
|
||||
|
||||
end if
|
||||
|
||||
will not cause error when "alpha" is not defined, as it would with previous
|
||||
versions. This is because after checking that "defined alpha" is false
|
||||
condition it doesn't need to know the second logical value to determine the
|
||||
value of conjunction.
|
||||
|
||||
[+] Added "short" keyword for specifying jump type, the "jmp byte" form is now
|
||||
obsolete and no longer correct - use "jmp short" instead.
|
||||
|
||||
[-] The size operator applied to jump no longer applies to the size of relative
|
||||
displacement - now it applies to the size of target address.
|
||||
|
||||
[-] The "ret" instruction with 0 parameter is now assembled into short form,
|
||||
unless you force using the 16-bit immediate with "word" operator.
|
||||
|
||||
[+] Added missing extended registers for the 32-bit addressing in long mode.
|
||||
|
||||
[+] Added "linkremove" and "linkinfo" section flags for MS COFF output.
|
||||
|
||||
[+] Added support for GOT offsets in ELF object formatter, which can be useful
|
||||
when making position-independent code for shared libraries. For any label
|
||||
you can get its offset relative to GOT by preceding it with "rva" operator
|
||||
(the same keyword as for PE format is used, to avoid adding a new one,
|
||||
while this one has very similar meaning).
|
||||
|
||||
[-] Changed ELF executable to use "segment" directive in place of "section",
|
||||
to make the distinction between the run-time segments and linkable
|
||||
sections. If you had a "section" directive in your ELF executables and they
|
||||
no longer assemble, replace it with "segment".
|
||||
|
||||
[-] The PE formatter now always creates the fixups directory when told to -
|
||||
even when there are no fixups to be put there (in such case it creates the
|
||||
directory with one empty block).
|
||||
|
||||
[-] Some of the internal structures have been extended to provide the
|
||||
possibility of making extensive symbol dumps.
|
||||
|
||||
[-] Corrected "fix" directive to keep the value intact before assigning it to the
|
||||
prioritized constant.
|
||||
|
||||
[+] The ` operator now works with any kind of symbol; when used with quoted
|
||||
string it simply does nothing. Thus the sequence of ` operators applied to
|
||||
one symbol work the same as if there was just one. In similar manner, the
|
||||
sequence of # operators now works as if it was a single one - using such a
|
||||
sequence instead of escaping, which was kept for some backward
|
||||
compatibility, is now deprecated.
|
||||
|
||||
[-] Corrected order of identifying assembler directives ("if db eq db" was
|
||||
incorrectly interpreted as data definition).
|
||||
|
||||
[-] Many other small bugs fixed.
|
||||
|
||||
|
||||
version 1.64 (Aug 8, 2005)
|
||||
|
||||
[+] Output of PE executables for Win64 architecture (with "format PE64"
|
||||
setting).
|
||||
|
||||
[+] Added "while" and "break" directives.
|
||||
|
||||
[+] Added "irp" and "irps" directives.
|
||||
|
||||
[+] The macro arguments can be marked as required with the "*" character.
|
||||
|
||||
[-] Fixed checking for overflow when multiplying 64-bit values - the result
|
||||
must always fit in the range of signed 64 integer now.
|
||||
|
||||
[-] Segment prefixes were generated incorrectly in 16-bit mode when BP was used
|
||||
as a second addressing register - fixed.
|
||||
|
||||
[-] The "local" directive was not creating unique labels in some cases - fixed.
|
||||
|
||||
[-] The "not encodable with long immediate" error in 64-bit mode was sometimes
|
||||
wrongly signaled - fixed.
|
||||
|
||||
[-] Other minor fixes and corrections.
|
||||
|
||||
|
||||
version 1.62 (Jun 14, 2005)
|
||||
|
||||
[+] Escaping of symbols inside macroinstructions with backslash.
|
||||
|
||||
[+] Ability of outputting the COFF object files for Win64 architecture
|
||||
(with "format MS64 COFF" setting).
|
||||
|
||||
[+] New preprocessor directives: "restruc", "rept" and "match"
|
||||
|
||||
[+] VMX instructions support (not documented).
|
||||
|
||||
[+] Extended data directives to allow use of the "dup" operator.
|
||||
|
||||
[+] Extended "struc" features to allow custom definitions of main structure's
|
||||
label.
|
||||
|
||||
[-] When building resources from the the .RES file that contained more
|
||||
than one resource of the same string name, the separate resource
|
||||
directories were created with the same names - fixed.
|
||||
|
||||
[-] Several bugs in the ELF64 object output has been fixed.
|
||||
|
||||
[-] Corrected behavior of "fix" directive to more straightforward.
|
||||
|
||||
[-] Fixed bug in "include" directive, which caused files included from within
|
||||
macros to be processed the wrong way.
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@kpack fasm
|
||||
@pause
|
@@ -1,174 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
out_of_memory:
|
||||
push _out_of_memory
|
||||
jmp fatal_error
|
||||
stack_overflow:
|
||||
push _stack_overflow
|
||||
jmp fatal_error
|
||||
main_file_not_found:
|
||||
push _main_file_not_found
|
||||
jmp fatal_error
|
||||
unexpected_end_of_file:
|
||||
push _unexpected_end_of_file
|
||||
jmp fatal_error
|
||||
code_cannot_be_generated:
|
||||
push _code_cannot_be_generated
|
||||
jmp fatal_error
|
||||
format_limitations_exceeded:
|
||||
push _format_limitations_exceeded
|
||||
jmp fatal_error
|
||||
invalid_definition:
|
||||
push _invalid_definition
|
||||
jmp fatal_error
|
||||
write_failed:
|
||||
push _write_failed
|
||||
jmp fatal_error
|
||||
|
||||
file_not_found:
|
||||
push _file_not_found
|
||||
jmp assembler_error
|
||||
error_reading_file:
|
||||
push _error_reading_file
|
||||
jmp assembler_error
|
||||
invalid_file_format:
|
||||
push _invalid_file_format
|
||||
jmp assembler_error
|
||||
invalid_macro_arguments:
|
||||
push _invalid_macro_arguments
|
||||
jmp assembler_error
|
||||
incomplete_macro:
|
||||
push _incomplete_macro
|
||||
jmp assembler_error
|
||||
unexpected_characters:
|
||||
push _unexpected_characters
|
||||
jmp assembler_error
|
||||
invalid_argument:
|
||||
push _invalid_argument
|
||||
jmp assembler_error
|
||||
illegal_instruction:
|
||||
push _illegal_instruction
|
||||
jmp assembler_error
|
||||
invalid_operand:
|
||||
push _invalid_operand
|
||||
jmp assembler_error
|
||||
invalid_operand_size:
|
||||
push _invalid_operand_size
|
||||
jmp assembler_error
|
||||
operand_size_not_specified:
|
||||
push _operand_size_not_specified
|
||||
jmp assembler_error
|
||||
operand_sizes_do_not_match:
|
||||
push _operand_sizes_do_not_match
|
||||
jmp assembler_error
|
||||
invalid_address_size:
|
||||
push _invalid_address_size
|
||||
jmp assembler_error
|
||||
address_sizes_do_not_agree:
|
||||
push _address_sizes_do_not_agree
|
||||
jmp assembler_error
|
||||
prefix_conflict:
|
||||
push _prefix_conflict
|
||||
jmp assembler_error
|
||||
long_immediate_not_encodable:
|
||||
push _long_immediate_not_encodable
|
||||
jmp assembler_error
|
||||
relative_jump_out_of_range:
|
||||
push _relative_jump_out_of_range
|
||||
jmp assembler_error
|
||||
invalid_expression:
|
||||
push _invalid_expression
|
||||
jmp assembler_error
|
||||
invalid_address:
|
||||
push _invalid_address
|
||||
jmp assembler_error
|
||||
invalid_value:
|
||||
push _invalid_value
|
||||
jmp assembler_error
|
||||
value_out_of_range:
|
||||
push _value_out_of_range
|
||||
jmp assembler_error
|
||||
undefined_symbol:
|
||||
mov edi,message
|
||||
mov esi,_undefined_symbol
|
||||
call copy_asciiz
|
||||
push message
|
||||
cmp [error_info],0
|
||||
je assembler_error
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
jmp assembler_error
|
||||
copy_asciiz:
|
||||
lods byte [esi]
|
||||
stos byte [edi]
|
||||
test al,al
|
||||
jnz copy_asciiz
|
||||
ret
|
||||
write_quoted_symbol_name:
|
||||
mov al,27h
|
||||
stosb
|
||||
mov esi,[error_info]
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movs byte [edi],[esi]
|
||||
mov ax,27h
|
||||
stosw
|
||||
ret
|
||||
symbol_out_of_scope:
|
||||
mov edi,message
|
||||
mov esi,_symbol_out_of_scope_1
|
||||
call copy_asciiz
|
||||
cmp [error_info],0
|
||||
je finish_symbol_out_of_scope_message
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
finish_symbol_out_of_scope_message:
|
||||
mov byte [edi-1],20h
|
||||
mov esi,_symbol_out_of_scope_2
|
||||
call copy_asciiz
|
||||
push message
|
||||
jmp assembler_error
|
||||
invalid_use_of_symbol:
|
||||
push _invalid_use_of_symbol
|
||||
jmp assembler_error
|
||||
name_too_long:
|
||||
push _name_too_long
|
||||
jmp assembler_error
|
||||
invalid_name:
|
||||
push _invalid_name
|
||||
jmp assembler_error
|
||||
reserved_word_used_as_symbol:
|
||||
push _reserved_word_used_as_symbol
|
||||
jmp assembler_error
|
||||
symbol_already_defined:
|
||||
push _symbol_already_defined
|
||||
jmp assembler_error
|
||||
missing_end_quote:
|
||||
push _missing_end_quote
|
||||
jmp assembler_error
|
||||
missing_end_directive:
|
||||
push _missing_end_directive
|
||||
jmp assembler_error
|
||||
unexpected_instruction:
|
||||
push _unexpected_instruction
|
||||
jmp assembler_error
|
||||
extra_characters_on_line:
|
||||
push _extra_characters_on_line
|
||||
jmp assembler_error
|
||||
section_not_aligned_enough:
|
||||
push _section_not_aligned_enough
|
||||
jmp assembler_error
|
||||
setting_already_specified:
|
||||
push _setting_already_specified
|
||||
jmp assembler_error
|
||||
data_already_defined:
|
||||
push _data_already_defined
|
||||
jmp assembler_error
|
||||
too_many_repeats:
|
||||
push _too_many_repeats
|
||||
jmp assembler_error
|
||||
invoked_error:
|
||||
push _invoked_error
|
||||
jmp assembler_error
|
File diff suppressed because it is too large
Load Diff
@@ -1,608 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; flat assembler source ;;
|
||||
;; Copyright (c) 1999-2006, Tomasz Grysztar ;;
|
||||
;; All rights reserved. ;;
|
||||
;; ;;
|
||||
;; Menuet port by VT ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
NORMAL_MODE = 8
|
||||
CONSOLE_MODE = 32
|
||||
|
||||
MAGIC1 = 6*(text.line_size-1)+14
|
||||
MAX_PATH = 100
|
||||
|
||||
APP_MEMORY = 0x00800000
|
||||
|
||||
;; Menuet header
|
||||
|
||||
appname equ "flat assembler "
|
||||
|
||||
use32
|
||||
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; program start
|
||||
dd program_end ; program image size
|
||||
dd stacktop ; required amount of memory
|
||||
dd stacktop ; stack
|
||||
dd params,0x0 ; parameters,icon
|
||||
|
||||
include 'lang.inc'
|
||||
include '..\..\..\macros.inc'
|
||||
purge add,sub ; macros.inc does incorrect substitution
|
||||
include 'fasm.inc'
|
||||
|
||||
center fix true
|
||||
|
||||
START: ; Start of execution
|
||||
mov edi, fileinfos
|
||||
mov ecx, (fileinfos_end-fileinfos)/4
|
||||
or eax, -1
|
||||
rep stosd
|
||||
push 68
|
||||
pop eax
|
||||
push 11
|
||||
pop ebx
|
||||
mcall
|
||||
|
||||
cmp [params],0
|
||||
jz red
|
||||
|
||||
mov ecx,10
|
||||
mov eax,' '
|
||||
mov edi,infile
|
||||
push ecx
|
||||
cld
|
||||
rep stosd
|
||||
mov ecx,[esp]
|
||||
mov edi,outfile
|
||||
rep stosd
|
||||
pop ecx
|
||||
mov edi,path
|
||||
rep stosd
|
||||
|
||||
mov esi,params
|
||||
; DEBUGF "params: %s\n",esi
|
||||
mov edi,infile
|
||||
call mov_param_str
|
||||
; mov edi,infile
|
||||
; DEBUGF " input: %s\n",edi
|
||||
inc esi
|
||||
mov edi,outfile
|
||||
call mov_param_str
|
||||
; mov edi,outfile
|
||||
; DEBUGF "output: %s\n",edi
|
||||
inc esi
|
||||
mov edi,path
|
||||
call mov_param_str
|
||||
; mov edi,path
|
||||
; DEBUGF " path: %s\n",edi
|
||||
|
||||
cmp [esi], dword ',run'
|
||||
jne @f
|
||||
mov [_run_outfile],1
|
||||
@@:
|
||||
|
||||
mov [_mode],CONSOLE_MODE
|
||||
jmp start
|
||||
|
||||
|
||||
red: ; Redraw
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
push 10 ; Wait here for event
|
||||
pop eax
|
||||
mcall
|
||||
dec eax
|
||||
je red ; Redraw request
|
||||
dec eax
|
||||
jne button ; Button in buffer
|
||||
|
||||
key: ; Key
|
||||
mov al,2 ; Read it and ignore
|
||||
mcall
|
||||
jmp still
|
||||
|
||||
button: ; Button in Window
|
||||
|
||||
mov al,17
|
||||
mcall
|
||||
|
||||
cmp ah,1
|
||||
jne noclose
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
noclose:
|
||||
cmp ah,2 ; Start compiling
|
||||
je start
|
||||
cmp ah,3 ; Start compiled file
|
||||
jnz norunout
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_start
|
||||
; xor ecx,ecx
|
||||
jmp still
|
||||
norunout:
|
||||
cmp ah,4
|
||||
jnz norundebug
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_debug
|
||||
jmp still
|
||||
|
||||
norundebug:
|
||||
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
|
||||
|
||||
jmp still
|
||||
|
||||
f4:
|
||||
xor [bGenerateDebugInfo], 1
|
||||
mcall 8,,,0x8000000E
|
||||
call draw_checkbox
|
||||
jmp still
|
||||
|
||||
draw_window:
|
||||
|
||||
pusha
|
||||
|
||||
mcall 12,1 ; Start of draw
|
||||
|
||||
get_sys_colors 1,0
|
||||
|
||||
xor eax,eax
|
||||
mov ebx,100*65536+280
|
||||
mov ecx,90*65536+260
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
mov edi,title ; Draw Window Label Text
|
||||
mcall
|
||||
|
||||
mcall 9,PROCESSINFO,-1
|
||||
|
||||
mpack ecx,1,1
|
||||
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
|
||||
madd ecx, 14,0
|
||||
mcall ,,,0x4000000C ; Button: Enter Outfile
|
||||
madd ecx, 14,0
|
||||
mcall ,,,0x4000000D ; Button: Enter Path
|
||||
|
||||
mpack ebx,[pinfo.box.width],MAGIC1
|
||||
msub ebx,MAGIC1+10+1,0
|
||||
mpack ecx,0, (14*3+16)/3-1
|
||||
madd ecx,1,0
|
||||
mcall ,,,0x00000002,[sc.work_button]
|
||||
madd ecx, (14*3+16)/3+1,0
|
||||
mcall ,,,0x00000003
|
||||
madd ecx, (14*3+16)/3+1,0
|
||||
mcall ,,,4
|
||||
|
||||
mpack ebx,6,0 ; Draw Window Text
|
||||
add ebx,1+ 14/2-3
|
||||
mov ecx,[sc.work_text]
|
||||
mov edx,text
|
||||
mov esi,text.line_size
|
||||
mov eax,4
|
||||
newline:
|
||||
mcall
|
||||
add ebx, 14
|
||||
add edx,text.line_size
|
||||
cmp byte[edx],'x'
|
||||
jne newline
|
||||
|
||||
mov ebx,[pinfo.box.width]
|
||||
sub ebx,MAGIC1+10+1-9
|
||||
shl ebx,16
|
||||
add ebx,1+( (14*3+16)/3-1)/2-3
|
||||
mcall ,,[sc.work_button_text],s_compile,7
|
||||
add ebx,(14*3+16)/3+1
|
||||
mcall ,,,s_run
|
||||
add ebx,(14*3+16)/3+1
|
||||
mcall ,,,s_debug
|
||||
|
||||
mpack ebx,MAGIC1+6,0
|
||||
add ebx,1+ 14/2-3+ 14*0
|
||||
mov esi,[pinfo.box.width]
|
||||
sub esi,MAGIC1*2+5*2+6+3
|
||||
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],infile
|
||||
add ebx,14
|
||||
mcall ,,,outfile
|
||||
add ebx,14
|
||||
mcall ,,,path
|
||||
|
||||
call draw_checkbox
|
||||
|
||||
call draw_messages
|
||||
|
||||
mcall 12,2 ; End of Draw
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
bottom_right dd ?
|
||||
|
||||
draw_checkbox:
|
||||
mcall 8,<5,10>,<14*3+5,10>,14,[sc.work_button]
|
||||
cmp [bGenerateDebugInfo], 0
|
||||
jz @f
|
||||
mov edx, [sc.work_button_text]
|
||||
mcall 38,<7,13>,<14*3+7,14*3+13>
|
||||
mcall 38,,<14*3+13,14*3+7>
|
||||
@@:
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x80000000
|
||||
mcall 4,<20,14*3+7>,,s_dbgdescr
|
||||
ret
|
||||
|
||||
draw_messages:
|
||||
mov eax,13 ; clear work area
|
||||
mpack ebx,7-2,[pinfo.box.width]
|
||||
sub ebx,5*2+7*2-1-2*2
|
||||
mpack ecx,0,[pinfo.box.height]
|
||||
madd ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25)
|
||||
mov word[bottom_right+2],bx
|
||||
mov word[bottom_right],cx
|
||||
msub [bottom_right],7,11
|
||||
add [bottom_right],7 shl 16 + 53
|
||||
mov edx,[sc.work]
|
||||
mcall
|
||||
_cy = 0
|
||||
_sy = 2
|
||||
_cx = 4
|
||||
_sx = 6
|
||||
push ebx ecx
|
||||
mpack ebx,4,5
|
||||
add bx,[esp+_cx]
|
||||
mov ecx,[esp+_sy-2]
|
||||
mov cx,[esp+_sy]
|
||||
msub ecx,1,1
|
||||
mcall 38,,,[sc.work_graph]
|
||||
mov si,[esp+_cy]
|
||||
add cx,si
|
||||
shl esi,16
|
||||
add ecx,esi
|
||||
madd ecx,1,1
|
||||
mcall
|
||||
mpack ebx,4,4
|
||||
mov esi,[esp+_sy-2]
|
||||
mov si,cx
|
||||
mov ecx,esi
|
||||
mcall
|
||||
mov si,[esp+_cx]
|
||||
add bx,si
|
||||
shl esi,16
|
||||
add ebx,esi
|
||||
madd ebx,1,1
|
||||
mcall
|
||||
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
|
||||
|
||||
text:
|
||||
db ' INFILE:'
|
||||
.line_size = $-text
|
||||
db 'OUTFILE:'
|
||||
db ' PATH:'
|
||||
db 'x'
|
||||
|
||||
s_compile db 'COMPILE'
|
||||
s_run db ' RUN '
|
||||
s_debug db ' DEBUG '
|
||||
|
||||
s_dbgdescr db 'Generate debug information',0
|
||||
|
||||
infile db 'example.asm'
|
||||
times MAX_PATH+$-infile db 0
|
||||
outfile db 'example'
|
||||
times MAX_PATH+$-outfile db 0
|
||||
path db '/rd/1/'
|
||||
times MAX_PATH+$-path db 0
|
||||
|
||||
lf db 13,10,0
|
||||
|
||||
addr dd 0x0
|
||||
ya dd 0x0
|
||||
zero db 0x0
|
||||
|
||||
mov_param_str:
|
||||
@@:
|
||||
mov al,[esi]
|
||||
cmp al,','
|
||||
je @f
|
||||
cmp al,0
|
||||
je @f
|
||||
mov [edi],al
|
||||
inc esi
|
||||
inc edi
|
||||
jmp @b
|
||||
@@:
|
||||
mov al,0
|
||||
stosb
|
||||
ret
|
||||
|
||||
start:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
call draw_messages
|
||||
mov [textxy],7 shl 16 + 70
|
||||
@@:
|
||||
mov esi,_logo
|
||||
call display_string
|
||||
|
||||
;
|
||||
; Fasm native code
|
||||
;
|
||||
|
||||
mov [input_file],infile
|
||||
mov [output_file],outfile
|
||||
|
||||
call init_memory
|
||||
|
||||
call make_timestamp
|
||||
mov [start_time],eax
|
||||
|
||||
call preprocessor
|
||||
call parser
|
||||
call assembler
|
||||
cmp [bGenerateDebugInfo], 0
|
||||
jz @f
|
||||
call symbol_dump
|
||||
@@:
|
||||
call formatter
|
||||
|
||||
call display_user_messages
|
||||
movzx eax,[current_pass]
|
||||
inc eax
|
||||
call display_number
|
||||
mov esi,_passes_suffix
|
||||
call display_string
|
||||
call make_timestamp
|
||||
sub eax,[start_time]
|
||||
xor edx,edx
|
||||
mov ebx,100
|
||||
div ebx
|
||||
or eax,eax
|
||||
jz display_bytes_count
|
||||
xor edx,edx
|
||||
mov ebx,10
|
||||
div ebx
|
||||
push edx
|
||||
call display_number
|
||||
mov dl,'.'
|
||||
call display_character
|
||||
pop eax
|
||||
call display_number
|
||||
mov esi,_seconds_suffix
|
||||
call display_string
|
||||
display_bytes_count:
|
||||
mov eax,[written_size]
|
||||
call display_number
|
||||
mov esi,_bytes_suffix
|
||||
call display_string
|
||||
xor al,al
|
||||
|
||||
cmp [_run_outfile],0
|
||||
je @f
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mov eax,70
|
||||
mov ebx,file_info_start
|
||||
xor ecx,ecx
|
||||
mcall
|
||||
@@:
|
||||
jmp exit_program
|
||||
|
||||
|
||||
include 'system.inc'
|
||||
include 'version.inc'
|
||||
include 'errors.inc'
|
||||
include 'expressi.inc'
|
||||
include 'preproce.inc'
|
||||
include 'parser.inc'
|
||||
include 'assemble.inc'
|
||||
include 'formats.inc'
|
||||
include 'x86_64.inc'
|
||||
include 'tables.inc'
|
||||
include 'symbdump.inc'
|
||||
include 'messages.inc'
|
||||
|
||||
title db appname,VERSION_STRING,0
|
||||
|
||||
_logo db 'flat assembler version ',VERSION_STRING,13,10,0
|
||||
|
||||
_passes_suffix db ' passes, ',0
|
||||
_seconds_suffix db ' seconds, ',0
|
||||
_bytes_suffix db ' bytes.',13,10,0
|
||||
|
||||
_include db 'INCLUDE',0
|
||||
|
||||
_counter db 4,'0000'
|
||||
|
||||
_mode dd NORMAL_MODE
|
||||
_run_outfile dd 0
|
||||
bGenerateDebugInfo db 0
|
||||
|
||||
sub_table:
|
||||
times $41 db $00
|
||||
times $1A db $20
|
||||
times $25 db $00
|
||||
times $10 db $20
|
||||
times $30 db $00
|
||||
times $10 db $50
|
||||
times $04 db $00,$01
|
||||
times $08 db $00
|
||||
|
||||
;include_debug_strings
|
||||
|
||||
params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
|
||||
program_end:
|
||||
rb 1000h
|
||||
|
||||
align 4
|
||||
|
||||
include 'variable.inc'
|
||||
|
||||
program_base dd ?
|
||||
buffer_address dd ?
|
||||
memory_setting dd ?
|
||||
start_time dd ?
|
||||
memblock dd ?
|
||||
|
||||
predefinitions rb 1000h
|
||||
|
||||
dbgfilename rb MAX_PATH+4
|
||||
|
||||
sc system_colors
|
||||
max_handles = 8
|
||||
fileinfos rb (4+20+MAX_PATH)*max_handles
|
||||
fileinfos_end:
|
||||
pinfo process_information
|
||||
|
||||
align 1000h
|
||||
rb 1000h
|
||||
stacktop:
|
@@ -1,53 +0,0 @@
|
||||
center fix false
|
||||
SYSTEMCOLORS fix sc
|
||||
PROCESSINFO fix pinfo
|
||||
|
||||
macro get_sys_colors wnd_skin,font_1 {
|
||||
mcall 48,3,SYSTEMCOLORS,sizeof.system_colors
|
||||
if wnd_skin <> 0
|
||||
or [SYSTEMCOLORS+system_colors.work],0x03000000
|
||||
end if
|
||||
if font_1 <> 0
|
||||
or [SYSTEMCOLORS+system_colors.grab_text],0x10000000
|
||||
end if
|
||||
}
|
||||
|
||||
macro draw_caption _edx,_esi {
|
||||
mov edx,_edx
|
||||
mov esi,_esi
|
||||
call __draw_caption
|
||||
}
|
||||
|
||||
macro mmov reg,a1,a2 {
|
||||
mov reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro madd reg,a1,a2 {
|
||||
add reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro msub reg,a1,a2 {
|
||||
sub reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro jmpe reg,def,[val,lab] {
|
||||
forward
|
||||
cmp reg,val
|
||||
je lab
|
||||
common
|
||||
if ~def eq
|
||||
jmp def
|
||||
end if
|
||||
}
|
||||
|
||||
macro func name {
|
||||
if used name
|
||||
name:
|
||||
}
|
||||
|
||||
macro endf {
|
||||
end if
|
||||
}
|
||||
|
||||
@^ fix macro comment {
|
||||
^@ fix }
|
File diff suppressed because it is too large
Load Diff
@@ -1,51 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
_out_of_memory db 'out of memory',0
|
||||
_stack_overflow db 'out of stack space',0
|
||||
_main_file_not_found db 'source file not found',0
|
||||
_unexpected_end_of_file db 'unexpected end of file',0
|
||||
_code_cannot_be_generated db 'code cannot be generated',0
|
||||
_format_limitations_exceeded db 'format limitations exceeded',0
|
||||
_invalid_definition db 'invalid definition provided',0
|
||||
_write_failed db 'write failed',0
|
||||
_file_not_found db 'file not found',0
|
||||
_error_reading_file db 'error reading file',0
|
||||
_invalid_file_format db 'invalid file format',0
|
||||
_invalid_macro_arguments db 'invalid macro arguments',0
|
||||
_incomplete_macro db 'incomplete macro',0
|
||||
_unexpected_characters db 'unexpected characters',0
|
||||
_invalid_argument db 'invalid argument',0
|
||||
_illegal_instruction db 'illegal instruction',0
|
||||
_invalid_operand db 'invalid operand',0
|
||||
_invalid_operand_size db 'invalid size of operand',0
|
||||
_operand_size_not_specified db 'operand size not specified',0
|
||||
_operand_sizes_do_not_match db 'operand sizes do not match',0
|
||||
_invalid_address_size db 'invalid size of address value',0
|
||||
_address_sizes_do_not_agree db 'address sizes do not agree',0
|
||||
_prefix_conflict db 'disallowed combination of registers',0
|
||||
_long_immediate_not_encodable db 'not encodable with long immediate',0
|
||||
_relative_jump_out_of_range db 'relative jump out of range',0
|
||||
_invalid_expression db 'invalid expression',0
|
||||
_invalid_address db 'invalid address',0
|
||||
_invalid_value db 'invalid value',0
|
||||
_value_out_of_range db 'value out of range',0
|
||||
_undefined_symbol db 'undefined symbol',0
|
||||
_symbol_out_of_scope_1 db 'symbol',0
|
||||
_symbol_out_of_scope_2 db 'out of scope',0
|
||||
_invalid_use_of_symbol db 'invalid use of symbol',0
|
||||
_name_too_long db 'name too long',0
|
||||
_invalid_name db 'invalid name',0
|
||||
_reserved_word_used_as_symbol db 'reserved word used as symbol',0
|
||||
_symbol_already_defined db 'symbol already defined',0
|
||||
_missing_end_quote db 'missing end quote',0
|
||||
_missing_end_directive db 'missing end directive',0
|
||||
_unexpected_instruction db 'unexpected instruction',0
|
||||
_extra_characters_on_line db 'extra characters on line',0
|
||||
_section_not_aligned_enough db 'section is not aligned enough',0
|
||||
_setting_already_specified db 'setting already specified',0
|
||||
_data_already_defined db 'data already defined',0
|
||||
_too_many_repeats db 'too many repeats',0
|
||||
_invoked_error db 'error directive invoked in source file',0
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,180 +0,0 @@
|
||||
|
||||
; Macroinstructions for defining data structures
|
||||
|
||||
macro struct name
|
||||
{ fields@struct equ name
|
||||
match child parent, name \{ fields@struct equ child,fields@\#parent \}
|
||||
sub@struct equ
|
||||
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \}
|
||||
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \}
|
||||
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \}
|
||||
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \}
|
||||
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \}
|
||||
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \}
|
||||
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \}
|
||||
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \}
|
||||
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \}
|
||||
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \}
|
||||
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \}
|
||||
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \}
|
||||
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \}
|
||||
macro db [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,db,<val> \}
|
||||
macro dw [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dw,<val> \}
|
||||
macro du [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,du,<val> \}
|
||||
macro dd [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dd,<val> \}
|
||||
macro dp [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dp,<val> \}
|
||||
macro dq [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dq,<val> \}
|
||||
macro dt [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dt,<val> \}
|
||||
macro rb count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,db,count dup (?) \}
|
||||
macro rw count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dw,count dup (?) \}
|
||||
macro rd count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dd,count dup (?) \}
|
||||
macro rp count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dp,count dup (?) \}
|
||||
macro rq count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dq,count dup (?) \}
|
||||
macro rt count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dt,count dup (?) \}
|
||||
macro union \{ fields@struct equ fields@struct,,union,<
|
||||
sub@struct equ union \}
|
||||
macro struct \{ fields@struct equ fields@struct,,substruct,<
|
||||
sub@struct equ substruct \}
|
||||
virtual at 0 }
|
||||
|
||||
macro ends
|
||||
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt
|
||||
restruc rb,rw,rd,rp,rq,rt
|
||||
purge db,dw,du,dd,dp,dq,dt
|
||||
purge rb,rw,rd,rp,rq,rt
|
||||
purge union,struct
|
||||
match name=,fields,fields@struct \\{ fields@struct equ
|
||||
make@struct name,fields
|
||||
fields@\\#name equ fields \\}
|
||||
end virtual \}
|
||||
match any, sub@struct \{ fields@struct equ fields@struct> \}
|
||||
restore sub@struct }
|
||||
|
||||
macro make@struct name,[field,type,def]
|
||||
{ common
|
||||
if $
|
||||
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah
|
||||
err
|
||||
end if
|
||||
local define
|
||||
define equ name
|
||||
forward
|
||||
local sub
|
||||
match , field \{ make@substruct type,name,sub def
|
||||
define equ define,.,sub, \}
|
||||
match any, field \{ define equ define,.#field,type,<def> \}
|
||||
common
|
||||
match fields, define \{ define@struct fields \} }
|
||||
|
||||
macro define@struct name,[field,type,def]
|
||||
{ common
|
||||
local list
|
||||
list equ
|
||||
forward
|
||||
if ~ field eq .
|
||||
name#field type def
|
||||
sizeof.#name#field = $ - name#field
|
||||
else
|
||||
rb sizeof.#type
|
||||
end if
|
||||
local value
|
||||
match any, list \{ list equ list, \}
|
||||
list equ list <value>
|
||||
common
|
||||
sizeof.#name = $
|
||||
restruc name
|
||||
match values, list \{
|
||||
struc name value \\{
|
||||
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\}
|
||||
match , fields@struct \\\{ label .
|
||||
forward
|
||||
match , value \\\\{ field type def \\\\}
|
||||
match any, value \\\\{ field type value
|
||||
if ~ field eq .
|
||||
rb sizeof.#name#field - ($-field)
|
||||
end if \\\\}
|
||||
common \\\} \\} \} }
|
||||
|
||||
macro enable@substruct
|
||||
{ macro make@substruct substruct,parent,name,[field,type,def]
|
||||
\{ \common
|
||||
\local define
|
||||
define equ parent,name
|
||||
\forward
|
||||
\local sub
|
||||
match , field \\{ match any, type \\\{ enable@substruct
|
||||
make@substruct type,name,sub def
|
||||
purge make@substruct
|
||||
define equ define,.,sub, \\\} \\}
|
||||
match any, field \\{ define equ define,.\#field,type,<def> \\}
|
||||
\common
|
||||
match fields, define \\{ define@\#substruct fields \\} \} }
|
||||
|
||||
enable@substruct
|
||||
|
||||
macro define@union parent,name,[field,type,def]
|
||||
{ common
|
||||
virtual at 0
|
||||
forward
|
||||
if ~ field eq .
|
||||
virtual at 0
|
||||
parent#field type def
|
||||
sizeof.#parent#field = $ - parent#field
|
||||
end virtual
|
||||
if sizeof.#parent#field > $
|
||||
rb sizeof.#parent#field - $
|
||||
end if
|
||||
else if sizeof.#type > $
|
||||
rb sizeof.#type - $
|
||||
end if
|
||||
common
|
||||
sizeof.#name = $
|
||||
end virtual
|
||||
struc name [value] \{ \common
|
||||
label .\#name
|
||||
last@union equ
|
||||
forward
|
||||
match any, last@union \\{ virtual at .\#name
|
||||
field type def
|
||||
end virtual \\}
|
||||
match , last@union \\{ match , value \\\{ field type def \\\}
|
||||
match any, value \\\{ field type value \\\} \\}
|
||||
last@union equ field
|
||||
common rb sizeof.#name - ($ - .\#name) \} }
|
||||
|
||||
macro define@substruct parent,name,[field,type,def]
|
||||
{ common
|
||||
virtual at 0
|
||||
forward
|
||||
if ~ field eq .
|
||||
parent#field type def
|
||||
sizeof.#parent#field = $ - parent#field
|
||||
else
|
||||
rb sizeof.#type
|
||||
end if
|
||||
local value
|
||||
common
|
||||
sizeof.#name = $
|
||||
end virtual
|
||||
struc name value \{
|
||||
label .\#name
|
||||
forward
|
||||
match , value \\{ field type def \\}
|
||||
match any, value \\{ field type value
|
||||
if ~ field eq .
|
||||
rb sizeof.#parent#field - ($-field)
|
||||
end if \\}
|
||||
common \} }
|
@@ -1,110 +0,0 @@
|
||||
symbol_dump:
|
||||
|
||||
push edi
|
||||
mov edx,[memory_end]
|
||||
symb_dump:
|
||||
cmp edx,[labels_list]
|
||||
jbe symbols_dumped
|
||||
sub edx,LABEL_STRUCTURE_SIZE
|
||||
cmp dword [edx+24],0
|
||||
je symb_dump ; do not dump anonymous symbols
|
||||
test byte [edx+8],1
|
||||
jz symb_dump ; do not dump symbols that didn't get defined
|
||||
mov ax,[current_pass]
|
||||
cmp ax,[edx+16]
|
||||
jne symb_dump
|
||||
test byte [edx+8],4 or 2
|
||||
jnz symb_dump ; do not dump assembly-time variables
|
||||
; do not dump variables defined with '='
|
||||
cmp word [edx+12], 0
|
||||
jnz symb_dump ; do not dump register-based variables
|
||||
|
||||
mov al, '0'
|
||||
stosb
|
||||
mov al, 'x'
|
||||
stosb
|
||||
mov eax, [edx+4]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
jz .nohigh
|
||||
inc ecx
|
||||
@@:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop @b
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
jmp .low
|
||||
.nohigh:
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
inc ecx
|
||||
.low:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop .low
|
||||
|
||||
mov al, ' '
|
||||
stosb
|
||||
|
||||
mov esi,[edx+24]
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movsb
|
||||
|
||||
mov ax,0A0Dh
|
||||
stosw
|
||||
|
||||
jmp symb_dump
|
||||
|
||||
symbols_dumped:
|
||||
mov edx,dbgfilename
|
||||
push esi edi
|
||||
mov esi, outfile
|
||||
mov edi, edx
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @b
|
||||
lea ecx, [edi-1]
|
||||
@@:
|
||||
dec edi
|
||||
cmp edi, edx
|
||||
jb @f
|
||||
cmp byte [edi], '/'
|
||||
jz @f
|
||||
cmp byte [edi], '.'
|
||||
jnz @b
|
||||
mov ecx, edi
|
||||
@@:
|
||||
mov dword [ecx], '.dbg'
|
||||
mov byte [ecx+4], 0
|
||||
pop edi esi
|
||||
call create
|
||||
mov edx,[esp]
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
call close
|
||||
pop edi
|
||||
|
||||
ret
|
@@ -1,573 +0,0 @@
|
||||
; flat assembler
|
||||
; Copyright (c) 1999-2007, Tomasz Grysztar
|
||||
; All rights reserved.
|
||||
|
||||
struc FILEIO
|
||||
{ .cmd dd ?
|
||||
.offset dd ?
|
||||
dd ?
|
||||
.count dd ?
|
||||
.buff dd ?
|
||||
db ?
|
||||
.name dd ?
|
||||
};
|
||||
|
||||
struc FILEINFO
|
||||
{ .attr dd ?
|
||||
.flags dd ?
|
||||
.cr_time dd ?
|
||||
.cr_date dd ?
|
||||
.acc_time dd ?
|
||||
.acc_date dd ?
|
||||
.mod_time dd ?
|
||||
.mod_date dd ?
|
||||
.size dd ?
|
||||
}
|
||||
|
||||
|
||||
|
||||
;file_info_open: dd 0,0,0xffffff,0x20000,0xf0000
|
||||
fullpath_open: ; db '/RD/1/EXAMPLE.ASM'
|
||||
times MAX_PATH db 0
|
||||
|
||||
|
||||
;file_info_write: dd 1,0,0,0,0xf0000
|
||||
fullpath_write:; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_start:
|
||||
dd 7
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
fullpath_start: ; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_debug:
|
||||
dd 7
|
||||
dd 0
|
||||
dd fullpath_start
|
||||
dd 0, 0
|
||||
db '/SYS/DEVELOP/MTDBG',0
|
||||
|
||||
_ramdisk db '/RD/1/'
|
||||
filepos dd 0x0
|
||||
|
||||
|
||||
init_memory:
|
||||
|
||||
mov ecx, 16*1024*1024
|
||||
|
||||
allocate_memory:
|
||||
mov [memory_setting],ecx
|
||||
mcall 68, 12
|
||||
or eax,eax
|
||||
jz out_of_memory
|
||||
mov [additional_memory],eax
|
||||
add eax,[memory_setting]
|
||||
mov [memory_end],eax
|
||||
mov eax,[memory_setting]
|
||||
shr eax,2
|
||||
add eax,[additional_memory]
|
||||
mov [additional_memory_end],eax
|
||||
mov [memory_start],eax
|
||||
ret
|
||||
|
||||
exit_program:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
mcall 68, 13, [memblock]
|
||||
jmp still
|
||||
@@:
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
make_timestamp:
|
||||
push ebx
|
||||
mcall 26,9
|
||||
imul eax,10
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
get_environment_variable:
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,edi
|
||||
cmp ecx,7
|
||||
jb out_of_memory
|
||||
cmp dword[esi],'INCL'
|
||||
jne .finish
|
||||
mov esi,_ramdisk
|
||||
mov ecx,6
|
||||
cld
|
||||
rep movsb
|
||||
.finish:
|
||||
; stc
|
||||
ret
|
||||
|
||||
alloc_handle:
|
||||
call make_fullpaths
|
||||
mov ebx, fileinfos+4
|
||||
@@:
|
||||
cmp dword [ebx], -1
|
||||
jz .found
|
||||
add ebx, 4+20+MAX_PATH
|
||||
cmp ebx, fileinfos_end
|
||||
jb @b
|
||||
stc
|
||||
ret
|
||||
.found:
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
push esi edi ecx
|
||||
mov esi, fullpath_open
|
||||
lea edi, [ebx+20]
|
||||
mov ecx, MAX_PATH
|
||||
rep movsb
|
||||
pop ecx edi esi
|
||||
ret ; CF=0
|
||||
|
||||
create:
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
and dword [ebx-4], 0
|
||||
mov dword [ebx], 2
|
||||
.ret:
|
||||
ret
|
||||
|
||||
|
||||
open:
|
||||
; call make_fullpaths
|
||||
|
||||
;; mov eax,fullpath_open
|
||||
;; DEBUGF '"%s"\n',eax
|
||||
|
||||
; mov dword[file_info_open+8],-1
|
||||
; mcall 58,file_info_open
|
||||
; or eax,eax ; found
|
||||
; jz @f
|
||||
; cmp eax,6
|
||||
; jne file_error
|
||||
;@@: mov [filesize],ebx
|
||||
; clc
|
||||
; ret
|
||||
;file_error:
|
||||
; stc
|
||||
; ret
|
||||
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
mov dword [ebx], 5
|
||||
and dword [ebx+12], 0
|
||||
mov dword [ebx+16], fileinfo
|
||||
mov eax, 70
|
||||
push ebx
|
||||
mcall
|
||||
pop ebx
|
||||
test eax, eax
|
||||
jnz .fail
|
||||
mov eax, [fileinfo.size]
|
||||
mov [ebx-4], eax
|
||||
and dword [ebx], 0
|
||||
.ret:
|
||||
ret
|
||||
.fail:
|
||||
or dword [ebx], -1 ; close handle
|
||||
stc
|
||||
ret
|
||||
|
||||
read:
|
||||
; pusha
|
||||
; mov edi,edx
|
||||
; mov esi,[filepos]
|
||||
; add esi,0x20000
|
||||
; cld
|
||||
; rep movsb
|
||||
; popa
|
||||
;; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
test eax, eax
|
||||
jz .ok
|
||||
cmp eax, 6
|
||||
jz .ok
|
||||
stc
|
||||
.ok:
|
||||
ret
|
||||
|
||||
close:
|
||||
or dword [ebx], -1
|
||||
ret
|
||||
|
||||
|
||||
; ebx file handle
|
||||
; ecx count of bytes to write
|
||||
; edx pointer to buffer
|
||||
write:
|
||||
; pusha
|
||||
; mov [file_info_write+8],ecx
|
||||
; mov [file_info_write+12],edx
|
||||
; mov [filesize],edx
|
||||
; mov eax,58
|
||||
; mov ebx,file_info_write
|
||||
; mcall
|
||||
; popa
|
||||
; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
mov byte [ebx], 3
|
||||
cmp eax, 1
|
||||
cmc
|
||||
ret
|
||||
|
||||
make_fullpaths:
|
||||
pusha
|
||||
push edx
|
||||
|
||||
mov esi,path ; open
|
||||
; DEBUGF " '%s'",esi
|
||||
mov edi,fullpath_open
|
||||
cld
|
||||
newc1:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc1
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_open
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; write
|
||||
mov edi,fullpath_write
|
||||
cld
|
||||
newc2:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc2
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_write
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; start
|
||||
mov edi,fullpath_start
|
||||
cld
|
||||
newc3:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc3
|
||||
; mov esi,[esp]
|
||||
pop esi
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_start
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
; add esp,4
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
|
||||
lseek:
|
||||
cmp al,0
|
||||
jnz @f
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
@@: cmp al,2
|
||||
jnz @f
|
||||
mov eax, [ebx-4]
|
||||
mov [ebx+4], eax
|
||||
and dword [ebx+8], 0
|
||||
@@: add dword [ebx+4], edx
|
||||
adc dword [ebx+8], 0
|
||||
ret
|
||||
|
||||
display_character:
|
||||
pusha
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
cmp dl,13
|
||||
jz dc2
|
||||
cmp dl,0xa
|
||||
jnz dc1
|
||||
and [textxy],0x0000FFFF
|
||||
add [textxy], 7 shl 16 +53 and 0xFFFF0000 + 10
|
||||
dc2:
|
||||
popa
|
||||
ret
|
||||
dc1:
|
||||
mov eax,[textxy]
|
||||
cmp ax,word[bottom_right]
|
||||
ja dc2
|
||||
shr eax,16
|
||||
cmp ax,word[bottom_right+2]
|
||||
ja dc2
|
||||
mov [dc],dl
|
||||
mcall 4,[textxy],[sc.work_text],dc,1
|
||||
add [textxy],0x00060000
|
||||
popa
|
||||
ret
|
||||
@@:
|
||||
mov eax,63
|
||||
mov ebx,1
|
||||
mov cl,dl
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
display_string:
|
||||
pusha
|
||||
@@:
|
||||
cmp byte[esi],0
|
||||
je @f
|
||||
mov dl,[esi]
|
||||
call display_character
|
||||
add esi,1
|
||||
jmp @b
|
||||
@@:
|
||||
popa
|
||||
ret
|
||||
|
||||
display_number:
|
||||
push ebx
|
||||
mov ecx,1000000000
|
||||
xor edx,edx
|
||||
xor bl,bl
|
||||
display_loop:
|
||||
div ecx
|
||||
push edx
|
||||
cmp ecx,1
|
||||
je display_digit
|
||||
or bl,bl
|
||||
jnz display_digit
|
||||
or al,al
|
||||
jz digit_ok
|
||||
not bl
|
||||
display_digit:
|
||||
mov dl,al
|
||||
add dl,30h
|
||||
push ebx ecx
|
||||
call display_character
|
||||
pop ecx ebx
|
||||
digit_ok:
|
||||
mov eax,ecx
|
||||
xor edx,edx
|
||||
mov ecx,10
|
||||
div ecx
|
||||
mov ecx,eax
|
||||
pop eax
|
||||
or ecx,ecx
|
||||
jnz display_loop
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
display_user_messages:
|
||||
; push [skinh]
|
||||
; pop [textxy]
|
||||
; add [textxy], 7 shl 16 +53
|
||||
mov [displayed_count],0
|
||||
call show_display_buffer
|
||||
cmp [displayed_count],1
|
||||
jb line_break_ok
|
||||
je make_line_break
|
||||
mov ax,word[last_displayed]
|
||||
cmp ax,0A0Dh
|
||||
je line_break_ok
|
||||
cmp ax,0D0Ah
|
||||
je line_break_ok
|
||||
make_line_break:
|
||||
mov esi,lf
|
||||
call display_string
|
||||
line_break_ok:
|
||||
ret
|
||||
|
||||
display_block:
|
||||
pusha
|
||||
@@: mov dl,[esi]
|
||||
call display_character
|
||||
inc esi
|
||||
loop @b
|
||||
popa
|
||||
ret
|
||||
|
||||
fatal_error:
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
mov esi,lf
|
||||
call display_string
|
||||
mov al,0FFh
|
||||
jmp exit_program
|
||||
|
||||
assembler_error:
|
||||
call display_user_messages
|
||||
push dword 0
|
||||
mov ebx,[current_line]
|
||||
get_error_lines:
|
||||
push ebx
|
||||
test byte [ebx+7],80h
|
||||
jz display_error_line
|
||||
mov edx,ebx
|
||||
find_definition_origin:
|
||||
mov edx,[edx+12]
|
||||
test byte [edx+7],80h
|
||||
jnz find_definition_origin
|
||||
push edx
|
||||
mov ebx,[ebx+8]
|
||||
jmp get_error_lines
|
||||
display_error_line:
|
||||
mov esi,[ebx]
|
||||
call display_string
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
mov eax,[ebx+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
pop esi
|
||||
cmp ebx,esi
|
||||
je line_number_ok
|
||||
mov dl,20h
|
||||
call display_character
|
||||
push esi
|
||||
mov esi,[esi]
|
||||
movzx ecx,byte [esi]
|
||||
inc esi
|
||||
call display_block
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
pop esi
|
||||
mov eax,[esi+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
line_number_ok:
|
||||
mov esi,line_data_start
|
||||
call display_string
|
||||
mov esi,ebx
|
||||
mov edx,[esi]
|
||||
call open
|
||||
mov al,2
|
||||
xor edx,edx
|
||||
call lseek
|
||||
mov edx,[esi+8]
|
||||
sub eax,edx
|
||||
push eax
|
||||
xor al,al
|
||||
call lseek
|
||||
mov ecx,[esp]
|
||||
mov edx,[additional_memory]
|
||||
lea eax,[edx+ecx]
|
||||
cmp eax,[additional_memory_end]
|
||||
ja out_of_memory
|
||||
call read
|
||||
call close
|
||||
pop ecx
|
||||
mov esi,[additional_memory]
|
||||
get_line_data:
|
||||
mov al,[esi]
|
||||
cmp al,0Ah
|
||||
je display_line_data
|
||||
cmp al,0Dh
|
||||
je display_line_data
|
||||
cmp al,1Ah
|
||||
je display_line_data
|
||||
or al,al
|
||||
jz display_line_data
|
||||
inc esi
|
||||
loop get_line_data
|
||||
display_line_data:
|
||||
mov ecx,esi
|
||||
mov esi,[additional_memory]
|
||||
sub ecx,esi
|
||||
call display_block
|
||||
mov esi,cr_lf
|
||||
call display_string
|
||||
pop ebx
|
||||
or ebx,ebx
|
||||
jnz display_error_line
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
jmp exit_program
|
||||
|
||||
align 4
|
||||
fileinfo FILEINFO
|
||||
|
||||
character db ?,0
|
||||
bytes_count dd ?
|
||||
|
||||
textxy dd 0x000500A0
|
||||
dc db 0x0
|
||||
filesize dd 0x0
|
||||
|
||||
displayed_count dd ?
|
||||
last_displayed rb 2
|
||||
|
||||
error_prefix db 'error: ',0
|
||||
error_suffix db '.',0
|
||||
line_data_start db ':'
|
||||
cr_lf db 0Dh,0Ah,0
|
||||
line_number_start db ' [',0
|
||||
|
||||
macro dm string { db string,0 }
|
File diff suppressed because it is too large
Load Diff
@@ -1,130 +0,0 @@
|
||||
|
||||
; flat assembler core variables
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
; Variables which have to be set up by interface:
|
||||
|
||||
memory_start dd ?
|
||||
memory_end dd ?
|
||||
|
||||
additional_memory dd ?
|
||||
additional_memory_end dd ?
|
||||
|
||||
stack_limit dd ?
|
||||
|
||||
input_file dd ?
|
||||
output_file dd ?
|
||||
symbols_file dd ?
|
||||
|
||||
passes_limit dw ?
|
||||
|
||||
; Internal core variables:
|
||||
|
||||
current_pass dw ?
|
||||
|
||||
include_paths dd ?
|
||||
free_additional_memory dd ?
|
||||
source_start dd ?
|
||||
code_start dd ?
|
||||
code_size dd ?
|
||||
real_code_size dd ?
|
||||
written_size dd ?
|
||||
headers_size dd ?
|
||||
|
||||
current_line dd ?
|
||||
macro_line dd ?
|
||||
macro_block dd ?
|
||||
macro_block_line dd ?
|
||||
macro_block_line_number dd ?
|
||||
macro_symbols dd ?
|
||||
struc_name dd ?
|
||||
struc_label dd ?
|
||||
instant_macro_start dd ?
|
||||
parameters_end dd ?
|
||||
locals_counter rb 8
|
||||
current_locals_prefix dd ?
|
||||
anonymous_reverse dd ?
|
||||
anonymous_forward dd ?
|
||||
labels_list dd ?
|
||||
label_hash dd ?
|
||||
label_leaf dd ?
|
||||
hash_tree dd ?
|
||||
org_origin dq ?
|
||||
org_registers dd ?
|
||||
org_symbol dd ?
|
||||
org_start dd ?
|
||||
undefined_data_start dd ?
|
||||
undefined_data_end dd ?
|
||||
counter dd ?
|
||||
counter_limit dd ?
|
||||
error_info dd ?
|
||||
error_line dd ?
|
||||
error dd ?
|
||||
display_buffer dd ?
|
||||
structures_buffer dd ?
|
||||
number_start dd ?
|
||||
current_offset dd ?
|
||||
value dq ?
|
||||
fp_value rd 8
|
||||
adjustment dq ?
|
||||
symbol_identifier dd ?
|
||||
address_symbol dd ?
|
||||
address_high dd ?
|
||||
format_flags dd ?
|
||||
resolver_flags dd ?
|
||||
symbols_stream dd ?
|
||||
number_of_relocations dd ?
|
||||
number_of_sections dd ?
|
||||
stub_size dd ?
|
||||
stub_file dd ?
|
||||
current_section dd ?
|
||||
machine dw ?
|
||||
subsystem dw ?
|
||||
subsystem_version dd ?
|
||||
image_base dd ?
|
||||
image_base_high dd ?
|
||||
resource_data dd ?
|
||||
resource_size dd ?
|
||||
parenthesis_stack dd ?
|
||||
blocks_stack dd ?
|
||||
parsed_lines dd ?
|
||||
logical_value_parentheses dd ?
|
||||
file_extension dd ?
|
||||
|
||||
labels_type db ?
|
||||
code_type db ?
|
||||
virtual_data db ?
|
||||
|
||||
operand_size db ?
|
||||
size_override db ?
|
||||
operand_prefix db ?
|
||||
rex_prefix db ?
|
||||
opcode_prefix db ?
|
||||
base_code db ?
|
||||
extended_code db ?
|
||||
supplemental_code db ?
|
||||
postbyte_register db ?
|
||||
|
||||
immediate_size db ?
|
||||
mmx_size db ?
|
||||
jump_type db ?
|
||||
push_size db ?
|
||||
value_size db ?
|
||||
address_size db ?
|
||||
size_declared db ?
|
||||
value_undefined db ?
|
||||
value_type db ?
|
||||
compare_type db ?
|
||||
logical_value_wrapping db ?
|
||||
next_pass_needed db ?
|
||||
macro_status db ?
|
||||
segment_register db ?
|
||||
prefixed_instruction db ?
|
||||
fp_sign db ?
|
||||
fp_format db ?
|
||||
output_format db ?
|
||||
|
||||
characters rb 100h
|
||||
converted rb 100h
|
||||
message rb 200h
|
@@ -1,39 +0,0 @@
|
||||
|
||||
; flat assembler version 1.68
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
;
|
||||
; This programs is free for commercial and non-commercial use as long as
|
||||
; the following conditions are adhered to.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are
|
||||
; met:
|
||||
;
|
||||
; 1. Redistributions of source code must retain the above copyright notice,
|
||||
; this list of conditions and the following disclaimer.
|
||||
; 2. Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;
|
||||
; The licence and distribution terms for any publically available
|
||||
; version or derivative of this code cannot be changed. i.e. this code
|
||||
; cannot simply be copied and put under another distribution licence
|
||||
; (including the GNU Public Licence).
|
||||
|
||||
VERSION_STRING equ "1.68"
|
||||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 68
|
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
add_include(tup.getvariantdir())
|
||||
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
|
||||
tup.rule({"fasm.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "fasm")
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm -m 16384 fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@kpack fasm
|
||||
@pause
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm -m 16384 fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@kpack fasm
|
||||
@pause
|
@@ -1,194 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
out_of_memory:
|
||||
push _out_of_memory
|
||||
jmp fatal_error
|
||||
stack_overflow:
|
||||
push _stack_overflow
|
||||
jmp fatal_error
|
||||
main_file_not_found:
|
||||
push _main_file_not_found
|
||||
jmp fatal_error
|
||||
write_failed:
|
||||
push _write_failed
|
||||
jmp fatal_error
|
||||
|
||||
unexpected_end_of_file:
|
||||
push _unexpected_end_of_file
|
||||
jmp general_error
|
||||
code_cannot_be_generated:
|
||||
push _code_cannot_be_generated
|
||||
jmp general_error
|
||||
format_limitations_exceeded:
|
||||
push _format_limitations_exceeded
|
||||
jmp general_error
|
||||
invalid_definition:
|
||||
push _invalid_definition
|
||||
general_error:
|
||||
cmp [symbols_file],0
|
||||
je fatal_error
|
||||
call dump_preprocessed_source
|
||||
jmp fatal_error
|
||||
|
||||
file_not_found:
|
||||
push _file_not_found
|
||||
jmp error_with_source
|
||||
error_reading_file:
|
||||
push _error_reading_file
|
||||
jmp error_with_source
|
||||
invalid_file_format:
|
||||
push _invalid_file_format
|
||||
jmp error_with_source
|
||||
invalid_macro_arguments:
|
||||
push _invalid_macro_arguments
|
||||
jmp error_with_source
|
||||
incomplete_macro:
|
||||
push _incomplete_macro
|
||||
jmp error_with_source
|
||||
unexpected_characters:
|
||||
push _unexpected_characters
|
||||
jmp error_with_source
|
||||
invalid_argument:
|
||||
push _invalid_argument
|
||||
jmp error_with_source
|
||||
illegal_instruction:
|
||||
push _illegal_instruction
|
||||
jmp error_with_source
|
||||
invalid_operand:
|
||||
push _invalid_operand
|
||||
jmp error_with_source
|
||||
invalid_operand_size:
|
||||
push _invalid_operand_size
|
||||
jmp error_with_source
|
||||
operand_size_not_specified:
|
||||
push _operand_size_not_specified
|
||||
jmp error_with_source
|
||||
operand_sizes_do_not_match:
|
||||
push _operand_sizes_do_not_match
|
||||
jmp error_with_source
|
||||
invalid_address_size:
|
||||
push _invalid_address_size
|
||||
jmp error_with_source
|
||||
address_sizes_do_not_agree:
|
||||
push _address_sizes_do_not_agree
|
||||
jmp error_with_source
|
||||
disallowed_combination_of_registers:
|
||||
push _disallowed_combination_of_registers
|
||||
jmp error_with_source
|
||||
long_immediate_not_encodable:
|
||||
push _long_immediate_not_encodable
|
||||
jmp error_with_source
|
||||
relative_jump_out_of_range:
|
||||
push _relative_jump_out_of_range
|
||||
jmp error_with_source
|
||||
invalid_expression:
|
||||
push _invalid_expression
|
||||
jmp error_with_source
|
||||
invalid_address:
|
||||
push _invalid_address
|
||||
jmp error_with_source
|
||||
invalid_value:
|
||||
push _invalid_value
|
||||
jmp error_with_source
|
||||
value_out_of_range:
|
||||
push _value_out_of_range
|
||||
jmp error_with_source
|
||||
undefined_symbol:
|
||||
mov edi,message
|
||||
mov esi,_undefined_symbol
|
||||
call copy_asciiz
|
||||
push message
|
||||
cmp [error_info],0
|
||||
je error_with_source
|
||||
mov esi,[error_info]
|
||||
mov esi,[esi+24]
|
||||
or esi,esi
|
||||
jz error_with_source
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
jmp error_with_source
|
||||
copy_asciiz:
|
||||
lods byte [esi]
|
||||
stos byte [edi]
|
||||
test al,al
|
||||
jnz copy_asciiz
|
||||
ret
|
||||
write_quoted_symbol_name:
|
||||
mov al,27h
|
||||
stosb
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movs byte [edi],[esi]
|
||||
mov ax,27h
|
||||
stosw
|
||||
ret
|
||||
symbol_out_of_scope:
|
||||
mov edi,message
|
||||
mov esi,_symbol_out_of_scope_1
|
||||
call copy_asciiz
|
||||
cmp [error_info],0
|
||||
je finish_symbol_out_of_scope_message
|
||||
mov esi,[error_info]
|
||||
mov esi,[esi+24]
|
||||
or esi,esi
|
||||
jz finish_symbol_out_of_scope_message
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
finish_symbol_out_of_scope_message:
|
||||
mov byte [edi-1],20h
|
||||
mov esi,_symbol_out_of_scope_2
|
||||
call copy_asciiz
|
||||
push message
|
||||
jmp error_with_source
|
||||
invalid_use_of_symbol:
|
||||
push _invalid_use_of_symbol
|
||||
jmp error_with_source
|
||||
name_too_long:
|
||||
push _name_too_long
|
||||
jmp error_with_source
|
||||
invalid_name:
|
||||
push _invalid_name
|
||||
jmp error_with_source
|
||||
reserved_word_used_as_symbol:
|
||||
push _reserved_word_used_as_symbol
|
||||
jmp error_with_source
|
||||
symbol_already_defined:
|
||||
push _symbol_already_defined
|
||||
jmp error_with_source
|
||||
missing_end_quote:
|
||||
push _missing_end_quote
|
||||
jmp error_with_source
|
||||
missing_end_directive:
|
||||
push _missing_end_directive
|
||||
jmp error_with_source
|
||||
unexpected_instruction:
|
||||
push _unexpected_instruction
|
||||
jmp error_with_source
|
||||
extra_characters_on_line:
|
||||
push _extra_characters_on_line
|
||||
jmp error_with_source
|
||||
section_not_aligned_enough:
|
||||
push _section_not_aligned_enough
|
||||
jmp error_with_source
|
||||
setting_already_specified:
|
||||
push _setting_already_specified
|
||||
jmp error_with_source
|
||||
data_already_defined:
|
||||
push _data_already_defined
|
||||
jmp error_with_source
|
||||
too_many_repeats:
|
||||
push _too_many_repeats
|
||||
jmp error_with_source
|
||||
assertion_failed:
|
||||
push _assertion_failed
|
||||
jmp error_with_source
|
||||
invoked_error:
|
||||
push _invoked_error
|
||||
error_with_source:
|
||||
cmp [symbols_file],0
|
||||
je assembler_error
|
||||
call dump_preprocessed_source
|
||||
call restore_preprocessed_source
|
||||
jmp assembler_error
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,758 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; flat assembler source ;;
|
||||
;; Copyright (c) 1999-2020, Tomasz Grysztar ;;
|
||||
;; All rights reserved. ;;
|
||||
;; ;;
|
||||
;; KolibriOS port by KolibriOS Team ;;
|
||||
;; Menuet port by VT ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
NORMAL_MODE = 8
|
||||
CONSOLE_MODE = 32
|
||||
|
||||
MAGIC1 = 6*(text.line_size-1)+14
|
||||
MAX_PATH = 100
|
||||
|
||||
DEFAULT_WIN_W = 450
|
||||
DEFAULT_WIN_H = 350
|
||||
LINE_H = 25
|
||||
RIGHT_BTN_W = 80
|
||||
|
||||
APP_MEMORY = 0x00800000
|
||||
|
||||
;; Menuet header
|
||||
|
||||
appname equ "flat assembler "
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; program start
|
||||
dd program_end ; program image size
|
||||
dd stacktop ; required amount of memory
|
||||
dd stacktop ; stack
|
||||
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/box_lib.mac'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../load_lib.mac'
|
||||
@use_library
|
||||
|
||||
center fix true
|
||||
;---------------------------------------------------------------------
|
||||
START: ; Start of execution
|
||||
mov edi, fileinfos
|
||||
mov ecx, (fileinfos_end-fileinfos)/4
|
||||
or eax, -1
|
||||
rep stosd
|
||||
push 68
|
||||
pop eax
|
||||
push 11
|
||||
pop ebx
|
||||
mcall
|
||||
|
||||
cmp [params],0
|
||||
jz start_1
|
||||
|
||||
;---------GerdtR
|
||||
or ecx,-1
|
||||
mov esi,params
|
||||
cmp byte[esi],' '
|
||||
jne @f
|
||||
mov edi,esi
|
||||
mov al,' '
|
||||
repe scasb
|
||||
mov esi,edi
|
||||
dec esi
|
||||
@@:
|
||||
|
||||
mov edi,dbgWord
|
||||
@@: lodsb
|
||||
scasb
|
||||
jne NoOutDebugInfo
|
||||
cmp byte[edi],0
|
||||
jnz @b
|
||||
|
||||
cmp byte[esi],' '
|
||||
jne NoOutDebugInfo
|
||||
|
||||
mov edi,esi
|
||||
mov al,' '
|
||||
repe scasb
|
||||
mov esi,edi
|
||||
dec esi
|
||||
|
||||
mov edi,params
|
||||
@@: lodsb
|
||||
stosb
|
||||
test al,al
|
||||
jnz @b
|
||||
|
||||
; mov [bGenerateDebugInfo], 1
|
||||
or dword[ch1_dbg.flags],10b
|
||||
|
||||
|
||||
NoOutDebugInfo:
|
||||
;---------/GerdtR
|
||||
|
||||
|
||||
|
||||
|
||||
mov ecx,10
|
||||
mov eax,' '
|
||||
mov edi,infile
|
||||
push ecx
|
||||
cld
|
||||
rep stosd
|
||||
mov ecx,[esp]
|
||||
mov edi,outfile
|
||||
rep stosd
|
||||
pop ecx
|
||||
mov edi,path
|
||||
rep stosd
|
||||
|
||||
mov esi,params
|
||||
; DEBUGF "params: %s\n",esi
|
||||
mov edi,infile
|
||||
call mov_param_str
|
||||
; mov edi,infile
|
||||
; DEBUGF " input: %s\n",edi
|
||||
mov edi,outfile
|
||||
call mov_param_str
|
||||
; mov edi,outfile
|
||||
; DEBUGF "output: %s\n",edi
|
||||
mov edi,path
|
||||
call mov_param_str
|
||||
; mov edi,path
|
||||
; DEBUGF " path: %s\n",edi
|
||||
dec esi
|
||||
cmp [esi], dword ',run'
|
||||
jne @f
|
||||
mov [_run_outfile],1
|
||||
@@:
|
||||
cmp [esi], dword ',dbg'
|
||||
jne @f
|
||||
mov [_run_outfile],2
|
||||
@@:
|
||||
mov [_mode],CONSOLE_MODE
|
||||
jmp start
|
||||
;---------------------------------------------------------------------
|
||||
start_1:
|
||||
;sys_
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
cmp eax,-1
|
||||
jne @f
|
||||
mcall -1 ;exit if not open box_lib.obj
|
||||
@@:
|
||||
mcall 40,0x80000027 ;<3B><>᪠ <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> ᮡ<>⨩
|
||||
;---------------------------------------------------------------------
|
||||
init_checkboxes2 ch1_dbg,ch1_dbg+ch_struc_size
|
||||
;---------------------------------------------------------------------
|
||||
; OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call dword [OpenDialog_Init]
|
||||
;---------------------------------------------------------------------
|
||||
red: ; Redraw
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
mcall 10 ; Wait here for event
|
||||
cmp al,6
|
||||
je call_mouse
|
||||
dec eax
|
||||
je red ; Redraw request
|
||||
dec eax
|
||||
jne button ; Button in buffer
|
||||
key: ; Key
|
||||
mcall 2 ; Read it and ignore
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
push dword edit2
|
||||
call [edit_box_key]
|
||||
push dword edit3
|
||||
call [edit_box_key]
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
call_mouse:
|
||||
call mouse
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button: ; Button in Window
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne noclose
|
||||
or eax,-1
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
noclose:
|
||||
cmp ah,5 ;press button for OpenDialog
|
||||
jne @f
|
||||
call fun_opn_dlg
|
||||
@@:
|
||||
cmp ah,2 ; Start compiling
|
||||
je start
|
||||
cmp ah,3 ; Start compiled file
|
||||
jnz norunout
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_start
|
||||
; xor ecx,ecx
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
norunout:
|
||||
cmp ah,4
|
||||
jnz norundebug
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_debug
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
norundebug:
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
push dword edit1
|
||||
call [edit_box_mouse]
|
||||
push dword edit2
|
||||
call [edit_box_mouse]
|
||||
push dword edit3
|
||||
call [edit_box_mouse]
|
||||
push dword ch1_dbg
|
||||
call [check_box_mouse]
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
pusha
|
||||
mcall 12,1 ; Start of draw
|
||||
|
||||
get_sys_colors 1,0
|
||||
edit_boxes_set_sys_color edit1,editboxes_end,sc
|
||||
;check_boxes_set_sys_color2 ch1_dbg,ch1_dbg+ch_struc_size,sc
|
||||
mov eax,[sc.work_text]
|
||||
or eax, 0x90000000
|
||||
mov [ch1_dbg.text_color], eax
|
||||
m2m [ch1_dbg.border_color], [sc.work_graph]
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
xor eax,eax
|
||||
xor esi,esi
|
||||
mcall ,<150,DEFAULT_WIN_W>,<150,DEFAULT_WIN_H>,edx,,title
|
||||
|
||||
mcall 9,PROCESSINFO,-1
|
||||
|
||||
mov eax,[PROCESSINFO+70] ;get status of window
|
||||
test eax,100b
|
||||
jne .end
|
||||
|
||||
WIN_MIN_W = 350
|
||||
WIN_MIN_H = 300
|
||||
|
||||
cmp dword[pinfo.client_box.width],WIN_MIN_W
|
||||
jge @f
|
||||
mcall 67,-1,-1,WIN_MIN_W+20,-1
|
||||
jmp .end
|
||||
@@:
|
||||
cmp dword[pinfo.client_box.height],WIN_MIN_H
|
||||
jge @f
|
||||
mcall 67,-1,-1,-1,WIN_MIN_H+50
|
||||
jmp .end
|
||||
@@:
|
||||
mpack ebx,[pinfo.client_box.width],RIGHT_BTN_W
|
||||
msub ebx,RIGHT_BTN_W+1,0
|
||||
mcall 8,ebx,<LINE_H*0+3,LINE_H-4>,ID_COMPILE_BTN,[sc.work_button]
|
||||
mcall ,ebx,<LINE_H*1+3,LINE_H-4>,ID_EXECUTE_BTN
|
||||
mcall ,ebx,<LINE_H*2+3,LINE_H-4>,ID_EXECDBG_BTN
|
||||
|
||||
mcall ,<5,62>,<LINE_H*2+3,LINE_H-5>,ID_OPENDLG_BTN
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, $10000000
|
||||
mcall 4,<6,LINE_H*0+6>,,text+text.line_size*0,text.line_size ;InFile
|
||||
mcall ,<6,LINE_H*1+6>,,text+text.line_size*1,esi ;OutFile
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, $10000000
|
||||
mcall ,<0,LINE_H*2+6>,,text+text.line_size*2,esi ;Path
|
||||
|
||||
mov ebx,[pinfo.client_box.width]
|
||||
sub ebx,RIGHT_BTN_W-12
|
||||
shl ebx,16
|
||||
add ebx,LINE_H/2-6
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, $10000000
|
||||
mcall ,ebx,ecx,s_compile,7
|
||||
add ebx,LINE_H
|
||||
mcall ,ebx,ecx,s_run
|
||||
add ebx,LINE_H
|
||||
mcall ,ebx,ecx,s_debug
|
||||
|
||||
mpack ebx,MAGIC1+6,1+ 14/2-3+ 14*0
|
||||
mov esi,[pinfo.client_box.width]
|
||||
sub esi,MAGIC1*2+6+3
|
||||
mov eax,esi
|
||||
mov cl,6
|
||||
div cl
|
||||
cmp al,MAX_PATH
|
||||
jbe @f
|
||||
mov al,MAX_PATH
|
||||
@@:
|
||||
movzx esi,al
|
||||
|
||||
call draw_messages
|
||||
|
||||
mov eax,dword [pinfo.client_box.width]
|
||||
sub eax,[edit1.left]
|
||||
sub eax,RIGHT_BTN_W+6
|
||||
mov dword[edit1.width],eax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov dword[edit2.width],eax
|
||||
mov dword[edit3.width],eax
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
push dword edit2
|
||||
call [edit_box_draw]
|
||||
push dword edit3
|
||||
call [edit_box_draw]
|
||||
push dword ch1_dbg
|
||||
call [check_box_draw]
|
||||
.end:
|
||||
mcall 12,2 ; End of Draw
|
||||
popa
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
bottom_right dd ?
|
||||
|
||||
align 4
|
||||
fun_opn_dlg: ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20>맮<EFBFBD><EBA7AE> OpenFile <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pushad
|
||||
copy_path open_dialog_name,communication_area_default_path,library_path,0
|
||||
mov [OpenDialog_data.type],0
|
||||
|
||||
xor al,al
|
||||
mov edi,dword [edit3.text]
|
||||
mov ecx,dword [edit3.max]
|
||||
cld
|
||||
repne scasb
|
||||
cmp byte[edi-2],'/'
|
||||
jne @f
|
||||
mov byte[edi-2],0 ;<3B> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>, <20><> <20><><EFBFBD><EFBFBD> 㪮<><E3AAAE>稢<EFBFBD><E7A8A2><EFBFBD> <20><> 1 ᨬ<><E1A8AC><EFBFBD>
|
||||
@@:
|
||||
push dword OpenDialog_data
|
||||
call dword [OpenDialog_Start]
|
||||
cmp [OpenDialog_data.status],2
|
||||
je @f
|
||||
|
||||
xor al,al
|
||||
mov edi,dword [edit3.text]
|
||||
mov ebx,edi ;copy text pointer
|
||||
mov ecx,dword [edit3.max]
|
||||
cld
|
||||
repne scasb
|
||||
cmp byte[edi-2],'/'
|
||||
jne .no_slash
|
||||
|
||||
dec edi ;<3B> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>, <20><> <20><><EFBFBD><EFBFBD> 㪮<><E3AAAE>稢<EFBFBD><E7A8A2><EFBFBD> <20><> 1 ᨬ<><E1A8AC><EFBFBD>
|
||||
.no_slash:
|
||||
mov byte[edi-1],'/' ;<3B>⠢<EFBFBD><E2A0A2> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>
|
||||
mov byte[edi],0 ;<3B><>१<EFBFBD><E0A5A7><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
sub edi,ebx ;edi = strlen(edit3.text)
|
||||
mov [edit3.size],edi
|
||||
mov [edit3.pos],edi
|
||||
|
||||
push dword [OpenDialog_data.filename_area]
|
||||
push dword edit1
|
||||
call dword [edit_box_set_text]
|
||||
|
||||
push dword [OpenDialog_data.filename_area]
|
||||
push dword edit2
|
||||
call dword [edit_box_set_text]
|
||||
|
||||
mov esi,[edit2.text]
|
||||
xor eax,eax
|
||||
cld
|
||||
.cycle:
|
||||
lodsb
|
||||
test eax,eax
|
||||
jnz .cycle
|
||||
|
||||
sub esi,5
|
||||
cmp esi,[edit2.text]
|
||||
jle .short_fn
|
||||
|
||||
mov byte[esi],0
|
||||
sub dword [edit2.size],4
|
||||
sub dword [edit2.pos],4
|
||||
|
||||
.short_fn:
|
||||
push dword edit1
|
||||
call dword [edit_box_draw]
|
||||
push dword edit2
|
||||
call dword [edit_box_draw]
|
||||
push dword edit3
|
||||
call dword [edit_box_draw]
|
||||
@@:
|
||||
popad
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_messages:
|
||||
mpack ebx,5,[pinfo.client_box.width]
|
||||
sub ebx,9
|
||||
mpack ecx,0,[pinfo.client_box.height]
|
||||
madd ecx, LINE_H*4,-( LINE_H*4+5)
|
||||
mov word[bottom_right+2],bx
|
||||
mov word[bottom_right],cx
|
||||
msub [bottom_right],7,11
|
||||
add [bottom_right],7 shl 16 + 53
|
||||
mcall 13,,,0xFeFefe ; clear work area
|
||||
|
||||
; draw top shadow
|
||||
push ecx
|
||||
mov cx,1
|
||||
mov edx,0xDADEDA
|
||||
mcall
|
||||
|
||||
; draw left shadow
|
||||
pop ecx
|
||||
push ebx
|
||||
mov bx,1
|
||||
mcall
|
||||
pop ebx
|
||||
|
||||
_cy = 0
|
||||
_sy = 2
|
||||
_cx = 4
|
||||
_sx = 6
|
||||
push ebx ecx
|
||||
mpack ebx,4,5
|
||||
add bx,[esp+_cx]
|
||||
mov ecx,[esp+_sy-2]
|
||||
mov cx,[esp+_sy]
|
||||
msub ecx,1,1
|
||||
mcall 38,,,[sc.work_graph]
|
||||
mov si,[esp+_cy]
|
||||
add cx,si
|
||||
shl esi,16
|
||||
add ecx,esi
|
||||
madd ecx,1,1
|
||||
mcall
|
||||
mpack ebx,4,4
|
||||
mov esi,[esp+_sy-2]
|
||||
mov si,cx
|
||||
mov ecx,esi
|
||||
mcall
|
||||
mov si,[esp+_cx]
|
||||
add bx,si
|
||||
shl esi,16
|
||||
add ebx,esi
|
||||
madd ebx,1,1
|
||||
mcall
|
||||
pop ecx ebx
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; DATA
|
||||
;---------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
text:
|
||||
db ' <20>唠<EFBFBD><E594A0>:'
|
||||
.line_size = $-text
|
||||
db '<27><>唠<EFBFBD><E594A0>:'
|
||||
db ' <20><><EFBFBD><EFBFBD>:'
|
||||
;db 'x'
|
||||
|
||||
s_compile db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.'
|
||||
s_run db ' <20><><EFBFBD><EFBFBD> '
|
||||
s_debug db '<27>⫠<EFBFBD><E2ABA0><EFBFBD>'
|
||||
s_dbgdescr db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⫠<EFBFBD><E2ABA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD>',0
|
||||
|
||||
|
||||
else
|
||||
text:
|
||||
db ' InFile:'
|
||||
.line_size = $-text
|
||||
db 'OutFile:'
|
||||
db ' Path:'
|
||||
;db 'x'
|
||||
|
||||
s_compile db 'COMPILE'
|
||||
s_run db ' RUN '
|
||||
s_debug db ' DEBUG '
|
||||
s_dbgdescr db 'Generate debug information',0
|
||||
|
||||
|
||||
end if
|
||||
|
||||
system_dir0 db '/sys/lib/'
|
||||
lib0_name db 'box_lib.obj',0
|
||||
|
||||
system_dir1 db '/sys/lib/'
|
||||
lib1_name db 'proc_lib.obj',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_box_lib:
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
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_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_proc_lib:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;---------------------------------------------------------------------
|
||||
;library structures
|
||||
l_libs_start:
|
||||
lib0 l_libs lib0_name, library_path, system_dir0, import_box_lib
|
||||
lib1 l_libs lib1_name, library_path, system_dir1, import_proc_lib
|
||||
load_lib_end:
|
||||
|
||||
edit1 edit_box 153, 72, 3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(outfile-infile-1), infile, mouse_dd, 0, 11,11
|
||||
edit2 edit_box 153, 72, LINE_H+3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
|
||||
edit3 edit_box 153, 72, LINE_H*2+3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path_end-path-1), path, mouse_dd, 0, 6,6
|
||||
editboxes_end:
|
||||
ch1_dbg check_box2 (5 shl 16)+15, ((LINE_H*3+3) shl 16)+15, 6, 0xffffff, 0x80ff, 0x10000000, s_dbgdescr,ch_flag_top
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd pinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_path dd path ;+16
|
||||
.dir_default_path dd default_dir ;+20
|
||||
.start_path dd library_path ;+24 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD>
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_path dd path ;+36 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
default_dir db '/rd/1',0 ;<3B><>४<EFBFBD><E0A5AA><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_name:
|
||||
db 'opendial',0
|
||||
communication_area_default_path:
|
||||
db '/rd/1/File managers/',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'ASM',0
|
||||
.end:
|
||||
db 0
|
||||
;---------------------------------------------------------------------
|
||||
mouse_dd dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Shift-<2D> <20> editbox
|
||||
;---------------------------------------------------------------------
|
||||
infile db 'example.asm'
|
||||
times MAX_PATH-$+infile db 0
|
||||
outfile db 'example'
|
||||
times MAX_PATH-$+outfile db 0
|
||||
path db '/rd/1//' ;OpenDialog <20><><EFBFBD> <20><><EFBFBD><EFBFBD>᪥ 㡨ࠥ<E3A1A8> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ᥣ<EFBFBD><E1A5A3>, <20><>⮬<EFBFBD> <><E1ABA5> 2
|
||||
times MAX_PATH-$+path db 0
|
||||
path_end:
|
||||
lf db 13,10,0
|
||||
;---------------------------------------------------------------------
|
||||
mov_param_str:
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
cmp al,','
|
||||
je @f
|
||||
stosb
|
||||
test al,al
|
||||
jnz @b
|
||||
@@:
|
||||
xor al,al
|
||||
stosb
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
start:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
call draw_messages
|
||||
mov [textxy],8 shl 16 + LINE_H*4+4
|
||||
@@:
|
||||
mov esi,_logo
|
||||
call display_string
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; Fasm native code
|
||||
;---------------------------------------------------------------------
|
||||
mov [input_file],infile
|
||||
mov [output_file],outfile
|
||||
|
||||
call init_memory
|
||||
|
||||
call make_timestamp
|
||||
mov [start_time],eax
|
||||
|
||||
call preprocessor
|
||||
call parser
|
||||
call assembler
|
||||
bt dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
|
||||
jae @f ;jz @f
|
||||
call symbol_dump
|
||||
@@:
|
||||
call formatter
|
||||
|
||||
call display_user_messages
|
||||
movzx eax,[current_pass]
|
||||
inc eax
|
||||
call display_number
|
||||
mov esi,_passes_suffix
|
||||
call display_string
|
||||
call make_timestamp
|
||||
sub eax,[start_time]
|
||||
xor edx,edx
|
||||
mov ebx,100
|
||||
div ebx
|
||||
or eax,eax
|
||||
jz display_bytes_count
|
||||
xor edx,edx
|
||||
mov ebx,10
|
||||
div ebx
|
||||
push edx
|
||||
call display_number
|
||||
mov dl,'.'
|
||||
call display_character
|
||||
pop eax
|
||||
call display_number
|
||||
mov esi,_seconds_suffix
|
||||
call display_string
|
||||
display_bytes_count:
|
||||
mov eax,[written_size]
|
||||
call display_number
|
||||
mov esi,_bytes_suffix
|
||||
call display_string
|
||||
xor al,al
|
||||
|
||||
cmp [_run_outfile],0
|
||||
je @f
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
xor ecx,ecx
|
||||
|
||||
cmp [_run_outfile],2 ; param is ',dbg'
|
||||
jne run
|
||||
mcall 70,file_info_debug
|
||||
jmp @f
|
||||
run:
|
||||
mcall 70,file_info_start
|
||||
@@:
|
||||
jmp exit_program
|
||||
;---------------------------------------------------------------------
|
||||
include 'system.inc'
|
||||
include 'version.inc'
|
||||
include 'errors.inc'
|
||||
include 'symbdump.inc'
|
||||
include 'preproce.inc'
|
||||
include 'parser.inc'
|
||||
include 'exprpars.inc'
|
||||
include 'assemble.inc'
|
||||
include 'exprcalc.inc'
|
||||
include 'formats.inc'
|
||||
include 'x86_64.inc'
|
||||
include 'avx.inc'
|
||||
include 'tables.inc'
|
||||
include 'messages.inc'
|
||||
;---------------------------------------------------------------------
|
||||
title db appname,VERSION_STRING,0
|
||||
|
||||
_logo db 'flat assembler version ',VERSION_STRING,13,10,0
|
||||
|
||||
_passes_suffix db ' passes, ',0
|
||||
_seconds_suffix db ' seconds, ',0
|
||||
_bytes_suffix db ' bytes.',13,10,0
|
||||
|
||||
_include db 'INCLUDE',0
|
||||
|
||||
_counter db 4,'0000'
|
||||
|
||||
_mode dd NORMAL_MODE
|
||||
_run_outfile dd 0
|
||||
;bGenerateDebugInfo db 0
|
||||
|
||||
dbgWord db '-d',0
|
||||
|
||||
sub_table:
|
||||
times $41 db $00
|
||||
times $1A db $20
|
||||
times $25 db $00
|
||||
times $10 db $20
|
||||
times $30 db $00
|
||||
times $10 db $50
|
||||
times $04 db $00,$01
|
||||
times $08 db $00
|
||||
|
||||
;include_debug_strings
|
||||
program_end:
|
||||
; params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
|
||||
params rb 4096
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
filename_area rb 256
|
||||
|
||||
align 4
|
||||
|
||||
include 'variable.inc'
|
||||
|
||||
program_base dd ?
|
||||
buffer_address dd ?
|
||||
memory_setting dd ?
|
||||
start_time dd ?
|
||||
memblock dd ?
|
||||
|
||||
predefinitions rb 1000h
|
||||
|
||||
dbgfilename rb MAX_PATH+4
|
||||
|
||||
sc system_colors
|
||||
max_handles = 8
|
||||
fileinfos rb (4+20+MAX_PATH)*max_handles
|
||||
fileinfos_end:
|
||||
pinfo process_information
|
||||
|
||||
align 1000h
|
||||
rb 1000h
|
||||
stacktop:
|
@@ -1,59 +0,0 @@
|
||||
ID_CLOSE_BTN = 1
|
||||
ID_COMPILE_BTN = 2
|
||||
ID_EXECUTE_BTN = 3
|
||||
ID_EXECDBG_BTN = 4
|
||||
ID_OPENDLG_BTN = 5
|
||||
|
||||
center fix false
|
||||
SYSTEMCOLORS fix sc
|
||||
PROCESSINFO fix pinfo
|
||||
|
||||
macro get_sys_colors wnd_skin,font_1 {
|
||||
mcall 48,3,SYSTEMCOLORS,sizeof.system_colors
|
||||
if wnd_skin <> 0
|
||||
or [SYSTEMCOLORS+system_colors.work],0x03000000
|
||||
end if
|
||||
if font_1 <> 0
|
||||
or [SYSTEMCOLORS+system_colors.grab_text],0x10000000
|
||||
end if
|
||||
}
|
||||
|
||||
macro draw_caption _edx,_esi {
|
||||
mov edx,_edx
|
||||
mov esi,_esi
|
||||
call __draw_caption
|
||||
}
|
||||
|
||||
macro mmov reg,a1,a2 {
|
||||
mov reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro madd reg,a1,a2 {
|
||||
add reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro msub reg,a1,a2 {
|
||||
sub reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro jmpe reg,def,[val,lab] {
|
||||
forward
|
||||
cmp reg,val
|
||||
je lab
|
||||
common
|
||||
if ~def eq
|
||||
jmp def
|
||||
end if
|
||||
}
|
||||
|
||||
macro func name {
|
||||
if used name
|
||||
name:
|
||||
}
|
||||
|
||||
macro endf {
|
||||
end if
|
||||
}
|
||||
|
||||
@^ fix macro comment {
|
||||
^@ fix }
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,37 +0,0 @@
|
||||
|
||||
flat assembler version 1.71
|
||||
Copyright (c) 1999-2013, Tomasz Grysztar.
|
||||
All rights reserved.
|
||||
|
||||
This program is free for commercial and non-commercial use as long as
|
||||
the following conditions are adhered to.
|
||||
|
||||
Copyright remains Tomasz Grysztar, and as such any Copyright notices
|
||||
in the code are not to be removed.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The licence and distribution terms for any publically available
|
||||
version or derivative of this code cannot be changed. i.e. this code
|
||||
cannot simply be copied and put under another distribution licence
|
||||
(including the GNU Public Licence).
|
@@ -1,52 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
_out_of_memory db 'out of memory',0
|
||||
_stack_overflow db 'out of stack space',0
|
||||
_main_file_not_found db 'source file not found',0
|
||||
_unexpected_end_of_file db 'unexpected end of file',0
|
||||
_code_cannot_be_generated db 'code cannot be generated',0
|
||||
_format_limitations_exceeded db 'format limitations exceeded',0
|
||||
_invalid_definition db 'invalid definition provided',0
|
||||
_write_failed db 'write failed',0
|
||||
_file_not_found db 'file not found',0
|
||||
_error_reading_file db 'error reading file',0
|
||||
_invalid_file_format db 'invalid file format',0
|
||||
_invalid_macro_arguments db 'invalid macro arguments',0
|
||||
_incomplete_macro db 'incomplete macro',0
|
||||
_unexpected_characters db 'unexpected characters',0
|
||||
_invalid_argument db 'invalid argument',0
|
||||
_illegal_instruction db 'illegal instruction',0
|
||||
_invalid_operand db 'invalid operand',0
|
||||
_invalid_operand_size db 'invalid size of operand',0
|
||||
_operand_size_not_specified db 'operand size not specified',0
|
||||
_operand_sizes_do_not_match db 'operand sizes do not match',0
|
||||
_invalid_address_size db 'invalid size of address value',0
|
||||
_address_sizes_do_not_agree db 'address sizes do not agree',0
|
||||
_disallowed_combination_of_registers db 'disallowed combination of registers',0
|
||||
_long_immediate_not_encodable db 'not encodable with long immediate',0
|
||||
_relative_jump_out_of_range db 'relative jump out of range',0
|
||||
_invalid_expression db 'invalid expression',0
|
||||
_invalid_address db 'invalid address',0
|
||||
_invalid_value db 'invalid value',0
|
||||
_value_out_of_range db 'value out of range',0
|
||||
_undefined_symbol db 'undefined symbol',0
|
||||
_symbol_out_of_scope_1 db 'symbol',0
|
||||
_symbol_out_of_scope_2 db 'out of scope',0
|
||||
_invalid_use_of_symbol db 'invalid use of symbol',0
|
||||
_name_too_long db 'name too long',0
|
||||
_invalid_name db 'invalid name',0
|
||||
_reserved_word_used_as_symbol db 'reserved word used as symbol',0
|
||||
_symbol_already_defined db 'symbol already defined',0
|
||||
_missing_end_quote db 'missing end quote',0
|
||||
_missing_end_directive db 'missing end directive',0
|
||||
_unexpected_instruction db 'unexpected instruction',0
|
||||
_extra_characters_on_line db 'extra characters on line',0
|
||||
_section_not_aligned_enough db 'section is not aligned enough',0
|
||||
_setting_already_specified db 'setting already specified',0
|
||||
_data_already_defined db 'data already defined',0
|
||||
_too_many_repeats db 'too many repeats',0
|
||||
_invoked_error db 'error directive encountered in source file',0
|
||||
_assertion_failed db 'assertion failed',0
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,450 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
dump_symbols:
|
||||
mov edi,[code_start]
|
||||
call setup_dump_header
|
||||
mov esi,[input_file]
|
||||
call copy_asciiz
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
mov [ebx-40h+0Ch],eax
|
||||
mov esi,[output_file]
|
||||
call copy_asciiz
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
mov edx,[symbols_stream]
|
||||
mov ebp,[free_additional_memory]
|
||||
and [number_of_sections],0
|
||||
cmp [output_format],4
|
||||
je prepare_strings_table
|
||||
cmp [output_format],5
|
||||
jne strings_table_ready
|
||||
bt [format_flags],0
|
||||
jc strings_table_ready
|
||||
prepare_strings_table:
|
||||
cmp edx,ebp
|
||||
je strings_table_ready
|
||||
mov al,[edx]
|
||||
test al,al
|
||||
jz prepare_string
|
||||
cmp al,80h
|
||||
je prepare_string
|
||||
add edx,0Ch
|
||||
cmp al,0C0h
|
||||
jb prepare_strings_table
|
||||
add edx,4
|
||||
jmp prepare_strings_table
|
||||
prepare_string:
|
||||
mov esi,edi
|
||||
sub esi,ebx
|
||||
xchg esi,[edx+4]
|
||||
test al,al
|
||||
jz prepare_section_string
|
||||
or dword [edx+4],1 shl 31
|
||||
add edx,0Ch
|
||||
prepare_external_string:
|
||||
mov ecx,[esi]
|
||||
add esi,4
|
||||
rep movs byte [edi],[esi]
|
||||
mov byte [edi],0
|
||||
inc edi
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
jmp prepare_strings_table
|
||||
prepare_section_string:
|
||||
mov ecx,[number_of_sections]
|
||||
mov eax,ecx
|
||||
inc eax
|
||||
mov [number_of_sections],eax
|
||||
xchg eax,[edx+4]
|
||||
shl ecx,2
|
||||
add ecx,[free_additional_memory]
|
||||
mov [ecx],eax
|
||||
add edx,20h
|
||||
test esi,esi
|
||||
jz prepare_default_section_string
|
||||
cmp [output_format],5
|
||||
jne prepare_external_string
|
||||
bt [format_flags],0
|
||||
jc prepare_external_string
|
||||
mov esi,[esi]
|
||||
add esi,[resource_data]
|
||||
copy_elf_section_name:
|
||||
lods byte [esi]
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
stos byte [edi]
|
||||
test al,al
|
||||
jnz copy_elf_section_name
|
||||
jmp prepare_strings_table
|
||||
prepare_default_section_string:
|
||||
mov eax,'.fla'
|
||||
stos dword [edi]
|
||||
mov ax,'t'
|
||||
stos word [edi]
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
jmp prepare_strings_table
|
||||
strings_table_ready:
|
||||
mov edx,[tagged_blocks]
|
||||
mov ebp,[memory_end]
|
||||
sub ebp,[labels_list]
|
||||
add ebp,edx
|
||||
prepare_labels_dump:
|
||||
cmp edx,ebp
|
||||
je labels_dump_ok
|
||||
mov eax,[edx+24]
|
||||
test eax,eax
|
||||
jz label_dump_name_ok
|
||||
cmp eax,[memory_start]
|
||||
jb label_name_outside_source
|
||||
cmp eax,[source_start]
|
||||
ja label_name_outside_source
|
||||
sub eax,[memory_start]
|
||||
dec eax
|
||||
mov [edx+24],eax
|
||||
jmp label_dump_name_ok
|
||||
label_name_outside_source:
|
||||
mov esi,eax
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
or eax,1 shl 31
|
||||
mov [edx+24],eax
|
||||
movzx ecx,byte [esi-1]
|
||||
lea eax,[edi+ecx+1]
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
rep movsb
|
||||
xor al,al
|
||||
stosb
|
||||
label_dump_name_ok:
|
||||
mov eax,[edx+28]
|
||||
test eax,eax
|
||||
jz label_dump_line_ok
|
||||
sub eax,[memory_start]
|
||||
mov [edx+28],eax
|
||||
label_dump_line_ok:
|
||||
test byte [edx+9],4
|
||||
jz convert_base_symbol_for_label
|
||||
xor eax,eax
|
||||
mov [edx],eax
|
||||
mov [edx+4],eax
|
||||
jmp base_symbol_for_label_ok
|
||||
convert_base_symbol_for_label:
|
||||
mov eax,[edx+20]
|
||||
test eax,eax
|
||||
jz base_symbol_for_label_ok
|
||||
cmp eax,[symbols_stream]
|
||||
mov eax,[eax+4]
|
||||
jae base_symbol_for_label_ok
|
||||
xor eax,eax
|
||||
base_symbol_for_label_ok:
|
||||
mov [edx+20],eax
|
||||
mov ax,[current_pass]
|
||||
cmp ax,[edx+16]
|
||||
je label_defined_flag_ok
|
||||
and byte [edx+8],not 1
|
||||
label_defined_flag_ok:
|
||||
cmp ax,[edx+18]
|
||||
je label_used_flag_ok
|
||||
and byte [edx+8],not 8
|
||||
label_used_flag_ok:
|
||||
add edx,LABEL_STRUCTURE_SIZE
|
||||
jmp prepare_labels_dump
|
||||
labels_dump_ok:
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
mov [ebx-40h+14h],eax
|
||||
add eax,40h
|
||||
mov [ebx-40h+18h],eax
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,[labels_list]
|
||||
mov [ebx-40h+1Ch],ecx
|
||||
add eax,ecx
|
||||
mov [ebx-40h+20h],eax
|
||||
mov ecx,[source_start]
|
||||
sub ecx,[memory_start]
|
||||
mov [ebx-40h+24h],ecx
|
||||
add eax,ecx
|
||||
mov [ebx-40h+28h],eax
|
||||
mov eax,[number_of_sections]
|
||||
shl eax,2
|
||||
mov [ebx-40h+34h],eax
|
||||
call prepare_preprocessed_source
|
||||
mov esi,[labels_list]
|
||||
mov ebp,edi
|
||||
make_lines_dump:
|
||||
cmp esi,[tagged_blocks]
|
||||
je lines_dump_ok
|
||||
mov eax,[esi-4]
|
||||
mov ecx,[esi-8]
|
||||
sub esi,8
|
||||
sub esi,ecx
|
||||
cmp eax,1
|
||||
je process_line_dump
|
||||
cmp eax,2
|
||||
jne make_lines_dump
|
||||
add dword [ebx-40h+3Ch],8
|
||||
jmp make_lines_dump
|
||||
process_line_dump:
|
||||
push ebx
|
||||
mov ebx,[esi+8]
|
||||
mov eax,[esi+4]
|
||||
sub eax,[code_start]
|
||||
add eax,[headers_size]
|
||||
test byte [ebx+0Ah],1
|
||||
jz store_offset
|
||||
xor eax,eax
|
||||
store_offset:
|
||||
stos dword [edi]
|
||||
mov eax,[esi]
|
||||
sub eax,[memory_start]
|
||||
stos dword [edi]
|
||||
mov eax,[esi+4]
|
||||
xor edx,edx
|
||||
xor cl,cl
|
||||
sub eax,[ebx]
|
||||
sbb edx,[ebx+4]
|
||||
sbb cl,[ebx+8]
|
||||
stos dword [edi]
|
||||
mov eax,edx
|
||||
stos dword [edi]
|
||||
mov eax,[ebx+10h]
|
||||
stos dword [edi]
|
||||
mov eax,[ebx+14h]
|
||||
test eax,eax
|
||||
jz base_symbol_for_line_ok
|
||||
cmp eax,[symbols_stream]
|
||||
mov eax,[eax+4]
|
||||
jae base_symbol_for_line_ok
|
||||
xor eax,eax
|
||||
base_symbol_for_line_ok:
|
||||
stos dword [edi]
|
||||
mov al,[ebx+9]
|
||||
stos byte [edi]
|
||||
mov al,[esi+10h]
|
||||
stos byte [edi]
|
||||
mov al,[ebx+0Ah]
|
||||
and al,1
|
||||
stos byte [edi]
|
||||
mov al,cl
|
||||
stos byte [edi]
|
||||
pop ebx
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
mov eax,edi
|
||||
sub eax,1Ch
|
||||
sub eax,ebp
|
||||
mov [esi],eax
|
||||
jmp make_lines_dump
|
||||
lines_dump_ok:
|
||||
mov edx,edi
|
||||
mov eax,[current_offset]
|
||||
sub eax,[code_start]
|
||||
add eax,[headers_size]
|
||||
stos dword [edi]
|
||||
mov ecx,edi
|
||||
sub ecx,ebx
|
||||
sub ecx,[ebx-40h+14h]
|
||||
mov [ebx-40h+2Ch],ecx
|
||||
add ecx,[ebx-40h+28h]
|
||||
mov [ebx-40h+30h],ecx
|
||||
add ecx,[ebx-40h+34h]
|
||||
mov [ebx-40h+38h],ecx
|
||||
find_inexisting_offsets:
|
||||
sub edx,1Ch
|
||||
cmp edx,ebp
|
||||
jb write_symbols
|
||||
test byte [edx+1Ah],1
|
||||
jnz find_inexisting_offsets
|
||||
cmp eax,[edx]
|
||||
jb correct_inexisting_offset
|
||||
mov eax,[edx]
|
||||
jmp find_inexisting_offsets
|
||||
correct_inexisting_offset:
|
||||
and dword [edx],0
|
||||
or byte [edx+1Ah],2
|
||||
jmp find_inexisting_offsets
|
||||
write_symbols:
|
||||
mov edx,[symbols_file]
|
||||
call create
|
||||
jc write_failed
|
||||
mov edx,[code_start]
|
||||
mov ecx,[edx+14h]
|
||||
add ecx,40h
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[tagged_blocks]
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,[labels_list]
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[memory_start]
|
||||
mov ecx,[source_start]
|
||||
sub ecx,edx
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,ebp
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[free_additional_memory]
|
||||
mov ecx,[number_of_sections]
|
||||
shl ecx,2
|
||||
call write
|
||||
jc write_failed
|
||||
mov esi,[labels_list]
|
||||
mov edi,[memory_start]
|
||||
make_references_dump:
|
||||
cmp esi,[tagged_blocks]
|
||||
je references_dump_ok
|
||||
mov eax,[esi-4]
|
||||
mov ecx,[esi-8]
|
||||
sub esi,8
|
||||
sub esi,ecx
|
||||
cmp eax,2
|
||||
je dump_reference
|
||||
cmp eax,1
|
||||
jne make_references_dump
|
||||
mov edx,[esi]
|
||||
jmp make_references_dump
|
||||
dump_reference:
|
||||
mov eax,[memory_end]
|
||||
sub eax,[esi]
|
||||
sub eax,LABEL_STRUCTURE_SIZE
|
||||
stosd
|
||||
mov eax,edx
|
||||
stosd
|
||||
cmp edi,[tagged_blocks]
|
||||
jb make_references_dump
|
||||
jmp out_of_memory
|
||||
references_dump_ok:
|
||||
mov edx,[memory_start]
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
jc write_failed
|
||||
call close
|
||||
ret
|
||||
setup_dump_header:
|
||||
xor eax,eax
|
||||
mov ecx,40h shr 2
|
||||
rep stos dword [edi]
|
||||
mov ebx,edi
|
||||
mov dword [ebx-40h],'fas'+1Ah shl 24
|
||||
mov dword [ebx-40h+4],VERSION_MAJOR + VERSION_MINOR shl 8 + 40h shl 16
|
||||
mov dword [ebx-40h+10h],40h
|
||||
ret
|
||||
prepare_preprocessed_source:
|
||||
mov esi,[memory_start]
|
||||
mov ebp,[source_start]
|
||||
test ebp,ebp
|
||||
jnz prepare_preprocessed_line
|
||||
mov ebp,[current_line]
|
||||
inc ebp
|
||||
prepare_preprocessed_line:
|
||||
cmp esi,ebp
|
||||
jae preprocessed_source_ok
|
||||
mov eax,[memory_start]
|
||||
mov edx,[input_file]
|
||||
cmp [esi],edx
|
||||
jne line_not_from_main_input
|
||||
mov [esi],eax
|
||||
line_not_from_main_input:
|
||||
sub [esi],eax
|
||||
test byte [esi+7],1 shl 7
|
||||
jz prepare_next_preprocessed_line
|
||||
sub [esi+8],eax
|
||||
sub [esi+12],eax
|
||||
prepare_next_preprocessed_line:
|
||||
call skip_preprocessed_line
|
||||
jmp prepare_preprocessed_line
|
||||
preprocessed_source_ok:
|
||||
ret
|
||||
skip_preprocessed_line:
|
||||
add esi,16
|
||||
skip_preprocessed_line_content:
|
||||
lods byte [esi]
|
||||
cmp al,1Ah
|
||||
je skip_preprocessed_symbol
|
||||
cmp al,3Bh
|
||||
je skip_preprocessed_symbol
|
||||
cmp al,22h
|
||||
je skip_preprocessed_string
|
||||
or al,al
|
||||
jnz skip_preprocessed_line_content
|
||||
ret
|
||||
skip_preprocessed_string:
|
||||
lods dword [esi]
|
||||
add esi,eax
|
||||
jmp skip_preprocessed_line_content
|
||||
skip_preprocessed_symbol:
|
||||
lods byte [esi]
|
||||
movzx eax,al
|
||||
add esi,eax
|
||||
jmp skip_preprocessed_line_content
|
||||
restore_preprocessed_source:
|
||||
mov esi,[memory_start]
|
||||
mov ebp,[source_start]
|
||||
test ebp,ebp
|
||||
jnz restore_preprocessed_line
|
||||
mov ebp,[current_line]
|
||||
inc ebp
|
||||
restore_preprocessed_line:
|
||||
cmp esi,ebp
|
||||
jae preprocessed_source_restored
|
||||
mov eax,[memory_start]
|
||||
add [esi],eax
|
||||
cmp [esi],eax
|
||||
jne preprocessed_line_source_restored
|
||||
mov edx,[input_file]
|
||||
mov [esi],edx
|
||||
preprocessed_line_source_restored:
|
||||
test byte [esi+7],1 shl 7
|
||||
jz restore_next_preprocessed_line
|
||||
add [esi+8],eax
|
||||
add [esi+12],eax
|
||||
restore_next_preprocessed_line:
|
||||
call skip_preprocessed_line
|
||||
jmp restore_preprocessed_line
|
||||
preprocessed_source_restored:
|
||||
ret
|
||||
dump_preprocessed_source:
|
||||
mov edi,[free_additional_memory]
|
||||
call setup_dump_header
|
||||
mov esi,[input_file]
|
||||
call copy_asciiz
|
||||
cmp edi,[additional_memory_end]
|
||||
jae out_of_memory
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
dec eax
|
||||
mov [ebx-40h+0Ch],eax
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
mov [ebx-40h+14h],eax
|
||||
add eax,40h
|
||||
mov [ebx-40h+20h],eax
|
||||
call prepare_preprocessed_source
|
||||
sub esi,[memory_start]
|
||||
mov [ebx-40h+24h],esi
|
||||
mov edx,[symbols_file]
|
||||
call create
|
||||
jc write_failed
|
||||
mov edx,[free_additional_memory]
|
||||
mov ecx,[edx+14h]
|
||||
add ecx,40h
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[memory_start]
|
||||
mov ecx,esi
|
||||
call write
|
||||
jc write_failed
|
||||
call close
|
||||
ret
|
@@ -1,692 +0,0 @@
|
||||
; flat assembler
|
||||
; Copyright (c) 1999-2012, Tomasz Grysztar
|
||||
; All rights reserved.
|
||||
|
||||
struc FILEIO
|
||||
{ .cmd dd ?
|
||||
.offset dd ?
|
||||
dd ?
|
||||
.count dd ?
|
||||
.buff dd ?
|
||||
db ?
|
||||
.name dd ?
|
||||
};
|
||||
|
||||
struc FILEINFO
|
||||
{ .attr dd ?
|
||||
.flags dd ?
|
||||
.cr_time dd ?
|
||||
.cr_date dd ?
|
||||
.acc_time dd ?
|
||||
.acc_date dd ?
|
||||
.mod_time dd ?
|
||||
.mod_date dd ?
|
||||
.size dd ?
|
||||
}
|
||||
|
||||
|
||||
|
||||
;file_info_open: dd 0,0,0xffffff,0x20000,0xf0000
|
||||
fullpath_open: ; db '/RD/1/EXAMPLE.ASM'
|
||||
times MAX_PATH db 0
|
||||
|
||||
|
||||
;file_info_write: dd 1,0,0,0,0xf0000
|
||||
fullpath_write:; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_start:
|
||||
dd 7
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
fullpath_start: ; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_debug:
|
||||
dd 7
|
||||
dd 0
|
||||
dd fullpath_start
|
||||
dd 0, 0
|
||||
db '/SYS/DEVELOP/MTDBG',0
|
||||
|
||||
_ramdisk db '/RD/1/'
|
||||
filepos dd 0x0
|
||||
|
||||
|
||||
init_memory:
|
||||
|
||||
; mov ecx, 16*1024*1024
|
||||
;
|
||||
; allocate_memory:
|
||||
mcall 18, 16
|
||||
cmp eax, 0x38000000 shr 9
|
||||
jbe @f
|
||||
mov eax, 0x38000000 shr 9
|
||||
@@:
|
||||
shl eax, 9
|
||||
xchg eax, ecx
|
||||
mov [memory_setting],ecx
|
||||
mcall 68, 12
|
||||
or eax,eax
|
||||
jz out_of_memory
|
||||
mov [memblock], eax
|
||||
mov [additional_memory],eax
|
||||
add eax,[memory_setting]
|
||||
mov [memory_end],eax
|
||||
mov eax,[memory_setting]
|
||||
shr eax,2
|
||||
add eax,[additional_memory]
|
||||
mov [additional_memory_end],eax
|
||||
mov [memory_start],eax
|
||||
ret
|
||||
|
||||
exit_program:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
mcall 68, 13, [memblock]
|
||||
jmp still
|
||||
@@:
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
make_timestamp:
|
||||
push ebx
|
||||
mcall 26,9
|
||||
imul eax,10
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
symbol_dump:
|
||||
|
||||
push edi
|
||||
mov edx,[memory_end]
|
||||
symb_dump:
|
||||
cmp edx,[labels_list]
|
||||
jbe symbols_dumped
|
||||
sub edx,LABEL_STRUCTURE_SIZE
|
||||
cmp dword [edx+24],0
|
||||
je symb_dump ; do not dump anonymous symbols
|
||||
test byte [edx+8],1
|
||||
jz symb_dump ; do not dump symbols that didn't get defined
|
||||
mov ax,[current_pass]
|
||||
cmp ax,[edx+16]
|
||||
jne symb_dump
|
||||
test byte [edx+8],4 or 2
|
||||
jnz symb_dump ; do not dump assembly-time variables
|
||||
; do not dump variables defined with '='
|
||||
cmp word [edx+12], 0
|
||||
jnz symb_dump ; do not dump register-based variables
|
||||
|
||||
mov al, '0'
|
||||
stosb
|
||||
mov al, 'x'
|
||||
stosb
|
||||
mov eax, [edx+4]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
jz .nohigh
|
||||
inc ecx
|
||||
@@:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop @b
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
jmp .low
|
||||
.nohigh:
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
inc ecx
|
||||
.low:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop .low
|
||||
|
||||
mov al, ' '
|
||||
stosb
|
||||
|
||||
mov esi,[edx+24]
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movsb
|
||||
|
||||
mov ax,0A0Dh
|
||||
stosw
|
||||
|
||||
jmp symb_dump
|
||||
|
||||
symbols_dumped:
|
||||
mov edx,dbgfilename
|
||||
push esi edi
|
||||
mov esi, outfile
|
||||
mov edi, edx
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @b
|
||||
lea ecx, [edi-1]
|
||||
@@:
|
||||
dec edi
|
||||
cmp edi, edx
|
||||
jb @f
|
||||
cmp byte [edi], '/'
|
||||
jz @f
|
||||
cmp byte [edi], '.'
|
||||
jnz @b
|
||||
mov ecx, edi
|
||||
@@:
|
||||
mov dword [ecx], '.dbg'
|
||||
mov byte [ecx+4], 0
|
||||
pop edi esi
|
||||
call create
|
||||
mov edx,[esp]
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
call close
|
||||
pop edi
|
||||
|
||||
ret
|
||||
|
||||
get_environment_variable:
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,edi
|
||||
cmp ecx,7
|
||||
jb out_of_memory
|
||||
cmp dword[esi],'INCL'
|
||||
jne .finish
|
||||
mov esi,_ramdisk
|
||||
mov ecx,6
|
||||
cld
|
||||
rep movsb
|
||||
.finish:
|
||||
; stc
|
||||
ret
|
||||
|
||||
alloc_handle:
|
||||
call make_fullpaths
|
||||
mov ebx, fileinfos+4
|
||||
@@:
|
||||
cmp dword [ebx], -1
|
||||
jz .found
|
||||
add ebx, 4+20+MAX_PATH
|
||||
cmp ebx, fileinfos_end
|
||||
jb @b
|
||||
stc
|
||||
ret
|
||||
.found:
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
push esi edi ecx
|
||||
mov esi, fullpath_open
|
||||
lea edi, [ebx+20]
|
||||
mov ecx, MAX_PATH
|
||||
rep movsb
|
||||
pop ecx edi esi
|
||||
ret ; CF=0
|
||||
|
||||
create:
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
and dword [ebx-4], 0
|
||||
mov dword [ebx], 2
|
||||
.ret:
|
||||
ret
|
||||
|
||||
|
||||
open:
|
||||
; call make_fullpaths
|
||||
|
||||
;; mov eax,fullpath_open
|
||||
;; DEBUGF '"%s"\n',eax
|
||||
|
||||
; mov dword[file_info_open+8],-1
|
||||
; mcall 58,file_info_open
|
||||
; or eax,eax ; found
|
||||
; jz @f
|
||||
; cmp eax,6
|
||||
; jne file_error
|
||||
;@@: mov [filesize],ebx
|
||||
; clc
|
||||
; ret
|
||||
;file_error:
|
||||
; stc
|
||||
; ret
|
||||
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
mov dword [ebx], 5
|
||||
and dword [ebx+12], 0
|
||||
mov dword [ebx+16], fileinfo
|
||||
mov eax, 70
|
||||
push ebx
|
||||
mcall
|
||||
pop ebx
|
||||
test eax, eax
|
||||
jnz .fail
|
||||
mov eax, [fileinfo.size]
|
||||
mov [ebx-4], eax
|
||||
and dword [ebx], 0
|
||||
.ret:
|
||||
ret
|
||||
.fail:
|
||||
or dword [ebx], -1 ; close handle
|
||||
stc
|
||||
ret
|
||||
|
||||
read:
|
||||
; pusha
|
||||
; mov edi,edx
|
||||
; mov esi,[filepos]
|
||||
; add esi,0x20000
|
||||
; cld
|
||||
; rep movsb
|
||||
; popa
|
||||
;; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
test eax, eax
|
||||
jz .ok
|
||||
cmp eax, 6
|
||||
jz .ok
|
||||
stc
|
||||
.ok:
|
||||
ret
|
||||
|
||||
close:
|
||||
or dword [ebx], -1
|
||||
ret
|
||||
|
||||
|
||||
; ebx file handle
|
||||
; ecx count of bytes to write
|
||||
; edx pointer to buffer
|
||||
write:
|
||||
; pusha
|
||||
; mov [file_info_write+8],ecx
|
||||
; mov [file_info_write+12],edx
|
||||
; mov [filesize],edx
|
||||
; mov eax,58
|
||||
; mov ebx,file_info_write
|
||||
; mcall
|
||||
; popa
|
||||
; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
mov byte [ebx], 3
|
||||
cmp eax, 1
|
||||
cmc
|
||||
ret
|
||||
|
||||
make_fullpaths:
|
||||
pusha
|
||||
push edx
|
||||
|
||||
mov esi,path ; open
|
||||
; DEBUGF " '%s'",esi
|
||||
mov edi,fullpath_open
|
||||
cld
|
||||
newc1:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc1
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_open
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; write
|
||||
mov edi,fullpath_write
|
||||
cld
|
||||
newc2:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc2
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_write
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; start
|
||||
mov edi,fullpath_start
|
||||
cld
|
||||
newc3:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc3
|
||||
; mov esi,[esp]
|
||||
pop esi
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_start
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
; add esp,4
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
|
||||
lseek:
|
||||
cmp al,0
|
||||
jnz @f
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
@@: cmp al,2
|
||||
jnz @f
|
||||
mov eax, [ebx-4]
|
||||
mov [ebx+4], eax
|
||||
and dword [ebx+8], 0
|
||||
@@: add dword [ebx+4], edx
|
||||
adc dword [ebx+8], 0
|
||||
ret
|
||||
|
||||
display_character:
|
||||
pusha
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
cmp dl,13
|
||||
jz dc2
|
||||
cmp dl,0xa
|
||||
jnz dc1
|
||||
and [textxy],0x0000FFFF
|
||||
add [textxy], 7 shl 16 +53 and 0xFFFF0000 + 16
|
||||
dc2:
|
||||
popa
|
||||
ret
|
||||
dc1:
|
||||
mov eax,[textxy]
|
||||
cmp ax,word[bottom_right]
|
||||
ja dc2
|
||||
shr eax,16
|
||||
cmp ax,word[bottom_right+2]
|
||||
ja dc2
|
||||
mov [dc],dl
|
||||
mcall 4,[textxy],0x10000000,dc,1
|
||||
add [textxy],0x00080000
|
||||
popa
|
||||
ret
|
||||
@@:
|
||||
mov eax,63
|
||||
mov ebx,1
|
||||
mov cl,dl
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
display_string:
|
||||
pusha
|
||||
@@:
|
||||
cmp byte[esi],0
|
||||
je @f
|
||||
mov dl,[esi]
|
||||
call display_character
|
||||
add esi,1
|
||||
jmp @b
|
||||
@@:
|
||||
popa
|
||||
ret
|
||||
|
||||
display_number:
|
||||
push ebx
|
||||
mov ecx,1000000000
|
||||
xor edx,edx
|
||||
xor bl,bl
|
||||
display_loop:
|
||||
div ecx
|
||||
push edx
|
||||
cmp ecx,1
|
||||
je display_digit
|
||||
or bl,bl
|
||||
jnz display_digit
|
||||
or al,al
|
||||
jz digit_ok
|
||||
not bl
|
||||
display_digit:
|
||||
mov dl,al
|
||||
add dl,30h
|
||||
push ebx ecx
|
||||
call display_character
|
||||
pop ecx ebx
|
||||
digit_ok:
|
||||
mov eax,ecx
|
||||
xor edx,edx
|
||||
mov ecx,10
|
||||
div ecx
|
||||
mov ecx,eax
|
||||
pop eax
|
||||
or ecx,ecx
|
||||
jnz display_loop
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
display_user_messages:
|
||||
; push [skinh]
|
||||
; pop [textxy]
|
||||
; add [textxy], 7 shl 16 +53
|
||||
mov [displayed_count],0
|
||||
call show_display_buffer
|
||||
cmp [displayed_count],1
|
||||
jb line_break_ok
|
||||
je make_line_break
|
||||
mov ax,word[last_displayed]
|
||||
cmp ax,0A0Dh
|
||||
je line_break_ok
|
||||
cmp ax,0D0Ah
|
||||
je line_break_ok
|
||||
make_line_break:
|
||||
mov esi,lf
|
||||
call display_string
|
||||
line_break_ok:
|
||||
ret
|
||||
|
||||
display_block:
|
||||
pusha
|
||||
@@: mov dl,[esi]
|
||||
call display_character
|
||||
inc esi
|
||||
loop @b
|
||||
popa
|
||||
ret
|
||||
|
||||
fatal_error:
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
mov esi,lf
|
||||
call display_string
|
||||
mov al,0FFh
|
||||
jmp exit_program
|
||||
|
||||
assembler_error:
|
||||
call display_user_messages
|
||||
push dword 0
|
||||
mov ebx,[current_line]
|
||||
get_error_lines:
|
||||
push ebx
|
||||
test byte [ebx+7],80h
|
||||
jz display_error_line
|
||||
mov edx,ebx
|
||||
find_definition_origin:
|
||||
mov edx,[edx+12]
|
||||
test byte [edx+7],80h
|
||||
jnz find_definition_origin
|
||||
push edx
|
||||
mov ebx,[ebx+8]
|
||||
jmp get_error_lines
|
||||
display_error_line:
|
||||
mov esi,[ebx]
|
||||
call display_string
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
mov eax,[ebx+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
pop esi
|
||||
cmp ebx,esi
|
||||
je line_number_ok
|
||||
mov dl,20h
|
||||
call display_character
|
||||
push esi
|
||||
mov esi,[esi]
|
||||
movzx ecx,byte [esi]
|
||||
inc esi
|
||||
call display_block
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
pop esi
|
||||
mov eax,[esi+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
line_number_ok:
|
||||
mov esi,line_data_start
|
||||
call display_string
|
||||
mov esi,ebx
|
||||
mov edx,[esi]
|
||||
call open
|
||||
mov al,2
|
||||
xor edx,edx
|
||||
call lseek
|
||||
mov edx,[esi+8]
|
||||
sub eax,edx
|
||||
push eax
|
||||
xor al,al
|
||||
call lseek
|
||||
mov ecx,[esp]
|
||||
mov edx,[additional_memory]
|
||||
lea eax,[edx+ecx]
|
||||
cmp eax,[additional_memory_end]
|
||||
ja out_of_memory
|
||||
call read
|
||||
call close
|
||||
pop ecx
|
||||
mov esi,[additional_memory]
|
||||
get_line_data:
|
||||
mov al,[esi]
|
||||
cmp al,0Ah
|
||||
je display_line_data
|
||||
cmp al,0Dh
|
||||
je display_line_data
|
||||
cmp al,1Ah
|
||||
je display_line_data
|
||||
or al,al
|
||||
jz display_line_data
|
||||
inc esi
|
||||
loop get_line_data
|
||||
display_line_data:
|
||||
mov ecx,esi
|
||||
mov esi,[additional_memory]
|
||||
sub ecx,esi
|
||||
call display_block
|
||||
mov esi,cr_lf
|
||||
call display_string
|
||||
pop ebx
|
||||
or ebx,ebx
|
||||
jnz display_error_line
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
jmp exit_program
|
||||
|
||||
align 4
|
||||
fileinfo FILEINFO
|
||||
|
||||
character db ?,0
|
||||
bytes_count dd ?
|
||||
|
||||
textxy dd 0x000500A0
|
||||
dc db 0x0
|
||||
filesize dd 0x0
|
||||
|
||||
displayed_count dd ?
|
||||
last_displayed rb 2
|
||||
|
||||
error_prefix db 'error: ',0
|
||||
error_suffix db '.',0
|
||||
line_data_start db ':'
|
||||
cr_lf db 0Dh,0Ah,0
|
||||
line_number_start db ' [',0
|
||||
|
||||
macro dm string { db string,0 }
|
File diff suppressed because it is too large
Load Diff
@@ -1,155 +0,0 @@
|
||||
|
||||
; flat assembler core variables
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
; Variables which have to be set up by interface:
|
||||
|
||||
memory_start dd ?
|
||||
memory_end dd ?
|
||||
|
||||
additional_memory dd ?
|
||||
additional_memory_end dd ?
|
||||
|
||||
stack_limit dd ?
|
||||
|
||||
initial_definitions dd ?
|
||||
input_file dd ?
|
||||
output_file dd ?
|
||||
symbols_file dd ?
|
||||
|
||||
passes_limit dw ?
|
||||
|
||||
; Internal core variables:
|
||||
|
||||
current_pass dw ?
|
||||
|
||||
include_paths dd ?
|
||||
free_additional_memory dd ?
|
||||
source_start dd ?
|
||||
code_start dd ?
|
||||
code_size dd ?
|
||||
real_code_size dd ?
|
||||
written_size dd ?
|
||||
headers_size dd ?
|
||||
|
||||
current_line dd ?
|
||||
macro_line dd ?
|
||||
macro_block dd ?
|
||||
macro_block_line dd ?
|
||||
macro_block_line_number dd ?
|
||||
macro_symbols dd ?
|
||||
struc_name dd ?
|
||||
struc_label dd ?
|
||||
instant_macro_start dd ?
|
||||
parameters_end dd ?
|
||||
default_argument_value dd ?
|
||||
locals_counter rb 8
|
||||
current_locals_prefix dd ?
|
||||
anonymous_reverse dd ?
|
||||
anonymous_forward dd ?
|
||||
labels_list dd ?
|
||||
label_hash dd ?
|
||||
label_leaf dd ?
|
||||
hash_tree dd ?
|
||||
addressing_space dd ?
|
||||
undefined_data_start dd ?
|
||||
undefined_data_end dd ?
|
||||
counter dd ?
|
||||
counter_limit dd ?
|
||||
error_info dd ?
|
||||
error_line dd ?
|
||||
error dd ?
|
||||
tagged_blocks dd ?
|
||||
structures_buffer dd ?
|
||||
number_start dd ?
|
||||
current_offset dd ?
|
||||
value dq ?
|
||||
fp_value rd 8
|
||||
adjustment dq ?
|
||||
symbol_identifier dd ?
|
||||
address_symbol dd ?
|
||||
address_high dd ?
|
||||
uncompressed_displacement dd ?
|
||||
format_flags dd ?
|
||||
resolver_flags dd ?
|
||||
symbols_stream dd ?
|
||||
number_of_relocations dd ?
|
||||
number_of_sections dd ?
|
||||
stub_size dd ?
|
||||
stub_file dd ?
|
||||
current_section dd ?
|
||||
machine dw ?
|
||||
subsystem dw ?
|
||||
subsystem_version dd ?
|
||||
image_base dd ?
|
||||
image_base_high dd ?
|
||||
resource_data dd ?
|
||||
resource_size dd ?
|
||||
actual_fixups_size dd ?
|
||||
reserved_fixups dd ?
|
||||
reserved_fixups_size dd ?
|
||||
last_fixup_base dd ?
|
||||
last_fixup_header dd ?
|
||||
parenthesis_stack dd ?
|
||||
blocks_stack dd ?
|
||||
parsed_lines dd ?
|
||||
logical_value_parentheses dd ?
|
||||
file_extension dd ?
|
||||
|
||||
operand_size db ?
|
||||
operand_flags db ?
|
||||
operand_prefix db ?
|
||||
rex_prefix db ?
|
||||
opcode_prefix db ?
|
||||
vex_required db ?
|
||||
vex_register db ?
|
||||
immediate_size db ?
|
||||
mask_register db ?
|
||||
broadcast_size db ?
|
||||
rounding_mode db ?
|
||||
|
||||
base_code db ?
|
||||
extended_code db ?
|
||||
supplemental_code db ?
|
||||
postbyte_register db ?
|
||||
segment_register db ?
|
||||
xop_opcode_map db ?
|
||||
|
||||
mmx_size db ?
|
||||
jump_type db ?
|
||||
push_size db ?
|
||||
value_size db ?
|
||||
address_size db ?
|
||||
label_size db ?
|
||||
size_declared db ?
|
||||
address_size_declared db ?
|
||||
displacement_compression db ?
|
||||
|
||||
value_undefined db ?
|
||||
value_constant db ?
|
||||
value_type db ?
|
||||
value_sign db ?
|
||||
fp_sign db ?
|
||||
fp_format db ?
|
||||
address_sign db ?
|
||||
address_register db ?
|
||||
compare_type db ?
|
||||
logical_value_wrapping db ?
|
||||
next_pass_needed db ?
|
||||
output_format db ?
|
||||
code_type db ?
|
||||
adjustment_sign db ?
|
||||
evex_mode db ?
|
||||
|
||||
macro_status db ?
|
||||
skip_default_argument_value db ?
|
||||
prefix_flags db ?
|
||||
formatter_symbols_allowed db ?
|
||||
decorator_symbols_allowed db ?
|
||||
free_address_range db ?
|
||||
|
||||
|
||||
characters rb 100h
|
||||
converted rb 100h
|
||||
message rb 200h
|
@@ -1,39 +0,0 @@
|
||||
|
||||
; flat assembler version 1.71
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
;
|
||||
; This programs is free for commercial and non-commercial use as long as
|
||||
; the following conditions are adhered to.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are
|
||||
; met:
|
||||
;
|
||||
; 1. Redistributions of source code must retain the above copyright notice,
|
||||
; this list of conditions and the following disclaimer.
|
||||
; 2. Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;
|
||||
; The licence and distribution terms for any publically available
|
||||
; version or derivative of this code cannot be changed. i.e. this code
|
||||
; cannot simply be copied and put under another distribution licence
|
||||
; (including the GNU Public Licence).
|
||||
|
||||
VERSION_STRING equ "1.71.54"
|
||||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 71
|
@@ -1,401 +0,0 @@
|
||||
|
||||
Visit http://flatassembler.net/ for more information.
|
||||
|
||||
|
||||
version 1.71.16 (Oct 30, 2013)
|
||||
|
||||
[-] Fixed some bugs in the ELF executable formatter.
|
||||
|
||||
|
||||
version 1.71.15 (Oct 26, 2013)
|
||||
|
||||
[-] Fixed some bugs inadvertently introduced in the previous release.
|
||||
|
||||
|
||||
version 1.71.14 (Oct 25, 2013)
|
||||
|
||||
[+] Added "postpone" directive to preprocessor.
|
||||
|
||||
|
||||
version 1.71.13 (Sep 09, 2013)
|
||||
|
||||
[-] Fixed a bug that caused the expressions containing external symbols
|
||||
to overflow from time to time.
|
||||
|
||||
|
||||
version 1.71.12 (Aug 04, 2013)
|
||||
|
||||
[-] Expressions in square brackets were incorrectly treated as valid numerical
|
||||
values when used in some logical expressions.
|
||||
|
||||
[-] A previous fix to "store" directive did not apply to all the cases when it
|
||||
was incorrectly leaving the data marked as uninitialized. The new fix
|
||||
addresses this issue.
|
||||
|
||||
|
||||
version 1.71.11 (Jul 09, 2013)
|
||||
|
||||
[-] Modifying a value in uninitialized data block with "store" directive will
|
||||
now correctly mark this data as initialized when it is in a different
|
||||
addressing space.
|
||||
|
||||
[-] Missing quote will no longer cause the symbols generator to hang or crash.
|
||||
|
||||
[-] Address range restrictions for addressing modes no longer apply to addresses
|
||||
provided to assembler directives like "label", "virtual" or "load".
|
||||
|
||||
|
||||
version 1.71.10 (Apr 03, 2013)
|
||||
|
||||
[-] Fixed a crashing "heap" directive in 64-bit PE format.
|
||||
|
||||
|
||||
version 1.71.09 (Mar 30, 2013)
|
||||
|
||||
[-] "use16","use32" and "use64" no longer allow to put another instruction in
|
||||
the same line.
|
||||
|
||||
[-] Fixed a bug in parser that caused it to hang while processing some
|
||||
specific ill-structured preprocessed lines.
|
||||
|
||||
[-] Modified memory allocation algorithm on Windows machines with large RAM.
|
||||
|
||||
|
||||
version 1.71.08 (Mar 08, 2013)
|
||||
|
||||
[-] Fixed a bug that caused "irp" to skip processing a list with one empty
|
||||
element when default value for iterating variable was specified.
|
||||
|
||||
|
||||
version 1.71.07 (Dec 23, 2012)
|
||||
|
||||
[-] Fixed a bug that was causing "used" operator to give incorrect results
|
||||
in some very specific cases.
|
||||
|
||||
|
||||
version 1.71.06 (Nov 22, 2012)
|
||||
|
||||
[-] Fixed a few bugs caused by unnecesarily strong restrictions on allowed
|
||||
types of relocatable values in some places (like "label" directive).
|
||||
|
||||
|
||||
version 1.71.05 (Oct 15, 2012)
|
||||
|
||||
[-] Fixed a bug which caused "load" and "store" directives to sometimes
|
||||
fail when assembler had preallocated very large amount of memory.
|
||||
|
||||
|
||||
version 1.71.04 (Oct 10, 2012)
|
||||
|
||||
[-] Fixed another bug in "org" directive, which was causing it to deal
|
||||
incorrectly with negative addresses.
|
||||
|
||||
|
||||
version 1.71.03 (Sep 27, 2012)
|
||||
|
||||
[-] Fixed a bug in "org" directive introduced by recent changes, which
|
||||
was manifesting with bases larger than 31-bit.
|
||||
|
||||
|
||||
version 1.71.02 (Sep 26, 2012)
|
||||
|
||||
[-] Expression calculator now allows to calculate the difference of
|
||||
relocatable addresses in a reverse order (first substracting/negating
|
||||
and then adding the other one).
|
||||
|
||||
|
||||
version 1.71.01 (Sep 23, 2012)
|
||||
|
||||
[+] Added support for ADX, RDSEED and SMAP instruction sets.
|
||||
|
||||
[-] Fixed the bugs related to creating a new addressing space inside the
|
||||
virtual block with "org" directive.
|
||||
|
||||
|
||||
version 1.71.00 (Sep 21, 2012)
|
||||
|
||||
[+] Added ability to define a special kind of label identifying the
|
||||
addressing space. This label can the be used with "load" or "store"
|
||||
directives to allow operations on bytes in any addressing space,
|
||||
not just the current one. This special label is defined by following
|
||||
its name with double colon, and can only be used with "load" and
|
||||
"store" directive, where address can now be specified in two parts,
|
||||
first the adressing space label, then the colon and then the
|
||||
address inside that addressing space.
|
||||
|
||||
|
||||
version 1.70.03 (Jun 29, 2012)
|
||||
|
||||
[-] Allowed to freely upgrade or downgrade the relocatable addresses in
|
||||
object format between the 32-bit or 64-bit size.
|
||||
|
||||
|
||||
version 1.70.02 (May 22, 2012)
|
||||
|
||||
[-] Corrected the optimization of segment prefixes when the extended syntax
|
||||
of some string instructions ("cmps", "lods", "movs" and "outs") is
|
||||
used in long mode. Now it is consistent with optimizations done with
|
||||
all the other instructions.
|
||||
|
||||
|
||||
version 1.70.01 (Apr 30, 2012)
|
||||
|
||||
[-] Corrected a recently introduced bug that caused some illegal
|
||||
address expressions to cause an error prematurely during the
|
||||
parsing stage.
|
||||
|
||||
|
||||
version 1.70 (Apr 17, 2012)
|
||||
|
||||
[+] Added support for AVX, AVX2, AES, CLMUL, FMA, RDRAND, FSGSBASE, F16C,
|
||||
FMA4, XOP, MOVBE, BMI, TBM, INVPCID, HLE and RTM instruction sets.
|
||||
|
||||
[+] Added half-precision floating point values support.
|
||||
|
||||
[+] Extended the syntax of "rept" directive to allow numerical expressions
|
||||
to be calculated by preprocessor in its arguments.
|
||||
|
||||
[+] Added "large" and "NX" settings for PE format.
|
||||
|
||||
[+] Allowed PE fixups to be resolved anywhere in the generated executable.
|
||||
|
||||
[+] Allowed to specify branding value (use 3 for Linux) after the
|
||||
"format ELF executable" setting.
|
||||
|
||||
[+] Added "intepreter", "dynamic" and "note" keywords for creation of
|
||||
special segments in ELF executables.
|
||||
|
||||
[-] Fixed long mode opcode generator to allow absolute addresses to be
|
||||
generated with "qword" keyword inside square brackets.
|
||||
|
||||
[-] Disallowed negative immediates with "int", "enter", "ret" instructions.
|
||||
|
||||
[+] Allowed symbolic information dump file to be created even in case of error.
|
||||
In such case it contains only the preprocessed source that can be extracted
|
||||
with PREPSRC tool. If error occured during preprocessing, only the source up
|
||||
to the point of error is provided.
|
||||
|
||||
[+] Added symbol references table to symbolic dump file.
|
||||
|
||||
[-] Corrected the "defined" and "used" flags in the symbols dump to reflect the
|
||||
state from the final assembly pass.
|
||||
|
||||
[+] Added "assert" directive.
|
||||
|
||||
[-] Formatter symbols like "PE" or "readable" are now recognized only in the
|
||||
context of formatter directives, and thus are no longer disallowed as
|
||||
labels.
|
||||
|
||||
[+] Macroinstruction argument now can have default value, defined with "="
|
||||
symbol followed by value after the argument name in definition.
|
||||
|
||||
[+] Added "relativeto" operator, which can be used in logical expressions
|
||||
to test whether two values differ only by a constant and not relocatable
|
||||
amount.
|
||||
|
||||
[-] Revised the expression calculator, it now is able to correctly perform
|
||||
calculations in signed and unsigned ranges in full 64-bit. This fixes
|
||||
a number of issues - the overflow will now be correctly detected for
|
||||
64-bit values in cases, where previous versions could not distinguish
|
||||
whether it was an overflow or not. The effect of these corrections is
|
||||
that "dq" directive will now behave consistently with behavior of the
|
||||
data directives for smaller sizes, and the same applies to all the
|
||||
places where "qword" size for value is used.
|
||||
|
||||
|
||||
version 1.68 (Jun 13, 2009)
|
||||
|
||||
[+] Added SSSE3 (Supplemental SSE3), SSE4.1, SSE4.2 and SSE4a instructions.
|
||||
|
||||
[+] Added the AMD SVM and Intel SMX instructions.
|
||||
|
||||
[+] Added "rdmsrq", "wrmsrq", "sysexitq" and "sysretq" mnemonics for the
|
||||
64-bit variants of respective instructions.
|
||||
|
||||
[+] Added "fstenvw", "fstenvd", "fsavew", "fsaved", "frstorw" and "frstord"
|
||||
mnemonics to allow choosing between 16-bit and 32-bit variants of
|
||||
structures used by the "fstenv", "fsave" and "frstor" instructions.
|
||||
|
||||
[+] Added "plt" operator for the ELF output format.
|
||||
|
||||
[+] Allowed "rva" operator to be used in MS COFF object format, and also
|
||||
added "static" keyword for the "public" directive.
|
||||
|
||||
[+] Added Intel-style aliases for the additional long mode 8-bit registers.
|
||||
|
||||
[-] The PE formatter now automatically detects whether relocatable labels
|
||||
should be used, depending on whether the fixups directory is placed
|
||||
somewhere into executable by programer, or not. This makes possible the
|
||||
more flexible use of the addressing symbols in case of PE executable fixed
|
||||
at some position.
|
||||
|
||||
[-] Added support for outputting the 32-bit address relocations in case of
|
||||
64-bit object formats and PE executable. This makes some specific
|
||||
instructions compilable, but it also forces linker to put such
|
||||
generated code into the low 2 gigabytes of addressing space.
|
||||
|
||||
[+] Added "EFI", "EFIboot" and "EFIruntime" subsystem keywords for PE format.
|
||||
|
||||
[-] Corrected the precedence of operators of macroinstruction line maker.
|
||||
The symbol escaping now has always the higher priority than symbol conversion,
|
||||
and both have higher precedence than concatenation.
|
||||
|
||||
[+] Allowed to check "@b" and "@f" symbols with "defined" operator.
|
||||
|
||||
[+] Allowed "as" operator to specify the output file extension when
|
||||
placed at the end of the "format" directive line.
|
||||
|
||||
[-] Definition of macro with the same name as one of the preprocessor's directives
|
||||
is no longer allowed.
|
||||
|
||||
[+] Allowed single quote character to be put inside the number value,
|
||||
to help improve long numbers readability.
|
||||
|
||||
[+] Added optional symbolic information output, and a set of tools that extract
|
||||
various kinds of information from it.
|
||||
|
||||
[+] Added "err" directive that allows to signalize error from the source.
|
||||
|
||||
|
||||
version 1.66 (May 7, 2006)
|
||||
|
||||
[+] Added "define" directive to preprocessor, which defines symbolic constants,
|
||||
the same kind as "equ" directive, however there's an important difference
|
||||
that "define" doesn't process symbolic constants in the value before
|
||||
assigning it. For example:
|
||||
|
||||
a equ 1
|
||||
a equ a+a
|
||||
|
||||
define b 1
|
||||
define b b+b
|
||||
|
||||
defines the "a" constant with value "1+1", but the "b" is defined with
|
||||
value "b+b". This directive may be useful in some advanced
|
||||
macroinstructions.
|
||||
|
||||
[-] Moved part of the conditional expression processing into parser,
|
||||
for slightly better performance and lesser memory usage by assembler.
|
||||
The logical values defined with "eq", "eqtype" and "in" operators are now
|
||||
evaluated by the parser and if they are enough to determine the condition,
|
||||
the whole block is processed accordingly. Thus this block:
|
||||
|
||||
if eax eq EAX | 0/0
|
||||
nop
|
||||
end if
|
||||
|
||||
is parsed into just "nop" instruction, since parser is able to determine
|
||||
that the condition is true, even though one of the logical values makes no
|
||||
sense - but since this is none of the "eq", "eqtype" and "in" expressions,
|
||||
the parser doesn't investigate.
|
||||
|
||||
[-] Also the assembler is now calculating only as many logical values as it
|
||||
needs to determine the condition. So this block:
|
||||
|
||||
if defined alpha & alpha
|
||||
|
||||
end if
|
||||
|
||||
will not cause error when "alpha" is not defined, as it would with previous
|
||||
versions. This is because after checking that "defined alpha" is false
|
||||
condition it doesn't need to know the second logical value to determine the
|
||||
value of conjunction.
|
||||
|
||||
[+] Added "short" keyword for specifying jump type, the "jmp byte" form is now
|
||||
obsolete and no longer correct - use "jmp short" instead.
|
||||
|
||||
[-] The size operator applied to jump no longer applies to the size of relative
|
||||
displacement - now it applies to the size of target address.
|
||||
|
||||
[-] The "ret" instruction with 0 parameter is now assembled into short form,
|
||||
unless you force using the 16-bit immediate with "word" operator.
|
||||
|
||||
[+] Added missing extended registers for the 32-bit addressing in long mode.
|
||||
|
||||
[+] Added "linkremove" and "linkinfo" section flags for MS COFF output.
|
||||
|
||||
[+] Added support for GOT offsets in ELF object formatter, which can be useful
|
||||
when making position-independent code for shared libraries. For any label
|
||||
you can get its offset relative to GOT by preceding it with "rva" operator
|
||||
(the same keyword as for PE format is used, to avoid adding a new one,
|
||||
while this one has very similar meaning).
|
||||
|
||||
[-] Changed ELF executable to use "segment" directive in place of "section",
|
||||
to make the distinction between the run-time segments and linkable
|
||||
sections. If you had a "section" directive in your ELF executables and they
|
||||
no longer assemble, replace it with "segment".
|
||||
|
||||
[-] The PE formatter now always creates the fixups directory when told to -
|
||||
even when there are no fixups to be put there (in such case it creates the
|
||||
directory with one empty block).
|
||||
|
||||
[-] Some of the internal structures have been extended to provide the
|
||||
possibility of making extensive symbol dumps.
|
||||
|
||||
[-] Corrected "fix" directive to keep the value intact before assigning it to the
|
||||
prioritized constant.
|
||||
|
||||
[+] The ` operator now works with any kind of symbol; when used with quoted
|
||||
string it simply does nothing. Thus the sequence of ` operators applied to
|
||||
one symbol work the same as if there was just one. In similar manner, the
|
||||
sequence of # operators now works as if it was a single one - using such a
|
||||
sequence instead of escaping, which was kept for some backward
|
||||
compatibility, is now deprecated.
|
||||
|
||||
[-] Corrected order of identifying assembler directives ("if db eq db" was
|
||||
incorrectly interpreted as data definition).
|
||||
|
||||
[-] Many other small bugs fixed.
|
||||
|
||||
|
||||
version 1.64 (Aug 8, 2005)
|
||||
|
||||
[+] Output of PE executables for Win64 architecture (with "format PE64"
|
||||
setting).
|
||||
|
||||
[+] Added "while" and "break" directives.
|
||||
|
||||
[+] Added "irp" and "irps" directives.
|
||||
|
||||
[+] The macro arguments can be marked as required with the "*" character.
|
||||
|
||||
[-] Fixed checking for overflow when multiplying 64-bit values - the result
|
||||
must always fit in the range of signed 64 integer now.
|
||||
|
||||
[-] Segment prefixes were generated incorrectly in 16-bit mode when BP was used
|
||||
as a second addressing register - fixed.
|
||||
|
||||
[-] The "local" directive was not creating unique labels in some cases - fixed.
|
||||
|
||||
[-] The "not encodable with long immediate" error in 64-bit mode was sometimes
|
||||
wrongly signaled - fixed.
|
||||
|
||||
[-] Other minor fixes and corrections.
|
||||
|
||||
|
||||
version 1.62 (Jun 14, 2005)
|
||||
|
||||
[+] Escaping of symbols inside macroinstructions with backslash.
|
||||
|
||||
[+] Ability of outputting the COFF object files for Win64 architecture
|
||||
(with "format MS64 COFF" setting).
|
||||
|
||||
[+] New preprocessor directives: "restruc", "rept" and "match"
|
||||
|
||||
[+] VMX instructions support (not documented).
|
||||
|
||||
[+] Extended data directives to allow use of the "dup" operator.
|
||||
|
||||
[+] Extended "struc" features to allow custom definitions of main structure's
|
||||
label.
|
||||
|
||||
[-] When building resources from the the .RES file that contained more
|
||||
than one resource of the same string name, the separate resource
|
||||
directories were created with the same names - fixed.
|
||||
|
||||
[-] Several bugs in the ELF64 object output has been fixed.
|
||||
|
||||
[-] Corrected behavior of "fix" directive to more straightforward.
|
||||
|
||||
[-] Fixed bug in "include" directive, which caused files included from within
|
||||
macros to be processed the wrong way.
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user