peter преди 26 години
родител
ревизия
4841b4236c
променени са 13 файла, в които са добавени 755 реда и са изтрити 913 реда
  1. 8 8
      compiler/ag386bin.pas
  2. 7 4
      compiler/assemble.pas
  3. 34 50
      compiler/i386asm.pas
  4. 88 148
      compiler/msgidx.inc
  5. 174 235
      compiler/msgtxt.inc
  6. 5 2
      compiler/og386.pas
  7. 6 1
      compiler/pstatmnt.pas
  8. 8 5
      compiler/ra386.pas
  9. 140 210
      compiler/ra386att.pas
  10. 13 10
      compiler/ra386dir.pas
  11. 101 96
      compiler/ra386int.pas
  12. 144 142
      compiler/rautils.pas
  13. 27 2
      compiler/systems.pas

+ 8 - 8
compiler/ag386bin.pas

@@ -422,7 +422,7 @@ unit ag386bin;
              ait_datablock :
                begin
                  if objectalloc^.currsec<>sec_bss then
-                  writeln('allocating of data is only allowed in bss section');
+                  Message(asmw_e_alloc_data_only_in_bss);
 {$ifdef EXTERNALBSS}
                  if pai_datablock(hp)^.is_global then
                   begin
@@ -516,9 +516,9 @@ unit ag386bin;
              ait_instruction :
                objectalloc^.sectionalloc(pai386(hp)^.Pass1(objectalloc^.sectionsize));
              ait_direct :
-               Comment(V_Fatal,'direct asm not supported with binary writers');
+               Message(asmw_f_direct_not_supported);
              ait_comp :
-               Comment(V_Fatal,'comp not supported');
+               Message(asmw_f_comp_not_supported);
              ait_cut :
                break;
            end;
@@ -752,10 +752,7 @@ unit ag386bin;
       begin
         case t of
           og_none :
-            begin
-              writeln('no binary writer selected');
-              exit;
-            end;
+            Message(asmw_f_no_binary_writer_selected);
           og_dbg :
             objectoutput:=new(pdbgoutput,init);
           og_coff :
@@ -777,7 +774,10 @@ unit ag386bin;
 end.
 {
   $Log$
-  Revision 1.3  1999-05-05 17:34:29  peter
+  Revision 1.4  1999-05-05 22:21:47  peter
+    * updated messages
+
+  Revision 1.3  1999/05/05 17:34:29  peter
     * output is more like as 2.9.1
     * stabs really working for go32v2
 

+ 7 - 4
compiler/assemble.pas

@@ -27,7 +27,7 @@ interface
 {$ifdef OLDASM}
   {$define NOAG386BIN}
 {$endif}
-  
+
 uses
 {$ifdef Delphi}
   dmisc,
@@ -247,7 +247,7 @@ var
 begin
   inc(SmartLinkFilesCnt);
   if SmartLinkFilesCnt>999999 then
-   Message(assem_f_too_many_asm_files);
+   Message(asmw_f_too_many_asm_files);
   if IsEndFile then
    begin
      s:=current_module^.asmprefix^+'e';
@@ -524,7 +524,7 @@ begin
   {$endif NoAg68kMpw}
 {$endif}
   else
-    Message(assem_f_assembler_output_not_supported);
+    Message(asmw_f_assembler_output_not_supported);
   end;
   a^.AsmCreate;
   a^.WriteAsmList;
@@ -548,7 +548,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.45  1999-05-04 21:44:33  florian
+  Revision 1.46  1999-05-05 22:21:48  peter
+    * updated messages
+
+  Revision 1.45  1999/05/04 21:44:33  florian
     * changes to compile it with Delphi 4.0
 
   Revision 1.44  1999/05/02 23:28:42  peter

+ 34 - 50
compiler/i386asm.pas

@@ -822,7 +822,11 @@ begin
   i:=instabcache^[opcode];
   if i=-1 then
    begin
-     Comment(V_Warning,'opcode not in the table !');
+{$ifdef TP}
+     Message1(asmw_e_opcode_not_in_table,'');
+{$else}
+     Message1(asmw_e_opcode_not_in_table,att_op2str[opcode]);
+{$endif}
      exit;
    end;
   insentry:=@instab[i];
@@ -842,14 +846,7 @@ begin
      insentry:=@instab[i];
    end;
   if insentry^.opcode<>opcode then
-   begin
-     case size_prob of
-      1 : Comment(V_Warning,GetString+' operation size not specified');
-      2 : Comment(V_Warning,GetString+' mismatch in operand sizes');
-     else
-      Comment(V_Warning,GetString+' invalid combination of opcode and operands');
-     end;
-   end;
+   Message1(asmw_e_invalid_opcode_and_operands,GetString);
 { No instruction found, set insentry to nil and inssize to -1 }
   insentry:=nil;
   inssize:=-1;
@@ -925,7 +922,7 @@ begin
       regval:=7;
     else
       begin
-        Comment(V_Warning,'invalid register operand given to regval()');
+        internalerror(777001);
         regval:=0;
       end;
   end;
@@ -989,7 +986,7 @@ begin
      { 16 bit address? }
      if not((i in [R_NO,R_EAX,R_EBX,R_ECX,R_EDX,R_EBP,R_ESP,R_ESI,R_EDI]) and
             (b in [R_NO,R_EAX,R_EBX,R_ECX,R_EDX,R_EBP,R_ESP,R_ESI,R_EDI])) then
-      Comment(V_Warning,'16 bit ea not supported');
+      Message(asmw_e_16bit_not_supported);
 {$ifdef OPTEA}
      { make single reg base }
      if (b=R_NO) and (s=1) then
@@ -1142,21 +1139,19 @@ begin
         end;
       224,225,226 :
         begin
-          Comment(V_Warning,'not supported');
+          InternalError(777002);
         end;
       else
         begin
           if (c>=64) and (c<=191) then
            begin
              if not process_ea(oper[(c shr 3) and 7], ea_data, 0) then
-              Comment(V_Warning,'invalid effective address')
+              Message(asmw_e_invalid_effective_address)
              else
               inc(len,ea_data.size);
            end
           else
-           begin
-             Comment(V_Warning,'internal instruction table corrupt: instruction code '+tostr(c)+' given');
-           end;
+           InternalError(777003);
         end;
     end;
   until false;
@@ -1233,7 +1228,7 @@ var
           currsym:=oper[opidx].sym;
         end;
       else
-        Comment(V_Error,'immediate or reference expected');
+        Message(asmw_e_immediate_or_reference_expected);
     end;
   end;
 
@@ -1296,7 +1291,7 @@ begin
                  bytes[0]:=$16;
               end;
             else
-              Comment(V_Warning,'bizarre 8086 segment register received');
+              InternalError(777004);
           end;
           objectoutput^.writebytes(bytes,1);
         end;
@@ -1318,7 +1313,7 @@ begin
                  bytes[0]:=$a8;
               end;
             else
-              Comment(V_Warning,'bizarre 386 segment register received');
+              InternalError(777005);
           end;
           objectoutput^.writebytes(bytes,1);
         end;
@@ -1337,7 +1332,7 @@ begin
         begin
           getvalsym(c-12);
           if (currval<-128) or (currval>127) then
-           Comment(V_Warning,'signed byte value exceeds bounds '+tostr(currval));
+           Message2(asmw_e_value_exceeds_bounds,'signed byte',tostr(currval));
           if assigned(currsym) then
             objectoutput^.writereloc(currval,1,currsym,relative_false)
           else
@@ -1347,7 +1342,7 @@ begin
         begin
           getvalsym(c-16);
           if (currval<-256) or (currval>255) then
-            Comment(V_Warning,'byte value exceeds bounds '+tostr(currval));
+           Message2(asmw_e_value_exceeds_bounds,'byte',tostr(currval));
           if assigned(currsym) then
            objectoutput^.writereloc(currval,1,currsym,relative_false)
           else
@@ -1357,7 +1352,7 @@ begin
         begin
           getvalsym(c-20);
           if (currval<0) or (currval>255) then
-            Comment(V_Warning,'unsigned byte value exceeds bounds '+tostr(currval));
+           Message2(asmw_e_value_exceeds_bounds,'unsigned byte',tostr(currval));
           if assigned(currsym) then
            objectoutput^.writereloc(currval,1,currsym,relative_false)
           else
@@ -1367,16 +1362,12 @@ begin
         begin
           getvalsym(c-24);
           if (currval<-65536) or (currval>65535) then
-            Comment(V_Warning,'word value exceeds bounds '+tostr(currval));
+           Message2(asmw_e_value_exceeds_bounds,'word',tostr(currval));
           if assigned(currsym) then
            objectoutput^.writereloc(currval,2,currsym,relative_false)
           else
            objectoutput^.writebytes(currval,2);
         end;
-      31 :
-        begin
-          Comment(V_Warning,'not supported');
-        end;
       28,29,30 :
         begin
           getvalsym(c-28);
@@ -1400,13 +1391,9 @@ begin
           if assigned(currsym) then
            inc(data,currsym^.address);
           if (data>127) or (data<-128) then
-           Comment(V_Warning,'short jump is out of range '+tostr(data));
+           Message1(asmw_e_short_jmp_out_of_range,tostr(data));
           objectoutput^.writebytes(data,1);
         end;
-      48,49,50 :
-        begin
-          Comment(V_Warning,'rel2adr not supported');
-        end;
       52,53,54 :
         begin
           getvalsym(c-52);
@@ -1436,32 +1423,28 @@ begin
           bytes[0]:=$67;
           objectoutput^.writebytes(bytes,1);
         end;
-      201 :
-        begin
-        end;
-      202 :
-        begin
-        end;
       208 :
         begin
           bytes[0]:=$66;
           objectoutput^.writebytes(bytes,1);
         end;
-      209 :
-        begin
-        end;
-      210 :
-        begin
-        end;
       216 :
         begin
           bytes[0]:=ord(codes^)+condval[condition];
           inc(codes);
           objectoutput^.writebytes(bytes,1);
         end;
+      201,
+      202,
+      209,
+      210 :
+        begin
+        end;
+      31,
+      48,49,50,
       224,225,226 :
         begin
-          Comment(V_Warning,'not supported');
+          InternalError(777006);
         end
       else
         begin
@@ -1478,7 +1461,7 @@ begin
               rfield:=c and 7;
              opidx:=(c shr 3) and 7;
              if not process_ea(oper[opidx], ea_data, rfield) then
-              Comment(V_Warning,'invalid effective address');
+              Message(asmw_e_invalid_effective_address);
 
              pb:=@bytes;
              pb^:=chr(ea_data.modrm);
@@ -1514,9 +1497,7 @@ begin
              end;
            end
           else
-           begin
-             Comment(V_Warning,'internal instruction table corrupt: instruction code '+tostr(c)+' given');
-           end;
+           InternalError(777007);
         end;
     end;
   until false;
@@ -1579,7 +1560,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.3  1999-05-02 22:41:53  peter
+  Revision 1.4  1999-05-05 22:21:51  peter
+    * updated messages
+
+  Revision 1.3  1999/05/02 22:41:53  peter
     * moved section names to systems
     * fixed nasm,intel writer
 

+ 88 - 148
compiler/msgidx.inc

@@ -197,6 +197,7 @@ type tmsgconst=(
   parser_e_duplicate_message_label,
   parser_e_self_in_non_message_handler,
   parser_e_threadvars_only_sg,
+  parser_f_direct_assembler_not_allowed,
   type_e_mismatch,
   type_e_incompatible_types,
   type_e_integer_expr_expected,
@@ -285,154 +286,93 @@ type tmsgconst=(
   cg_w_may_wrong_math_argument,
   cg_e_cannot_call_cons_dest_inside_with,
   cg_e_cannot_call_message_direct,
-  assem_f_ev_zero_divide,
-  assem_f_ev_stack_overflow,
-  assem_f_ev_stack_underflow,
-  assem_f_ev_invalid_number,
-  assem_f_ev_invalid_op,
-  assem_f_ev_unknown,
-  assem_w_invalid_numeric,
-  assem_e_escape_seq_ignored,
-  assem_e_syn_prefix_not_found,
-  assem_e_syn_try_add_more_prefix,
-  assem_e_syn_opcode_not_found,
-  assem_e_invalid_symbol_ref,
-  assem_w_calling_overload_func,
-  assem_e_constant_out_of_bounds,
-  assem_e_none_label_contain_at,
-  assem_e_invalid_operand,
-  assem_w_override_op_not_supported,
-  assem_e_error_in_binary_const,
-  assem_e_error_in_octal_const,
-  assem_e_error_in_hex_const,
-  assem_e_error_in_integer_const,
-  assem_e_invalid_labeled_opcode,
-  assem_f_internal_error_in_findtype,
-  assem_e_invalid_size_movzx,
-  assem_e_16bit_base_in_32bit_segment,
-  assem_e_16bit_index_in_32bit_segment,
-  assem_e_invalid_opcode,
-  assem_e_const_ref_not_allowed,
-  assem_w_fwait_emu_prob,
-  assem_e_invalid_opcode_and_operand,
-  assem_e_unsupported_opcode_and_operand,
-  assem_w_opcode_not_in_table,
-  assem_f_internal_error_in_concatopcode,
-  assem_e_invalid_size_in_ref,
-  assem_e_invalid_middle_sized_operand,
-  assem_e_invalid_three_operand_opcode,
-  assem_e_syntax_error,
-  assem_e_invalid_operand_type,
-  assem_e_segment_override_not_supported,
-  assem_e_invalid_const_symbol,
-  assem_f_error_converting_bin,
-  assem_f_error_converting_hex,
-  assem_f_error_converting_octal,
-  assem_e_invalid_constant_expression,
-  assem_e_unknown_id,
-  assem_e_defining_index_more_than_once,
-  assem_e_invalid_field_specifier,
-  assem_f_internal_error_in_buildscale,
-  assem_e_invalid_scaling_factor,
-  assem_e_invalid_scaling_value,
-  assem_e_scaling_value_only_allowed_with_index,
-  assem_e_syn_no_ref_with_brackets,
-  assem_e_expression_form_not_supported,
-  assem_e_defining_seg_more_than_once,
-  assem_e_defining_base_more_than_once,
-  assem_e_negative_index_register,
-  assem_e_syn_reference,
-  assem_e_local_symbol_not_allowed_as_ref,
-  assem_e_invalid_operand_in_bracket_expression,
-  assem_e_invalid_symbol_name,
-  assem_e_invalid_reference_syntax,
-  assem_e_invalid_string_as_opcode_operand,
-  assem_w_CODE_and_DATA_not_supported,
-  assem_e_null_label_ref_not_allowed,
-  assem_w_calling_overloaded,
-  assem_e_cannot_use_SELF_outside_a_method,
-  assem_e_syn_start_with_bracket,
-  assem_e_syn_register,
-  assem_e_SEG_and_OFFSET_not_supported,
-  assem_e_syn_opcode_operand,
-  assem_e_invalid_string_expression,
-  assem_e_expression_out_of_bounds,
-  assem_f_internal_error_in_buildconstant,
-  assem_w_repeat_prefix_and_seg_override,
-  assem_e_invalid_or_missing_opcode,
-  assem_e_invalid_prefix_and_opcode,
-  assem_e_invalid_override_and_opcode,
-  assem_e_too_many_operands,
-  assem_e_dup_local_sym,
-  assem_e_unknown_label_identifer,
-  assem_e_assemble_node_syntax_error,
-  assem_e_unknown_local_sym,
-  assem_d_start_intel,
-  assem_d_finish_intel,
-  assem_e_not_directive_or_local_symbol,
-  assem_e_slash_at_begin_of_line_not_allowed,
-  assem_e_nor_not_supported,
-  assem_e_invalid_fpu_register,
-  assem_w_modulo_not_supported,
-  assem_e_invalid_float_const,
-  assem_e_size_suffix_and_dest_reg_dont_match,
-  assem_e_size_suffix_and_dest_dont_match,
-  assem_w_size_suffix_and_dest_dont_match,
-  assem_f_internal_error_in_concatlabeledinstr,
-  assem_w_float_bin_ignored,
-  assem_w_float_hex_ignored,
-  assem_w_float_octal_ignored,
-  assem_e_invalid_real_const,
-  assem_e_parenthesis_are_not_allowed,
-  assem_e_invalid_reference,
-  assem_e_cannot_use___SELF_outside_methode,
-  assem_e_cannot_use___OLDEBP_outside_nested_procedure,
-  assem_w_id_supposed_external,
-  assem_e_invalid_seg_override,
-  assem_e_string_not_allowed_as_const,
-  assem_d_start_att,
-  assem_d_finish_att,
-  assem_e_switching_sections_not_allowed,
-  assem_e_invalid_global_def,
-  assem_e_line_separator_expected,
-  assem_w_globl_not_supported,
-  assem_w_align_not_supported,
-  assem_w_lcomm_not_supported,
-  assem_w_comm_not_supported,
-  assem_e_invalid_lcomm_def,
-  assem_e_invalid_comm_def,
-  assem_e_local_sym_not_found_in_asm_statement,
-  assem_e_assembler_code_not_returned_to_text,
-  assem_f_internal_error_in_buildreference,
-  assem_e_invalid_opcode_size,
-  assem_w_near_ignored,
-  assem_w_far_ignored,
-  assem_d_creating_lookup_tables,
-  assem_w_using_defined_as_local,
-  assem_f_internal_error_in_handleextend,
-  assem_e_invalid_char_smaller,
-  assem_e_invalid_char_greater,
-  assem_e_unsupported_opcode,
-  assem_e_no_inc_and_dec_together,
-  assem_e_invalid_reg_list_in_movem,
-  assem_e_invalid_reg_list_for_opcode,
-  assem_e_68020_mode_required,
-  assem_d_start_motorola,
-  assem_d_finish_motorola,
-  assem_w_xdef_not_supported,
-  assem_w_void_function,
-  assem_f_invalid_suffix_intel,
-  assem_e_extended_not_supported,
-  assem_e_comp_not_supported,
-  assem_w_mmxwarning_as_281,
-  assem_f_too_many_asm_files,
-  assem_f_assembler_output_not_supported,
-  assem_e_unsupported_symbol_type,
-  assem_e_cannot_index_relative_var,
-  assem_h_direct_global_to_mangled,
-  assem_w_direct_global_is_overloaded_func,
-  assem_d_arg_offset,
-  assem_d_arg_unfound_offset,
+  asmr_d_start_reading,
+  asmr_d_finish_reading,
+  asmr_e_none_label_contain_at,
+  asmr_w_override_op_not_supported,
+  asmr_e_building_record_offset,
+  asmr_e_offset_without_identifier,
+  asmr_e_no_local_or_para_allowed,
+  asmr_e_need_offset,
+  asmr_e_cant_have_multiple_relocatable_symbols,
+  asmr_e_only_add_relocatable_symbol,
+  asmr_e_invalid_constant_expression,
+  asmr_e_relocatable_symbol_not_allowed,
+  asmr_e_invalid_reference_syntax,
+  asmr_e_local_symbol_not_allowed_as_ref,
+  asmr_e_wrong_base_index,
+  asmr_e_wrong_scale_factor,
+  asmr_e_multiple_index,
+  asmr_e_invalid_operand_type,
+  asmr_e_invalid_string_as_opcode_operand,
+  asmr_w_CODE_and_DATA_not_supported,
+  asmr_e_null_label_ref_not_allowed,
+  asmr_e_ev_zero_divide,
+  asmr_e_ev_stack_overflow,
+  asmr_e_ev_stack_underflow,
+  asmr_e_ev_invalid_number,
+  asmr_e_ev_invalid_op,
+  asmr_e_escape_seq_ignored,
+  asmr_e_invalid_symbol_ref,
+  asmr_w_fwait_emu_prob,
+  asmr_w_calling_overload_func,
+  asmr_e_unsupported_symbol_type,
+  asmr_e_constant_out_of_bounds,
+  asmr_e_error_converting_decimal,
+  asmr_e_error_converting_octal,
+  asmr_e_error_converting_binary,
+  asmr_e_error_converting_hexadecimal,
+  asmr_h_direct_global_to_mangled,
+  asmr_w_direct_global_is_overloaded_func,
+  asmr_e_cannot_use_SELF_outside_a_method,
+  asmr_e_cannot_use___SELF_outside_methode,
+  asmr_e_cannot_use___OLDEBP_outside_nested_procedure,
+  asmr_e_void_function,
+  asmr_e_SEG_not_supported,
+  asmr_e_size_suffix_and_dest_dont_match,
+  asmr_w_size_suffix_and_dest_dont_match,
+  asmr_e_syntax_error,
+  asmr_e_invalid_opcode_and_operand,
+  asmr_e_syn_operand,
+  asmr_e_syn_constant,
+  asmr_e_invalid_string_expression,
+  asmr_w_const32bit_for_address,
+  asmr_e_invalid_or_missing_opcode,
+  asmr_e_invalid_prefix_and_opcode,
+  asmr_e_invalid_override_and_opcode,
+  asmr_e_too_many_operands,
+  asmr_w_near_ignored,
+  asmr_w_far_ignored,
+  asmr_e_dup_local_sym,
+  asmr_e_unknown_local_sym,
+  asmr_e_unknown_label_identifier,
+  asmr_e_invalid_fpu_register,
+  asmr_e_nor_not_supported,
+  asmr_w_modulo_not_supported,
+  asmr_e_invalid_float_const,
+  asmr_e_invalid_float_expr,
+  asmr_e_wrong_sym_type,
+  asmr_e_cannot_index_relative_var,
+  asmr_e_invalid_seg_override,
+  asmr_w_id_supposed_external,
+  asmr_e_string_not_allowed_as_const,
+  asmr_e_no_var_type_specified,
+  asmr_w_assembler_code_not_returned_to_text,
+  asmr_e_not_directive_or_local_symbol,
+  asmr_w_using_defined_as_local,
+  asmw_f_too_many_asm_files,
+  asmw_f_assembler_output_not_supported,
+  asmw_f_comp_not_supported,
+  asmw_f_direct_not_supported,
+  asmw_e_alloc_data_only_in_bss,
+  asmw_f_no_binary_writer_selected,
+  asmw_e_opcode_not_in_table,
+  asmw_e_invalid_opcode_and_operands,
+  asmw_e_16bit_not_supported,
+  asmw_e_invalid_effective_address,
+  asmw_e_immediate_or_reference_expected,
+  asmw_e_value_exceeds_bounds,
+  asmw_e_short_jmp_out_of_range,
   exec_w_source_os_redefined,
   exec_i_assembling_pipe,
   exec_d_cant_create_asmfile,

+ 174 - 235
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
-const msgtxt : array[0..    00103] of string[240]=(
+const msgtxt : array[0..    00093] of string[240]=(
 {$else Delphi}
-const msgtxt : array[0..    00103,1..240] of char=(
+const msgtxt : array[0..    00093,1..240] of char=(
 {$endif Delphi}
   'T_Compiler: $1'#000+
   'D_Compiler OS: $1'#000+
@@ -209,277 +209,216 @@ const msgtxt : array[0..    00103,1..240] of char=(
   'E_Duplicate message label: %1'#000+
   'E_Self can be only an explicit parameter in message handlers'#000+
   'E_Thr','eadvars can be only static or global'#000+
+  'F_Direct assembler not supported for output format'#000+
   'E_Type mismatch'#000+
   'E_Incompatible types: got $1 expected $2'#000+
   'E_Integer expression expected'#000+
   'E_Ordinal expression expected'#000+
   'E_Type identifier expected'#000+
-  'E_Variable identifier expected'#000+
+  'E_Variab','le identifier expected'#000+
   'E_pointer type expected'#000+
-  'E_cl','ass type expected'#000+
+  'E_class type expected'#000+
   'E_Variable or type indentifier expected'#000+
   'E_Can'#039't evaluate constant expression'#000+
   'E_Set elements are not compatible'#000+
   'E_Operation not implemented for sets'#000+
-  'W_Automatic type conversion from floating type to COMP which is an int'+
-  'eger',' type'#000+
+  'W_Automatic type conver','sion from floating type to COMP which is an i'+
+  'nteger type'#000+
   'H_use DIV instead to get an integer result'#000+
   'E_string types doesn'#039't match, because of $V+ mode'#000+
   'E_succ or pred on enums with assignments not possible'#000+
-  'E_Can'#039't read or write variables of this type'#000+
+  'E_Can'#039't read or write variables of t','his type'#000+
   'E_Type conflict between set elements'#000+
-  'W_lo/','hi(longint/dword) returns the upper/lower word'#000+
+  'W_lo/hi(longint/dword) returns the upper/lower word'#000+
   'E_Integer or real expression expected'#000+
   'E_Wrong type in array constructor'#000+
   'E_Incompatible type for arg #$1: Got $2, expected $3'#000+
-  'E_Identifier not found $1'#000+
+  'E_Identifier not ','found $1'#000+
   'F_Internal Error in SymTableStack()'#000+
-  'E_Dupl','icate identifier $1'#000+
+  'E_Duplicate identifier $1'#000+
   'E_Unknown identifier $1'#000+
   'E_Forward declaration not solved $1'#000+
   'F_Identifier type already defined as type'#000+
   'E_Error in type definition'#000+
   'E_Type identifier not defined'#000+
-  'E_Forward type not resolved $1'#000+
-  'E_Only static variables can be',' used in static methods or outside met'+
-  'hods'#000+
+  'E_Forward ','type not resolved $1'#000+
+  'E_Only static variables can be used in static methods or outside metho'+
+  'ds'#000+
   'E_Invalid call to tvarsym.mangledname()'#000+
   'F_record or class type expected'#000+
   'E_Instances of classes or objects with abstract method are not allowed'+
   #000+
-  'W_Label not defined $1'#000+
+  'W_L','abel not defined $1'#000+
   'E_Illegal label declaration'#000+
-  'E_G','OTO und LABEL are not supported (use command line switch -Sg)'#000+
+  'E_GOTO und LABEL are not supported (use command line switch -Sg)'#000+
   'E_Label not found'#000+
   'E_identifier isn'#039't a label'#000+
   'E_label already defined'#000+
   'E_illegal type declaration of set elements'#000+
-  'E_Forward class definition not resolved $1'#000+
-  'H_Parameter not used $1',#000+
+  'E_Forward class',' definition not resolved $1'#000+
+  'H_Parameter not used $1'#000+
   'N_Local variable not used $1'#000+
   'E_Set type expected'#000+
   'W_Function result does not seem to be set'#000+
   'E_Unknown record field identifier $1'#000+
   'W_Local variable $1 does not seem to be initialized'#000+
-  'E_identifier idents no member $1'#000+
+  'E_identi','fier idents no member $1'#000+
   'B_Found declaration: $1'#000+
-  'E_','BREAK not allowed'#000+
+  'E_BREAK not allowed'#000+
   'E_CONTINUE not allowed'#000+
   'E_Expression too complicated - FPU stack overflow'#000+
   'E_Illegal expression'#000+
   'E_Invalid integer'#000+
   'E_Illegal qualifier'#000+
   'E_High range limit < low range limit'#000+
-  'E_Illegal counter variable'#000+
-  'E_Can'#039't determine which ov','erloaded function to call'#000+
+  'E_','Illegal counter variable'#000+
+  'E_Can'#039't determine which overloaded function to call'#000+
   'E_Parameter list size exceeds 65535 bytes'#000+
   'E_Illegal type conversion'#000+
   'E_File types must be var parameters'#000+
   'E_The use of a far pointer isn'#039't allowed there'#000+
-  'E_illegal call by reference parameters'#000+
-  'E_EXPORT declared functi','ons can'#039't be called'#000+
+  'E_illegal ca','ll by reference parameters'#000+
+  'E_EXPORT declared functions can'#039't be called'#000+
   'W_Possible illegal call of constructor or destructor (doesn'#039't matc'+
   'h to this context)'#000+
   'N_Inefficient code'#000+
   'W_unreachable code'#000+
   'E_procedure call with stackframe ESP/SP'#000+
-  'E_Abstract methods can'#039't be called directly'#000+
-  'F_Internal Er','ror in getfloatreg(), allocation failure'#000+
+  'E_Abst','ract methods can'#039't be called directly'#000+
+  'F_Internal Error in getfloatreg(), allocation failure'#000+
   'F_Unknown float type'#000+
   'F_SecondVecn() base defined twice'#000+
   'F_Extended cg68k not supported'#000+
   'F_32-bit unsigned not supported in MC68000 mode'#000+
-  'F_Internal Error in secondinline()'#000+
+  'F_Internal Err','or in secondinline()'#000+
   'D_Register $1 weight $2 $3'#000+
-  'E_S','tack limit excedeed in local routine'#000+
+  'E_Stack limit excedeed in local routine'#000+
   'D_Stack frame is omited'#000+
   'E_Unable to inline object methods'#000+
   'E_Unable to inline procvar calls'#000+
   'E_No code for inline procedure stored'#000+
-  'E_Element zero of an ansi/wide- or longstring can'#039't be accessed, u'+
-  'se (set)','length instead'#000+
+  'E_Element zero of an an','si/wide- or longstring can'#039't be accessed,'+
+  ' use (set)length instead'#000+
   'E_Include or exclude not implemented in this case'#000+
   'W_Probably illegal constant passed to internal math function'#000+
-  'E_Constructors or destructors can not be called inside with here'#000+
+  'E_Constructors or destructors can not be called inside with her','e'#000+
   'E_Cannot call message handler method directly'#000+
-  'F_D','ivide by zero in asm evaluator'#000+
+  'D_Starting $1 styled assembler parsing'#000+
+  'D_Finished $1 styled assembler parsing'#000+
+  'E_Non-label pattern contains @'#000+
+  'W_Override operator not supported'#000+
+  'E_Error building record offset'#000+
+  'E_OFFSET used with','out identifier'#000+
+  'E_Cannot use local variable or parameters here'#000+
+  'E_need to use OFFSET here'#000+
+  'E_Cannot use multiple relocatable symbols'#000+
+  'E_Relocatable symbol can only be added'#000+
+  'E_Invalid constant expression'#000+
+  'E_Relocatable symbol is not allowed'#000+
+  'E_Inv','alid reference syntax'#000+
+  'E_Local symbols not allowed as references'#000+
+  'E_Invalid base and index register usage'#000+
+  'E_Wrong scale factor specified'#000+
+  'E_Multiple index register usage'#000+
+  'E_Invalid operand type'#000+
+  'E_Invalid string as opcode operand: $1'#000+
+  'W_@CODE and',' @DATA not supported'#000+
+  'E_Null label references are not allowed'#000+
+  'F_Divide by zero in asm evaluator'#000+
   'F_Evaluator stack overflow'#000+
   'F_Evaluator stack underflow'#000+
   'F_Invalid numeric format in asm evaluator'#000+
   'F_Invalid Operator in asm evaluator'#000+
-  'F_Unknown error in asm evaluator'#000+
-  'W_Invalid numeric value'#000+
-  'E_escape sequence i','gnored: $1'#000+
-  'E_Asm syntax error - Prefix not found'#000+
-  'E_Asm syntax error - Trying to add more than one prefix'#000+
-  'E_Asm syntax error - Opcode not found'#000+
+  'E_escape seq','uence ignored: $1'#000+
   'E_Invalid symbol reference'#000+
-  'W_Calling an overload function in an asm'#000+
-  'E_Constant value out of bound','s'#000+
-  'E_Non-label pattern contains @'#000+
-  'E_Invalid Operand: $1'#000+
-  'W_Override operator not supported'#000+
-  'E_Error in binary constant: $1'#000+
-  'E_Error in octal constant: $1'#000+
-  'E_Error in hexadecimal constant: $1'#000+
-  'E_Error in integer constant: $1'#000+
-  'E_Invalid labeled opco','de'#000+
-  'F_Internal error in Findtype()'#000+
-  'E_Invalid size for MOVSX/MOVZX'#000+
-  'E_16-bit base in 32-bit segment'#000+
-  'E_16-bit index in 32-bit segment'#000+
-  'E_Invalid Opcode'#000+
-  'E_Constant reference not allowed'#000+
   'W_Fwait can cause emulation problems with emu387'#000+
-  'E_Invalid c','ombination of opcode and operands'#000+
-  'E_Unsupported combination of opcode and operands'#000+
-  'W_Opcode $1 not in table, operands not checked'#000+
-  'F_Internal Error in ConcatOpcode()'#000+
-  'E_Invalid size in reference'#000+
-  'E_Invalid middle sized operand'#000+
-  'E_Invalid three ','operand opcode'#000+
-  'E_Assembler syntax error'#000+
-  'E_Invalid operand type'#000+
-  'E_Segment overrides not supported'#000+
-  'E_Invalid constant symbol $1'#000+
-  'F_Internal Errror converting binary'#000+
-  'F_Internal Errror converting hexadecimal'#000+
-  'F_Internal Errror converting octal'#000+
-  'E_','Invalid constant expression'#000+
-  'E_Unknown identifier: $1'#000+
-  'E_Trying to define an index register more than once'#000+
-  'E_Invalid field specifier'#000+
-  'F_Internal Error in BuildScaling()'#000+
-  'E_Invalid scaling factor'#000+
-  'E_Invalid scaling value'#000+
-  'E_Scaling value only allo','wed with index'#000+
-  'E_Invalid assembler syntax. No ref with brackets)'#000+
-  'E_Expressions of the form [sreg:reg...] are currently not supported'#000+
-  'E_Trying to define a segment register twice'#000+
-  'E_Trying to define a base register twice'#000+
-  'E_Trying to use a nega','tive index register'#000+
-  'E_Asm syntax error - error in reference'#000+
-  'E_Local symbols not allowed as references'#000+
-  'E_Invalid operand in bracket expression'#000+
-  'E_Invalid symbol name: $1'#000+
-  'E_Invalid Reference syntax'#000+
-  'E_Invalid string as opcode operand: $1'#000+
-  'W_@COD','E and @DATA not supported'#000+
-  'E_Null label references are not allowed'#000+
-  'W_Calling of an overloaded function in direct assembler'#000+
+  'W_Calling an overload function in assembler'#000+
+  'E_Unsupported symbol type for operand'#000+
+  'E_Constant value out of bounds'#000+
+  'E_Error converting decimal $1'#000+
+  'E_E','rror converting octal $1'#000+
+  'E_Error converting binary $1'#000+
+  'E_Error converting hexadecimal $1'#000+
+  'H_$1 translated to $2'#000+
+  'W_$1 is associated to an overloaded function'#000+
   'E_Cannot use SELF outside a method'#000+
-  'E_Asm syntax error - Should start with bracket'#000+
-  'E_Asm syntax error - register: $1'#000+
-  'E_','SEG and OFFSET not supported'#000+
-  'E_Asm syntax error - in opcode operand'#000+
+  'E_Cannot use __SELF outside a method'#000+
+  'E_Cannot use ','__OLDEBP outside a nested procedure'#000+
+  'W_Functions with void return value can'#039't return any value in asm c'+
+  'ode'#000+
+  'E_SEG not supported'#000+
+  'E_Size suffix and destination or source size do not match'#000+
+  'W_Size suffix and destination or source size do not matc','h'#000+
+  'E_Assembler syntax error'#000+
+  'E_Invalid combination of opcode and operands'#000+
+  'E_Assemler syntax error in operand'#000+
+  'E_Assemler syntax error in constant'#000+
   'E_Invalid String expression'#000+
-  'E_Constant expression out of bounds'#000+
-  'F_Internal Error in BuildConstant()'#000+
-  'W_A repeat prefix and a segment override on <= i386 may result in erro'+
-  'rs',' if an interrupt occurs'#000+
+  '32bit constant created for address'#000+
   'E_Invalid or missing opcode'#000+
-  'E_Invalid combination of prefix and opcode: $1'#000+
+  'E_Inva','lid combination of prefix and opcode: $1'#000+
   'E_Invalid combination of override and opcode: $1'#000+
   'E_Too many operands on line'#000+
-  'E_Duplicate local symbol: $1'#000+
-  'E_Unknown label identifer: $1'#000+
-  'E_Ass','emble node syntax error'#000+
-  'E_Undefined local symbol: $1'#000+
-  'D_Starting intel styled assembler parsing...'#000+
-  'D_Finished intel styled assembler parsing...'#000+
-  'E_Not a directive or local symbol: $1'#000+
-  'E_/ at beginning of line not allowed'#000+
+  'W_NEAR ignored'#000+
+  'W_FAR ignored'#000+
+  'E_Duplicate local symbol $1'#000+
+  'E_Undefined local symbol $1'#000+
+  'E_Unknown label identifier $1'#000+
+  'E_Inval','id floating point register name'#000+
   'E_NOR not supported'#000+
-  'E_','Invalid floating point register name'#000+
   'W_Modulo not supported'#000+
-  'E_Invalid floating point constant: $1'#000+
-  'E_Size suffix and destination register do not match'#000+
-  'E_Size suffix and destination or source size do not match'#000+
-  'W_Size suffix and destination or',' source size do not match'#000+
-  'E_Internal error in ConcatLabeledInstr()'#000+
-  'W_Floating point binary representation ignored'#000+
-  'W_Floating point hexadecimal representation ignored'#000+
-  'W_Floating point octal representation ignored'#000+
-  'E_Invalid real constant expr','ession'#000+
-  'E_Parenthesis are not allowed'#000+
-  'E_Invalid Reference'#000+
-  'E_Cannot use __SELF outside a method'#000+
-  'E_Cannot use __OLDEBP outside a nested procedure'#000+
+  'E_Invalid floating point constant $1'#000+
+  'E_Invalid floating point expression'#000+
+  'E_Wrong symbol type'#000+
+  'E_Cannot index a local var or parameter with a register'#000+
+  'E_Invalid segmen','t override expression'#000+
   'W_Identifier $1 supposed external'#000+
-  'E_Invalid segment override expression'#000+
-  'E_Strings not allowed as ','constants'#000+
-  'D_Starting AT&T styled assembler parsing...'#000+
-  'D_Finished AT&T styled assembler parsing...'#000+
-  'E_Switching sections is not allowed in an assembler block'#000+
-  'E_Invalid global definition'#000+
-  'E_Line separator expected'#000+
-  'W_globl not supported'#000+
-  'W_align ','not supported'#000+
-  'W_lcomm not supported'#000+
-  'W_comm not supported'#000+
-  'E_Invalid local common definition'#000+
-  'E_Invalid global common definition'#000+
-  'E_local symbol: $1 not found inside asm statement'#000+
-  'E_assembler code not returned to text'#000+
-  'F_internal error in BuildR','eference()'#000+
-  'E_invalid opcode size'#000+
-  'W_NEAR ignored'#000+
-  'W_FAR ignored'#000+
-  'D_Creating inline asm lookup tables'#000+
-  'E_Using a defined name as a local label'#000+
-  'F_internal error in HandleExtend()'#000+
-  'E_Invalid character: <'#000+
-  'E_Invalid character: >'#000+
-  'E_Unsupported opcode'#000,
-  'E_Increment and Decrement mode not allowed together'#000+
-  'E_Invalid Register list in movem/fmovem'#000+
-  'E_Invalid Register list for opcode'#000+
-  'E_68020+ mode required to assemble'#000+
-  'D_Starting Motorola styled assembler parsing...'#000+
-  'D_Finished Motorola styled ass','embler parsing...'#000+
-  'W_XDEF not supported'#000+
-  'W_Functions with void return value can'#039't return any value in asm c'+
-  'ode'#000+
-  'E_Invalid suffix for intel assembler'#000+
-  'E_Extended not supported in this mode'#000+
-  'E_Comp not supported in this mode'#000+
-  'W_You need GNU as vers','ion >= 2.81 to compile this MMX code'#000+
+  'E_Strings not allowed as constants'#000+
+  'No type of variable specified'#000+
+  'E_assembler code not returned to text section'#000+
+  'E_Not a directive or local symbol $1'#000+
+  'E_Using a defined name as a local la','bel'#000+
   'F_Too many assembler files'#000+
   'F_Selected assembler output not supported'#000+
-  'E_Unsupported symbol type for operand'#000+
-  'E_Cannot index a local var or parameter with a register'#000+
-  'H_$1 translated to $2'#000+
-  'W_$1 is associated',' to an overloaded function'#000+
-  'Z_Reference at $1 corresponds to $2 arg'#000+
-  'Z_Reference at $1 is not an arg !'#000+
-  'W_Source operating system redefined'#000+
+  'F_Comp not supported'#000+
+  'F_Direct not support for binary writers'#000+
+  'E_Allocating of data is only allowed in bss section'#000+
+  'F_No binary writer selected'#000+
+  'E_Asm: Opcode $1 not in ta','ble'#000+
+  'E_Asm: $1 invalid combination of opcode and operands'#000+
+  'E_Asm: 16 Bit references not supported'#000+
+  'E_Asm: Invalid effective address'#000+
+  'E_Asm: Immediate or reference expected'#000+
+  'E_Asm: $1 value exceeds bounds $2'#000+
+  'E_Asm: Short jump is out of range $1'#000+
+  'W','_Source operating system redefined'#000+
   'I_Assembling (pipe) $1'#000+
   'E_Can'#039't create assember file $1'#000+
-  'W_Assembler $1 not found, switching to external ','assembling'#000+
+  'W_Assembler $1 not found, switching to external assembling'#000+
   'T_Using assembler: $1'#000+
   'W_Error while assembling exitcode $1'#000+
-  'W_Can'#039't call the assembler, error $1 switching to external assembl'+
-  'ing'#000+
+  'W_Can'#039't call the assembler, erro','r $1 switching to external assem'+
+  'bling'#000+
   'I_Assembling $1'#000+
   'W_Linker $1 not found, switching to external linking'#000+
   'T_Using linker: $1'#000+
-  'W_Object $1 ','not found, Linking may fail !'#000+
+  'W_Object $1 not found, Linking may fail !'#000+
   'W_Library $1 not found, Linking may fail !'#000+
   'W_Error while linking'#000+
-  'W_Can'#039't call the linker, switching to external linking'#000+
+  'W_Can'#039't',' call the linker, switching to external linking'#000+
   'I_Linking $1'#000+
   'W_binder not found, switching to external binding'#000+
-  'W_ar not found, switching t','o external ar'#000+
+  'W_ar not found, switching to external ar'#000+
   'E_Dynamic Libraries not supported'#000+
   'I_Closing script $1'#000+
-  'W_resource compiler not found, switching to external mode'#000+
+  'W_resource compiler not found, swi','tching to external mode'#000+
   'I_Compiling resource $1'#000+
   'F_Can'#039't post process executable $1'#000+
   'F_Can'#039't open executable $1'#000+
   'X_Size of Code: $1 bytes'#000+
-  'X_S','ize of initialized data: $1 bytes'#000+
+  'X_Size of initialized data: $1 bytes'#000+
   'X_Size of uninitialized data: $1 bytes'#000+
-  'X_Stack space reserved: $1 bytes'#000+
+  'X_Stack space reserved: $1 by','tes'#000+
   'X_Stack space commited: $1 bytes'#000+
   'T_Unitsearch: $1'#000+
   'T_PPU Loading $1'#000+
@@ -487,203 +426,203 @@ const msgtxt : array[0..    00103,1..240] of char=(
   'U_PPU Flags: $1'#000+
   'U_PPU Crc: $1'#000+
   'U_PPU Time: $1'#000+
-  'U_PPU F','ile too short'#000+
+  'U_PPU File too short'#000+
   'U_PPU Invalid Header (no PPU at the begin)'#000+
   'U_PPU Invalid Version $1'#000+
-  'U_PPU is compiled for an other processor'#000+
+  'U_PPU is compiled fo','r an other processor'#000+
   'U_PPU is compiled for an other target'#000+
   'U_PPU Source: $1'#000+
   'U_Writing $1'#000+
   'F_Can'#039't Write PPU-File'#000+
   'F_reading PPU-File'#000+
-  'F_unexp','ected end of PPU-File'#000+
+  'F_unexpected end of PPU-File'#000+
   'F_Invalid PPU-File entry: $1'#000+
   'F_PPU Dbx count problem'#000+
   'E_Illegal unit name: $1'#000+
-  'F_Too much units'#000+
+  'F_T','oo much units'#000+
   'F_Circular unit reference between $1 and $2'#000+
   'F_Can'#039't compile unit $1, no sources available'#000+
-  'W_Compiling the system unit requir','es the -Us switch'#000+
+  'W_Compiling the system unit requires the -Us switch'#000+
   'F_There were $1 errors compiling module, stopping'#000+
   'U_Load from $1 ($2) unit $3'#000+
-  'U_Recompiling $1, checksum changed for $2'#000+
+  'U_Reco','mpiling $1, checksum changed for $2'#000+
   'U_Recompiling $1, source found only'#000+
   'U_Recompiling unit, static lib is older than ppufile'#000+
-  'U_Recompiling',' unit, shared lib is older than ppufile'#000+
+  'U_Recompiling unit, shared lib is older than ppufile'#000+
   'U_Recompiling unit, obj and asm are older than ppufile'#000+
-  'U_Recompiling unit, obj is older than asm'#000+
+  'U_Recom','piling unit, obj is older than asm'#000+
   'U_Parsing interface of $1'#000+
   'U_Parsing implementation of $1'#000+
   'U_Second load for unit $1'#000+
-  'U_PPU Check file $1 ','time $2'#000+
+  'U_PPU Check file $1 time $2'#000+
   '$1 [options] <inputfile> [options]'#000+
   'W_Only one source file supported'#000+
-  'W_DEF file can be created only for OS/2'#000+
+  'W_DEF file can be created ','only for OS/2'#000+
   'E_nested response files are not supported'#000+
   'F_No source file name in command line'#000+
   'E_Illegal parameter: $1'#000+
-  'H_-? writes help pag','es'#000+
+  'H_-? writes help pages'#000+
   'F_Too many config files nested'#000+
   'F_Unable to open file $1'#000+
   'N_Reading further options from $1'#000+
-  'W_Target is already set to: $1'#000+
+  'W_Target ','is already set to: $1'#000+
   'W_Shared libs not supported on DOS platform, reverting to static'#000+
   'F_too many IF(N)DEFs'#000+
   'F_too many ENDIFs'#000+
-  'F_open condi','tional at the end of the file'#000+
+  'F_open conditional at the end of the file'#000+
   'W_Debug information generation is not supported by this executable'#000+
-  'H_Try recompiling with -dGDB'#000+
+  'H_Try',' recompiling with -dGDB'#000+
   'W_You are using the obsolete switch $1'#000+
   'Free Pascal Compiler version $FPCVER [$FPCDATE] for $FPCTARGET'#000+
-  'Copyright (c',') 1993-98 by Florian Klaempfl'#000+
+  'Copyright (c) 1993-98 by Florian Klaempfl'#000+
   'Free Pascal Compiler version $FPCVER'#000+
   #000+
   'Compiler Date  : $FPCDATE'#000+
-  'Compiler Target: $FPCTARGET'#000+
+  'Compiler',' Target: $FPCTARGET'#000+
   #000+
   'This program comes under the GNU General Public Licence'#000+
   'For more information read COPYING.FPC'#000+
   #000+
-  'Report bugs,suggestion','s etc to:'#000+
+  'Report bugs,suggestions etc to:'#000+
   '                 [email protected]'#000+
-  '**0*_put + after a boolean switch option to enable it, - to disable it'+
-  #000+
+  '**0*_put + after a boolean switch option ','to enable it, - to disable '+
+  'it'#000+
   '**1a_the compiler doesn'#039't delete the generated assembler file'#000+
-  '**2al_list sourcecode lines in assembler file'#000,
+  '**2al_list sourcecode lines in assembler file'#000+
   '**1b_generate browser info'#000+
   '**2bl_generate local symbol info'#000+
   '**1B_build all modules'#000+
-  '**1C<x>_code generation options:'#000+
+  '**1C<x>_code genera','tion options:'#000+
   '3*2CD_create dynamic library'#000+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#000+
   '**2Ci_IO-checking'#000+
-  '**2Cn_omit linking stage'#000,
+  '**2Cn_omit linking stage'#000+
   '**2Co_check overflow of integer operations'#000+
   '**2Cr_range checking'#000+
   '**2Cs<n>_set stack size to <n>'#000+
-  '**2Ct_stack checking'#000+
+  '**2Ct_s','tack checking'#000+
   '3*2CS_create static library'#000+
   '3*2Cx_use smartlinking'#000+
   '**1d<x>_defines the symbol <x>'#000+
   '*O1D_generate a DEF file'#000+
-  '*O2Dd<x>_set desc','ription to <x>'#000+
+  '*O2Dd<x>_set description to <x>'#000+
   '*O2Dw_PM application'#000+
   '**1e<x>_set path to executable'#000+
   '**1E_same as -Cn'#000+
-  '**1F<x>_set file names and paths:'#000+
+  '**1F<x>_set file n','ames and paths:'#000+
   '**2FD<x>_sets the directory where to search for compiler utilities'#000+
   '**2Fe<x>_redirect error output to <x>'#000+
-  '**2FE<x>_set exe/','unit output path to <x>'#000+
+  '**2FE<x>_set exe/unit output path to <x>'#000+
   '*L2Fg<x>_same as -Fl'#000+
   '**2Fi<x>_adds <x> to include path'#000+
-  '**2Fl<x>_adds <x> to library path'#000+
+  '**2Fl<x>_adds <x> to li','brary path'#000+
   '*L2FL<x>_uses <x> as dynamic linker'#000+
   '**2Fo<x>_adds <x> to object path'#000+
   '**2Fr<x>_load error message file <x>'#000+
-  '**2Fu<x>_adds <x> to ','unit path'#000+
+  '**2Fu<x>_adds <x> to unit path'#000+
   '**2FU<x>_set unit output path to <x>, overrides -FE'#000+
   '*g1g<x>_generate debugger information:'#000+
-  '*g2gg_use gsym'#000+
+  '*','g2gg_use gsym'#000+
   '*g2gd_use dbx'#000+
   '*g2gh_use heap trace unit'#000+
   '**1i_information'#000+
   '**2iD_return compiler date'#000+
   '**2iV_return compiler version'#000+
-  '**2iSO_ret','urn compiler OS'#000+
+  '**2iSO_return compiler OS'#000+
   '**2iSP_return compiler processor'#000+
   '**2iTO_return target OS'#000+
-  '**2iTP_return target processor'#000+
+  '**2iTP_return target processo','r'#000+
   '**1I<x>_adds <x> to include path'#000+
   '**1k<x>_Pass <x> to the linker'#000+
   '**1l_write logo'#000+
   '**1n_don'#039't read the default config file'#000+
-  '**1o<x>_change t','he name of the executable produced to <x>'#000+
+  '**1o<x>_change the name of the executable produced to <x>'#000+
   '**1pg_generate profile code for gprof'#000+
-  '*L1P_use pipes instead of creating temporary assembler files'#000+
+  '*L1P_use pipes instead',' of creating temporary assembler files'#000+
   '**1S<x>_syntax options:'#000+
   '**2S2_switch some Delphi 2 extensions on'#000+
-  '**2Sc_supports operators like C (*','=,+=,/= and -=)'#000+
+  '**2Sc_supports operators like C (*=,+=,/= and -=)'#000+
   '**2Sd_tries to be Delphi compatible'#000+
   '**2Se_compiler stops after the first error'#000+
-  '**2Sg_allow LABEL and GOTO'#000+
+  '**2Sg_a','llow LABEL and GOTO'#000+
   '**2Sh_Use ansistrings'#000+
   '**2Si_support C++ styled INLINE'#000+
   '**2Sm_support macros like C (global)'#000+
-  '**2So_tries to be TP/BP 7.0',' compatible'#000+
+  '**2So_tries to be TP/BP 7.0 compatible'#000+
   '**2Sp_tries to be gpc compatible'#000+
-  '**2Ss_constructor name must be init (destructor must be done)'#000+
+  '**2Ss_constructor name must be init (destructor must be d','one)'#000+
   '**2St_allow static keyword in objects'#000+
   '**1s_don'#039't call assembler and linker (only with -a)'#000+
   '**1u<x>_undefines the symbol <x>'#000+
-  '**1U_unit ','options:'#000+
+  '**1U_unit options:'#000+
   '**2Un_don'#039't check the unit name'#000+
   '**2Up<x>_same as -Fu<x>'#000+
   '**2Us_compile a system unit'#000+
-  '**1v<x>_Be verbose. <x> is a combination of the following letters:'#000+
+  '**1v<x>_B','e verbose. <x> is a combination of the following letters:'#000+
   '**2*_e : Show errors (default)       d : Show debug info'#000+
-  '**2*_w : Show warnings ','              u : Show unit info'#000+
+  '**2*_w : Show warnings               u : Show unit info'#000+
   '**2*_n : Show notes                  t : Show tried/used files'#000+
-  '**2*_h : Show hints                  m : Show defined macros'#000+
+  '**2*_h',' : Show hints                  m : Show defined macros'#000+
   '**2*_i : Show general info           p : Show compiled procedures'#000+
-  '**2*_l : Show lin','enumbers            c : Show conditionals'#000+
-  '**2*_a : Show everything             0 : Show nothing (except errors)'#000+
-  '**2*_b : Show all procedure          r : Rhide/GCC compatibility mode'#000+
-  '**2*_    declarations if an error    x : Executable info (','Win32 only'+
+  '**2*_l : Show linenumbers            c : Show conditionals'#000+
+  '**2*_a : Show everything             0 : Show nothing (excep','t errors'+
   ')'#000+
+  '**2*_b : Show all procedure          r : Rhide/GCC compatibility mode'#000+
+  '**2*_    declarations if an error    x : Executable info (Win32 only)'#000+
   '**2*_    occurs'#000+
   '**1X_executable options:'#000+
   '*L2Xc_link with the c library'#000+
-  '**2XD_link with dynamic libraries (defines FPC_LINK_DYNAMIC)'#000+
+  '**2XD_link with dyn','amic libraries (defines FPC_LINK_DYNAMIC)'#000+
   '**2Xs_strip all symbols from executable'#000+
-  '**2XS_link with static libraries (defines FPC_LINK_STATI','C)'#000+
+  '**2XS_link with static libraries (defines FPC_LINK_STATIC)'#000+
   '**0*_Processor specific options:'#000+
   '3*1A<x>_output format:'#000+
   '3*2Ao_coff file using GNU AS'#000+
-  '3*2Anasmcoff_coff file using Nasm'#000+
+  '3*2Anasmcoff_c','off file using Nasm'#000+
   '3*2Anasmelf_elf32 (Linux) file using Nasm'#000+
   '3*2Anasmobj_obj file using Nasm'#000+
   '3*2Amasm_obj file using Masm (Mircosoft)'#000+
-  '3*2','Atasm_obj file using Tasm (Borland)'#000+
+  '3*2Atasm_obj file using Tasm (Borland)'#000+
   '3*1R<x>_assembler reading style:'#000+
-  '3*2Ratt_read AT&T style assembler'#000+
+  '3*2Ratt_read AT&T style assembler',#000+
   '3*2Rintel_read Intel style assembler'#000+
   '3*2Rdirect_copy assembler text directly to assembler file'#000+
   '3*1O<x>_optimizations:'#000+
-  '3*2Og_generate smal','ler code'#000+
+  '3*2Og_generate smaller code'#000+
   '3*2OG_generate faster code (default)'#000+
-  '3*2Or_keep certain variables in registers (still BUGGY!!!)'#000+
+  '3*2Or_keep certain variables in registers (still BUGGY!!','!)'#000+
   '3*2Ou_enable uncertain optimizations (see docs)'#000+
   '3*2O1_level 1 optimizations (quick optimizations)'#000+
-  '3*2O2_level 2 optimizations (-O1 + sl','ower optimizations)'#000+
+  '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#000+
   '3*2O3_level 3 optimizations (same as -O2u)'#000+
   '3*2Op<x>_target processor:'#000+
-  '3*3Op1_set target processor to 386/486'#000+
+  '3*3Op1_set t','arget processor to 386/486'#000+
   '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#000+
   '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#000+
-  '3*','1T<x>_Target operating system:'#000+
+  '3*1T<x>_Target operating system:'#000+
   '3*2TGO32V1_version 1 of DJ Delorie DOS extender'#000+
-  '3*2TGO32V2_version 2 of DJ Delorie DOS extender'#000+
+  '3*2TGO32V2_version 2 of',' DJ Delorie DOS extender'#000+
   '3*2TLINUX_Linux'#000+
   '3*2TOS2_OS/2 2.x'#000+
   '3*2TWin32_Windows 32 Bit'#000+
   '6*1A<x>_output format'#000+
   '6*2Ao_Unix o-file using GNU AS'#000+
-  '6*','2Agas_GNU Motorola assembler'#000+
+  '6*2Agas_GNU Motorola assembler'#000+
   '6*2Amit_MIT Syntax (old GAS)'#000+
   '6*2Amot_Standard Motorola assembler'#000+
-  '6*1O_optimizations:'#000+
+  '6*1O_opt','imizations:'#000+
   '6*2Oa_turn on the optimizer'#000+
   '6*2Og_generate smaller code'#000+
   '6*2OG_generate faster code (default)'#000+
-  '6*2Ox_optimize maximum (still BUG','GY!!!)'#000+
+  '6*2Ox_optimize maximum (still BUGGY!!!)'#000+
   '6*2O2_set target processor to a MC68020+'#000+
   '6*1R<x>_assembler reading style:'#000+
-  '6*2RMOT_read motorola style assembler'#000+
+  '6*2RMOT_read motorola',' style assembler'#000+
   '6*1T<x>_Target operating system:'#000+
   '6*2TAMIGA_Commodore Amiga'#000+
   '6*2TATARI_Atari ST/STe/TT'#000+
   '6*2TMACOS_Macintosh m68k'#000+
-  '6*2TLINUX_L','inux-68k'#000+
+  '6*2TLINUX_Linux-68k'#000+
   '**1*_'#000+
   '**1?_shows this help'#000+
   '**1h_shows this help without waiting'#000

+ 5 - 2
compiler/og386.pas

@@ -177,7 +177,7 @@ unit og386;
       begin
         inc(SmartLinkFilesCnt);
         if SmartLinkFilesCnt>999999 then
-         Message(assem_f_too_many_asm_files);
+         Message(asmw_f_too_many_asm_files);
         if (cs_asm_leave in aktglobalswitches) then
           begin
             if IsEndFile then
@@ -253,7 +253,10 @@ unit og386;
 end.
 {
   $Log$
-  Revision 1.4  1999-05-05 17:34:30  peter
+  Revision 1.5  1999-05-05 22:21:57  peter
+    * updated messages
+
+  Revision 1.4  1999/05/05 17:34:30  peter
     * output is more like as 2.9.1
     * stabs really working for go32v2
 

+ 6 - 1
compiler/pstatmnt.pas

@@ -720,6 +720,8 @@ unit pstatmnt;
   {$ifndef NoRA386Dir}
            asmmode_i386_direct:
              begin
+               if not target_asm.allowdirect then
+                 Message(parser_f_direct_assembler_not_allowed);
                if (aktprocsym^.definition^.options and poinline)<>0 then
                  Begin
                     Message1(parser_w_not_supported_for_inline,'direct asm');
@@ -1283,7 +1285,10 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.82  1999-05-01 13:24:35  peter
+  Revision 1.83  1999-05-05 22:21:58  peter
+    * updated messages
+
+  Revision 1.82  1999/05/01 13:24:35  peter
     * merged nasm compiler
     * old asm moved to oldasm/
 

+ 8 - 5
compiler/ra386.pas

@@ -146,7 +146,7 @@ Begin
        OPR_REFERENCE: exit;
        OPR_NONE: ;
      else
-       Message(assem_e_invalid_operand_type);
+       Message(asmr_e_invalid_operand_type);
      end;
      operands[operandnum].operandtype := OPR_REFERENCE;
      operands[operandnum].ref.segment := R_DEFAULT_SEG;
@@ -303,9 +303,9 @@ begin
         { if range checks are on then generate an error }
         if (cs_compilesystem in aktmoduleswitches) or
            not (cs_check_range in aktlocalswitches) then
-          Message(assem_w_size_suffix_and_dest_dont_match)
+          Message(asmr_w_size_suffix_and_dest_dont_match)
         else
-          Message(assem_e_size_suffix_and_dest_dont_match);
+          Message(asmr_e_size_suffix_and_dest_dont_match);
       end;
    end;
 end;
@@ -385,7 +385,7 @@ begin
      if assigned(ai) then
       p^.concat(ai)
      else
-      Message(assem_e_invalid_opcode_and_operand);
+      Message(asmr_e_invalid_opcode_and_operand);
 
    end;
 end;
@@ -393,7 +393,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.2  1999-05-02 14:24:26  peter
+  Revision 1.3  1999-05-05 22:21:59  peter
+    * updated messages
+
+  Revision 1.2  1999/05/02 14:24:26  peter
     * translate opr_symbol to reference for lea
 
   Revision 1.1  1999/05/01 13:24:40  peter

+ 140 - 210
compiler/ra386att.pas

@@ -62,15 +62,19 @@ const
    firstdirective = AS_DB;
    lastdirective  = AS_END;
 
-   _count_asmdirectives = longint(lastdirective)-longint(firstdirective);
    _count_asmprefixes   = 5;
    _count_asmspecialops = 25;
    _count_asmoverrides  = 3;
 
-   _asmdirectives : array[0.._count_asmdirectives] of tasmkeyword =
-   ('.byte','.word','.long','.quad','.globl','.align','.ascii',
+  token2str : array[tasmtoken] of string[10]=(
+    '','Label','LLabel','string','integer',
+    'float',',','(',
+    ')',':','.','+','-','*',
+    ';','identifier','register','opcode','/','$',
+    '.byte','.word','.long','.quad','.globl','.align','.ascii',
     '.asciz','.lcomm','.comm','.single','.double','.tfloat',
-    '.data','.text','END');
+    '.data','.text','END',
+    '%','<<','>>','!','&','|','^','~');
 
 const
   newline = #10;
@@ -101,7 +105,6 @@ var
   i : tasmop;
   j : tregister;
 Begin
-  Message(assem_d_creating_lookup_tables);
   { opcodes }
   new(iasmops);
   for i:=firstop to lastop do
@@ -187,12 +190,12 @@ end;
 
 Function is_asmdirective(const s: string):boolean;
 var
-  i : longint;
+  i : tasmtoken;
 Begin
-  for i:=0 to _count_asmdirectives do
-   if s=_asmdirectives[i] then
+  for i:=firstdirective to lastdirective do
+   if s=token2str[i] then
     begin
-      actasmtoken:=tasmtoken(longint(firstdirective)+i);
+      actasmtoken:=i;
       is_asmdirective:=true;
       exit;
     end;
@@ -277,7 +280,7 @@ begin
            { directives are case sensitive!! }
            if is_asmdirective(actasmpattern) then
             exit;
-           Message1(assem_e_not_directive_or_local_symbol,actasmpattern);
+           Message1(asmr_e_not_directive_or_local_symbol,actasmpattern);
          end;
       end;
      { only opcodes and global labels are allowed now. }
@@ -387,10 +390,10 @@ begin
               if c in ['0'..'9'] then
                actasmpattern:=actasmpattern + c
               else
-               Message(assem_e_invalid_fpu_register);
+               Message(asmr_e_invalid_fpu_register);
               c:=current_scanner^.asmgetchar;
               if c <> ')' then
-               Message(assem_e_invalid_fpu_register)
+               Message(asmr_e_invalid_fpu_register)
               else
                Begin
                  actasmpattern:=actasmpattern + c;
@@ -399,7 +402,7 @@ begin
             end;
            if is_register(actasmpattern) then
             exit;
-           Message(assem_w_modulo_not_supported);
+           Message(asmr_w_modulo_not_supported);
          end;
 
        '1'..'9': { integer number }
@@ -478,7 +481,7 @@ begin
                   end
                  else
                   begin
-                    Message1(assem_e_invalid_float_const,actasmpattern+c);
+                    Message1(asmr_e_invalid_float_const,actasmpattern+c);
                     actasmtoken:=AS_NONE;
                  end;
                end;
@@ -625,7 +628,7 @@ begin
 
        '!' :
          begin
-           Message(assem_e_nor_not_supported);
+           Message(asmr_e_nor_not_supported);
            c:=current_scanner^.asmgetchar;
            actasmtoken:=AS_NONE;
            exit;
@@ -698,15 +701,17 @@ begin
 end;
 
 
-procedure consume(t : tasmtoken);
+function consume(t : tasmtoken):boolean;
 begin
+  Consume:=true;
   if t<>actasmtoken then
-    Message(assem_e_syntax_error);
-  gettoken;
-  { if the token must be ignored, then }
-  { get another token to parse.        }
-  if actasmtoken = AS_NONE then
+   begin
+     Message2(scan_f_syn_expected,token2str[t],token2str[actasmtoken]);
+     Consume:=false;
+   end;
+  repeat
     gettoken;
+  until actasmtoken<>AS_NONE;
 end;
 
 
@@ -739,19 +744,15 @@ Begin
    begin
      Consume(AS_DOT);
      if actasmtoken=AS_ID then
+      s:=s+'.'+actasmpattern;
+     if not Consume(AS_ID) then
       begin
-        s:=s+'.'+actasmpattern;
-        Consume(AS_ID);
-      end
-     else
-      begin
-        Message(assem_e_syntax_error);
         RecoverConsume(true);
         break;
       end;
    end;
   if not GetRecordOffsetSize(s,offset,size) then
-   Comment(V_Error,'Error building record offset');
+   Message(asmr_e_building_record_offset);
 end;
 
 
@@ -909,29 +910,29 @@ Begin
                      procsym :
                        hs:=pprocsym(srsym)^.mangledname;
                      else
-                       Writeln('Error: wrong sym type');
+                       Message(asmr_e_wrong_sym_type);
                    end;
                  end
                 else
-                 Message1(assem_e_unknown_id,tempstr);
+                 Message1(sym_e_unknown_id,tempstr);
               end;
              { symbol found? }
              if hs<>'' then
               begin
                 if needofs and (prevtok<>AS_DOLLAR) then
-                 Comment(V_Error,'assem_e_need_offset');
+                 Message(asmr_e_need_offset);
                 if asmsym='' then
                  asmsym:=hs
                 else
-                 Comment(V_Error,'assem_e_cant_have_multiple_relocatable_symbols');
+                 Message(asmr_e_cant_have_multiple_relocatable_symbols);
                 if (expr='') or (expr[length(expr)]='+') then
                  begin
                    delete(expr,length(expr),1);
                    if not(actasmtoken in [AS_MINUS,AS_PLUS,AS_COMMA,AS_SEPARATOR,AS_END]) then
-                    Comment(V_Error,'assem_e_only_add_relocatable_symbol');
+                    Message(asmr_e_only_add_relocatable_symbol);
                  end
                 else
-                 Comment(V_Error,'assem_e_only_add_relocatable_symbol');
+                 Message(asmr_e_only_add_relocatable_symbol);
               end;
            end;
         end;
@@ -944,7 +945,7 @@ Begin
       Begin
         { write error only once. }
         if not errorflag then
-          Message(assem_e_invalid_constant_expression);
+          Message(asmr_e_invalid_constant_expression);
         { consume tokens until we find COMMA or SEPARATOR }
         Consume(actasmtoken);
         errorflag:=TRUE;
@@ -968,7 +969,7 @@ var
 begin
   BuildConstSymbolExpression(allowref,betweenbracket,false,l,hs);
   if hs<>'' then
-   Comment(V_Error,'no relocatable symbols allowed');
+   Message(asmr_e_relocatable_symbol_not_allowed);
   BuildConstExpression:=l;
 end;
 
@@ -1023,7 +1024,7 @@ end;
            Begin
              { only write error once. }
              if not errorflag then
-              Message(assem_e_invalid_real_const);
+              Message(asmr_e_invalid_float_expr);
              { consume tokens until we find COMMA or SEPARATOR }
              Consume(actasmtoken);
              errorflag:=TRUE;
@@ -1038,7 +1039,7 @@ end;
           if code<>0 then
             Begin
                r:=0;
-               Message(assem_e_invalid_real_const);
+               Message(asmr_e_invalid_float_expr);
                ConcatRealConstant(curlist,r,typ);
             End
           else
@@ -1047,7 +1048,7 @@ end;
             End;
         end
       else
-       Message(assem_e_invalid_real_const);
+       Message(asmr_e_invalid_float_expr);
     Until actasmtoken=AS_SEPARATOR;
   end;
 
@@ -1068,7 +1069,7 @@ Procedure BuildReference(var Instr: TInstruction);
   begin
     if actasmtoken <> AS_RPAREN then
      Begin
-       Message(assem_e_invalid_reference);
+       Message(asmr_e_invalid_reference_syntax);
        RecoverConsume(true);
      end
     else
@@ -1076,14 +1077,27 @@ Procedure BuildReference(var Instr: TInstruction);
        Consume(AS_RPAREN);
        if not (actasmtoken in [AS_COMMA,AS_SEPARATOR]) then
         Begin
-          Message(assem_e_invalid_reference);
+          Message(asmr_e_invalid_reference_syntax);
           RecoverConsume(true);
         end;
       end;
    end;
 
-var
-  l:longint;
+   procedure Consume_Scale;
+   var
+     l : longint;
+   begin
+     { we have to process the scaling }
+     l:=BuildConstExpression(false,true);
+     if ((l = 2) or (l = 4) or (l = 8) or (l = 1)) then
+      instr.operands[operandnum].ref.scalefactor:=l
+     else
+      Begin
+        Message(asmr_e_wrong_scale_factor);
+        instr.operands[operandnum].ref.scalefactor:=0;
+      end;
+   end;
+
 Begin
    Consume(AS_LPAREN);
    initAsmRef(instr,operandnum);
@@ -1095,7 +1109,7 @@ Begin
          { offset(offset) is invalid }
          If Instr.Operands[OperandNum].Ref.Offset <> 0 Then
           Begin
-            Message(assem_e_invalid_reference);
+            Message(asmr_e_invalid_reference_syntax);
             RecoverConsume(true);
           End
          Else
@@ -1110,7 +1124,7 @@ Begin
          { Check if there is already a base (mostly ebp,esp) than this is
            not allowed,becuase it will give crashing code }
          if instr.operands[operandnum].ref.base<>R_NO then
-          Message(assem_e_cannot_index_relative_var);
+          Message(asmr_e_cannot_index_relative_var);
          instr.operands[operandnum].ref.base:=actasmregister;
          Consume(AS_REGISTER);
          { can either be a register or a right parenthesis }
@@ -1136,30 +1150,20 @@ Begin
               AS_COMMA:
                 Begin
                   Consume(AS_COMMA);
-                  { we have to process the scaling }
-                  l:=BuildConstExpression(false,true);
-                  if ((l = 2) or (l = 4) or (l = 8) or (l = 1)) then
-                   instr.operands[operandnum].ref.scalefactor:=l
-                  else
-                   Begin
-                     Message(assem_e_invalid_scaling_value);
-                     instr.operands[operandnum].ref.scalefactor:=0;
-                   end;
+                  Consume_Scale;
                   Consume_RParen;
                 end;
             else
               Begin
-                Message(assem_e_invalid_reference_syntax);
-                while (actasmtoken <> AS_SEPARATOR) do
-                 Consume(actasmtoken);
+                Message(asmr_e_invalid_reference_syntax);
+                RecoverConsume(false);
               end;
             end; { end case }
           end
          else
           Begin
-            Message(assem_e_invalid_reference_syntax);
-            while (actasmtoken <> AS_SEPARATOR) do
-             Consume(actasmtoken);
+            Message(asmr_e_invalid_reference_syntax);
+            RecoverConsume(false);
           end;
        end; {end case }
      AS_COMMA: { (, ...  can either be scaling, or index }
@@ -1180,36 +1184,20 @@ Begin
               AS_COMMA:
                 Begin
                   Consume(AS_COMMA);
-                  { we have to process the scaling }
-                  l:=BuildConstExpression(false,true);
-                  if ((l = 2) or (l = 4) or (l = 8) or (l = 1)) then
-                   instr.operands[operandnum].ref.scalefactor:=l
-                  else
-                   Begin
-                     Message(assem_e_invalid_scaling_value);
-                     instr.operands[operandnum].ref.scalefactor:=0;
-                   end;
+                  Consume_Scale;
                   Consume_RParen;
                 end;
             else
               Begin
-                Message(assem_e_invalid_reference_syntax);
-                while (actasmtoken <> AS_SEPARATOR) do
-                 Consume(actasmtoken);
+                Message(asmr_e_invalid_reference_syntax);
+                RecoverConsume(false);
               end;
             end; {end case }
           end
          { Scaling }
          else
           Begin
-            l:=BuildConstExpression(false,true);
-            if ((l = 2) or (l = 4) or (l = 8) or (l = 1)) then
-              instr.operands[operandnum].ref.scalefactor:=l
-            else
-              Begin
-                Message(assem_e_invalid_scaling_value);
-                instr.operands[operandnum].ref.scalefactor:=0;
-              end;
+            Consume_Scale;
             Consume_RParen;
             exit;
           end;
@@ -1217,11 +1205,10 @@ Begin
 
    else
      Begin
-       Message(assem_e_invalid_reference_syntax);
-       while (actasmtoken <> AS_SEPARATOR) do
-         Consume(actasmtoken);
+       Message(asmr_e_invalid_reference_syntax);
+       RecoverConsume(false);
      end;
-   end; { end case }
+   end;
 end;
 
 
@@ -1259,7 +1246,7 @@ Procedure BuildOperand(var instr: TInstruction);
         Begin
           instr.operands[operandnum].ref.offset:=BuildConstExpression(True,False);
           if actasmtoken<>AS_LPAREN then
-            Message(assem_e_invalid_reference_syntax)
+            Message(asmr_e_invalid_reference_syntax)
           else
             BuildReference(instr);
         end;
@@ -1275,10 +1262,10 @@ Procedure BuildOperand(var instr: TInstruction);
              if (cs_compilesystem in aktmoduleswitches) then
               begin
                 if not SearchDirectVar(instr,actasmpattern,operandnum) then
-                 Message(assem_e_invalid_seg_override);
+                 Message(asmr_e_invalid_seg_override);
               end
              else
-              Message(assem_e_invalid_seg_override);
+              Message(asmr_e_invalid_seg_override);
            end;
           Consume(actasmtoken);
           case actasmtoken of
@@ -1287,7 +1274,7 @@ Procedure BuildOperand(var instr: TInstruction);
             AS_LPAREN: BuildReference(instr);
           else
             Begin
-              Message(assem_e_invalid_seg_override);
+              Message(asmr_e_invalid_seg_override);
               Consume(actasmtoken);
             end;
           end; {end case }
@@ -1331,7 +1318,7 @@ Begin
         initAsmRef(instr,operandnum);
         instr.operands[operandnum].ref.offset:=BuildConstExpression(True,False);
         if actasmtoken<>AS_LPAREN then
-          Message(assem_e_invalid_reference_syntax)
+          Message(asmr_e_invalid_reference_syntax)
         else
           BuildReference(instr);
       end;
@@ -1350,7 +1337,7 @@ Begin
          begin
            initAsmRef(instr,operandnum);
            if not MaybeBuildReference then
-            Message(assem_e_syn_opcode_operand);
+            Message(asmr_e_syn_operand);
          end;
         { this is only allowed for call's and jmp's }
         case instr.opcode of
@@ -1358,7 +1345,7 @@ Begin
           A_JMP,
           A_Jcc : ;
         else
-          Message(assem_e_syn_opcode_operand);
+          Message(asmr_e_syn_operand);
         end;
       end;
 
@@ -1369,7 +1356,7 @@ Begin
          Begin
            delete(actasmpattern,1,2);
            if actasmpattern = '' then
-             Message(assem_e_null_label_ref_not_allowed);
+             Message(asmr_e_null_label_ref_not_allowed);
            lab:=labellist.search(actasmpattern);
            { check if the label is already defined   }
            { if so, we then check if the plabel is   }
@@ -1396,9 +1383,7 @@ Begin
             end;
            Consume(AS_ID);
            if not (actasmtoken in [AS_SEPARATOR,AS_COMMA]) then
-            Begin
-              Message(assem_e_syntax_error);
-            end;
+            Message(asmr_e_syntax_error);
           end
          else
          { probably a variable or normal expression }
@@ -1413,7 +1398,7 @@ Begin
                instr.labeled:=TRUE;
                Consume(AS_ID);
                if not (actasmtoken in [AS_SEPARATOR,AS_COMMA]) then
-                 Message(assem_e_syntax_error);
+                 Message(asmr_e_syntax_error);
              end
             else
             { is it a normal variable ? }
@@ -1435,7 +1420,7 @@ Begin
                          instr.operands[operandnum].ref.base:=procinfo.framepointer;
                        end
                       else
-                       Message(assem_e_cannot_use___SELF_outside_methode);
+                       Message(asmr_e_cannot_use___SELF_outside_methode);
                     end
                   else
                    if actasmpattern = '__OLDEBP' then
@@ -1447,7 +1432,7 @@ Begin
                          instr.operands[operandnum].ref.base:=procinfo.framepointer;
                        end
                       else
-                       Message(assem_e_cannot_use___OLDEBP_outside_nested_procedure);
+                       Message(asmr_e_cannot_use___OLDEBP_outside_nested_procedure);
                     end
                   else
                     { check for direct symbolic names   }
@@ -1457,12 +1442,12 @@ Begin
                        if not SearchDirectVar(instr,actasmpattern,operandnum) then
                         Begin
                           { not found, finally ... add it anyways ... }
-                          Message1(assem_w_id_supposed_external,actasmpattern);
+                          Message1(asmr_w_id_supposed_external,actasmpattern);
                           instr.operands[operandnum].ref.symbol:=newasmsymbol(actasmpattern);
                         end;
                      end
                   else
-                    Message1(assem_e_unknown_id,actasmpattern);
+                    Message1(sym_e_unknown_id,actasmpattern);
                 end;
                { constant expression? }
                if (instr.operands[operandnum].operandtype=OPR_CONSTANT) then
@@ -1511,27 +1496,27 @@ Begin
            { This must absolutely be followed by a reference }
            if not MaybeBuildReference then
             Begin
-              Message(assem_e_invalid_seg_override);
+              Message(asmr_e_invalid_seg_override);
               Consume(actasmtoken);
             end;
          end
-       { Simple register  }
-       else if (actasmtoken in [AS_SEPARATOR,AS_COMMA]) then
+        { Simple register  }
+        else if (actasmtoken in [AS_SEPARATOR,AS_COMMA]) then
          Begin
            if not (instr.operands[operandnum].operandtype in [OPR_NONE,OPR_REGISTER]) then
-             Message(assem_e_invalid_operand_type);
+             Message(asmr_e_invalid_operand_type);
            instr.operands[operandnum].operandtype:=OPR_REGISTER;
            instr.operands[operandnum].reg:=tempreg;
            instr.operands[operandnum].size:=reg_2_opsize[tempreg];
          end
         else
-         Message1(assem_e_syn_register,att_reg2str[tempreg]);
+         Message(asmr_e_syn_operand);
       end;
     AS_SEPARATOR,
     AS_COMMA: ;
   else
     Begin
-      Message(assem_e_syn_opcode_operand);
+      Message(asmr_e_syn_operand);
       Consume(actasmtoken);
     end;
   end; { end case }
@@ -1564,16 +1549,16 @@ Begin
           if maxvalue = $ff then
            strlength:=1
           else
-           Message(assem_e_string_not_allowed_as_const);
+           Message(asmr_e_string_not_allowed_as_const);
           expr:=actasmpattern;
           if length(expr) > 1 then
-           Message(assem_e_string_not_allowed_as_const);
+           Message(asmr_e_string_not_allowed_as_const);
           Consume(AS_STRING);
           Case actasmtoken of
             AS_COMMA: Consume(AS_COMMA);
             AS_SEPARATOR: ;
           else
-            Message(assem_e_invalid_string_expression);
+            Message(asmr_e_invalid_string_expression);
           end; { end case }
           ConcatString(curlist,expr);
         end;
@@ -1599,7 +1584,10 @@ Begin
       AS_SEPARATOR:
         break;
       else
-        Message(assem_f_internal_error_in_buildconstant);
+        begin
+          Message(asmr_e_syn_constant);
+          RecoverConsume(false);
+        end
    end; { end case }
  Until false;
 end;
@@ -1641,7 +1629,7 @@ Begin
      Begin
        Consume(actasmtoken);
        if not errorflag then
-        Message(assem_e_invalid_string_expression);
+        Message(asmr_e_invalid_string_expression);
        errorflag:=TRUE;
      end;
    end;
@@ -1669,8 +1657,6 @@ Begin
   repeat
     if is_prefix(actopcode) then
      begin
-       if (PrefixOp<>A_None) or (OverrideOp<>A_None) then
-        Message(assem_w_repeat_prefix_and_seg_override);
        PrefixOp:=ActOpcode;
        instr.opcode:=ActOpcode;
        instr.condition:=ActCondition;
@@ -1681,8 +1667,6 @@ Begin
     else
      if is_override(actopcode) then
       begin
-        if (PrefixOp<>A_None) or (OverrideOp<>A_None) then
-         Message(assem_w_repeat_prefix_and_seg_override);
         OverrideOp:=ActOpcode;
         instr.opcode:=ActOpcode;
         instr.condition:=ActCondition;
@@ -1699,7 +1683,7 @@ Begin
   { opcode }
   if (actasmtoken <> AS_OPCODE) then
    Begin
-     Message(assem_e_invalid_or_missing_opcode);
+     Message(asmr_e_invalid_or_missing_opcode);
      RecoverConsume(true);
      exit;
    end;
@@ -1709,9 +1693,9 @@ Begin
   instr.opsize:=ActOpsize;
   { Valid combination of prefix/override and instruction ?  }
   if (prefixop<>A_NONE) and (NOT CheckPrefix(PrefixOp,actopcode)) then
-    Message1(assem_e_invalid_prefix_and_opcode,actasmpattern);
+    Message1(asmr_e_invalid_prefix_and_opcode,actasmpattern);
   if (overrideop<>A_NONE) and (NOT CheckOverride(OverrideOp,ActOpcode)) then
-    Message1(assem_e_invalid_override_and_opcode,actasmpattern);
+    Message1(asmr_e_invalid_override_and_opcode,actasmpattern);
   { We are reading operands, so opcode will be an AS_ID }
   operandnum:=1;
   Consume(AS_OPCODE);
@@ -1727,7 +1711,7 @@ Begin
       AS_COMMA: { Operand delimiter }
         Begin
           if operandnum > MaxOperands then
-           Message(assem_e_too_many_operands)
+           Message(asmr_e_too_many_operands)
           else
            Inc(operandnum);
           Consume(AS_COMMA);
@@ -1757,7 +1741,7 @@ Var
   commname  : string;
   lastsec   : tsection;
 Begin
-  Message(assem_d_start_att);
+  Message1(asmr_d_start_reading,'AT&T');
   firsttoken:=TRUE;
   operandnum:=0;
   if assigned(procinfo.retdef) and
@@ -1797,7 +1781,7 @@ Begin
              { duplicate local symbol (in this case it has   }
              { already been emitted).                        }
              if labelptr^.emitted then
-               Message1(assem_e_dup_local_sym,'.L'+labelptr^.name^)
+               Message1(asmr_e_dup_local_sym,'.L'+labelptr^.name^)
              else
                Begin
                  if assigned(labelptr^.lab) then
@@ -1817,13 +1801,13 @@ Begin
            Begin
              if (cs_compilesystem in aktmoduleswitches) then
               begin
-                 Message1(assem_e_unknown_label_identifer,actasmpattern);
+                 Message1(asmr_e_unknown_label_identifier,actasmpattern);
                  { once again we don't know what it represents }
                  { so we simply concatenate it                 }
                  ConcatLocal(curlist,actasmpattern);
               end
              else
-              Message1(assem_e_unknown_label_identifer,actasmpattern);
+              Message1(asmr_e_unknown_label_identifier,actasmpattern);
            end;
           Consume(AS_LABEL);
         end;
@@ -1876,34 +1860,19 @@ Begin
         end;
       AS_GLOBAL:
         Begin
-          { normal units should not be able to declare }
-          { direct label names like this... anyhow     }
-          { procedural calls in asm blocks are         }
-          { supposedely replaced automatically         }
-          if (cs_compilesystem in aktmoduleswitches) then
-           begin
-             Consume(AS_GLOBAL);
-              if actasmtoken <> AS_ID then
-                Message(assem_e_invalid_global_def)
-              else
-                ConcatPublic(curlist,actasmpattern);
-              Consume(actasmtoken);
-              if actasmtoken <> AS_SEPARATOR then
-               Begin
-                 Message(assem_e_line_separator_expected);
-                 RecoverConsume(false);
-               end;
-           end
-          else
-           begin
-             Message(assem_w_globl_not_supported);
-             RecoverConsume(false);
-           end;
+          Consume(AS_GLOBAL);
+          if actasmtoken=AS_ID then
+            ConcatPublic(curlist,actasmpattern);
+          Consume(AS_ID);
+          if actasmtoken<>AS_SEPARATOR then
+           Consume(AS_SEPARATOR);
         end;
       AS_ALIGN:
         Begin
-          Message(assem_w_align_not_supported);
-          RecoverConsume(false);
+          Consume(AS_ALIGN);
+          ConcatAlign(curlist,BuildConstExpression(false,false));
+          if actasmtoken<>AS_SEPARATOR then
+           Consume(AS_SEPARATOR);
         end;
       AS_ASCIIZ:
         Begin
@@ -1917,65 +1886,23 @@ Begin
         end;
       AS_LCOMM:
         Begin
-          { -- this should only be allowed for system development -- }
-          { -- otherwise may mess up future enhancements we might -- }
-          { -- add.                                               -- }
-          if (cs_compilesystem in aktmoduleswitches) then
-           begin
-             Consume(AS_LCOMM);
-             if actasmtoken <> AS_ID then
-              begin
-                Message(assem_e_invalid_lcomm_def);
-                RecoverConsume(false);
-               end
-              else
-               begin
-                 commname:=actasmpattern;
-                 Consume(AS_COMMA);
-                 ConcatLocalBss(actasmpattern,BuildConstExpression(false,false));
-                 if actasmtoken <> AS_SEPARATOR then
-                  Begin
-                    Message(assem_e_line_separator_expected);
-                    RecoverConsume(false);
-                  end;
-               end;
-            end
-           else
-            begin
-              Message(assem_w_lcomm_not_supported);
-              RecoverConsume(false);
-            end;
-         end;
+          Consume(AS_LCOMM);
+          commname:=actasmpattern;
+          Consume(AS_ID);
+          Consume(AS_COMMA);
+          ConcatLocalBss(actasmpattern,BuildConstExpression(false,false));
+          if actasmtoken<>AS_SEPARATOR then
+           Consume(AS_SEPARATOR);
+        end;
       AS_COMM:
          Begin
-           { -- this should only be allowed for system development -- }
-           { -- otherwise may mess up future enhancements we might -- }
-           { -- add.                                               -- }
-           if (cs_compilesystem in aktmoduleswitches) then
-            begin
-              Consume(AS_COMM);
-              if actasmtoken <> AS_ID then
-               begin
-                 Message(assem_e_invalid_comm_def);
-                 RecoverConsume(false);
-               end
-              else
-               begin
-                 commname:=actasmpattern;
-                 Consume(AS_COMMA);
-                 ConcatGlobalBss(actasmpattern,BuildConstExpression(false,false));
-                 if actasmtoken <> AS_SEPARATOR then
-                  Begin
-                    Message(assem_e_line_separator_expected);
-                    RecoverConsume(false);
-                  end;
-               end;
-            end
-           else
-            begin
-              Message(assem_w_comm_not_supported);
-              RecoverConsume(false);
-            end;
+          Consume(AS_LCOMM);
+          commname:=actasmpattern;
+          Consume(AS_ID);
+          Consume(AS_COMMA);
+          ConcatGlobalBss(actasmpattern,BuildConstExpression(false,false));
+          if actasmtoken<>AS_SEPARATOR then
+           Consume(AS_SEPARATOR);
         end;
       AS_OPCODE:
         Begin
@@ -2001,7 +1928,7 @@ Begin
         end;
       else
         Begin
-          Message(assem_e_syntax_error);
+          Message(asmr_e_syntax_error);
           RecoverConsume(false);
         end;
     end;
@@ -2017,19 +1944,19 @@ Begin
       Begin
         nextlabel:=labelptr^.next;
         if not labelptr^.emitted  then
-         Message1(assem_e_local_sym_not_found_in_asm_statement,'.L'+labelptr^.name^);
+         Message1(asmr_e_unknown_label_identifier,'.L'+labelptr^.name^);
         labelptr:=nextlabel;
       end;
    end;
   { are we back in the code section? }
   if lastsec<>sec_code then
    begin
-     Message(assem_e_assembler_code_not_returned_to_text);
+     Message(asmr_w_assembler_code_not_returned_to_text);
      curlist^.Concat(new(pai_section,init(sec_code)));
    end;
   assemble:=genasmnode(curlist);
   labellist.done;
-  Message(assem_d_finish_att);
+  Message1(asmr_d_finish_reading,'AT&T');
 end;
 
 
@@ -2056,7 +1983,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.43  1999-05-04 21:45:01  florian
+  Revision 1.44  1999-05-05 22:22:00  peter
+    * updated messages
+
+  Revision 1.43  1999/05/04 21:45:01  florian
     * changes to compile it with Delphi 4.0
 
   Revision 1.42  1999/05/02 14:25:07  peter

+ 13 - 10
compiler/ra386dir.pas

@@ -130,7 +130,7 @@ unit Ra386dir;
                                        plabelsym(srsym)^.number^.is_set:=true;
                                     end
                                   else
-                                    Message(assem_w_using_defined_as_local);
+                                    Message(asmr_w_using_defined_as_local);
                               end
                             else if upper(hs)='FWAIT' then
                              FwaitWarning
@@ -215,7 +215,7 @@ unit Ra386dir;
                                              begin
                                                 if (sym^.typ = varsym) or (sym^.typ = typedconstsym) then
                                                   begin
-                                                     Message2(assem_h_direct_global_to_mangled,hs,sym^.mangledname);
+                                                     Message2(asmr_h_direct_global_to_mangled,hs,sym^.mangledname);
                                                      hs:=sym^.mangledname;
                                                      if sym^.typ=varsym then
                                                        inc(pvarsym(sym)^.refs);
@@ -225,8 +225,8 @@ unit Ra386dir;
                                                    ((pos('CALL',upper(s))>0) or (pos('LEA',upper(s))>0)) then
                                                   begin
                                                      if assigned(pprocsym(sym)^.definition^.nextoverloaded) then
-                                                       Message1(assem_w_direct_global_is_overloaded_func,hs);
-                                                     Message2(assem_h_direct_global_to_mangled,hs,sym^.mangledname);
+                                                       Message1(asmr_w_direct_global_is_overloaded_func,hs);
+                                                     Message2(asmr_h_direct_global_to_mangled,hs,sym^.mangledname);
                                                      hs:=sym^.mangledname;
                                                   end;
                                              end
@@ -237,7 +237,7 @@ unit Ra386dir;
                                                 if assigned(procinfo._class) then
                                                   hs:=tostr(procinfo.ESI_offset)+'('+att_reg2str[procinfo.framepointer]+')'
                                                 else
-                                                 Message(assem_e_cannot_use_SELF_outside_a_method);
+                                                 Message(asmr_e_cannot_use_SELF_outside_a_method);
                                              end
                                            else if upper(hs)='__RESULT' then
                                              begin
@@ -245,17 +245,17 @@ unit Ra386dir;
                                                   (procinfo.retdef<>pdef(voiddef)) then
                                                   hs:=retstr
                                                 else
-                                                  Message(assem_w_void_function);
+                                                  Message(asmr_e_void_function);
                                              end
                                            else if upper(hs)='__OLDEBP' then
                                              begin
                                                 { complicate to check there }
                                                 { we do it: }
                                                 if lexlevel>normal_function_level then
-                                                  hs:=tostr(procinfo.framepointer_offset)
-                                                    +'('+att_reg2str[procinfo.framepointer]+')'
+                                                  hs:=tostr(procinfo.framepointer_offset)+
+                                                    '('+att_reg2str[procinfo.framepointer]+')'
                                                 else
-                                                  Message(assem_e_cannot_use___OLDEBP_outside_nested_procedure);
+                                                  Message(asmr_e_cannot_use___OLDEBP_outside_nested_procedure);
                                              end;
                                            end;
                                         end;
@@ -295,7 +295,10 @@ unit Ra386dir;
 end.
 {
   $Log$
-  Revision 1.18  1999-05-01 13:24:40  peter
+  Revision 1.19  1999-05-05 22:22:02  peter
+    * updated messages
+
+  Revision 1.18  1999/05/01 13:24:40  peter
     * merged nasm compiler
     * old asm moved to oldasm/
 

+ 101 - 96
compiler/ra386int.pas

@@ -44,19 +44,19 @@ Uses
 
 
 type
- tasmtoken = (
-   AS_NONE,AS_LABEL,AS_LLABEL,AS_STRING,AS_INTNUM,
-   AS_COMMA,AS_LBRACKET,AS_RBRACKET,AS_LPAREN,
-   AS_RPAREN,AS_COLON,AS_DOT,AS_PLUS,AS_MINUS,AS_STAR,
-   AS_SEPARATOR,AS_ID,AS_REGISTER,AS_OPCODE,AS_SLASH,
+  tasmtoken = (
+    AS_NONE,AS_LABEL,AS_LLABEL,AS_STRING,AS_INTNUM,
+    AS_COMMA,AS_LBRACKET,AS_RBRACKET,AS_LPAREN,
+    AS_RPAREN,AS_COLON,AS_DOT,AS_PLUS,AS_MINUS,AS_STAR,
+    AS_SEPARATOR,AS_ID,AS_REGISTER,AS_OPCODE,AS_SLASH,
      {------------------ Assembler directives --------------------}
-   AS_DB,AS_DW,AS_DD,AS_END,
+    AS_DB,AS_DW,AS_DD,AS_END,
      {------------------ Assembler Operators  --------------------}
-   AS_BYTE,AS_WORD,AS_DWORD,AS_QWORD,AS_TBYTE,AS_NEAR,AS_FAR,
-   AS_HIGH,AS_LOW,AS_OFFSET,AS_SEG,AS_TYPE,AS_PTR,AS_MOD,AS_SHL,AS_SHR,AS_NOT,
-   AS_AND,AS_OR,AS_XOR);
+    AS_BYTE,AS_WORD,AS_DWORD,AS_QWORD,AS_TBYTE,AS_NEAR,AS_FAR,
+    AS_HIGH,AS_LOW,AS_OFFSET,AS_SEG,AS_TYPE,AS_PTR,AS_MOD,AS_SHL,AS_SHR,AS_NOT,
+    AS_AND,AS_OR,AS_XOR);
 
-   tasmkeyword = string[6];
+  tasmkeyword = string[6];
 const
    { These tokens should be modified accordingly to the modifications }
    { in the different enumerations.                                   }
@@ -83,6 +83,17 @@ const
     'LOW','OFFSET','SEG','TYPE','PTR','MOD','SHL','SHR','NOT','AND',
     'OR','XOR');
 
+  token2str : array[tasmtoken] of string[10] = (
+    '','Label','LLabel','String','Integer',
+    ',','[',']','(',
+    ')',':','.','+','-','*',
+    ';','identifier','register','opcode','/',
+    '','','','END',
+    '','','','','','','','',
+    '','','','type','ptr','mod','shl','shr','not',
+    'and','or','xor'
+  );
+
 const
   newline = #10;
   firsttoken : boolean = TRUE;
@@ -111,7 +122,6 @@ var
   i : tasmop;
   j : tregister;
 Begin
-  Message(assem_d_creating_lookup_tables);
   { opcodes }
   new(iasmops);
   for i:=firstop to lastop do
@@ -286,7 +296,7 @@ begin
      { Are we trying to create an identifier with }
      { an at-sign...?                             }
      if forcelabel then
-      Message(assem_e_none_label_contain_at);
+      Message(asmr_e_none_label_contain_at);
      { opcode ? }
      If is_asmopcode(actasmpattern) then
       Begin
@@ -297,7 +307,6 @@ begin
       end;
      if is_asmdirective(actasmpattern) then
       exit;
-     Message1(assem_e_invalid_operand,actasmpattern);
      actasmtoken:=AS_NONE;
      exit;
    end
@@ -350,7 +359,7 @@ begin
 
        '&' : { override operator... not supported }
          begin
-           Message(assem_w_override_op_not_supported);
+           Message(asmr_w_override_op_not_supported);
            c:=current_scanner^.asmgetchar;
            actasmtoken:=AS_NONE;
          end;
@@ -607,15 +616,17 @@ begin
 end;
 
 
-procedure consume(t : tasmtoken);
+function consume(t : tasmtoken):boolean;
 begin
+  Consume:=true;
   if t<>actasmtoken then
-    Message(assem_e_syntax_error);
-  gettoken;
-  { if the token must be ignored, then }
-  { get another token to parse.        }
-  if actasmtoken = AS_NONE then
+   begin
+     Message2(scan_f_syn_expected,token2str[t],token2str[actasmtoken]);
+     Consume:=false;
+   end;
+  repeat
     gettoken;
+  until actasmtoken<>AS_NONE;
 end;
 
 
@@ -648,19 +659,15 @@ Begin
    begin
      Consume(AS_DOT);
      if actasmtoken=AS_ID then
+      s:=s+'.'+actasmpattern;
+     if not Consume(AS_ID) then
       begin
-        s:=s+'.'+actasmpattern;
-        Consume(AS_ID);
-      end
-     else
-      begin
-        Message(assem_e_syntax_error);
         RecoverConsume(true);
         break;
       end;
    end;
   if not GetRecordOffsetSize(s,offset,size) then
-   Message(assem_e_syntax_error);
+   Message(asmr_e_building_record_offset);
 end;
 
 
@@ -773,7 +780,7 @@ Begin
         begin
           Consume(AS_OFFSET);
           if actasmtoken<>AS_ID then
-           Comment(V_Error,'assem_e_offset_without_identifier');
+           Message(asmr_e_offset_without_identifier);
         end;
       AS_ID:
         Begin
@@ -804,7 +811,7 @@ Begin
                 if assigned(sym) then
                  begin
                    if sym^.owner^.symtabletype in [localsymtable,parasymtable] then
-                     Writeln('can''t use local variable or parameters here');
+                     Message(asmr_e_no_local_or_para_allowed);
                    case srsym^.typ of
                      varsym :
                        hs:=pvarsym(srsym)^.mangledname;
@@ -813,29 +820,29 @@ Begin
                      procsym :
                        hs:=pprocsym(srsym)^.mangledname;
                      else
-                       Writeln('Error: wrong sym type');
+                       Message(asmr_e_wrong_sym_type);
                    end;
                  end
                 else
-                 Message1(assem_e_unknown_id,tempstr);
+                 Message1(sym_e_unknown_id,tempstr);
               end;
              { symbol found? }
              if hs<>'' then
               begin
                 if needofs and (prevtok<>AS_OFFSET) then
-                 Comment(V_Error,'assem_e_need_offset');
+                 Message(asmr_e_need_offset);
                 if asmsym='' then
                  asmsym:=hs
                 else
-                 Comment(V_Error,'assem_e_cant_have_multiple_relocatable_symbols');
+                 Message(asmr_e_cant_have_multiple_relocatable_symbols);
                 if (expr='') or (expr[length(expr)]='+') then
                  begin
                    delete(expr,length(expr),1);
                    if not(actasmtoken in [AS_MINUS,AS_PLUS,AS_COMMA,AS_SEPARATOR,AS_END]) then
-                    Comment(V_Error,'assem_e_only_add_relocatable_symbol');
+                    Message(asmr_e_only_add_relocatable_symbol);
                  end
                 else
-                 Comment(V_Error,'assem_e_only_add_relocatable_symbol');
+                 Message(asmr_e_only_add_relocatable_symbol);
               end;
            end;
         end;
@@ -849,7 +856,7 @@ Begin
       Begin
         { write error only once. }
         if not errorflag then
-          Message(assem_e_invalid_constant_expression);
+          Message(asmr_e_invalid_constant_expression);
         { consume tokens until we find COMMA or SEPARATOR }
         Consume(actasmtoken);
         errorflag:=TRUE;
@@ -866,6 +873,7 @@ Begin
 end;
 
 
+
 Function BuildConstExpression:longint;
 var
   l : longint;
@@ -873,7 +881,7 @@ var
 begin
   BuildConstSymbolExpression(false,l,hs);
   if hs<>'' then
-   Comment(V_Error,'no relocatable symbols allowed');
+   Message(asmr_e_relocatable_symbol_not_allowed);
   BuildConstExpression:=l;
 end;
 
@@ -909,9 +917,9 @@ Begin
       AS_ID: { Constant reference expression OR variable reference expression }
         Begin
           if not GotPlus then
-            Message(assem_e_invalid_reference_syntax);
+            Message(asmr_e_invalid_reference_syntax);
           if actasmpattern[1] = '@' then
-           Message(assem_e_local_symbol_not_allowed_as_ref);
+           Message(asmr_e_local_symbol_not_allowed_as_ref);
           if SearchIConstant(actasmpattern,l) then
            begin
              l:=BuildConstExpression;
@@ -928,19 +936,19 @@ Begin
           else
            Begin
              if instr.operands[operandnum].hasvar then
-               writeln('can''t have more than one variable in an reference');
+               Message(asmr_e_cant_have_multiple_relocatable_symbols);
              if negative then
-               writeln('can''t substract relocatable variable');
+               Message(asmr_e_only_add_relocatable_symbol);
              oldbase:=instr.operands[operandnum].ref.base;
              instr.operands[operandnum].ref.base:=R_NO;
              if not CreateVarInstr(instr,actasmpattern,operandnum) then
-               Message1(assem_e_unknown_id,actasmpattern);
+               Message1(sym_e_unknown_id,actasmpattern);
              { is the base register loaded by the var ? }
              if (instr.operands[operandnum].ref.base<>R_NO) then
               begin
                 { check if we can move the old base to the index register }
                 if (instr.operands[operandnum].ref.index<>R_NO) then
-                 writeln('invalid base and index register usage')
+                 Message(asmr_e_wrong_base_index)
                 else
                  instr.operands[operandnum].ref.index:=oldbase;
               end
@@ -988,10 +996,10 @@ Begin
             AS_REGISTER :
               begin
                 if instr.operands[operandnum].ref.scalefactor=0 then
-                 Comment(V_Error,'wrong scale factor specified');
+                 Message(asmr_e_wrong_scale_factor);
               end;
             else
-              Message(assem_e_invalid_reference_syntax);
+              Message(asmr_e_invalid_reference_syntax);
           end;
           if actasmtoken<>AS_REGISTER then
            begin
@@ -1005,7 +1013,7 @@ Begin
       AS_REGISTER :
         begin
           if (not GotPlus) and (actasmtoken<>AS_STAR) then
-            Message(assem_e_invalid_reference_syntax);
+            Message(asmr_e_invalid_reference_syntax);
           hreg:=actasmregister;
           Consume(AS_REGISTER);
           { this register will be the index }
@@ -1013,7 +1021,7 @@ Begin
              (instr.operands[operandnum].ref.base<>R_NO) then
            begin
              if (instr.operands[operandnum].ref.index<>R_NO) then
-               writeln('Error: multiple index register usage');
+              Message(asmr_e_multiple_index);
              instr.operands[operandnum].ref.index:=hreg;
            end
           else
@@ -1026,7 +1034,7 @@ Begin
       AS_LPAREN : { Constant reference expression }
         begin
           if not GotPlus then
-            Message(assem_e_invalid_reference_syntax);
+            Message(asmr_e_invalid_reference_syntax);
           l:=BuildConstExpression;
           if actasmtoken=AS_STAR then
            instr.operands[operandnum].ref.scalefactor:=l
@@ -1043,14 +1051,14 @@ Begin
       AS_RBRACKET :
         begin
           if GotPlus then
-            Message(assem_e_invalid_reference_syntax);
+            Message(asmr_e_invalid_reference_syntax);
           Consume(AS_RBRACKET);
           break;
         end;
 
       else
         Begin
-          Message(assem_e_invalid_reference_syntax);
+          Message(asmr_e_invalid_reference_syntax);
           RecoverConsume(true);
           break;
         end;
@@ -1102,19 +1110,19 @@ Begin
     AS_LPAREN :
       Begin
         if not (instr.operands[operandnum].operandtype in [OPR_NONE,OPR_CONSTANT]) then
-          Message(assem_e_invalid_operand_type);
+          Message(asmr_e_invalid_operand_type);
         BuildConstOperand(instr);
       end;
 
     AS_STRING :
       Begin
         if not (instr.operands[operandnum].operandtype in [OPR_NONE]) then
-          Message(assem_e_invalid_operand_type);
+          Message(asmr_e_invalid_operand_type);
         instr.operands[operandnum].operandtype:=OPR_CONSTANT;
         if not PadZero(actasmpattern,4) then
-          Message1(assem_e_invalid_string_as_opcode_operand,actasmpattern);
+          Message1(asmr_e_invalid_string_as_opcode_operand,actasmpattern);
         instr.operands[operandnum].val:=ord(actasmpattern[4]) + ord(actasmpattern[3]) shl 8 +
-                                          Ord(actasmpattern[2]) shl 16 + ord(actasmpattern[1]) shl 24;
+                                        Ord(actasmpattern[2]) shl 16 + ord(actasmpattern[1]) shl 24;
         Consume(AS_STRING);
       end;
 
@@ -1131,12 +1139,12 @@ Begin
             end
            else
             if (actasmpattern = '@CODE') or (actasmpattern = '@DATA') then
-              Message(assem_w_CODE_and_DATA_not_supported)
+              Message(asmr_w_CODE_and_DATA_not_supported)
            else
             Begin
               delete(actasmpattern,1,1);
               if actasmpattern = '' then
-                Message(assem_e_null_label_ref_not_allowed);
+                Message(asmr_e_null_label_ref_not_allowed);
               lab:=labellist.search(actasmpattern);
               { check if the label is already defined   }
               { if so, we then check if the plabel is   }
@@ -1164,7 +1172,7 @@ Begin
             end;
            Consume(AS_ID);
            if not (actasmtoken in [AS_SEPARATOR,AS_COMMA]) then
-             Message(assem_e_syntax_error);
+             Message(asmr_e_syntax_error);
          end
         else
         { support result for delphi modes }
@@ -1182,7 +1190,7 @@ Begin
            if SearchIConstant(actasmpattern,l) then
             Begin
               if not (instr.operands[operandnum].operandtype in [OPR_NONE,OPR_CONSTANT]) then
-               Message(assem_e_invalid_operand_type);
+               Message(asmr_e_invalid_operand_type);
               BuildConstOperand(instr);
             end
            else
@@ -1194,7 +1202,7 @@ Begin
                instr.labeled:=TRUE;
                Consume(AS_ID);
                if not (actasmtoken in [AS_SEPARATOR,AS_COMMA]) then
-                Message(assem_e_syntax_error);
+                Message(asmr_e_syntax_error);
              end
             else
             { is it a normal variable ? }
@@ -1212,10 +1220,10 @@ Begin
                         instr.operands[operandnum].ref.base:=procinfo.framepointer;
                       end
                      else
-                      Message(assem_e_cannot_use_SELF_outside_a_method);
+                      Message(asmr_e_cannot_use_SELF_outside_a_method);
                    end
                   else
-                   Message1(assem_e_unknown_id,actasmpattern);
+                   Message1(sym_e_unknown_id,actasmpattern);
                 end;
                l:=0;
                expr:=actasmpattern;
@@ -1229,7 +1237,7 @@ Begin
                if actasmtoken=AS_DOT then
                 begin
                   if expr='' then
-                   writeln('No type specified!')
+                   Message(asmr_e_no_var_type_specified)
                   else
                    begin
                      BuildRecordOffsetSize(expr,toffset,tsize);
@@ -1255,20 +1263,15 @@ Begin
         if actasmtoken = AS_COLON then
          Begin
            Consume(AS_COLON);
-           if actasmtoken <> AS_LBRACKET then
-            Message(assem_e_syn_start_with_bracket)
-           else
-            Begin
-              initAsmRef(instr,operandnum);
-              instr.operands[operandnum].ref.segment:=tempreg;
-              BuildBracketExpression(instr);
-            end;
+           initAsmRef(instr,operandnum);
+           instr.operands[operandnum].ref.segment:=tempreg;
+           BuildBracketExpression(instr);
          end
         else
         { Simple register }
          begin
            if not (instr.operands[operandnum].operandtype in [OPR_NONE,OPR_REGISTER]) then
-            Message(assem_e_invalid_operand_type);
+            Message(asmr_e_invalid_operand_type);
            instr.operands[operandnum].operandtype:=OPR_REGISTER;
            instr.operands[operandnum].reg:=tempreg;
            instr.operands[operandnum].size:=reg_2_opsize[instr.operands[operandnum].reg];
@@ -1282,7 +1285,7 @@ Begin
 
     AS_SEG :
       Begin
-        Comment(V_Error,'assem_e_seg_not_supported');
+        Message(asmr_e_seg_not_supported);
         Consume(actasmtoken);
       end;
 
@@ -1290,11 +1293,11 @@ Begin
     AS_COMMA: ;
 
     else
-      Message(assem_e_syn_opcode_operand);
+      Message(asmr_e_syn_operand);
   end;
   if not(actasmtoken in [AS_END,AS_SEPARATOR,AS_COMMA]) then
    begin
-     Message(assem_e_syntax_error);
+     Message(asmr_e_syntax_error);
      RecoverConsume(true);
    end;
 end;
@@ -1341,7 +1344,7 @@ Begin
               Consume(AS_COMMA);
             AS_SEPARATOR: ;
             else
-              Message(assem_e_invalid_string_expression);
+              Message(asmr_e_invalid_string_expression);
           end;
           ConcatString(curlist,expr);
         end;
@@ -1356,7 +1359,7 @@ Begin
           if asmsym<>'' then
            begin
              if maxvalue<>$ffffffff then
-              Comment(V_Warning,'32bit constant created for address');
+               Message(asmr_w_const32bit_for_address);
              ConcatConstSymbol(curlist,asmsym,value)
            end
           else
@@ -1367,7 +1370,10 @@ Begin
       AS_SEPARATOR:
         break;
       else
-        Message(assem_f_internal_error_in_buildconstant);
+        begin
+          Message(asmr_e_syn_constant);
+          RecoverConsume(false);
+        end
     end;
   Until false;
 end;
@@ -1394,8 +1400,6 @@ Begin
   repeat
     if is_prefix(actopcode) then
      begin
-       if (PrefixOp<>A_None) or (OverrideOp<>A_None) then
-        Message(assem_w_repeat_prefix_and_seg_override);
        PrefixOp:=ActOpcode;
        instr.opcode:=ActOpcode;
        instr.condition:=ActCondition;
@@ -1406,8 +1410,6 @@ Begin
     else
      if is_override(actopcode) then
       begin
-        if (PrefixOp<>A_None) or (OverrideOp<>A_None) then
-         Message(assem_w_repeat_prefix_and_seg_override);
         OverrideOp:=ActOpcode;
         instr.opcode:=ActOpcode;
         instr.condition:=ActCondition;
@@ -1421,7 +1423,7 @@ Begin
   { opcode }
   if (actasmtoken <> AS_OPCODE) then
    Begin
-     Message(assem_e_invalid_or_missing_opcode);
+     Message(asmr_e_invalid_or_missing_opcode);
      RecoverConsume(false);
      exit;
    end;
@@ -1431,9 +1433,9 @@ Begin
   instr.opsize:=ActOpsize;
   { Valid combination of prefix/override and instruction ?  }
   if (prefixop<>A_NONE) and (NOT CheckPrefix(PrefixOp,actopcode)) then
-    Message1(assem_e_invalid_prefix_and_opcode,actasmpattern);
+    Message1(asmr_e_invalid_prefix_and_opcode,actasmpattern);
   if (overrideop<>A_NONE) and (NOT CheckOverride(OverrideOp,ActOpcode)) then
-    Message1(assem_e_invalid_override_and_opcode,actasmpattern);
+    Message1(asmr_e_invalid_override_and_opcode,actasmpattern);
   { We are reading operands, so opcode will be an AS_ID }
   operandnum:=1;
   Consume(AS_OPCODE);
@@ -1456,7 +1458,7 @@ Begin
       AS_COMMA :
         Begin
           if operandnum > MaxOperands then
-            Message(assem_e_too_many_operands)
+            Message(asmr_e_too_many_operands)
           else
             Inc(operandnum);
           Consume(AS_COMMA);
@@ -1501,7 +1503,7 @@ Begin
                    { otherwise syntax error.        }
                    initAsmRef(instr,operandnum);
                    if not CreateVarInstr(instr,actasmpattern,operandnum) then
-                     Message1(assem_e_unknown_id,actasmpattern);
+                     Message1(sym_e_unknown_id,actasmpattern);
                  end
                 else
                  begin
@@ -1521,9 +1523,9 @@ Begin
       AS_FAR :
         Begin
           if actasmtoken = AS_NEAR then
-            Message(assem_w_near_ignored)
+            Message(asmr_w_near_ignored)
           else
-            Message(assem_w_far_ignored);
+            Message(asmr_w_far_ignored);
           Consume(actasmtoken);
           if actasmtoken = AS_PTR then
            begin
@@ -1558,7 +1560,7 @@ Var
   hl : plabel;
   labelptr : pasmlabel;
 Begin
-  Message(assem_d_start_intel);
+  Message1(asmr_d_start_reading,'intel');
   inexpression:=FALSE;
   firsttoken:=TRUE;
   operandnum:=0;
@@ -1597,7 +1599,7 @@ Begin
            { already been emitted).                        }
            Begin
               if labelptr^.emitted then
-               Message1(assem_e_dup_local_sym,'@'+labelptr^.name^)
+               Message1(asmr_e_dup_local_sym,'@'+labelptr^.name^)
               else
                Begin
                  if assigned(labelptr^.lab) then
@@ -1613,7 +1615,7 @@ Begin
           if SearchLabel(actasmpattern,hl) then
             ConcatLabel(curlist,hl)
           else
-            Message1(assem_e_unknown_label_identifer,actasmpattern);
+            Message1(asmr_e_unknown_label_identifier,actasmpattern);
           Consume(AS_LABEL);
         end;
 
@@ -1668,7 +1670,7 @@ Begin
 
       else
         Begin
-          Message(assem_e_assemble_node_syntax_error);
+          Message(asmr_e_syntax_error);
           { error recovery }
           Consume(actasmtoken);
         end;
@@ -1685,19 +1687,19 @@ Begin
       Begin
         { first label }
         if not labelptr^.emitted then
-          Message1(assem_e_unknown_local_sym,'@'+labelptr^.name^);
+          Message1(asmr_e_unknown_local_sym,'@'+labelptr^.name^);
         { other labels ... }
         While (labelptr^.Next <> nil) do
          Begin
            labelptr:=labelptr^.Next;
            if not labelptr^.emitted then
-            Message1(assem_e_unknown_local_sym,'@'+labelptr^.name^);
+            Message1(asmr_e_unknown_local_sym,'@'+labelptr^.name^);
          end;
       end;
    end;
   assemble:=genasmnode(curlist);
   labellist.done;
-  Message(assem_d_finish_intel);
+  Message1(asmr_d_finish_reading,'intel');
 end;
 
 
@@ -1724,7 +1726,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.32  1999-05-04 21:45:02  florian
+  Revision 1.33  1999-05-05 22:22:03  peter
+    * updated messages
+
+  Revision 1.32  1999/05/04 21:45:02  florian
     * changes to compile it with Delphi 4.0
 
   Revision 1.31  1999/05/01 13:48:41  peter

+ 144 - 142
compiler/rautils.pas

@@ -129,15 +129,6 @@ Type
   {                   Expression parser types                           }
   {---------------------------------------------------------------------}
 
-  { expression parser error codes }
-  texpr_error =
-   (zero_divide,       { divide by zero.     }
-    stack_overflow,    { stack overflow.     }
-    stack_underflow,   { stack underflow.    }
-    invalid_number,    { invalid conversion  }
-    invalid_op);       { invalid operator    }
-
-
    TExprOperator = record
     ch: char;           { operator }
     is_prefix: boolean; { was it a prefix, possible prefixes are +,- and not }
@@ -166,7 +157,6 @@ Type
      Constructor Init;
      Destructor Done;
      Function Evaluate(Expr:  String): longint;
-     Procedure Error(anerror: texpr_error); virtual;
      Function Priority(_Operator: Char): Integer; virtual;
     private
      RPNStack   : Array[1..RPNMax] of longint;        { Stack For RPN calculator }
@@ -241,6 +231,7 @@ Function ValHexaDecimal(const S:String):longint;
   Procedure ConcatConstSymbol(p : paasmoutput;const sym:string;l:longint);
   Procedure ConcatRealConstant(p : paasmoutput;value: bestreal; real_typ : tfloattype);
   Procedure ConcatString(p : paasmoutput;s:string);
+  procedure ConcatAlign(p:paasmoutput;l:longint);
   Procedure ConcatPublic(p:paasmoutput;const s : string);
   Procedure ConcatLocal(p:paasmoutput;const s : string);
   Procedure ConcatGlobalBss(const s : string;size : longint);
@@ -261,138 +252,136 @@ Constructor TExprParse.Init;
 Begin
 end;
 
-Procedure TExprParse.Error(anerror:texpr_error);
-var
-  t : tmsgconst;
-Begin
-  case anerror of
-    zero_divide:
-      t:=assem_f_ev_zero_divide;
-    stack_overflow:
-      t:=assem_f_ev_stack_overflow;
-    stack_underflow:
-      t:=assem_f_ev_stack_underflow;
-    invalid_number:
-      t:=assem_f_ev_invalid_number;
-    invalid_op:
-      t:=assem_f_ev_invalid_op;
-    else
-      t:=assem_f_ev_unknown;
-  end;
-  Message(t);
-end;
-
-Procedure TExprParse.RPNPush(Num : longint); { Add an operand to the top of the RPN stack }
+Procedure TExprParse.RPNPush(Num : longint);
+{ Add an operand to the top of the RPN stack }
 begin
   if RPNTop < RPNMax then
-  begin
-    Inc(RPNTop);
-    RPNStack[RPNTop]:=Num;
-  end
+   begin
+     Inc(RPNTop);
+     RPNStack[RPNTop]:=Num;
+   end
   else
-    Error(stack_overflow); { Put some error handler here }
+   Message(asmr_e_ev_stack_overflow);
 end;
 
 
-
-
-Function TExprParse.RPNPop : longint;       { Get the operand at the top of the RPN stack }
+Function TExprParse.RPNPop : longint;
+{ Get the operand at the top of the RPN stack }
 begin
   if RPNTop > 0 then
-  begin
-    RPNPop:=RPNStack[RPNTop];
-    Dec(RPNTop);
-  end
-  else  { Put some error handler here }
-   Error(stack_underflow);
+   begin
+     RPNPop:=RPNStack[RPNTop];
+     Dec(RPNTop);
+   end
+  else
+   Message(asmr_e_ev_stack_underflow);
 end;
 
+
 Procedure TExprParse.RPNCalc(Token : String15; prefix:boolean);                       { RPN Calculator }
 Var
   Temp  : longint;
   LocalError : Integer;
 begin
-{  Write(Token, ' ');              This just outputs the RPN expression }
-
+  { Handle operators }
   if (Length(Token) = 1) and (Token[1] in ['+', '-', '*', '/','&','|','%','^','~','<','>']) then
-  Case Token[1] of                                   { Handle operators }
-    '+' : Begin
-       if prefix then
-       else
-          RPNPush(RPNPop + RPNPop);
-     end;
-    '-' : Begin
-      if prefix then
+   Case Token[1] of
+    '+' :
+      Begin
+        if not prefix then
+         RPNPush(RPNPop + RPNPop);
+      end;
+    '-' :
+      Begin
+        if prefix then
          RPNPush(-(RPNPop))
-      else
+        else
          RPNPush(RPNPop - RPNPop);
-     end;
+      end;
     '*' : RPNPush(RPNPop * RPNPop);
     '&' : RPNPush(RPNPop AND RPNPop);
     '|' : RPNPush(RPNPop OR RPNPop);
     '~' : RPNPush(NOT RPNPop);
     '<' : RPNPush(RPNPop SHL RPNPop);
     '>' : RPNPush(RPNPop SHR RPNPop);
-    '%' : begin
-      Temp:=RPNPop;
-      if Temp <> 0 then
-       RPNPush(RPNPop mod Temp)
-      else Error(zero_divide); { Handle divide by zero error }
-     end;
+    '%' :
+      begin
+        Temp:=RPNPop;
+        if Temp <> 0 then
+         RPNPush(RPNPop mod Temp)
+        else
+         Message(asmr_e_ev_zero_divide);
+      end;
     '^' : RPNPush(RPNPop XOR RPNPop);
     '/' :
-    begin
-      Temp:=RPNPop;
-      if Temp <> 0 then
-   RPNPush(RPNPop div Temp)
-      else  Error(zero_divide);{ Handle divide by 0 error }
-    end;
-  end
+      begin
+        Temp:=RPNPop;
+        if Temp <> 0 then
+         RPNPush(RPNPop div Temp)
+        else
+         Message(asmr_e_ev_zero_divide);
+      end;
+   end
   else
-  begin                   { Convert String to number and add to stack }
-    if token='-2147483648' then
+   begin
+     { Convert String to number and add to stack }
+     if token='-2147483648' then
       begin
-         temp:=$80000000;
-         localerror:=0;
+        temp:=$80000000;
+        localerror:=0;
       end
-    else
+     else
       Val(Token, Temp, LocalError);
-    if LocalError = 0 then
+     if LocalError = 0 then
       RPNPush(Temp)
-    else  Error(invalid_number);{ Handle error }
-  end;
+     else
+      Message(asmr_e_ev_invalid_number);
+   end;
 end;
 
-Procedure TExprParse.OpPush(_Operator : char;prefix: boolean);  { Add an operator onto top of the stack }
+
+Procedure TExprParse.OpPush(_Operator : char;prefix: boolean);
+{ Add an operator onto top of the stack }
 begin
   if OpTop < OpMax then
-  begin
-    Inc(OpTop);
-    OpStack[OpTop].ch:=_Operator;
-    OpStack[OpTop].is_prefix:=prefix;
-  end
-  else Error(stack_overflow); { Put some error handler here }
+   begin
+     Inc(OpTop);
+     OpStack[OpTop].ch:=_Operator;
+     OpStack[OpTop].is_prefix:=prefix;
+   end
+  else
+   Message(asmr_e_ev_stack_overflow);
 end;
 
-Procedure TExprParse.OpPop(var _Operator:TExprOperator);               { Get operator at the top of the stack }
+
+Procedure TExprParse.OpPop(var _Operator:TExprOperator);
+{ Get operator at the top of the stack }
 begin
   if OpTop > 0 then
-  begin
-    _Operator:=OpStack[OpTop];
-    Dec(OpTop);
-  end
-  else Error(stack_underflow); { Put some error handler here }
+   begin
+     _Operator:=OpStack[OpTop];
+     Dec(OpTop);
+   end
+  else
+   Message(asmr_e_ev_stack_underflow);
 end;
 
-Function TExprParse.Priority(_Operator : Char) : Integer; { Return priority of operator }
+
+Function TExprParse.Priority(_Operator : Char) : Integer;
+{ Return priority of operator }
 { The greater the priority, the higher the precedence }
 begin
   Case _Operator OF
-    '('      : Priority:=0;
-    '+', '-' : Priority:=1;
-    '*', '/','%','<','>' : Priority:=2;
-    '|','&','^','~': Priority:=0;
-    else  Error(invalid_op);{ More error handling }
+    '(' :
+      Priority:=0;
+    '+', '-' :
+      Priority:=1;
+    '*', '/','%','<','>' :
+      Priority:=2;
+    '|','&','^','~' :
+      Priority:=0;
+  else
+    Message(asmr_e_ev_invalid_op);
   end;
 end;
 
@@ -401,7 +390,7 @@ Function TExprParse.Evaluate(Expr : String):longint;
 Var
   I     : Integer;
   Token : String15;
-  opr: TExprOperator;
+  opr   : TExprOperator;
 begin
   Evaluate:=0;
   { Reset stacks }
@@ -473,7 +462,7 @@ begin
          end; { Case }
        end
      else
-      Error(invalid_op);  { Handle bad input error }
+      Message(asmr_e_ev_invalid_op);  { Handle bad input error }
    end;
 
 { Pop off the remaining operators }
@@ -557,7 +546,7 @@ Begin
            end;
          else
            Begin
-             Message1(assem_e_escape_seq_ignored,s[i]);
+             Message1(asmr_e_escape_seq_ignored,s[i]);
              c:=s[i];
            end;
         end;
@@ -585,7 +574,7 @@ Begin
       inc(vs,ord(s[c])-ord('0'))
      else
       begin
-        Comment(V_Error,'assem_e_error_converting_decimal');
+        Message1(asmr_e_error_converting_decimal,s);
         ValDecimal:=0;
         exit;
       end;
@@ -607,7 +596,7 @@ Begin
       inc(vs,ord(s[c])-ord('0'))
      else
       begin
-        Comment(V_Error,'assem_e_error_converting_octal');
+        Message1(asmr_e_error_converting_octal,s);
         ValOctal:=0;
         exit;
       end;
@@ -629,7 +618,7 @@ Begin
       inc(vs,ord(s[c])-ord('0'))
      else
       begin
-        Comment(V_Error,'assem_e_error_converting_binary');
+        Message1(asmr_e_error_converting_binary,s);
         ValBinary:=0;
         exit;
       end;
@@ -656,7 +645,7 @@ Begin
          inc(vs,ord(s[c])-ord('a')+10);
        else
          begin
-           Comment(V_Error,'assem_e_error_converting_hexadecimal');
+           Message1(asmr_e_error_converting_hexadecimal,s);
            ValHexadecimal:=0;
            exit;
          end;
@@ -901,14 +890,14 @@ end;
     { replace by correct offset. }
     if assigned(procinfo.retdef) and
       (procinfo.retdef<>pdef(voiddef)) then
-    begin
-      instr.operands[operandnum].ref.offset:=procinfo.retoffset;
-      instr.operands[operandnum].ref.base:= procinfo.framepointer;
-      { always assume that the result is valid. }
-      procinfo.funcret_is_valid:=true;
-    end
+     begin
+       instr.operands[operandnum].ref.offset:=procinfo.retoffset;
+       instr.operands[operandnum].ref.base:= procinfo.framepointer;
+       { always assume that the result is valid. }
+       procinfo.funcret_is_valid:=true;
+     end
     else
-     Message(assem_e_invalid_symbol_ref);
+     Message(asmr_e_void_function);
   end;
 
 
@@ -916,7 +905,7 @@ end;
   Procedure FWaitWarning;
   begin
     if (target_info.target=target_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
-     Message(assem_w_fwait_emu_prob);
+     Message(asmr_w_fwait_emu_prob);
   end;
 {$endif i386}
 
@@ -1122,7 +1111,7 @@ Begin
     procsym :
       begin
         if assigned(pprocsym(sym)^.definition^.nextoverloaded) then
-          Message(assem_w_calling_overload_func);
+          Message(asmr_w_calling_overload_func);
         instr.operands[operandnum].operandtype:=OPR_SYMBOL;
         instr.operands[operandnum].symbol:=newasmsymbol(pprocsym(sym)^.definition^.mangledname);
         instr.operands[operandnum].hasvar:=true;
@@ -1131,7 +1120,7 @@ Begin
       end;
     else
       begin
-        Message(assem_e_unsupported_symbol_type);
+        Message(asmr_e_unsupported_symbol_type);
         exit;
       end;
   end;
@@ -1262,32 +1251,32 @@ end;
 
 
 
-   Procedure ConcatConstant(p: paasmoutput; value: longint; maxvalue: longint);
-  {*********************************************************************}
-  { PROCEDURE ConcatConstant(value: longint; maxvalue: longint);        }
-  {  Description: This routine adds the value constant to the current   }
-  {  instruction linked list.                                           }
-  {   maxvalue -> indicates the size of the data to initialize:         }
-  {                  $ff -> create a byte node.                         }
-  {                  $ffff -> create a word node.                       }
-  {                  $ffffffff -> create a dword node.                  }
-  {*********************************************************************}
-  Begin
-      if value > maxvalue then
-      Begin
-         Message(assem_e_constant_out_of_bounds);
-         { assuming a value of maxvalue }
-         value:=maxvalue;
-      end;
-      if maxvalue = $ff then
-          p^.concat(new(pai_const,init_8bit(byte(value))))
-      else
-      if maxvalue = $ffff then
-          p^.concat(new(pai_const,init_16bit(word(value))))
-      else
-      if maxvalue = $ffffffff then
-          p^.concat(new(pai_const,init_32bit(longint(value))));
-  end;
+Procedure ConcatConstant(p: paasmoutput; value: longint; maxvalue: longint);
+{*********************************************************************}
+{ PROCEDURE ConcatConstant(value: longint; maxvalue: longint);        }
+{  Description: This routine adds the value constant to the current   }
+{  instruction linked list.                                           }
+{   maxvalue -> indicates the size of the data to initialize:         }
+{                  $ff -> create a byte node.                         }
+{                  $ffff -> create a word node.                       }
+{                  $ffffffff -> create a dword node.                  }
+{*********************************************************************}
+Begin
+  if value > maxvalue then
+   Begin
+     Message(asmr_e_constant_out_of_bounds);
+     { assuming a value of maxvalue }
+     value:=maxvalue;
+   end;
+  if maxvalue = $ff then
+   p^.concat(new(pai_const,init_8bit(byte(value))))
+  else
+   if maxvalue = $ffff then
+    p^.concat(new(pai_const,init_16bit(word(value))))
+  else
+   if maxvalue = $ffffffff then
+    p^.concat(new(pai_const,init_32bit(longint(value))));
+end;
 
 
   Procedure ConcatConstSymbol(p : paasmoutput;const sym:string;l:longint);
@@ -1328,6 +1317,16 @@ end;
      p^.concat(new(pai_label,init(l)))
    end;
 
+   procedure ConcatAlign(p:paasmoutput;l:longint);
+  {*********************************************************************}
+  { PROCEDURE ConcatPublic                                              }
+  {  Description: This routine emits an global   definition to the      }
+  {  linked list of instructions.(used by AT&T styled asm)              }
+  {*********************************************************************}
+   begin
+     p^.concat(new(pai_align,init(l)));
+   end;
+
    procedure ConcatPublic(p:paasmoutput;const s : string);
   {*********************************************************************}
   { PROCEDURE ConcatPublic                                              }
@@ -1401,7 +1400,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.11  1999-05-02 22:41:57  peter
+  Revision 1.12  1999-05-05 22:22:04  peter
+    * updated messages
+
+  Revision 1.11  1999/05/02 22:41:57  peter
     * moved section names to systems
     * fixed nasm,intel writer
 

+ 27 - 2
compiler/systems.pas

@@ -152,7 +152,8 @@ unit systems;
           idtxt       : string[8];
           asmbin      : string[8];
           asmcmd      : string[50];
-          externals   : boolean;
+          allowdirect,
+          externals,
           needar      : boolean;
           labelprefix : string[2];
           comment     : string[2];
@@ -476,6 +477,7 @@ implementation
             idtxt  : 'AS';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
             needar : true;
             labelprefix : '.L';
@@ -490,6 +492,7 @@ implementation
             idtxt  : 'AS_AOUT';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
             needar : true;
             labelprefix : 'L';
@@ -504,6 +507,7 @@ implementation
             idtxt  : 'ASW';
             asmbin : 'asw';
             asmcmd : '-o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
             needar : true;
             labelprefix : '.L';
@@ -519,6 +523,7 @@ implementation
             idtxt  : 'NASMCOFF';
             asmbin : 'nasm';
             asmcmd : '-f coff -o $OBJ $ASM';
+            allowdirect : true;
             externals : true;
             needar : true;
             labelprefix : 'L';
@@ -533,6 +538,7 @@ implementation
             idtxt  : 'NASMELF';
             asmbin : 'nasm';
             asmcmd : '-f elf -o $OBJ $ASM';
+            allowdirect : true;
             externals : true;
             needar : true;
             labelprefix : 'L';
@@ -547,6 +553,7 @@ implementation
             idtxt  : 'NASMOBJ';
             asmbin : 'nasm';
             asmcmd : '-f obj -o $OBJ $ASM';
+            allowdirect : true;
             externals : true;
             needar : true;
             labelprefix : 'L';
@@ -561,6 +568,7 @@ implementation
             idtxt  : 'TASM';
             asmbin : 'tasm';
             asmcmd : '/m2 $ASM $OBJ';
+            allowdirect : true;
             externals : true;
             needar : true;
             labelprefix : '@@';
@@ -575,6 +583,7 @@ implementation
             idtxt  : 'MASM';
             asmbin : 'masm';
             asmcmd : '$ASM $OBJ';
+            allowdirect : true;
             externals : true;
             needar : true;
             labelprefix : '.L';
@@ -589,6 +598,7 @@ implementation
             idtxt  : 'DBG';
             asmbin : '';
             asmcmd : '';
+            allowdirect : false;
             externals : true;
             needar : false;
             labelprefix : 'L';
@@ -603,6 +613,7 @@ implementation
             idtxt  : 'COFF';
             asmbin : '';
             asmcmd : '';
+            allowdirect : false;
             externals : true;
             needar : false;
             labelprefix : '.L';
@@ -617,6 +628,7 @@ implementation
             idtxt  : 'PECOFF';
             asmbin : '';
             asmcmd : '';
+            allowdirect : false;
             externals : true;
             needar : false;
             labelprefix : '.L';
@@ -633,7 +645,9 @@ implementation
             idtxt  : 'AS';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
+            needar : true;
             labelprefix : '.L';
             comment : '# ';
             secnames : ('',
@@ -646,7 +660,9 @@ implementation
             idtxt  : 'GAS';
             asmbin : 'as68k'; { Gas for the Amiga}
             asmcmd : '--register-prefix-optional -o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
+            needar : true;
             labelprefix : '.L';
             comment : '| ';
             secnames : ('',
@@ -659,7 +675,9 @@ implementation
             idtxt  : 'MIT';
             asmbin : '';
             asmcmd : '-o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
+            needar : true;
             labelprefix : '.L';
             comment : '| ';
             secnames : ('',
@@ -672,7 +690,9 @@ implementation
             idtxt  : 'MOT';
             asmbin : '';
             asmcmd : '-o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
+            needar : true;
             labelprefix : '__L';
             comment : '| ';
             secnames : ('',
@@ -685,7 +705,9 @@ implementation
             idtxt  : 'MPW';
             asmbin : '';
             asmcmd : '-model far -o $OBJ $ASM';
+            allowdirect : true;
             externals : false;
+            needar : true;
             labelprefix : '__L';
             comment : '| ';
             secnames : ('',
@@ -1452,7 +1474,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.71  1999-05-05 17:34:33  peter
+  Revision 1.72  1999-05-05 22:22:05  peter
+    * updated messages
+
+  Revision 1.71  1999/05/05 17:34:33  peter
     * output is more like as 2.9.1
     * stabs really working for go32v2