(*---------------------------------------------------------------------------
  :Program.    ReqToolsSupport.mod
  :Contents.   Umgehung von A4-Problem bei ReqTools-Funktionen
  :Author.     Frank Lömker
  :Copyright.  Public Domain
  :Language.   Modula-2
  :Translator. M2Amiga V4.0d
  :Imports.    ReqTools [kai]
  :History.    V1.0, [Frank Lömker] 24-Feb-92
  :Bugs.       keine bekannt
---------------------------------------------------------------------------*)

IMPLEMENTATION MODULE ReqToolsSupport;

FROM UtilityD IMPORT TagItemPtr;
FROM SYSTEM IMPORT ASSEMBLE,ADDRESS;
IMPORT ReqTools;

(* Diese Prozeduren sind identisch zu denen aus ReqTools.def, benutzen aber
   nicht das Register A4, so das der Aufruf von Modula aus möglich ist.

   This procedures are identical to these from ReqTools.def, but they do not
   use register A4, so they can be used from Modula. *)

(*$ EntryExitCode:=FALSE *)
PROCEDURE EZRequestA (bodyfmt{9}, gadfmt{10}: ADDRESS (*ARRAY OF CHAR*);
                      reqInfo{11}: ReqTools.ReqInfoPtr;
                      argarray{2}: ADDRESS;
                      tagList{8}: TagItemPtr): LONGINT;
BEGIN
  ASSEMBLE (
    MOVE.L A6,-(A7)
    MOVEA.L ReqTools(A4),A6
    EXG.L D2,A4
    JSR -$42(A6)
    EXG.L D2,A4
    MOVEA.L (A7)+,A6
    RTS
  END);
END EZRequestA;

(*$ EntryExitCode:=FALSE *)
PROCEDURE EZRequestTags (bodyfmt{9}, gadfmt{10}: ADDRESS (*ARRAY OF CHAR*);
                         reqInfo{11}: ReqTools.ReqInfoPtr;
                         argarray{2}: ADDRESS;
                         tag1{8}: TagItemPtr):LONGINT;
BEGIN
  ASSEMBLE (
    MOVE.L A6,-(A7)
    MOVEA.L ReqTools(A4),A6
    EXG.L D2,A4
    JSR -$42(A6)
    EXG.L D2,A4
    MOVEA.L (A7)+,A6
    RTS
  END);
END EZRequestTags;

(*$ EntryExitCode:=FALSE *)
PROCEDURE EZRequest (bodyfmt{9}, gadfmt{10}: ADDRESS (*ARRAY OF CHAR*);
                     reqInfo{11}: ReqTools.ReqInfoPtr;
                     tagList{8}: TagItemPtr;
                     argarray{2}: ADDRESS (*LONGINT*)): LONGINT;
BEGIN
  ASSEMBLE (
    MOVE.L A6,-(A7)
    MOVEA.L ReqTools(A4),A6
    EXG.L D2,A4
    JSR -$42(A6)
    EXG.L D2,A4
    MOVEA.L (A7)+,A6
    RTS
  END);
END EZRequest;

(*$ EntryExitCode:=FALSE *)
PROCEDURE vEZRequestA (bodyfmt{9}, gadfmt{10}: ADDRESS (*ARRAY OF CHAR*);
                       reqInfo{11}: ReqTools.ReqInfoPtr;
                       argarray{2}: ADDRESS;
                       tagList{8}: TagItemPtr);
BEGIN
  ASSEMBLE (
    MOVE.L A6,-(A7)
    MOVEA.L ReqTools(A4),A6
    EXG.L D2,A4
    JSR -$42(A6)
    EXG.L D2,A4
    MOVEA.L (A7)+,A6
    RTS
  END);
END vEZRequestA;

(*$ EntryExitCode:=FALSE *)
PROCEDURE vEZRequestTags (bodyfmt{9}, gadfmt{10}: ADDRESS (*ARRAY OF CHAR*);
                          reqInfo{11}: ReqTools.ReqInfoPtr;
                          argarray{2}: ADDRESS;
                          tag1{8}: TagItemPtr);
BEGIN
  ASSEMBLE (
    MOVE.L A6,-(A7)
    MOVEA.L ReqTools(A4),A6
    EXG.L D2,A4
    JSR -$42(A6)
    EXG.L D2,A4
    MOVEA.L (A7)+,A6
    RTS
  END);
END vEZRequestTags;

(*$ EntryExitCode:=FALSE *)
PROCEDURE vEZRequest (bodyfmt{9}, gadfmt{10}: ADDRESS (*ARRAY OF CHAR*);
                      reqInfo{11}: ReqTools.ReqInfoPtr;
                      tagList{8}: TagItemPtr;
                      argarray{2}: ADDRESS (*LONGINT*));
BEGIN
  ASSEMBLE (
    MOVE.L A6,-(A7)
    MOVEA.L ReqTools(A4),A6
    EXG.L D2,A4
    JSR -$42(A6)
    EXG.L D2,A4
    MOVEA.L (A7)+,A6
    RTS
  END);
END vEZRequest;

END ReqToolsSupport.
