Subversion Repositories Kolibri OS

Rev

Rev 2665 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. ; flat assembler core
  3. ; Copyright (c) 1999-2013, Tomasz Grysztar.
  4. ; All rights reserved.
  5.  
  6. out_of_memory:
  7.         push    _out_of_memory
  8.         jmp     fatal_error
  9. stack_overflow:
  10.         push    _stack_overflow
  11.         jmp     fatal_error
  12. main_file_not_found:
  13.         push    _main_file_not_found
  14.         jmp     fatal_error
  15. write_failed:
  16.         push    _write_failed
  17.         jmp     fatal_error
  18.  
  19. unexpected_end_of_file:
  20.         push    _unexpected_end_of_file
  21.         jmp     general_error
  22. code_cannot_be_generated:
  23.         push    _code_cannot_be_generated
  24.         jmp     general_error
  25. format_limitations_exceeded:
  26.         push    _format_limitations_exceeded
  27.     general_error:
  28.         cmp     [symbols_file],0
  29.         je      fatal_error
  30.         call    dump_preprocessed_source
  31.         jmp     fatal_error
  32.  
  33. file_not_found:
  34.         push    _file_not_found
  35.         jmp     error_with_source
  36. error_reading_file:
  37.         push    _error_reading_file
  38.         jmp     error_with_source
  39. invalid_file_format:
  40.         push    _invalid_file_format
  41.         jmp     error_with_source
  42. invalid_macro_arguments:
  43.         push    _invalid_macro_arguments
  44.         jmp     error_with_source
  45. incomplete_macro:
  46.         push    _incomplete_macro
  47.         jmp     error_with_source
  48. unexpected_characters:
  49.         push    _unexpected_characters
  50.         jmp     error_with_source
  51. invalid_argument:
  52.         push    _invalid_argument
  53.         jmp     error_with_source
  54. illegal_instruction:
  55.         push    _illegal_instruction
  56.         jmp     error_with_source
  57. invalid_operand:
  58.         push    _invalid_operand
  59.         jmp     error_with_source
  60. invalid_operand_size:
  61.         push    _invalid_operand_size
  62.         jmp     error_with_source
  63. operand_size_not_specified:
  64.         push    _operand_size_not_specified
  65.         jmp     error_with_source
  66. operand_sizes_do_not_match:
  67.         push    _operand_sizes_do_not_match
  68.         jmp     error_with_source
  69. invalid_address_size:
  70.         push    _invalid_address_size
  71.         jmp     error_with_source
  72. address_sizes_do_not_agree:
  73.         push    _address_sizes_do_not_agree
  74.         jmp     error_with_source
  75. disallowed_combination_of_registers:
  76.         push    _disallowed_combination_of_registers
  77.         jmp     error_with_source
  78. long_immediate_not_encodable:
  79.         push    _long_immediate_not_encodable
  80.         jmp     error_with_source
  81. relative_jump_out_of_range:
  82.         push    _relative_jump_out_of_range
  83.         jmp     error_with_source
  84. invalid_expression:
  85.         push    _invalid_expression
  86.         jmp     error_with_source
  87. invalid_address:
  88.         push    _invalid_address
  89.         jmp     error_with_source
  90. invalid_value:
  91.         push    _invalid_value
  92.         jmp     error_with_source
  93. value_out_of_range:
  94.         push    _value_out_of_range
  95.         jmp     error_with_source
  96. undefined_symbol:
  97.         mov     edi,message
  98.         mov     esi,_undefined_symbol
  99.         call    copy_asciiz
  100.         push    message
  101.         cmp     [error_info],0
  102.         je      error_with_source
  103.         mov     esi,[error_info]
  104.         mov     esi,[esi+24]
  105.         or      esi,esi
  106.         jz      error_with_source
  107.         mov     byte [edi-1],20h
  108.         call    write_quoted_symbol_name
  109.         jmp     error_with_source
  110.     copy_asciiz:
  111.         lods    byte [esi]
  112.         stos    byte [edi]
  113.         test    al,al
  114.         jnz     copy_asciiz
  115.         ret
  116.     write_quoted_symbol_name:
  117.         mov     al,27h
  118.         stosb
  119.         movzx   ecx,byte [esi-1]
  120.         rep     movs byte [edi],[esi]
  121.         mov     ax,27h
  122.         stosw
  123.         ret
  124. symbol_out_of_scope:
  125.         mov     edi,message
  126.         mov     esi,_symbol_out_of_scope_1
  127.         call    copy_asciiz
  128.         cmp     [error_info],0
  129.         je      finish_symbol_out_of_scope_message
  130.         mov     esi,[error_info]
  131.         mov     esi,[esi+24]
  132.         or      esi,esi
  133.         jz      finish_symbol_out_of_scope_message
  134.         mov     byte [edi-1],20h
  135.         call    write_quoted_symbol_name
  136.     finish_symbol_out_of_scope_message:
  137.         mov     byte [edi-1],20h
  138.         mov     esi,_symbol_out_of_scope_2
  139.         call    copy_asciiz
  140.         push    message
  141.         jmp     error_with_source
  142. invalid_use_of_symbol:
  143.         push    _invalid_use_of_symbol
  144.         jmp     error_with_source
  145. name_too_long:
  146.         push    _name_too_long
  147.         jmp     error_with_source
  148. invalid_name:
  149.         push    _invalid_name
  150.         jmp     error_with_source
  151. reserved_word_used_as_symbol:
  152.         push    _reserved_word_used_as_symbol
  153.         jmp     error_with_source
  154. symbol_already_defined:
  155.         push    _symbol_already_defined
  156.         jmp     error_with_source
  157. missing_end_quote:
  158.         push    _missing_end_quote
  159.         jmp     error_with_source
  160. missing_end_directive:
  161.         push    _missing_end_directive
  162.         jmp     error_with_source
  163. unexpected_instruction:
  164.         push    _unexpected_instruction
  165.         jmp     error_with_source
  166. extra_characters_on_line:
  167.         push    _extra_characters_on_line
  168.         jmp     error_with_source
  169. section_not_aligned_enough:
  170.         push    _section_not_aligned_enough
  171.         jmp     error_with_source
  172. setting_already_specified:
  173.         push    _setting_already_specified
  174.         jmp     error_with_source
  175. data_already_defined:
  176.         push    _data_already_defined
  177.         jmp     error_with_source
  178. too_many_repeats:
  179.         push    _too_many_repeats
  180.         jmp     error_with_source
  181. assertion_failed:
  182.         push    _assertion_failed
  183.         jmp     error_with_source
  184. invoked_error:
  185.         push    _invoked_error
  186.     error_with_source:
  187.         cmp     [symbols_file],0
  188.         je      assembler_error
  189.         call    dump_preprocessed_source
  190.         call    restore_preprocessed_source
  191.         jmp     assembler_error
  192.