Ver código fonte

+ emit a ret instruction at the end of functions

git-svn-id: branches/z80@44485 -
nickysn 5 anos atrás
pai
commit
050244e5f0
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      compiler/z80/cgcpu.pas

+ 4 - 3
compiler/z80/cgcpu.pas

@@ -1719,11 +1719,12 @@ unit cgcpu;
         reg : TSuperRegister;
         reg : TSuperRegister;
         LocalSize : longint;
         LocalSize : longint;
       begin
       begin
-        { every byte counts for avr, so if a subroutine is marked as non-returning, we do
+        { every byte counts for Z80, so if a subroutine is marked as non-returning, we do
           not generate any exit code, so we really trust the noreturn directive
           not generate any exit code, so we really trust the noreturn directive
         }
         }
-        //if po_noreturn in current_procinfo.procdef.procoptions then
-        //  exit;
+        if po_noreturn in current_procinfo.procdef.procoptions then
+          exit;
+        list.concat(taicpu.op_none(A_RET));
         //if po_interrupt in current_procinfo.procdef.procoptions then
         //if po_interrupt in current_procinfo.procdef.procoptions then
         //  begin
         //  begin
         //    regs:=rg[R_INTREGISTER].used_in_proc;
         //    regs:=rg[R_INTREGISTER].used_in_proc;