IsAutoPushOn, PushAutoOn, PushAutoOff, PopAuto,
PushInConstExpression, PopInConstExpression,
IsInConstExpression,
- MustCheckOverflow, BuildAsmElement ;
+ MustCheckOverflow, BuildAsmElement, BuildAsmTrash ;
TYPE
|------------------| |------------------|
*)
-PROCEDURE BuildAsmElement (input, output, trash: BOOLEAN) ;
+PROCEDURE BuildAsmElement (input, output: BOOLEAN) ;
+
+
+(*
+ BuildAsmTrash - the stack is expected to contain:
+
+
+ Entry Exit
+ ===== ====
+
+ Ptr ->
+ +------------------+
+ | expr | tokpos |
+ |------------------| +------------------+
+ | CurrentInterface | | CurrentInterface |
+ |------------------| |------------------|
+ | CurrentAsm | | CurrentAsm |
+ |------------------| |------------------|
+ | n | | n |
+ |------------------| |------------------|
+*)
+
+PROCEDURE BuildAsmTrash ;
END M2Quads.
|------------------| |------------------|
*)
-PROCEDURE BuildAsmElement (input, output, trash: BOOLEAN) ;
+PROCEDURE BuildAsmElement (input, output: BOOLEAN) ;
VAR
n, str, expr, tokpos,
CurrentInterface,
PutRegInterface (tokpos, CurrentInterface, n, name, str, expr,
0, NextQuad)
END ;
- IF trash
+ PushT (n) ;
+ PushT (CurrentAsm) ;
+ PushT (CurrentInterface)
+END BuildAsmElement ;
+
+
+(*
+ BuildAsmTrash - the stack is expected to contain:
+
+
+ Entry Exit
+ ===== ====
+
+ Ptr ->
+ +------------------+
+ | expr | tokpos |
+ |------------------| +------------------+
+ | CurrentInterface | | CurrentInterface |
+ |------------------| |------------------|
+ | CurrentAsm | | CurrentAsm |
+ |------------------| |------------------|
+ | n | | n |
+ |------------------| |------------------|
+*)
+
+PROCEDURE BuildAsmTrash ;
+VAR
+ n, expr, tokpos,
+ CurrentInterface,
+ CurrentAsm : CARDINAL ;
+BEGIN
+ PopTtok (expr, tokpos) ;
+ PopT (CurrentInterface) ;
+ PopT (CurrentAsm) ;
+ Assert (IsGnuAsm (CurrentAsm) OR IsGnuAsmVolatile (CurrentAsm)) ;
+ PopT (n) ;
+ INC (n) ;
+ IF CurrentInterface = NulSym
THEN
- PutRegInterface (tokpos, CurrentInterface, n, name, str, expr,
- 0, NextQuad)
+ CurrentInterface := MakeRegInterface ()
END ;
+ PutRegInterface (tokpos, CurrentInterface, n, NulName, NulSym, expr,
+ 0, NextQuad) ;
PushT (n) ;
PushT (CurrentAsm) ;
PushT (CurrentInterface)
-END BuildAsmElement ;
+END BuildAsmTrash ;
(*
BuildRetry,
DisplayStack,
AddVarientRange, AddVarientEquality,
- BuildAsmElement,
+ BuildAsmElement, BuildAsmTrash,
BeginVarient, EndVarient, BeginVarientList, EndVarientList,
PushInConstExpression, PopInConstExpression, IsInConstExpression,
BuildDefaultFieldAlignment, BuildPragmaField,
AsmInputElement := AsmOperandName
ConstExpression '(' Expression % IF Pass3
THEN
- BuildAsmElement (TRUE, FALSE, FALSE)
+ BuildAsmElement (TRUE, FALSE)
END
%
')'
AsmOutputElement := AsmOperandName
ConstExpression '(' Expression % IF Pass3
THEN
- BuildAsmElement (FALSE, TRUE, FALSE)
+ BuildAsmElement (FALSE, TRUE)
END
%
')'
=:
-AsmTrashList := % VAR expr, tokpos : CARDINAL ; %
+AsmTrashList := % VAR expr, tokpos: CARDINAL ; %
[ ConstExpression % IF Pass3
THEN
- PopTtok (expr, tokpos) ;
- PushT (NulSym) ;
- PushTtok (expr, tokpos) ;
- BuildAsmElement (FALSE, FALSE, TRUE) ;
- PopTtok (expr, tokpos) ;
- PopNothing ;
- PushTtok (expr, tokpos) ;
+ BuildAsmTrash
END
%
] { ',' ConstExpression % IF Pass3
THEN
- PopTtok (expr, tokpos) ;
- PushT (NulSym) ;
- PushTtok (expr, tokpos) ;
- BuildAsmElement (FALSE, FALSE, TRUE) ;
- PopTtok (expr, tokpos) ;
- PopNothing ;
- PushTtok (expr, tokpos) ;
+ BuildAsmTrash
END
%
} =: