2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
; flat assembler core
|
2007-02-12 04:06:46 +03:00
|
|
|
; Copyright (c) 1999-2007, Tomasz Grysztar.
|
2006-01-03 12:43:31 +03:00
|
|
|
; All rights reserved.
|
|
|
|
|
|
|
|
out_of_memory:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _out_of_memory
|
|
|
|
jmp fatal_error
|
2006-01-03 12:43:31 +03:00
|
|
|
stack_overflow:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _stack_overflow
|
|
|
|
jmp fatal_error
|
2006-01-03 12:43:31 +03:00
|
|
|
main_file_not_found:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _main_file_not_found
|
|
|
|
jmp fatal_error
|
2006-01-03 12:43:31 +03:00
|
|
|
unexpected_end_of_file:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _unexpected_end_of_file
|
|
|
|
jmp fatal_error
|
2006-01-03 12:43:31 +03:00
|
|
|
code_cannot_be_generated:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _code_cannot_be_generated
|
|
|
|
jmp fatal_error
|
2006-01-03 12:43:31 +03:00
|
|
|
format_limitations_exceeded:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _format_limitations_exceeded
|
|
|
|
jmp fatal_error
|
|
|
|
invalid_definition:
|
|
|
|
push _invalid_definition
|
|
|
|
jmp fatal_error
|
2006-01-03 12:43:31 +03:00
|
|
|
write_failed:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _write_failed
|
|
|
|
jmp fatal_error
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
file_not_found:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _file_not_found
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
error_reading_file:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _error_reading_file
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_file_format:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_file_format
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_macro_arguments:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_macro_arguments
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
incomplete_macro:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _incomplete_macro
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
unexpected_characters:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _unexpected_characters
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_argument:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_argument
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
illegal_instruction:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _illegal_instruction
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_operand:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_operand
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_operand_size:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_operand_size
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
operand_size_not_specified:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _operand_size_not_specified
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
operand_sizes_do_not_match:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _operand_sizes_do_not_match
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_address_size:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_address_size
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
address_sizes_do_not_agree:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _address_sizes_do_not_agree
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
prefix_conflict:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _prefix_conflict
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
long_immediate_not_encodable:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _long_immediate_not_encodable
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
relative_jump_out_of_range:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _relative_jump_out_of_range
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_expression:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_expression
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_address:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_address
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_value:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_value
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
value_out_of_range:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _value_out_of_range
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
undefined_symbol:
|
2007-12-31 02:34:37 +03:00
|
|
|
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
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_use_of_symbol:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_use_of_symbol
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
name_too_long:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _name_too_long
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
invalid_name:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _invalid_name
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
reserved_word_used_as_symbol:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _reserved_word_used_as_symbol
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
symbol_already_defined:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _symbol_already_defined
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
missing_end_quote:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _missing_end_quote
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
missing_end_directive:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _missing_end_directive
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
unexpected_instruction:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _unexpected_instruction
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
extra_characters_on_line:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _extra_characters_on_line
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
section_not_aligned_enough:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _section_not_aligned_enough
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
setting_already_specified:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _setting_already_specified
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
data_already_defined:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _data_already_defined
|
|
|
|
jmp assembler_error
|
2006-01-03 12:43:31 +03:00
|
|
|
too_many_repeats:
|
2007-12-31 02:34:37 +03:00
|
|
|
push _too_many_repeats
|
|
|
|
jmp assembler_error
|