Browse Source

+ implemented ait_align asm output for sdcc-sdasz80

git-svn-id: branches/z80@44475 -
nickysn 5 years ago
parent
commit
1d3f14f769
1 changed files with 17 additions and 3 deletions
  1. 17 3
      compiler/z80/agsdasz80.pas

+ 17 - 3
compiler/z80/agsdasz80.pas

@@ -382,20 +382,34 @@ unit agsdasz80;
           //end;
           //end;
         end;
         end;
 
 
+
+      procedure doalign(alignment: byte; use_op: boolean; fillop: byte; maxbytes: byte; out last_align: longint;lasthp:tai);
+        var
+          i: longint;
+          alignment64 : int64;
+        begin
+          last_align:=alignment;
+          if alignment>1 then
+            writer.AsmWriteLn(#9'.bndry '+tostr(alignment));
+        end;
+
     //var op: TAsmOp;
     //var op: TAsmOp;
     //    s: string;
     //    s: string;
     //    i: byte;
     //    i: byte;
     //    sep: string[3];
     //    sep: string[3];
     var
     var
+      lasthp,
       hp: tai;
       hp: tai;
       s: string;
       s: string;
-      counter,lines,i,j,l,tokens,pos: longint;
+      counter,lines,i,j,l,tokens,pos,last_align: longint;
       quoted: Boolean;
       quoted: Boolean;
       consttype: taiconst_type;
       consttype: taiconst_type;
       ch: Char;
       ch: Char;
     begin
     begin
       if not assigned(p) then
       if not assigned(p) then
        exit;
        exit;
+      last_align:=1;
+      lasthp:=nil;
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
         begin
         begin
@@ -422,8 +436,7 @@ unit agsdasz80;
               end;
               end;
             ait_align :
             ait_align :
               begin
               begin
-                if tai_align_abstract(hp).aligntype>1 then
-                  writer.AsmWriteLn(asminfo^.comment+'Unsupported ALIGN '+tostr(tai_align_abstract(hp).aligntype));
+                doalign(tai_align_abstract(hp).aligntype,tai_align_abstract(hp).use_op,tai_align_abstract(hp).fillop,tai_align_abstract(hp).maxbytes,last_align,lasthp);
               end;
               end;
             ait_label :
             ait_label :
               begin
               begin
@@ -594,6 +607,7 @@ unit agsdasz80;
                 writer.AsmWriteLn(s);
                 writer.AsmWriteLn(s);
               end;
               end;
           end;
           end;
+          lasthp:=hp;
           hp:=tai(hp.next);
           hp:=tai(hp.next);
         end;
         end;
       //op:=taicpu(hp).opcode;
       //op:=taicpu(hp).opcode;