max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
src/gnat/atree.ads
My-Colaborations/dynamo
15
25702
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A T R E E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Alloc; with Sinfo; use Sinfo; with Einfo; use Einfo; with Namet; use Namet; with Types; use Types; with Snames; use Snames; with System; use System; with Table; with Uintp; use Uintp; with Urealp; use Urealp; with Unchecked_Conversion; package Atree is -- This package defines the format of the tree used to represent the Ada -- program internally. Syntactic and semantic information is combined in -- this tree. There is no separate symbol table structure. -- WARNING: There is a C version of this package. Any changes to this source -- file must be properly reflected in the C header file atree.h -- Package Atree defines the basic structure of the tree and its nodes and -- provides the basic abstract interface for manipulating the tree. Two other -- packages use this interface to define the representation of Ada programs -- using this tree format. The package Sinfo defines the basic representation -- of the syntactic structure of the program, as output by the parser. The -- package Einfo defines the semantic information which is added to the tree -- nodes that represent declared entities (i.e. the information which might -- typically be described in a separate symbol table structure). -- The front end of the compiler first parses the program and generates a -- tree that is simply a syntactic representation of the program in abstract -- syntax tree format. Subsequent processing in the front end traverses the -- tree, transforming it in various ways and adding semantic information. ---------------------- -- Size of Entities -- ---------------------- -- Currently entities are composed of 7 sequentially allocated 32-byte -- nodes, considered as a single record. The following definition gives -- the number of extension nodes. Num_Extension_Nodes : Node_Id := 6; -- This value is increased by one if debug flag -gnatd.N is set. This is -- for testing performance impact of adding a new extension node. We make -- this of type Node_Id for easy reference in loops using this value. ---------------------------------------- -- Definitions of Fields in Tree Node -- ---------------------------------------- -- The representation of the tree is completely hidden, using a functional -- interface for accessing and modifying the contents of nodes. Logically -- a node contains a number of fields, much as though the nodes were -- defined as a record type. The fields in a node are as follows: -- Nkind Indicates the kind of the node. This field is present -- in all nodes. The type is Node_Kind, which is declared -- in the package Sinfo. -- Sloc Location (Source_Ptr) of the corresponding token -- in the Source buffer. The individual node definitions -- show which token is referenced by this pointer. -- In_List A flag used to indicate if the node is a member -- of a node list. -- Rewrite_Ins A flag set if a node is marked as a rewrite inserted -- node as a result of a call to Mark_Rewrite_Insertion. -- Paren_Count A 2-bit count used in sub-expression nodes to indicate -- the level of parentheses. The settings are 0,1,2 and -- 3 for many. If the value is 3, then an auxiliary table -- is used to indicate the real value. Set to zero for -- non-subexpression nodes. -- Note: the required parentheses surrounding conditional -- and quantified expressions count as a level of parens -- for this purpose, so e.g. in X := (if A then B else C); -- Paren_Count for the right side will be 1. -- Comes_From_Source -- This flag is present in all nodes. It is set if the -- node is built by the scanner or parser, and clear if -- the node is built by the analyzer or expander. It -- indicates that the node corresponds to a construct -- that appears in the original source program. -- Analyzed This flag is present in all nodes. It is set when -- a node is analyzed, and is used to avoid analyzing -- the same node twice. Analysis includes expansion if -- expansion is active, so in this case if the flag is -- set it means the node has been analyzed and expanded. -- Error_Posted This flag is present in all nodes. It is set when -- an error message is posted which is associated with -- the flagged node. This is used to avoid posting more -- than one message on the same node. -- Field1 -- Field2 -- Field3 -- Field4 -- Field5 Five fields holding Union_Id values -- ElistN Synonym for FieldN typed as Elist_Id (Empty = No_Elist) -- ListN Synonym for FieldN typed as List_Id -- NameN Synonym for FieldN typed as Name_Id -- NodeN Synonym for FieldN typed as Node_Id -- StrN Synonym for FieldN typed as String_Id -- UintN Synonym for FieldN typed as Uint (Empty = Uint_0) -- UrealN Synonym for FieldN typed as Ureal -- Note: in the case of ElistN and UintN fields, it is common that we -- end up with a value of Union_Id'(0) as the default value. This value -- is meaningless as a Uint or Elist_Id value. We have two choices here. -- We could require that all Uint and Elist fields be initialized to an -- appropriate value, but that's error prone, since it would be easy to -- miss an initialization. So instead we have the retrieval functions -- generate an appropriate default value (Uint_0 or No_Elist). Probably -- it would be cleaner to generate No_Uint in the Uint case but we got -- stuck with representing an "unset" size value as zero early on, and -- it will take a bit of fiddling to change that ??? -- Note: the actual usage of FieldN (i.e. whether it contains a Elist_Id, -- List_Id, Name_Id, Node_Id, String_Id, Uint or Ureal) depends on the -- value in Nkind. Generally the access to this field is always via the -- functional interface, so the field names ElistN, ListN, NameN, NodeN, -- StrN, UintN and UrealN are used only in the bodies of the access -- functions (i.e. in the bodies of Sinfo and Einfo). These access -- functions contain debugging code that checks that the use is -- consistent with Nkind and Ekind values. -- However, in specialized circumstances (examples are the circuit in -- generic instantiation to copy trees, and in the tree dump routine), -- it is useful to be able to do untyped traversals, and an internal -- package in Atree allows for direct untyped accesses in such cases. -- Flag0 Nineteen Boolean flags (use depends on Nkind and -- Flag1 Ekind, as described for FieldN). Again the access -- Flag2 is usually via subprograms in Sinfo and Einfo which -- Flag3 provide high-level synonyms for these flags, and -- Flag4 contain debugging code that checks that the values -- Flag5 in Nkind and Ekind are appropriate for the access. -- Flag6 -- Flag7 -- Flag8 -- Flag9 -- Flag10 -- Flag11 Note that Flag0-3 are stored separately in the Flags -- Flag12 table, but that's a detail of the implementation which -- Flag13 is entirely hidden by the funcitonal interface. -- Flag14 -- Flag15 -- Flag16 -- Flag17 -- Flag18 -- Link For a node, points to the Parent. For a list, points -- to the list header. Note that in the latter case, a -- client cannot modify the link field. This field is -- private to the Atree package (but is also modified -- by the Nlists package). -- The following additional fields are present in extended nodes used -- for entities (Nkind in N_Entity). -- Ekind Entity type. This field indicates the type of the -- entity, it is of type Entity_Kind which is defined -- in package Einfo. -- Flag19 299 additional flags -- ... -- Flag317 -- Convention Entity convention (Convention_Id value) -- Field6 Additional Union_Id value stored in tree -- Node6 Synonym for Field6 typed as Node_Id -- Elist6 Synonym for Field6 typed as Elist_Id (Empty = No_Elist) -- Uint6 Synonym for Field6 typed as Uint (Empty = Uint_0) -- Similar definitions for Field7 to Field41 (and also Node7-Node41, -- Elist7-Elist41, Uint7-Uint41, Ureal7-Ureal41). Note that not all -- these functions are defined, only the ones that are actually used. function Last_Node_Id return Node_Id; pragma Inline (Last_Node_Id); -- Returns Id of last allocated node Id function Nodes_Address return System.Address; -- Return address of Nodes table (used in Back_End for Gigi call) function Flags_Address return System.Address; -- Return address of Flags table (used in Back_End for Gigi call) function Num_Nodes return Nat; -- Total number of nodes allocated, where an entity counts as a single -- node. This count is incremented every time a node or entity is -- allocated, and decremented every time a node or entity is deleted. -- This value is used by Xref and by Treepr to allocate hash tables of -- suitable size for hashing Node_Id values. ----------------------- -- Use of Empty Node -- ----------------------- -- The special Node_Id Empty is used to mark missing fields. Whenever the -- syntax has an optional component, then the corresponding field will be -- set to Empty if the component is missing. -- Note: Empty is not used to describe an empty list. Instead in this -- case the node field contains a list which is empty, and these cases -- should be distinguished (essentially from a type point of view, Empty -- is a Node, and is thus not a list). -- Note: Empty does in fact correspond to an allocated node. Only the -- Nkind field of this node may be referenced. It contains N_Empty, which -- uniquely identifies the empty case. This allows the Nkind field to be -- dereferenced before the check for Empty which is sometimes useful. ----------------------- -- Use of Error Node -- ----------------------- -- The Error node is used during syntactic and semantic analysis to -- indicate that the corresponding piece of syntactic structure or -- semantic meaning cannot properly be represented in the tree because -- of an illegality in the program. -- If an Error node is encountered, then you know that a previous -- illegality has been detected. The proper reaction should be to -- avoid posting related cascaded error messages, and to propagate -- the error node if necessary. ------------------------ -- Current_Error_Node -- ------------------------ -- The current error node is a global location indicating the current -- node that is being processed for the purposes of placing a compiler -- abort message. This is not necessarily perfectly accurate, it is -- just a reasonably accurate best guess. It is used to output the -- source location in the abort message by Comperr, and also to -- implement the d3 debugging flag. This is also used by Rtsfind -- to generate error messages for high integrity mode. -- There are two ways this gets set. During parsing, when new source -- nodes are being constructed by calls to New_Node and New_Entity, -- either one of these calls sets Current_Error_Node to the newly -- created node. During semantic analysis, this mechanism is not -- used, and instead Current_Error_Node is set by the subprograms in -- Debug_A that mark the start and end of analysis/expansion of a -- node in the tree. Current_Error_Node : Node_Id; -- Node to place error messages ------------------ -- Error Counts -- ------------------ -- The following variables denote the count of errors of various kinds -- detected in the tree. Note that these might be more logically located -- in Err_Vars, but we put it to deal with licensing issues (we need this -- to have the GPL exception licensing, since Check_Error_Detected can -- be called from units with this licensing). Serious_Errors_Detected : Nat := 0; -- This is a count of errors that are serious enough to stop expansion, -- and hence to prevent generation of an object file even if the -- switch -gnatQ is set. Initialized to zero at the start of compilation. -- Initialized for -gnatVa use, see comment above. Total_Errors_Detected : Nat := 0; -- Number of errors detected so far. Includes count of serious errors and -- non-serious errors, so this value is always greater than or equal to the -- Serious_Errors_Detected value. Initialized to zero at the start of -- compilation. Initialized for -gnatVa use, see comment above. Warnings_Detected : Nat := 0; -- Number of warnings detected. Initialized to zero at the start of -- compilation. Initialized for -gnatVa use, see comment above. This -- count includes the count of style and info messages. Info_Messages : Nat := 0; -- Number of info messages generated. Info messages are neved treated as -- errors (whether from use of the pragma, or the compiler switch -gnatwe). Check_Messages : Nat := 0; -- Number of check messages generated. Check messages are neither warnings -- nor errors. Warnings_Treated_As_Errors : Nat := 0; -- Number of warnings changed into errors as a result of matching a pattern -- given in a Warning_As_Error configuration pragma. Configurable_Run_Time_Violations : Nat := 0; -- Count of configurable run time violations so far. This is used to -- suppress certain cascaded error messages when we know that we may not -- have fully expanded some items, due to high integrity violations (e.g. -- the use of constructs not permitted by the library in use, or improper -- constructs in No_Run_Time mode). procedure Check_Error_Detected; -- When an anomaly is found in the tree, many semantic routines silently -- bail out, assuming that the anomaly was caused by a previously detected -- serious error (or configurable run time violation). This routine should -- be called in these cases, and will raise an exception if no such error -- has been detected. This ensure that the anomaly is never allowed to go -- unnoticed. ------------------------------- -- Default Setting of Fields -- ------------------------------- -- Nkind is set to N_Unused_At_Start -- Ekind is set to E_Void -- Sloc is always set, there is no default value -- Field1-5 fields are set to Empty -- Field6-41 fields in extended nodes are set to Empty -- Parent is set to Empty -- All Boolean flag fields are set to False -- Note: the value Empty is used in Field1-Field41 to indicate a null node. -- The usage varies. The common uses are to indicate absence of an optional -- clause or a completely unused Field1-35 field. ------------------------------------- -- Use of Synonyms for Node Fields -- ------------------------------------- -- A subpackage Atree.Unchecked_Access provides routines for reading and -- writing the fields defined above (Field1-35, Node1-35, Flag0-317 etc). -- These unchecked access routines can be used for untyped traversals. -- In addition they are used in the implementations of the Sinfo and -- Einfo packages. These packages both provide logical synonyms for -- the generic fields, together with an appropriate set of access routines. -- Normally access to information within tree nodes uses these synonyms, -- providing a high level typed interface to the tree information. -------------------------------------------------- -- Node Allocation and Modification Subprograms -- -------------------------------------------------- -- Generally the parser builds the tree and then it is further decorated -- (e.g. by setting the entity fields), but not fundamentally modified. -- However, there are cases in which the tree must be restructured by -- adding and rearranging nodes, as a result of disambiguating cases -- which the parser could not parse correctly, and adding additional -- semantic information (e.g. making constraint checks explicit). The -- following subprograms are used for constructing the tree in the first -- place, and then for subsequent modifications as required. procedure Initialize; -- Called at the start of compilation to initialize the allocation of -- the node and list tables and make the standard entries for Empty, -- Error and Error_List. Note that Initialize must not be called if -- Tree_Read is used. procedure Lock; -- Called before the back end is invoked to lock the nodes table -- Also called after Unlock to relock??? procedure Unlock; -- Unlocks nodes table, in cases where the back end needs to modify it procedure Tree_Read; -- Initializes internal tables from current tree file using the relevant -- Table.Tree_Read routines. Note that Initialize should not be called if -- Tree_Read is used. Tree_Read includes all necessary initialization. procedure Tree_Write; -- Writes out internal tables to current tree file using the relevant -- Table.Tree_Write routines. function New_Node (New_Node_Kind : Node_Kind; New_Sloc : Source_Ptr) return Node_Id; -- Allocates a completely new node with the given node type and source -- location values. All other fields are set to their standard defaults: -- -- Empty for all FieldN fields -- False for all FlagN fields -- -- The usual approach is to build a new node using this function and -- then, using the value returned, use the Set_xxx functions to set -- fields of the node as required. New_Node can only be used for -- non-entity nodes, i.e. it never generates an extended node. -- -- If we are currently parsing, as indicated by a previous call to -- Set_Comes_From_Source_Default (True), then this call also resets -- the value of Current_Error_Node. function New_Entity (New_Node_Kind : Node_Kind; New_Sloc : Source_Ptr) return Entity_Id; -- Similar to New_Node, except that it is used only for entity nodes -- and returns an extended node. procedure Set_Comes_From_Source_Default (Default : Boolean); -- Sets value of Comes_From_Source flag to be used in all subsequent -- New_Node and New_Entity calls until another call to this procedure -- changes the default. This value is set True during parsing and -- False during semantic analysis. This is also used to determine -- if New_Node and New_Entity should set Current_Error_Node. function Get_Comes_From_Source_Default return Boolean; pragma Inline (Get_Comes_From_Source_Default); -- Gets the current value of the Comes_From_Source flag procedure Preserve_Comes_From_Source (NewN, OldN : Node_Id); pragma Inline (Preserve_Comes_From_Source); -- When a node is rewritten, it is sometimes appropriate to preserve the -- original comes from source indication. This is true when the rewrite -- essentially corresponds to a transformation corresponding exactly to -- semantics in the reference manual. This procedure copies the setting -- of Comes_From_Source from OldN to NewN. function Has_Extension (N : Node_Id) return Boolean; pragma Inline (Has_Extension); -- Returns True if the given node has an extension (i.e. was created by -- a call to New_Entity rather than New_Node, and Nkind is in N_Entity) procedure Change_Node (N : Node_Id; New_Node_Kind : Node_Kind); -- This procedure replaces the given node by setting its Nkind field to -- the indicated value and resetting all other fields to their default -- values except for Sloc, which is unchanged, and the Parent pointer -- and list links, which are also unchanged. All other information in -- the original node is lost. The new node has an extension if the -- original node had an extension. procedure Copy_Node (Source : Node_Id; Destination : Node_Id); -- Copy the entire contents of the source node to the destination node. -- The contents of the source node is not affected. If the source node -- has an extension, then the destination must have an extension also. -- The parent pointer of the destination and its list link, if any, are -- not affected by the copy. Note that parent pointers of descendents -- are not adjusted, so the descendents of the destination node after -- the Copy_Node is completed have dubious parent pointers. Note that -- this routine does NOT copy aspect specifications, the Has_Aspects -- flag in the returned node will always be False. The caller must deal -- with copying aspect specifications where this is required. function New_Copy (Source : Node_Id) return Node_Id; -- This function allocates a completely new node, and then initializes -- it by copying the contents of the source node into it. The contents of -- the source node is not affected. The target node is always marked as -- not being in a list (even if the source is a list member), and not -- overloaded. The new node will have an extension if the source has -- an extension. New_Copy (Empty) returns Empty, and New_Copy (Error) -- returns Error. Note that, unlike Copy_Separate_Tree, New_Copy does not -- recursively copy any descendents, so in general parent pointers are not -- set correctly for the descendents of the copied node. Both normal and -- extended nodes (entities) may be copied using New_Copy. function Relocate_Node (Source : Node_Id) return Node_Id; -- Source is a non-entity node that is to be relocated. A new node is -- allocated, and the contents of Source are copied to this node, using -- New_Copy. The parent pointers of descendents of the node are then -- adjusted to point to the relocated copy. The original node is not -- modified, but the parent pointers of its descendents are no longer -- valid. The new copy is always marked as not overloaded. This routine is -- used in conjunction with the tree rewrite routines (see descriptions of -- Replace/Rewrite). -- -- Note that the resulting node has the same parent as the source node, and -- is thus still attached to the tree. It is valid for Source to be Empty, -- in which case Relocate_Node simply returns Empty as the result. function Copy_Separate_Tree (Source : Node_Id) return Node_Id; -- Given a node that is the root of a subtree, Copy_Separate_Tree copies -- the entire syntactic subtree, including recursively any descendants -- whose parent field references a copied node (descendants not linked to -- a copied node by the parent field are also copied.) The parent pointers -- in the copy are properly set. Copy_Separate_Tree (Empty/Error) returns -- Empty/Error. The new subtree does not share entities with the source, -- but has new entities with the same name. -- -- Most of the time this routine is called on an unanalyzed tree, and no -- semantic information is copied. However, to ensure that no entities -- are shared between the two when the source is already analyzed, and -- that the result looks like an unanalyzed tree from the parser, Entity -- fields and Etype fields are set to Empty, and Analyzed flags set False. -- -- In addition, Expanded_Name nodes are converted back into the original -- parser form (where they are Selected_Components), so that reanalysis -- does the right thing. function Copy_Separate_List (Source : List_Id) return List_Id; -- Applies Copy_Separate_Tree to each element of the Source list, returning -- a new list of the results of these copy operations. procedure Exchange_Entities (E1 : Entity_Id; E2 : Entity_Id); -- Exchange the contents of two entities. The parent pointers are switched -- as well as the Defining_Identifier fields in the parents, so that the -- entities point correctly to their original parents. The effect is thus -- to leave the tree completely unchanged in structure, except that the -- entity ID values of the two entities are interchanged. Neither of the -- two entities may be list members. Note that entities appear on two -- semantic chains: Homonym and Next_Entity: the corresponding links must -- be adjusted by the caller, according to context. function Extend_Node (Node : Node_Id) return Entity_Id; -- This function returns a copy of its input node with an extension added. -- The fields of the extension are set to Empty. Due to the way extensions -- are handled (as four consecutive array elements), it may be necessary -- to reallocate the node, so that the returned value is not the same as -- the input value, but where possible the returned value will be the same -- as the input value (i.e. the extension will occur in place). It is the -- caller's responsibility to ensure that any pointers to the original node -- are appropriately updated. This function is used only by Sinfo.CN to -- change nodes into their corresponding entities. type Report_Proc is access procedure (Target : Node_Id; Source : Node_Id); procedure Set_Reporting_Proc (P : Report_Proc); -- Register a procedure that is invoked when a node is allocated, replaced -- or rewritten. type Traverse_Result is (Abandon, OK, OK_Orig, Skip); -- This is the type of the result returned by the Process function passed -- to Traverse_Func and Traverse_Proc. See below for details. subtype Traverse_Final_Result is Traverse_Result range Abandon .. OK; -- This is the type of the final result returned Traverse_Func, based on -- the results of Process calls. See below for details. generic with function Process (N : Node_Id) return Traverse_Result is <>; function Traverse_Func (Node : Node_Id) return Traverse_Final_Result; -- This is a generic function that, given the parent node for a subtree, -- traverses all syntactic nodes of this tree, calling the given function -- Process on each one, in pre order (i.e. top-down). The order of -- traversing subtrees is arbitrary. The traversal is controlled as follows -- by the result returned by Process: -- OK The traversal continues normally with the syntactic -- children of the node just processed. -- OK_Orig The traversal continues normally with the syntactic -- children of the original node of the node just processed. -- Skip The children of the node just processed are skipped and -- excluded from the traversal, but otherwise processing -- continues elsewhere in the tree. -- Abandon The entire traversal is immediately abandoned, and the -- original call to Traverse returns Abandon. -- The result returned by Traverse is Abandon if processing was terminated -- by a call to Process returning Abandon, otherwise it is OK (meaning that -- all calls to process returned either OK, OK_Orig, or Skip). generic with function Process (N : Node_Id) return Traverse_Result is <>; procedure Traverse_Proc (Node : Node_Id); pragma Inline (Traverse_Proc); -- This is the same as Traverse_Func except that no result is returned, -- i.e. Traverse_Func is called and the result is simply discarded. --------------------------- -- Node Access Functions -- --------------------------- -- The following functions return the contents of the indicated field of -- the node referenced by the argument, which is a Node_Id. function Analyzed (N : Node_Id) return Boolean; pragma Inline (Analyzed); function Comes_From_Source (N : Node_Id) return Boolean; pragma Inline (Comes_From_Source); function Error_Posted (N : Node_Id) return Boolean; pragma Inline (Error_Posted); function Has_Aspects (N : Node_Id) return Boolean; pragma Inline (Has_Aspects); function Is_Ignored_Ghost_Node (N : Node_Id) return Boolean; pragma Inline (Is_Ignored_Ghost_Node); function Nkind (N : Node_Id) return Node_Kind; pragma Inline (Nkind); function No (N : Node_Id) return Boolean; pragma Inline (No); -- Tests given Id for equality with the Empty node. This allows notations -- like "if No (Variant_Part)" as opposed to "if Variant_Part = Empty". function Parent (N : Node_Id) return Node_Id; pragma Inline (Parent); -- Returns the parent of a node if the node is not a list member, or else -- the parent of the list containing the node if the node is a list member. function Paren_Count (N : Node_Id) return Nat; pragma Inline (Paren_Count); function Present (N : Node_Id) return Boolean; pragma Inline (Present); -- Tests given Id for inequality with the Empty node. This allows notations -- like "if Present (Statement)" as opposed to "if Statement /= Empty". function Sloc (N : Node_Id) return Source_Ptr; pragma Inline (Sloc); --------------------- -- Node_Kind Tests -- --------------------- -- These are like the functions in Sinfo, but the first argument is a -- Node_Id, and the tested field is Nkind (N). function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind) return Boolean; function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind) return Boolean; function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind) return Boolean; function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind) return Boolean; function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind) return Boolean; function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind; V7 : Node_Kind) return Boolean; function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind; V7 : Node_Kind; V8 : Node_Kind) return Boolean; function Nkind_In (N : Node_Id; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind; V7 : Node_Kind; V8 : Node_Kind; V9 : Node_Kind) return Boolean; pragma Inline (Nkind_In); -- Inline all above functions ----------------------- -- Entity_Kind_Tests -- ----------------------- -- Utility functions to test whether an Entity_Kind value, either given -- directly as the first argument, or the Ekind field of an Entity give -- as the first argument, matches any of the given list of Entity_Kind -- values. Return True if any match, False if no match. function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind) return Boolean; function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind) return Boolean; function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind) return Boolean; function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind) return Boolean; function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind) return Boolean; function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind; V7 : Entity_Kind) return Boolean; function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind; V7 : Entity_Kind; V8 : Entity_Kind) return Boolean; function Ekind_In (E : Entity_Id; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind; V7 : Entity_Kind; V8 : Entity_Kind; V9 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind; V7 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind; V7 : Entity_Kind; V8 : Entity_Kind) return Boolean; function Ekind_In (T : Entity_Kind; V1 : Entity_Kind; V2 : Entity_Kind; V3 : Entity_Kind; V4 : Entity_Kind; V5 : Entity_Kind; V6 : Entity_Kind; V7 : Entity_Kind; V8 : Entity_Kind; V9 : Entity_Kind) return Boolean; pragma Inline (Ekind_In); -- Inline all above functions ----------------------------- -- Entity Access Functions -- ----------------------------- -- The following functions apply only to Entity_Id values, i.e. -- to extended nodes. function Ekind (E : Entity_Id) return Entity_Kind; pragma Inline (Ekind); function Convention (E : Entity_Id) return Convention_Id; pragma Inline (Convention); ---------------------------- -- Node Update Procedures -- ---------------------------- -- The following functions set a specified field in the node whose Id is -- passed as the first argument. The second parameter is the new value -- to be set in the specified field. Note that Set_Nkind is in the next -- section, since its use is restricted. procedure Set_Analyzed (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Analyzed); procedure Set_Comes_From_Source (N : Node_Id; Val : Boolean); pragma Inline (Set_Comes_From_Source); -- Note that this routine is very rarely used, since usually the default -- mechanism provided sets the right value, but in some unusual cases, the -- value needs to be reset (e.g. when a source node is copied, and the copy -- must not have Comes_From_Source set). procedure Set_Error_Posted (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Error_Posted); procedure Set_Has_Aspects (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Has_Aspects); procedure Set_Is_Ignored_Ghost_Node (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Is_Ignored_Ghost_Node); procedure Set_Original_Node (N : Node_Id; Val : Node_Id); pragma Inline (Set_Original_Node); -- Note that this routine is used only in very peculiar cases. In normal -- cases, the Original_Node link is set by calls to Rewrite. We currently -- use it in ASIS mode to manually set the link from pragma expressions to -- their aspect original source expressions, so that the original source -- expressions accessed by ASIS are also semantically analyzed. procedure Set_Parent (N : Node_Id; Val : Node_Id); pragma Inline (Set_Parent); procedure Set_Paren_Count (N : Node_Id; Val : Nat); pragma Inline (Set_Paren_Count); procedure Set_Sloc (N : Node_Id; Val : Source_Ptr); pragma Inline (Set_Sloc); ------------------------------ -- Entity Update Procedures -- ------------------------------ -- The following procedures apply only to Entity_Id values, i.e. -- to extended nodes. procedure Basic_Set_Convention (E : Entity_Id; Val : Convention_Id); pragma Inline (Basic_Set_Convention); -- Clients should use Sem_Util.Set_Convention rather than calling this -- routine directly, as Set_Convention also deals with the special -- processing required for access types. procedure Set_Ekind (E : Entity_Id; Val : Entity_Kind); pragma Inline (Set_Ekind); --------------------------- -- Tree Rewrite Routines -- --------------------------- -- During the compilation process it is necessary in a number of situations -- to rewrite the tree. In some cases, such rewrites do not affect the -- structure of the tree, for example, when an indexed component node is -- replaced by the corresponding call node (the parser cannot distinguish -- between these two cases). -- In other situations, the rewrite does affect the structure of the -- tree. Examples are the replacement of a generic instantiation by the -- instantiated spec and body, and the static evaluation of expressions. -- If such structural modifications are done by the expander, there are -- no difficulties, since the form of the tree after the expander has no -- special significance, except as input to the backend of the compiler. -- However, if these modifications are done by the semantic phase, then -- it is important that they be done in a manner which allows the original -- tree to be preserved. This is because tools like pretty printers need -- to have this original tree structure available. -- The subprograms in this section allow rewriting of the tree by either -- insertion of new nodes in an existing list, or complete replacement of -- a subtree. The resulting tree for most purposes looks as though it has -- been really changed, and there is no trace of the original. However, -- special subprograms, also defined in this section, allow the original -- tree to be reconstructed if necessary. -- For tree modifications done in the expander, it is permissible to -- destroy the original tree, although it is also allowable to use the -- tree rewrite routines where it is convenient to do so. procedure Mark_Rewrite_Insertion (New_Node : Node_Id); pragma Inline (Mark_Rewrite_Insertion); -- This procedure marks the given node as an insertion made during a tree -- rewriting operation. Only the root needs to be marked. The call does -- not do the actual insertion, which must be done using one of the normal -- list insertion routines. The node is treated normally in all respects -- except for its response to Is_Rewrite_Insertion. The function of these -- calls is to be able to get an accurate original tree. This helps the -- accuracy of Sprint.Sprint_Node, and in particular, when stubs are being -- generated, it is essential that the original tree be accurate. function Is_Rewrite_Insertion (Node : Node_Id) return Boolean; pragma Inline (Is_Rewrite_Insertion); -- Tests whether the given node was marked using Mark_Rewrite_Insertion. -- This is used in reconstructing the original tree (where such nodes are -- to be eliminated). procedure Rewrite (Old_Node, New_Node : Node_Id); -- This is used when a complete subtree is to be replaced. Old_Node is the -- root of the old subtree to be replaced, and New_Node is the root of the -- newly constructed replacement subtree. The actual mechanism is to swap -- the contents of these two nodes fixing up the parent pointers of the -- replaced node (we do not attempt to preserve parent pointers for the -- original node). Neither Old_Node nor New_Node can be extended nodes. -- -- Note: New_Node may not contain references to Old_Node, for example as -- descendents, since the rewrite would make such references invalid. If -- New_Node does need to reference Old_Node, then these references should -- be to a relocated copy of Old_Node (see Relocate_Node procedure). -- -- Note: The Original_Node function applied to Old_Node (which has now -- been replaced by the contents of New_Node), can be used to obtain the -- original node, i.e. the old contents of Old_Node. procedure Replace (Old_Node, New_Node : Node_Id); -- This is similar to Rewrite, except that the old value of Old_Node is -- not saved, and the New_Node is deleted after the replace, since it -- is assumed that it can no longer be legitimately needed. The flag -- Is_Rewrite_Substitution will be False for the resulting node, unless -- it was already true on entry, and Original_Node will not return the -- original contents of the Old_Node, but rather the New_Node value (unless -- Old_Node had already been rewritten using Rewrite). Replace also -- preserves the setting of Comes_From_Source. -- -- Note, New_Node may not contain references to Old_Node, for example as -- descendents, since the rewrite would make such references invalid. If -- New_Node does need to reference Old_Node, then these references should -- be to a relocated copy of Old_Node (see Relocate_Node procedure). -- -- Replace is used in certain circumstances where it is desirable to -- suppress any history of the rewriting operation. Notably, it is used -- when the parser has mis-classified a node (e.g. a task entry call -- that the parser has parsed as a procedure call). function Is_Rewrite_Substitution (Node : Node_Id) return Boolean; pragma Inline (Is_Rewrite_Substitution); -- Return True iff Node has been rewritten (i.e. if Node is the root -- of a subtree which was installed using Rewrite). function Original_Node (Node : Node_Id) return Node_Id; pragma Inline (Original_Node); -- If Node has not been rewritten, then returns its input argument -- unchanged, else returns the Node for the original subtree. Note that -- this is used extensively by ASIS on the trees constructed in ASIS mode -- to reconstruct the original semantic tree. See section in sinfo.ads -- for requirements on original nodes returned by this function. -- -- Note: Parents are not preserved in original tree nodes that are -- retrieved in this way (i.e. their children may have children whose -- pointers which reference some other node). This needs more details??? -- -- Note: there is no direct mechanism for deleting an original node (in -- a manner that can be reversed later). One possible approach is to use -- Rewrite to substitute a null statement for the node to be deleted. ----------------------------------- -- Generic Field Access Routines -- ----------------------------------- -- This subpackage provides the functions for accessing and procedures for -- setting fields that are normally referenced by wrapper subprograms (e.g. -- logical synonyms defined in packages Sinfo and Einfo, or specialized -- routines such as Rewrite (for Original_Node), or the node creation -- routines (for Set_Nkind). The implementations of these wrapper -- subprograms use the package Atree.Unchecked_Access as do various -- special case accesses where no wrapper applies. Documentation is always -- required for such a special case access explaining why it is needed. package Unchecked_Access is -- Functions to allow interpretation of Union_Id values as Uint and -- Ureal values. function To_Union is new Unchecked_Conversion (Uint, Union_Id); function To_Union is new Unchecked_Conversion (Ureal, Union_Id); function From_Union is new Unchecked_Conversion (Union_Id, Uint); function From_Union is new Unchecked_Conversion (Union_Id, Ureal); -- Functions to fetch contents of indicated field. It is an error to -- attempt to read the value of a field which is not present. function Field1 (N : Node_Id) return Union_Id; pragma Inline (Field1); function Field2 (N : Node_Id) return Union_Id; pragma Inline (Field2); function Field3 (N : Node_Id) return Union_Id; pragma Inline (Field3); function Field4 (N : Node_Id) return Union_Id; pragma Inline (Field4); function Field5 (N : Node_Id) return Union_Id; pragma Inline (Field5); function Field6 (N : Node_Id) return Union_Id; pragma Inline (Field6); function Field7 (N : Node_Id) return Union_Id; pragma Inline (Field7); function Field8 (N : Node_Id) return Union_Id; pragma Inline (Field8); function Field9 (N : Node_Id) return Union_Id; pragma Inline (Field9); function Field10 (N : Node_Id) return Union_Id; pragma Inline (Field10); function Field11 (N : Node_Id) return Union_Id; pragma Inline (Field11); function Field12 (N : Node_Id) return Union_Id; pragma Inline (Field12); function Field13 (N : Node_Id) return Union_Id; pragma Inline (Field13); function Field14 (N : Node_Id) return Union_Id; pragma Inline (Field14); function Field15 (N : Node_Id) return Union_Id; pragma Inline (Field15); function Field16 (N : Node_Id) return Union_Id; pragma Inline (Field16); function Field17 (N : Node_Id) return Union_Id; pragma Inline (Field17); function Field18 (N : Node_Id) return Union_Id; pragma Inline (Field18); function Field19 (N : Node_Id) return Union_Id; pragma Inline (Field19); function Field20 (N : Node_Id) return Union_Id; pragma Inline (Field20); function Field21 (N : Node_Id) return Union_Id; pragma Inline (Field21); function Field22 (N : Node_Id) return Union_Id; pragma Inline (Field22); function Field23 (N : Node_Id) return Union_Id; pragma Inline (Field23); function Field24 (N : Node_Id) return Union_Id; pragma Inline (Field24); function Field25 (N : Node_Id) return Union_Id; pragma Inline (Field25); function Field26 (N : Node_Id) return Union_Id; pragma Inline (Field26); function Field27 (N : Node_Id) return Union_Id; pragma Inline (Field27); function Field28 (N : Node_Id) return Union_Id; pragma Inline (Field28); function Field29 (N : Node_Id) return Union_Id; pragma Inline (Field29); function Field30 (N : Node_Id) return Union_Id; pragma Inline (Field30); function Field31 (N : Node_Id) return Union_Id; pragma Inline (Field31); function Field32 (N : Node_Id) return Union_Id; pragma Inline (Field32); function Field33 (N : Node_Id) return Union_Id; pragma Inline (Field33); function Field34 (N : Node_Id) return Union_Id; pragma Inline (Field34); function Field35 (N : Node_Id) return Union_Id; pragma Inline (Field35); function Field36 (N : Node_Id) return Union_Id; pragma Inline (Field36); function Field37 (N : Node_Id) return Union_Id; pragma Inline (Field37); function Field38 (N : Node_Id) return Union_Id; pragma Inline (Field38); function Field39 (N : Node_Id) return Union_Id; pragma Inline (Field39); function Field40 (N : Node_Id) return Union_Id; pragma Inline (Field40); function Field41 (N : Node_Id) return Union_Id; pragma Inline (Field41); function Node1 (N : Node_Id) return Node_Id; pragma Inline (Node1); function Node2 (N : Node_Id) return Node_Id; pragma Inline (Node2); function Node3 (N : Node_Id) return Node_Id; pragma Inline (Node3); function Node4 (N : Node_Id) return Node_Id; pragma Inline (Node4); function Node5 (N : Node_Id) return Node_Id; pragma Inline (Node5); function Node6 (N : Node_Id) return Node_Id; pragma Inline (Node6); function Node7 (N : Node_Id) return Node_Id; pragma Inline (Node7); function Node8 (N : Node_Id) return Node_Id; pragma Inline (Node8); function Node9 (N : Node_Id) return Node_Id; pragma Inline (Node9); function Node10 (N : Node_Id) return Node_Id; pragma Inline (Node10); function Node11 (N : Node_Id) return Node_Id; pragma Inline (Node11); function Node12 (N : Node_Id) return Node_Id; pragma Inline (Node12); function Node13 (N : Node_Id) return Node_Id; pragma Inline (Node13); function Node14 (N : Node_Id) return Node_Id; pragma Inline (Node14); function Node15 (N : Node_Id) return Node_Id; pragma Inline (Node15); function Node16 (N : Node_Id) return Node_Id; pragma Inline (Node16); function Node17 (N : Node_Id) return Node_Id; pragma Inline (Node17); function Node18 (N : Node_Id) return Node_Id; pragma Inline (Node18); function Node19 (N : Node_Id) return Node_Id; pragma Inline (Node19); function Node20 (N : Node_Id) return Node_Id; pragma Inline (Node20); function Node21 (N : Node_Id) return Node_Id; pragma Inline (Node21); function Node22 (N : Node_Id) return Node_Id; pragma Inline (Node22); function Node23 (N : Node_Id) return Node_Id; pragma Inline (Node23); function Node24 (N : Node_Id) return Node_Id; pragma Inline (Node24); function Node25 (N : Node_Id) return Node_Id; pragma Inline (Node25); function Node26 (N : Node_Id) return Node_Id; pragma Inline (Node26); function Node27 (N : Node_Id) return Node_Id; pragma Inline (Node27); function Node28 (N : Node_Id) return Node_Id; pragma Inline (Node28); function Node29 (N : Node_Id) return Node_Id; pragma Inline (Node29); function Node30 (N : Node_Id) return Node_Id; pragma Inline (Node30); function Node31 (N : Node_Id) return Node_Id; pragma Inline (Node31); function Node32 (N : Node_Id) return Node_Id; pragma Inline (Node32); function Node33 (N : Node_Id) return Node_Id; pragma Inline (Node33); function Node34 (N : Node_Id) return Node_Id; pragma Inline (Node34); function Node35 (N : Node_Id) return Node_Id; pragma Inline (Node35); function Node36 (N : Node_Id) return Node_Id; pragma Inline (Node36); function Node37 (N : Node_Id) return Node_Id; pragma Inline (Node37); function Node38 (N : Node_Id) return Node_Id; pragma Inline (Node38); function Node39 (N : Node_Id) return Node_Id; pragma Inline (Node39); function Node40 (N : Node_Id) return Node_Id; pragma Inline (Node40); function Node41 (N : Node_Id) return Node_Id; pragma Inline (Node41); function List1 (N : Node_Id) return List_Id; pragma Inline (List1); function List2 (N : Node_Id) return List_Id; pragma Inline (List2); function List3 (N : Node_Id) return List_Id; pragma Inline (List3); function List4 (N : Node_Id) return List_Id; pragma Inline (List4); function List5 (N : Node_Id) return List_Id; pragma Inline (List5); function List10 (N : Node_Id) return List_Id; pragma Inline (List10); function List14 (N : Node_Id) return List_Id; pragma Inline (List14); function List25 (N : Node_Id) return List_Id; pragma Inline (List25); function Elist1 (N : Node_Id) return Elist_Id; pragma Inline (Elist1); function Elist2 (N : Node_Id) return Elist_Id; pragma Inline (Elist2); function Elist3 (N : Node_Id) return Elist_Id; pragma Inline (Elist3); function Elist4 (N : Node_Id) return Elist_Id; pragma Inline (Elist4); function Elist5 (N : Node_Id) return Elist_Id; pragma Inline (Elist5); function Elist8 (N : Node_Id) return Elist_Id; pragma Inline (Elist8); function Elist9 (N : Node_Id) return Elist_Id; pragma Inline (Elist9); function Elist10 (N : Node_Id) return Elist_Id; pragma Inline (Elist10); function Elist13 (N : Node_Id) return Elist_Id; pragma Inline (Elist13); function Elist15 (N : Node_Id) return Elist_Id; pragma Inline (Elist15); function Elist16 (N : Node_Id) return Elist_Id; pragma Inline (Elist16); function Elist18 (N : Node_Id) return Elist_Id; pragma Inline (Elist18); function Elist21 (N : Node_Id) return Elist_Id; pragma Inline (Elist21); function Elist23 (N : Node_Id) return Elist_Id; pragma Inline (Elist23); function Elist24 (N : Node_Id) return Elist_Id; pragma Inline (Elist24); function Elist25 (N : Node_Id) return Elist_Id; pragma Inline (Elist25); function Elist26 (N : Node_Id) return Elist_Id; pragma Inline (Elist26); function Name1 (N : Node_Id) return Name_Id; pragma Inline (Name1); function Name2 (N : Node_Id) return Name_Id; pragma Inline (Name2); function Str3 (N : Node_Id) return String_Id; pragma Inline (Str3); -- Note: the following Uintnn functions have a special test for the -- Field value being Empty. If an Empty value is found then Uint_0 is -- returned. This avoids the rather tricky requirement of initializing -- all Uint fields in nodes and entities. function Uint2 (N : Node_Id) return Uint; pragma Inline (Uint2); function Uint3 (N : Node_Id) return Uint; pragma Inline (Uint3); function Uint4 (N : Node_Id) return Uint; pragma Inline (Uint4); function Uint5 (N : Node_Id) return Uint; pragma Inline (Uint5); function Uint8 (N : Node_Id) return Uint; pragma Inline (Uint8); function Uint9 (N : Node_Id) return Uint; pragma Inline (Uint9); function Uint10 (N : Node_Id) return Uint; pragma Inline (Uint10); function Uint11 (N : Node_Id) return Uint; pragma Inline (Uint11); function Uint12 (N : Node_Id) return Uint; pragma Inline (Uint12); function Uint13 (N : Node_Id) return Uint; pragma Inline (Uint13); function Uint14 (N : Node_Id) return Uint; pragma Inline (Uint14); function Uint15 (N : Node_Id) return Uint; pragma Inline (Uint15); function Uint16 (N : Node_Id) return Uint; pragma Inline (Uint16); function Uint17 (N : Node_Id) return Uint; pragma Inline (Uint17); function Uint22 (N : Node_Id) return Uint; pragma Inline (Uint22); function Uint24 (N : Node_Id) return Uint; pragma Inline (Uint24); function Ureal3 (N : Node_Id) return Ureal; pragma Inline (Ureal3); function Ureal18 (N : Node_Id) return Ureal; pragma Inline (Ureal18); function Ureal21 (N : Node_Id) return Ureal; pragma Inline (Ureal21); function Flag0 (N : Node_Id) return Boolean; pragma Inline (Flag0); function Flag1 (N : Node_Id) return Boolean; pragma Inline (Flag1); function Flag2 (N : Node_Id) return Boolean; pragma Inline (Flag2); function Flag3 (N : Node_Id) return Boolean; pragma Inline (Flag3); function Flag4 (N : Node_Id) return Boolean; pragma Inline (Flag4); function Flag5 (N : Node_Id) return Boolean; pragma Inline (Flag5); function Flag6 (N : Node_Id) return Boolean; pragma Inline (Flag6); function Flag7 (N : Node_Id) return Boolean; pragma Inline (Flag7); function Flag8 (N : Node_Id) return Boolean; pragma Inline (Flag8); function Flag9 (N : Node_Id) return Boolean; pragma Inline (Flag9); function Flag10 (N : Node_Id) return Boolean; pragma Inline (Flag10); function Flag11 (N : Node_Id) return Boolean; pragma Inline (Flag11); function Flag12 (N : Node_Id) return Boolean; pragma Inline (Flag12); function Flag13 (N : Node_Id) return Boolean; pragma Inline (Flag13); function Flag14 (N : Node_Id) return Boolean; pragma Inline (Flag14); function Flag15 (N : Node_Id) return Boolean; pragma Inline (Flag15); function Flag16 (N : Node_Id) return Boolean; pragma Inline (Flag16); function Flag17 (N : Node_Id) return Boolean; pragma Inline (Flag17); function Flag18 (N : Node_Id) return Boolean; pragma Inline (Flag18); function Flag19 (N : Node_Id) return Boolean; pragma Inline (Flag19); function Flag20 (N : Node_Id) return Boolean; pragma Inline (Flag20); function Flag21 (N : Node_Id) return Boolean; pragma Inline (Flag21); function Flag22 (N : Node_Id) return Boolean; pragma Inline (Flag22); function Flag23 (N : Node_Id) return Boolean; pragma Inline (Flag23); function Flag24 (N : Node_Id) return Boolean; pragma Inline (Flag24); function Flag25 (N : Node_Id) return Boolean; pragma Inline (Flag25); function Flag26 (N : Node_Id) return Boolean; pragma Inline (Flag26); function Flag27 (N : Node_Id) return Boolean; pragma Inline (Flag27); function Flag28 (N : Node_Id) return Boolean; pragma Inline (Flag28); function Flag29 (N : Node_Id) return Boolean; pragma Inline (Flag29); function Flag30 (N : Node_Id) return Boolean; pragma Inline (Flag30); function Flag31 (N : Node_Id) return Boolean; pragma Inline (Flag31); function Flag32 (N : Node_Id) return Boolean; pragma Inline (Flag32); function Flag33 (N : Node_Id) return Boolean; pragma Inline (Flag33); function Flag34 (N : Node_Id) return Boolean; pragma Inline (Flag34); function Flag35 (N : Node_Id) return Boolean; pragma Inline (Flag35); function Flag36 (N : Node_Id) return Boolean; pragma Inline (Flag36); function Flag37 (N : Node_Id) return Boolean; pragma Inline (Flag37); function Flag38 (N : Node_Id) return Boolean; pragma Inline (Flag38); function Flag39 (N : Node_Id) return Boolean; pragma Inline (Flag39); function Flag40 (N : Node_Id) return Boolean; pragma Inline (Flag40); function Flag41 (N : Node_Id) return Boolean; pragma Inline (Flag41); function Flag42 (N : Node_Id) return Boolean; pragma Inline (Flag42); function Flag43 (N : Node_Id) return Boolean; pragma Inline (Flag43); function Flag44 (N : Node_Id) return Boolean; pragma Inline (Flag44); function Flag45 (N : Node_Id) return Boolean; pragma Inline (Flag45); function Flag46 (N : Node_Id) return Boolean; pragma Inline (Flag46); function Flag47 (N : Node_Id) return Boolean; pragma Inline (Flag47); function Flag48 (N : Node_Id) return Boolean; pragma Inline (Flag48); function Flag49 (N : Node_Id) return Boolean; pragma Inline (Flag49); function Flag50 (N : Node_Id) return Boolean; pragma Inline (Flag50); function Flag51 (N : Node_Id) return Boolean; pragma Inline (Flag51); function Flag52 (N : Node_Id) return Boolean; pragma Inline (Flag52); function Flag53 (N : Node_Id) return Boolean; pragma Inline (Flag53); function Flag54 (N : Node_Id) return Boolean; pragma Inline (Flag54); function Flag55 (N : Node_Id) return Boolean; pragma Inline (Flag55); function Flag56 (N : Node_Id) return Boolean; pragma Inline (Flag56); function Flag57 (N : Node_Id) return Boolean; pragma Inline (Flag57); function Flag58 (N : Node_Id) return Boolean; pragma Inline (Flag58); function Flag59 (N : Node_Id) return Boolean; pragma Inline (Flag59); function Flag60 (N : Node_Id) return Boolean; pragma Inline (Flag60); function Flag61 (N : Node_Id) return Boolean; pragma Inline (Flag61); function Flag62 (N : Node_Id) return Boolean; pragma Inline (Flag62); function Flag63 (N : Node_Id) return Boolean; pragma Inline (Flag63); function Flag64 (N : Node_Id) return Boolean; pragma Inline (Flag64); function Flag65 (N : Node_Id) return Boolean; pragma Inline (Flag65); function Flag66 (N : Node_Id) return Boolean; pragma Inline (Flag66); function Flag67 (N : Node_Id) return Boolean; pragma Inline (Flag67); function Flag68 (N : Node_Id) return Boolean; pragma Inline (Flag68); function Flag69 (N : Node_Id) return Boolean; pragma Inline (Flag69); function Flag70 (N : Node_Id) return Boolean; pragma Inline (Flag70); function Flag71 (N : Node_Id) return Boolean; pragma Inline (Flag71); function Flag72 (N : Node_Id) return Boolean; pragma Inline (Flag72); function Flag73 (N : Node_Id) return Boolean; pragma Inline (Flag73); function Flag74 (N : Node_Id) return Boolean; pragma Inline (Flag74); function Flag75 (N : Node_Id) return Boolean; pragma Inline (Flag75); function Flag76 (N : Node_Id) return Boolean; pragma Inline (Flag76); function Flag77 (N : Node_Id) return Boolean; pragma Inline (Flag77); function Flag78 (N : Node_Id) return Boolean; pragma Inline (Flag78); function Flag79 (N : Node_Id) return Boolean; pragma Inline (Flag79); function Flag80 (N : Node_Id) return Boolean; pragma Inline (Flag80); function Flag81 (N : Node_Id) return Boolean; pragma Inline (Flag81); function Flag82 (N : Node_Id) return Boolean; pragma Inline (Flag82); function Flag83 (N : Node_Id) return Boolean; pragma Inline (Flag83); function Flag84 (N : Node_Id) return Boolean; pragma Inline (Flag84); function Flag85 (N : Node_Id) return Boolean; pragma Inline (Flag85); function Flag86 (N : Node_Id) return Boolean; pragma Inline (Flag86); function Flag87 (N : Node_Id) return Boolean; pragma Inline (Flag87); function Flag88 (N : Node_Id) return Boolean; pragma Inline (Flag88); function Flag89 (N : Node_Id) return Boolean; pragma Inline (Flag89); function Flag90 (N : Node_Id) return Boolean; pragma Inline (Flag90); function Flag91 (N : Node_Id) return Boolean; pragma Inline (Flag91); function Flag92 (N : Node_Id) return Boolean; pragma Inline (Flag92); function Flag93 (N : Node_Id) return Boolean; pragma Inline (Flag93); function Flag94 (N : Node_Id) return Boolean; pragma Inline (Flag94); function Flag95 (N : Node_Id) return Boolean; pragma Inline (Flag95); function Flag96 (N : Node_Id) return Boolean; pragma Inline (Flag96); function Flag97 (N : Node_Id) return Boolean; pragma Inline (Flag97); function Flag98 (N : Node_Id) return Boolean; pragma Inline (Flag98); function Flag99 (N : Node_Id) return Boolean; pragma Inline (Flag99); function Flag100 (N : Node_Id) return Boolean; pragma Inline (Flag100); function Flag101 (N : Node_Id) return Boolean; pragma Inline (Flag101); function Flag102 (N : Node_Id) return Boolean; pragma Inline (Flag102); function Flag103 (N : Node_Id) return Boolean; pragma Inline (Flag103); function Flag104 (N : Node_Id) return Boolean; pragma Inline (Flag104); function Flag105 (N : Node_Id) return Boolean; pragma Inline (Flag105); function Flag106 (N : Node_Id) return Boolean; pragma Inline (Flag106); function Flag107 (N : Node_Id) return Boolean; pragma Inline (Flag107); function Flag108 (N : Node_Id) return Boolean; pragma Inline (Flag108); function Flag109 (N : Node_Id) return Boolean; pragma Inline (Flag109); function Flag110 (N : Node_Id) return Boolean; pragma Inline (Flag110); function Flag111 (N : Node_Id) return Boolean; pragma Inline (Flag111); function Flag112 (N : Node_Id) return Boolean; pragma Inline (Flag112); function Flag113 (N : Node_Id) return Boolean; pragma Inline (Flag113); function Flag114 (N : Node_Id) return Boolean; pragma Inline (Flag114); function Flag115 (N : Node_Id) return Boolean; pragma Inline (Flag115); function Flag116 (N : Node_Id) return Boolean; pragma Inline (Flag116); function Flag117 (N : Node_Id) return Boolean; pragma Inline (Flag117); function Flag118 (N : Node_Id) return Boolean; pragma Inline (Flag118); function Flag119 (N : Node_Id) return Boolean; pragma Inline (Flag119); function Flag120 (N : Node_Id) return Boolean; pragma Inline (Flag120); function Flag121 (N : Node_Id) return Boolean; pragma Inline (Flag121); function Flag122 (N : Node_Id) return Boolean; pragma Inline (Flag122); function Flag123 (N : Node_Id) return Boolean; pragma Inline (Flag123); function Flag124 (N : Node_Id) return Boolean; pragma Inline (Flag124); function Flag125 (N : Node_Id) return Boolean; pragma Inline (Flag125); function Flag126 (N : Node_Id) return Boolean; pragma Inline (Flag126); function Flag127 (N : Node_Id) return Boolean; pragma Inline (Flag127); function Flag128 (N : Node_Id) return Boolean; pragma Inline (Flag128); function Flag129 (N : Node_Id) return Boolean; pragma Inline (Flag129); function Flag130 (N : Node_Id) return Boolean; pragma Inline (Flag130); function Flag131 (N : Node_Id) return Boolean; pragma Inline (Flag131); function Flag132 (N : Node_Id) return Boolean; pragma Inline (Flag132); function Flag133 (N : Node_Id) return Boolean; pragma Inline (Flag133); function Flag134 (N : Node_Id) return Boolean; pragma Inline (Flag134); function Flag135 (N : Node_Id) return Boolean; pragma Inline (Flag135); function Flag136 (N : Node_Id) return Boolean; pragma Inline (Flag136); function Flag137 (N : Node_Id) return Boolean; pragma Inline (Flag137); function Flag138 (N : Node_Id) return Boolean; pragma Inline (Flag138); function Flag139 (N : Node_Id) return Boolean; pragma Inline (Flag139); function Flag140 (N : Node_Id) return Boolean; pragma Inline (Flag140); function Flag141 (N : Node_Id) return Boolean; pragma Inline (Flag141); function Flag142 (N : Node_Id) return Boolean; pragma Inline (Flag142); function Flag143 (N : Node_Id) return Boolean; pragma Inline (Flag143); function Flag144 (N : Node_Id) return Boolean; pragma Inline (Flag144); function Flag145 (N : Node_Id) return Boolean; pragma Inline (Flag145); function Flag146 (N : Node_Id) return Boolean; pragma Inline (Flag146); function Flag147 (N : Node_Id) return Boolean; pragma Inline (Flag147); function Flag148 (N : Node_Id) return Boolean; pragma Inline (Flag148); function Flag149 (N : Node_Id) return Boolean; pragma Inline (Flag149); function Flag150 (N : Node_Id) return Boolean; pragma Inline (Flag150); function Flag151 (N : Node_Id) return Boolean; pragma Inline (Flag151); function Flag152 (N : Node_Id) return Boolean; pragma Inline (Flag152); function Flag153 (N : Node_Id) return Boolean; pragma Inline (Flag153); function Flag154 (N : Node_Id) return Boolean; pragma Inline (Flag154); function Flag155 (N : Node_Id) return Boolean; pragma Inline (Flag155); function Flag156 (N : Node_Id) return Boolean; pragma Inline (Flag156); function Flag157 (N : Node_Id) return Boolean; pragma Inline (Flag157); function Flag158 (N : Node_Id) return Boolean; pragma Inline (Flag158); function Flag159 (N : Node_Id) return Boolean; pragma Inline (Flag159); function Flag160 (N : Node_Id) return Boolean; pragma Inline (Flag160); function Flag161 (N : Node_Id) return Boolean; pragma Inline (Flag161); function Flag162 (N : Node_Id) return Boolean; pragma Inline (Flag162); function Flag163 (N : Node_Id) return Boolean; pragma Inline (Flag163); function Flag164 (N : Node_Id) return Boolean; pragma Inline (Flag164); function Flag165 (N : Node_Id) return Boolean; pragma Inline (Flag165); function Flag166 (N : Node_Id) return Boolean; pragma Inline (Flag166); function Flag167 (N : Node_Id) return Boolean; pragma Inline (Flag167); function Flag168 (N : Node_Id) return Boolean; pragma Inline (Flag168); function Flag169 (N : Node_Id) return Boolean; pragma Inline (Flag169); function Flag170 (N : Node_Id) return Boolean; pragma Inline (Flag170); function Flag171 (N : Node_Id) return Boolean; pragma Inline (Flag171); function Flag172 (N : Node_Id) return Boolean; pragma Inline (Flag172); function Flag173 (N : Node_Id) return Boolean; pragma Inline (Flag173); function Flag174 (N : Node_Id) return Boolean; pragma Inline (Flag174); function Flag175 (N : Node_Id) return Boolean; pragma Inline (Flag175); function Flag176 (N : Node_Id) return Boolean; pragma Inline (Flag176); function Flag177 (N : Node_Id) return Boolean; pragma Inline (Flag177); function Flag178 (N : Node_Id) return Boolean; pragma Inline (Flag178); function Flag179 (N : Node_Id) return Boolean; pragma Inline (Flag179); function Flag180 (N : Node_Id) return Boolean; pragma Inline (Flag180); function Flag181 (N : Node_Id) return Boolean; pragma Inline (Flag181); function Flag182 (N : Node_Id) return Boolean; pragma Inline (Flag182); function Flag183 (N : Node_Id) return Boolean; pragma Inline (Flag183); function Flag184 (N : Node_Id) return Boolean; pragma Inline (Flag184); function Flag185 (N : Node_Id) return Boolean; pragma Inline (Flag185); function Flag186 (N : Node_Id) return Boolean; pragma Inline (Flag186); function Flag187 (N : Node_Id) return Boolean; pragma Inline (Flag187); function Flag188 (N : Node_Id) return Boolean; pragma Inline (Flag188); function Flag189 (N : Node_Id) return Boolean; pragma Inline (Flag189); function Flag190 (N : Node_Id) return Boolean; pragma Inline (Flag190); function Flag191 (N : Node_Id) return Boolean; pragma Inline (Flag191); function Flag192 (N : Node_Id) return Boolean; pragma Inline (Flag192); function Flag193 (N : Node_Id) return Boolean; pragma Inline (Flag193); function Flag194 (N : Node_Id) return Boolean; pragma Inline (Flag194); function Flag195 (N : Node_Id) return Boolean; pragma Inline (Flag195); function Flag196 (N : Node_Id) return Boolean; pragma Inline (Flag196); function Flag197 (N : Node_Id) return Boolean; pragma Inline (Flag197); function Flag198 (N : Node_Id) return Boolean; pragma Inline (Flag198); function Flag199 (N : Node_Id) return Boolean; pragma Inline (Flag199); function Flag200 (N : Node_Id) return Boolean; pragma Inline (Flag200); function Flag201 (N : Node_Id) return Boolean; pragma Inline (Flag201); function Flag202 (N : Node_Id) return Boolean; pragma Inline (Flag202); function Flag203 (N : Node_Id) return Boolean; pragma Inline (Flag203); function Flag204 (N : Node_Id) return Boolean; pragma Inline (Flag204); function Flag205 (N : Node_Id) return Boolean; pragma Inline (Flag205); function Flag206 (N : Node_Id) return Boolean; pragma Inline (Flag206); function Flag207 (N : Node_Id) return Boolean; pragma Inline (Flag207); function Flag208 (N : Node_Id) return Boolean; pragma Inline (Flag208); function Flag209 (N : Node_Id) return Boolean; pragma Inline (Flag209); function Flag210 (N : Node_Id) return Boolean; pragma Inline (Flag210); function Flag211 (N : Node_Id) return Boolean; pragma Inline (Flag211); function Flag212 (N : Node_Id) return Boolean; pragma Inline (Flag212); function Flag213 (N : Node_Id) return Boolean; pragma Inline (Flag213); function Flag214 (N : Node_Id) return Boolean; pragma Inline (Flag214); function Flag215 (N : Node_Id) return Boolean; pragma Inline (Flag215); function Flag216 (N : Node_Id) return Boolean; pragma Inline (Flag216); function Flag217 (N : Node_Id) return Boolean; pragma Inline (Flag217); function Flag218 (N : Node_Id) return Boolean; pragma Inline (Flag218); function Flag219 (N : Node_Id) return Boolean; pragma Inline (Flag219); function Flag220 (N : Node_Id) return Boolean; pragma Inline (Flag220); function Flag221 (N : Node_Id) return Boolean; pragma Inline (Flag221); function Flag222 (N : Node_Id) return Boolean; pragma Inline (Flag222); function Flag223 (N : Node_Id) return Boolean; pragma Inline (Flag223); function Flag224 (N : Node_Id) return Boolean; pragma Inline (Flag224); function Flag225 (N : Node_Id) return Boolean; pragma Inline (Flag225); function Flag226 (N : Node_Id) return Boolean; pragma Inline (Flag226); function Flag227 (N : Node_Id) return Boolean; pragma Inline (Flag227); function Flag228 (N : Node_Id) return Boolean; pragma Inline (Flag228); function Flag229 (N : Node_Id) return Boolean; pragma Inline (Flag229); function Flag230 (N : Node_Id) return Boolean; pragma Inline (Flag230); function Flag231 (N : Node_Id) return Boolean; pragma Inline (Flag231); function Flag232 (N : Node_Id) return Boolean; pragma Inline (Flag232); function Flag233 (N : Node_Id) return Boolean; pragma Inline (Flag233); function Flag234 (N : Node_Id) return Boolean; pragma Inline (Flag234); function Flag235 (N : Node_Id) return Boolean; pragma Inline (Flag235); function Flag236 (N : Node_Id) return Boolean; pragma Inline (Flag236); function Flag237 (N : Node_Id) return Boolean; pragma Inline (Flag237); function Flag238 (N : Node_Id) return Boolean; pragma Inline (Flag238); function Flag239 (N : Node_Id) return Boolean; pragma Inline (Flag239); function Flag240 (N : Node_Id) return Boolean; pragma Inline (Flag240); function Flag241 (N : Node_Id) return Boolean; pragma Inline (Flag241); function Flag242 (N : Node_Id) return Boolean; pragma Inline (Flag242); function Flag243 (N : Node_Id) return Boolean; pragma Inline (Flag243); function Flag244 (N : Node_Id) return Boolean; pragma Inline (Flag244); function Flag245 (N : Node_Id) return Boolean; pragma Inline (Flag245); function Flag246 (N : Node_Id) return Boolean; pragma Inline (Flag246); function Flag247 (N : Node_Id) return Boolean; pragma Inline (Flag247); function Flag248 (N : Node_Id) return Boolean; pragma Inline (Flag248); function Flag249 (N : Node_Id) return Boolean; pragma Inline (Flag249); function Flag250 (N : Node_Id) return Boolean; pragma Inline (Flag250); function Flag251 (N : Node_Id) return Boolean; pragma Inline (Flag251); function Flag252 (N : Node_Id) return Boolean; pragma Inline (Flag252); function Flag253 (N : Node_Id) return Boolean; pragma Inline (Flag253); function Flag254 (N : Node_Id) return Boolean; pragma Inline (Flag254); function Flag255 (N : Node_Id) return Boolean; pragma Inline (Flag255); function Flag256 (N : Node_Id) return Boolean; pragma Inline (Flag256); function Flag257 (N : Node_Id) return Boolean; pragma Inline (Flag257); function Flag258 (N : Node_Id) return Boolean; pragma Inline (Flag258); function Flag259 (N : Node_Id) return Boolean; pragma Inline (Flag259); function Flag260 (N : Node_Id) return Boolean; pragma Inline (Flag260); function Flag261 (N : Node_Id) return Boolean; pragma Inline (Flag261); function Flag262 (N : Node_Id) return Boolean; pragma Inline (Flag262); function Flag263 (N : Node_Id) return Boolean; pragma Inline (Flag263); function Flag264 (N : Node_Id) return Boolean; pragma Inline (Flag264); function Flag265 (N : Node_Id) return Boolean; pragma Inline (Flag265); function Flag266 (N : Node_Id) return Boolean; pragma Inline (Flag266); function Flag267 (N : Node_Id) return Boolean; pragma Inline (Flag267); function Flag268 (N : Node_Id) return Boolean; pragma Inline (Flag268); function Flag269 (N : Node_Id) return Boolean; pragma Inline (Flag269); function Flag270 (N : Node_Id) return Boolean; pragma Inline (Flag270); function Flag271 (N : Node_Id) return Boolean; pragma Inline (Flag271); function Flag272 (N : Node_Id) return Boolean; pragma Inline (Flag272); function Flag273 (N : Node_Id) return Boolean; pragma Inline (Flag273); function Flag274 (N : Node_Id) return Boolean; pragma Inline (Flag274); function Flag275 (N : Node_Id) return Boolean; pragma Inline (Flag275); function Flag276 (N : Node_Id) return Boolean; pragma Inline (Flag276); function Flag277 (N : Node_Id) return Boolean; pragma Inline (Flag277); function Flag278 (N : Node_Id) return Boolean; pragma Inline (Flag278); function Flag279 (N : Node_Id) return Boolean; pragma Inline (Flag279); function Flag280 (N : Node_Id) return Boolean; pragma Inline (Flag280); function Flag281 (N : Node_Id) return Boolean; pragma Inline (Flag281); function Flag282 (N : Node_Id) return Boolean; pragma Inline (Flag282); function Flag283 (N : Node_Id) return Boolean; pragma Inline (Flag283); function Flag284 (N : Node_Id) return Boolean; pragma Inline (Flag284); function Flag285 (N : Node_Id) return Boolean; pragma Inline (Flag285); function Flag286 (N : Node_Id) return Boolean; pragma Inline (Flag286); function Flag287 (N : Node_Id) return Boolean; pragma Inline (Flag287); function Flag288 (N : Node_Id) return Boolean; pragma Inline (Flag288); function Flag289 (N : Node_Id) return Boolean; pragma Inline (Flag289); function Flag290 (N : Node_Id) return Boolean; pragma Inline (Flag290); function Flag291 (N : Node_Id) return Boolean; pragma Inline (Flag291); function Flag292 (N : Node_Id) return Boolean; pragma Inline (Flag292); function Flag293 (N : Node_Id) return Boolean; pragma Inline (Flag293); function Flag294 (N : Node_Id) return Boolean; pragma Inline (Flag294); function Flag295 (N : Node_Id) return Boolean; pragma Inline (Flag295); function Flag296 (N : Node_Id) return Boolean; pragma Inline (Flag296); function Flag297 (N : Node_Id) return Boolean; pragma Inline (Flag297); function Flag298 (N : Node_Id) return Boolean; pragma Inline (Flag298); function Flag299 (N : Node_Id) return Boolean; pragma Inline (Flag299); function Flag300 (N : Node_Id) return Boolean; pragma Inline (Flag300); function Flag301 (N : Node_Id) return Boolean; pragma Inline (Flag301); function Flag302 (N : Node_Id) return Boolean; pragma Inline (Flag302); function Flag303 (N : Node_Id) return Boolean; pragma Inline (Flag303); function Flag304 (N : Node_Id) return Boolean; pragma Inline (Flag304); function Flag305 (N : Node_Id) return Boolean; pragma Inline (Flag305); function Flag306 (N : Node_Id) return Boolean; pragma Inline (Flag306); function Flag307 (N : Node_Id) return Boolean; pragma Inline (Flag307); function Flag308 (N : Node_Id) return Boolean; pragma Inline (Flag308); function Flag309 (N : Node_Id) return Boolean; pragma Inline (Flag309); function Flag310 (N : Node_Id) return Boolean; pragma Inline (Flag310); function Flag311 (N : Node_Id) return Boolean; pragma Inline (Flag311); function Flag312 (N : Node_Id) return Boolean; pragma Inline (Flag312); function Flag313 (N : Node_Id) return Boolean; pragma Inline (Flag313); function Flag314 (N : Node_Id) return Boolean; pragma Inline (Flag314); function Flag315 (N : Node_Id) return Boolean; pragma Inline (Flag315); function Flag316 (N : Node_Id) return Boolean; pragma Inline (Flag316); function Flag317 (N : Node_Id) return Boolean; pragma Inline (Flag317); -- Procedures to set value of indicated field procedure Set_Nkind (N : Node_Id; Val : Node_Kind); pragma Inline (Set_Nkind); procedure Set_Field1 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field1); procedure Set_Field2 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field2); procedure Set_Field3 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field3); procedure Set_Field4 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field4); procedure Set_Field5 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field5); procedure Set_Field6 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field6); procedure Set_Field7 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field7); procedure Set_Field8 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field8); procedure Set_Field9 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field9); procedure Set_Field10 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field10); procedure Set_Field11 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field11); procedure Set_Field12 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field12); procedure Set_Field13 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field13); procedure Set_Field14 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field14); procedure Set_Field15 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field15); procedure Set_Field16 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field16); procedure Set_Field17 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field17); procedure Set_Field18 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field18); procedure Set_Field19 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field19); procedure Set_Field20 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field20); procedure Set_Field21 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field21); procedure Set_Field22 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field22); procedure Set_Field23 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field23); procedure Set_Field24 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field24); procedure Set_Field25 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field25); procedure Set_Field26 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field26); procedure Set_Field27 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field27); procedure Set_Field28 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field28); procedure Set_Field29 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field29); procedure Set_Field30 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field30); procedure Set_Field31 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field31); procedure Set_Field32 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field32); procedure Set_Field33 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field33); procedure Set_Field34 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field34); procedure Set_Field35 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field35); procedure Set_Field36 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field36); procedure Set_Field37 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field37); procedure Set_Field38 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field38); procedure Set_Field39 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field39); procedure Set_Field40 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field40); procedure Set_Field41 (N : Node_Id; Val : Union_Id); pragma Inline (Set_Field41); procedure Set_Node1 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node1); procedure Set_Node2 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node2); procedure Set_Node3 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node3); procedure Set_Node4 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node4); procedure Set_Node5 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node5); procedure Set_Node6 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node6); procedure Set_Node7 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node7); procedure Set_Node8 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node8); procedure Set_Node9 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node9); procedure Set_Node10 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node10); procedure Set_Node11 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node11); procedure Set_Node12 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node12); procedure Set_Node13 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node13); procedure Set_Node14 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node14); procedure Set_Node15 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node15); procedure Set_Node16 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node16); procedure Set_Node17 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node17); procedure Set_Node18 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node18); procedure Set_Node19 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node19); procedure Set_Node20 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node20); procedure Set_Node21 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node21); procedure Set_Node22 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node22); procedure Set_Node23 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node23); procedure Set_Node24 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node24); procedure Set_Node25 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node25); procedure Set_Node26 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node26); procedure Set_Node27 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node27); procedure Set_Node28 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node28); procedure Set_Node29 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node29); procedure Set_Node30 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node30); procedure Set_Node31 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node31); procedure Set_Node32 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node32); procedure Set_Node33 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node33); procedure Set_Node34 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node34); procedure Set_Node35 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node35); procedure Set_Node36 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node36); procedure Set_Node37 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node37); procedure Set_Node38 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node38); procedure Set_Node39 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node39); procedure Set_Node40 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node40); procedure Set_Node41 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node41); procedure Set_List1 (N : Node_Id; Val : List_Id); pragma Inline (Set_List1); procedure Set_List2 (N : Node_Id; Val : List_Id); pragma Inline (Set_List2); procedure Set_List3 (N : Node_Id; Val : List_Id); pragma Inline (Set_List3); procedure Set_List4 (N : Node_Id; Val : List_Id); pragma Inline (Set_List4); procedure Set_List5 (N : Node_Id; Val : List_Id); pragma Inline (Set_List5); procedure Set_List10 (N : Node_Id; Val : List_Id); pragma Inline (Set_List10); procedure Set_List14 (N : Node_Id; Val : List_Id); pragma Inline (Set_List14); procedure Set_List25 (N : Node_Id; Val : List_Id); pragma Inline (Set_List25); procedure Set_Elist1 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist1); procedure Set_Elist2 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist2); procedure Set_Elist3 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist3); procedure Set_Elist4 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist4); procedure Set_Elist5 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist5); procedure Set_Elist8 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist8); procedure Set_Elist9 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist9); procedure Set_Elist10 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist10); procedure Set_Elist13 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist13); procedure Set_Elist15 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist15); procedure Set_Elist16 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist16); procedure Set_Elist18 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist18); procedure Set_Elist21 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist21); procedure Set_Elist23 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist23); procedure Set_Elist24 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist24); procedure Set_Elist25 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist25); procedure Set_Elist26 (N : Node_Id; Val : Elist_Id); pragma Inline (Set_Elist26); procedure Set_Name1 (N : Node_Id; Val : Name_Id); pragma Inline (Set_Name1); procedure Set_Name2 (N : Node_Id; Val : Name_Id); pragma Inline (Set_Name2); procedure Set_Str3 (N : Node_Id; Val : String_Id); pragma Inline (Set_Str3); procedure Set_Uint2 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint2); procedure Set_Uint3 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint3); procedure Set_Uint4 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint4); procedure Set_Uint5 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint5); procedure Set_Uint8 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint8); procedure Set_Uint9 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint9); procedure Set_Uint10 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint10); procedure Set_Uint11 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint11); procedure Set_Uint12 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint12); procedure Set_Uint13 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint13); procedure Set_Uint14 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint14); procedure Set_Uint15 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint15); procedure Set_Uint16 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint16); procedure Set_Uint17 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint17); procedure Set_Uint22 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint22); procedure Set_Uint24 (N : Node_Id; Val : Uint); pragma Inline (Set_Uint24); procedure Set_Ureal3 (N : Node_Id; Val : Ureal); pragma Inline (Set_Ureal3); procedure Set_Ureal18 (N : Node_Id; Val : Ureal); pragma Inline (Set_Ureal18); procedure Set_Ureal21 (N : Node_Id; Val : Ureal); pragma Inline (Set_Ureal21); procedure Set_Flag0 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag0); procedure Set_Flag1 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag1); procedure Set_Flag2 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag2); procedure Set_Flag3 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag3); procedure Set_Flag4 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag4); procedure Set_Flag5 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag5); procedure Set_Flag6 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag6); procedure Set_Flag7 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag7); procedure Set_Flag8 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag8); procedure Set_Flag9 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag9); procedure Set_Flag10 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag10); procedure Set_Flag11 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag11); procedure Set_Flag12 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag12); procedure Set_Flag13 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag13); procedure Set_Flag14 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag14); procedure Set_Flag15 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag15); procedure Set_Flag16 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag16); procedure Set_Flag17 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag17); procedure Set_Flag18 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag18); procedure Set_Flag19 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag19); procedure Set_Flag20 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag20); procedure Set_Flag21 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag21); procedure Set_Flag22 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag22); procedure Set_Flag23 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag23); procedure Set_Flag24 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag24); procedure Set_Flag25 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag25); procedure Set_Flag26 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag26); procedure Set_Flag27 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag27); procedure Set_Flag28 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag28); procedure Set_Flag29 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag29); procedure Set_Flag30 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag30); procedure Set_Flag31 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag31); procedure Set_Flag32 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag32); procedure Set_Flag33 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag33); procedure Set_Flag34 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag34); procedure Set_Flag35 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag35); procedure Set_Flag36 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag36); procedure Set_Flag37 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag37); procedure Set_Flag38 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag38); procedure Set_Flag39 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag39); procedure Set_Flag40 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag40); procedure Set_Flag41 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag41); procedure Set_Flag42 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag42); procedure Set_Flag43 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag43); procedure Set_Flag44 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag44); procedure Set_Flag45 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag45); procedure Set_Flag46 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag46); procedure Set_Flag47 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag47); procedure Set_Flag48 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag48); procedure Set_Flag49 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag49); procedure Set_Flag50 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag50); procedure Set_Flag51 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag51); procedure Set_Flag52 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag52); procedure Set_Flag53 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag53); procedure Set_Flag54 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag54); procedure Set_Flag55 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag55); procedure Set_Flag56 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag56); procedure Set_Flag57 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag57); procedure Set_Flag58 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag58); procedure Set_Flag59 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag59); procedure Set_Flag60 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag60); procedure Set_Flag61 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag61); procedure Set_Flag62 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag62); procedure Set_Flag63 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag63); procedure Set_Flag64 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag64); procedure Set_Flag65 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag65); procedure Set_Flag66 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag66); procedure Set_Flag67 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag67); procedure Set_Flag68 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag68); procedure Set_Flag69 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag69); procedure Set_Flag70 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag70); procedure Set_Flag71 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag71); procedure Set_Flag72 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag72); procedure Set_Flag73 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag73); procedure Set_Flag74 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag74); procedure Set_Flag75 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag75); procedure Set_Flag76 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag76); procedure Set_Flag77 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag77); procedure Set_Flag78 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag78); procedure Set_Flag79 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag79); procedure Set_Flag80 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag80); procedure Set_Flag81 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag81); procedure Set_Flag82 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag82); procedure Set_Flag83 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag83); procedure Set_Flag84 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag84); procedure Set_Flag85 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag85); procedure Set_Flag86 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag86); procedure Set_Flag87 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag87); procedure Set_Flag88 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag88); procedure Set_Flag89 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag89); procedure Set_Flag90 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag90); procedure Set_Flag91 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag91); procedure Set_Flag92 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag92); procedure Set_Flag93 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag93); procedure Set_Flag94 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag94); procedure Set_Flag95 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag95); procedure Set_Flag96 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag96); procedure Set_Flag97 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag97); procedure Set_Flag98 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag98); procedure Set_Flag99 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag99); procedure Set_Flag100 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag100); procedure Set_Flag101 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag101); procedure Set_Flag102 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag102); procedure Set_Flag103 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag103); procedure Set_Flag104 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag104); procedure Set_Flag105 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag105); procedure Set_Flag106 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag106); procedure Set_Flag107 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag107); procedure Set_Flag108 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag108); procedure Set_Flag109 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag109); procedure Set_Flag110 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag110); procedure Set_Flag111 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag111); procedure Set_Flag112 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag112); procedure Set_Flag113 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag113); procedure Set_Flag114 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag114); procedure Set_Flag115 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag115); procedure Set_Flag116 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag116); procedure Set_Flag117 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag117); procedure Set_Flag118 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag118); procedure Set_Flag119 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag119); procedure Set_Flag120 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag120); procedure Set_Flag121 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag121); procedure Set_Flag122 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag122); procedure Set_Flag123 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag123); procedure Set_Flag124 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag124); procedure Set_Flag125 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag125); procedure Set_Flag126 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag126); procedure Set_Flag127 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag127); procedure Set_Flag128 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag128); procedure Set_Flag129 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag129); procedure Set_Flag130 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag130); procedure Set_Flag131 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag131); procedure Set_Flag132 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag132); procedure Set_Flag133 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag133); procedure Set_Flag134 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag134); procedure Set_Flag135 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag135); procedure Set_Flag136 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag136); procedure Set_Flag137 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag137); procedure Set_Flag138 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag138); procedure Set_Flag139 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag139); procedure Set_Flag140 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag140); procedure Set_Flag141 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag141); procedure Set_Flag142 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag142); procedure Set_Flag143 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag143); procedure Set_Flag144 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag144); procedure Set_Flag145 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag145); procedure Set_Flag146 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag146); procedure Set_Flag147 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag147); procedure Set_Flag148 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag148); procedure Set_Flag149 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag149); procedure Set_Flag150 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag150); procedure Set_Flag151 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag151); procedure Set_Flag152 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag152); procedure Set_Flag153 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag153); procedure Set_Flag154 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag154); procedure Set_Flag155 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag155); procedure Set_Flag156 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag156); procedure Set_Flag157 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag157); procedure Set_Flag158 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag158); procedure Set_Flag159 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag159); procedure Set_Flag160 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag160); procedure Set_Flag161 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag161); procedure Set_Flag162 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag162); procedure Set_Flag163 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag163); procedure Set_Flag164 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag164); procedure Set_Flag165 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag165); procedure Set_Flag166 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag166); procedure Set_Flag167 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag167); procedure Set_Flag168 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag168); procedure Set_Flag169 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag169); procedure Set_Flag170 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag170); procedure Set_Flag171 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag171); procedure Set_Flag172 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag172); procedure Set_Flag173 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag173); procedure Set_Flag174 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag174); procedure Set_Flag175 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag175); procedure Set_Flag176 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag176); procedure Set_Flag177 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag177); procedure Set_Flag178 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag178); procedure Set_Flag179 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag179); procedure Set_Flag180 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag180); procedure Set_Flag181 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag181); procedure Set_Flag182 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag182); procedure Set_Flag183 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag183); procedure Set_Flag184 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag184); procedure Set_Flag185 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag185); procedure Set_Flag186 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag186); procedure Set_Flag187 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag187); procedure Set_Flag188 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag188); procedure Set_Flag189 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag189); procedure Set_Flag190 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag190); procedure Set_Flag191 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag191); procedure Set_Flag192 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag192); procedure Set_Flag193 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag193); procedure Set_Flag194 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag194); procedure Set_Flag195 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag195); procedure Set_Flag196 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag196); procedure Set_Flag197 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag197); procedure Set_Flag198 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag198); procedure Set_Flag199 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag199); procedure Set_Flag200 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag200); procedure Set_Flag201 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag201); procedure Set_Flag202 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag202); procedure Set_Flag203 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag203); procedure Set_Flag204 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag204); procedure Set_Flag205 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag205); procedure Set_Flag206 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag206); procedure Set_Flag207 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag207); procedure Set_Flag208 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag208); procedure Set_Flag209 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag209); procedure Set_Flag210 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag210); procedure Set_Flag211 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag211); procedure Set_Flag212 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag212); procedure Set_Flag213 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag213); procedure Set_Flag214 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag214); procedure Set_Flag215 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag215); procedure Set_Flag216 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag216); procedure Set_Flag217 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag217); procedure Set_Flag218 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag218); procedure Set_Flag219 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag219); procedure Set_Flag220 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag220); procedure Set_Flag221 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag221); procedure Set_Flag222 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag222); procedure Set_Flag223 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag223); procedure Set_Flag224 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag224); procedure Set_Flag225 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag225); procedure Set_Flag226 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag226); procedure Set_Flag227 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag227); procedure Set_Flag228 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag228); procedure Set_Flag229 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag229); procedure Set_Flag230 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag230); procedure Set_Flag231 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag231); procedure Set_Flag232 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag232); procedure Set_Flag233 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag233); procedure Set_Flag234 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag234); procedure Set_Flag235 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag235); procedure Set_Flag236 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag236); procedure Set_Flag237 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag237); procedure Set_Flag238 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag238); procedure Set_Flag239 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag239); procedure Set_Flag240 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag240); procedure Set_Flag241 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag241); procedure Set_Flag242 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag242); procedure Set_Flag243 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag243); procedure Set_Flag244 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag244); procedure Set_Flag245 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag245); procedure Set_Flag246 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag246); procedure Set_Flag247 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag247); procedure Set_Flag248 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag248); procedure Set_Flag249 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag249); procedure Set_Flag250 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag250); procedure Set_Flag251 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag251); procedure Set_Flag252 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag252); procedure Set_Flag253 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag253); procedure Set_Flag254 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag254); procedure Set_Flag255 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag255); procedure Set_Flag256 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag256); procedure Set_Flag257 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag257); procedure Set_Flag258 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag258); procedure Set_Flag259 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag259); procedure Set_Flag260 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag260); procedure Set_Flag261 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag261); procedure Set_Flag262 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag262); procedure Set_Flag263 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag263); procedure Set_Flag264 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag264); procedure Set_Flag265 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag265); procedure Set_Flag266 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag266); procedure Set_Flag267 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag267); procedure Set_Flag268 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag268); procedure Set_Flag269 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag269); procedure Set_Flag270 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag270); procedure Set_Flag271 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag271); procedure Set_Flag272 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag272); procedure Set_Flag273 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag273); procedure Set_Flag274 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag274); procedure Set_Flag275 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag275); procedure Set_Flag276 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag276); procedure Set_Flag277 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag277); procedure Set_Flag278 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag278); procedure Set_Flag279 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag279); procedure Set_Flag280 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag280); procedure Set_Flag281 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag281); procedure Set_Flag282 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag282); procedure Set_Flag283 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag283); procedure Set_Flag284 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag284); procedure Set_Flag285 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag285); procedure Set_Flag286 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag286); procedure Set_Flag287 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag287); procedure Set_Flag288 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag288); procedure Set_Flag289 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag289); procedure Set_Flag290 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag290); procedure Set_Flag291 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag291); procedure Set_Flag292 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag292); procedure Set_Flag293 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag293); procedure Set_Flag294 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag294); procedure Set_Flag295 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag295); procedure Set_Flag296 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag296); procedure Set_Flag297 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag297); procedure Set_Flag298 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag298); procedure Set_Flag299 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag299); procedure Set_Flag300 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag300); procedure Set_Flag301 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag301); procedure Set_Flag302 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag302); procedure Set_Flag303 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag303); procedure Set_Flag304 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag304); procedure Set_Flag305 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag305); procedure Set_Flag306 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag306); procedure Set_Flag307 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag307); procedure Set_Flag308 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag308); procedure Set_Flag309 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag309); procedure Set_Flag310 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag310); procedure Set_Flag311 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag311); procedure Set_Flag312 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag312); procedure Set_Flag313 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag313); procedure Set_Flag314 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag314); procedure Set_Flag315 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag315); procedure Set_Flag316 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag316); procedure Set_Flag317 (N : Node_Id; Val : Boolean); pragma Inline (Set_Flag317); -- The following versions of Set_Noden also set the parent pointer of -- the referenced node if it is not Empty. procedure Set_Node1_With_Parent (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node1_With_Parent); procedure Set_Node2_With_Parent (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node2_With_Parent); procedure Set_Node3_With_Parent (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node3_With_Parent); procedure Set_Node4_With_Parent (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node4_With_Parent); procedure Set_Node5_With_Parent (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node5_With_Parent); -- The following versions of Set_Listn also set the parent pointer of -- the referenced node if it is not Empty. procedure Set_List1_With_Parent (N : Node_Id; Val : List_Id); pragma Inline (Set_List1_With_Parent); procedure Set_List2_With_Parent (N : Node_Id; Val : List_Id); pragma Inline (Set_List2_With_Parent); procedure Set_List3_With_Parent (N : Node_Id; Val : List_Id); pragma Inline (Set_List3_With_Parent); procedure Set_List4_With_Parent (N : Node_Id; Val : List_Id); pragma Inline (Set_List4_With_Parent); procedure Set_List5_With_Parent (N : Node_Id; Val : List_Id); pragma Inline (Set_List5_With_Parent); end Unchecked_Access; ----------------------------- -- Private Part Subpackage -- ----------------------------- -- The following package contains the definition of the data structure -- used by the implementation of the Atree package. Logically it really -- corresponds to the private part, hence the name. The reason that it -- is defined as a sub-package is to allow special access from clients -- that need to see the internals of the data structures. package Atree_Private_Part is ------------------------- -- Tree Representation -- ------------------------- -- The nodes of the tree are stored in a table (i.e. an array). In the -- case of extended nodes six consecutive components in the array are -- used. There are thus two formats for array components. One is used -- for non-extended nodes, and for the first component of extended -- nodes. The other is used for the extension parts (second, third, -- fourth, fifth, and sixth components) of an extended node. A variant -- record structure is used to distinguish the two formats. type Node_Record (Is_Extension : Boolean := False) is record -- Logically, the only field in the common part is the above -- Is_Extension discriminant (a single bit). However, Gigi cannot -- yet handle such a structure, so we fill out the common part of -- the record with fields that are used in different ways for -- normal nodes and node extensions. Pflag1, Pflag2 : Boolean; -- The Paren_Count field is represented using two boolean flags, -- where Pflag1 is worth 1, and Pflag2 is worth 2. This is done -- because we need to be easily able to reuse this field for -- extra flags in the extended node case. In_List : Boolean; -- Flag used to indicate if node is a member of a list. -- This field is considered private to the Atree package. Has_Aspects : Boolean; -- Flag used to indicate that a node has aspect specifications that -- are associated with the node. See Aspects package for details. Rewrite_Ins : Boolean; -- Flag set by Mark_Rewrite_Insertion procedure. -- This field is considered private to the Atree package. Analyzed : Boolean; -- Flag to indicate the node has been analyzed (and expanded) Comes_From_Source : Boolean; -- Flag to indicate that node comes from the source program (i.e. -- was built by the parser or scanner, not the analyzer or expander). Error_Posted : Boolean; -- Flag to indicate that an error message has been posted on the -- node (to avoid duplicate flags on the same node) Flag4 : Boolean; Flag5 : Boolean; Flag6 : Boolean; Flag7 : Boolean; Flag8 : Boolean; Flag9 : Boolean; Flag10 : Boolean; Flag11 : Boolean; Flag12 : Boolean; Flag13 : Boolean; Flag14 : Boolean; Flag15 : Boolean; Flag16 : Boolean; Flag17 : Boolean; Flag18 : Boolean; -- Flags 4-18 for a normal node. Note that Flags 0-3 are stored -- separately in the Flags array. -- The above fields are used as follows in components 2-6 of an -- extended node entry. Currently they are not used in component 7, -- since for now we have all the flags we need, but of course they -- can be used for additional flags when needed in component 7. -- In_List used as Flag19,Flag40,Flag129,Flag216,Flag287 -- Has_Aspects used as Flag20,Flag41,Flag130,Flag217,Flag288 -- Rewrite_Ins used as Flag21,Flag42,Flag131,Flag218,Flag289 -- Analyzed used as Flag22,Flag43,Flag132,Flag219,Flag290 -- Comes_From_Source used as Flag23,Flag44,Flag133,Flag220,Flag291 -- Error_Posted used as Flag24,Flag45,Flag134,Flag221,Flag292 -- Flag4 used as Flag25,Flag46,Flag135,Flag222,Flag293 -- Flag5 used as Flag26,Flag47,Flag136,Flag223,Flag294 -- Flag6 used as Flag27,Flag48,Flag137,Flag224,Flag295 -- Flag7 used as Flag28,Flag49,Flag138,Flag225,Flag296 -- Flag8 used as Flag29,Flag50,Flag139,Flag226,Flag297 -- Flag9 used as Flag30,Flag51,Flag140,Flag227,Flag298 -- Flag10 used as Flag31,Flag52,Flag141,Flag228,Flag299 -- Flag11 used as Flag32,Flag53,Flag142,Flag229,Flag300 -- Flag12 used as Flag33,Flag54,Flag143,Flag230,Flag301 -- Flag13 used as Flag34,Flag55,Flag144,Flag231,Flag302 -- Flag14 used as Flag35,Flag56,Flag145,Flag232,Flag303 -- Flag15 used as Flag36,Flag57,Flag146,Flag233,Flag304 -- Flag16 used as Flag37,Flag58,Flag147,Flag234,Flag305 -- Flag17 used as Flag38,Flag59,Flag148,Flag235,Flag306 -- Flag18 used as Flag39,Flag60,Flag149,Flag236,Flag307 -- Pflag1 used as Flag61,Flag62,Flag150,Flag237,Flag308 -- Pflag2 used as Flag63,Flag64,Flag151,Flag238,Flag309 Nkind : Node_Kind; -- For a non-extended node, or the initial section of an extended -- node, this field holds the Node_Kind value. For an extended node, -- The Nkind field is used as follows: -- -- Second entry: holds the Ekind field of the entity -- Third entry: holds 8 additional flags (Flag65-Flag72) -- Fourth entry: holds 8 additional flags (Flag239-246) -- Fifth entry: holds 8 additional flags (Flag247-254) -- Sixth entry: holds 8 additional flags (Flag310-317) -- Seventh entry: currently unused -- Now finally (on an 32-bit boundary) comes the variant part case Is_Extension is -- Non-extended node, or first component of extended node when False => Sloc : Source_Ptr; -- Source location for this node Link : Union_Id; -- This field is used either as the Parent pointer (if In_List -- is False), or to point to the list header (if In_List is -- True). This field is considered private and can be modified -- only by Atree or by Nlists. Field1 : Union_Id; Field2 : Union_Id; Field3 : Union_Id; Field4 : Union_Id; Field5 : Union_Id; -- Five general use fields, which can contain Node_Id, List_Id, -- Elist_Id, String_Id, or Name_Id values depending on the -- values in Nkind and (for extended nodes), in Ekind. See -- packages Sinfo and Einfo for details of their use. -- Extension (second component) of extended node when True => Field6 : Union_Id; Field7 : Union_Id; Field8 : Union_Id; Field9 : Union_Id; Field10 : Union_Id; Field11 : Union_Id; Field12 : Union_Id; -- Seven additional general fields available only for entities -- See package Einfo for details of their use (which depends -- on the value in the Ekind field). -- In the third component, the extension format as described -- above is used to hold additional general fields and flags -- as follows: -- Field6-11 Holds Field13-Field18 -- Field12 Holds Flag73-Flag96 and Convention -- In the fourth component, the extension format as described -- above is used to hold additional general fields and flags -- as follows: -- Field6-10 Holds Field19-Field23 -- Field11 Holds Flag152-Flag183 -- Field12 Holds Flag97-Flag128 -- In the fifth component, the extension format as described -- above is used to hold additional general fields and flags -- as follows: -- Field6-11 Holds Field24-Field29 -- Field12 Holds Flag184-Flag215 -- In the sixth component, the extension format as described -- above is used to hold additional general fields and flags -- as follows: -- Field6-11 Holds Field30-Field35 -- Field12 Holds Flag255-Flag286 -- In the seventh component, the extension format as described -- above is used to hold additional general fields as follows. -- Flags are also available potentially, but not used now, as -- we are not short of entity flags. -- Field6-11 Holds Field36-Field41 end case; end record; pragma Pack (Node_Record); for Node_Record'Size use 8 * 32; for Node_Record'Alignment use 4; function E_To_N is new Unchecked_Conversion (Entity_Kind, Node_Kind); function N_To_E is new Unchecked_Conversion (Node_Kind, Entity_Kind); -- Default value used to initialize default nodes. Note that some of the -- fields get overwritten, and in particular, Nkind always gets reset. Default_Node : Node_Record := ( Is_Extension => False, Pflag1 => False, Pflag2 => False, In_List => False, Has_Aspects => False, Rewrite_Ins => False, Analyzed => False, Comes_From_Source => False, -- modified by Set_Comes_From_Source_Default Error_Posted => False, Flag4 => False, Flag5 => False, Flag6 => False, Flag7 => False, Flag8 => False, Flag9 => False, Flag10 => False, Flag11 => False, Flag12 => False, Flag13 => False, Flag14 => False, Flag15 => False, Flag16 => False, Flag17 => False, Flag18 => False, Nkind => N_Unused_At_Start, Sloc => No_Location, Link => Empty_List_Or_Node, Field1 => Empty_List_Or_Node, Field2 => Empty_List_Or_Node, Field3 => Empty_List_Or_Node, Field4 => Empty_List_Or_Node, Field5 => Empty_List_Or_Node); -- Default value used to initialize node extensions (i.e. the second -- through seventh components of an extended node). Note we are cheating -- a bit here when it comes to Node12, which often holds flags and (for -- the third component), the convention. But it works because Empty, -- False, Convention_Ada, all happen to be all zero bits. Default_Node_Extension : constant Node_Record := ( Is_Extension => True, Pflag1 => False, Pflag2 => False, In_List => False, Has_Aspects => False, Rewrite_Ins => False, Analyzed => False, Comes_From_Source => False, Error_Posted => False, Flag4 => False, Flag5 => False, Flag6 => False, Flag7 => False, Flag8 => False, Flag9 => False, Flag10 => False, Flag11 => False, Flag12 => False, Flag13 => False, Flag14 => False, Flag15 => False, Flag16 => False, Flag17 => False, Flag18 => False, Nkind => E_To_N (E_Void), Field6 => Empty_List_Or_Node, Field7 => Empty_List_Or_Node, Field8 => Empty_List_Or_Node, Field9 => Empty_List_Or_Node, Field10 => Empty_List_Or_Node, Field11 => Empty_List_Or_Node, Field12 => Empty_List_Or_Node); -- The following defines the extendable array used for the nodes table -- Nodes with extensions use six consecutive entries in the array package Nodes is new Table.Table ( Table_Component_Type => Node_Record, Table_Index_Type => Node_Id'Base, Table_Low_Bound => First_Node_Id, Table_Initial => Alloc.Nodes_Initial, Table_Increment => Alloc.Nodes_Increment, Table_Name => "Nodes"); -- The following is a parallel table to Nodes, which provides 8 more -- bits of space that logically belong to the corresponding node. This -- is currently used to implement Flags 0,1,2,3 for normal nodes, or -- the first component of an extended node (four bits unused). Entries -- for extending components are completely unused. type Flags_Byte is record Flag0 : Boolean; Flag1 : Boolean; Flag2 : Boolean; Flag3 : Boolean; Is_Ignored_Ghost_Node : Boolean; -- Flag denothing whether the node is subject to pragma Ghost with -- policy Ignore. The name of the flag should be Flag4, however this -- requires changing the names of all remaining 300+ flags. Spare1 : Boolean; Spare2 : Boolean; Spare3 : Boolean; end record; for Flags_Byte'Size use 8; pragma Pack (Flags_Byte); Default_Flags : constant Flags_Byte := (others => False); -- Default value used to initialize new entries package Flags is new Table.Table ( Table_Component_Type => Flags_Byte, Table_Index_Type => Node_Id'Base, Table_Low_Bound => First_Node_Id, Table_Initial => Alloc.Nodes_Initial, Table_Increment => Alloc.Nodes_Increment, Table_Name => "Flags"); end Atree_Private_Part; end Atree;
tests/src/test_placeholders.adb
TNO/Rejuvenation-Ada
1
18320
<reponame>TNO/Rejuvenation-Ada with Ada.Containers; use Ada.Containers; with AUnit.Assertions; use AUnit.Assertions; with Libadalang.Analysis; use Libadalang.Analysis; with Libadalang.Common; use Libadalang.Common; with Missing.AUnit.Assertions; use Missing.AUnit.Assertions; with Rejuvenation; use Rejuvenation; with Rejuvenation.Node_Locations; use Rejuvenation.Node_Locations; with Rejuvenation.Placeholders; use Rejuvenation.Placeholders; with Rejuvenation.Simple_Factory; use Rejuvenation.Simple_Factory; with String_Vectors; use String_Vectors; with String_Sets; use String_Sets; with String_Sets_Utils; use String_Sets_Utils; with Make_Ada; use Make_Ada; package body Test_Placeholders is procedure Assert is new Generic_Assert (Natural); procedure Assert is new Generic_Assert (Count_Type); procedure Assert is new Generic_Assert (Ada_Node_Kind_Type); -- Test Functions procedure Test_Defining_Name_Placeholder (T : in out Test_Case'Class); procedure Test_Defining_Name_Placeholder (T : in out Test_Case'Class) is pragma Unreferenced (T); Placeholder_Name : constant String := "$M____MyName12"; -- TODO make a separate test case to document that -- two consecutive underlines not permitted -- in normal Ada variables, -- but allowed in placeholder names! Fragment : constant String := Make_Object_Declaration_Subtype_Indication (Defining_Identifier_List => To_Vector (Placeholder_Name, 1)); Unit : constant Analysis_Unit := Analyze_Fragment (Fragment, Object_Decl_Rule); begin Assert (Condition => Is_Placeholder_Name (Placeholder_Name), Message => "Precondition violated: " & "Name is unexpectedly not a placeholder name"); Assert (Actual => Unit.Root.Kind, Expected => Ada_Object_Decl, Message => "Unexpected kind of 'Unit.Root'"); declare O_D : constant Object_Decl := Unit.Root.As_Object_Decl; Ids : constant Defining_Name_List := O_D.F_Ids; begin Assert (Actual => Ids.Children_Count, Expected => 1, Message => "Unexpected count of children of 'Ids'"); Assert (Condition => not Is_Placeholder (Ids), Message => "Unexpected 'Ids' is placeholder"); Assert (Condition => Is_Placeholder (Ids.First_Child), Message => "Unexpected not a placeholder"); end; end Test_Defining_Name_Placeholder; procedure Test_Stmt_Placeholder (T : in out Test_Case'Class); procedure Test_Stmt_Placeholder (T : in out Test_Case'Class) is pragma Unreferenced (T); Placeholder_Name : constant String := "$M_Aap_Noot_Mies"; Fragment : constant String := Make_Procedure_Call_Statement (Procedure_Name => Placeholder_Name); Unit : constant Analysis_Unit := Analyze_Fragment (Fragment, Call_Stmt_Rule); begin Assert (Condition => Is_Placeholder_Name (Placeholder_Name), Message => "Precondition violated: " & "Name is unexpectedly not a placeholder name"); Assert (Actual => Unit.Root.Kind, Expected => Ada_Call_Stmt, Message => "Unexpected kind of 'Unit.Root'"); Assert (Condition => Is_Placeholder (Unit.Root), Message => "Unexpected not a placeholder"); end Test_Stmt_Placeholder; procedure Test_Subprogram_Identifier_Placeholder (T : in out Test_Case'Class); procedure Test_Subprogram_Identifier_Placeholder (T : in out Test_Case'Class) is pragma Unreferenced (T); Placeholder_Name : constant String := "$M_379"; Fragment : constant String := Make_Procedure_Call_Statement (Procedure_Name => Placeholder_Name, Actual_Parameter_Part => To_Vector ("3", 1) & "True" & "max"); Unit : constant Analysis_Unit := Analyze_Fragment (Fragment, Call_Stmt_Rule); begin Assert (Condition => Is_Placeholder_Name (Placeholder_Name), Message => "Precondition violated: " & "Name is unexpectedly not a placeholder name"); Assert (Actual => Unit.Root.Kind, Expected => Ada_Call_Stmt, Message => "Unexpected kind of 'Unit.Root'"); declare C_S : constant Call_Stmt := Unit.Root.As_Call_Stmt; Call : constant Libadalang.Analysis.Name := C_S.F_Call; begin Assert (Actual => Call.Kind, Expected => Ada_Call_Expr, Message => "Unexpected kind of Call"); Assert (Condition => not Is_Placeholder (Call), Message => "Unexpected 'Call' is placeholder"); declare N : constant Libadalang.Analysis.Name := Call.As_Call_Expr.F_Name; begin Assert (Condition => Is_Placeholder (N), Message => "Unexpected not a placeholder"); end; end; end Test_Subprogram_Identifier_Placeholder; procedure Test_Enum_Literal_Decl_Placeholder (T : in out Test_Case'Class); procedure Test_Enum_Literal_Decl_Placeholder (T : in out Test_Case'Class) is pragma Unreferenced (T); Placeholder_Name : constant String := "$S__"; Fragment : constant String := Make_Enumeration_Type_Definition (To_Vector (Placeholder_Name, 1)); Unit : constant Analysis_Unit := Analyze_Fragment (Fragment, Enum_Type_Def_Rule); begin Assert (Condition => Is_Placeholder_Name (Placeholder_Name), Message => "Precondition violated: " & "Name is unexpectedly not a placeholder name"); Assert (Actual => Unit.Root.Kind, Expected => Ada_Enum_Type_Def, Message => "Unexpected kind of 'Unit.Root'"); declare E_T_D : constant Enum_Type_Def := Unit.Root.As_Enum_Type_Def; E_L_D_L : constant Enum_Literal_Decl_List := E_T_D.F_Enum_Literals; begin Assert (Condition => not Is_Placeholder (E_T_D), Message => "Unexpected 'E_T_D' is placeholder"); Assert (Condition => not Is_Placeholder (E_L_D_L), Message => "Unexpected 'E_L_D_L' is placeholder"); Assert (Actual => E_L_D_L.Children_Count, Expected => 1, Message => "Unexpected count of children of 'E_L_D_L'"); Assert (Condition => Is_Placeholder (E_L_D_L.First_Child), Message => "Unexpected not a placeholder"); end; end Test_Enum_Literal_Decl_Placeholder; procedure Test_Param_Assoc_Placeholder (T : in out Test_Case'Class); procedure Test_Param_Assoc_Placeholder (T : in out Test_Case'Class) is pragma Unreferenced (T); Placeholder_Name : constant String := "$M_S"; Fragment : constant String := Make_Function_Call (Actual_Parameter_Part => To_Vector (Placeholder_Name, 1)); Unit : constant Analysis_Unit := Analyze_Fragment (Fragment, Expr_Rule); begin Assert (Condition => Is_Placeholder_Name (Placeholder_Name), Message => "Precondition violated: " & "Name is unexpectedly not a placeholder name"); Assert (Actual => Unit.Root.Kind, Expected => Ada_Call_Expr, Message => "Unexpected kind of 'Unit.Root'"); declare C_E : constant Call_Expr := Unit.Root.As_Call_Expr; S : constant Ada_Node := C_E.F_Suffix; begin Assert (Condition => not Is_Placeholder (S), Message => "Unexpected 'S' is placeholder"); Assert (Actual => S.Kind, Expected => Ada_Assoc_List, Message => "Unexpected kind of 'S'"); declare A_L : constant Assoc_List := S.As_Assoc_List; begin Assert (Actual => A_L.Children_Count, Expected => 1, Message => "Unexpected count of children of 'A_L'"); Assert (Condition => Is_Placeholder (A_L.First_Child), Message => "Unexpected not a placeholder"); end; end; end Test_Param_Assoc_Placeholder; procedure Assert_Nodes_In_Order (Nodes : Node_List.Vector; Message : String); procedure Assert_Nodes_In_Order (Nodes : Node_List.Vector; Message : String) is Last_Position : Natural := 0; begin for Node of Nodes loop declare Start_Position : constant Positive := Start_Offset (Node); begin Assert (Condition => Last_Position < Start_Position, Message => Message & ASCII.LF & "Nodes not in order" & ASCII.LF & "Last_Position = " & Last_Position'Image & ASCII.LF & "Start_Position = " & Start_Position'Image); Last_Position := End_Offset (Node); end; end loop; end Assert_Nodes_In_Order; procedure Test_Placeholder_Nodes (T : in out Test_Case'Class); procedure Test_Placeholder_Nodes (T : in out Test_Case'Class) is pragma Unreferenced (T); procedure Test_Placeholder_Nodes (Fragment : String; Rule : Grammar_Rule; NrOf_Placeholders : Count_Type); procedure Test_Placeholder_Nodes (Fragment : String; Rule : Grammar_Rule; NrOf_Placeholders : Count_Type) is Unit : constant Analysis_Unit := Analyze_Fragment (Fragment, Rule); Placeholders : constant Node_List.Vector := Get_Placeholders (Unit.Root); begin Assert (Actual => Placeholders.Length, Expected => NrOf_Placeholders, Message => "Number of placeholder nodes differ"); Assert_Nodes_In_Order (Placeholders, "Check placeholders in order failed."); end Test_Placeholder_Nodes; begin Test_Placeholder_Nodes ("$S_Bla", Name_Rule, 1); Test_Placeholder_Nodes ("if $S_Cond then $M_True_Stmts; else $M_False_Stmts; end if;", If_Stmt_Rule, 3); Test_Placeholder_Nodes ("if $S_Cond then $M_Stmts; else $M_Stmts; end if;", If_Stmt_Rule, 3); Test_Placeholder_Nodes ("my_Str : constant String := ""$S_Cond"";", Object_Decl_Rule, 0); end Test_Placeholder_Nodes; procedure Test_Placeholder_Names (T : in out Test_Case'Class); procedure Test_Placeholder_Names (T : in out Test_Case'Class) is pragma Unreferenced (T); procedure Test_Placeholder_Names (Fragment : String; Rule : Grammar_Rule; Expected : Set); procedure Test_Placeholder_Names (Fragment : String; Rule : Grammar_Rule; Expected : Set) is Pattern : constant Analysis_Unit := Analyze_Fragment (Fragment, Rule); Actual : constant String_Sets.Set := Get_Placeholder_Names (Pattern.Root); begin Assert (Condition => Actual = Expected, Message => "Placeholder names differ" & ASCII.LF & "Actual = " & To_String (Actual) & ASCII.LF & "Expected = " & To_String (Expected)); end Test_Placeholder_Names; Placeholder_A : constant String := "$S_Bla"; Placeholder_C : constant String := "$S_Cond"; Placeholder_T : constant String := "$M_True_Stmts"; Placeholder_F : constant String := "$M_False_Stmts"; Placeholder_S : constant String := "$M_Stmts"; begin Test_Placeholder_Names ("$S_Bla", Name_Rule, String_Sets.To_Set (Placeholder_A)); Test_Placeholder_Names ("if " & Placeholder_C & " then " & Placeholder_T & "; else " & Placeholder_F & "; end if;", If_Stmt_Rule, From_Vector (String_Vectors.To_Vector (Placeholder_C, 1) & Placeholder_T & Placeholder_F)); Test_Placeholder_Names ("if " & Placeholder_C & " then " & Placeholder_S & "; else " & Placeholder_S & "; end if;", If_Stmt_Rule, From_Vector (Placeholder_C & Placeholder_S)); Test_Placeholder_Names ("my_Str : constant String := ""$S_Cond"";", Object_Decl_Rule, String_Sets.Empty_Set); end Test_Placeholder_Names; -- Test plumbing overriding function Name (T : Placeholders_Test_Case) return AUnit.Message_String is pragma Unreferenced (T); begin return AUnit.Format ("Patterns Placeholders"); end Name; overriding procedure Register_Tests (T : in out Placeholders_Test_Case) is begin Registration.Register_Routine (T, Test_Defining_Name_Placeholder'Access, "Defining Name Placeholder"); Registration.Register_Routine (T, Test_Stmt_Placeholder'Access, "Stmt Placeholder"); Registration.Register_Routine (T, Test_Subprogram_Identifier_Placeholder'Access, "Subprogram Identifier Placeholder"); Registration.Register_Routine (T, Test_Enum_Literal_Decl_Placeholder'Access, "Enum Literal Declaration Placeholder"); Registration.Register_Routine (T, Test_Param_Assoc_Placeholder'Access, "Param Assoc Placeholder"); -- TODO Designator Identifier (e.g. $S_X => 12) and -- Value Identifier (e.g. param_name => $S_Value) are not Param Assocs Registration.Register_Routine (T, Test_Placeholder_Nodes'Access, "Placeholder nodes"); Registration.Register_Routine (T, Test_Placeholder_Names'Access, "Placeholder names"); end Register_Tests; end Test_Placeholders;
programs/oeis/156/A156637.asm
neoneye/loda
22
242591
; A156637: Pell numbers A000129 mod 9. Period 24: repeat 0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1. ; 0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1,0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1,0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1,0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1 seq $0,163271 ; Numerators of fractions in a 'zero-transform' approximation of sqrt(2) by means of a(n) = (a(n-1) + c)/(a(n-1) + 1) with c=2 and a(1)=0. mod $0,18 div $0,2
windows/x86-64/MessageBox/MessageBox.asm
a-rey/0xDEADBEEF
0
177685
<reponame>a-rey/0xDEADBEEF ; position independent non-NULL shellcode BITS 64 section .text global _start _start: jmp start ; jump to program start (keeps PIC offsets from having NULLs) ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; get_address(1, 2, 3) ; rcx = (1) DLL base address ; rdx = (2) pointer to function string to look for ; r8 = (3) strlen(function string) ; - returns in rax the virtual address of the function from the DLL provided ; - clobbers rax, rcx, rdx, rsi, rdi, r8, r9, r10, r11 ; - does not modify the stack ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ get_address: xor r9, r9 ; zero register mov r9d, [rcx + 0x3C] ; get RVA of PE header (4 byte value) add r9, rcx ; get virtual address of PE header xor r11, r11 ; zero register add r9, 0x78 ; trickery to keep shellcode non-NULL mov r11d, [r9 + 0x10] ; get RVA of export table in PE header (0x88) add r11, rcx ; get virtual address of export table xor r9, r9 ; zero register mov r9d, [r11 + 0x20] ; get RVA of name pointer table in export table add r9, rcx ; get virtual address of name pointer table xor rax, rax ; zero register mov eax, [r11 + 0x18] ; get number of exported *named* functions from export table xchg rcx, r10 ; save dll base in r10 .loop: ; loop through name pointer table backwards dec eax ; go to the next name pointer mov rcx, r8 ; get length of target string mov rdi, rdx ; get pointer to target string xor rsi, rsi ; zero register mov esi, [r9 + (rax * 0x4)] ; get RVA of next pointer from name table (entries are 4 bytes long) add rsi, r10 ; get virtual address of next pointer from name table repe cmpsb ; compare till rcx = 0 or hit a NULL byte jnz get_address.loop ; if rcx != 0, then keep looping xor rsi, rsi ; zero register mov esi, [r11 + 0x24] ; get the RVA of the ordinal table in export table add rsi, r10 ; get the virtual address of the ordinal table xor rdx, rdx ; zero register mov dx, [rsi + (rax * 0x2)] ; get the ordinal number of the target function from the ordinal table (entries are 2 bytes long) xor rsi, rsi ; zero register mov esi, [r11 + 0x1C] ; get RVA of address table in export table add rsi, r10 ; get the virtual address of the address table mov edx, [rsi + (rdx * 0x4)] ; get the RVA of the target function add rdx, r10 ; get the virtual address of the target function xchg rdx, rax ; set return value ret ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; main routine: ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ start: and rsp, 0xFFFFFFFFFFFFFFF0 ; align stack to 16 bytes xor r12, r12 ; keep r12 as constant NULL for program mov rbx, [gs:r12 + 0x60] ; get address of PEB from TEB mov rbx, [rbx + 0x18] ; get pointer to PEB_LDR_DATA in PEB mov rbx, [rbx + 0x20] ; get pointer to LDR_MODULE[0] from Flink of InMemoryOrderModuleList in PEB_LDR_DATA mov rbx, [rbx] ; get pointer to ntdll.dll mov rbx, [rbx] ; get pointer to kernel32.dll mov rbx, [rbx + 0x20] ; get pointer to BaseAddress of kernel32.dll xor r8, r8 mov r8b, LoadLibraryA.len jmp LoadLibraryA _LoadLibraryA: pop rdx mov rcx, rbx call get_address ; get_address(kernel32.dll, 'LoadLibraryA', strlen('LoadLibraryA')) jmp User32 _User32: pop rcx mov [rcx + User32.len], r12b ; get dll pointer and add NULL termination to string call rax ; LoadLibraryA('user32') mov r8b, MessageBoxA.len jmp MessageBoxA _MessageBoxA: pop rdx mov rcx, rax call get_address ; get_address(user32.dll, 'MessageBoxA', strlen('MessageBoxA')) push r12 xor r8, r8 jmp msg _msg: pop rdx xor rcx, rcx mov [rdx + msg.len], r12b ; get message pointer and add NULL termination to string call rax ; MessageBox(NULL, message, NULL, NULL) mov r8b, ExitProcess.len jmp ExitProcess _ExitProcess: pop rdx mov rcx, rbx call get_address ; get_address(kernel32.dll, "ExitProcess", strlen("ExitProcess")) xor rcx, rcx call rax ; ExitProcess(0) ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; position independent code (PIC) data: ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LoadLibraryA: call _LoadLibraryA .string: db "LoadLibraryA" .len: equ $ - LoadLibraryA.string User32: call _User32 .string: db "user32", 0x30 ; NULL byte set at runtime .len: equ $ - User32.string - 0x1 ; 1 byte offset to point to temp 0x30 byte MessageBoxA: call _MessageBoxA .string: db "MessageBoxA" .len: equ $ - MessageBoxA.string msg: call _msg .string: db "Hello World!", 0x30 ; NULL byte set at runtime .len: equ $ - msg.string - 0x1 ; 1 byte offset to point to temp 0x30 byte ExitProcess: call _ExitProcess .string: db "ExitProcess" .len: equ $ - ExitProcess.string
includes/library.asm
matthewtillett/z80-boilerplate
1
164702
; Clear entire screen ; Version : v1.0 ; Created : 01/01/1971 ; Author : Unknown ; Usage : fn_ClearScreen: push hl push bc push de xor a ld (SCREEN_RAM), a ld hl, SCREEN_RAM ld de, SCREEN_RAM+1 ld bc, 6143 ldir pop de pop bc pop hl ret ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Prints a string at a specified screen location ; Version : v1.0 ; Created : 04/08/2017 ; Author : <NAME> ; ; Data Structure: ix+0 : Length of string ; : ix+1 : AT line (Y-position) ; : ix+2 : AY column (X-position) ; : ix+3 : String ; ; Example ; ; ld hl, _strUpper ; Message address ; call fn_PrintUpper ; Call subroutine to print to upper screen (lines 0 - 21) ; ld hl, _strLower ; Message address ; call fn_PrintLower ; Call subroutine to print to lower screen (lines 0 & 1) ; _strUpper: db 5,21,3,"Upper" ; Message structure ; _strLower: db 5,1,3,"Lower" ; Message structure fn_PrintUpper: push hl ; Push onto stack message address ; Calls to $1601 modifies hl ld a, 2 ; Output to upper screen (0-21) jp _printAt fn_PrintLower: push hl ; Push onto stack message address ; Calls to $1601 modifies hl ld a, 1 ; Output to lower screen (0-1) _printAt: call $1601 ; Open channel to upper or lower section of screen ld a, 22 ; Print at rst 16 ; pop hl ; Restore message address ld b, (hl) ; Length of string to output inc hl ; Grab line number to print at (y-pos) ld a, (hl) rst 16 inc hl ; Grab column number to print at (x-pos) ld a, (hl) rst 16 _printLoop: inc hl ; Loop through characters ld a, (hl) ; rst 16 ; ..and display djnz _printLoop ; Decrease 'b'. If b != 0, do jump to label ret ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Waits for the spacebar to become pressed ; Version : v1.0 ; Created : 04/08/2017 ; Author : <NAME> ; ; Example ; ; LAST_KEY_PRESS equ $5C08 ; Address where last keypress stored ; call fn_WaitForSpace ; Wait for spacebar to become pressed fn_WaitForSpace: ld a, (LAST_KEY_PRESS) ; Address where last keypress stored cp 32 ; Was it the spacebar? jr nz, fn_WaitForSpace ; Repeate loop if not ret ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Waits for any key to become pressed ; Version : v1.0 ; Created : 06/08/2017 ; Author : <NAME> ; ; Example ; ; LAST_KEY_PRESS equ $5C08 ; Address where last keypress stored ; call fn_WaitForKeyPress ; Wait for spacebar to become pressed fn_WaitForKeyPress: ld hl, LAST_KEY_PRESS ; Address where last keypress stored ld (hl), 0 ; Set it to null _keyPressLoop: ld a, (hl) ; Get new value of LAST_KEY_PRESS cp 0 ; Something other than null? jr z, _keyPressLoop ; Repeate loop if null ret ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Generates a pseudo random number (from first 8k of ROM) ; Version : v1.0 ; Created : Unknown ; Original Auth : <NAME> ; Modified : <NAME> | 06/08/2017 ; ; Affected Registers: ; - A : Random number value ; ; Example ; _rand: call fn_RndNum ; Grab pseudo random number ; and 15 ; Random number must be between 1 and 15 ; cp 0 ; Is it 0 ; jp z, _rand ; ..request next random number if it is fn_RndNum: ld hl, (_rndSeed) ; Grab seed ld a, h ; Grab high byte and 31 ; Limit to first 8k or ROM (0x1fff / 8191) ld h, a ; Store in high byte ld a, (hl) ; Grab byte stored at address pointed to in HL inc hl ; Increase seed ld (_rndSeed), hl ; and store back to seed ret ; Random number returned in 'A' _rndSeed: dw 0 ; 0 to 65535 ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Test function ; Version : v1.0 ; Created : 29/07/2014 ; Author : <NAME> ; Usage : call fn_Test fn_Test: ld a, #1 ld a, #1 ld a, #1 ld a, #1 ld a, #1 ret ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cubical/HITs/PropositionalTruncation/MagicTrick.agda
oisdk/cubical
0
6215
{- Based on <NAME>' blog post: The Truncation Map |_| : ℕ -> ‖ℕ‖ is nearly Invertible https://homotopytypetheory.org/2013/10/28/the-truncation-map-_-ℕ-‖ℕ‖-is-nearly-invertible/ Defines [recover], which definitionally satisfies `recover ∣ x ∣ ≡ x` ([recover∣∣]) for homogeneous types Also see the follow-up post by <NAME>: Composition is not what you think it is! Why “nearly invertible” isn’t. https://homotopytypetheory.org/2014/02/24/composition-is-not-what-you-think-it-is-why-nearly-invertible-isnt/ -} {-# OPTIONS --cubical --safe #-} module Cubical.HITs.PropositionalTruncation.MagicTrick where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Path open import Cubical.Foundations.Pointed open import Cubical.Foundations.Pointed.Homogeneous open import Cubical.HITs.PropositionalTruncation.Base open import Cubical.HITs.PropositionalTruncation.Properties module Recover {ℓ} (A∙ : Pointed ℓ) (h : isHomogeneous A∙) where private A = typ A∙ a = pt A∙ toEquivPtd : ∥ A ∥ → Σ[ B∙ ∈ Pointed ℓ ] (A , a) ≡ B∙ toEquivPtd = recPropTrunc (isContr→isProp (_ , λ p → contrSingl (snd p))) (λ x → (A , x) , h x) private B∙ : ∥ A ∥ → Pointed ℓ B∙ tx = fst (toEquivPtd tx) -- the key observation is that B∙ ∣ x ∣ is definitionally equal to (A , x) private obvs : ∀ x → B∙ ∣ x ∣ ≡ (A , x) obvs x = refl -- try it: `C-c C-n B∙ ∣ x ∣` gives `(A , x)` -- thus any truncated element (of a homogeneous type) can be recovered by agda's normalizer! recover : ∀ (tx : ∥ A ∥) → typ (B∙ tx) recover tx = pt (B∙ tx) recover∣∣ : ∀ (x : A) → recover ∣ x ∣ ≡ x recover∣∣ x = refl -- try it: `C-c C-n recover ∣ x ∣` gives `x` private -- notice that the following typechecks because typ (B∙ ∣ x ∣) is definitionally equal to to A, but -- `recover : ∥ A ∥ → A` does not because typ (B∙ tx) is not definitionally equal to A (though it is -- judegmentally equal to A by cong typ (snd (toEquivPtd tx)) : A ≡ typ (B∙ tx)) obvs2 : A → A obvs2 = recover ∘ ∣_∣ -- one might wonder if (cong recover (squash ∣ x ∣ ∣ y ∣)) therefore has type x ≡ y, but thankfully -- typ (B∙ (squash ∣ x ∣ ∣ y ∣ i)) is *not* A (it's a messy hcomp involving h x and h y) recover-squash : ∀ x y → -- x ≡ y -- this raises an error PathP (λ i → typ (B∙ (squash ∣ x ∣ ∣ y ∣ i))) x y recover-squash x y = cong recover (squash ∣ x ∣ ∣ y ∣) -- Demo, adapted from: -- https://bitbucket.org/nicolaikraus/agda/src/e30d70c72c6af8e62b72eefabcc57623dd921f04/trunc-inverse.lagda private open import Cubical.Data.Nat open Recover (ℕ , zero) (isHomogeneousDiscrete discreteℕ) -- only `∣hidden∣` is exported, `hidden` is no longer in scope module _ where private hidden : ℕ hidden = 17 ∣hidden∣ : ∥ ℕ ∥ ∣hidden∣ = ∣ hidden ∣ -- we can still recover the value, even though agda can no longer see `hidden`! test : recover ∣hidden∣ ≡ 17 test = refl -- try it: `C-c C-n recover ∣hidden∣` gives `17` -- `C-c C-n hidden` gives an error -- Finally, note that the definition of recover is independent of the proof that A is homogeneous. Thus we -- still can definitionally recover information hidden by ∣_∣ as long as we permit holes. Try replacing -- `isHomogeneousDiscrete discreteℕ` above with a hole (`?`) and notice that everything still works
unit_names.ads
annexi-strayline/AURA
13
30437
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- Command Line Interface -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019-2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * <NAME> (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package provides a standardized Unit/Subsystem name facility -- All names going into a Unit_Name will be come from the Ada Lexical Parser, -- and so will always have Unicode Simple Case Folding applied with Ada.Strings.Wide_Wide_Unbounded; package Unit_Names is type Unit_Name is tagged private; function "<" (Left, Right: Unit_Name) return Boolean; -- Lexicographical function Match_Initial (Name: Unit_Name; Initial: Wide_Wide_String) return Boolean; -- Returns True if Initial matches the head portion of the name. -- -- eg: Name => abcde, Initial => abcd returns True -- Initial => abcdef returns False function Valid_Unit_Name (Candidate: in Wide_Wide_String) return Boolean; -- Returns True iff Candidate is a valid unit name, according to the RM, -- which means an expanded name, or if the name is a properly formatted -- AURA "external unit" name. -- -- Valid_Unit_Name is not a precondition to Set_Name because AURA constructs -- names while parsing, and often times they transition through invalid -- states. -- -- Unit names sources externaly should be checked via this function whenever -- it is possible that the user could provide an invalid unit name function Is_External_Unit (Name: Unit_Name) return Boolean with Pre => Valid_Unit_Name (Name.To_String); -- Returns True if Name is for an "external unit" function To_String (Name: Unit_Name) return Wide_Wide_String; function To_UTF8_String (Name: Unit_Name) return String; function Set_Name (S: Wide_Wide_String) return Unit_Name; procedure Set_Name (Name: out Unit_Name; S : in Wide_Wide_String); -- Returns or Sets Name after applying Simple Case Folding to -- S. procedure Prepend (Name: in out Unit_Name; S: in Wide_Wide_String); procedure Append (Name: in out Unit_Name; S: in Wide_Wide_String); -- Prepends/Appends S to the end of Unit_Name -- Mainly used when building a name during parsing. function "&" (Left: Unit_Name; Right: Wide_Wide_String) return Unit_Name; function "&" (Left: Wide_Wide_String; Right: Unit_Name) return Unit_Name; function "&" (Left, Right: Unit_Name) return Unit_Name; function Empty (Name: Unit_Name) return Boolean; function Parent_Name (Name: Unit_Name) return Unit_Name; -- Returns the unit name for the parent of an Ada unit. If -- Name is already a top-level name (a subsystem), the returned -- Unit_Name is empty. -- -- This subprogram should not be invoked on non-Ada unit names -- -- E.g. for N: Name = "a.b.c.d": -- N.Parent_Unit = "a.b.c" -- -- For N: Name = "p": -- N.Parent_Unit = "" function Subsystem_Name (Name: Unit_Name) return Unit_Name; -- Extracts the Subsystem name from a full name. This simply means -- it extracts the identifier that consists of the first prefixed portion. -- -- E.g. For N: Name := "a.b.c.d": -- N.Subsystem_Name = "a" -- -- For N: Name := "p": -- N.Subsystem_Name = "p" -- -- For the external dependency where N: Name := "p%binding.c" -- N.Subsystem_Name = "p" function Self_Direct_Name (Name: Unit_Name) return Unit_Name; -- Returns the direct name of Name from the perspective of that unit. I.e: -- -- For N: Name := "a.b.c.d": -- N.Self_Direct_Name = "d" -- -- For N: Name := "p": -- N.Self_Direct_Name = "p" -- -- For N: Name := "p%binding.c" -- N.Self_Direct_Name = "binding.c" private package WWU renames Ada.Strings.Wide_Wide_Unbounded; type Unit_Name is tagged record Name_String: WWU.Unbounded_Wide_Wide_String; end record; end Unit_Names;
scripts/checkmate/spectre.als
eskang/alloy-maxsat-benchmark
0
1505
<reponame>eskang/alloy-maxsat-benchmark module SpectreMeltdown open checkmate fact { no coh } fact { no ucoh_inter } fact { no ucoh_intra } //////////////////////////////////////////////////////////////////////////////////// // Pipeline module ///////////////////////////////////////////////////////////////////////////////////// // define pipeline locations one sig Fetch extends Location { } one sig Execute extends Location { } one sig ReorderBuffer extends Location { } one sig PermissionCheck extends Location { } one sig Commit extends Location { } one sig StoreBuffer extends Location { } one sig ViCLCreate extends Location { } one sig ViCLExpire extends Location { } one sig MainMemory extends Location { } one sig Complete extends Location { } // instruction paths fun SquashedEvent : Event { Event - NodeRel.Commit } fun CommittedEvent : Event { NodeRel.Commit } fact { all b : Branch <: SquashedEvent | all disj l, l' : Location | l->l' in br_path_squash <=> EdgeExists[b, l, b, l', uhb_intra] } fact { all b : Branch <: CommittedEvent | all disj l, l' : Location | l->l' in br_path_commit <=> EdgeExists[b, l, b, l', uhb_intra] } fact { all c : CacheFlush <: SquashedEvent | all disj l, l' : Location | l->l' in cf_path_squash <=> EdgeExists[c, l, c, l', uhb_intra] } fact { all c : CacheFlush <: CommittedEvent | all disj l, l' : Location | l->l' in cf_path_commit <=> EdgeExists[c, l, c, l', uhb_intra] } fact { all r : Read <: SquashedEvent | all disj l, l' : Location | l->l' in r_path_squash <=> EdgeExists[r, l, r, l', uhb_intra] } fact { all r : Read <: CommittedEvent | all disj l, l' : Location | l->l' in r_path_commit <=> EdgeExists[r, l, r, l', uhb_intra] } fact { all w : CacheableWrite <: SquashedEvent | all disj l, l' : Location | l->l' in wc_path_squash <=> EdgeExists[w, l, w, l', uhb_intra] } fact { all w : CacheableWrite <: CommittedEvent | all disj l, l' : Location | l->l' in wc_path_commit <=> EdgeExists[w, l, w, l', uhb_intra] } fact { all w : NonCacheableWrite <: SquashedEvent | all disj l, l' : Location | l->l' in wnc_path_squash <=> EdgeExists[w, l, w, l', uhb_intra] } fact { all w : NonCacheableWrite <: CommittedEvent | all disj l, l' : Location | l->l' in wnc_path_commit <=> EdgeExists[w, l, w, l', uhb_intra] } // create minimal nodes // all nodes that *must exist* fact { Branch->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Complete } + CacheFlush->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Complete } + CacheableRead->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Complete } + NonCacheableRead->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Complete } + CacheableWrite->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Complete } + NonCacheableWrite->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Complete } in NodeRel } // bound nodes so Alloy doesn't create more // all nodes that *could exist* fact { NodeRel in Branch->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Commit + Complete } + CacheFlush->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Commit + Complete } + CacheableRead->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Commit + ViCLCreate + ViCLExpire + Complete } + NonCacheableRead->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Commit + Complete } + CacheableWrite->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Commit + StoreBuffer + ViCLCreate + ViCLExpire + MainMemory + Complete } + NonCacheableWrite->{ Fetch + Execute + ReorderBuffer + PermissionCheck + Commit + StoreBuffer + MainMemory + Complete } } // define branch squash path (no commit node) fun br_path_squash : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Complete } // define branch commit path fun br_path_commit : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Commit + Commit->Complete } // define branch squash path (no commit node) fun cf_path_squash : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Complete } // define cflush commit path fun cf_path_commit : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Commit + Commit->Complete } // define fence squash path (no commit node) fun f_path_squash : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->Complete } // define fence commit path fun f_path_commit: Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->Commit + Commit->Complete } // define read squash path (no commit node) fun r_path_squash : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Complete } // define read commit path fun r_path_commit : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Commit + Commit->Complete } // define cacheable write squash path (no commit node) fun wc_path_squash : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Complete } // define cacheable write commit path fun wc_path_commit : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Commit + Commit->StoreBuffer + StoreBuffer->ViCLCreate + ViCLCreate->ViCLExpire + ViCLCreate->MainMemory + ViCLCreate->Complete } // define non-cacheable write squash path (no commit node) fun wnc_path_squash : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Complete } // define non-cacheable write commit path fun wnc_path_commit : Location->Location { Fetch->Execute + Execute->ReorderBuffer + ReorderBuffer->PermissionCheck + PermissionCheck->Commit + Commit->StoreBuffer + StoreBuffer->MainMemory + MainMemory->Complete } // uhb_inter: inter-instruction happens-before fact Fetch_stage_is_inorder { all disj e, e' : Event | ProgramOrder[e, e'] <=> EdgeExists[e, Fetch, e', Fetch, uhb_inter] } fact Execute_state_is_ooo { all disj e, e' : Event | (EdgeExists[e, Fetch, e', Fetch, uhb_inter] and (SamePhysicalAddress[e, e'] or HasDependency[e, e'] or IsAnyFence[e] or IsAnyFence[e'])) <=> EdgeExists[e, Execute, e', Execute, uhb_inter] } fact Commit_stage_is_inorder { all disj e, e' : Event | (EdgeExists[e, Fetch, e', Fetch, uhb_inter] and NodeExists[e, Commit] and NodeExists[e', Commit]) <=> EdgeExists[e, Commit, e', Commit, uhb_inter] } fact STB_FIFO { all disj w, w' : Write | EdgeExists[w, Commit, w', Commit, uhb_inter] <=> EdgeExists[w, StoreBuffer, w', StoreBuffer, uhb_inter] } fact STB_OneAtATime { all disj w, w' : Write | EdgeExists[w, StoreBuffer, w', StoreBuffer, uhb_inter] <=> ((IsCacheable[w] and EdgeExists[w, ViCLCreate, w', StoreBuffer, uhb_inter] and not EdgeExists[w, MainMemory, w', StoreBuffer, uhb_inter]) or (not IsCacheable[w] and EdgeExists[w, MainMemory, w', StoreBuffer, uhb_inter])) } fact Complete_stage_is_inorder { all disj e, e' : Event | EdgeExists[e, Fetch, e', Fetch, uhb_inter] <=> EdgeExists[e, Complete, e', Complete, uhb_inter] } fact bound_uhb_inter { uhb_inter in Event->Fetch->Event->Fetch + Event->Execute->Event->Execute + Event->Commit->Event->Commit + Write->StoreBuffer->Write->StoreBuffer + Write->ViCLCreate->Write->StoreBuffer + Write->MainMemory->Write->StoreBuffer + Event->Complete->Event->Complete } //////////////////////////////////////////////////////////////////////////////////// // Predicates ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// // Communication predicates pred ReadViCLsExist[r: Read] { EdgeExists[r, ViCLCreate, r, Execute, uvicl] and EdgeExists[r, Execute, r, ViCLExpire, uvicl] and NodeExists[r, ViCLCreate] and NodeExists[r, ViCLExpire] } pred NoReadViCLs[r: Read] { not NodeExists[r, ViCLCreate] and not NodeExists[r, ViCLExpire] } // true if read is sourced from STB // i.e., if it executes before the write reaches the L1 Cache pred STBFwd[w: Write, r: Read] { SameThread[w, r] and ProgramOrder[w, r] and NoReadViCLs[r] and EdgeExists[w, Execute, r, Execute, urf] and ( NodeExists[w, Commit] and IsCacheable[w] and EdgeExists[r, Execute, w, ViCLCreate, ustb] or NodeExists[w, Commit] and not IsCacheable[w] and EdgeExists[r, Execute, w, MainMemory, ustb] or not NodeExists[w, Commit] and EdgeExists[r, Execute, w, PermissionCheck, ustb] ) } // true if all stores before read have been written to the L1 Cache (Cacheable) or Main Memory (NonCacheable) pred STBEmpty[r: Read] { all w : Write | SameVirtualAddress[w, r] and ProgramOrder[w, r] and NodeExists[w, Commit] <=> ( ( IsCacheable[w] and EdgeExists[w, ViCLCreate, r, Execute, ustb_flush] or not IsCacheable[w] and EdgeExists[w, MainMemory, r, Execute, ustb_flush] ) ) } // true if read is source from the L1 (i.e., from another access' ViCLs // can read from a write's ViCL or can read from a read's ViCL pred ReadSourcedFromL1[w: Write, r: Read] { SameCore[w, r] and NoReadViCLs[r] and IsCacheable[r] and SameVirtualAddress[w, r] and NodeExists[w, Commit] and ( ( IsCacheable[w] and EdgeExists[w, ViCLCreate, r, Execute, urf] and EdgeExists[r, Execute, w, ViCLExpire, uvicl] ) or ( some r': Read | SameCore[r, r'] and w->r' in rf and NodeExists[r', ViCLCreate] and EdgeExists[r', ViCLCreate, r, Execute, uvicl] and EdgeExists[r, Execute, r', ViCLExpire, uvicl] and ( IsCacheable[w] and EdgeExists[w, ViCLExpire, r', ViCLCreate, ucci] and EdgeExists[w, MainMemory, r', ViCLCreate, urf] or not IsCacheable[w] and EdgeExists[w, MainMemory, r', ViCLCreate, urf] ) ) ) } // true if read is sourced from a same-core write from Main Memory pred InternalReadSourcedFromMM[w: Write, r: Read] { SameCore[w, r] and NodeExists[w, Commit] and ( ( IsCacheable[r] and ReadViCLsExist[r] and EdgeExists[w, MainMemory, r, ViCLCreate, urf] and ( IsCacheable[w] and EdgeExists[w, ViCLExpire, r, ViCLCreate, ucci] or not IsCacheable[w] ) ) or ( not IsCacheable[r] and EdgeExists[w, MainMemory, r, Execute, urf] ) ) } // true if read is rouced from a different-core write from Main Memory pred ExternalReadSourcedFromMM[w: Write, r: Read] { not SameCore[w, r] and NodeExists[w, Commit] and ( ( IsCacheable[r] and ReadViCLsExist[r] and EdgeExists[w, MainMemory, r, ViCLCreate, urf] ) or ( not IsCacheable[r] and EdgeExists[w, MainMemory, r, Execute, urf] ) ) } pred SameCoreCoherence[w: Write, w': Write] { SameCore[w, w'] and NodeExists[w, Commit] and NodeExists[w', Commit] and ( ( (IsCacheable[w] and IsCacheable[w']) and EdgeExists[w, ViCLCreate, w', ViCLCreate, uco] and EdgeExists[w, ViCLExpire, w', ViCLCreate, uco] and EdgeExists[w, MainMemory, w', MainMemory, uco] ) or ( not (IsCacheable[w] and IsCacheable[w']) and EdgeExists[w, MainMemory, w', MainMemory, uco] ) ) } pred DifferentCoreCoherence[w: Write, w': Write] { not SameCore[w, w'] and NodeExists[w, Commit] and NodeExists[w', Commit] and EdgeExists[w, MainMemory, w', MainMemory, uco] } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // shared memory predicates pred no_shared_mem { all a : PhysicalAddress | (Attacker in a.region => (a.readers = { Attacker } and a.writers = { Attacker })) and (Victim in a.region => (a.readers = { Victim } and a.writers = { Victim })) } pred shared_ro_mem { all a : PhysicalAddress | (Victim in a.region => a.readers = { Attacker + Victim } and no a.writers) } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // speculation predicates // two instructions can execute in the window of a mispredicted branch; can be increased if desired pred SpecWindowOne[e : Event] { some b : MispredictedBranch | b->e in po } pred SpecWindowTwo[e' : Event] { some e : Event | not SameEvent[e, e'] and e->e' in po and (some b : MispredictedBranch | b->e in po) } //////////////////////////////////////////////////////////////////////////////////// // Axioms ///////////////////////////////////////////////////////////////////////////////////// fact NonCacheableReadViCLs { all r: NonCacheableRead | NoReadViCLs[r] } fact ViCLPairs { all e: Event | NodeExists[e, ViCLCreate] <=> NodeExists[e, ViCLExpire] } // disallow trailing flushes and fences fact no_trailing_flush { all c : CacheFlush | c in Event.po and c in po.Event } fact no_trailing_fence { all f : Fence | f in Event.po and f in po.Event } fact FenceSC_order { all f: Fence | all w : Write | SameCore[w, f] and (ProgramOrder[w, f] or EdgeExists[w, Complete, f, Fetch, uhb_proc]) <=> EdgeExists[w, MainMemory, f, Execute, ufence] } fact one_flush_edge { all w : Write | all r : Read | not (EdgeExists[w, ViCLCreate, r, Execute, ustb_flush] and EdgeExists[w, MainMemory, r, Execute, ustb_flush]) } fact flush_implies_squash { all w: Write | all r : Read | (EdgeExists[w, ViCLCreate, r, Execute, ustb_flush] => IsCacheable[w] and NodeExists[w, Commit]) and (EdgeExists[w, MainMemory, r, Execute, ustb_flush] => not IsCacheable[w] and NodeExists[w, Commit]) } fact ReadsFrom { all r : Read | all w : Write | w->r in rf => ( STBFwd[w, r] or STBEmpty[r] and ( ReadSourcedFromL1[w, r] or InternalReadSourcedFromMM[w, r] or ExternalReadSourcedFromMM[w, r] ) ) } fact constrain_urf { all w : Write | all r : Read | not (EdgeExists[w, MainMemory, r, ViCLCreate, urf] and EdgeExists[w, MainMemory, r, Execute, urf]) and not (EdgeExists[w, MainMemory, r, ViCLCreate, urf] and EdgeExists[w, ViCLCreate, r, Execute, urf]) and not (EdgeExists[w, MainMemory, r, ViCLCreate, urf] and EdgeExists[w, Execute, r, Execute, urf]) and not (EdgeExists[w, ViCLCreate, r, Execute, urf] and EdgeExists[w, MainMemory, r, Execute, urf]) and not (EdgeExists[w, ViCLCreate, r, Execute, urf] and EdgeExists[w, Execute, r, Execute, urf]) and not (EdgeExists[w, Execute, r, Execute, urf] and EdgeExists[w, MainMemory, r, Execute, urf]) and not (EdgeExists[w, Execute, r, Execute, urf] and EdgeExists[w, ViCLCreate, r, Execute, ustb_flush]) } fact CoherenceOrder { all w : Write | all w' : Write| w->w' in co => ( SameCoreCoherence[w, w'] or DifferentCoreCoherence[w, w'] or (not (NodeExists[w, Commit] and NodeExists[w', Commit])) ) } fact FromReads { all r : Read | all w : Write | r->w in fr => ( SameCore[r, w] and EdgeExists[r, Execute, w, Execute, ufr] ) or ( not SameCore[w, r] and not EdgeExists[r, Execute, w, Execute, ufr] and ( ( IsCacheable[r] and NodeExists[w, Commit] and EdgeExists[r, ViCLCreate, w, MainMemory, ufr] ) or ( not IsCacheable[r] and NodeExists[w, Commit] and EdgeExists[r, Execute, w, MainMemory, ufr] ) or ( not NodeExists[w, Commit] ) ) ) } fact CFLUSH_order { all c : CacheFlush | all e : CacheableEvent | ( SameVirtualAddress[e, c] and SameCore[e, c] and NodeExists[e, ViCLCreate] and ( (SameProcess[e, c] and ProgramOrder[e, c]) or (not SameProcess[e, c] and EdgeExists[e, Complete, c, Fetch, uhb_proc]) ) ) <=> EdgeExists[e, ViCLExpire, c, Execute, uflush] } fact DataFromInitialMM { all r : Read | DataFromInitialStateAtPA[r] and IsCacheable[r] => ( STBEmpty[r] and ( ReadViCLsExist[r] or ( NoReadViCLs[r] and (some r': Read | SameCore[r,r'] and SameVirtualAddress[r, r'] and DataFromInitialStateAtPA[r'] and NodeExists[r', ViCLCreate] and EdgeExists[r', ViCLCreate, r, Execute, uvicl] and EdgeExists[r, Execute, r', ViCLExpire, uvicl] ) ) ) ) } fact diff_reads_sourced_initial_l1 { all disj r, r' : Read | EdgeExists[r, ViCLCreate, r', Execute, uvicl] and EdgeExists[r', Execute, r, ViCLExpire, uvicl] => (SameVirtualAddress[r, r'] and ( (DataFromInitialStateAtPA[r] and DataFromInitialStateAtPA[r']) or ( some w : Write | w->r in rf and w->r' in rf and NodeExists[w, Commit] and NodeExists[r, ViCLCreate] and not NodeExists[r', ViCLCreate] and ReadSourcedFromL1[w, r'] ) )) } fact read_miss_vicls { all r : Read | EdgeExists[r, ViCLCreate, r, Execute, uvicl] and EdgeExists[r, Execute, r, ViCLExpire, uvicl] => ( DataFromInitialStateAtPA[r] or (some w : Write | w->r in rf and (InternalReadSourcedFromMM[w, r] or ExternalReadSourcedFromMM[w, r])) ) } fact SWMR { all w: Write | all e: MemoryEvent | (not SameEvent[w, e] and SamePhysicalAddress[w, e] and NodeExists[e, ViCLCreate] and NodeExists[w, ViCLCreate]) => (EdgeExists[e, ViCLExpire, w, ViCLCreate, ucci] or EdgeExists[w, ViCLCreate, e, ViCLCreate, ucci]) } fact SWMRidx { all e: MemoryEvent | all e' : MemoryEvent | ( not SameEvent[e, e'] and SameCore[e, e'] and SameIndexL1[e, e'] and NodeExists[e, ViCLCreate] and NodeExists[e', ViCLCreate] ) => (EdgeExists[e, ViCLCreate, e', ViCLCreate, ucci] or EdgeExists[e', ViCLCreate, e, ViCLCreate, ucci]) } fact L1ViCLNoDups { all e: MemoryEvent | all e' : MemoryEvent | ( not SameEvent[e, e'] and SameCore[e, e'] and (SameIndexL1[e, e'] or SamePhysicalAddress[e, e']) and NodeExists[e, ViCLCreate] and NodeExists[e', ViCLCreate] ) => (EdgeExists[e, ViCLExpire, e', ViCLCreate, ucci] or EdgeExists[e', ViCLExpire, e, ViCLCreate, ucci]) } fact same_core_read_vicls { all disj r, r' : Read | EdgeExists[r, ViCLExpire, r', ViCLCreate, ucci] => SameCore[r, r'] } fact swmr_or_conflict { all e, e' : MemoryEvent | ( EdgeExists[e, ViCLCreate, e', ViCLCreate, ucci] => (IsAnyWrite[e] or (SameCore[e, e'] and SameIndexL1[e, e'])) ) } fact swmr_nodups_or_conflict { all e, e' : MemoryEvent | ( EdgeExists[e, ViCLExpire, e', ViCLCreate, ucci] => SamePhysicalAddress[e, e'] or (SameCore[e, e'] and SameIndexL1[e, e']) ) } fact SingleReadSource { all r: Read | not ( some r' : Read | some w : Write | EdgeExists[r', ViCLCreate, r, Execute, uvicl] and EdgeExists[w, ViCLCreate, r, Execute, urf]) and not ( some r' : Read | some w : Write | EdgeExists[r', ViCLCreate, r, Execute, uvicl] and EdgeExists[w, MainMemory, r, Execute, urf]) } fact constrain_vicls_involving_writes { all r : Read | all w : Write | EdgeExists[r, Execute, w, ViCLExpire, uvicl] => w->r in rf and EdgeExists[w, ViCLCreate, r, Execute, urf] and ReadSourcedFromL1[w, r] } fact constrain_uvicl_source { all r: Read | all e: MemoryEvent | (EdgeExists[r, ViCLCreate, e, Execute, uvicl] => (no r': Read | not SameEvent[r, r'] and EdgeExists[r', ViCLCreate, e, Execute, uvicl])) } fact constrain_uvicl_execute { all e, e' : MemoryEvent | (EdgeExists[e', Execute, e, ViCLExpire, uvicl] => (no e'': MemoryEvent | not SameEvent[e, e''] and EdgeExists[e', Execute, e'', ViCLExpire, uvicl])) } fact map_dep_to_udep { all disj e, e': Event | HasDependency[e, e'] <=> EdgeExists[e, Execute, e', Execute, udep] } fact dep_vicl_source { all disj e, e': Event | (HasDependency[e, e'] and NodeExists[e, ViCLCreate] and NodeExists[e', ViCLCreate] ) <=> EdgeExists[e, ViCLCreate, e', ViCLCreate, udep] } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // threading and process scheduling fact assign_thds_to_procs { all disj e, e': Event | SameThread[e, e'] => SameProcess[e, e'] } fact assign_thds_to_cores { all disj e, e' : Event | SameThread[e, e'] => SameCore[e, e'] } fact same_proc_diff_thds_diff_cores { all disj e, e' : Event | SameProcess[e, e'] and not SameThread[e, e'] => not SameCore[e, e'] } fact time_mux_attacker_vicitim { all a : AttackerEvent | all v: VictimEvent | SameCore[a, v] => (EdgeExists[a, Complete, v, Fetch, uhb_proc] or EdgeExists[v, Complete, a, Fetch, uhb_proc]) } fact assign_uhb_to_procs { all e, e' : Event | all l, l' : Location | ( EdgeExists[e, l, e', l', ustb] or EdgeExists[e, l, e', l', ustb_flush] or EdgeExists[e, l, e', l', udep] or EdgeExists[e, l, e', l', uhb_spec] or EdgeExists[e, l, e', l', uhb_inter] or EdgeExists[e, l, e', l', uhb_intra] ) => SameProcess[e, e'] } // memory access permissions fact no_shared_attacker_memory { all a : PhysicalAddress | Attacker in a.region => ( a.readers = { Attacker } and a.writers = { Attacker } ) } fact no_shared_or_ro_victim_memory { all a : PhysicalAddress | Victim in a.region => ( a.readers = { Attacker + Victim } and no a.writers) or ( a.readers = { Victim } and a.writers = { Victim } ) } // no pre-fetching across process boundaries fact no_prefetch_samecore_diffproc { all e, e': Event | EdgeExists[e, Complete, e', Fetch, uhb_proc] => (NodeExists[e', ViCLCreate] => EdgeExists[e, Complete, e', ViCLCreate, uhb_proc]) and (all e'': Event | ProgramOrder[e', e''] and NodeExists[e'', ViCLCreate] => EdgeExists[e, Complete, e'', ViCLCreate, uhb_proc]) } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // branch prediction fact squash_spec_window_one { all e : Event | all b : MispredictedBranch | (b->e in po) => ( not NodeExists[e, Commit] and EdgeExists[e, ReorderBuffer, b, Execute, usquash] and (NodeExists[e, ViCLCreate] => EdgeExists[e, ViCLCreate, b, Execute, usquash]) ) } fact squash_spec_window_two { all e' : Event | all b : MispredictedBranch | (some e : Event | not SameEvent[e, e'] and e->e' in po and b->e in po) => ( not NodeExists[e', Commit] and EdgeExists[e', ReorderBuffer, b, Execute, usquash] and (NodeExists[e', ViCLCreate] => EdgeExists[e', ViCLCreate, b, Execute, usquash]) ) } fact branch_commit { all b : Branch | (not SpecWindowOne[b] and not SpecWindowTwo[b]) => NodeExists[b, Commit]} ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // committeed vs. squashed instructions fact squashed_event { all e: MemoryEvent | ( IsIllegalRead[e] or IsIllegalWrite[e] or DependsOnIllegal[e] or ReadsFromIllegal[e] or SpecWindowOne[e] or SpecWindowTwo[e] or (some e' : Event | ProgramOrder[e, e'] and (some e'': Event | ProgramOrder[e'', e] and (HasDependency[e'', e'] or e''->e' in rf) and IsIllegalRead[e''] or IsIllegalWrite[e''])) ) <=> not NodeExists[e, Commit] } fact committed_read { all r: { Read + CacheFlush } | ( not IsIllegalRead[r] and not DependsOnIllegal[r] and not ReadsFromIllegal[r] and not SpecWindowOne[r] and not SpecWindowTwo[r] and (no e' : Event | ProgramOrder[r, e'] and (some e'': Event | ProgramOrder[e'', r] and (HasDependency[e'', e'] or e''->e' in rf) and IsIllegalRead[e''] or IsIllegalWrite[e''])) ) => NodeExists[r, Commit] } fact committed_write { all w: { Write } | ( not IsIllegalWrite[w] and not DependsOnIllegal[w] and not SpecWindowOne[w] and not SpecWindowTwo[w] and (no e' : Event | ProgramOrder[w, e'] and (some e'': Event | ProgramOrder[e'', w] and (HasDependency[e'', e'] or e''->e' in rf) and IsIllegalRead[e''] or IsIllegalWrite[e''])) ) => NodeExists[w, Commit] } fact depends_on_illegal { all e: Event | all r: Read | (HasDependency[r, e] and IsIllegalRead[r] and not SpecWindowOne[e] and not SpecWindowTwo[e]) <=> EdgeExists[e, ReorderBuffer, r, PermissionCheck, usquash] } fact reads_from_illegal { all e: Event | all w : Write | (IsAnyRead[e] and w->e in rf and IsIllegalWrite[w] and not SpecWindowOne[e] and not SpecWindowTwo[e]) <=> EdgeExists[e, ReorderBuffer, w, PermissionCheck, usquash]} fact vicl_permissions_viclc_pc { all e, e': Event | (EdgeExists[e, ReorderBuffer, e', PermissionCheck, usquash]) => (NodeExists[e, ViCLCreate] => EdgeExists[e, ViCLCreate, e', PermissionCheck, usquash])} fact vicl_permissions_rob_pc { all e, e': Event | (EdgeExists[e, ViCLCreate, e', PermissionCheck, usquash]) => (EdgeExists[e, ReorderBuffer, e', PermissionCheck, usquash])} fact suqashed_write { all w : Write | not NodeExists[w, Commit]=> not NodeExists[w, StoreBuffer] and not NodeExists[w, MainMemory] and not NodeExists[w, ViCLCreate] and not NodeExists[w, ViCLExpire] } fact committed_cwrite { all w : CacheableWrite | NodeExists[w, Commit] => NodeExists[w, StoreBuffer] and NodeExists[w, MainMemory] and NodeExists[w, ViCLCreate] and NodeExists[w, ViCLExpire] } fact committed_ncwrite { all w : NonCacheableWrite | NodeExists[w, Commit] => NodeExists[w, StoreBuffer] and NodeExists[w, MainMemory] } fact fetch_after_squash { all disj e, e' : Event | (ProgramOrder[e, e'] and not NodeExists[e, Commit] and NodeExists[e', Commit]) <=> EdgeExists[e, Complete, e', Fetch, uhb_spec] } fact constrain_usquash { all e, e' : Event | all l, l' : Location | EdgeExists[e, l, e', l', usquash] => (not SameEvent[e, e'] and (l in ReorderBuffer or l in ViCLCreate) and not NodeExists[e, Commit]) and ( (e' in Branch and l' = Execute) or ((IsIllegalRead[e'] or IsIllegalWrite[e']) and l' = PermissionCheck)) } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // constrain additional uhb edges fact bound_urf { urf in Write->Execute->Read->Execute + Write->ViCLCreate->Read->Execute + Write->MainMemory->Read->Execute + Write->MainMemory->Read->ViCLCreate } fact bound_uco { uco in Write->ViCLCreate->Write->ViCLCreate + Write->ViCLExpire->Write->ViCLCreate + Write->MainMemory->Write->MainMemory } fact bound_ufr { ufr in Read->Execute->Write->Execute + Read->ViCLCreate->Write->MainMemory + Read->Execute->Write->MainMemory } fact bound_ustb_flush { ustb_flush in Write->ViCLCreate->Read->Execute + Write->MainMemory->Read->Execute } fact bound_udep { udep in Read->Execute->{MemoryEvent + CacheFlush}->Execute + Read->ViCLCreate->MemoryEvent->ViCLCreate } fact bound_uhb_spec { uhb_spec in Event->Complete->Event->Fetch } fact bound_ustb { ustb in Read->Execute->Write->ViCLCreate + Read->Execute->Write->MainMemory + Read->Execute->Write->PermissionCheck } fact bound_ufence { ufence in Write->MainMemory->Fence->Execute } fact bound_uvicl { uvicl in Read->ViCLCreate->Read->Execute + Read->Execute->Read->ViCLExpire + Read->Execute->Write->ViCLExpire } fact bound_ucci { ucci in Event->ViCLCreate->Event->ViCLCreate + Event->ViCLExpire->Event->ViCLCreate } fact bound_uflush { uflush in Event->ViCLExpire->CacheFlush->Execute } fact bound_uhb_proc { uhb_proc in AttackerEvent->Complete->VictimEvent->Fetch + VictimEvent->Complete->AttackerEvent->Fetch + AttackerEvent->Complete->VictimEvent->ViCLCreate + VictimEvent->Complete->AttackerEvent->ViCLCreate } fact urf_implies_rf { all w : Write | all r : Read | all l, l' : Location | EdgeExists[w, l, r, l', urf] => w->r in rf } fact uco_implies_co { all disj w, w' : Write | all l, l' : Location | EdgeExists[w, l, w', l', uco] => w->w' in co } fact ufr_implies_fr { all r : Read | all w : Write | all l, l' : Location | EdgeExists[r, l, w, l', ufr] => r->w in fr } fact ustb_implies_rf { all r : Read, w : Write | all l, l' : Location | EdgeExists[r, l, w, l', ustb] => w->r in rf and STBFwd[w, r] } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // =Threat Descriptions= fact explicit_evictions { all disj e, e' : CacheableEvent | IsAnyRead[e'] and (ProgramOrder[e, e'] or EdgeExists[e, Complete, e', Fetch, uhb_proc]) and (SameVirtualAddress[e, e'] or SamePhysicalAddress[e, e'] and SameIndexL1[e, e']) and NodeExists[e, ViCLCreate] and (no e'' : CacheableEvent | EdgeExists[e, ViCLExpire, e'', ViCLCreate, ucci] and not SameEvent[e'', e']) and (no e'' : CacheFlush | EdgeExists[e, ViCLExpire, e'', Execute, uflush]) => IsAnyWrite[e] and EdgeExists[e, ViCLCreate, e', Execute, urf] or IsAnyRead[e] and EdgeExists[e, ViCLCreate, e', Execute, uvicl] } pred meltdown_fix { all e: MemoryEvent | ( not (SpecWindowOne[e] or SpecWindowTwo[e]) and ( IsIllegalRead[e] or IsIllegalWrite[e] or DependsOnIllegal[e] or ReadsFromIllegal[e] or (some e' : Event | ProgramOrder[e, e'] and (some e'': Event | ProgramOrder[e'', e] and (HasDependency[e'', e'] or e''->e' in rf) and IsIllegalRead[e''] or IsIllegalWrite[e''])) ) ) => not NodeExists[e, ViCLCreate] } pred flush_reload { some disj a, a', f : AttackerEvent | IsAnyMemory[a] and IsAnyRead[a'] and NodeExists[a, Commit] and NodeExists[a', Commit] and NodeExists[f, Commit] and SameVirtualAddress[a, a'] and ProgramOrder[a, a'] and ProgramOrder[a, f] and ProgramOrder[f, a'] and (no e: Event | ProgramOrder[a, e] and ProgramOrder[e, f]) and (no e: Event | EdgeExists[a, Complete, e, Fetch, uhb_proc] and EdgeExists[e, Complete, f, Fetch, uhb_proc]) and IsCacheable[a] and NodeExists[a, ViCLCreate] and IsCacheable[a'] and not NodeExists[a', ViCLCreate] and not (EdgeExists[a, ViCLCreate, a', Execute, urf] and EdgeExists[a', Execute, a, ViCLExpire, uvicl]) and not (EdgeExists[a, ViCLCreate, a', Execute, uvicl] and EdgeExists[a', Execute, a, ViCLExpire, uvicl]) and ( IsCacheFlush[f] and SameVirtualAddress[a, f] or IsAnyRead[f] and not SamePhysicalAddress[a, f] and EdgeExists[a, ViCLExpire, f, ViCLCreate, ucci] or IsAnyWrite[f] and not SamePhysicalAddress[a, f] and EdgeExists[a, ViCLExpire, f, ViCLCreate, ucci] ) and not (some e: AttackerEvent | ProgramOrder[f, e] and ProgramOrder[e, a'] and SameVirtualAddress[e, a'] and IsCacheable[e] and IsAnyMemory[e] and NodeExists[e, Commit]) and not (some e: AttackerEvent | ProgramOrder[e, a]) and not (some e: AttackerEvent | ProgramOrder[a', e]) and not (some e: Event | EdgeExists[e, Complete, a, Fetch, uhb_proc]) and not (some e: Event | EdgeExists[a', Complete, e, Fetch, uhb_proc]) } run test_spectre { no_shared_mem and flush_reload and #dep = 1 and (all disj e, e' : Event | HasDependency[e, e'] => (Victim in PhysicalAddress[e].region and Attacker in PhysicalAddress[e'].region and NodeExists[e', ViCLCreate])) and meltdown_fix and NumProcessThreads[1, Attacker] and NumProcessThreads[0, Victim] and ucheck } for 75 but 1 Core, 2 Process, 2 CacheIndexL1, 1 Cacheability, 2 Outcome, 6 Address, 3 PhysicalAddress, 3 VirtualAddress, 10 Location, 6 Event, 44 Node
win64_examples/WindowWorkSample.asm
rgimad/fasm_programs
8
10470
<filename>win64_examples/WindowWorkSample.asm format PE64 GUI 5.0 entry start ; from chapter 5 of <NAME> book include 'win64a.inc' section '.data' data readable writeable main_hwnd dq ? msg MSG wc WNDCLASS hInst dq ? szTitleName db 'Window work sample Win64',0 szClassName db 'ASMCLASS32',0 button_class db 'BUTTON',0 AboutTitle db 'About',0 AboutText db 'First win64 window program',0; ExitTitle db 'Exit',0 AboutBtnHandle dq ? ExitBtnHandle dq ? section '.code' code executable readable start: sub rsp, 8*5 ; align stack and alloc space for 4 parameters xor rcx, rcx call [GetModuleHandle] mov [hInst], rax mov [wc.style], CS_HREDRAW + CS_VREDRAW + CS_GLOBALCLASS mov rbx, WndProc mov [wc.lpfnWndProc], rbx mov [wc.cbClsExtra], 0 mov [wc.cbWndExtra], 0 mov [wc.hInstance], rax mov rdx, IDI_APPLICATION xor rcx, rcx call [LoadIcon] mov [wc.hIcon], rax mov rdx, IDC_ARROW xor rcx, rcx call [LoadCursor] mov [wc.hCursor], rax mov [wc.hbrBackground], COLOR_BACKGROUND+1 mov qword [wc.lpszMenuName], 0 mov rbx, szClassName mov qword [wc.lpszClassName], rbx mov rcx, wc call [RegisterClass] sub rsp, 8*8 ; alloc place in stack for 8 parameters xor rcx, rcx mov rdx, szClassName mov r8, szTitleName mov r9, WS_OVERLAPPEDWINDOW mov qword [rsp+8*4], 50 mov qword [rsp+8*5], 50 mov qword [rsp+8*6], 300 mov qword [rsp+8*7], 250 mov qword [rsp+8*8], rcx mov qword [rsp+8*9], rcx mov rbx, [hInst] mov [rsp+8*10], rbx mov [rsp+8*11], rcx call [CreateWindowEx] mov [main_hwnd], rax xor rcx, rcx mov rdx, button_class mov r8, AboutTitle mov r9, WS_CHILD mov qword [rsp+8*4], 50 mov qword [rsp+8*5], 50 mov qword [rsp+8*6], 200 mov qword [rsp+8*7], 50 mov rbx, [main_hwnd] mov qword [rsp+8*8], rbx mov qword [rsp+8*9], rcx mov rbx, [hInst] mov [rsp+8*10], rbx mov [rsp+8*11], rcx call [CreateWindowEx] mov [AboutBtnHandle], rax xor rcx, rcx mov rdx, button_class mov r8, ExitTitle mov r9, WS_CHILD mov qword [rsp+8*4], 50 mov qword [rsp+8*5], 150 mov qword [rsp+8*6], 200 mov qword [rsp+8*7], 50 mov rbx, [main_hwnd] mov qword [rsp+8*8], rbx mov qword [rsp+8*9], rcx mov rbx, [hInst] mov [rsp+8*10], rbx mov [rsp+8*11], rcx call [CreateWindowEx] mov [ExitBtnHandle], rax add rsp, 8*8 ; free place in stack mov rdx, SW_SHOWNORMAL mov rcx, [main_hwnd] call [ShowWindow] mov rcx, [main_hwnd] call [UpdateWindow] mov rdx, SW_SHOWNORMAL mov rcx, [AboutBtnHandle] call [ShowWindow] mov rdx, SW_SHOWNORMAL mov rcx, [ExitBtnHandle] call [ShowWindow] msg_loop: xor r9, r9 xor r8, r8 xor rdx, rdx mov rcx, msg call [GetMessage] cmp rax,1 jb end_loop jne msg_loop mov rcx, msg call [TranslateMessage] mov rcx, msg call [DispatchMessage] jmp msg_loop end_loop: xor rcx, rcx call [ExitProcess] proc WndProc hwnd, wmsg, wparam, lparam ; proc macro contains prologue (push rbp; mov rbp, rsp) etc. ; ; rdx = wmsg ; r8 = wparam ; r9 = lparam ; stack aligned! because code that calls WndProc, uses 16-byte aligned stack ; when call return addr (8bytes) pushed, and after that prologue of WndProc pushes (rbp) ; and stack becomes 16-byte aligned again sub rsp, 8*4 ; alloc space for 4 parameters cmp rdx, WM_DESTROY je .wmdestroy cmp rdx, WM_COMMAND jne .default mov rax, r8 shr rax, 16 cmp rax, BN_CLICKED jne .default cmp r9, [AboutBtnHandle] je .about cmp r9, [ExitBtnHandle] je .wmdestroy .default: call [DefWindowProc] jmp .finish .about: xor rcx, rcx mov rdx, AboutText mov r8, AboutTitle xor r9, r9 call [MessageBox] jmp .finish .wmdestroy: xor rcx, rcx call [ExitProcess] .finish: add rsp, 8*4 ; restore stack ret endp section '.relocs' fixups readable writeable section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',\ user,'USER32.DLL' import kernel,\ GetModuleHandle,'GetModuleHandleA',\ ExitProcess,'ExitProcess' import user,\ RegisterClass,'RegisterClassA',\ CreateWindowEx,'CreateWindowExA',\ DefWindowProc,'DefWindowProcA',\ GetMessage,'GetMessageA',\ TranslateMessage,'TranslateMessage',\ DispatchMessage,'DispatchMessageA',\ LoadCursor,'LoadCursorA',\ LoadIcon,'LoadIconA',\ ShowWindow,'ShowWindow',\ UpdateWindow,'UpdateWindow',\ MessageBox,'MessageBoxA'
oeis/217/A217530.asm
neoneye/loda-programs
11
173074
; A217530: n^4/2-5*n^3/2+21*n-30. ; 0,6,22,75,204,460,906,1617,2680,4194,6270,9031,12612,17160,22834,29805,38256,48382,60390,74499,90940,109956,131802,156745,185064,217050,253006,293247,338100,387904,443010,503781,570592,643830,723894,811195,906156,1009212,1120810,1241409,1371480,1511506,1661982,1823415,1996324,2181240,2378706,2589277,2813520,3052014,3305350,3574131,3858972,4160500,4479354,4816185,5171656,5546442,5941230,6356719,6793620,7252656,7734562,8240085,8769984,9325030,9906006,10513707,11148940,11812524,12505290,13228081 mov $2,$0 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $7,$0 mov $8,0 mov $9,$0 lpb $9 mov $0,$7 sub $9,1 sub $0,$9 mul $0,2 mov $3,$0 mov $5,$0 mov $6,$0 div $6,2 sub $0,$6 add $5,$0 mul $3,$5 add $5,8 lpb $0 mov $0,1 sub $3,$5 lpe add $8,$3 lpe add $1,$8 lpe mov $0,$1
data/phone/text/parry_overworld.asm
Dev727/ancientplatinum
28
103179
<reponame>Dev727/ancientplatinum ParryAskNumber1Text: text "Sheesh, the way" line "you attacked! That" para "was something! We" line "should meet again!" para "How about giving" line "me your number?" done ParryAskNumber2Text: text "So you want to" line "register my phone" para "number for a re-" line "match, huh?" done ParryNumberAcceptedText: text "I'll call you" line "whenever I feel" cont "like battling!" done ParryNumberDeclinedText: text "No? That's fine." para "A definite no is" line "easy to take!" para "I'll be right here" line "when you're ready" cont "for a rematch." done ParryPhoneFullText: text "Oh? There's no" line "room to register" cont "my phone number." done ParryRematchText: text "Hey, here comes" line "the kid! Let's go!" para "Ready for my usual" line "no-brainer, all-" cont "out offense?" done ParryPackFullText: text "Your PACK looks" line "stuffed full!" para "You can't have" line "this now." done ParryRematchGiftText: text "Well, you're" line "special all right." para "If only I'd begun" line "#MON when I was" cont "a tad younger…" para "I want you to work" line "and succeed for" para "the both of us." line "So take this, OK?" done
source/machine-w64-mingw32/s-zetews.adb
ytomino/drake
33
21545
with System.Address_To_Named_Access_Conversions; with System.Storage_Elements; with C.string; with C.winnls; package body System.Zero_Terminated_WStrings is pragma Suppress (All_Checks); use type Storage_Elements.Storage_Offset; package LPSTR_Conv is new Address_To_Named_Access_Conversions (C.char, C.winnt.LPSTR); -- implementation function Value (Item : not null access constant C.winnt.WCHAR) return String is begin return Value (Item, C.string.wcslen (Item)); end Value; function Value ( Item : not null access constant C.winnt.WCHAR; Length : C.size_t) return String is Result : String (1 .. Natural (Length) * 2); Result_Length : C.signed_int; begin Result_Length := C.winnls.WideCharToMultiByte ( C.winnls.CP_UTF8, 0, Item, C.signed_int (Length), LPSTR_Conv.To_Pointer (Result'Address), Result'Length, null, null); return Result (1 .. Natural (Result_Length)); end Value; procedure To_C (Source : String; Result : not null access C.winnt.WCHAR) is Dummy : C.size_t; begin To_C (Source, Result, Dummy); end To_C; procedure To_C ( Source : String; Result : not null access C.winnt.WCHAR; Result_Length : out C.size_t) is type LPWSTR is access all C.winnt.WCHAR -- local type with Convention => C; for LPWSTR'Storage_Size use 0; package LPWSTR_Conv is new Address_To_Named_Access_Conversions (C.winnt.WCHAR, LPWSTR); Source_Length : constant Natural := Source'Length; Raw_Result_Length : C.signed_int; Result_End : LPWSTR; begin Raw_Result_Length := C.winnls.MultiByteToWideChar ( C.winnls.CP_UTF8, 0, LPSTR_Conv.To_Pointer (Source'Address), C.signed_int (Source_Length), Result, C.signed_int (Source_Length)); -- assuming Result has enough size Result_End := LPWSTR_Conv.To_Pointer ( LPWSTR_Conv.To_Address (LPWSTR (Result)) + Storage_Elements.Storage_Offset (Raw_Result_Length) * (C.winnt.WCHAR'Size / Standard'Storage_Unit)); Result_End.all := C.winnt.WCHAR'Val (0); Result_Length := C.size_t (Raw_Result_Length); end To_C; end System.Zero_Terminated_WStrings;
src/main-draw_curve.adb
alkhimey/Ada_Curve
5
12072
<filename>src/main-draw_curve.adb -- The MIT License (MIT) -- -- Copyright (c) 2016-2017 <EMAIL> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -- THE SOFTWARE. -- -- separate (Main) procedure Draw_Curve(Control_Points : in CRV.Control_Points_Array; Algorithm : in Algorithm_Type; Knot_Values : in CRV.Knot_Values_Array) is procedure Draw_Curve_Segment(Segment : in Positive := 1) is STEP : constant := 0.015625; -- Power of 2 required for floating point to reach 1.0 exaclty! Token : Gl.Immediate.Input_Token := GL.Immediate.Start (Line_Strip); T : Gl.Types.Double := 0.0; P : CRV.Point_Type := CRV.ORIGIN_POINT; Skip_Vertex : Boolean := False; begin T := 0.0; while T <= 1.0 loop Skip_Vertex := False; case Algorithm is when DE_CASTELIJAU => P := CRV.Eval_De_Castelijau( Control_Points, T); when DE_BOOR => P := CRV.Eval_De_Boor ( Control_Points => Control_Points, Knot_Values => Knot_Values, T => T, Is_Outside_The_Domain => Skip_Vertex); when CATMULL_ROM => P := CRV.Eval_Catmull_Rom( Control_Points, Segment, T); when LAGRANGE_EQUIDISTANT => P := CRV.Eval_Lagrange( Control_Points, CRV.Make_Equidistant_Nodes(Control_Points'Length), T); when LAGRANGE_CHEBYSHEV => P := CRV.Eval_Lagrange( Control_Points, CRV.Make_Chebyshev_Nodes(Control_Points'Length), T); end case; if not Skip_Vertex then GL.Immediate.Add_Vertex(Token, Vector2'(P(CRV.X), P(CRV.Y))); end if; T := T + STEP; end loop; end Draw_Curve_Segment; begin GL.Toggles.Enable(GL.Toggles.Line_Smooth); Gl.Immediate.Set_Color (GL.Types.Colors.Color'(1.0, 1.0, 0.0, 0.0)); case Algorithm is when DE_CASTELIJAU | LAGRANGE_EQUIDISTANT | LAGRANGE_CHEBYSHEV | DE_BOOR => Draw_Curve_Segment; when CATMULL_ROM => for Segment in Positive range 1 .. Control_Points'Length - 3 loop Draw_Curve_Segment(Segment); end loop; end case; GL.Toggles.Disable(GL.Toggles.Line_Smooth); end Draw_Curve;
oeis/007/A007450.asm
neoneye/loda-programs
11
164610
<filename>oeis/007/A007450.asm<gh_stars>10-100 ; A007450: Decimal expansion of 1/17. ; 0,5,8,8,2,3,5,2,9,4,1,1,7,6,4,7,0,5,8,8,2,3,5,2,9,4,1,1,7,6,4,7,0,5,8,8,2,3,5,2,9,4,1,1,7,6,4,7,0,5,8,8,2,3,5,2,9,4,1,1,7,6,4,7,0,5,8,8,2,3,5,2,9,4,1,1,7,6,4,7,0,5,8,8,2,3,5,2,9,4,1,1,7,6,4,7,0,5,8,8 add $0,1 mov $2,10 pow $2,$0 div $2,17 mov $0,$2 mod $0,10
Task/Same-Fringe/Ada/same-fringe-3.ada
LaudateCorpus1/RosettaCodeData
1
641
<reponame>LaudateCorpus1/RosettaCodeData generic with procedure Process_Data(Item: Data); with function Stop return Boolean; with procedure Finish; package Bin_Trees.Traverse is task Inorder_Task is entry Run(Tree: Tree_Type); -- this will call each Item in Tree and, at the very end, it will call Finish -- except when Stop becomes true; in this case, the task terminates end Inorder_Task; end Bin_Trees.Traverse;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/pack18_pkg.ads
best08618/asylo
7
90
with GNAT.Dynamic_Tables; package Pack18_Pkg is type String_Access is access String; type Rec is record S : String_Access; B : Boolean; N : Natural; end record; pragma Pack (Rec); package Attributes_Tables is new GNAT.Dynamic_Tables (Table_Component_Type => Rec, Table_Index_Type => Natural, Table_Low_Bound => 1, Table_Initial => 200, Table_Increment => 200); end Pack18_Pkg;
OvmfPkg/CpuHotplugSmm/PostSmmPen.nasm
nicklela/edk2
3,012
84767
<reponame>nicklela/edk2 ;------------------------------------------------------------------------------ ; @file ; Pen any hot-added CPU in a 16-bit, real mode HLT loop, after it leaves SMM by ; executing the RSM instruction. ; ; Copyright (c) 2020, Red Hat, Inc. ; ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; The routine implemented here is stored into normal RAM, under 1MB, at the ; beginning of a page that is allocated as EfiReservedMemoryType. On any ; hot-added CPU, it is executed after *at least* the first RSM (i.e., after ; SMBASE relocation). ; ; The first execution of this code occurs as follows: ; ; - The hot-added CPU is in RESET state. ; ; - The ACPI CPU hotplug event handler triggers a broadcast SMI, from the OS. ; ; - Existent CPUs (BSP and APs) enter SMM. ; ; - The hot-added CPU remains in RESET state, but an SMI is pending for it now. ; (See "SYSTEM MANAGEMENT INTERRUPT (SMI)" in the Intel SDM.) ; ; - In SMM, pre-existent CPUs that are not elected SMM Monarch, keep themselves ; busy with their wait loops. ; ; - From the root MMI handler, the SMM Monarch: ; ; - places this routine in the reserved page, ; ; - clears the "about to leave SMM" byte in SMRAM, ; ; - clears the last byte of the reserved page, ; ; - sends an INIT-SIPI-SIPI sequence to the hot-added CPU, ; ; - un-gates the default SMI handler by APIC ID. ; ; - The startup vector in the SIPI that is sent by the SMM Monarch points to ; this code; i.e., to the reserved page. (Example: 0x9_F000.) ; ; - The SMM Monarch starts polling the "about to leave SMM" byte in SMRAM. ; ; - The hot-added CPU boots, and immediately enters SMM due to the pending SMI. ; It starts executing the default SMI handler. ; ; - Importantly, the SMRAM Save State Map captures the following information, ; when the hot-added CPU enters SMM: ; ; - CS selector: assumes the 16 most significant bits of the 20-bit (i.e., ; below 1MB) startup vector from the SIPI. (Example: 0x9F00.) ; ; - CS attributes: Accessed, Readable, User (S=1), CodeSegment (bit#11), ; Present. ; ; - CS limit: 0xFFFF. ; ; - CS base: the CS selector value shifted left by 4 bits. That is, the CS ; base equals the SIPI startup vector. (Example: 0x9_F000.) ; ; - IP: the least significant 4 bits from the SIPI startup vector. Because ; the routine is page-aligned, these bits are zero (hence IP is zero). ; ; - ES, SS, DS, FS, GS selectors: 0. ; ; - ES, SS, DS, FS, GS attributes: same as the CS attributes, minus ; CodeSegment (bit#11). ; ; - ES, SS, DS, FS, GS limits: 0xFFFF. ; ; - ES, SS, DS, FS, GS bases: 0. ; ; - The hot-added CPU sets its new SMBASE value in the SMRAM Save State Map. ; ; - The hot-added CPU sets the "about to leave SMM" byte in SMRAM, then ; executes the RSM instruction immediately after, leaving SMM. ; ; - The SMM Monarch notices that the "about to leave SMM" byte in SMRAM has ; been set, and starts polling the last byte in the reserved page. ; ; - The hot-added CPU jumps ("returns") to the code below (in the reserved ; page), according to the register state listed in the SMRAM Save State Map. ; ; - The hot-added CPU sets the last byte of the reserved page, then halts ; itself. ; ; - The SMM Monarch notices that the hot-added CPU is done with SMBASE ; relocation. ; ; Note that, if the OS is malicious and sends INIT-SIPI-SIPI to the hot-added ; CPU before allowing the ACPI CPU hotplug event handler to trigger a broadcast ; SMI, then said broadcast SMI will yank the hot-added CPU directly into SMM, ; without becoming pending for it (as the hot-added CPU is no longer in RESET ; state). This is OK, because: ; ; - The default SMI handler copes with this, as it is gated by APIC ID. The ; hot-added CPU won't start the actual SMBASE relocation until the SMM ; Monarch lets it. ; ; - The INIT-SIPI-SIPI sequence that the SMM Monarch sends to the hot-added CPU ; will be ignored in this sate (it won't even be latched). See "SMI HANDLER ; EXECUTION ENVIRONMENT" in the Intel SDM: "INIT operations are inhibited ; when the processor enters SMM". ; ; - When the hot-added CPU (e.g., CPU#1) executes the RSM (having relocated ; SMBASE), it returns to the OS. The OS can use CPU#1 to attack the last byte ; of the reserved page, while another CPU (e.g., CPU#2) is relocating SMBASE, ; in order to trick the SMM Monarch (e.g., CPU#0) to open the APIC ID gate ; for yet another CPU (e.g., CPU#3). However, the SMM Monarch won't look at ; the last byte of the reserved page, until CPU#2 sets the "about to leave ; SMM" byte in SMRAM. This leaves a very small window (just one instruction's ; worth before the RSM) for CPU#3 to "catch up" with CPU#2, and overwrite ; CPU#2's SMBASE with its own. ; ; In other words, we do not / need not prevent a malicious OS from booting the ; hot-added CPU early; instead we provide benign OSes with a pen for hot-added ; CPUs. ;------------------------------------------------------------------------------ SECTION .data BITS 16 GLOBAL ASM_PFX (mPostSmmPen) ; UINT8[] GLOBAL ASM_PFX (mPostSmmPenSize) ; UINT16 ASM_PFX (mPostSmmPen): ; ; Point DS at the same reserved page. ; mov ax, cs mov ds, ax ; ; Inform the SMM Monarch that we're done with SMBASE relocation, by setting ; the last byte in the reserved page. ; mov byte [ds : word 0xFFF], 1 ; ; Halt now, until we get woken by another SMI, or (more likely) the OS ; reboots us with another INIT-SIPI-SIPI. ; HltLoop: cli hlt jmp HltLoop ASM_PFX (mPostSmmPenSize): dw $ - ASM_PFX (mPostSmmPen)
src/gen/cups-cups_ipp_h.ads
persan/a-cups
0
12560
<gh_stars>0 pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with System; with CUPS.stdio_h; with Interfaces.C_Streams; with Interfaces.C.Strings; with CUPS.time_h; private package CUPS.cups_ipp_h is -- unsupported macro: IPP_VERSION "\002\001" IPP_PORT : constant := 631; -- cups/ipp.h:52 IPP_MAX_CHARSET : constant := 64; -- cups/ipp.h:58 IPP_MAX_KEYWORD : constant := 256; -- cups/ipp.h:59 IPP_MAX_LANGUAGE : constant := 64; -- cups/ipp.h:60 IPP_MAX_LENGTH : constant := 32767; -- cups/ipp.h:61 IPP_MAX_MIMETYPE : constant := 256; -- cups/ipp.h:62 IPP_MAX_NAME : constant := 256; -- cups/ipp.h:63 IPP_MAX_OCTETSTRING : constant := 1023; -- cups/ipp.h:64 IPP_MAX_TEXT : constant := 1024; -- cups/ipp.h:65 IPP_MAX_URI : constant := 1024; -- cups/ipp.h:66 IPP_MAX_URISCHEME : constant := 64; -- cups/ipp.h:67 IPP_MAX_VALUES : constant := 8; -- cups/ipp.h:68 -- arg-macro: function IPP_CONST_TAG (ipp_tag_t)(IPP_TAG_CUPS_CONST or (x) -- return ipp_tag_t)(IPP_TAG_CUPS_CONST or (x); -- unsupported macro: IPP_DOCUMENT_PENDING IPP_DSTATE_PENDING -- unsupported macro: IPP_DOCUMENT_PROCESSING IPP_DSTATE_PROCESSING -- unsupported macro: IPP_DOCUMENT_CANCELED IPP_DSTATE_CANCELED -- unsupported macro: IPP_DOCUMENT_ABORTED IPP_DSTATE_ABORTED -- unsupported macro: IPP_DOCUMENT_COMPLETED IPP_DSTATE_COMPLETED -- unsupported macro: IPP_FINISHINGS_JOB_OFFSET IPP_FINISHINGS_JOG_OFFSET -- unsupported macro: IPP_JOB_UNCOLLATED_SHEETS IPP_JCOLLATE_UNCOLLATED_SHEETS -- unsupported macro: IPP_JOB_COLLATED_DOCUMENTS IPP_JCOLLATE_COLLATED_DOCUMENTS -- unsupported macro: IPP_JOB_UNCOLLATED_DOCUMENTS IPP_JCOLLATE_UNCOLLATED_DOCUMENTS -- unsupported macro: IPP_JOB_PENDING IPP_JSTATE_PENDING -- unsupported macro: IPP_JOB_HELD IPP_JSTATE_HELD -- unsupported macro: IPP_JOB_PROCESSING IPP_JSTATE_PROCESSING -- unsupported macro: IPP_JOB_STOPPED IPP_JSTATE_STOPPED -- unsupported macro: IPP_JOB_CANCELED IPP_JSTATE_CANCELED -- unsupported macro: IPP_JOB_ABORTED IPP_JSTATE_ABORTED -- unsupported macro: IPP_JOB_COMPLETED IPP_JSTATE_COMPLETED -- unsupported macro: IPP_JOB_CANCELLED IPP_JSTATE_CANCELED -- unsupported macro: IPP_PRINT_JOB IPP_OP_PRINT_JOB -- unsupported macro: IPP_PRINT_URI IPP_OP_PRINT_URI -- unsupported macro: IPP_VALIDATE_JOB IPP_OP_VALIDATE_JOB -- unsupported macro: IPP_CREATE_JOB IPP_OP_CREATE_JOB -- unsupported macro: IPP_SEND_DOCUMENT IPP_OP_SEND_DOCUMENT -- unsupported macro: IPP_SEND_URI IPP_OP_SEND_URI -- unsupported macro: IPP_CANCEL_JOB IPP_OP_CANCEL_JOB -- unsupported macro: IPP_GET_JOB_ATTRIBUTES IPP_OP_GET_JOB_ATTRIBUTES -- unsupported macro: IPP_GET_JOBS IPP_OP_GET_JOBS -- unsupported macro: IPP_GET_PRINTER_ATTRIBUTES IPP_OP_GET_PRINTER_ATTRIBUTES -- unsupported macro: IPP_HOLD_JOB IPP_OP_HOLD_JOB -- unsupported macro: IPP_RELEASE_JOB IPP_OP_RELEASE_JOB -- unsupported macro: IPP_RESTART_JOB IPP_OP_RESTART_JOB -- unsupported macro: IPP_PAUSE_PRINTER IPP_OP_PAUSE_PRINTER -- unsupported macro: IPP_RESUME_PRINTER IPP_OP_RESUME_PRINTER -- unsupported macro: IPP_PURGE_JOBS IPP_OP_PURGE_JOBS -- unsupported macro: IPP_SET_PRINTER_ATTRIBUTES IPP_OP_SET_PRINTER_ATTRIBUTES -- unsupported macro: IPP_SET_JOB_ATTRIBUTES IPP_OP_SET_JOB_ATTRIBUTES -- unsupported macro: IPP_GET_PRINTER_SUPPORTED_VALUES IPP_OP_GET_PRINTER_SUPPORTED_VALUES -- unsupported macro: IPP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS -- unsupported macro: IPP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS -- unsupported macro: IPP_OP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS -- unsupported macro: IPP_OP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS -- unsupported macro: IPP_GET_SUBSCRIPTION_ATTRIBUTES IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES -- unsupported macro: IPP_GET_SUBSCRIPTIONS IPP_OP_GET_SUBSCRIPTIONS -- unsupported macro: IPP_RENEW_SUBSCRIPTION IPP_OP_RENEW_SUBSCRIPTION -- unsupported macro: IPP_CANCEL_SUBSCRIPTION IPP_OP_CANCEL_SUBSCRIPTION -- unsupported macro: IPP_GET_NOTIFICATIONS IPP_OP_GET_NOTIFICATIONS -- unsupported macro: IPP_SEND_NOTIFICATIONS IPP_OP_SEND_NOTIFICATIONS -- unsupported macro: IPP_GET_RESOURCE_ATTRIBUTES IPP_OP_GET_RESOURCE_ATTRIBUTES -- unsupported macro: IPP_GET_RESOURCE_DATA IPP_OP_GET_RESOURCE_DATA -- unsupported macro: IPP_GET_RESOURCES IPP_OP_GET_RESOURCES -- unsupported macro: IPP_GET_PRINT_SUPPORT_FILES IPP_OP_GET_PRINT_SUPPORT_FILES -- unsupported macro: IPP_ENABLE_PRINTER IPP_OP_ENABLE_PRINTER -- unsupported macro: IPP_DISABLE_PRINTER IPP_OP_DISABLE_PRINTER -- unsupported macro: IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB -- unsupported macro: IPP_HOLD_NEW_JOBS IPP_OP_HOLD_NEW_JOBS -- unsupported macro: IPP_RELEASE_HELD_NEW_JOBS IPP_OP_RELEASE_HELD_NEW_JOBS -- unsupported macro: IPP_DEACTIVATE_PRINTER IPP_OP_DEACTIVATE_PRINTER -- unsupported macro: IPP_ACTIVATE_PRINTER IPP_OP_ACTIVATE_PRINTER -- unsupported macro: IPP_RESTART_PRINTER IPP_OP_RESTART_PRINTER -- unsupported macro: IPP_SHUTDOWN_PRINTER IPP_OP_SHUTDOWN_PRINTER -- unsupported macro: IPP_STARTUP_PRINTER IPP_OP_STARTUP_PRINTER -- unsupported macro: IPP_REPROCESS_JOB IPP_OP_REPROCESS_JOB -- unsupported macro: IPP_CANCEL_CURRENT_JOB IPP_OP_CANCEL_CURRENT_JOB -- unsupported macro: IPP_SUSPEND_CURRENT_JOB IPP_OP_SUSPEND_CURRENT_JOB -- unsupported macro: IPP_RESUME_JOB IPP_OP_RESUME_JOB -- unsupported macro: IPP_PROMOTE_JOB IPP_OP_PROMOTE_JOB -- unsupported macro: IPP_SCHEDULE_JOB_AFTER IPP_OP_SCHEDULE_JOB_AFTER -- unsupported macro: IPP_CANCEL_DOCUMENT IPP_OP_CANCEL_DOCUMENT -- unsupported macro: IPP_GET_DOCUMENT_ATTRIBUTES IPP_OP_GET_DOCUMENT_ATTRIBUTES -- unsupported macro: IPP_GET_DOCUMENTS IPP_OP_GET_DOCUMENTS -- unsupported macro: IPP_DELETE_DOCUMENT IPP_OP_DELETE_DOCUMENT -- unsupported macro: IPP_SET_DOCUMENT_ATTRIBUTES IPP_OP_SET_DOCUMENT_ATTRIBUTES -- unsupported macro: IPP_CANCEL_JOBS IPP_OP_CANCEL_JOBS -- unsupported macro: IPP_CANCEL_MY_JOBS IPP_OP_CANCEL_MY_JOBS -- unsupported macro: IPP_RESUBMIT_JOB IPP_OP_RESUBMIT_JOB -- unsupported macro: IPP_CLOSE_JOB IPP_OP_CLOSE_JOB -- unsupported macro: IPP_IDENTIFY_PRINTER IPP_OP_IDENTIFY_PRINTER -- unsupported macro: IPP_VALIDATE_DOCUMENT IPP_OP_VALIDATE_DOCUMENT -- unsupported macro: IPP_PRIVATE IPP_OP_PRIVATE -- unsupported macro: CUPS_GET_DEFAULT IPP_OP_CUPS_GET_DEFAULT -- unsupported macro: CUPS_GET_PRINTERS IPP_OP_CUPS_GET_PRINTERS -- unsupported macro: CUPS_ADD_MODIFY_PRINTER IPP_OP_CUPS_ADD_MODIFY_PRINTER -- unsupported macro: CUPS_DELETE_PRINTER IPP_OP_CUPS_DELETE_PRINTER -- unsupported macro: CUPS_GET_CLASSES IPP_OP_CUPS_GET_CLASSES -- unsupported macro: CUPS_ADD_MODIFY_CLASS IPP_OP_CUPS_ADD_MODIFY_CLASS -- unsupported macro: CUPS_DELETE_CLASS IPP_OP_CUPS_DELETE_CLASS -- unsupported macro: CUPS_ACCEPT_JOBS IPP_OP_CUPS_ACCEPT_JOBS -- unsupported macro: CUPS_REJECT_JOBS IPP_OP_CUPS_REJECT_JOBS -- unsupported macro: CUPS_SET_DEFAULT IPP_OP_CUPS_SET_DEFAULT -- unsupported macro: CUPS_GET_DEVICES IPP_OP_CUPS_GET_DEVICES -- unsupported macro: CUPS_GET_PPDS IPP_OP_CUPS_GET_PPDS -- unsupported macro: CUPS_MOVE_JOB IPP_OP_CUPS_MOVE_JOB -- unsupported macro: CUPS_AUTHENTICATE_JOB IPP_OP_CUPS_AUTHENTICATE_JOB -- unsupported macro: CUPS_GET_PPD IPP_OP_CUPS_GET_PPD -- unsupported macro: CUPS_GET_DOCUMENT IPP_OP_CUPS_GET_DOCUMENT -- unsupported macro: CUPS_ADD_PRINTER IPP_OP_CUPS_ADD_MODIFY_PRINTER -- unsupported macro: CUPS_ADD_CLASS IPP_OP_CUPS_ADD_MODIFY_CLASS -- unsupported macro: IPP_PORTRAIT IPP_ORIENT_PORTRAIT -- unsupported macro: IPP_LANDSCAPE IPP_ORIENT_LANDSCAPE -- unsupported macro: IPP_REVERSE_LANDSCAPE IPP_ORIENT_REVERSE_LANDSCAPE -- unsupported macro: IPP_REVERSE_PORTRAIT IPP_ORIENT_REVERSE_PORTRAIT -- unsupported macro: IPP_PRINTER_IDLE IPP_PSTATE_IDLE -- unsupported macro: IPP_PRINTER_PROCESSING IPP_PSTATE_PROCESSING -- unsupported macro: IPP_PRINTER_STOPPED IPP_PSTATE_STOPPED -- unsupported macro: IPP_ERROR IPP_STATE_ERROR -- unsupported macro: IPP_IDLE IPP_STATE_IDLE -- unsupported macro: IPP_HEADER IPP_STATE_HEADER -- unsupported macro: IPP_ATTRIBUTE IPP_STATE_ATTRIBUTE -- unsupported macro: IPP_DATA IPP_STATE_DATA -- unsupported macro: IPP_OK IPP_STATUS_OK -- unsupported macro: IPP_OK_SUBST IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED -- unsupported macro: IPP_OK_CONFLICT IPP_STATUS_OK_CONFLICTING -- unsupported macro: IPP_OK_IGNORED_SUBSCRIPTIONS IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS -- unsupported macro: IPP_OK_IGNORED_NOTIFICATIONS IPP_STATUS_OK_IGNORED_NOTIFICATIONS -- unsupported macro: IPP_OK_TOO_MANY_EVENTS IPP_STATUS_OK_TOO_MANY_EVENTS -- unsupported macro: IPP_OK_BUT_CANCEL_SUBSCRIPTION IPP_STATUS_OK_BUT_CANCEL_SUBSCRIPTION -- unsupported macro: IPP_OK_EVENTS_COMPLETE IPP_STATUS_OK_EVENTS_COMPLETE -- unsupported macro: IPP_REDIRECTION_OTHER_SITE IPP_STATUS_REDIRECTION_OTHER_SITE -- unsupported macro: CUPS_SEE_OTHER IPP_STATUS_CUPS_SEE_OTHER -- unsupported macro: IPP_BAD_REQUEST IPP_STATUS_ERROR_BAD_REQUEST -- unsupported macro: IPP_FORBIDDEN IPP_STATUS_ERROR_FORBIDDEN -- unsupported macro: IPP_NOT_AUTHENTICATED IPP_STATUS_ERROR_NOT_AUTHENTICATED -- unsupported macro: IPP_NOT_AUTHORIZED IPP_STATUS_ERROR_NOT_AUTHORIZED -- unsupported macro: IPP_NOT_POSSIBLE IPP_STATUS_ERROR_NOT_POSSIBLE -- unsupported macro: IPP_TIMEOUT IPP_STATUS_ERROR_TIMEOUT -- unsupported macro: IPP_NOT_FOUND IPP_STATUS_ERROR_NOT_FOUND -- unsupported macro: IPP_GONE IPP_STATUS_ERROR_GONE -- unsupported macro: IPP_REQUEST_ENTITY IPP_STATUS_ERROR_REQUEST_ENTITY -- unsupported macro: IPP_REQUEST_VALUE IPP_STATUS_ERROR_REQUEST_VALUE -- unsupported macro: IPP_DOCUMENT_FORMAT IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED -- unsupported macro: IPP_ATTRIBUTES IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES -- unsupported macro: IPP_URI_SCHEME IPP_STATUS_ERROR_URI_SCHEME -- unsupported macro: IPP_CHARSET IPP_STATUS_ERROR_CHARSET -- unsupported macro: IPP_CONFLICT IPP_STATUS_ERROR_CONFLICTING -- unsupported macro: IPP_COMPRESSION_NOT_SUPPORTED IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED -- unsupported macro: IPP_COMPRESSION_ERROR IPP_STATUS_ERROR_COMPRESSION_ERROR -- unsupported macro: IPP_DOCUMENT_FORMAT_ERROR IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR -- unsupported macro: IPP_DOCUMENT_ACCESS_ERROR IPP_STATUS_ERROR_DOCUMENT_ACCESS -- unsupported macro: IPP_ATTRIBUTES_NOT_SETTABLE IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE -- unsupported macro: IPP_IGNORED_ALL_SUBSCRIPTIONS IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS -- unsupported macro: IPP_TOO_MANY_SUBSCRIPTIONS IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS -- unsupported macro: IPP_IGNORED_ALL_NOTIFICATIONS IPP_STATUS_ERROR_IGNORED_ALL_NOTIFICATIONS -- unsupported macro: IPP_PRINT_SUPPORT_FILE_NOT_FOUND IPP_STATUS_ERROR_PRINT_SUPPORT_FILE_NOT_FOUND -- unsupported macro: IPP_DOCUMENT_PASSWORD_ERROR IPP_STATUS_ERROR_DOCUMENT_PASSWORD -- unsupported macro: IPP_DOCUMENT_PERMISSION_ERROR IPP_STATUS_ERROR_DOCUMENT_PERMISSION -- unsupported macro: IPP_DOCUMENT_SECURITY_ERROR IPP_STATUS_ERROR_DOCUMENT_SECURITY -- unsupported macro: IPP_DOCUMENT_UNPRINTABLE_ERROR IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE -- unsupported macro: IPP_INTERNAL_ERROR IPP_STATUS_ERROR_INTERNAL -- unsupported macro: IPP_OPERATION_NOT_SUPPORTED IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED -- unsupported macro: IPP_SERVICE_UNAVAILABLE IPP_STATUS_ERROR_SERVICE_UNAVAILABLE -- unsupported macro: IPP_VERSION_NOT_SUPPORTED IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED -- unsupported macro: IPP_DEVICE_ERROR IPP_STATUS_ERROR_DEVICE -- unsupported macro: IPP_TEMPORARY_ERROR IPP_STATUS_ERROR_TEMPORARY -- unsupported macro: IPP_NOT_ACCEPTING IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS -- unsupported macro: IPP_PRINTER_BUSY IPP_STATUS_ERROR_BUSY -- unsupported macro: IPP_ERROR_JOB_CANCELED IPP_STATUS_ERROR_JOB_CANCELED -- unsupported macro: IPP_MULTIPLE_JOBS_NOT_SUPPORTED IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED -- unsupported macro: IPP_PRINTER_IS_DEACTIVATED IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED -- unsupported macro: IPP_TOO_MANY_JOBS IPP_STATUS_ERROR_TOO_MANY_JOBS -- unsupported macro: IPP_TOO_MANY_DOCUMENTS IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS -- unsupported macro: IPP_AUTHENTICATION_CANCELED IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED -- unsupported macro: IPP_PKI_ERROR IPP_STATUS_ERROR_CUPS_PKI -- unsupported macro: IPP_UPGRADE_REQUIRED IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED -- unsupported macro: IPP_ERROR_JOB_CANCELLED IPP_STATUS_ERROR_JOB_CANCELED -- unsupported macro: IPP_TAG_MASK IPP_TAG_CUPS_MASK -- unsupported macro: IPP_TAG_COPY IPP_TAG_CUPS_CONST -- * "$Id: ipp.h 12666 2015-05-25 19:38:09Z msweet $" -- * -- * Internet Printing Protocol definitions for CUPS. -- * -- * Copyright 2007-2014 by Apple Inc. -- * Copyright 1997-2006 by Easy Software Products. -- * -- * These coded instructions, statements, and computer programs are the -- * property of Apple Inc. and are protected by Federal copyright -- * law. Distribution and use rights are outlined in the file "LICENSE.txt" -- * which should have been included with this file. If this file is -- * file is missing or damaged, see the license at "http://www.cups.org/". -- * -- * This file is subject to the Apple OS-Developed Software exception. -- -- * Include necessary headers... -- -- * C++ magic... -- -- * IPP version string... -- -- * IPP registered port number... -- * -- * Note: Applications should never use IPP_PORT, but instead use the -- * ippPort() function to allow overrides via the IPP_PORT environment -- * variable and services file if needed! -- -- * Common limits... -- -- * Macro to flag a text string attribute as "const" (static storage) vs. -- * allocated. -- -- * Types and structures... -- --*** Document states *** subtype ipp_dstate_e is unsigned; IPP_DOCUMENT_PENDING : constant ipp_dstate_e := 3; IPP_DOCUMENT_PROCESSING : constant ipp_dstate_e := 5; IPP_DOCUMENT_CANCELED : constant ipp_dstate_e := 7; IPP_DOCUMENT_ABORTED : constant ipp_dstate_e := 8; IPP_DOCUMENT_COMPLETED : constant ipp_dstate_e := 9; -- cups/ipp.h:82 -- Document is pending -- Document is processing -- Document is canceled -- Document is aborted -- Document is completed subtype ipp_dstate_t is ipp_dstate_e; --*** Finishings *** subtype ipp_finishings_e is unsigned; IPP_FINISHINGS_NONE : constant ipp_finishings_e := 3; IPP_FINISHINGS_STAPLE : constant ipp_finishings_e := 4; IPP_FINISHINGS_PUNCH : constant ipp_finishings_e := 5; IPP_FINISHINGS_COVER : constant ipp_finishings_e := 6; IPP_FINISHINGS_BIND : constant ipp_finishings_e := 7; IPP_FINISHINGS_SADDLE_STITCH : constant ipp_finishings_e := 8; IPP_FINISHINGS_EDGE_STITCH : constant ipp_finishings_e := 9; IPP_FINISHINGS_FOLD : constant ipp_finishings_e := 10; IPP_FINISHINGS_TRIM : constant ipp_finishings_e := 11; IPP_FINISHINGS_BALE : constant ipp_finishings_e := 12; IPP_FINISHINGS_BOOKLET_MAKER : constant ipp_finishings_e := 13; IPP_FINISHINGS_JOG_OFFSET : constant ipp_finishings_e := 14; IPP_FINISHINGS_COAT : constant ipp_finishings_e := 15; IPP_FINISHINGS_LAMINATE : constant ipp_finishings_e := 16; IPP_FINISHINGS_STAPLE_TOP_LEFT : constant ipp_finishings_e := 20; IPP_FINISHINGS_STAPLE_BOTTOM_LEFT : constant ipp_finishings_e := 21; IPP_FINISHINGS_STAPLE_TOP_RIGHT : constant ipp_finishings_e := 22; IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT : constant ipp_finishings_e := 23; IPP_FINISHINGS_EDGE_STITCH_LEFT : constant ipp_finishings_e := 24; IPP_FINISHINGS_EDGE_STITCH_TOP : constant ipp_finishings_e := 25; IPP_FINISHINGS_EDGE_STITCH_RIGHT : constant ipp_finishings_e := 26; IPP_FINISHINGS_EDGE_STITCH_BOTTOM : constant ipp_finishings_e := 27; IPP_FINISHINGS_STAPLE_DUAL_LEFT : constant ipp_finishings_e := 28; IPP_FINISHINGS_STAPLE_DUAL_TOP : constant ipp_finishings_e := 29; IPP_FINISHINGS_STAPLE_DUAL_RIGHT : constant ipp_finishings_e := 30; IPP_FINISHINGS_STAPLE_DUAL_BOTTOM : constant ipp_finishings_e := 31; IPP_FINISHINGS_STAPLE_TRIPLE_LEFT : constant ipp_finishings_e := 32; IPP_FINISHINGS_STAPLE_TRIPLE_TOP : constant ipp_finishings_e := 33; IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT : constant ipp_finishings_e := 34; IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM : constant ipp_finishings_e := 35; IPP_FINISHINGS_BIND_LEFT : constant ipp_finishings_e := 50; IPP_FINISHINGS_BIND_TOP : constant ipp_finishings_e := 51; IPP_FINISHINGS_BIND_RIGHT : constant ipp_finishings_e := 52; IPP_FINISHINGS_BIND_BOTTOM : constant ipp_finishings_e := 53; IPP_FINISHINGS_TRIM_AFTER_PAGES : constant ipp_finishings_e := 60; IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS : constant ipp_finishings_e := 61; IPP_FINISHINGS_TRIM_AFTER_COPIES : constant ipp_finishings_e := 62; IPP_FINISHINGS_TRIM_AFTER_JOB : constant ipp_finishings_e := 63; IPP_FINISHINGS_PUNCH_TOP_LEFT : constant ipp_finishings_e := 70; IPP_FINISHINGS_PUNCH_BOTTOM_LEFT : constant ipp_finishings_e := 71; IPP_FINISHINGS_PUNCH_TOP_RIGHT : constant ipp_finishings_e := 72; IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT : constant ipp_finishings_e := 73; IPP_FINISHINGS_PUNCH_DUAL_LEFT : constant ipp_finishings_e := 74; IPP_FINISHINGS_PUNCH_DUAL_TOP : constant ipp_finishings_e := 75; IPP_FINISHINGS_PUNCH_DUAL_RIGHT : constant ipp_finishings_e := 76; IPP_FINISHINGS_PUNCH_DUAL_BOTTOM : constant ipp_finishings_e := 77; IPP_FINISHINGS_PUNCH_TRIPLE_LEFT : constant ipp_finishings_e := 78; IPP_FINISHINGS_PUNCH_TRIPLE_TOP : constant ipp_finishings_e := 79; IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT : constant ipp_finishings_e := 80; IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM : constant ipp_finishings_e := 81; IPP_FINISHINGS_PUNCH_QUAD_LEFT : constant ipp_finishings_e := 82; IPP_FINISHINGS_PUNCH_QUAD_TOP : constant ipp_finishings_e := 83; IPP_FINISHINGS_PUNCH_QUAD_RIGHT : constant ipp_finishings_e := 84; IPP_FINISHINGS_PUNCH_QUAD_BOTTOM : constant ipp_finishings_e := 85; IPP_FINISHINGS_FOLD_ACCORDIAN : constant ipp_finishings_e := 90; IPP_FINISHINGS_FOLD_DOUBLE_GATE : constant ipp_finishings_e := 91; IPP_FINISHINGS_FOLD_GATE : constant ipp_finishings_e := 92; IPP_FINISHINGS_FOLD_HALF : constant ipp_finishings_e := 93; IPP_FINISHINGS_FOLD_HALF_Z : constant ipp_finishings_e := 94; IPP_FINISHINGS_FOLD_LEFT_GATE : constant ipp_finishings_e := 95; IPP_FINISHINGS_FOLD_LETTER : constant ipp_finishings_e := 96; IPP_FINISHINGS_FOLD_PARALLEL : constant ipp_finishings_e := 97; IPP_FINISHINGS_FOLD_POSTER : constant ipp_finishings_e := 98; IPP_FINISHINGS_FOLD_RIGHT_GATE : constant ipp_finishings_e := 99; IPP_FINISHINGS_FOLD_Z : constant ipp_finishings_e := 100; IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT : constant ipp_finishings_e := 1073741894; IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT : constant ipp_finishings_e := 1073741895; IPP_FINISHINGS_CUPS_PUNCH_TOP_RIGHT : constant ipp_finishings_e := 1073741896; IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_RIGHT : constant ipp_finishings_e := 1073741897; IPP_FINISHINGS_CUPS_PUNCH_DUAL_LEFT : constant ipp_finishings_e := 1073741898; IPP_FINISHINGS_CUPS_PUNCH_DUAL_TOP : constant ipp_finishings_e := 1073741899; IPP_FINISHINGS_CUPS_PUNCH_DUAL_RIGHT : constant ipp_finishings_e := 1073741900; IPP_FINISHINGS_CUPS_PUNCH_DUAL_BOTTOM : constant ipp_finishings_e := 1073741901; IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_LEFT : constant ipp_finishings_e := 1073741902; IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_TOP : constant ipp_finishings_e := 1073741903; IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_RIGHT : constant ipp_finishings_e := 1073741904; IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_BOTTOM : constant ipp_finishings_e := 1073741905; IPP_FINISHINGS_CUPS_PUNCH_QUAD_LEFT : constant ipp_finishings_e := 1073741906; IPP_FINISHINGS_CUPS_PUNCH_QUAD_TOP : constant ipp_finishings_e := 1073741907; IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT : constant ipp_finishings_e := 1073741908; IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM : constant ipp_finishings_e := 1073741909; IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN : constant ipp_finishings_e := 1073741914; IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE : constant ipp_finishings_e := 1073741915; IPP_FINISHINGS_CUPS_FOLD_GATE : constant ipp_finishings_e := 1073741916; IPP_FINISHINGS_CUPS_FOLD_HALF : constant ipp_finishings_e := 1073741917; IPP_FINISHINGS_CUPS_FOLD_HALF_Z : constant ipp_finishings_e := 1073741918; IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE : constant ipp_finishings_e := 1073741919; IPP_FINISHINGS_CUPS_FOLD_LETTER : constant ipp_finishings_e := 1073741920; IPP_FINISHINGS_CUPS_FOLD_PARALLEL : constant ipp_finishings_e := 1073741921; IPP_FINISHINGS_CUPS_FOLD_POSTER : constant ipp_finishings_e := 1073741922; IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE : constant ipp_finishings_e := 1073741923; IPP_FINISHINGS_CUPS_FOLD_Z : constant ipp_finishings_e := 1073741924; -- cups/ipp.h:99 -- No finishing -- Staple (any location) -- Punch (any location/count) -- Add cover -- Bind -- Staple interior -- Stitch along any side -- Fold (any type) -- Trim (any type) -- Bale (any type) -- Fold to make booklet -- Offset for binding (any type) -- Apply protective liquid or powder coating -- Apply protective (solid) material -- Staple top left corner -- Staple bottom left corner -- Staple top right corner -- Staple bottom right corner -- Stitch along left side -- Stitch along top edge -- Stitch along right side -- Stitch along bottom edge -- Two staples on left -- Two staples on top -- Two staples on right -- Two staples on bottom -- Three staples on left -- Three staples on top -- Three staples on right -- Three staples on bottom -- Bind on left -- Bind on top -- Bind on right -- Bind on bottom -- Trim output after each page -- Trim output after each document -- Trim output after each copy -- Trim output after job -- Punch 1 hole top left -- Punch 1 hole bottom left -- Punch 1 hole top right -- Punch 1 hole bottom right -- Punch 2 holes left side -- Punch 2 holes top edge -- Punch 2 holes right side -- Punch 2 holes bottom edge -- Punch 3 holes left side -- Punch 3 holes top edge -- Punch 3 holes right side -- Punch 3 holes bottom edge -- Punch 4 holes left side -- Punch 4 holes top edge -- Punch 4 holes right side -- Punch 4 holes bottom edge -- Accordian-fold the paper vertically into four sections -- Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically -- Fold the top and bottom quarters of the paper towards the midline -- Fold the paper in half vertically -- Fold the paper in half horizontally, then Z-fold the paper vertically -- Fold the top quarter of the paper towards the midline -- Fold the paper into three sections vertically; sometimes also known as a C fold -- Fold the paper in half vertically two times, yielding four sections -- Fold the paper in half horizontally and vertically; sometimes also called a cross fold -- Fold the bottom quarter of the paper towards the midline -- Fold the paper vertically into three sections, forming a Z -- CUPS extensions for finishings (pre-standard versions of values above) -- Punch 1 hole top left -- Punch 1 hole bottom left -- Punch 1 hole top right -- Punch 1 hole bottom right -- Punch 2 holes left side -- Punch 2 holes top edge -- Punch 2 holes right side -- Punch 2 holes bottom edge -- Punch 3 holes left side -- Punch 3 holes top edge -- Punch 3 holes right side -- Punch 3 holes bottom edge -- Punch 4 holes left side -- Punch 4 holes top edge -- Punch 4 holes right side -- Punch 4 holes bottom edge -- Accordian-fold the paper vertically into four sections -- Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically -- Fold the top and bottom quarters of the paper towards the midline -- Fold the paper in half vertically -- Fold the paper in half horizontally, then Z-fold the paper vertically -- Fold the top quarter of the paper towards the midline -- Fold the paper into three sections vertically; sometimes also known as a C fold -- Fold the paper in half vertically two times, yielding four sections -- Fold the paper in half horizontally and vertically; sometimes also called a cross fold -- Fold the bottom quarter of the paper towards the midline -- Fold the paper vertically into three sections, forming a Z subtype ipp_finishings_t is ipp_finishings_e; -- Long-time misspelling... subtype ipp_finish_t is ipp_finishings_e; --*** Job collation types *** subtype ipp_jcollate_e is unsigned; IPP_JCOLLATE_UNCOLLATED_SHEETS : constant ipp_jcollate_e := 3; IPP_JCOLLATE_COLLATED_DOCUMENTS : constant ipp_jcollate_e := 4; IPP_JCOLLATE_UNCOLLATED_DOCUMENTS : constant ipp_jcollate_e := 5; -- cups/ipp.h:208 subtype ipp_jcollate_t is ipp_jcollate_e; --*** Job states *** subtype ipp_jstate_e is unsigned; IPP_JSTATE_PENDING : constant ipp_jstate_e := 3; IPP_JSTATE_HELD : constant ipp_jstate_e := 4; IPP_JSTATE_PROCESSING : constant ipp_jstate_e := 5; IPP_JSTATE_STOPPED : constant ipp_jstate_e := 6; IPP_JSTATE_CANCELED : constant ipp_jstate_e := 7; IPP_JSTATE_ABORTED : constant ipp_jstate_e := 8; IPP_JSTATE_COMPLETED : constant ipp_jstate_e := 9; -- cups/ipp.h:221 -- Job is waiting to be printed -- Job is held for printing -- Job is currently printing -- Job has been stopped -- Job has been canceled -- Job has aborted due to error -- Job has completed successfully -- Legacy name for canceled state subtype ipp_jstate_t is ipp_jstate_e; --*** IPP operations *** subtype ipp_op_e is unsigned; IPP_OP_CUPS_INVALID : constant ipp_op_e := -1; IPP_OP_CUPS_NONE : constant ipp_op_e := 0; IPP_OP_PRINT_JOB : constant ipp_op_e := 2; IPP_OP_PRINT_URI : constant ipp_op_e := 3; IPP_OP_VALIDATE_JOB : constant ipp_op_e := 4; IPP_OP_CREATE_JOB : constant ipp_op_e := 5; IPP_OP_SEND_DOCUMENT : constant ipp_op_e := 6; IPP_OP_SEND_URI : constant ipp_op_e := 7; IPP_OP_CANCEL_JOB : constant ipp_op_e := 8; IPP_OP_GET_JOB_ATTRIBUTES : constant ipp_op_e := 9; IPP_OP_GET_JOBS : constant ipp_op_e := 10; IPP_OP_GET_PRINTER_ATTRIBUTES : constant ipp_op_e := 11; IPP_OP_HOLD_JOB : constant ipp_op_e := 12; IPP_OP_RELEASE_JOB : constant ipp_op_e := 13; IPP_OP_RESTART_JOB : constant ipp_op_e := 14; IPP_OP_PAUSE_PRINTER : constant ipp_op_e := 16; IPP_OP_RESUME_PRINTER : constant ipp_op_e := 17; IPP_OP_PURGE_JOBS : constant ipp_op_e := 18; IPP_OP_SET_PRINTER_ATTRIBUTES : constant ipp_op_e := 19; IPP_OP_SET_JOB_ATTRIBUTES : constant ipp_op_e := 20; IPP_OP_GET_PRINTER_SUPPORTED_VALUES : constant ipp_op_e := 21; IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS : constant ipp_op_e := 22; IPP_OP_CREATE_JOB_SUBSCRIPTIONS : constant ipp_op_e := 23; IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES : constant ipp_op_e := 24; IPP_OP_GET_SUBSCRIPTIONS : constant ipp_op_e := 25; IPP_OP_RENEW_SUBSCRIPTION : constant ipp_op_e := 26; IPP_OP_CANCEL_SUBSCRIPTION : constant ipp_op_e := 27; IPP_OP_GET_NOTIFICATIONS : constant ipp_op_e := 28; IPP_OP_SEND_NOTIFICATIONS : constant ipp_op_e := 29; IPP_OP_GET_RESOURCE_ATTRIBUTES : constant ipp_op_e := 30; IPP_OP_GET_RESOURCE_DATA : constant ipp_op_e := 31; IPP_OP_GET_RESOURCES : constant ipp_op_e := 32; IPP_OP_GET_PRINT_SUPPORT_FILES : constant ipp_op_e := 33; IPP_OP_ENABLE_PRINTER : constant ipp_op_e := 34; IPP_OP_DISABLE_PRINTER : constant ipp_op_e := 35; IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB : constant ipp_op_e := 36; IPP_OP_HOLD_NEW_JOBS : constant ipp_op_e := 37; IPP_OP_RELEASE_HELD_NEW_JOBS : constant ipp_op_e := 38; IPP_OP_DEACTIVATE_PRINTER : constant ipp_op_e := 39; IPP_OP_ACTIVATE_PRINTER : constant ipp_op_e := 40; IPP_OP_RESTART_PRINTER : constant ipp_op_e := 41; IPP_OP_SHUTDOWN_PRINTER : constant ipp_op_e := 42; IPP_OP_STARTUP_PRINTER : constant ipp_op_e := 43; IPP_OP_REPROCESS_JOB : constant ipp_op_e := 44; IPP_OP_CANCEL_CURRENT_JOB : constant ipp_op_e := 45; IPP_OP_SUSPEND_CURRENT_JOB : constant ipp_op_e := 46; IPP_OP_RESUME_JOB : constant ipp_op_e := 47; IPP_OP_PROMOTE_JOB : constant ipp_op_e := 48; IPP_OP_SCHEDULE_JOB_AFTER : constant ipp_op_e := 49; IPP_OP_CANCEL_DOCUMENT : constant ipp_op_e := 51; IPP_OP_GET_DOCUMENT_ATTRIBUTES : constant ipp_op_e := 52; IPP_OP_GET_DOCUMENTS : constant ipp_op_e := 53; IPP_OP_DELETE_DOCUMENT : constant ipp_op_e := 54; IPP_OP_SET_DOCUMENT_ATTRIBUTES : constant ipp_op_e := 55; IPP_OP_CANCEL_JOBS : constant ipp_op_e := 56; IPP_OP_CANCEL_MY_JOBS : constant ipp_op_e := 57; IPP_OP_RESUBMIT_JOB : constant ipp_op_e := 58; IPP_OP_CLOSE_JOB : constant ipp_op_e := 59; IPP_OP_IDENTIFY_PRINTER : constant ipp_op_e := 60; IPP_OP_VALIDATE_DOCUMENT : constant ipp_op_e := 61; IPP_OP_SEND_HARDCOPY_DOCUMENT : constant ipp_op_e := 62; IPP_OP_ACKNOWLEDGE_DOCUMENT : constant ipp_op_e := 63; IPP_OP_ACKNOWLEDGE_IDENTIFY_PRINTER : constant ipp_op_e := 64; IPP_OP_ACKNOWLEDGE_JOB : constant ipp_op_e := 65; IPP_OP_FETCH_DOCUMENT : constant ipp_op_e := 66; IPP_OP_FETCH_JOB : constant ipp_op_e := 67; IPP_OP_GET_OUTPUT_DEVICE_ATTRIBUTES : constant ipp_op_e := 68; IPP_OP_UPDATE_ACTIVE_JOBS : constant ipp_op_e := 69; IPP_OP_DEREGISTER_OUTPUT_DEVICE : constant ipp_op_e := 70; IPP_OP_UPDATE_DOCUMENT_STATUS : constant ipp_op_e := 71; IPP_OP_UPDATE_JOB_STATUS : constant ipp_op_e := 72; IPP_OP_UPDATE_OUTPUT_DEVICE_ATTRIBUTES : constant ipp_op_e := 73; IPP_OP_GET_NEXT_DOCUMENT_DATA : constant ipp_op_e := 74; IPP_OP_PRIVATE : constant ipp_op_e := 16384; IPP_OP_CUPS_GET_DEFAULT : constant ipp_op_e := 16385; IPP_OP_CUPS_GET_PRINTERS : constant ipp_op_e := 16386; IPP_OP_CUPS_ADD_MODIFY_PRINTER : constant ipp_op_e := 16387; IPP_OP_CUPS_DELETE_PRINTER : constant ipp_op_e := 16388; IPP_OP_CUPS_GET_CLASSES : constant ipp_op_e := 16389; IPP_OP_CUPS_ADD_MODIFY_CLASS : constant ipp_op_e := 16390; IPP_OP_CUPS_DELETE_CLASS : constant ipp_op_e := 16391; IPP_OP_CUPS_ACCEPT_JOBS : constant ipp_op_e := 16392; IPP_OP_CUPS_REJECT_JOBS : constant ipp_op_e := 16393; IPP_OP_CUPS_SET_DEFAULT : constant ipp_op_e := 16394; IPP_OP_CUPS_GET_DEVICES : constant ipp_op_e := 16395; IPP_OP_CUPS_GET_PPDS : constant ipp_op_e := 16396; IPP_OP_CUPS_MOVE_JOB : constant ipp_op_e := 16397; IPP_OP_CUPS_AUTHENTICATE_JOB : constant ipp_op_e := 16398; IPP_OP_CUPS_GET_PPD : constant ipp_op_e := 16399; IPP_OP_CUPS_GET_DOCUMENT : constant ipp_op_e := 16423; -- cups/ipp.h:244 -- Invalid operation name for @link ippOpValue@ -- No operation @private@ -- Print a single file -- Print a single URL -- Validate job options -- Create an empty print job -- Add a file to a job -- Add a URL to a job -- Cancel a job -- Get job attributes -- Get a list of jobs -- Get printer attributes -- Hold a job for printing -- Release a job for printing -- Reprint a job -- Stop a printer -- Start a printer -- Cancel all jobs -- Set printer attributes -- Set job attributes -- Get supported attribute values -- Create one or more printer subscriptions @since CUPS 1.2/OS X 10.5@ -- Create one of more job subscriptions @since CUPS 1.2/OS X 10.5@ -- Get subscription attributes @since CUPS 1.2/OS X 10.5@ -- Get list of subscriptions @since CUPS 1.2/OS X 10.5@ -- Renew a printer subscription @since CUPS 1.2/OS X 10.5@ -- Cancel a subscription @since CUPS 1.2/OS X 10.5@ -- Get notification events @since CUPS 1.2/OS X 10.5@ -- Send notification events @private@ -- Get resource attributes @private@ -- Get resource data @private@ -- Get list of resources @private@ -- Get printer support files @private@ -- Start a printer -- Stop a printer -- Stop printer after the current job -- Hold new jobs -- Release new jobs -- Stop a printer -- Start a printer -- Restart a printer -- Turn a printer off -- Turn a printer on -- Reprint a job -- Cancel the current job -- Suspend the current job -- Resume the current job -- Promote a job to print sooner -- Schedule a job to print after another -- Cancel-Document -- Get-Document-Attributes -- Get-Documents -- Delete-Document -- Set-Document-Attributes -- Cancel-Jobs -- Cancel-My-Jobs -- Resubmit-Job -- Close-Job -- Identify-Printer -- Validate-Document -- Send-Hardcopy-Document -- Acknowledge-Document -- Acknowledge-Identify-Printer -- Acknowledge-Job -- Fetch-Document -- Fetch-Job -- Get-Output-Device-Attributes -- Update-Active-Jobs -- Deregister-Output-Device -- Update-Document-Status -- Update-Job-Status -- Update-Output-Device-Attributes -- Get-Next-Document-Data -- Reserved @private@ -- Get the default printer -- Get a list of printers and/or classes -- Add or modify a printer -- Delete a printer -- Get a list of classes @deprecated@ -- Add or modify a class -- Delete a class -- Accept new jobs on a printer -- Reject new jobs on a printer -- Set the default printer -- Get a list of supported devices -- Get a list of supported drivers -- Move a job to a different printer -- Authenticate a job @since CUPS 1.2/OS X 10.5@ -- Get a PPD file @since CUPS 1.3/OS X 10.5@ -- Get a document file @since CUPS 1.4/OS X 10.6@ -- Legacy names subtype ipp_op_t is ipp_op_e; --*** Orientation values *** subtype ipp_orient_e is unsigned; IPP_ORIENT_PORTRAIT : constant ipp_orient_e := 3; IPP_ORIENT_LANDSCAPE : constant ipp_orient_e := 4; IPP_ORIENT_REVERSE_LANDSCAPE : constant ipp_orient_e := 5; IPP_ORIENT_REVERSE_PORTRAIT : constant ipp_orient_e := 6; IPP_ORIENT_NONE : constant ipp_orient_e := 7; -- cups/ipp.h:424 -- No rotation -- 90 degrees counter-clockwise -- 90 degrees clockwise -- 180 degrees -- No rotation subtype ipp_orient_t is ipp_orient_e; --*** Printer states *** subtype ipp_pstate_e is unsigned; IPP_PSTATE_IDLE : constant ipp_pstate_e := 3; IPP_PSTATE_PROCESSING : constant ipp_pstate_e := 4; IPP_PSTATE_STOPPED : constant ipp_pstate_e := 5; -- cups/ipp.h:440 -- Printer is idle -- Printer is working -- Printer is stopped subtype ipp_pstate_t is ipp_pstate_e; --*** Qualities *** subtype ipp_quality_e is unsigned; IPP_QUALITY_DRAFT : constant ipp_quality_e := 3; IPP_QUALITY_NORMAL : constant ipp_quality_e := 4; IPP_QUALITY_HIGH : constant ipp_quality_e := 5; -- cups/ipp.h:453 -- Draft quality -- Normal quality -- High quality subtype ipp_quality_t is ipp_quality_e; --*** Resolution units *** subtype ipp_res_e is unsigned; IPP_RES_PER_INCH : constant ipp_res_e := 3; IPP_RES_PER_CM : constant ipp_res_e := 4; -- cups/ipp.h:460 -- Pixels per inch -- Pixels per centimeter subtype ipp_res_t is ipp_res_e; --*** IPP states *** subtype ipp_state_e is unsigned; IPP_STATE_ERROR : constant ipp_state_e := -1; IPP_STATE_IDLE : constant ipp_state_e := 0; IPP_STATE_HEADER : constant ipp_state_e := 1; IPP_STATE_ATTRIBUTE : constant ipp_state_e := 2; IPP_STATE_DATA : constant ipp_state_e := 3; -- cups/ipp.h:466 -- An error occurred -- Nothing is happening/request completed -- The request header needs to be sent/received -- One or more attributes need to be sent/received -- IPP request data needs to be sent/received subtype ipp_state_t is ipp_state_e; --*** IPP status codes *** subtype ipp_status_e is unsigned; IPP_STATUS_CUPS_INVALID : constant ipp_status_e := -1; IPP_STATUS_OK : constant ipp_status_e := 0; IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED : constant ipp_status_e := 1; IPP_STATUS_OK_CONFLICTING : constant ipp_status_e := 2; IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS : constant ipp_status_e := 3; IPP_STATUS_OK_IGNORED_NOTIFICATIONS : constant ipp_status_e := 4; IPP_STATUS_OK_TOO_MANY_EVENTS : constant ipp_status_e := 5; IPP_STATUS_OK_BUT_CANCEL_SUBSCRIPTION : constant ipp_status_e := 6; IPP_STATUS_OK_EVENTS_COMPLETE : constant ipp_status_e := 7; IPP_STATUS_REDIRECTION_OTHER_SITE : constant ipp_status_e := 512; IPP_STATUS_CUPS_SEE_OTHER : constant ipp_status_e := 640; IPP_STATUS_ERROR_BAD_REQUEST : constant ipp_status_e := 1024; IPP_STATUS_ERROR_FORBIDDEN : constant ipp_status_e := 1025; IPP_STATUS_ERROR_NOT_AUTHENTICATED : constant ipp_status_e := 1026; IPP_STATUS_ERROR_NOT_AUTHORIZED : constant ipp_status_e := 1027; IPP_STATUS_ERROR_NOT_POSSIBLE : constant ipp_status_e := 1028; IPP_STATUS_ERROR_TIMEOUT : constant ipp_status_e := 1029; IPP_STATUS_ERROR_NOT_FOUND : constant ipp_status_e := 1030; IPP_STATUS_ERROR_GONE : constant ipp_status_e := 1031; IPP_STATUS_ERROR_REQUEST_ENTITY : constant ipp_status_e := 1032; IPP_STATUS_ERROR_REQUEST_VALUE : constant ipp_status_e := 1033; IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED : constant ipp_status_e := 1034; IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES : constant ipp_status_e := 1035; IPP_STATUS_ERROR_URI_SCHEME : constant ipp_status_e := 1036; IPP_STATUS_ERROR_CHARSET : constant ipp_status_e := 1037; IPP_STATUS_ERROR_CONFLICTING : constant ipp_status_e := 1038; IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED : constant ipp_status_e := 1039; IPP_STATUS_ERROR_COMPRESSION_ERROR : constant ipp_status_e := 1040; IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR : constant ipp_status_e := 1041; IPP_STATUS_ERROR_DOCUMENT_ACCESS : constant ipp_status_e := 1042; IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE : constant ipp_status_e := 1043; IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS : constant ipp_status_e := 1044; IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS : constant ipp_status_e := 1045; IPP_STATUS_ERROR_IGNORED_ALL_NOTIFICATIONS : constant ipp_status_e := 1046; IPP_STATUS_ERROR_PRINT_SUPPORT_FILE_NOT_FOUND : constant ipp_status_e := 1047; IPP_STATUS_ERROR_DOCUMENT_PASSWORD : constant ipp_status_e := 1048; IPP_STATUS_ERROR_DOCUMENT_PERMISSION : constant ipp_status_e := 1049; IPP_STATUS_ERROR_DOCUMENT_SECURITY : constant ipp_status_e := 1050; IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE : constant ipp_status_e := 1051; IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED : constant ipp_status_e := 1052; IPP_STATUS_ERROR_ACCOUNT_CLOSED : constant ipp_status_e := 1053; IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED : constant ipp_status_e := 1054; IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED : constant ipp_status_e := 1055; IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED : constant ipp_status_e := 1180; IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED : constant ipp_status_e := 1181; IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED : constant ipp_status_e := 1182; IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED : constant ipp_status_e := 1183; IPP_STATUS_ERROR_INTERNAL : constant ipp_status_e := 1280; IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED : constant ipp_status_e := 1281; IPP_STATUS_ERROR_SERVICE_UNAVAILABLE : constant ipp_status_e := 1282; IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED : constant ipp_status_e := 1283; IPP_STATUS_ERROR_DEVICE : constant ipp_status_e := 1284; IPP_STATUS_ERROR_TEMPORARY : constant ipp_status_e := 1285; IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS : constant ipp_status_e := 1286; IPP_STATUS_ERROR_BUSY : constant ipp_status_e := 1287; IPP_STATUS_ERROR_JOB_CANCELED : constant ipp_status_e := 1288; IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED : constant ipp_status_e := 1289; IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED : constant ipp_status_e := 1290; IPP_STATUS_ERROR_TOO_MANY_JOBS : constant ipp_status_e := 1291; IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS : constant ipp_status_e := 1292; IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED : constant ipp_status_e := 4096; IPP_STATUS_ERROR_CUPS_PKI : constant ipp_status_e := 4097; IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED : constant ipp_status_e := 4098; -- cups/ipp.h:483 -- Invalid status name for @link ippErrorValue@ -- successful-ok -- successful-ok-ignored-or-substituted-attributes -- successful-ok-conflicting-attributes -- successful-ok-ignored-subscriptions -- successful-ok-ignored-notifications @private@ -- successful-ok-too-many-events -- successful-ok-but-cancel-subscription @private@ -- successful-ok-events-complete -- redirection-other-site @private@ -- cups-see-other -- client-error-bad-request -- client-error-forbidden -- client-error-not-authenticated -- client-error-not-authorized -- client-error-not-possible -- client-error-timeout -- client-error-not-found -- client-error-gone -- client-error-request-entity-too-large -- client-error-request-value-too-long -- client-error-document-format-not-supported -- client-error-attributes-or-values-not-supported -- client-error-uri-scheme-not-supported -- client-error-charset-not-supported -- client-error-conflicting-attributes -- client-error-compression-not-supported -- client-error-compression-error -- client-error-document-format-error -- client-error-document-access-error -- client-error-attributes-not-settable -- client-error-ignored-all-subscriptions -- client-error-too-many-subscriptions -- client-error-ignored-all-notifications @private@ -- client-error-print-support-file-not-found @private@ -- client-error-document-password-error -- client-error-document-permission-error -- client-error-document-security-error -- client-error-document-unprintable-error -- client-error-account-info-needed -- client-error-account-closed -- client-error-account-limit-reached -- client-error-account-authorization-failed -- Legacy status codes for paid printing -- cups-error-account-info-needed @deprecated@ -- cups-error-account-closed @deprecate@ -- cups-error-account-limit-reached @deprecated@ -- cups-error-account-authorization-failed @deprecated@ -- server-error-internal-error -- server-error-operation-not-supported -- server-error-service-unavailable -- server-error-version-not-supported -- server-error-device-error -- server-error-temporary-error -- server-error-not-accepting-jobs -- server-error-busy -- server-error-job-canceled -- server-error-multiple-document-jobs-not-supported -- server-error-printer-is-deactivated -- server-error-too-many-jobs -- server-error-too-many-documents -- These are internal and never sent over the wire... -- cups-authentication-canceled - Authentication canceled by user @since CUPS 1.5/OS X 10.7@ -- cups-pki-error - Error negotiating a secure connection @since CUPS 1.5/OS X 10.7@ -- cups-upgrade-required - TLS upgrade required -- Legacy name for canceled status subtype ipp_status_t is ipp_status_e; --*** Format tags for attributes *** subtype ipp_tag_e is unsigned; IPP_TAG_CUPS_INVALID : constant ipp_tag_e := -1; IPP_TAG_ZERO : constant ipp_tag_e := 0; IPP_TAG_OPERATION : constant ipp_tag_e := 1; IPP_TAG_JOB : constant ipp_tag_e := 2; IPP_TAG_END : constant ipp_tag_e := 3; IPP_TAG_PRINTER : constant ipp_tag_e := 4; IPP_TAG_UNSUPPORTED_GROUP : constant ipp_tag_e := 5; IPP_TAG_SUBSCRIPTION : constant ipp_tag_e := 6; IPP_TAG_EVENT_NOTIFICATION : constant ipp_tag_e := 7; IPP_TAG_RESOURCE : constant ipp_tag_e := 8; IPP_TAG_DOCUMENT : constant ipp_tag_e := 9; IPP_TAG_UNSUPPORTED_VALUE : constant ipp_tag_e := 16; IPP_TAG_DEFAULT : constant ipp_tag_e := 17; IPP_TAG_UNKNOWN : constant ipp_tag_e := 18; IPP_TAG_NOVALUE : constant ipp_tag_e := 19; IPP_TAG_NOTSETTABLE : constant ipp_tag_e := 21; IPP_TAG_DELETEATTR : constant ipp_tag_e := 22; IPP_TAG_ADMINDEFINE : constant ipp_tag_e := 23; IPP_TAG_INTEGER : constant ipp_tag_e := 33; IPP_TAG_BOOLEAN : constant ipp_tag_e := 34; IPP_TAG_ENUM : constant ipp_tag_e := 35; IPP_TAG_STRING : constant ipp_tag_e := 48; IPP_TAG_DATE : constant ipp_tag_e := 49; IPP_TAG_RESOLUTION : constant ipp_tag_e := 50; IPP_TAG_RANGE : constant ipp_tag_e := 51; IPP_TAG_BEGIN_COLLECTION : constant ipp_tag_e := 52; IPP_TAG_TEXTLANG : constant ipp_tag_e := 53; IPP_TAG_NAMELANG : constant ipp_tag_e := 54; IPP_TAG_END_COLLECTION : constant ipp_tag_e := 55; IPP_TAG_TEXT : constant ipp_tag_e := 65; IPP_TAG_NAME : constant ipp_tag_e := 66; IPP_TAG_RESERVED_STRING : constant ipp_tag_e := 67; IPP_TAG_KEYWORD : constant ipp_tag_e := 68; IPP_TAG_URI : constant ipp_tag_e := 69; IPP_TAG_URISCHEME : constant ipp_tag_e := 70; IPP_TAG_CHARSET : constant ipp_tag_e := 71; IPP_TAG_LANGUAGE : constant ipp_tag_e := 72; IPP_TAG_MIMETYPE : constant ipp_tag_e := 73; IPP_TAG_MEMBERNAME : constant ipp_tag_e := 74; IPP_TAG_EXTENSION : constant ipp_tag_e := 127; IPP_TAG_CUPS_MASK : constant ipp_tag_e := 2147483647; IPP_TAG_CUPS_CONST : constant ipp_tag_e := -2147483648; -- cups/ipp.h:633 -- Invalid tag name for @link ippTagValue@ -- Zero tag - used for separators -- Operation group -- Job group -- End-of-attributes -- Printer group -- Unsupported attributes group -- Subscription group -- Event group -- Resource group @private@ -- Document group -- Unsupported value -- Default value -- Unknown value -- No-value value -- Not-settable value -- Delete-attribute value -- Admin-defined value -- Integer value -- Boolean value -- Enumeration value -- Octet string value -- Date/time value -- Resolution value -- Range value -- Beginning of collection value -- Text-with-language value -- Name-with-language value -- End of collection value -- Text value -- Name value -- Reserved for future string value @private@ -- Keyword value -- URI value -- URI scheme value -- Character set value -- Language value -- MIME media type value -- Collection member name value -- Extension point for 32-bit tags -- Mask for copied attribute values @private@ -- The following expression is used to avoid compiler warnings with +/-0x80000000 -- Bitflag for copied/const attribute values @private@ subtype ipp_tag_t is ipp_tag_e; --*** Unsigned 8-bit integer/character *** subtype ipp_uchar_t is unsigned_char; -- cups/ipp.h:685 --*** IPP request/response data *** -- skipped empty struct u_ipp_s -- skipped empty struct ipp_t -- skipped empty struct u_ipp_attribute_s -- skipped empty struct ipp_attribute_t --*** IPP attribute *** --*** New in CUPS 1.2/OS X 10.5 *** type ipp_iocb_t is access function (arg1 : System.Address; arg2 : access ipp_uchar_t; arg3 : size_t) return size_t; pragma Convention (C, ipp_iocb_t); -- cups/ipp.h:691 --*** IPP IO Callback Function @since CUPS 1.2/OS X 10.5@ *** --*** New in CUPS 1.6/OS X 10.8 *** type ipp_copycb_t is access function (arg1 : System.Address; arg2 : System.Address; arg3 : System.Address) return int; pragma Convention (C, ipp_copycb_t); -- cups/ipp.h:695 -- * The following structures are PRIVATE starting with CUPS 1.6/OS X 10.8. -- * Please use the new accessor functions available in CUPS 1.6 and later, as -- * these definitions will be moved to a private header file in a future release. -- * -- * Define _IPP_PRIVATE_STRUCTURES to 1 to cause the private IPP structures to be -- * exposed in CUPS 1.6. This happens automatically on OS X when compiling for -- * a deployment target of 10.7 or earlier. -- * -- * Define _IPP_PRIVATE_STRUCTURES to 0 to prevent the private IPP structures -- * from being exposed. This is useful when migrating existing code to the new -- * accessors. -- -- Somebody has overridden the value -- Building CUPS -- Building for 10.7 and earlier -- Building for 10.7 and earlier --*** Request Header *** -- Any Header -- Protocol version number -- Operation ID or status code -- Request ID -- Operation Header -- Protocol version number -- Operation ID -- Request ID -- Status Header -- Protocol version number -- Status code -- Request ID --*** New in CUPS 1.1.19 *** -- Event Header @since CUPS 1.1.19/OS X 10.3@ -- Protocol version number -- Status code -- Request ID --*** New in CUPS 1.1.19 *** --*** Attribute Value *** -- Integer/enumerated value -- Boolean value -- Date/time value -- Horizontal resolution -- Vertical resolution -- Resolution units -- Resolution value -- Lower value -- Upper value -- Range of integers value -- Language code -- String -- String with language value -- Length of attribute -- Data in attribute -- Unknown attribute type --*** New in CUPS 1.1.19 *** -- Collection value @since CUPS 1.1.19/OS X 10.3@ --*** Convenience typedef that will be removed @private@ *** --*** Attribute *** -- Next attribute in list -- Job/Printer/Operation group tag -- What type of value is it? -- Name of attribute -- Number of values -- Values --*** IPP Request/Response/Notification *** -- State of request -- Request header -- Attributes -- Last attribute in list -- Current attribute (for read/write) -- Current attribute group tag --*** New in CUPS 1.2 *** -- Previous attribute (for read) @since CUPS 1.2/OS X 10.5@ --*** New in CUPS 1.4.4 *** -- Use count @since CUPS 1.4.4/OS X 10.6.?@ --*** New in CUPS 2.0 *** -- At end of list? -- Current attribute index for hierarchical search -- * Prototypes... -- function ippAddBoolean (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; value : char) return System.Address; -- cups/ipp.h:837 pragma Import (C, ippAddBoolean, "ippAddBoolean"); function ippAddBooleans (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; num_values : int; values : Interfaces.C.Strings.chars_ptr) return System.Address; -- cups/ipp.h:839 pragma Import (C, ippAddBooleans, "ippAddBooleans"); function ippAddDate (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; value : access ipp_uchar_t) return System.Address; -- cups/ipp.h:842 pragma Import (C, ippAddDate, "ippAddDate"); function ippAddInteger (ipp : System.Address; group : ipp_tag_t; value_tag : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; value : int) return System.Address; -- cups/ipp.h:844 pragma Import (C, ippAddInteger, "ippAddInteger"); function ippAddIntegers (ipp : System.Address; group : ipp_tag_t; value_tag : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; num_values : int; values : access int) return System.Address; -- cups/ipp.h:847 pragma Import (C, ippAddIntegers, "ippAddIntegers"); function ippAddRange (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; lower : int; upper : int) return System.Address; -- cups/ipp.h:850 pragma Import (C, ippAddRange, "ippAddRange"); function ippAddRanges (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; num_values : int; lower : access int; upper : access int) return System.Address; -- cups/ipp.h:852 pragma Import (C, ippAddRanges, "ippAddRanges"); function ippAddResolution (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; units : ipp_res_t; xres : int; yres : int) return System.Address; -- cups/ipp.h:855 pragma Import (C, ippAddResolution, "ippAddResolution"); function ippAddResolutions (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; num_values : int; units : ipp_res_t; xres : access int; yres : access int) return System.Address; -- cups/ipp.h:858 pragma Import (C, ippAddResolutions, "ippAddResolutions"); function ippAddSeparator (ipp : System.Address) return System.Address; -- cups/ipp.h:862 pragma Import (C, ippAddSeparator, "ippAddSeparator"); function ippAddString (ipp : System.Address; group : ipp_tag_t; value_tag : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; language : Interfaces.C.Strings.chars_ptr; value : Interfaces.C.Strings.chars_ptr) return System.Address; -- cups/ipp.h:863 pragma Import (C, ippAddString, "ippAddString"); function ippAddStrings (ipp : System.Address; group : ipp_tag_t; value_tag : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; num_values : int; language : Interfaces.C.Strings.chars_ptr; values : System.Address) return System.Address; -- cups/ipp.h:866 pragma Import (C, ippAddStrings, "ippAddStrings"); function ippDateToTime (date : access ipp_uchar_t) return CUPS.time_h.time_t; -- cups/ipp.h:870 pragma Import (C, ippDateToTime, "ippDateToTime"); procedure ippDelete (ipp : System.Address); -- cups/ipp.h:871 pragma Import (C, ippDelete, "ippDelete"); function ippErrorString (error : ipp_status_t) return Interfaces.C.Strings.chars_ptr; -- cups/ipp.h:872 pragma Import (C, ippErrorString, "ippErrorString"); function ippFindAttribute (ipp : System.Address; name : Interfaces.C.Strings.chars_ptr; value_tag : ipp_tag_t) return System.Address; -- cups/ipp.h:873 pragma Import (C, ippFindAttribute, "ippFindAttribute"); function ippFindNextAttribute (ipp : System.Address; name : Interfaces.C.Strings.chars_ptr; value_tag : ipp_tag_t) return System.Address; -- cups/ipp.h:875 pragma Import (C, ippFindNextAttribute, "ippFindNextAttribute"); function ippLength (ipp : System.Address) return size_t; -- cups/ipp.h:877 pragma Import (C, ippLength, "ippLength"); function ippNew return System.Address; -- cups/ipp.h:878 pragma Import (C, ippNew, "ippNew"); function ippRead (http : System.Address; ipp : System.Address) return ipp_state_t; -- cups/ipp.h:879 pragma Import (C, ippRead, "ippRead"); function ippTimeToDate (t : CUPS.time_h.time_t) return access ipp_uchar_t; -- cups/ipp.h:880 pragma Import (C, ippTimeToDate, "ippTimeToDate"); function ippWrite (http : System.Address; ipp : System.Address) return ipp_state_t; -- cups/ipp.h:881 pragma Import (C, ippWrite, "ippWrite"); function ippPort return int; -- cups/ipp.h:882 pragma Import (C, ippPort, "ippPort"); procedure ippSetPort (p : int); -- cups/ipp.h:883 pragma Import (C, ippSetPort, "ippSetPort"); --*** New in CUPS 1.1.19 *** function ippAddCollection (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; value : System.Address) return System.Address; -- cups/ipp.h:886 pragma Import (C, ippAddCollection, "ippAddCollection"); function ippAddCollections (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; num_values : int; values : System.Address) return System.Address; -- cups/ipp.h:888 pragma Import (C, ippAddCollections, "ippAddCollections"); procedure ippDeleteAttribute (ipp : System.Address; attr : System.Address); -- cups/ipp.h:891 pragma Import (C, ippDeleteAttribute, "ippDeleteAttribute"); function ippReadFile (fd : int; ipp : System.Address) return ipp_state_t; -- cups/ipp.h:892 pragma Import (C, ippReadFile, "ippReadFile"); function ippWriteFile (fd : int; ipp : System.Address) return ipp_state_t; -- cups/ipp.h:893 pragma Import (C, ippWriteFile, "ippWriteFile"); --*** New in CUPS 1.2/OS X 10.5 *** function ippAddOctetString (ipp : System.Address; group : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; data : System.Address; datalen : int) return System.Address; -- cups/ipp.h:896 pragma Import (C, ippAddOctetString, "ippAddOctetString"); function ippErrorValue (name : Interfaces.C.Strings.chars_ptr) return ipp_status_t; -- cups/ipp.h:899 pragma Import (C, ippErrorValue, "ippErrorValue"); function ippNewRequest (op : ipp_op_t) return System.Address; -- cups/ipp.h:900 pragma Import (C, ippNewRequest, "ippNewRequest"); function ippOpString (op : ipp_op_t) return Interfaces.C.Strings.chars_ptr; -- cups/ipp.h:901 pragma Import (C, ippOpString, "ippOpString"); function ippOpValue (name : Interfaces.C.Strings.chars_ptr) return ipp_op_t; -- cups/ipp.h:902 pragma Import (C, ippOpValue, "ippOpValue"); function ippReadIO (src : System.Address; cb : ipp_iocb_t; blocking : int; parent : System.Address; ipp : System.Address) return ipp_state_t; -- cups/ipp.h:903 pragma Import (C, ippReadIO, "ippReadIO"); function ippWriteIO (dst : System.Address; cb : ipp_iocb_t; blocking : int; parent : System.Address; ipp : System.Address) return ipp_state_t; -- cups/ipp.h:905 pragma Import (C, ippWriteIO, "ippWriteIO"); --*** New in CUPS 1.4/OS X 10.6 *** function ippTagString (tag : ipp_tag_t) return Interfaces.C.Strings.chars_ptr; -- cups/ipp.h:909 pragma Import (C, ippTagString, "ippTagString"); function ippTagValue (name : Interfaces.C.Strings.chars_ptr) return ipp_tag_t; -- cups/ipp.h:910 pragma Import (C, ippTagValue, "ippTagValue"); --*** New in CUPS 1.6/OS X 10.8 *** function ippAddOutOfBand (ipp : System.Address; group : ipp_tag_t; value_tag : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr) return System.Address; -- cups/ipp.h:913 pragma Import (C, ippAddOutOfBand, "ippAddOutOfBand"); function ippAttributeString (attr : System.Address; buffer : Interfaces.C.Strings.chars_ptr; bufsize : size_t) return size_t; -- cups/ipp.h:916 pragma Import (C, ippAttributeString, "ippAttributeString"); function ippCopyAttribute (dst : System.Address; attr : System.Address; quickcopy : int) return System.Address; -- cups/ipp.h:918 pragma Import (C, ippCopyAttribute, "ippCopyAttribute"); function ippCopyAttributes (dst : System.Address; src : System.Address; quickcopy : int; cb : ipp_copycb_t; context : System.Address) return int; -- cups/ipp.h:920 pragma Import (C, ippCopyAttributes, "ippCopyAttributes"); function ippDeleteValues (ipp : System.Address; attr : System.Address; element : int; count : int) return int; -- cups/ipp.h:923 pragma Import (C, ippDeleteValues, "ippDeleteValues"); function ippEnumString (attrname : Interfaces.C.Strings.chars_ptr; enumvalue : int) return Interfaces.C.Strings.chars_ptr; -- cups/ipp.h:925 pragma Import (C, ippEnumString, "ippEnumString"); function ippEnumValue (attrname : Interfaces.C.Strings.chars_ptr; enumstring : Interfaces.C.Strings.chars_ptr) return int; -- cups/ipp.h:927 pragma Import (C, ippEnumValue, "ippEnumValue"); function ippFirstAttribute (ipp : System.Address) return System.Address; -- cups/ipp.h:929 pragma Import (C, ippFirstAttribute, "ippFirstAttribute"); function ippGetBoolean (attr : System.Address; element : int) return int; -- cups/ipp.h:930 pragma Import (C, ippGetBoolean, "ippGetBoolean"); function ippGetCollection (attr : System.Address; element : int) return System.Address; -- cups/ipp.h:932 pragma Import (C, ippGetCollection, "ippGetCollection"); function ippGetCount (attr : System.Address) return int; -- cups/ipp.h:934 pragma Import (C, ippGetCount, "ippGetCount"); function ippGetDate (attr : System.Address; element : int) return access ipp_uchar_t; -- cups/ipp.h:935 pragma Import (C, ippGetDate, "ippGetDate"); function ippGetGroupTag (attr : System.Address) return ipp_tag_t; -- cups/ipp.h:937 pragma Import (C, ippGetGroupTag, "ippGetGroupTag"); function ippGetInteger (attr : System.Address; element : int) return int; -- cups/ipp.h:938 pragma Import (C, ippGetInteger, "ippGetInteger"); function ippGetName (attr : System.Address) return Interfaces.C.Strings.chars_ptr; -- cups/ipp.h:940 pragma Import (C, ippGetName, "ippGetName"); function ippGetOperation (ipp : System.Address) return ipp_op_t; -- cups/ipp.h:941 pragma Import (C, ippGetOperation, "ippGetOperation"); function ippGetRange (attr : System.Address; element : int; upper : access int) return int; -- cups/ipp.h:942 pragma Import (C, ippGetRange, "ippGetRange"); function ippGetRequestId (ipp : System.Address) return int; -- cups/ipp.h:944 pragma Import (C, ippGetRequestId, "ippGetRequestId"); function ippGetResolution (attr : System.Address; element : int; yres : access int; units : access ipp_res_t) return int; -- cups/ipp.h:945 pragma Import (C, ippGetResolution, "ippGetResolution"); function ippGetState (ipp : System.Address) return ipp_state_t; -- cups/ipp.h:948 pragma Import (C, ippGetState, "ippGetState"); function ippGetStatusCode (ipp : System.Address) return ipp_status_t; -- cups/ipp.h:949 pragma Import (C, ippGetStatusCode, "ippGetStatusCode"); function ippGetString (attr : System.Address; element : int; language : System.Address) return Interfaces.C.Strings.chars_ptr; -- cups/ipp.h:950 pragma Import (C, ippGetString, "ippGetString"); function ippGetValueTag (attr : System.Address) return ipp_tag_t; -- cups/ipp.h:952 pragma Import (C, ippGetValueTag, "ippGetValueTag"); function ippGetVersion (ipp : System.Address; minor : access int) return int; -- cups/ipp.h:953 pragma Import (C, ippGetVersion, "ippGetVersion"); function ippNextAttribute (ipp : System.Address) return System.Address; -- cups/ipp.h:954 pragma Import (C, ippNextAttribute, "ippNextAttribute"); function ippSetBoolean (ipp : System.Address; attr : System.Address; element : int; boolvalue : int) return int; -- cups/ipp.h:955 pragma Import (C, ippSetBoolean, "ippSetBoolean"); function ippSetCollection (ipp : System.Address; attr : System.Address; element : int; colvalue : System.Address) return int; -- cups/ipp.h:957 pragma Import (C, ippSetCollection, "ippSetCollection"); function ippSetDate (ipp : System.Address; attr : System.Address; element : int; datevalue : access ipp_uchar_t) return int; -- cups/ipp.h:960 pragma Import (C, ippSetDate, "ippSetDate"); function ippSetGroupTag (ipp : System.Address; attr : System.Address; group_tag : ipp_tag_t) return int; -- cups/ipp.h:963 pragma Import (C, ippSetGroupTag, "ippSetGroupTag"); function ippSetInteger (ipp : System.Address; attr : System.Address; element : int; intvalue : int) return int; -- cups/ipp.h:965 pragma Import (C, ippSetInteger, "ippSetInteger"); function ippSetName (ipp : System.Address; attr : System.Address; name : Interfaces.C.Strings.chars_ptr) return int; -- cups/ipp.h:967 pragma Import (C, ippSetName, "ippSetName"); function ippSetOperation (ipp : System.Address; op : ipp_op_t) return int; -- cups/ipp.h:969 pragma Import (C, ippSetOperation, "ippSetOperation"); function ippSetRange (ipp : System.Address; attr : System.Address; element : int; lowervalue : int; uppervalue : int) return int; -- cups/ipp.h:970 pragma Import (C, ippSetRange, "ippSetRange"); function ippSetRequestId (ipp : System.Address; request_id : int) return int; -- cups/ipp.h:973 pragma Import (C, ippSetRequestId, "ippSetRequestId"); function ippSetResolution (ipp : System.Address; attr : System.Address; element : int; unitsvalue : ipp_res_t; xresvalue : int; yresvalue : int) return int; -- cups/ipp.h:975 pragma Import (C, ippSetResolution, "ippSetResolution"); function ippSetState (ipp : System.Address; state : ipp_state_t) return int; -- cups/ipp.h:979 pragma Import (C, ippSetState, "ippSetState"); function ippSetStatusCode (ipp : System.Address; status : ipp_status_t) return int; -- cups/ipp.h:981 pragma Import (C, ippSetStatusCode, "ippSetStatusCode"); function ippSetString (ipp : System.Address; attr : System.Address; element : int; strvalue : Interfaces.C.Strings.chars_ptr) return int; -- cups/ipp.h:983 pragma Import (C, ippSetString, "ippSetString"); function ippSetValueTag (ipp : System.Address; attr : System.Address; value_tag : ipp_tag_t) return int; -- cups/ipp.h:986 pragma Import (C, ippSetValueTag, "ippSetValueTag"); function ippSetVersion (ipp : System.Address; major : int; minor : int) return int; -- cups/ipp.h:988 pragma Import (C, ippSetVersion, "ippSetVersion"); --*** New in CUPS 1.7 *** function ippAddStringf (ipp : System.Address; group : ipp_tag_t; value_tag : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; language : Interfaces.C.Strings.chars_ptr; format : Interfaces.C.Strings.chars_ptr -- , ... ) return System.Address; -- cups/ipp.h:992 pragma Import (C, ippAddStringf, "ippAddStringf"); function ippAddStringfv (ipp : System.Address; group : ipp_tag_t; value_tag : ipp_tag_t; name : Interfaces.C.Strings.chars_ptr; language : Interfaces.C.Strings.chars_ptr; format : Interfaces.C.Strings.chars_ptr; ap : access System.Address) return System.Address; -- cups/ipp.h:996 pragma Import (C, ippAddStringfv, "ippAddStringfv"); function ippContainsInteger (attr : System.Address; value : int) return int; -- cups/ipp.h:1001 pragma Import (C, ippContainsInteger, "ippContainsInteger"); function ippContainsString (attr : System.Address; value : Interfaces.C.Strings.chars_ptr) return int; -- cups/ipp.h:1003 pragma Import (C, ippContainsString, "ippContainsString"); function ippCreateRequestedArray (request : System.Address) return System.Address; -- cups/ipp.h:1005 pragma Import (C, ippCreateRequestedArray, "ippCreateRequestedArray"); function ippGetOctetString (attr : System.Address; element : int; datalen : access int) return System.Address; -- cups/ipp.h:1006 pragma Import (C, ippGetOctetString, "ippGetOctetString"); function ippNewResponse (request : System.Address) return System.Address; -- cups/ipp.h:1008 pragma Import (C, ippNewResponse, "ippNewResponse"); function ippSetOctetString (ipp : System.Address; attr : System.Address; element : int; data : System.Address; datalen : int) return int; -- cups/ipp.h:1009 pragma Import (C, ippSetOctetString, "ippSetOctetString"); function ippSetStringf (ipp : System.Address; attr : System.Address; element : int; format : Interfaces.C.Strings.chars_ptr -- , ... ) return int; -- cups/ipp.h:1012 pragma Import (C, ippSetStringf, "ippSetStringf"); function ippSetStringfv (ipp : System.Address; attr : System.Address; element : int; format : Interfaces.C.Strings.chars_ptr; ap : access System.Address) return int; -- cups/ipp.h:1015 pragma Import (C, ippSetStringfv, "ippSetStringfv"); function ippValidateAttribute (attr : System.Address) return int; -- cups/ipp.h:1018 pragma Import (C, ippValidateAttribute, "ippValidateAttribute"); function ippValidateAttributes (ipp : System.Address) return int; -- cups/ipp.h:1020 pragma Import (C, ippValidateAttributes, "ippValidateAttributes"); --*** New in CUPS 2.0 *** function ippStateString (state : ipp_state_t) return Interfaces.C.Strings.chars_ptr; -- cups/ipp.h:1024 pragma Import (C, ippStateString, "ippStateString"); -- * C++ magic... -- -- * "$Id: ipp.h 12666 2015-05-25 19:38:09Z msweet $" -- * -- * Internet Printing Protocol definitions for CUPS. -- * -- * Copyright 2007-2014 by Apple Inc. -- * Copyright 1997-2006 by Easy Software Products. -- * -- * These coded instructions, statements, and computer programs are the -- * property of Apple Inc. and are protected by Federal copyright -- * law. Distribution and use rights are outlined in the file "LICENSE.txt" -- * which should have been included with this file. If this file is -- * file is missing or damaged, see the license at "http://www.cups.org/". -- * -- * This file is subject to the Apple OS-Developed Software exception. -- end CUPS.cups_ipp_h;
Docs/MCB/MCB.g4
CoCo3-org/Retro.BASIC
0
7515
<reponame>CoCo3-org/Retro.BASIC grammar MCB; // ----- PARSER ----- program : line* EOF ; line : integerLiteral COLON* statement (COLON+ statement?)* CR ; statement : commentStatement | printStatement | assignmentStatement ; commentStatement : COMMENT_REM ; printStatement : PRINT | PRINT printCommaOrSemicolon* expression (printCommaOrSemicolon+ expression)* printCommaOrSemicolon* ; printCommaOrSemicolon : COMMA | SEMICOLON ; assignmentStatement : LET? assignmentTarget (OPENPAREN expression (COMMA expression)* CLOSEPAREN)? EQUALS expression ; assignmentTarget : varRef ; expression : varRef | integerLiteral | stringLiteral | hexLiteral | unaryExpression ; unaryExpression : notExpression | plusOrMinusExpression ; notExpression : NOT expression ; plusOrMinusExpression : (MINUS | PLUS) expression ; integerLiteral : INTLITERAL ; stringLiteral : STRING ; hexLiteral : HEXLITERAL ; varRef : VARID DOLLAR? ; // ----- LEXER ----- LET: 'LET'; PRINT: 'PRINT'; NOT: 'NOT'; COLON: ':'; COMMA: ','; SEMICOLON: ';'; PLUS: '+'; MINUS: '-'; DOLLAR: '$'; EQUALS: '='; OPENPAREN: '('; CLOSEPAREN: ')'; fragment DIGIT: '0'..'9'; fragment DIGITS: DIGIT+; INTLITERAL: DIGITS; fragment HEXPREFIX: '&H'; fragment HEXLETTER: 'A'..'F'; fragment HEXDIGITS: (HEXLETTER|DIGIT)+; HEXLITERAL: HEXPREFIX HEXDIGITS; fragment LETTER: 'A'..'Z'; VARID: LETTER (LETTER|DIGIT)*; STRING: '"' ~ ["\r\n]* '"'; COMMENT_REM: 'REM' ~ [\r\n]+; CR: [\r\n]+; WS: [ \t] -> skip;
Transynther/x86/_processed/NONE/_zr_xt_/i3-7100_9_0x84_notsx.log_21829_1998.asm
ljhsiun2/medusa
9
95535
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x100c8, %rsi lea addresses_D_ht+0x18091, %rdi nop nop nop and $13090, %rdx mov $70, %rcx rep movsl nop cmp $20499, %rbp lea addresses_normal_ht+0x1a361, %rsi lea addresses_D_ht+0x1b461, %rdi nop nop nop nop sub %r12, %r12 mov $50, %rcx rep movsw nop nop nop nop xor $12899, %rbp lea addresses_UC_ht+0x1b8a1, %rsi lea addresses_WT_ht+0x5649, %rdi clflush (%rsi) nop nop nop nop sub %r11, %r11 mov $119, %rcx rep movsb nop nop add $33760, %r12 lea addresses_WT_ht+0xb261, %rbp nop nop nop nop xor $47797, %rdi movl $0x61626364, (%rbp) nop nop and %rsi, %rsi lea addresses_D_ht+0x17fe5, %rsi lea addresses_WC_ht+0xa3e1, %rdi nop nop nop add $48258, %r9 mov $20, %rcx rep movsl nop nop xor %r9, %r9 lea addresses_WT_ht+0x12ca, %rsi nop nop nop nop nop xor %r9, %r9 movb $0x61, (%rsi) nop nop nop nop xor $15620, %rdx lea addresses_normal_ht+0x5f11, %rdx and %rsi, %rsi vmovups (%rdx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %r12 nop nop nop nop and %r12, %r12 lea addresses_WC_ht+0x6ae1, %rdi and $24017, %rcx mov (%rdi), %r9d nop nop nop xor %r11, %r11 lea addresses_D_ht+0xdc61, %rsi lea addresses_UC_ht+0x7261, %rdi nop xor %rbp, %rbp mov $79, %rcx rep movsw inc %r11 lea addresses_A_ht+0xe9c1, %rsi lea addresses_WT_ht+0xf6e1, %rdi nop nop nop nop nop inc %r11 mov $112, %rcx rep movsl nop nop nop nop cmp %rdi, %rdi lea addresses_WC_ht+0x4761, %r9 nop add $41204, %rdx mov $0x6162636465666768, %rcx movq %rcx, %xmm1 vmovups %ymm1, (%r9) nop nop nop nop sub %rsi, %rsi lea addresses_WT_ht+0xbc61, %r12 nop nop nop nop xor %rcx, %rcx movb (%r12), %r9b sub $11481, %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r15 push %rcx push %rdx push %rsi // Store lea addresses_D+0x18d61, %rsi nop add %rcx, %rcx mov $0x5152535455565758, %r15 movq %r15, (%rsi) inc %r10 // Store lea addresses_WT+0xd881, %r11 clflush (%r11) add $40617, %r12 movb $0x51, (%r11) nop nop add %r10, %r10 // Store lea addresses_A+0xf7e1, %r11 nop nop inc %r10 movw $0x5152, (%r11) nop nop and %r11, %r11 // Store lea addresses_WC+0xcb61, %rsi xor %r11, %r11 movl $0x51525354, (%rsi) nop nop add %rsi, %rsi // Faulty Load lea addresses_A+0x17d61, %rsi nop nop and $46461, %r12 mov (%rsi), %r15w lea oracles, %r11 and $0xff, %r15 shlq $12, %r15 mov (%r11,%r15,1), %r15 pop %rsi pop %rdx pop %rcx pop %r15 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 4, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 1, '35': 21828} 00 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
internal/well-typed-quoted-syntax.agda
JasonGross/lob
19
15186
<reponame>JasonGross/lob<filename>internal/well-typed-quoted-syntax.agda {-# OPTIONS --without-K #-} module well-typed-quoted-syntax where open import common open import well-typed-syntax open import well-typed-syntax-helpers public open import well-typed-quoted-syntax-defs public open import well-typed-syntax-context-helpers public open import well-typed-syntax-eq-dec public infixr 2 _‘‘∘’’_ quote-sigma : (Γv : Σ Context Typ) → Term {ε} (‘Σ’ ‘Context’ ‘Typ’) quote-sigma (Γ , v) = ‘existT’ ⌜ Γ ⌝c ⌜ v ⌝T _‘‘∘’’_ : ∀ {A B C} → □ (‘□’ ‘’ (C ‘‘→'’’ B)) → □ (‘□’ ‘’ (A ‘‘→'’’ C)) → □ (‘□’ ‘’ (A ‘‘→'’’ B)) g ‘‘∘’’ f = (‘‘fcomp-nd’’ ‘'’ₐ f ‘'’ₐ g) Conv0 : ∀ {qH0 qX} → Term {Γ = (ε ▻ ‘□’ ‘’ qH0)} (W (‘□’ ‘’ ⌜ ‘□’ ‘’ qH0 ‘→'’ qX ⌝T)) → Term {Γ = (ε ▻ ‘□’ ‘’ qH0)} (W (‘□’ ‘’ (⌜ ‘□’ ‘’ qH0 ⌝T ‘‘→'’’ ⌜ qX ⌝T))) Conv0 {qH0} {qX} x = w→ ⌜→'⌝ ‘'’ₐ x
source/containers/a-cndlli.ads
ytomino/drake
33
4921
pragma License (Unrestricted); -- implementation unit with System; package Ada.Containers.Naked_Doubly_Linked_Lists is pragma Preelaborate; Node_Size : constant := Standard'Address_Size * 2; type Node is limited private; type Node_Access is access Node; function Next (Position : not null Node_Access) return Node_Access with Convention => Intrinsic; function Previous (Position : not null Node_Access) return Node_Access with Convention => Intrinsic; pragma Inline_Always (Next); pragma Inline_Always (Previous); -- traversing procedure Iterate ( First : Node_Access; Process : not null access procedure (Position : not null Node_Access)); procedure Reverse_Iterate ( Last : Node_Access; Process : not null access procedure (Position : not null Node_Access)); -- liner search function Find ( First : Node_Access; Params : System.Address; Equivalent : not null access function ( Right : not null Node_Access; Params : System.Address) return Boolean) return Node_Access; function Reverse_Find ( Last : Node_Access; Params : System.Address; Equivalent : not null access function ( Right : not null Node_Access; Params : System.Address) return Boolean) return Node_Access; function Is_Before (Before, After : Node_Access) return Boolean; -- comparison function Equivalent ( Left_Last, Right_Last : Node_Access; Equivalent : not null access function ( Left, Right : not null Node_Access) return Boolean) return Boolean; -- management procedure Free ( First : in out Node_Access; Last : in out Node_Access; Length : in out Count_Type; Free : not null access procedure (Object : in out Node_Access)); procedure Insert ( First : in out Node_Access; Last : in out Node_Access; Length : in out Count_Type; Before : Node_Access; New_Item : not null Node_Access); procedure Remove ( First : in out Node_Access; Last : in out Node_Access; Length : in out Count_Type; Position : not null Node_Access; Next : Node_Access); procedure Swap_Links ( First : in out Node_Access; Last : in out Node_Access; I, J : not null Node_Access); procedure Splice ( Target_First : in out Node_Access; Target_Last : in out Node_Access; Length : in out Count_Type; Before : Node_Access; Source_First : in out Node_Access; Source_Last : in out Node_Access; Source_Length : in out Count_Type); procedure Split ( Target_First : out Node_Access; Target_Last : out Node_Access; Length : out Count_Type; Source_First : in out Node_Access; Source_Last : in out Node_Access; Source_Length : in out Count_Type; Count : Count_Type); procedure Copy ( Target_First : out Node_Access; Target_Last : out Node_Access; Length : out Count_Type; Source_Last : Node_Access; Copy : not null access procedure ( Target : out Node_Access; Source : not null Node_Access)); procedure Reverse_Elements ( Target_First : in out Node_Access; Target_Last : in out Node_Access; Length : in out Count_Type); -- sorting function Is_Sorted ( Last : Node_Access; LT : not null access function ( Left, Right : not null Node_Access) return Boolean) return Boolean; procedure Merge ( Target_First : in out Node_Access; Target_Last : in out Node_Access; Length : in out Count_Type; Source_First : in out Node_Access; Source_Last : in out Node_Access; Source_Length : in out Count_Type; LT : not null access function ( Left, Right : not null Node_Access) return Boolean); procedure Merge_Sort ( Target_First : in out Node_Access; Target_Last : in out Node_Access; Length : in out Count_Type; LT : not null access function ( Left, Right : not null Node_Access) return Boolean); private type Node is limited record Previous : Node_Access := null; Next : Node_Access := null; end record; for Node'Size use Node_Size; end Ada.Containers.Naked_Doubly_Linked_Lists;
extern/gnat_sdl/gnat_sdl2/src/sdl_version_h.ads
AdaCore/training_material
15
13066
<filename>extern/gnat_sdl/gnat_sdl2/src/sdl_version_h.ads pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with SDL_stdinc_h; with Interfaces.C.Strings; package SDL_version_h is SDL_MAJOR_VERSION : constant := 2; -- ..\SDL2_tmp\SDL_version.h:60 SDL_MINOR_VERSION : constant := 0; -- ..\SDL2_tmp\SDL_version.h:61 SDL_PATCHLEVEL : constant := 9; -- ..\SDL2_tmp\SDL_version.h:62 -- arg-macro: procedure SDL_VERSION (x) -- { (x).major := SDL_MAJOR_VERSION; (x).minor := SDL_MINOR_VERSION; (x).patch := SDL_PATCHLEVEL; } -- arg-macro: function SDL_VERSIONNUM (X, Y, Z) -- return (X)*1000 + (Y)*100 + (Z); -- unsupported macro: SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) -- arg-macro: function SDL_VERSION_ATLEAST (X, Y, Z) -- return SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z); -- Simple DirectMedia Layer -- Copyright (C) 1997-2018 <NAME> <<EMAIL>> -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- 3. This notice may not be removed or altered from any source distribution. -- --* -- * \file SDL_version.h -- * -- * This header defines the current SDL version. -- -- Set up for C function definitions, even when using C++ --* -- * \brief Information the version of SDL in use. -- * -- * Represents the library's version as three levels: major revision -- * (increments with massive changes, additions, and enhancements), -- * minor revision (increments with backwards-compatible changes to the -- * major revision), and patchlevel (increments with fixes to the minor -- * revision). -- * -- * \sa SDL_VERSION -- * \sa SDL_GetVersion -- --*< major version type SDL_version is record major : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_version.h:53 minor : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_version.h:54 patch : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_version.h:55 end record; pragma Convention (C_Pass_By_Copy, SDL_version); -- ..\SDL2_tmp\SDL_version.h:51 --*< minor version --*< update version -- Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -- --* -- * \brief Macro to determine SDL version program was compiled against. -- * -- * This macro fills in a SDL_version structure with the version of the -- * library you compiled against. This is determined by what header the -- * compiler uses. Note that if you dynamically linked the library, you might -- * have a slightly newer or older version at runtime. That version can be -- * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), -- * is not a macro. -- * -- * \param x A pointer to a SDL_version struct to initialize. -- * -- * \sa SDL_version -- * \sa SDL_GetVersion -- --* -- * This macro turns the version numbers into a numeric value: -- * \verbatim -- (1,2,3) -> (1203) -- \endverbatim -- * -- * This assumes that there will never be more than 100 patchlevels. -- --* -- * This is the version number macro for the current SDL version. -- --* -- * This macro will evaluate to true if compiled with SDL at least X.Y.Z. -- --* -- * \brief Get the version of SDL that is linked against your program. -- * -- * If you are linking to SDL dynamically, then it is possible that the -- * current version will be different than the version you compiled against. -- * This function returns the current version, while SDL_VERSION() is a -- * macro that tells you what version you compiled with. -- * -- * \code -- * SDL_version compiled; -- * SDL_version linked; -- * -- * SDL_VERSION(&compiled); -- * SDL_GetVersion(&linked); -- * printf("We compiled against SDL version %d.%d.%d ...\n", -- * compiled.major, compiled.minor, compiled.patch); -- * printf("But we linked against SDL version %d.%d.%d.\n", -- * linked.major, linked.minor, linked.patch); -- * \endcode -- * -- * This function may be called safely at any time, even before SDL_Init(). -- * -- * \sa SDL_VERSION -- procedure SDL_GetVersion (ver : access SDL_version); -- ..\SDL2_tmp\SDL_version.h:133 pragma Import (C, SDL_GetVersion, "SDL_GetVersion"); --* -- * \brief Get the code revision of SDL that is linked against your program. -- * -- * Returns an arbitrary string (a hash value) uniquely identifying the -- * exact revision of the SDL library in use, and is only useful in comparing -- * against other revisions. It is NOT an incrementing number. -- function SDL_GetRevision return Interfaces.C.Strings.chars_ptr; -- ..\SDL2_tmp\SDL_version.h:142 pragma Import (C, SDL_GetRevision, "SDL_GetRevision"); --* -- * \brief Get the revision number of SDL that is linked against your program. -- * -- * Returns a number uniquely identifying the exact revision of the SDL -- * library in use. It is an incrementing number based on commits to -- * hg.libsdl.org. -- function SDL_GetRevisionNumber return int; -- ..\SDL2_tmp\SDL_version.h:151 pragma Import (C, SDL_GetRevisionNumber, "SDL_GetRevisionNumber"); -- Ends C function definitions when using C++ -- vi: set ts=4 sw=4 expandtab: end SDL_version_h;
Core/compiler/src/main/resources/BringIOSSimulatorToFront.scpt
bugvm/robovm
29
1040
<reponame>bugvm/robovm #!/usr/bin/osascript on run argv repeat 30 times try if application "Simulator" is running then tell application "System Events" to set frontmost of process "Simulator" to true end if if application "iOS Simulator" is running then tell application "System Events" to set frontmost of process "iOS Simulator" to true end if exit repeat on error msg log "BringIOSSimulatorToFront: Failed to bring iOS Simulator to front: " & msg log "BringIOSSimulatorToFront: Retrying..." delay 1 end try end repeat end run
SaveMailAttachmentsToLocalFolder.applescript
thecesrom/AppleScript
0
2405
<reponame>thecesrom/AppleScript using terms from application "Mail" on perform mail action with messages theMessages for rule theRule -- set up the attachment folder path tell application "Finder" --set attachmentsFolder to (path to documents folder as text) as text set folderName to "Box" --set homePath to (path to home folder as text) as text set documentsPath to (path to documents folder as text) as text set attachmentsFolder to (documentsPath & folderName) as text end tell tell application "Mail" repeat with eachMessage in theMessages --set the sub folder for the attachments to the mail's subject. set subFolder to (subject of eachMessage) -- set up the folder name for this mail message's attachments. We use the time stamp of the date received time stamp set {year:y, month:m, day:d, hours:h, minutes:min, seconds:sec} to eachMessage's date received set timeStamp to (y & "-" & my pad(m as integer) & "-" & my pad(d) & "_" & my pad(h) & "-" & my pad(min) & "-" & my pad(sec) & "_") as string set attachCount to count of (mail attachments of eachMessage) if attachCount is not equal to 0 then -- use the unix /bin/test command to test if the timeStamp folder exists. if not then create it and any intermediate directories as required if (do shell script "/bin/test -e " & quoted form of ((POSIX path of attachmentsFolder) & "/" & subFolder) & " ; echo $?") is "1" then -- 1 is false do shell script "/bin/mkdir -p " & quoted form of ((POSIX path of attachmentsFolder) & "/" & subFolder) end if try -- Save the attachment repeat with theAttachment in eachMessage's mail attachments set originalName to name of theAttachment set newFileName to (timeStamp & originalName) as string set savePath to attachmentsFolder & ":" & subFolder & ":" & newFileName try save theAttachment in file (savePath) end try end repeat --on error msg --display dialog msg end try end if end repeat end tell end perform mail action with messages end using terms from on pad(n) return text -2 thru -1 of ("0" & n) end pad
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-cgcaso.adb
djamal2727/Main-Bearing-Analytical-Model
0
6915
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.GENERIC_CONSTRAINED_ARRAY_SORT -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by <NAME>. -- ------------------------------------------------------------------------------ -- This algorithm was adapted from GNAT.Heap_Sort_G (see g-hesorg.ad[sb]) procedure Ada.Containers.Generic_Constrained_Array_Sort (Container : in out Array_Type) is subtype T is Long_Long_Integer; function To_Index (J : T) return Index_Type; pragma Inline (To_Index); procedure Sift (S : T); A : Array_Type renames Container; -------------- -- To_Index -- -------------- function To_Index (J : T) return Index_Type is K : constant T'Base := Index_Type'Pos (A'First) + J - T'(1); begin return Index_Type'Val (K); end To_Index; Max : T := A'Length; Temp : Element_Type; ---------- -- Sift -- ---------- procedure Sift (S : T) is C : T := S; Son : T; begin loop Son := 2 * C; exit when Son > Max; declare Son_Index : Index_Type := To_Index (Son); begin if Son < Max then if A (Son_Index) < A (Index_Type'Succ (Son_Index)) then Son := Son + 1; Son_Index := Index_Type'Succ (Son_Index); end if; end if; A (To_Index (C)) := A (Son_Index); -- Move (Son, C); end; C := Son; end loop; while C /= S loop declare Father : constant T := C / 2; begin if A (To_Index (Father)) < Temp then -- Lt (Father, 0) A (To_Index (C)) := A (To_Index (Father)); -- Move (Father, C) C := Father; else exit; end if; end; end loop; A (To_Index (C)) := Temp; -- Move (0, C); end Sift; -- Start of processing for Generic_Constrained_Array_Sort begin for J in reverse 1 .. Max / 2 loop Temp := Container (To_Index (J)); -- Move (J, 0); Sift (J); end loop; while Max > 1 loop Temp := A (To_Index (Max)); -- Move (Max, 0); A (To_Index (Max)) := A (A'First); -- Move (1, Max); Max := Max - 1; Sift (1); end loop; end Ada.Containers.Generic_Constrained_Array_Sort;
src/ggt/group/Facts.agda
zampino/ggt
2
6062
open import Algebra.Bundles using (Group) module GGT.Group.Facts {a b ℓ} (G : Group a ℓ) where open import Relation.Unary using (Pred) open import Relation.Binary open import GGT.Group.Structures open import Algebra.Bundles using (Group) open import Algebra.Properties.Group G open Group G open import Relation.Binary.Reasoning.Setoid setoid ⁻¹-anti-homo-- : ∀ (x y : Carrier) → (x - y)⁻¹ ≈ y - x ⁻¹-anti-homo-- x y = begin (x - y)⁻¹ ≡⟨⟩ (x ∙ y ⁻¹)⁻¹ ≈⟨ ⁻¹-anti-homo-∙ _ _ ⟩ (y ⁻¹) ⁻¹ ∙ x ⁻¹ ≈⟨ ∙-congʳ (⁻¹-involutive _) ⟩ y ∙ x ⁻¹ ≡⟨⟩ y - x ∎ subgroup⁻¹-closed : {P : Pred Carrier b } → IsSubGroup G P → ∀ x → P x → P (x ⁻¹) subgroup⁻¹-closed iss x px = -- e - x = x ⁻¹ → P e - x → P x ⁻¹ r (identityˡ (x ⁻¹)) (∙-⁻¹-closed ε∈ px) where open IsSubGroup iss -- ----- -- (Right) Coset Relation is Equivalenc cosetRelRefl : {P : Pred Carrier b } → (iss : IsSubGroup G P) → Reflexive (IsSubGroup._∼_ iss) cosetRelRefl iss {x} = r (sym (inverseʳ x)) ε∈ where open IsSubGroup iss -- (e = x - x) → P e → P x - x cosetRelSym : {P : Pred Carrier b } → (iss : IsSubGroup G P) → Symmetric (IsSubGroup._∼_ iss) cosetRelSym iss {x} {y} x∼y = r u≈y-x Pu where -- P e → P (x - y) → P (y - x) open IsSubGroup iss u≈y-x = begin ε - (x - y) ≡⟨⟩ ε ∙ (x - y)⁻¹ ≈⟨ identityˡ ((x - y)⁻¹) ⟩ (x - y)⁻¹ ≈⟨ ⁻¹-anti-homo-- _ _ ⟩ y - x ∎ Pu = ∙-⁻¹-closed ε∈ x∼y cosetRelTrans : {P : Pred Carrier b } → (iss : IsSubGroup G P) → Transitive (IsSubGroup._∼_ iss) cosetRelTrans iss {x} {y} {z} x∼y y∼z = r x-y-[z-y]≈x-z Pu where open IsSubGroup iss -- P z - y z∼y = cosetRelSym iss y∼z x-y-[z-y]≈x-z = begin (x - y) - (z - y) ≡⟨⟩ (x - y) ∙ (z - y) ⁻¹ ≈⟨ ∙-congˡ (⁻¹-anti-homo-- z y) ⟩ (x - y) ∙ (y - z) ≡⟨⟩ (x ∙ y ⁻¹) ∙ (y ∙ z ⁻¹) ≈⟨ assoc x (y ⁻¹) (y ∙ z ⁻¹) ⟩ x ∙ (y ⁻¹ ∙ (y ∙ z ⁻¹)) ≈˘⟨ ∙-congˡ (assoc (y ⁻¹) y (z ⁻¹)) ⟩ x ∙ ((y ⁻¹ ∙ y) ∙ z ⁻¹) ≈⟨ ∙-congˡ (∙-congʳ (inverseˡ _)) ⟩ x ∙ (ε ∙ z ⁻¹) ≈⟨ ∙-congˡ (identityˡ _) ⟩ x ∙ z ⁻¹ ≡⟨⟩ x - z ∎ Pu = ∙-⁻¹-closed {x - y} {z - y} x∼y z∼y
programs/oeis/098/A098823.asm
jmorken/loda
1
170622
; A098823: a(n) = 16*(8*prime(n) + 7). ; 368,496,752,1008,1520,1776,2288,2544,3056,3824,4080,4848,5360,5616,6128,6896,7664,7920,8688,9200,9456,10224,10736,11504,12528,13040,13296,13808,14064,14576,16368,16880,17648,17904,19184,19440,20208,20976 cal $0,40 ; The prime numbers. mul $0,8 add $0,7 mov $1,$0 mul $1,16
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_563.asm
ljhsiun2/medusa
9
12165
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_563.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r14 push %r15 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1d297, %r14 nop nop nop nop inc %rdx and $0xffffffffffffffc0, %r14 vmovntdqa (%r14), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %r13 nop nop nop nop inc %rsi lea addresses_WC_ht+0x1b457, %rbx nop nop xor $48694, %r15 mov (%rbx), %r11d nop nop nop sub %rsi, %rsi lea addresses_normal_ht+0x19717, %rsi lea addresses_normal_ht+0x2f17, %rdi nop nop nop nop nop lfence mov $121, %rcx rep movsb nop nop nop and %rdi, %rdi lea addresses_WC_ht+0xf837, %r14 nop nop nop dec %rcx movw $0x6162, (%r14) nop nop nop nop nop cmp $2580, %r15 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %rcx push %rdi push %rsi // Store lea addresses_A+0x5517, %r15 nop nop nop cmp $57534, %r14 movw $0x5152, (%r15) nop nop nop xor %r12, %r12 // REPMOV lea addresses_normal+0x1d457, %rsi lea addresses_WC+0x851f, %rdi nop nop nop nop xor %r15, %r15 mov $42, %rcx rep movsb nop nop nop nop nop and $29951, %r12 // Faulty Load lea addresses_WC+0x7d17, %r14 nop nop xor %r15, %r15 movb (%r14), %r13b lea oracles, %rsi and $0xff, %r13 shlq $12, %r13 mov (%rsi,%r13,1), %r13 pop %rsi pop %rdi pop %rcx pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_WC', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A', 'congruent': 11}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal'}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 6}} {'dst': {'same': True, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 5}, 'OP': 'STOR'} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_21829_384.asm
ljhsiun2/medusa
9
245531
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %rax push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x148e0, %rsi clflush (%rsi) nop dec %rbp movb (%rsi), %cl nop nop nop nop nop xor %rax, %rax lea addresses_A_ht+0x17831, %rsi nop nop cmp %rbx, %rbx mov (%rsi), %r10 nop nop nop nop nop cmp %rcx, %rcx lea addresses_A_ht+0xd331, %rsi lea addresses_A_ht+0x1b761, %rdi nop dec %r15 mov $42, %rcx rep movsb nop nop nop nop sub $15644, %rcx lea addresses_WC_ht+0x13c31, %rbp nop nop nop dec %rdi mov $0x6162636465666768, %r15 movq %r15, (%rbp) nop nop and %rax, %rax lea addresses_normal_ht+0x1ac31, %rcx nop nop nop cmp $256, %rdi movups (%rcx), %xmm2 vpextrq $0, %xmm2, %rbx nop nop cmp $3372, %r10 lea addresses_UC_ht+0x1ab31, %rbx nop nop nop nop cmp %rsi, %rsi movb $0x61, (%rbx) and $60042, %rax lea addresses_D_ht+0x16b73, %rsi nop nop nop nop dec %rbp movups (%rsi), %xmm6 vpextrq $1, %xmm6, %r15 nop dec %rbx lea addresses_WT_ht+0x89e7, %rbp clflush (%rbp) sub $55723, %r10 movb $0x61, (%rbp) nop nop nop nop nop dec %rcx lea addresses_UC_ht+0x3897, %r15 nop sub $24486, %r10 movups (%r15), %xmm1 vpextrq $0, %xmm1, %rbx nop xor $39966, %rax lea addresses_normal_ht+0x17831, %rsi clflush (%rsi) nop nop nop nop nop add $30773, %r10 mov (%rsi), %r15d cmp $18612, %rax pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r15 push %r8 push %r9 push %rdi push %rsi // Faulty Load mov $0x16a78a0000000431, %rsi nop nop nop xor %rdi, %rdi mov (%rsi), %r9d lea oracles, %r15 and $0xff, %r9 shlq $12, %r9 mov (%r15,%r9,1), %r9 pop %rsi pop %rdi pop %r9 pop %r8 pop %r15 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
libsrc/fcntl/newbrain/readbyte.asm
meesokim/z88dk
0
9267
; ; Grundy Newbrain Specific libraries ; ; <NAME> - 30/05/2007 ; ; ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; ; fcntl input function ; ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; ; int __LIB__ __FASTCALL__ readbyte(int handle); ; ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; ; ; $Id: readbyte.asm,v 1.2 2015/01/22 12:09:57 stefano Exp $ ; PUBLIC readbyte EXTERN nb_getc .readbyte jp nb_getc
decreasoner.macosx/software/relsat-dist/gmp-3.1/mpn/x86/k6/mmx/popham.asm
problem-frames/openpf
1
162445
dnl AMD K6-2 mpn_popcount, mpn_hamdist -- mpn bit population count and dnl hamming distance. dnl dnl popcount hamdist dnl K6-2: 9.0 11.5 cycles/limb dnl K6: 12.5 13.0 dnl Copyright (C) 2000 Free Software Foundation, Inc. dnl dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Lesser General Public License as dnl published by the Free Software Foundation; either version 2.1 of the dnl License, or (at your option) any later version. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with the GNU MP Library; see the file COPYING.LIB. If dnl not, write to the Free Software Foundation, Inc., 59 Temple Place - dnl Suite 330, Boston, MA 02111-1307, USA. include(`../config.m4') C unsigned long mpn_popcount (mp_srcptr src, mp_size_t size); C unsigned long mpn_hamdist (mp_srcptr src, mp_srcptr src2, mp_size_t size); C C The code here isn't optimal, but it's already a 2x speedup over the plain C integer mpn/generic/popcount.c,hamdist.c. ifdef(`OPERATION_popcount',, `ifdef(`OPERATION_hamdist',, `m4_error(`Need OPERATION_popcount or OPERATION_hamdist ')m4exit(1)')') define(HAM, m4_assert_numargs(1) `ifdef(`OPERATION_hamdist',`$1')') define(POP, m4_assert_numargs(1) `ifdef(`OPERATION_popcount',`$1')') HAM(` defframe(PARAM_SIZE, 12) defframe(PARAM_SRC2, 8) defframe(PARAM_SRC, 4) define(M4_function,mpn_hamdist) ') POP(` defframe(PARAM_SIZE, 8) defframe(PARAM_SRC, 4) define(M4_function,mpn_popcount) ') MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist) ifdef(`PIC',,` dnl non-PIC .section .rodata ALIGN(8) define(LS, m4_assert_numargs(1) `LF(M4_function,`$1')') LS(rodata_AAAAAAAAAAAAAAAA): .long 0xAAAAAAAA .long 0xAAAAAAAA LS(rodata_3333333333333333): .long 0x33333333 .long 0x33333333 LS(rodata_0F0F0F0F0F0F0F0F): .long 0x0F0F0F0F .long 0x0F0F0F0F LS(rodata_000000FF000000FF): .long 0x000000FF .long 0x000000FF ') .text ALIGN(32) POP(`ifdef(`PIC', ` C avoid shrl crossing a 32-byte boundary nop')') PROLOGUE(M4_function) deflit(`FRAME',0) movl PARAM_SIZE, %ecx orl %ecx, %ecx jz L(zero) ifdef(`PIC',` movl $0xAAAAAAAA, %eax movl $0x33333333, %edx movd %eax, %mm7 movd %edx, %mm6 movl $0x0F0F0F0F, %eax movl $0x000000FF, %edx punpckldq %mm7, %mm7 punpckldq %mm6, %mm6 movd %eax, %mm5 movd %edx, %mm4 punpckldq %mm5, %mm5 punpckldq %mm4, %mm4 ',` movq LS(rodata_AAAAAAAAAAAAAAAA), %mm7 movq LS(rodata_3333333333333333), %mm6 movq LS(rodata_0F0F0F0F0F0F0F0F), %mm5 movq LS(rodata_000000FF000000FF), %mm4 ') define(REG_AAAAAAAAAAAAAAAA, %mm7) define(REG_3333333333333333, %mm6) define(REG_0F0F0F0F0F0F0F0F, %mm5) define(REG_000000FF000000FF, %mm4) movl PARAM_SRC, %eax HAM(` movl PARAM_SRC2, %edx') pxor %mm2, %mm2 C total shrl %ecx jnc L(top) Zdisp( movd, 0,(%eax,%ecx,8), %mm1) HAM(` Zdisp( movd, 0,(%edx,%ecx,8), %mm0) pxor %mm0, %mm1 ') incl %ecx jmp L(loaded) ALIGN(16) POP(` nop C alignment to avoid crossing 32-byte boundaries') L(top): C eax src C ebx C ecx counter, qwords, decrementing C edx [hamdist] src2 C C mm0 (scratch) C mm1 (scratch) C mm2 total (low dword) C mm3 C mm4 \ C mm5 | special constants C mm6 | C mm7 / movq -8(%eax,%ecx,8), %mm1 HAM(` pxor -8(%edx,%ecx,8), %mm1') L(loaded): movq %mm1, %mm0 pand REG_AAAAAAAAAAAAAAAA, %mm1 psrlq $1, %mm1 HAM(` nop C code alignment') psubd %mm1, %mm0 C bit pairs HAM(` nop C code alignment') movq %mm0, %mm1 psrlq $2, %mm0 pand REG_3333333333333333, %mm0 pand REG_3333333333333333, %mm1 paddd %mm1, %mm0 C nibbles movq %mm0, %mm1 psrlq $4, %mm0 pand REG_0F0F0F0F0F0F0F0F, %mm0 pand REG_0F0F0F0F0F0F0F0F, %mm1 paddd %mm1, %mm0 C bytes movq %mm0, %mm1 psrlq $8, %mm0 paddb %mm1, %mm0 C words movq %mm0, %mm1 psrlq $16, %mm0 paddd %mm1, %mm0 C dwords pand REG_000000FF000000FF, %mm0 paddd %mm0, %mm2 C low to total psrlq $32, %mm0 paddd %mm0, %mm2 C high to total loop L(top) movd %mm2, %eax emms_or_femms ret L(zero): movl $0, %eax ret EPILOGUE()
Library/Kernel/Thread/threadSem.asm
steakknife/pcgeos
504
19208
<reponame>steakknife/pcgeos COMMENT @----------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: Thread FILE: threadSem.asm ROUTINES: Name Description ---- ----------- GLB ThreadBlockOnQueue Block on a queue (application entry point) GLB ThreadWakeUpQueue Wake up a queue (application entry point) EXT BlockOnLongQueue Block on a queue (general routine) EXT WakeUpLongQueue Wake up a queue (general routine) EXT WakeUpRunQueue Wake up the run queue EXT WakeUpSI Wake up thread SI INT WakeUpRunQueue Wake up the run queue REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 4/88 Initial version DESCRIPTION: This file implements the semaphore handling routines. $Id: threadSem.asm,v 1.1 97/04/05 01:15:22 newdeal Exp $ -------------------------------------------------------------------------------@ COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadAllocThreadLock DESCRIPTION: Allocate a semaphore CALLED BY: GLOBAL PASS: none RETURN: bx - handle of semaphore DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadAllocThreadLock proc far mov bx, 1 FALL_THRU ThreadAllocSem ThreadAllocThreadLock endp COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadAllocSem DESCRIPTION: Allocate a semaphore CALLED BY: GLOBAL PASS: bx - value for semaphore RETURN: bx - handle of semaphore DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadAllocSem proc far uses ds .enter push bx LoadVarSeg ds mov bx, ss:[TPD_processHandle] ;owner call AllocateHandle ;all fields set to zero mov ds:[bx].HS_type, SIG_SEMAPHORE mov ds:[bx].HS_moduleLock.TL_owner, -1 pop ds:[bx].HS_moduleLock.TL_sem.Sem_value .leave ret ThreadAllocSem endp COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadFreeSem DESCRIPTION: Allocate a semaphore CALLED BY: GLOBAL PASS: bx - handle of semaphore RETURN: none DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadFreeSem proc far uses ds .enter EC < call CheckLegalSemaphoreHandle > LoadVarSeg ds call FreeHandle .leave ret ThreadFreeSem endp if ERROR_CHECK CheckLegalSemaphoreHandle proc near pushf ; flags presevered, remember? push ds ; -- todd 08/15/94 LoadVarSeg ds call CheckHandleLegal cmp ds:[bx].HS_type, SIG_SEMAPHORE ERROR_NZ NON_SEMAPHORE_PASSED_TO_SEM_ROUTINE pop ds call SafePopf ; can be called with INTs off. ret ; -- todd 08/15/94 CheckLegalSemaphoreHandle endp endif COMMENT @---------------------------------------------------------------------- C FUNCTION: ThreadPSem C DECLARATION: extern SemaphoreError _far _pascal ThreadPSem(SemaphoreHandle sem); KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/91 Initial version ------------------------------------------------------------------------------@ SetGeosConvention THREADPSEM proc far ; mh:hptr C_GetOneWordArg bx, ax,cx ;bx = handle FALL_THRU ThreadPSem THREADPSEM endp SetDefaultConvention COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadPSem DESCRIPTION: P a semaphore CALLED BY: GLOBAL PASS: bx - handle of semaphore RETURN: ax - SemaphoreError DESTROYED: none (carry flag preserved) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadPSem proc far call _dopsem clr ax ret ThreadPSem endp _dopsem proc near push bx EC < call CheckLegalSemaphoreHandle > lea bx, ds:[bx].HS_moduleLock.TL_sem ;preserve flags jmp SysPSemCommon _dopsem endp COMMENT @---------------------------------------------------------------------- C FUNCTION: ThreadVSem C DECLARATION: extern SemaphoreError C DECLARATION: extern Boolean _far _pascal ThreadVSem(SemaphoreHandle sem); KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/91 Initial version ------------------------------------------------------------------------------@ SetGeosConvention THREADVSEM proc far ; mh:hptr C_GetOneWordArg bx, ax,cx ;bx = handle FALL_THRU ThreadVSem THREADVSEM endp SetDefaultConvention COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadVSem DESCRIPTION: V a semaphore CALLED BY: GLOBAL PASS: bx - handle of semaphore RETURN: ax - SemaphoreError DESTROYED: none (flags preserved) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadVSem proc far call _dovsem mov ax, 0 ;preserve flags ret ThreadVSem endp _dovsem proc near EC < call CheckLegalSemaphoreHandle > push bx lea bx, ds:[bx].HS_moduleLock.TL_sem ;preserve flags jmp SysVSemCommon _dovsem endp COMMENT @---------------------------------------------------------------------- C FUNCTION: ThreadPTimedSem C DECLARATION: extern SemaphoreError _far _pascal ThreadPTimedSem(SemaphoreHandle sem, word timeout); KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/91 Initial version ------------------------------------------------------------------------------@ SetGeosConvention THREADPTIMEDSEM proc far ; mh:hptr C_GetTwoWordArgs bx, cx, ax,dx ;bx = handle, cx = timeout FALL_THRU ThreadPTimedSem THREADPTIMEDSEM endp SetDefaultConvention COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadPTimedSem DESCRIPTION: P a semaphore with a timeout value CALLED BY: GLOBAL PASS: bx - handle of semaphore cx - timeout value RETURN: ax - SemaphoreError (SE_TIMEOUT if timeout) DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadPTimedSem proc far uses ds .enter clr ax LoadVarSeg ds EC < call CheckLegalSemaphoreHandle > PTimedSem ds, [bx].HS_moduleLock.TL_sem, cx jnc done mov ax, SE_TIMEOUT done: .leave ret ThreadPTimedSem endp COMMENT @---------------------------------------------------------------------- C FUNCTION: ThreadGrabThreadLock C DECLARATION: extern void _far _pascal ThreadGrabThreadLock( ThreadLockHandle sem); KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/91 Initial version ------------------------------------------------------------------------------@ SetGeosConvention THREADGRABTHREADLOCK proc far ; mh:hptr C_GetOneWordArg bx, ax,cx ;bx = handle FALL_THRU ThreadGrabThreadLock THREADGRABTHREADLOCK endp SetDefaultConvention COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadGrabThreadLock DESCRIPTION: Grab a thread lock CALLED BY: GLOBAL PASS: bx - handle of semaphore RETURN: none DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadGrabThreadLock proc far call _dolock ret ThreadGrabThreadLock endp _dolock proc near push bx EC < call CheckHandleLegal > add bx, offset HS_moduleLock jmp SysLockCommon _dolock endp COMMENT @---------------------------------------------------------------------- C FUNCTION: ThreadReleaseThreadLock C DECLARATION: extern void _far _pascal ThreadReleaseThreadLock( ThreadLockHandle sem); KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/91 Initial version ------------------------------------------------------------------------------@ SetGeosConvention THREADRELEASETHREADLOCK proc far ; mh:hptr C_GetOneWordArg bx, ax,cx ;bx = handle FALL_THRU ThreadReleaseThreadLock THREADRELEASETHREADLOCK endp SetDefaultConvention COMMENT @---------------------------------------------------------------------- FUNCTION: ThreadReleaseThreadLock DESCRIPTION: Release a thread lock CALLED BY: GLOBAL PASS: bx - handle of semaphore RETURN: none DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/91 Initial version ------------------------------------------------------------------------------@ ThreadReleaseThreadLock proc far call _dounlock ret ThreadReleaseThreadLock endp _dounlock proc near push bx EC < call CheckHandleLegal > add bx, offset HS_moduleLock jmp SysUnlockCommon _dounlock endp COMMENT @----------------------------------------------------------------------- FUNCTION: ThreadBlockOnQueue DESCRIPTION: Block on a queue (application entry point) CALLED BY: GLOBAL PASS: ax - segment of queue bx - offset of queue RETURN: ax, bx - destroyed DESTROYED: none (flags preserved) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 4/88 Initial version -------------------------------------------------------------------------------@ ThreadBlockOnQueue proc far call BlockOnLongQueue ;call real routine ret ThreadBlockOnQueue endp COMMENT @----------------------------------------------------------------------- FUNCTION: ThreadWakeUpQueue DESCRIPTION: Wake up a queue (application entry point) CALLED BY: GLOBAL PASS: ax - segment of queue bx - offset of queue RETURN: ax, bx - destroyed DESTROYED: none (carry flag preserved) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 4/88 Initial version -------------------------------------------------------------------------------@ ThreadWakeUpQueue proc far call WakeUpLongQueue ;call real routine ret ThreadWakeUpQueue endp COMMENT @----------------------------------------------------------------------- FUNCTION: WakeUpSI DESCRIPTION: Wake up thread SI if it is higher priority than current thread. Otherwise, put SI on the run queue. CALLED BY: EXTERNAL ThreadCreate PASS: si - handle of thread RETURN: si - same DESTROYED: ax, bx REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 6/88 Initial version -------------------------------------------------------------------------------@ FarWakeUpSI proc far call WakeUpSI ret FarWakeUpSI endp WakeUpSI proc near if SUPPORT_32BIT_DATA_REGS push ds push esi push edi push ecx pushf push edx mov ecx, eax ; ecx.high = eax.high rol ebx, 16 ; bx = orig ebx.high mov cx, bx ; cx = orig ebx.high ror ebx, 16 ; restore ebx push ecx ; push eax.high, ebx.high push es push fs push gs else push ds push si push di push cx pushf push dx push es endif ; SUPPORT_32BIT_DATA_REGS LoadVarSeg ds INT_OFF jmp WakeUpCommon WakeUpSI endp COMMENT @----------------------------------------------------------------------- FUNCTION: WakeUpRunQueue DESCRIPTION: Wake up any higher-priority thread that is runnable. CALLED BY: EXTERNAL TimerInterrupt, ThreadModify, SysExitInterrupt PASS: ds = idata RETURN: none DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 7/88 Initial version ardeb 5/90 Changed to check for empty run queue and save bx (2 of the 3 places that called this saved bx around it; 2 of 3 places had to check for a non-zero run queue) -------------------------------------------------------------------------------@ WakeUpRunQueue proc near push bx mov bx,offset runQueue tst {word}ds:[bx] jz noOneElse mov ax,ds call WakeUpLongQueue noOneElse: pop bx ret WakeUpRunQueue endp COMMENT @----------------------------------------------------------------------- FUNCTION: WakeUpLongQueue DESCRIPTION: Wake up a queue (kernel entry point) CALLED BY: EXTERNAL WakeUpCSQueue, ThreadWakeUpQueue PASS: ax - segment of queue bx - offset of queue RETURN: ax, bx - destroyed carry flag - SAME DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: Take first thread off of queue and put it on run queue. If new thread is higher priority than current thread, then block the current thread and run the new thread. If in interrupt code or in in the kernel's thread then do not context switch. Since the PSem and VSem macros do not turn off interrupts, a little bit of special syncronization code is required in BlockOnLongQueue and in WakeUpLongQueue: BlockOnLongQueue: INT_OFF test queue,15 jz BOLQ_block dec queue ret BOLQ_block: ** Block on the queue WakeUpLongQueue: INT_OFF test queue,15 jbe WULQ_wakeUp inc queue ret WULQ_wakeUp: ** Wake up the queue The problem is that PSem might decrement the semaphore from 0 to -1 but before the thread can block, a context switch causes another thread to do a VSem and increment from -1 to 0. This causes WakeUpLongQueue to be called which normally expects to wake up a thread. This is impossible since the first thread has not yet blocked. In this case WakeUpLongQueue will set the queue to 1 which signals BlockOnLongQueue to not actually block. KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 4/88 Initial version -------------------------------------------------------------------------------@ WakeUpLongQueue proc near if SUPPORT_32BIT_DATA_REGS push ds push esi push edi push ecx pushf push edx mov ecx, eax rol ebx, 16 ; ecx.high = eax.high mov cx, bx ; cx = orig ebx.high ror ebx, 16 ; restore ebx push ecx ; push eax.high, ebx.high push es push fs push gs else push ds push si push di push cx pushf push dx push es endif ; SUPPORT_32BIT_DATA_REGS LoadVarSeg ds INT_OFF mov es,ax ; test for nothing to wake up cmp word ptr es:[bx],16 jae 10$ inc word ptr es:[bx] jmp RecoverFromPartialBlock 10$: call RemoveFromQueue ;get highest priority thread from queue ;compare priorities WakeUpCommon label near cmp si,KERNEL_INIT_BLOCK ;is kernel blocked in init code ? jz kernelInit cmp ds:[interruptCount],0 ;are we running interrupt code ? jnz intNoWakeUp ;if so then do not context switch mov bx,ds:[currentThread] tst bx ;test for kernel mode jz noWakeUp mov al,ds:[bx][HT_curPriority] ;load priority of current cmp al,ds:[si][HT_curPriority] ;compare to newly runnable jae BlockAndDispatchSI ;if current process is lower or ;equal then branch to block it ; else put new thread on run queue and exit noWakeUp: mov ax,ds:[runQueue] mov ds:[si][HT_nextQThread],ax mov ds:[runQueue],si jmp RecoverFromPartialBlock ; waking up kernel thread kernelInit: inc ds:[initWaitFlag] jmp RecoverFromPartialBlock ; not waking up because running interrupt code intNoWakeUp: mov ds:[intWakeUpAborted],TRUE jmp noWakeUp WakeUpLongQueue endp COMMENT @----------------------------------------------------------------------- FUNCTION: BlockAndDispatchSI DESCRIPTION: Block on the run queue and run the given thread CALLED BY: EXTERNAL WakeUpCommon PASS: interrupts off si - handle of thread to run ds - kernel variable segment stack - registers pushed in this order: ds, si, di, cx, flags, dx, es RETURN: ax, bx - destroyed DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 6/88 Initial version -------------------------------------------------------------------------------@ BlockAndDispatchSI proc near jmp if SUPPORT_32BIT_DATA_REGS push ebp ;push the rest of the registerse else push bp ;push the rest of the registers endif ; SUPPORT_32BIT_DATA_REGS if UTILITY_MAPPING_WINDOW ; ; save current utility mapping windows ; call UtilWindowSaveMapping endif if TRACK_INTER_RESOURCE_CALLS FXIP < push ds:[curXIPResourceHandle] ;Save the current XIP > ;resource handle endif FXIP < push ds:[curXIPPage] ;Save the current XIP page > EC < mov dx,ss > EC < cmp dx, seg dgroup > EC < ERROR_Z BLOCK_IN_KERNEL > mov bx,ds:[currentThread] ;insert proc in queue mov ax,ds:[runQueue] ;get old start of queue mov ds:[bx][HT_nextQThread],ax mov ds:[runQueue],bx mov ds:[bx][HT_saveSS],ss mov ds:[bx][HT_saveSP],sp ;switch to kernel context call SwitchToKernel ;ds <- idata jmp DispatchSI BlockAndDispatchSI endp COMMENT @----------------------------------------------------------------------- FUNCTION: BlockOnLongQueue DESCRIPTION: Block on a queue (kernel entry point) CALLED BY: EXTERNAL ThreadBlockOnQueue, various and sundry PASS: interrupts off ax - segment of queue bx - offset of queue RETURN: ax, bx - destroyed flags - same DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: Special code is needed since PSem and VSem do not turn off interrupts. This is detailed in WakeUpLongQueue. BlockOnLongQueue: INT_OFF test queue,15 jz BOLQ_block dec queue ret BOLQ_block: ** Block on the queue KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 4/88 Initial version -------------------------------------------------------------------------------@ BlockOnLongQueue proc near if SUPPORT_32BIT_DATA_REGS push ds push esi push edi push ecx pushf push edx mov ecx, eax ; ecx.high = eax.high rol ebx, 16 ; bx = orig ebx.high mov cx, bx ; cx = orig ebx.high ror ebx, 16 ; restore ebx push ecx ; push eax.high, ebx.high push es push fs push gs push ebp else push ds ;save registers, both to save state and to push si ;give us some working space push di push cx pushf push dx push es push bp endif ; SUPPORT_32BIT_DATA_REGS LoadVarSeg ds ;ds = idata mov es,ax ;es = queue ; If blocked in kernel then assume init code and don't reset stack ; this allows blocking in init code INT_OFF ; Test for WakeUp already happened mov ax,es:[bx] ;get old start of queue test ax,15 jz 10$ dec word ptr es:[bx] ;wake up already happened, continue jmp RecoverFromFullBlock 10$: tst ds:[interruptCount] jnz blockInInterrupt mov si,ds:[currentThread] ;insert proc in queue tst si jz kernel mov es:[bx],si mov ds:[si][HT_nextQThread],ax if UTILITY_MAPPING_WINDOW ; ; save current utility mapping windows ; call UtilWindowSaveMapping endif if TRACK_INTER_RESOURCE_CALLS FXIP < push ds:[curXIPResourceHandle] ;Save the current XIP > ;resource handle endif FXIP < push ds:[curXIPPage] > mov ds:[si][HT_saveSS],ss mov ds:[si][HT_saveSP],sp jmp Dispatch ;context is switched to kernel in ;this routine. Returning from BOLQ ;is also handled by Dispatch ;when this thread is woken up. ; Blocking in kernel thread or during an interrupt -- use special wait ; loop kernel: ; EC CODE REMOVED 1/7/93: this can happen if wait/post is enabled and the ; machine is acting as a server for a peer-to-peer network. In this case, ; the int 28h issued by the primary IFS driver will be echoed as an ; int 2ah::84h which can cause disk access and lead to a wait/post ; invocation. The primary IFS driver doesn't do a SysEnterCritical, as it ; has no need to, other than this EC code... -- ardeb EC < cmp ds:[initFlag],0 > EC < ERROR_Z BLOCK_IN_KERNEL > blockInInterrupt: mov ax, sp mov si, ss xchg ds:[initStack].offset, ax xchg ds:[initStack].segment, si push ax push si push {word}es:[bx] ;allow other threads to be blocked on ; the same queue mov word ptr es:[bx],KERNEL_INIT_BLOCK ;mark as special block clr ax mov ds:[initWaitFlag],al INT_ON BOLQ_loop: call Idle xchg al,ds:[initWaitFlag] tst al jz BOLQ_loop pop {word}es:[bx] ; recover previously queued threads pop ds:[initStack].segment ; and previous initStack in case pop ds:[initStack].offset ; we're nesting these things... jmp RecoverFromFullBlock BlockOnLongQueue endp COMMENT @----------------------------------------------------------------------- FUNCTION: RemoveFromQueue DESCRIPTION: Remove the highest priority thread from the given queue CALLED BY: INTERNAL WakeUpLongQueue, Dispatch PASS: interupts off es:bx - queue ds - kernel variable segment RETURN: si - handle of highest priority thread (0 if none in queue) DESTROYED: ax, bx, cx, dx, di REGISTER/STACK USAGE: cl - highest priority so far si - handle of highest priority thread PSEUDO CODE/STRATEGY: Move through queue keeping to find highest priority thread KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 6/88 Initial version -------------------------------------------------------------------------------@ RemoveFromQueue proc near ; es:bx = queue mov si,es:[bx] ;get first proc on queue ; test for waking up thread blocked in init code cmp si,KERNEL_INIT_BLOCK jz kernelInit EC < call CheckThreadSI > cmp ds:[si][HT_nextQThread],0 ;test for only one thread jnz moreThanOne ; only one thread mov word ptr es:[bx],0 ;zero queue ret ;return thread in si kernelInit: mov word ptr es:[bx],0 ret moreThanOne: mov dx,bx mov cl,ds:[si][HT_curPriority] mov bx,si clr si ; bx = current thread ; si = handle BEFORE highest priority thread so far ; cl = priority of highest priority thread so far threadLoop: mov di,ds:[bx][HT_nextQThread] ;di = next thread or di,di ;(thread to test) jz atEnd ;if at end then branch EC < call CheckThreadDI > cmp cl,ds:[di][HT_curPriority] ;compare priority of current jb noNewWinner ;winner to priority of thread ;on queue. If current is higher ;then branch mov si,bx mov cl,ds:[di][HT_curPriority] noNewWinner: mov bx,di jmp threadLoop atEnd: or si,si ;test for removing first thread jz removeFirst mov bx,si mov si,ds:[si][HT_nextQThread] ;si = thread to return clr di ;make si's not point to anything xchg di,ds:[si][HT_nextQThread] mov ds:[bx][HT_nextQThread],di EC < call CheckThreadSI > ret removeFirst: mov bx,dx mov si,es:[bx] clr di xchg di,ds:[si][HT_nextQThread] mov es:[bx],di EC < call CheckThreadSI > ret RemoveFromQueue endp
programs/oeis/014/A014900.asm
neoneye/loda
22
94259
; A014900: a(1)=1, a(n)=17*a(n-1)+n. ; 1,19,326,5546,94287,1602885,27249052,463233892,7874976173,133874594951,2275868114178,38689757941038,657725884997659,11181340044960217,190082780764323704,3231407272993502984,54933923640889550745,933876701895122362683,15875903932217080165630,269890366847690362815730,4588136236410736167867431,77998316018982514853746349,1325971372322702752513687956,22541513329485946792732695276,383205726601261095476455819717,6514497352221438623099748935215,110746454987764456592695731898682,1882689734791995762075827442277622,32005725491463927955289066518719603,544097333354886775239914130818233281 add $0,1 lpb $0 sub $0,1 add $2,1 mul $2,17 add $1,$2 lpe div $1,17 mov $0,$1
src/fmt-generic_mod_int_argument.ads
likai3g/afmt
0
3063
generic type Mod_Int_Type is mod <>; package Fmt.Generic_Mod_Int_Argument is function To_Argument (X : Mod_Int_Type) return Argument_Type'Class with Inline; function "&" (Args : Arguments; X : Mod_Int_Type) return Arguments with Inline; private type Digit_Style is (DS_Lowercase, DS_Uppercase); subtype Number_Base is Positive range 2 .. 36; type Mod_Int_Argument_Type is new Argument_Type with record Value : Mod_Int_Type; Width : Natural := 0; Align : Text_Align := 'R'; Fill : Character := ' '; Base : Number_Base := 10; Style : Digit_Style := DS_Lowercase; end record; overriding procedure Parse (Self : in out Mod_Int_Argument_Type; Edit : String); overriding function Get_Length (Self : in out Mod_Int_Argument_Type) return Natural; overriding procedure Put ( Self : in out Mod_Int_Argument_Type; Edit : String; To : in out String); end Fmt.Generic_Mod_Int_Argument;
src/Fragment/Examples/Semigroup/Arith/Atomic.agda
yallop/agda-fragment
18
12327
{-# OPTIONS --without-K --safe #-} module Fragment.Examples.Semigroup.Arith.Atomic where open import Fragment.Examples.Semigroup.Arith.Base -- Fully dynamic associativity dyn-assoc₁ : ∀ {m n o} → (m + n) + o ≡ m + (n + o) dyn-assoc₁ = fragment SemigroupFrex +-semigroup dyn-assoc₂ : ∀ {m n o p} → ((m + n) + o) + p ≡ m + (n + (o + p)) dyn-assoc₂ = fragment SemigroupFrex +-semigroup dyn-assoc₃ : ∀ {m n o p q} → (m + n) + o + (p + q) ≡ m + (n + o + p) + q dyn-assoc₃ = fragment SemigroupFrex +-semigroup -- Partially static associativity sta-assoc₁ : ∀ {m n} → (m + 2) + (3 + n) ≡ m + (5 + n) sta-assoc₁ = fragment SemigroupFrex +-semigroup sta-assoc₂ : ∀ {m n o p} → (((m + n) + 5) + o) + p ≡ m + (n + (2 + (3 + (o + p)))) sta-assoc₂ = fragment SemigroupFrex +-semigroup sta-assoc₃ : ∀ {m n o p} → ((m + n) + 2) + (3 + (o + p)) ≡ m + ((n + 1) + (4 + o)) + p sta-assoc₃ = fragment SemigroupFrex +-semigroup
tier-1/gmp/applet/test/minimal/minimal.adb
charlie5/cBound
2
24330
<gh_stars>1-10 with GMP.discrete; procedure Minimal is use GMP, gmp.Discrete; Distance : discrete.Integer; begin define (Distance); destroy (Distance); end;
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_1883.asm
ljhsiun2/medusa
9
172458
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r8 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xc042, %r9 nop nop nop nop xor $23266, %rbx movb (%r9), %r10b nop nop nop nop dec %rdx lea addresses_A_ht+0x169c2, %rbx nop and %r8, %r8 mov $0x6162636465666768, %r11 movq %r11, %xmm3 vmovups %ymm3, (%rbx) nop nop nop nop xor $45145, %r9 lea addresses_D_ht+0x11d3c, %rsi lea addresses_WC_ht+0x17b82, %rdi nop nop nop xor $2348, %r11 mov $90, %rcx rep movsb nop nop nop inc %rdx lea addresses_A_ht+0x1e642, %rdx nop nop nop xor %r9, %r9 vmovups (%rdx), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %r10 nop nop nop nop cmp %r10, %r10 lea addresses_WC_ht+0x16642, %r9 nop nop nop nop nop cmp %rdx, %rdx mov (%r9), %edi nop nop nop inc %r11 lea addresses_normal_ht+0x17693, %rsi lea addresses_WT_ht+0x8042, %rdi nop nop nop nop sub %r10, %r10 mov $16, %rcx rep movsl nop nop nop xor %rdi, %rdi lea addresses_D_ht+0x4902, %rsi lea addresses_normal_ht+0x1d692, %rdi clflush (%rsi) sub $39999, %r11 mov $42, %rcx rep movsq nop cmp %r8, %r8 lea addresses_WC_ht+0x2942, %rdx nop nop nop nop add $16418, %r11 movw $0x6162, (%rdx) nop nop nop nop cmp %rdx, %rdx lea addresses_normal_ht+0x9e42, %rcx nop nop nop nop nop xor $1894, %rdi mov $0x6162636465666768, %rdx movq %rdx, %xmm7 and $0xffffffffffffffc0, %rcx vmovntdq %ymm7, (%rcx) nop sub $42325, %r11 lea addresses_D_ht+0x81d2, %r8 nop nop nop add $4722, %rdx mov $0x6162636465666768, %rdi movq %rdi, %xmm4 vmovups %ymm4, (%r8) nop nop nop nop add $40738, %rsi lea addresses_WC_ht+0x1487a, %rsi lea addresses_D_ht+0xbe42, %rdi nop nop xor %r10, %r10 mov $48, %rcx rep movsq nop cmp $52720, %r10 lea addresses_D_ht+0x19e42, %rsi lea addresses_WT_ht+0x1df52, %rdi sub $36346, %r9 mov $127, %rcx rep movsw nop nop nop nop nop xor %rbx, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %rcx push %rdx push %rsi // Store lea addresses_A+0xbe42, %r11 nop nop nop xor $63866, %r13 movw $0x5152, (%r11) nop and %rsi, %rsi // Load lea addresses_RW+0x1c282, %rdx nop nop add $53935, %r14 movb (%rdx), %r13b nop sub %rsi, %rsi // Load mov $0xe42, %r11 nop nop nop nop and $22296, %r14 vmovups (%r11), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rsi add %r11, %r11 // Store lea addresses_WT+0x642, %r10 sub $3256, %rdx movw $0x5152, (%r10) nop nop dec %r10 // Faulty Load lea addresses_PSE+0x1ee42, %r11 xor %r13, %r13 mov (%r11), %r14 lea oracles, %rsi and $0xff, %r14 shlq $12, %r14 mov (%rsi,%r14,1), %r14 pop %rsi pop %rdx pop %rcx pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'dst': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_P'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 5, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 10, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 4, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
test/Succeed/WarningOnImport/Impo.agda
cruhland/agda
1,989
7374
<gh_stars>1000+ module WarningOnImport.Impo where B = Set A = B {-# WARNING_ON_USAGE A "Deprecated: Use B instead" #-} {-# WARNING_ON_IMPORT "Deprecated: Use Impossible instead" #-}
alloy4fun_models/trashltl/models/10/A2ige6mbXYD9LqpQi.als
Kaixi26/org.alloytools.alloy
0
4411
<filename>alloy4fun_models/trashltl/models/10/A2ige6mbXYD9LqpQi.als<gh_stars>0 open main pred idA2ige6mbXYD9LqpQi_prop11 { always after ((File & Protected) in Protected) } pred __repair { idA2ige6mbXYD9LqpQi_prop11 } check __repair { idA2ige6mbXYD9LqpQi_prop11 <=> prop11o }
testsuite/tests/Q612-015__Ada_runtime_fullpath/a-cohamb.adb
AdaCore/style_checker
2
1849
<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.HASHED_MAPS -- -- -- -- B o d y -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This unit was originally developed by <NAME>. -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Ada.Containers.Hash_Tables.Generic_Operations; pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Operations); with Ada.Containers.Hash_Tables.Generic_Keys; pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Keys); package body Ada.Containers.Hashed_Maps is ----------------------- -- Local Subprograms -- ----------------------- function Copy_Node (Source : Node_Access) return Node_Access; pragma Inline (Copy_Node); function Equivalent_Keys (Key : Key_Type; Node : Node_Access) return Boolean; pragma Inline (Equivalent_Keys); function Find_Equal_Key (R_HT : Hash_Table_Type; L_Node : Node_Access) return Boolean; function Hash_Node (Node : Node_Access) return Hash_Type; pragma Inline (Hash_Node); function Next (Node : Node_Access) return Node_Access; pragma Inline (Next); function Read_Node (Stream : access Root_Stream_Type'Class) return Node_Access; pragma Inline (Read_Node); procedure Set_Next (Node : Node_Access; Next : Node_Access); pragma Inline (Set_Next); procedure Write_Node (Stream : access Root_Stream_Type'Class; Node : Node_Access); pragma Inline (Write_Node); -------------------------- -- Local Instantiations -- -------------------------- procedure Free is new Ada.Unchecked_Deallocation (Node_Type, Node_Access); package HT_Ops is new Hash_Tables.Generic_Operations (HT_Types => HT_Types, Hash_Node => Hash_Node, Next => Next, Set_Next => Set_Next, Copy_Node => Copy_Node, Free => Free); package Key_Ops is new Hash_Tables.Generic_Keys (HT_Types => HT_Types, Next => Next, Set_Next => Set_Next, Key_Type => Key_Type, Hash => Hash, Equivalent_Keys => Equivalent_Keys); function Is_Equal is new HT_Ops.Generic_Equal (Find_Equal_Key); procedure Read_Nodes is new HT_Ops.Generic_Read (Read_Node); procedure Write_Nodes is new HT_Ops.Generic_Write (Write_Node); --------- -- "=" -- --------- function "=" (Left, Right : Map) return Boolean is begin return Is_Equal (Left.HT, Right.HT); end "="; ------------ -- Adjust -- ------------ procedure Adjust (Container : in out Map) is begin HT_Ops.Adjust (Container.HT); end Adjust; -------------- -- Capacity -- -------------- function Capacity (Container : Map) return Count_Type is begin return HT_Ops.Capacity (Container.HT); end Capacity; ----------- -- Clear -- ----------- procedure Clear (Container : in out Map) is begin HT_Ops.Clear (Container.HT); end Clear; -------------- -- Contains -- -------------- function Contains (Container : Map; Key : Key_Type) return Boolean is begin return Find (Container, Key) /= No_Element; end Contains; --------------- -- Copy_Node -- --------------- function Copy_Node (Source : Node_Access) return Node_Access is Target : constant Node_Access := new Node_Type'(Key => Source.Key, Element => Source.Element, Next => null); begin return Target; end Copy_Node; ------------ -- Delete -- ------------ procedure Delete (Container : in out Map; Key : Key_Type) is X : Node_Access; begin Key_Ops.Delete_Key_Sans_Free (Container.HT, Key, X); if X = null then raise Constraint_Error; end if; Free (X); end Delete; procedure Delete (Container : in out Map; Position : in out Cursor) is begin if Position = No_Element then return; end if; if Position.Container /= Map_Access'(Container'Unchecked_Access) then raise Program_Error; end if; HT_Ops.Delete_Node_Sans_Free (Container.HT, Position.Node); Free (Position.Node); Position.Container := null; end Delete; ------------- -- Element -- ------------- function Element (Container : Map; Key : Key_Type) return Element_Type is C : constant Cursor := Find (Container, Key); begin return C.Node.Element; end Element; function Element (Position : Cursor) return Element_Type is begin return Position.Node.Element; end Element; --------------------- -- Equivalent_Keys -- --------------------- function Equivalent_Keys (Key : Key_Type; Node : Node_Access) return Boolean is begin return Equivalent_Keys (Key, Node.Key); end Equivalent_Keys; --------------------- -- Equivalent_Keys -- --------------------- function Equivalent_Keys (Left, Right : Cursor) return Boolean is begin return Equivalent_Keys (Left.Node.Key, Right.Node.Key); end Equivalent_Keys; function Equivalent_Keys (Left : Cursor; Right : Key_Type) return Boolean is begin return Equivalent_Keys (Left.Node.Key, Right); end Equivalent_Keys; function Equivalent_Keys (Left : Key_Type; Right : Cursor) return Boolean is begin return Equivalent_Keys (Left, Right.Node.Key); end Equivalent_Keys; ------------- -- Exclude -- ------------- procedure Exclude (Container : in out Map; Key : Key_Type) is X : Node_Access; begin Key_Ops.Delete_Key_Sans_Free (Container.HT, Key, X); Free (X); end Exclude; -------------- -- Finalize -- -------------- procedure Finalize (Container : in out Map) is begin HT_Ops.Finalize (Container.HT); end Finalize; ---------- -- Find -- ---------- function Find (Container : Map; Key : Key_Type) return Cursor is Node : constant Node_Access := Key_Ops.Find (Container.HT, Key); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unchecked_Access, Node); end Find; -------------------- -- Find_Equal_Key -- -------------------- function Find_Equal_Key (R_HT : Hash_Table_Type; L_Node : Node_Access) return Boolean is R_Index : constant Hash_Type := Key_Ops.Index (R_HT, L_Node.Key); R_Node : Node_Access := R_HT.Buckets (R_Index); begin while R_Node /= null loop if Equivalent_Keys (L_Node.Key, R_Node.Key) then return L_Node.Element = R_Node.Element; end if; R_Node := R_Node.Next; end loop; return False; end Find_Equal_Key; ----------- -- First -- ----------- function First (Container : Map) return Cursor is Node : constant Node_Access := HT_Ops.First (Container.HT); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unchecked_Access, Node); end First; ----------------- -- Has_Element -- ----------------- function Has_Element (Position : Cursor) return Boolean is begin return Position /= No_Element; end Has_Element; --------------- -- Hash_Node -- --------------- function Hash_Node (Node : Node_Access) return Hash_Type is begin return Hash (Node.Key); end Hash_Node; ------------- -- Include -- ------------- procedure Include (Container : in out Map; Key : Key_Type; New_Item : Element_Type) is Position : Cursor; Inserted : Boolean; begin Insert (Container, Key, New_Item, Position, Inserted); if not Inserted then Position.Node.Key := Key; Position.Node.Element := New_Item; end if; end Include; ------------ -- Insert -- ------------ procedure Insert (Container : in out Map; Key : Key_Type; Position : out Cursor; Inserted : out Boolean) is function New_Node (Next : Node_Access) return Node_Access; pragma Inline (New_Node); procedure Local_Insert is new Key_Ops.Generic_Conditional_Insert (New_Node); -------------- -- New_Node -- -------------- function New_Node (Next : Node_Access) return Node_Access is Node : Node_Access := new Node_Type; -- Ada 2005 aggregate possible? begin Node.Key := Key; Node.Next := Next; return Node; exception when others => Free (Node); raise; end New_Node; HT : Hash_Table_Type renames Container.HT; -- Start of processing for Insert begin if HT.Length >= HT_Ops.Capacity (HT) then HT_Ops.Reserve_Capacity (HT, HT.Length + 1); end if; Local_Insert (HT, Key, Position.Node, Inserted); Position.Container := Container'Unchecked_Access; end Insert; procedure Insert (Container : in out Map; Key : Key_Type; New_Item : Element_Type; Position : out Cursor; Inserted : out Boolean) is function New_Node (Next : Node_Access) return Node_Access; pragma Inline (New_Node); procedure Local_Insert is new Key_Ops.Generic_Conditional_Insert (New_Node); -------------- -- New_Node -- -------------- function New_Node (Next : Node_Access) return Node_Access is Node : constant Node_Access := new Node_Type'(Key, New_Item, Next); begin return Node; end New_Node; HT : Hash_Table_Type renames Container.HT; -- Start of processing for Insert begin if HT.Length >= HT_Ops.Capacity (HT) then HT_Ops.Reserve_Capacity (HT, HT.Length + 1); end if; Local_Insert (HT, Key, Position.Node, Inserted); Position.Container := Container'Unchecked_Access; end Insert; procedure Insert (Container : in out Map; Key : Key_Type; New_Item : Element_Type) is Position : Cursor; Inserted : Boolean; begin Insert (Container, Key, New_Item, Position, Inserted); if not Inserted then raise Constraint_Error; end if; end Insert; -------------- -- Is_Empty -- -------------- function Is_Empty (Container : Map) return Boolean is begin return Container.Length = 0; end Is_Empty; ------------- -- Iterate -- ------------- procedure Iterate (Container : Map; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Node_Access); pragma Inline (Process_Node); procedure Local_Iterate is new HT_Ops.Generic_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Node_Access) is begin Process (Cursor'(Container'Unchecked_Access, Node)); end Process_Node; -- Start of processing for Iterate begin Local_Iterate (Container.HT); end Iterate; --------- -- Key -- --------- function Key (Position : Cursor) return Key_Type is begin return Position.Node.Key; end Key; ------------ -- Length -- ------------ function Length (Container : Map) return Count_Type is begin return Container.HT.Length; end Length; ---------- -- Move -- ---------- procedure Move (Target : in out Map; Source : in out Map) is begin HT_Ops.Move (Target => Target.HT, Source => Source.HT); end Move; ---------- -- Next -- ---------- function Next (Node : Node_Access) return Node_Access is begin return Node.Next; end Next; function Next (Position : Cursor) return Cursor is begin if Position = No_Element then return No_Element; end if; declare M : Map renames Position.Container.all; Node : constant Node_Access := HT_Ops.Next (M.HT, Position.Node); begin if Node = null then return No_Element; end if; return Cursor'(Position.Container, Node); end; end Next; procedure Next (Position : in out Cursor) is begin Position := Next (Position); end Next; ------------------- -- Query_Element -- ------------------- procedure Query_Element (Position : Cursor; Process : not null access procedure (Element : Element_Type)) is begin Process (Position.Node.Key, Position.Node.Element); end Query_Element; ---------- -- Read -- ---------- procedure Read (Stream : access Root_Stream_Type'Class; Container : out Map) is begin Read_Nodes (Stream, Container.HT); end Read; --------------- -- Read_Node -- --------------- function Read_Node (Stream : access Root_Stream_Type'Class) return Node_Access is Node : Node_Access := new Node_Type; begin Key_Type'Read (Stream, Node.Key); Element_Type'Read (Stream, Node.Element); return Node; exception when others => Free (Node); raise; end Read_Node; ------------- -- Replace -- ------------- procedure Replace (Container : in out Map; Key : Key_Type; New_Item : Element_Type) is Node : constant Node_Access := Key_Ops.Find (Container.HT, Key); begin if Node = null then raise Constraint_Error; end if; Node.Key := Key; Node.Element := New_Item; end Replace; --------------------- -- Replace_Element -- --------------------- procedure Replace_Element (Position : Cursor; By : Element_Type) is begin Position.Node.Element := By; end Replace_Element; ---------------------- -- Reserve_Capacity -- ---------------------- procedure Reserve_Capacity (Container : in out Map; Capacity : Count_Type) is begin HT_Ops.Reserve_Capacity (Container.HT, Capacity); end Reserve_Capacity; -------------- -- Set_Next -- -------------- procedure Set_Next (Node : Node_Access; Next : Node_Access) is begin Node.Next := Next; end Set_Next; -------------------- -- Update_Element -- -------------------- procedure Update_Element (Position : Cursor; Process : not null access procedure (Element : in out Element_Type)) is begin Process (Position.Node.Key, Position.Node.Element); end Update_Element; ----------- -- Write -- ----------- procedure Write (Stream : access Root_Stream_Type'Class; Container : Map) is begin Write_Nodes (Stream, Container.HT); end Write; ---------------- -- Write_Node -- ---------------- procedure Write_Node (Stream : access Root_Stream_Type'Class; Node : Node_Access) is begin Key_Type'Write (Stream, Node.Key); Element_Type'Write (Stream, Node.Element); end Write_Node; end Ada.Containers.Hashed_Maps;
Kernel/idt.asm
heyimnowi/arqui-os
0
82976
GLOBAL _irq00handler GLOBAL _irq01handler GLOBAL _int80handler GLOBAL _sti GLOBAL _cli GLOBAL picMasterMask GLOBAL picSlaveMask EXTERN keyboardHandler EXTERN timertickHandler EXTERN syscallHandler EXTERN _vWrite %macro pushaq 0 push rax ;save current rax push rbx ;save current rbx push rcx ;save current rcx push rdx ;savepushaq current rdx push rbp ;save current rbp push rdi ;save current rdi push rsi ;save current rsi push r8 ;save current r8 push r9 ;save current r9 push r10 ;save current r10 push r11 ;save current r11 push r12 ;save current r12 push r13 ;save current r13 push r14 ;save current r14 push r15 ;save current r15 %endmacro %macro popaq 0 pop r15 pop r14 pop r13 pop r12 pop r11 pop r10 pop r9 pop r8 pop rsi pop rdi pop rbp pop rdx pop rcx pop rbx pop rax %endmacro %macro END_INT 0 mov al, 20h ; Acknowledge interruption was treated out PIC_MASTER_CONTROL, al ; and PIC can recieve the next one popaq iretq %endmacro section .text ; Constants PIC_MASTER_CONTROL equ 0x20 PIC_MASTER_MASK equ 0x21 PIC_SLAVE_CONTROL equ 0xA0 PIC_SLAVE_MASK equ 0xA1 KBD_PORT equ 0x60 KBD_STATUS equ 0x61 ; Disable interruptions _cli: cli ret ; Enable interruptions _sti: sti ret picMasterMask: push rbp mov rbp, rsp mov ax, si out PIC_MASTER_MASK, al pop rbp retn picSlaveMask: push rbp mov rbp, rsp mov ax, si out PIC_SLAVE_MASK, al pop rbp retn ; Timer tick _irq00handler: pushaq call timertickHandler END_INT ; Keyboard _irq01handler: pushaq in al, KBD_PORT mov rdi, rax call keyboardHandler in al, KBD_STATUS or al, 80h out KBD_STATUS, al and al, 7Fh out KBD_STATUS, al END_INT ; System call ; recieves the system call code in rax ; and parameters in rdi, rsi, rdx, r10, r8 and r9 ; We won't be using more than 3 params _int80handler: pushaq mov rcx, rdx mov rdx, rsi mov rsi, rdi mov rdi, rax call syscallHandler popaq iretq
Task/Sorting-algorithms-Gnome-sort/Ada/sorting-algorithms-gnome-sort-2.ada
LaudateCorpus1/RosettaCodeData
1
13172
procedure Gnome_Sort(Item : in out Collection) is procedure Swap(Left, Right : in out Element_Type) is Temp : Element_Type := Left; begin Left := Right; Right := Temp; end Swap; I : Integer := Index'Pos(Index'Succ(Index'First)); J : Integer := I + 1; begin while I <= Index'Pos(Index'Last) loop if Item(Index'Val(I - 1)) <= Item(Index'Val(I)) then I := J; J := J + 1; else Swap(Item(Index'Val(I - 1)), Item(Index'Val(I))); I := I - 1; if I = Index'Pos(Index'First) then I := J; J := J + 1; end if; end if; end loop; end Gnome_Sort;
interfacing 7 segment display with proteous/source_code_in_emu8086.asm
L12161/assembly_habijabi
0
13920
; Main.asm file generated by New Project wizard ; ; Created: Fri May 28 2021 ; Processor: 8086 ; Compiler: MASM32 ; ; Before starting simulation set Internal Memory Size ; in the 8086 model properties to 0x10000 ;==================================================================== DATA SEGMENT P_A EQU 00H P_B EQU 02H P_C EQU 04H CONNECT EQU 06H DATA ENDS CODE SEGMENT ASSUME CS:CODE ASSUME DS:CODE ASSUME ES:CODE ASSUME SS:CODE ORG 0000H ; MOV AX, DATA MOV DS, AX MOV AL, 10000000B ; OUT CONNECT, AL MAIN_LOOP: ; HUNDREADTH POSITIONAL DATA MOV AL, 11000000B OUT P_A, AL ; TENTH POSITIONAL DATA MOV AL, 10110000B OUT P_B, AL ; UNIT POSITIONAL DATA MOV AL, 10000000B OUT P_C, AL ; Output data JMP MAIN_LOOP CODE ENDS END ;
src/ewok-sleep.ads
vdh-anssi/ewok-kernel
65
14719
<filename>src/ewok-sleep.ads -- -- Copyright 2018 The wookey project team <<EMAIL>> -- - <NAME> -- - <NAME> -- - <NAME> -- - <NAME> -- - <NAME> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- with config.applications; use config.applications; with ewok.exported.sleep; use ewok.exported.sleep; with ewok.tasks; with m4.systick; package ewok.sleep with spark_mode => on is awakening_time : array (t_real_task_id'range) of m4.systick.t_tick := (others => 0); -- Make the task sleeping and not executable for the given time. -- Only external events can awake the task during this period unless -- SLEEP_MODE_DEEP is selected. procedure sleeping (task_id : in t_real_task_id; ms : in milliseconds; mode : in t_sleep_mode) with global => (Output => awakening_time); -- For each task, check if it's sleeping time is over procedure check_is_awoke with global => (In_Out => (awakening_time, ewok.tasks.tasks_list)); -- Try to awake a task procedure try_waking_up (task_id : in t_real_task_id) with global => (In_Out => (awakening_time, ewok.tasks.tasks_list)); -- Check if a task is currently sleeping function is_sleeping (task_id : in t_real_task_id) return boolean with global => (Input => awakening_time); end ewok.sleep;
alloy4fun_models/trashltl/models/5/aBg7pDvBCGpDMJbHT.als
Kaixi26/org.alloytools.alloy
0
4219
open main pred idaBg7pDvBCGpDMJbHT_prop6 { } pred __repair { idaBg7pDvBCGpDMJbHT_prop6 } check __repair { idaBg7pDvBCGpDMJbHT_prop6 <=> prop6o }
oeis/167/A167469.asm
neoneye/loda-programs
11
13058
<filename>oeis/167/A167469.asm ; A167469: a(n) = 3*n*(5*n-1)/2. ; 6,27,63,114,180,261,357,468,594,735,891,1062,1248,1449,1665,1896,2142,2403,2679,2970,3276,3597,3933,4284,4650,5031,5427,5838,6264,6705,7161,7632,8118,8619,9135,9666,10212,10773,11349,11940,12546,13167,13803,14454,15120,15801,16497,17208,17934,18675,19431,20202,20988,21789,22605,23436,24282,25143,26019,26910,27816,28737,29673,30624,31590,32571,33567,34578,35604,36645,37701,38772,39858,40959,42075,43206,44352,45513,46689,47880,49086,50307,51543,52794,54060,55341,56637,57948,59274,60615,61971 mul $0,5 add $0,5 bin $0,2 div $0,5 mul $0,3
Source/eu.modelwriter.core.alloyinecore/src/test/resources/kodkod/pigeonhole.als
ModelWriter/AlloyInEcore
2
4556
sig Pigeon { hole: Hole } sig Hole {} fact {no disj p1, p2: Pigeon | p1.hole = p2.hole} pred aPigeonPerHole() { // holes are not shared -- all p1, p2: Pigeon | p1 != p2 implies p1.hole != p2.hole -- all p1, p2: Pigeon, h1, h2: Hole | p1 != p2 => p1.hole != p2.hole -- no disj p1, p2: Pigeon | p1.hole = p2.hole } run aPigeonPerHole for exactly 4 Pigeon, exactly 4 Hole
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95085a.ada
best08618/asylo
7
20395
-- C95085A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT CONSTRAINT_ERROR IS RAISED FOR OUT OF RANGE SCALAR -- ARGUMENTS. SUBTESTS ARE: -- (A) STATIC IN ARGUMENT. -- (B) DYNAMIC IN ARGUMENT. -- (C) IN OUT, OUT OF RANGE ON CALL. -- (D) OUT, OUT OF RANGE ON RETURN. -- (E) IN OUT, OUT OF RANGE ON RETURN. -- GLH 7/15/85 -- JRK 8/23/85 -- JWC 11/15/85 ADDED VARIABLE "CALLED" TO ENSURE THAT THE ENTRY -- CALL WAS MADE FOR THOSE CASES THAT ARE APPLICABLE. WITH REPORT; USE REPORT; PROCEDURE C95085A IS SUBTYPE DIGIT IS INTEGER RANGE 0..9; D : DIGIT; I : INTEGER; M1 : CONSTANT INTEGER := IDENT_INT (-1); COUNT : INTEGER := 0; CALLED : BOOLEAN; SUBTYPE SI IS INTEGER RANGE M1 .. 10; TASK T1 IS ENTRY E1 (PIN : IN DIGIT; WHO : STRING); -- (A), (B). END T1; TASK BODY T1 IS BEGIN LOOP BEGIN SELECT ACCEPT E1 (PIN : IN DIGIT; WHO : STRING) DO -- (A), (B). FAILED ("EXCEPTION NOT RAISED BEFORE " & "CALL - E1 " & WHO); END E1; OR TERMINATE; END SELECT; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN E1"); END; END LOOP; END T1; TASK T2 IS ENTRY E2 (PINOUT : IN OUT DIGIT; WHO : STRING); -- (C). END T2; TASK BODY T2 IS BEGIN LOOP BEGIN SELECT ACCEPT E2 (PINOUT : IN OUT DIGIT; WHO : STRING) DO -- (C). FAILED ("EXCEPTION NOT RAISED BEFORE " & "CALL - E2 " & WHO); END E2; OR TERMINATE; END SELECT; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN E2"); END; END LOOP; END T2; TASK T3 IS ENTRY E3 (POUT : OUT SI; WHO : STRING); -- (D). END T3; TASK BODY T3 IS BEGIN LOOP BEGIN SELECT ACCEPT E3 (POUT : OUT SI; WHO : STRING) DO -- (D). CALLED := TRUE; IF WHO = "10" THEN POUT := IDENT_INT (10); -- 10 IS NOT -- A DIGIT. ELSE POUT := -1; END IF; END E3; OR TERMINATE; END SELECT; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN E3"); END; END LOOP; END T3; TASK T4 IS ENTRY E4 (PINOUT : IN OUT INTEGER; WHO : STRING); -- (E). END T4; TASK BODY T4 IS BEGIN LOOP BEGIN SELECT ACCEPT E4 (PINOUT : IN OUT INTEGER; WHO : STRING) DO -- (E). CALLED := TRUE; IF WHO = "10" THEN PINOUT := 10; -- 10 IS NOT A DIGIT. ELSE PINOUT := IDENT_INT (-1); END IF; END E4; OR TERMINATE; END SELECT; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN E4"); END; END LOOP; END T4; BEGIN TEST ("C95085A", "CHECK THAT CONSTRAINT_ERROR IS RAISED " & "FOR OUT OF RANGE SCALAR ARGUMENTS"); BEGIN -- (A) T1.E1 (10, "10"); FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E1 (10)"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E1 (10)"); END; -- (A) BEGIN -- (B) T1.E1 (IDENT_INT (-1), "-1"); FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E1 (" & "IDENT_INT (-1))"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E1 (" & "IDENT_INT (-1))"); END; -- (B) BEGIN -- (C) I := IDENT_INT (10); T2.E2 (I, "10"); FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E2 (10)"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E2 (10)"); END; -- (C) BEGIN -- (C1) I := IDENT_INT (-1); T2.E2 (I, "-1"); FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E2 (-1)"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E2 (-1)"); END; -- (C1) BEGIN -- (D) CALLED := FALSE; D := IDENT_INT (1); T3.E3 (D, "10"); FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " & "E3 (10)"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; IF NOT CALLED THEN FAILED ("EXCEPTION RAISED BEFORE CALL " & "E3 (10)"); END IF; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E3 (10)"); END; -- (D) BEGIN -- (D1) CALLED := FALSE; D := IDENT_INT (1); T3.E3 (D, "-1"); FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " & "E3 (-1)"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; IF NOT CALLED THEN FAILED ("EXCEPTION RAISED BEFORE CALL " & "E3 (-1)"); END IF; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E3 (-1)"); END; -- (D1) BEGIN -- (E) CALLED := FALSE; D := 9; T4.E4 (D, "10"); FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " & "E4 (10)"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; IF NOT CALLED THEN FAILED ("EXCEPTION RAISED BEFORE CALL " & "E4 (10)"); END IF; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E4 (10)"); END; -- (E) BEGIN -- (E1) CALLED := FALSE; D := 0; T4.E4 (D, "-1"); FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " & "E4 (-1)"); EXCEPTION WHEN CONSTRAINT_ERROR => COUNT := COUNT + 1; IF NOT CALLED THEN FAILED ("EXCEPTION RAISED BEFORE CALL " & "E4 (-1)"); END IF; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR E4 (-1)"); END; -- (E1) IF COUNT /= 8 THEN FAILED ("INCORRECT NUMBER OF CONSTRAINT_ERRORS RAISED"); END IF; RESULT; END C95085A;
Task/Death-Star/Ada/death-star.ada
mullikine/RosettaCodeData
1
22368
<reponame>mullikine/RosettaCodeData with Ada.Numerics.Elementary_Functions; with Ada.Numerics.Generic_Real_Arrays; with SDL.Video.Windows.Makers; with SDL.Video.Renderers.Makers; with SDL.Video.Palettes; with SDL.Events.Events; procedure Death_Star is Width : constant := 400; Height : constant := 400; package Float_Arrays is new Ada.Numerics.Generic_Real_Arrays (Float); use Ada.Numerics.Elementary_Functions; use Float_Arrays; Window : SDL.Video.Windows.Window; Renderer : SDL.Video.Renderers.Renderer; subtype Vector_3 is Real_Vector (1 .. 3); type Sphere_Type is record Cx, Cy, Cz : Integer; R : Integer; end record; function Normalize (V : Vector_3) return Vector_3 is (V / Sqrt (V * V)); procedure Hit (S : Sphere_Type; X, Y : Integer; Z1, Z2 : out Float; Is_Hit : out Boolean) is NX : constant Integer := X - S.Cx; NY : constant Integer := Y - S.Cy; Zsq : constant Integer := S.R * S.R - (NX * NX + NY * NY); Zsqrt : Float; begin if Zsq >= 0 then Zsqrt := Sqrt (Float (Zsq)); Z1 := Float (S.Cz) - Zsqrt; Z2 := Float (S.Cz) + Zsqrt; Is_Hit := True; return; end if; Z1 := 0.0; Z2 := 0.0; Is_Hit := False; end Hit; procedure Draw_Death_Star (Pos, Neg : Sphere_Type; K, Amb : Float; Dir : Vector_3) is Vec : Vector_3; ZB1, ZB2 : Float; ZS1, ZS2 : Float; Is_Hit : Boolean; S : Float; Lum : Integer; begin for Y in Pos.Cy - Pos.R .. Pos.Cy + Pos.R loop for X in Pos.Cx - Pos.R .. Pos.Cx + Pos.R loop Hit (Pos, X, Y, ZB1, ZB2, Is_Hit); if not Is_Hit then goto Continue; end if; Hit (Neg, X, Y, ZS1, ZS2, Is_Hit); if Is_Hit then if ZS1 > ZB1 then Is_Hit := False; elsif ZS2 > ZB2 then goto Continue; end if; end if; if Is_Hit then Vec := (Float (Neg.Cx - X), Float (Neg.Cy - Y), Float (Neg.Cz) - ZS2); else Vec := (Float (X - Pos.Cx), Float (Y - Pos.Cy), ZB1 - Float (Pos.Cz)); end if; S := Float'Max (0.0, Dir * Normalize (Vec)); Lum := Integer (255.0 * (S ** K + Amb) / (1.0 + Amb)); Lum := Integer'Max (0, Lum); Lum := Integer'Min (Lum, 255); Renderer.Set_Draw_Colour ((SDL.Video.Palettes.Colour_Component (Lum), SDL.Video.Palettes.Colour_Component (Lum), SDL.Video.Palettes.Colour_Component (Lum), 255)); Renderer.Draw (Point => (SDL.C.int (X + Width / 2), SDL.C.int (Y + Height / 2))); <<Continue>> end loop; end loop; end Draw_Death_Star; procedure Wait is use type SDL.Events.Event_Types; Event : SDL.Events.Events.Events; begin loop while SDL.Events.Events.Poll (Event) loop if Event.Common.Event_Type = SDL.Events.Quit then return; end if; end loop; delay 0.100; end loop; end Wait; Direction : constant Vector_3 := Normalize ((20.0, -40.0, -10.0)); Positive : constant Sphere_Type := (0, 0, 0, 120); Negative : constant Sphere_Type := (-90, -90, -30, 100); begin if not SDL.Initialise (Flags => SDL.Enable_Screen) then return; end if; SDL.Video.Windows.Makers.Create (Win => Window, Title => "Death star", Position => SDL.Natural_Coordinates'(X => 10, Y => 10), Size => SDL.Positive_Sizes'(Width, Height), Flags => 0); SDL.Video.Renderers.Makers.Create (Renderer, Window.Get_Surface); Renderer.Set_Draw_Colour ((0, 0, 0, 255)); Renderer.Fill (Rectangle => (0, 0, Width, Height)); Draw_Death_Star (Positive, Negative, 1.5, 0.2, Direction); Window.Update_Surface; Wait; Window.Finalize; SDL.Finalise; end Death_Star;
src/ui/ships-ui-crew-inventory.adb
thindil/steamsky
80
27960
<filename>src/ui/ships-ui-crew-inventory.adb<gh_stars>10-100 -- Copyright (c) 2020-2021 <NAME> <<EMAIL>> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Containers.Generic_Array_Sort; with Tcl.Ada; use Tcl.Ada; with Tcl.Tk.Ada; use Tcl.Tk.Ada; with Tcl.Tk.Ada.Event; use Tcl.Tk.Ada.Event; with Tcl.Tk.Ada.Grid; with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets; with Tcl.Tk.Ada.Widgets.Canvas; use Tcl.Tk.Ada.Widgets.Canvas; with Tcl.Tk.Ada.Widgets.Menu; use Tcl.Tk.Ada.Widgets.Menu; with Tcl.Tk.Ada.Widgets.Toplevel; use Tcl.Tk.Ada.Widgets.Toplevel; with Tcl.Tk.Ada.Widgets.Toplevel.MainWindow; use Tcl.Tk.Ada.Widgets.Toplevel.MainWindow; with Tcl.Tk.Ada.Widgets.TtkButton; use Tcl.Tk.Ada.Widgets.TtkButton; with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox; use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox; with Tcl.Tk.Ada.Widgets.TtkEntry.TtkSpinBox; use Tcl.Tk.Ada.Widgets.TtkEntry.TtkSpinBox; with Tcl.Tk.Ada.Widgets.TtkFrame; use Tcl.Tk.Ada.Widgets.TtkFrame; with Tcl.Tk.Ada.Widgets.TtkLabel; use Tcl.Tk.Ada.Widgets.TtkLabel; with Tcl.Tk.Ada.Widgets.TtkScrollbar; use Tcl.Tk.Ada.Widgets.TtkScrollbar; with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo; with Tcl.Tklib.Ada.Autoscroll; use Tcl.Tklib.Ada.Autoscroll; with Config; use Config; with CoreUI; use CoreUI; with Crew.Inventory; use Crew.Inventory; with Dialogs; use Dialogs; with Factions; use Factions; with Ships.Cargo; use Ships.Cargo; with Ships.Crew; use Ships.Crew; with Table; use Table; with Utils; use Utils; with Utils.UI; use Utils.UI; package body Ships.UI.Crew.Inventory is -- ****iv* SUCI/SUCI.InventoryTable -- FUNCTION -- Table with info about the crew member inventory -- SOURCE InventoryTable: Table_Widget (5); -- **** -- ****iv* SUCI/SUCI.MemberIndex -- FUNCTION -- The index of the selected crew member -- SOURCE MemberIndex: Positive; -- **** -- ****iv* SUCI/SUCI.Inventory_Indexes -- FUNCTION -- Indexes of the crew member items in inventory -- SOURCE Inventory_Indexes: Positive_Container.Vector; -- **** -- ****o* SUCI/SUCI.Update_Inventory_Command -- FUNCTION -- Update inventory list of the selected crew member -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. Unused -- Argc - Number of arguments passed to the command. -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- UpdateInventory memberindex page -- MemberIndex is the index of the crew member to show inventory, page -- is a number of the page of inventory list to show -- SOURCE function Update_Inventory_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Update_Inventory_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Interp); Member: Member_Data (Amount_Of_Attributes => Attributes_Amount, Amount_Of_Skills => Skills_Amount); Page: constant Positive := (if Argc = 3 then Positive'Value(CArgv.Arg(Argv, 2)) else 1); Start_Row: constant Positive := ((Page - 1) * Game_Settings.Lists_Limit) + 1; Current_Row: Positive := 1; begin MemberIndex := Positive'Value(CArgv.Arg(Argv, 1)); Member := Player_Ship.Crew(MemberIndex); if InventoryTable.Row > 1 then ClearTable(InventoryTable); end if; if Inventory_Indexes.Length /= Member.Inventory.Length then Inventory_Indexes.Clear; for I in Member.Inventory.Iterate loop Inventory_Indexes.Append(Inventory_Container.To_Index(I)); end loop; end if; Load_Inventory_Loop : for I of Inventory_Indexes loop if Current_Row < Start_Row then Current_Row := Current_Row + 1; goto End_Of_Loop; end if; AddButton (InventoryTable, GetItemName(Member.Inventory(I), False, False), "Show available item's options", "ShowInventoryMenu " & CArgv.Arg(Argv, 1) & Positive'Image(I), 1); AddProgressBar (InventoryTable, Member.Inventory(I).Durability, Default_Item_Durability, "The current durability level of the selected item.", "ShowInventoryMenu " & CArgv.Arg(Argv, 1) & Positive'Image(I), 2); if ItemIsUsed(MemberIndex, I) then AddCheckButton (InventoryTable, "The item is used by the crew member", "ShowInventoryMenu " & CArgv.Arg(Argv, 1) & Positive'Image(I), True, 3); else AddCheckButton (InventoryTable, "The item isn't used by the crew member", "ShowInventoryMenu " & CArgv.Arg(Argv, 1) & Positive'Image(I), False, 3); end if; AddButton (InventoryTable, Positive'Image(Member.Inventory(I).Amount), "The amount of the item owned by the crew member", "ShowInventoryMenu " & CArgv.Arg(Argv, 1) & Positive'Image(I), 4); AddButton (InventoryTable, Positive'Image (Member.Inventory(I).Amount * Items_List(Member.Inventory(I).ProtoIndex).Weight) & " kg", "The total weight of the items", "ShowInventoryMenu " & CArgv.Arg(Argv, 1) & Positive'Image(I), 5, True); exit Load_Inventory_Loop when InventoryTable.Row = Game_Settings.Lists_Limit + 1; <<End_Of_Loop>> end loop Load_Inventory_Loop; if Page > 1 then AddPagination (InventoryTable, "UpdateInventory " & CArgv.Arg(Argv, 1) & Positive'Image(Page - 1), (if InventoryTable.Row < Game_Settings.Lists_Limit + 1 then "" else "UpdateInventory " & CArgv.Arg(Argv, 1) & Positive'Image(Page + 1))); elsif InventoryTable.Row = Game_Settings.Lists_Limit + 1 then AddPagination (InventoryTable, "", "UpdateInventory " & CArgv.Arg(Argv, 1) & Positive'Image(Page + 1)); end if; UpdateTable(InventoryTable); return TCL_OK; end Update_Inventory_Command; -- ****it* SUCI/SUCI.Inventory_Sort_Orders -- FUNCTION -- Sorting orders for items inside various inventories -- OPTIONS -- NAMEASC - Sort items by name ascending -- NAMEDESC - Sort items by name descending -- DURABILITYASC - Sort items by durability ascending -- DURABILITYDESC - Sort items by durability descending -- TYPEASC - Sort items by type ascending -- TYPEDESC - Sort items by type descending -- AMOUNTASC - Sort items by amount ascending -- AMOUNTDESC - Sort items by amount descending -- WEIGHTASC - Sort items by total weight ascending -- WEIGHTDESC - Sort items by total weight descending -- USEDASC - Sort items by use status (mobs inventory only) ascending -- USEDDESC - Sort items by use status (mobs inventory only) descending -- NONE - No sorting items (default) -- HISTORY -- 6.4 - Added -- SOURCE type Inventory_Sort_Orders is (NAMEASC, NAMEDESC, DURABILITYASC, DURABILITYDESC, TYPEASC, TYPEDESC, AMOUNTASC, AMOUNTDESC, WEIGHTASC, WEIGHTDESC, USEDASC, USEDDESC, NONE) with Default_Value => NONE; -- **** -- ****id* SUCI/SUCI.Default_Inventory_Sort_Order -- FUNCTION -- Default sorting order for items in various inventories -- HISTORY -- 6.4 - Added -- SOURCE Default_Inventory_Sort_Order: constant Inventory_Sort_Orders := NONE; -- **** -- ****iv* SUCI/SUCI.Inventory_Sort_Order -- FUNCTION -- The current sorting order of items in various inventories -- SOURCE Inventory_Sort_Order: Inventory_Sort_Orders := Default_Inventory_Sort_Order; -- **** -- ****o* SUCI/SUCI.Sort_Crew_Inventory_Command -- FUNCTION -- Sort the selected crew member inventory -- PARAMETERS -- ClientData - Custom data send to the command. -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- SortCrewInventory x -- X is X axis coordinate where the player clicked the mouse button -- SOURCE function Sort_Crew_Inventory_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Sort_Crew_Inventory_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(Argc); Column: constant Positive := (if CArgv.Arg(Argv, 1) = "-1" then Positive'Last else Get_Column_Number (InventoryTable, Natural'Value(CArgv.Arg(Argv, 1)))); type Local_Item_Data is record Name: Unbounded_String; Damage: Float; Item_Type: Unbounded_String; Amount: Positive; Weight: Positive; Used: Boolean; Id: Positive; end record; type Inventory_Array is array(Positive range <>) of Local_Item_Data; Local_Inventory: Inventory_Array (1 .. Positive(Player_Ship.Crew(MemberIndex).Inventory.Length)); function "<"(Left, Right: Local_Item_Data) return Boolean is begin if Inventory_Sort_Order = NAMEASC and then Left.Name < Right.Name then return True; end if; if Inventory_Sort_Order = NAMEDESC and then Left.Name > Right.Name then return True; end if; if Inventory_Sort_Order = DURABILITYASC and then Left.Damage < Right.Damage then return True; end if; if Inventory_Sort_Order = DURABILITYDESC and then Left.Damage > Right.Damage then return True; end if; if Inventory_Sort_Order = TYPEASC and then Left.Item_Type < Right.Item_Type then return True; end if; if Inventory_Sort_Order = TYPEDESC and then Left.Item_Type > Right.Item_Type then return True; end if; if Inventory_Sort_Order = AMOUNTASC and then Left.Amount < Right.Amount then return True; end if; if Inventory_Sort_Order = AMOUNTDESC and then Left.Amount > Right.Amount then return True; end if; if Inventory_Sort_Order = WEIGHTASC and then Left.Weight < Right.Weight then return True; end if; if Inventory_Sort_Order = WEIGHTDESC and then Left.Weight > Right.Weight then return True; end if; if Inventory_Sort_Order = USEDASC and then Left.Used < Right.Used then return True; end if; if Inventory_Sort_Order = USEDDESC and then Left.Used > Right.Used then return True; end if; return False; end "<"; procedure Sort_Inventory is new Ada.Containers.Generic_Array_Sort (Index_Type => Positive, Element_Type => Local_Item_Data, Array_Type => Inventory_Array); begin case Column is when 1 => if Inventory_Sort_Order = NAMEASC then Inventory_Sort_Order := NAMEDESC; else Inventory_Sort_Order := NAMEASC; end if; when 2 => if Inventory_Sort_Order = DURABILITYASC then Inventory_Sort_Order := DURABILITYDESC; else Inventory_Sort_Order := DURABILITYASC; end if; when 3 => if Inventory_Sort_Order = USEDASC then Inventory_Sort_Order := USEDDESC; else Inventory_Sort_Order := USEDASC; end if; when 4 => if Inventory_Sort_Order = AMOUNTASC then Inventory_Sort_Order := AMOUNTDESC; else Inventory_Sort_Order := AMOUNTASC; end if; when 5 => if Inventory_Sort_Order = WEIGHTASC then Inventory_Sort_Order := WEIGHTDESC; else Inventory_Sort_Order := WEIGHTASC; end if; when others => null; end case; if Inventory_Sort_Order = NONE then return Update_Inventory_Command (ClientData, Interp, 2, CArgv.Empty & "UpdateInventory" & Trim(Positive'Image(MemberIndex), Left)); end if; for I in Player_Ship.Crew(MemberIndex).Inventory.Iterate loop Local_Inventory(Inventory_Container.To_Index(I)) := (Name => To_Unbounded_String (GetItemName (Player_Ship.Crew(MemberIndex).Inventory(I), False, False)), Damage => Float(Player_Ship.Crew(MemberIndex).Inventory(I).Durability) / Float(Default_Item_Durability), Item_Type => (if Items_List (Player_Ship.Crew(MemberIndex).Inventory(I).ProtoIndex) .ShowType /= Null_Unbounded_String then Items_List (Player_Ship.Crew(MemberIndex).Inventory(I).ProtoIndex) .ShowType else Items_List (Player_Ship.Crew(MemberIndex).Inventory(I).ProtoIndex) .IType), Amount => Player_Ship.Crew(MemberIndex).Inventory(I).Amount, Weight => Player_Ship.Crew(MemberIndex).Inventory(I).Amount * Items_List(Player_Ship.Crew(MemberIndex).Inventory(I).ProtoIndex) .Weight, Used => ItemIsUsed(MemberIndex, Inventory_Container.To_Index(I)), Id => Inventory_Container.To_Index(I)); end loop; Sort_Inventory(Local_Inventory); Inventory_Indexes.Clear; for Item of Local_Inventory loop Inventory_Indexes.Append(Item.Id); end loop; return Update_Inventory_Command (ClientData, Interp, 2, CArgv.Empty & "UpdateInventory" & Trim(Positive'Image(MemberIndex), Left)); end Sort_Crew_Inventory_Command; -- ****o* SUCI/SUCI.Show_Member_Inventory_Command -- FUNCTION -- Show inventory of the selected crew member -- PARAMETERS -- ClientData - Custom data send to the command. -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ShowMemberInventory memberindex -- MemberIndex is the index of the crew member to show inventory -- SOURCE function Show_Member_Inventory_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Member_Inventory_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is MemberDialog: constant Ttk_Frame := Create_Dialog (Name => ".memberdialog", Title => "Inventory of " & To_String (Player_Ship.Crew(Positive'Value(CArgv.Arg(Argv, 1))).Name), Columns => 2); YScroll: constant Ttk_Scrollbar := Create (MemberDialog & ".yscroll", "-orient vertical -command [list .memberdialog.canvas yview]"); MemberCanvas: constant Tk_Canvas := Create (MemberDialog & ".canvas", "-yscrollcommand [list " & YScroll & " set]"); MemberFrame: constant Ttk_Frame := Create(MemberCanvas & ".frame"); Height, Width: Positive := 10; FreeSpaceLabel: constant Ttk_Label := Create (MemberFrame & ".freespace", "-text {Free inventory space:" & Integer'Image (FreeInventory(Positive'Value(CArgv.Arg(Argv, 1)), 0)) & " kg} -wraplength 400"); Close_Button: constant Ttk_Button := Create (MemberDialog & ".button", "-text Close -command {CloseDialog " & MemberDialog & "}"); begin Tcl.Tk.Ada.Grid.Grid(MemberCanvas, "-padx 5 -pady 5"); Tcl.Tk.Ada.Grid.Grid (YScroll, "-row 1 -column 1 -padx 5 -pady 5 -sticky ns"); Autoscroll(YScroll); Tcl.Tk.Ada.Grid.Grid(FreeSpaceLabel); Height := Height + Positive'Value(Winfo_Get(FreeSpaceLabel, "reqheight")); InventoryTable := CreateTable (Widget_Image(MemberFrame), (To_Unbounded_String("Name"), To_Unbounded_String("Durability"), To_Unbounded_String("Used"), To_Unbounded_String("Amount"), To_Unbounded_String("Weight")), YScroll, "SortCrewInventory", "Press mouse button to sort the inventory."); if Update_Inventory_Command(ClientData, Interp, Argc, Argv) = TCL_ERROR then return TCL_ERROR; end if; Height := Height + Positive'Value(Winfo_Get(InventoryTable.Canvas, "reqheight")); Width := Positive'Value(Winfo_Get(InventoryTable.Canvas, "reqwidth")); Tcl.Tk.Ada.Grid.Grid(Close_Button, "-pady 5"); Widgets.Focus(InventoryTable.Canvas); Bind (Close_Button, "<Tab>", "{focus " & InventoryTable.Canvas & ";break}"); Bind(Close_Button, "<Escape>", "{" & Close_Button & " invoke;break}"); Bind (InventoryTable.Canvas, "<Escape>", "{" & Close_Button & " invoke;break}"); if Height > 500 then Height := 500; end if; configure (MemberFrame, "-height" & Positive'Image(Height) & " -width" & Positive'Image(Width)); configure (MemberCanvas, "-height" & Positive'Image(Height) & " -width" & Positive'Image(Width + 15)); Canvas_Create (MemberCanvas, "window", "0 0 -anchor nw -window " & MemberFrame); Tcl_Eval(Interp, "update"); configure (MemberCanvas, "-scrollregion [list " & BBox(MemberCanvas, "all") & "]"); Show_Dialog (Dialog => MemberDialog, Relative_X => 0.2, Relative_Y => 0.2); return TCL_OK; end Show_Member_Inventory_Command; -- ****o* SUCI/SUCI.Set_Use_Item_Command -- FUNCTION -- Set if item is used by a crew member or not -- PARAMETERS -- ClientData - Custom data send to the command. -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- SetUseItem memberindex itemindex -- Memberindex is the index of the crew member in which inventory item will -- be set, itemindex is the index of the item which will be set -- SOURCE function Set_Use_Item_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Set_Use_Item_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(Argc); MemberIndex: constant Positive := Positive'Value(CArgv.Arg(Argv, 1)); ItemIndex: constant Positive := Positive'Value(CArgv.Arg(Argv, 2)); ItemType: constant Unbounded_String := Items_List (Player_Ship.Crew(MemberIndex).Inventory(ItemIndex).ProtoIndex) .IType; begin if ItemIsUsed(MemberIndex, ItemIndex) then TakeOffItem(MemberIndex, ItemIndex); return Sort_Crew_Inventory_Command (ClientData, Interp, 2, CArgv.Empty & "SortCrewInventory" & "-1"); end if; if ItemType = Weapon_Type then if Items_List (Player_Ship.Crew(MemberIndex).Inventory(ItemIndex).ProtoIndex) .Value (4) = 2 and Player_Ship.Crew(MemberIndex).Equipment(2) /= 0 then ShowMessage (Text => To_String(Player_Ship.Crew(MemberIndex).Name) & " can't use this weapon because have shield equiped. Take off shield first.", Title => "Shield in use"); return TCL_OK; end if; Player_Ship.Crew(MemberIndex).Equipment(1) := ItemIndex; elsif ItemType = Shield_Type then if Player_Ship.Crew(MemberIndex).Equipment(1) > 0 then if Items_List (Player_Ship.Crew(MemberIndex).Inventory (Player_Ship.Crew(MemberIndex).Equipment(1)) .ProtoIndex) .Value (4) = 2 then ShowMessage (Text => To_String(Player_Ship.Crew(MemberIndex).Name) & " can't use shield because have equiped two-hand weapon. Take off weapon first.", Title => "Two handed weapon in use"); return TCL_OK; end if; end if; Player_Ship.Crew(MemberIndex).Equipment(2) := ItemIndex; elsif ItemType = Head_Armor then Player_Ship.Crew(MemberIndex).Equipment(3) := ItemIndex; elsif ItemType = Chest_Armor then Player_Ship.Crew(MemberIndex).Equipment(4) := ItemIndex; elsif ItemType = Arms_Armor then Player_Ship.Crew(MemberIndex).Equipment(5) := ItemIndex; elsif ItemType = Legs_Armor then Player_Ship.Crew(MemberIndex).Equipment(6) := ItemIndex; elsif Tools_List.Find_Index(Item => ItemType) /= UnboundedString_Container.No_Index then Player_Ship.Crew(MemberIndex).Equipment(7) := ItemIndex; end if; return Sort_Crew_Inventory_Command (ClientData, Interp, 2, CArgv.Empty & "SortCrewInventory" & "-1"); end Set_Use_Item_Command; -- ****o* SUCI/SUCI.Show_Move_Item_Command -- FUNCTION -- Show UI to move the selected item to the ship cargo -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ShowMoveItem memberindex itemindex -- Memberindex is the index of the crew member in which inventory item will -- be set, itemindex is the index of the item which will be set -- SOURCE function Show_Move_Item_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Move_Item_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Interp, Argc); MemberIndex: constant Positive := Positive'Value(CArgv.Arg(Argv, 1)); ItemIndex: constant Positive := Positive'Value(CArgv.Arg(Argv, 2)); ItemDialog: constant Ttk_Frame := Create_Dialog (".itemdialog", "Move " & GetItemName(Player_Ship.Crew(MemberIndex).Inventory(ItemIndex)) & " to ship cargo", 400, 2, ".memberdialog"); Button: Ttk_Button := Create (ItemDialog & ".movebutton", "-text Move -command {MoveItem " & CArgv.Arg(Argv, 1) & " " & CArgv.Arg(Argv, 2) & "}"); Label: Ttk_Label; MaxAmount: constant Positive := Player_Ship.Crew(MemberIndex).Inventory(ItemIndex).Amount; AmountBox: constant Ttk_SpinBox := Create (ItemDialog & ".amount", "-width 5 -from 1.0 -to" & Float'Image(Float(MaxAmount)) & " -validate key -validatecommand {ValidateMoveAmount" & Positive'Image(MaxAmount) & " %P}"); begin Label := Create (ItemDialog & ".amountlbl", "-text {Amount (max:" & Positive'Image(MaxAmount) & "):}"); Tcl.Tk.Ada.Grid.Grid(Label, "-padx 5"); Set(AmountBox, "1"); Tcl.Tk.Ada.Grid.Grid(AmountBox, "-column 1 -row 1"); Bind (AmountBox, "<Escape>", "{" & ItemDialog & ".cancelbutton invoke;break}"); Tcl.Tk.Ada.Grid.Grid(Button, "-padx {5 0} -pady {0 5}"); Bind (Button, "<Escape>", "{" & ItemDialog & ".cancelbutton invoke;break}"); Button := Create (ItemDialog & ".cancelbutton", "-text Cancel -command {CloseDialog " & ItemDialog & " .memberdialog;focus .memberdialog.canvas.frame.button}"); Tcl.Tk.Ada.Grid.Grid(Button, "-column 1 -row 2 -padx {0 5} -pady {0 5}"); Focus(Button); Bind(Button, "<Tab>", "{focus " & ItemDialog & ".movebutton;break}"); Bind(Button, "<Escape>", "{" & Button & " invoke;break}"); Show_Dialog(ItemDialog); return TCL_OK; end Show_Move_Item_Command; -- ****o* SUCI/SUCI.Move_Item_Command -- FUNCTION -- Move the selected item to the ship cargo -- PARAMETERS -- ClientData - Custom data send to the command. -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- MoveItem memberindex itemindex -- Memberindex is the index of the crew member in which inventory item will -- be set, itemindex is the index of the item which will be set -- SOURCE function Move_Item_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Move_Item_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(Argc); Amount: Positive; MemberIndex: constant Positive := Positive'Value(CArgv.Arg(Argv, 1)); ItemIndex: constant Positive := Positive'Value(CArgv.Arg(Argv, 2)); ItemDialog: Tk_Toplevel := Get_Widget(".itemdialog", Interp); AmountBox: constant Ttk_SpinBox := Get_Widget(ItemDialog & ".amount", Interp); TypeBox: constant Ttk_ComboBox := Get_Widget (Main_Paned & ".shipinfoframe.cargo.canvas.frame.selecttype.combo", Interp); begin Amount := Positive'Value(Get(AmountBox)); if FreeCargo (0 - (Items_List (Player_Ship.Crew(MemberIndex).Inventory(ItemIndex).ProtoIndex) .Weight * Amount)) < 0 then ShowMessage (Text => "No free space in ship cargo for that amount of " & GetItemName(Player_Ship.Crew(MemberIndex).Inventory(ItemIndex)), Title => "No free space in cargo"); return TCL_OK; end if; UpdateCargo (Ship => Player_Ship, ProtoIndex => Player_Ship.Crew(MemberIndex).Inventory(ItemIndex).ProtoIndex, Amount => Amount, Durability => Player_Ship.Crew(MemberIndex).Inventory(ItemIndex).Durability, Price => Player_Ship.Crew(MemberIndex).Inventory(ItemIndex).Price); UpdateInventory (MemberIndex => MemberIndex, Amount => (0 - Amount), InventoryIndex => ItemIndex); if (Player_Ship.Crew(MemberIndex).Order = Clean and FindItem (Inventory => Player_Ship.Crew(MemberIndex).Inventory, ItemType => Cleaning_Tools) = 0) or ((Player_Ship.Crew(MemberIndex).Order = Upgrading or Player_Ship.Crew(MemberIndex).Order = Repair) and FindItem (Inventory => Player_Ship.Crew(MemberIndex).Inventory, ItemType => Repair_Tools) = 0) then GiveOrders(Player_Ship, MemberIndex, Rest); end if; Destroy(ItemDialog); Generate(TypeBox, "<<ComboboxSelected>>"); Tcl_Eval(Interp, "CloseDialog {.itemdialog .memberdialog}"); return Sort_Crew_Inventory_Command (ClientData, Interp, 2, CArgv.Empty & "SortCrewInventory" & "-1"); end Move_Item_Command; -- ****o* SUCI/SUCI.Validate_Move_Amount_Command -- FUNCTION -- Validate amount of the item to move -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ValidateMoveAmount -- SOURCE function Validate_Move_Amount_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Validate_Move_Amount_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Argc); Amount: Positive; begin Amount := Positive'Value(CArgv.Arg(Argv, 2)); if Amount > Positive'Value(CArgv.Arg(Argv, 1)) then Tcl_SetResult(Interp, "0"); return TCL_OK; end if; Tcl_SetResult(Interp, "1"); return TCL_OK; exception when Constraint_Error => Tcl_SetResult(Interp, "0"); return TCL_OK; end Validate_Move_Amount_Command; -- ****o* SUCI/SUCI.Show_Inventory_Item_Info_Command -- FUNCTION -- Show detailed information about the selected item in crew member -- inventory -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ValidateMoveAmount -- SOURCE function Show_Inventory_Item_Info_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Inventory_Item_Info_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Interp, Argc); begin Show_Inventory_Item_Info (".memberdialog", Positive'Value(CArgv.Arg(Argv, 2)), Positive'Value(CArgv.Arg(Argv, 1))); return TCL_OK; end Show_Inventory_Item_Info_Command; -- ****if* SUCI/SUCI.Show_Inventory_Menu_Command -- FUNCTION -- Show the menu with available the selected item options -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ShowInventoryMenu moduleindex -- ModuleIndex is the index of the item's menu to show -- SOURCE function Show_Inventory_Menu_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Inventory_Menu_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Argc); ItemMenu: Tk_Menu := Get_Widget(".itemmenu", Interp); MemberIndex: constant Positive := Positive'Value(CArgv.Arg(Argv, 1)); begin if (Winfo_Get(ItemMenu, "exists")) = "0" then ItemMenu := Create(".itemmenu", "-tearoff false"); end if; Delete(ItemMenu, "0", "end"); if ItemIsUsed(MemberIndex, Positive'Value(CArgv.Arg(Argv, 2))) then Menu.Add (ItemMenu, "command", "-label {Unequip} -command {SetUseItem " & CArgv.Arg(Argv, 1) & " " & CArgv.Arg(Argv, 2) & "}"); else Menu.Add (ItemMenu, "command", "-label {Equip} -command {SetUseItem " & CArgv.Arg(Argv, 1) & " " & CArgv.Arg(Argv, 2) & "}"); end if; Menu.Add (ItemMenu, "command", "-label {Move the item to the ship cargo} -command {ShowMoveItem " & CArgv.Arg(Argv, 1) & " " & CArgv.Arg(Argv, 2) & "}"); Menu.Add (ItemMenu, "command", "-label {Show more info about the item} -command {ShowInventoryItemInfo " & CArgv.Arg(Argv, 1) & " " & CArgv.Arg(Argv, 2) & "}"); Tk_Popup (ItemMenu, Winfo_Get(Get_Main_Window(Interp), "pointerx"), Winfo_Get(Get_Main_Window(Interp), "pointery")); return TCL_OK; end Show_Inventory_Menu_Command; procedure AddCommands is begin Add_Command("UpdateInventory", Update_Inventory_Command'Access); Add_Command("ShowMemberInventory", Show_Member_Inventory_Command'Access); Add_Command("SetUseItem", Set_Use_Item_Command'Access); Add_Command("ShowMoveItem", Show_Move_Item_Command'Access); Add_Command("MoveItem", Move_Item_Command'Access); Add_Command("ValidateMoveAmount", Validate_Move_Amount_Command'Access); Add_Command ("ShowInventoryItemInfo", Show_Inventory_Item_Info_Command'Access); Add_Command("ShowInventoryMenu", Show_Inventory_Menu_Command'Access); Add_Command("SortCrewInventory", Sort_Crew_Inventory_Command'Access); end AddCommands; end Ships.UI.Crew.Inventory;
oeis/287/A287324.asm
neoneye/loda-programs
11
165476
; A287324: a(n) = A008412(n-1) + A008412(n-2) for n>1, a(0)=0, a(1)=1. ; Submitted by <NAME> ; 0,1,9,40,120,280,552,968,1560,2360,3400,4712,6328,8280,10600,13320,16472,20088,24200,28840,34040,39832,46248,53320,61080,69560,78792,88808,99640,111320,123880,137352,151768,167160,183560,201000,219512,239128,259880,281800,304920,329272,354888,381800,410040,439640,470632,503048,536920,572280,609160,647592,687608,729240,772520,817480,864152,912568,962760,1014760,1068600,1124312,1181928,1241480,1303000,1366520,1432072,1499688,1569400,1641240,1715240,1791432,1869848,1950520,2033480,2118760,2206392 mov $5,2 mov $6,$0 lpb $5 mov $0,$6 mov $3,0 sub $5,1 add $0,$5 sub $0,1 lpb $0 sub $0,1 mov $2,$0 mov $0,0 max $2,0 seq $2,8413 ; Coordination sequence for 5-dimensional cubic lattice. add $3,$2 lpe mov $4,$5 mul $4,$3 add $1,$4 mov $7,$3 lpe min $6,1 mul $6,$7 sub $1,$6 mov $0,$1
SLIDE_Video.asm
XlogicX/CactusCon2017
2
3650
%include 'textmode.h' call draw_border mov di, 160 * 2 + 8 ;where to place cursor mov si, line01 ;fetch the text mov ah, 0x0A ;color call slide_line mov di, 160 * 4 + 16 ;where to place cursor mov si, line02 ;fetch the text mov ah, 0x0E call slide_line mov di, 160 * 6 + 16 ;where to place cursor mov si, line03 ;fetch the text call slide_line mov di, 160 * 8 + 16 ;where to place cursor mov si, line04 ;fetch the text call slide_line mov di, 160 * 10 + 16 ;where to place cursor mov si, line05 ;fetch the text call slide_line mov di, 160 * 12 + 16 ;where to place cursor mov si, line06 ;fetch the text call slide_line mov di, 160 * 14 + 16 ;where to place cursor mov si, line07 ;fetch the text call slide_line mov di, 160 * 16 + 16 ;where to place cursor mov si, line05 ;fetch the text call slide_line mov di, 160 * 4 + 48 ;where to place cursor mov si, line08 ;fetch the text mov ah, 0x07 call slide_line mov di, 160 * 6 + 48 ;where to place cursor mov si, line09 ;fetch the text call slide_line mov di, 160 * 8 + 48 ;where to place cursor mov si, line0A ;fetch the text call slide_line mov di, 160 * 10 + 48 ;where to place cursor mov si, line0B ;fetch the text call slide_line mov di, 160 * 12 + 48 ;where to place cursor mov si, line0C ;fetch the text call slide_line mov di, 160 * 14 + 48 ;where to place cursor mov si, line0D ;fetch the text call slide_line mov di, 160 * 16 + 48 ;where to place cursor mov si, line0E ;fetch the text call slide_line jmp endloop endloop: jmp endloop %include 'slide_frame.h' %include 'pause.h' line01 db 0x14, 0x07, ' Basic Video Setup:' line02 db 0x0C, 'mov ah, 0xb8' line03 db 0x0A, 'mov es, ax' line04 db 0x0C, 'mov al, 0x03' line05 db 0x08, 'int 0x10' line06 db 0x09, 'mov ah, 1' line07 db 0x0C, 'mov ch, 0x26' line08 db 0x12, ';text video memory' line09 db 0x0A, ';ES=0xB800' line0A db 0x0A, ';Text Mode' line0B db 0x0A, ';BIOS Call' line0C db 0x10, '; I hear this is' line0D db 0x0C, '; good to do' line0E db 0x0A, ';BIOS Call' titlemessage db 0x05, 'Video' ;BIOS sig and padding times 510-($-$$) db 0 dw 0xAA55
src/libraries/Rewriters_Lib/src/rewriters_context_utils.adb
Fabien-Chouteau/Renaissance-Ada
0
26445
<reponame>Fabien-Chouteau/Renaissance-Ada with Ada.Assertions; use Ada.Assertions; with Libadalang.Common; use Libadalang.Common; package body Rewriters_Context_Utils is function Combine_Contexts (C1, C2 : Ada_Node) return Ada_Node is begin if Is_Reflexive_Ancestor (C1, C2) then return C1; else Assert (Check => Is_Reflexive_Ancestor (C2, C1), Message => "Unexpectedly, contexts don't share same node."); return C2; end if; end Combine_Contexts; function To_Supported_Context (C : Ada_Node) return Ada_Node is begin -- workaround for https://gt3-prod-1.adacore.com/#/tickets/UB17-030 -- solved in libadalang version 23.0 and higher case C.Kind is when Ada_While_Loop_Spec | Ada_Elsif_Stmt_Part_List => return C.Parent; when Ada_Case_Stmt_Alternative | Ada_Elsif_Stmt_Part => return C.Parent.Parent; when others => return C; end case; end To_Supported_Context; end Rewriters_Context_Utils;
core/zxaritm.asm
freemanix/zxemul
4
161360
; ZX Spectrum emulator ; Arithmetic instructions ; (c) Freeman, August 2000, Prague ; ----------------------------------------------------------------------------- AddFlags MACRO FastClearVFlags flgN, flgSZHC ENDM ; ----------------------------------------------------------------------------- AddWFlags MACRO FastClearVFlags flgN, flgHC ENDM ; ----------------------------------------------------------------------------- SubFlags MACRO FastSetVFlags flgN, flgSZHC ENDM ; ----------------------------------------------------------------------------- OrFlags MACRO FastClearFlags flgHNC, flgSZP ENDM ; ----------------------------------------------------------------------------- AndFlags MACRO FastCSFlags flgNC, flgH, flgSZP ENDM ; ----------------------------------------------------------------------------- IncFlags MACRO FastClearVFlags flgN, flgSZH ENDM ; ----------------------------------------------------------------------------- DecFlags MACRO FastSetVFlags flgN, flgSZH ENDM ; ----------------------------------------------------------------------------- DaaFlags MACRO FastClearFlags flg0, flgSZHPC ENDM ; ----------------------------------------------------------------------------- AddReg MACRO SRC mov di, ax add RegA, SRC AddFlags ENDM ; ----------------------------------------------------------------------------- AddRegXY MACRO SRC push ax FetchXY SRC add RegA, MemTMP pop di AddFlags ENDM ; ----------------------------------------------------------------------------- AddRegImm MACRO mov di, ax lods MemIPC add RegA, al AddFlags ENDM ; ----------------------------------------------------------------------------- AddRegW MACRO DST, SRC mov di, ax add DST, SRC AddWFlags ENDM ; ----------------------------------------------------------------------------- AddRegWM MACRO DST, SRC mov di, ax mov ax, SRC add DST, ax AddWFlags ENDM ; ----------------------------------------------------------------------------- AdcReg MACRO SRC mov di, ax LoadFlags adc RegA, SRC AddFlags ENDM ; ----------------------------------------------------------------------------- AdcRegXY MACRO SRC push ax FetchXY SRC LoadFlags adc RegA, MemTMP pop di AddFlags ENDM ; ----------------------------------------------------------------------------- AdcRegImm MACRO mov di, ax LoadFlags lods MemIPC adc RegA, al AddFlags ENDM ; ----------------------------------------------------------------------------- AdcRegW MACRO DST, SRC mov di, ax LoadFlags adc DST, SRC AddFlags ENDM ; ----------------------------------------------------------------------------- AdcRegWM MACRO DST, SRC mov di, ax mov ax, SRC LoadFlags adc DST, ax AddFlags ENDM ; ----------------------------------------------------------------------------- SubReg MACRO SRC mov di, ax sub RegA, SRC SubFlags ENDM ; ----------------------------------------------------------------------------- SubRegXY MACRO SRC push ax FetchXY SRC sub RegA, MemTMP pop di SubFlags ENDM ; ----------------------------------------------------------------------------- SubRegImm MACRO mov di, ax lods MemIPC sub RegA, al SubFlags ENDM ; ----------------------------------------------------------------------------- SbcReg MACRO SRC mov di, ax LoadFlags sbb RegA, SRC SubFlags ENDM ; ----------------------------------------------------------------------------- SbcRegXY MACRO SRC push ax FetchXY SRC LoadFlags sbb RegA, MemTMP pop di SubFlags ENDM ; ----------------------------------------------------------------------------- SbcRegImm MACRO mov di, ax LoadFlags lods MemIPC sbb RegA, al SubFlags ENDM ; ----------------------------------------------------------------------------- SbcRegW MACRO DST, SRC mov di, ax LoadFlags sbb DST, SRC SubFlags ENDM ; ----------------------------------------------------------------------------- SbcRegWM MACRO DST, SRC mov di, ax mov ax, SRC LoadFlags sbb DST, ax SubFlags ENDM ; ----------------------------------------------------------------------------- CpReg MACRO SRC mov di, ax cmp RegA, SRC SubFlags ENDM ; ----------------------------------------------------------------------------- CpRegXY MACRO SRC push ax FetchXY SRC cmp RegA, MemTMP pop di SubFlags ENDM ; ----------------------------------------------------------------------------- CpRegImm MACRO mov di, ax lods MemIPC cmp RegA, al SubFlags ENDM ; ----------------------------------------------------------------------------- OrReg MACRO SRC mov di, ax or RegA, SRC OrFlags ENDM ; ----------------------------------------------------------------------------- OrRegXY MACRO SRC push ax FetchXY SRC or RegA, MemTMP pop di OrFlags ENDM ; ----------------------------------------------------------------------------- OrRegImm MACRO mov di, ax lods MemIPC or RegA, al OrFlags ENDM ; ----------------------------------------------------------------------------- XorReg MACRO SRC mov di, ax xor RegA, SRC OrFlags ENDM ; ----------------------------------------------------------------------------- XorRegXY MACRO SRC push ax FetchXY SRC xor RegA, MemTMP pop di OrFlags ENDM ; ----------------------------------------------------------------------------- XorRegImm MACRO mov di, ax lods MemIPC xor RegA, al OrFlags ENDM ; ----------------------------------------------------------------------------- AndReg MACRO SRC mov di, ax and RegA, SRC AndFlags ENDM ; ----------------------------------------------------------------------------- AndRegXY MACRO SRC push ax FetchXY SRC and RegA, MemTMP pop di AndFlags ENDM ; ----------------------------------------------------------------------------- AndRegImm MACRO mov di, ax lods MemIPC and RegA, al AndFlags ENDM ; ----------------------------------------------------------------------------- IncReg MACRO REG mov di, ax inc REG IncFlags ENDM ; ----------------------------------------------------------------------------- IncRegXY MACRO REG push ax FetchXY REG inc MemTMP pop di IncFlags ENDM ; ----------------------------------------------------------------------------- IncRegW MACRO REG inc REG FetchSwapHere ENDM ; ----------------------------------------------------------------------------- DecReg MACRO REG mov di, ax dec REG DecFlags ENDM ; ----------------------------------------------------------------------------- DecRegXY MACRO REG push ax FetchXY REG dec MemTMP pop di DecFlags ENDM ; ----------------------------------------------------------------------------- DecRegW MACRO REG dec REG FetchSwapHere ENDM ; ----------------------------------------------------------------------------- NegOp MACRO mov di, ax neg RegA SubFlags ENDM ; ----------------------------------------------------------------------------- DaaOp MACRO LOCAL @DaaSub mov di,ax mov al, RegA test RegF, flgN jnz @DaaSub LoadFlags daa mov RegA, al DaaFlags @DaaSub: LoadFlags das mov RegA, al DaaFlags ENDM ; ----------------------------------------------------------------------------- add_a_a: AddReg RegA add_a_b: AddReg RegB add_a_c: AddReg RegC add_a_d: AddReg RegD add_a_e: AddReg RegE add_a_h: AddReg RegH add_a_l: AddReg RegL add_a_ihl: AddReg MemIHL add_a_iix: AddRegXY RegIX add_a_iiy: AddRegXY RegIY add_a_n: AddRegImm add_a_ixh: AddReg RegIXH add_a_ixl: AddReg RegIXL add_a_iyh: AddReg RegIYH add_a_iyl: AddReg RegIYL ; ----------------------------------------------------------------------------- adc_a_a: AdcReg RegA adc_a_b: AdcReg RegB adc_a_c: AdcReg RegC adc_a_d: AdcReg RegD adc_a_e: AdcReg RegE adc_a_h: AdcReg RegH adc_a_l: AdcReg RegL adc_a_ihl: AdcReg MemIHL adc_a_iix: AdcRegXY RegIX adc_a_iiy: AdcRegXY RegIY adc_a_n: AdcRegImm adc_a_ixh: AdcReg RegIXH adc_a_ixl: AdcReg RegIXL adc_a_iyh: AdcReg RegIYH adc_a_iyl: AdcReg RegIYL ; ----------------------------------------------------------------------------- sub_a: SubReg RegA sub_b: SubReg RegB sub_c: SubReg RegC sub_d: SubReg RegD sub_e: SubReg RegE sub_h: SubReg RegH sub_l: SubReg RegL sub_ihl: SubReg MemIHL sub_iix: SubRegXY RegIX sub_iiy: SubRegXY RegIY sub_n: SubRegImm sub_ixh: SubReg RegIXH sub_ixl: SubReg RegIXL sub_iyh: SubReg RegIYH sub_iyl: SubReg RegIYL ; ----------------------------------------------------------------------------- sbc_a_a: SbcReg RegA sbc_a_b: SbcReg RegB sbc_a_c: SbcReg RegC sbc_a_d: SbcReg RegD sbc_a_e: SbcReg RegE sbc_a_h: SbcReg RegH sbc_a_l: SbcReg RegL sbc_a_ihl: SbcReg MemIHL sbc_a_iix: SbcRegXY RegIX sbc_a_iiy: SbcRegXY RegIY sbc_a_n: SbcRegImm sbc_a_ixh: SbcReg RegIXH sbc_a_ixl: SbcReg RegIXL sbc_a_iyh: SbcReg RegIYH sbc_a_iyl: SbcReg RegIYL ; ----------------------------------------------------------------------------- cp_a: CpReg RegA cp_b: CpReg RegB cp_c: CpReg RegC cp_d: CpReg RegD cp_e: CpReg RegE cp_h: CpReg RegH cp_l: CpReg RegL cp_ihl: CpReg MemIHL cp_iix: CpRegXY RegIX cp_iiy: CpRegXY RegIY cp_n: CpRegImm cp_ixh: CpReg RegIXH cp_ixl: CpReg RegIXL cp_iyh: CpReg RegIYH cp_iyl: CpReg RegIYL ; ----------------------------------------------------------------------------- and_a: AndReg RegA and_b: AndReg RegB and_c: AndReg RegC and_d: AndReg RegD and_e: AndReg RegE and_h: AndReg RegH and_l: AndReg RegL and_ihl: AndReg MemIHL and_iix: AndRegXY RegIX and_iiy: AndRegXY RegIY and_n: AndRegImm and_ixh: AndReg RegIXH and_ixl: AndReg RegIXL and_iyh: AndReg RegIYH and_iyl: AndReg RegIYL ; ----------------------------------------------------------------------------- or_a: OrReg RegA or_b: OrReg RegB or_c: OrReg RegC or_d: OrReg RegD or_e: OrReg RegE or_h: OrReg RegH or_l: OrReg RegL or_ihl: OrReg MemIHL or_iix: OrRegXY RegIX or_iiy: OrRegXY RegIY or_n: OrRegImm or_ixh: OrReg RegIXH or_ixl: OrReg RegIXL or_iyh: OrReg RegIYH or_iyl: OrReg RegIYL ; ----------------------------------------------------------------------------- xor_a: XorReg RegA xor_b: XorReg RegB xor_c: XorReg RegC xor_d: XorReg RegD xor_e: XorReg RegE xor_h: XorReg RegH xor_l: XorReg RegL xor_ihl: XorReg MemIHL xor_iix: XorRegXY RegIX xor_iiy: XorRegXY RegIY xor_n: XorRegImm xor_ixh: XorReg RegIXH xor_ixl: XorReg RegIXL xor_iyh: XorReg RegIYH xor_iyl: XorReg RegIYL ; ----------------------------------------------------------------------------- inc_a: IncReg RegA inc_b: IncReg RegB inc_c: IncReg RegC inc_d: IncReg RegD inc_e: IncReg RegE inc_h: IncReg RegH inc_l: IncReg RegL inc_ihl: IncReg MemIHL inc_iix: IncRegXY RegIX inc_iiy: IncRegXY RegIY inc_ixh: IncReg RegIXH inc_ixl: IncReg RegIXL inc_iyh: IncReg RegIYH inc_iyl: IncReg RegIYL ; ----------------------------------------------------------------------------- dec_a: DecReg RegA dec_b: DecReg RegB dec_c: DecReg RegC dec_d: DecReg RegD dec_e: DecReg RegE dec_h: DecReg RegH dec_l: DecReg RegL dec_ihl: DecReg MemIHL dec_iix: DecRegXY RegIX dec_iiy: DecRegXY RegIY dec_ixh: DecReg RegIXH dec_ixl: DecReg RegIXL dec_iyh: DecReg RegIYH dec_iyl: DecReg RegIYL ; ----------------------------------------------------------------------------- add_hl_bc: AddRegW RegHL, RegBC add_hl_de: AddRegW RegHL, RegDE add_hl_hl: AddRegW RegHL, RegHL add_hl_sp: AddRegW RegHL, RegSP add_ix_bc: AddRegW RegIX, RegBC add_ix_de: AddRegWM RegIX, RegDE add_ix_ix: AddRegWM RegIX, RegIX add_ix_sp: AddRegW RegIX, RegSP add_iy_bc: AddRegW RegIY, RegBC add_iy_de: AddRegWM RegIY, RegDE add_iy_iy: AddRegWM RegIY, RegIY add_iy_sp: AddRegW RegIY, RegSP ; ----------------------------------------------------------------------------- adc_hl_bc: AdcRegW RegHL, RegBC adc_hl_de: AdcRegW RegHL, RegDE adc_hl_hl: AdcRegW RegHL, RegHL adc_hl_sp: AdcRegW RegHL, RegSP ; ----------------------------------------------------------------------------- sbc_hl_bc: SbcRegW RegHL, RegBC sbc_hl_de: SbcRegW RegHL, RegDE sbc_hl_hl: SbcRegW RegHL, RegHL sbc_hl_sp: SbcRegW RegHL, RegSP ; ----------------------------------------------------------------------------- inc_bc: IncRegW RegBC inc_de: IncRegW RegDE inc_hl: IncRegW RegHL inc_ix: IncRegW RegIX inc_iy: IncRegW RegIY inc_sp: IncRegW RegSP ; ----------------------------------------------------------------------------- dec_bc: DecRegW RegBC dec_de: DecRegW RegDE dec_hl: DecRegW RegHL dec_ix: DecRegW RegIX dec_iy: DecRegW RegIY dec_sp: DecRegW RegSP ; ----------------------------------------------------------------------------- neg_: NegOp ; ----------------------------------------------------------------------------- daa_: DaaOp ; -----------------------------------------------------------------------------
Sol_HW4/Q2/MiniJava.g4
kamyab78/IUSTCompiler
0
6395
grammar MiniJava; program: mainClass (classDeclaration)* EOF; mainClass: 'class' ID '{' PUBLIC STATIC VOID MAIN '(' STRING '[' ']' ID ')' '{' statement '}' '}'; classDeclaration: 'class' ID (EXTENDS ID)? '{' (varDeclaration)* (methodDeclaration)* '}'; varDeclaration: type_t ID ';'; methodDeclaration: PUBLIC type_t ID '(' (type_t ID (',' type_t ID)*)? ')' '{' (varDeclaration)* (statement)* RETURN expression ';' '}'; type_t: INT '[' ']' | BOOLEAN | INT | ID ; statement: '{' (statement)* '}' | IF '(' expression ')' statement ELSE statement | WHILE '(' expression ')' statement | 'System.out.println' '(' expression ')' ';' | ID '=' expression ';' | ID '[' expression ']' '=' expression ';' ; expression : expression '&&' expression | expression '<' expression | expression ('+' | '-') expression | expression '*' expression | expression '[' expression ']' | expression '.' LENGTH | expression '.' ID '(' (expression (',' expression)*)? ')' | INT_VALUE | TRUE | FALSE | ID | THIS | NEW INT '[' expression ']' | NEW ID '(' ')' | '!' expression | '(' expression ')' ; BOOLEAN : 'boolean'; CLASS : 'class'; ELSE : 'else'; EXTENDS : 'extends'; FALSE : 'false'; IF : 'if'; INT : 'int'; LENGTH : 'length'; MAIN : 'main'; NEW : 'new'; PUBLIC : 'public'; RETURN : 'return'; STATIC : 'static'; STRING : 'String'; THIS : 'this'; TRUE : 'true'; VOID : 'void'; WHILE : 'while'; ASSIGN : '='; GREAT : '>'; LITTLE : '<'; GREAT_EQUAL : '>='; LITTLE_EQUAL : '<='; PLUS : '+'; MINUS : '-'; TIMES : '*'; BANG : '!'; AND : '&&'; OR : '||'; LEFT_PARANTEZ : '('; RIGHT_PARANTEZ : ')'; LEFT_BRACKET : '['; RIGHT_BRACKET : ']'; LEFT_BRACE : '{'; RIGHT_BRACE : '}'; COMMA : ','; DOT : '.'; SEMICOLEM : ';'; ID : LETTER (LETTER | NUMS)*; INT_VALUE : ('0' | [1-9] NUMS*); fragment LETTER : [a-zA-Z_]; fragment NUMS : [0-9]; WS : [ \t\r\n]+ -> skip ; COMMENT : '/*' .*? '*/' -> skip; LINE_COMMENT: '//' ~[\r\n]* -> skip;
external/source/shellcode/windows/x64/src/block/block_recv.asm
madhavarao-yejarla/VoIP
35
12438
;-----------------------------------------------------------------------------; ; Author: <NAME> (stephen_fewer[at]harmonysecurity[dot]com) ; Compatible: Windows 7, 2003 ; Architecture: x64 ;-----------------------------------------------------------------------------; [BITS 64] ; Compatible: block_bind_tcp, block_reverse_tcp ; Input: RBP must be the address of 'api_call'. RDI must be the socket. ; Output: None. ; Clobbers: RAX, RBX, RCX, RDX, RSI, R8, R9, R15 recv: ; Receive the size of the incoming second stage... sub rsp, 16 ; alloc some space (16 bytes) on stack for to hold the second stage length mov rdx, rsp ; set pointer to this buffer xor r9, r9 ; flags push byte 4 ; pop r8 ; length = sizeof( DWORD ); mov rcx, rdi ; the saved socket mov r10d, 0x5FC8D902 ; hash( "ws2_32.dll", "recv" ) call rbp ; recv( s, &dwLength, 4, 0 ); add rsp, 32 ; we restore RSP from the api_call so we can pop off RSI next ; Alloc a RWX buffer for the second stage pop rsi ; pop off the second stage length push byte 0x40 ; pop r9 ; PAGE_EXECUTE_READWRITE push 0x1000 ; pop r8 ; MEM_COMMIT mov rdx, rsi ; the newly recieved second stage length. xor rcx, rcx ; NULL as we dont care where the allocation is. mov r10d, 0xE553A458 ; hash( "kernel32.dll", "VirtualAlloc" ) call rbp ; VirtualAlloc( NULL, dwLength, MEM_COMMIT, PAGE_EXECUTE_READWRITE ); ; Receive the second stage and execute it... mov rbx, rax ; rbx = our new memory address for the new stage mov r15, rax ; save the address so we can jump into it later read_more: ; xor r9, r9 ; flags mov r8, rsi ; length mov rdx, rbx ; the current address into our second stages RWX buffer mov rcx, rdi ; the saved socket mov r10d, 0x5FC8D902 ; hash( "ws2_32.dll", "recv" ) call rbp ; recv( s, buffer, length, 0 ); add rbx, rax ; buffer += bytes_received sub rsi, rax ; length -= bytes_received test rsi, rsi ; test length jnz short read_more ; continue if we have more to read jmp r15 ; return into the second stage
programs/oeis/184/A184551.asm
karttu/loda
1
81131
; A184551: Super-birthdays (falling on the same weekday), version 3 (birth within 2 and 3 years after a February 29). ; 0,11,17,22,28,39,45,50,56,67,73,78,84,95,101,106,112,123,129,134,140,151,157,162,168,179,185,190,196,207,213,218,224,235,241,246,252,263,269,274,280,291,297,302,308,319,325,330,336,347,353,358,364,375,381,386,392,403,409,414,420,431,437,442,448,459,465,470,476,487,493,498,504,515,521,526,532,543,549,554,560,571,577,582,588,599,605,610,616,627,633,638,644,655,661,666,672,683,689,694,700,711,717,722,728,739,745,750,756,767,773,778,784,795,801,806,812,823,829,834,840,851,857,862,868,879,885,890,896,907,913,918,924,935,941,946,952,963,969,974,980,991,997,1002,1008,1019,1025,1030,1036,1047,1053,1058,1064,1075,1081,1086,1092,1103,1109,1114,1120,1131,1137,1142,1148,1159,1165,1170,1176,1187,1193,1198,1204,1215,1221,1226,1232,1243,1249,1254,1260,1271,1277,1282,1288,1299,1305,1310,1316,1327,1333,1338,1344,1355,1361,1366,1372,1383,1389,1394,1400,1411,1417,1422,1428,1439,1445,1450,1456,1467,1473,1478,1484,1495,1501,1506,1512,1523,1529,1534,1540,1551,1557,1562,1568,1579,1585,1590,1596,1607,1613,1618,1624,1635,1641,1646,1652,1663,1669,1674,1680,1691,1697,1702,1708,1719,1725,1730,1736,1747 mov $3,$0 mul $0,9 div $0,2 mov $1,$0 mod $1,6 mov $2,$3 mul $2,7 add $1,$2
theorems/cohomology/RephraseSubFinCoboundary.agda
timjb/HoTT-Agda
0
12363
{-# OPTIONS --without-K --rewriting #-} open import HoTT open import homotopy.FinWedge open import homotopy.Bouquet open import groups.SphereEndomorphism open import cohomology.Theory module cohomology.RephraseSubFinCoboundary (OT : OrdinaryTheory lzero) where open OrdinaryTheory OT open import cohomology.SphereEndomorphism cohomology-theory open import cohomology.Sphere OT open import cohomology.SubFinBouquet OT abstract rephrase-in-degree : ∀ n {I : ℕ} {JA JB : Type₀} (JB-ac : has-choice 0 JB lzero) (JB-dec : has-dec-eq JB) {J} (p : Fin J ≃ Coprod JA JB) (f : ⊙FinBouquet I (S n) ⊙→ ⊙Susp (⊙Bouquet JB n)) g → GroupIso.f (C-FinBouquet-diag (S n) I) (CEl-fmap (ℕ-to-ℤ (S n)) f (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Bouquet JB n)) (GroupIso.g (C-SubFinBouquet-diag n JB-ac (–> p)) g))) ∼ λ <I → Group.subsum-r (C2 0) (–> p) (λ b → Group.exp (C2 0) (g b) (⊙SphereS-endo-degree n (⊙Susp-fmap (⊙bwproj JB-dec b) ⊙∘ f ⊙∘ ⊙fwin <I))) rephrase-in-degree n {I} {JA} {JB} JB-ac JB-dec {J} p f g <I = GroupIso.f (C-FinBouquet-diag (S n) I) (CEl-fmap (ℕ-to-ℤ (S n)) f (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Bouquet JB n)) (GroupIso.g (C-SubFinBouquet-diag n JB-ac (–> p)) g))) <I =⟨ ap (λ g → GroupIso.f (C-FinBouquet-diag (S n) I) (CEl-fmap (ℕ-to-ℤ (S n)) f (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Bouquet JB n)) g)) <I) (inverse-C-SubFinBouquet-diag-β n JB-ac JB-dec p g) ⟩ GroupIso.f (C-FinBouquet-diag (S n) I) (CEl-fmap (ℕ-to-ℤ (S n)) f (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Bouquet JB n)) (Group.subsum-r (C (ℕ-to-ℤ n) (⊙Bouquet JB n)) (–> p) (λ b → CEl-fmap (ℕ-to-ℤ n) (⊙bwproj JB-dec b) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))))))) <I =⟨ ap (λ g → GroupIso.f (C-FinBouquet-diag (S n) I) g <I) $ GroupHom.pres-subsum-r (C-fmap (ℕ-to-ℤ (S n)) f ∘ᴳ GroupIso.g-hom (C-Susp (ℕ-to-ℤ n) (⊙Bouquet JB n))) (–> p) (λ b → CEl-fmap (ℕ-to-ℤ n) (⊙bwproj JB-dec b) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b)))) ⟩ GroupIso.f (C-FinBouquet-diag (S n) I) (Group.subsum-r (C (ℕ-to-ℤ (S n)) (⊙FinBouquet I (S n))) (–> p) (λ b → CEl-fmap (ℕ-to-ℤ (S n)) f (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Bouquet JB n)) (CEl-fmap (ℕ-to-ℤ n) (⊙bwproj JB-dec b) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))))))) <I =⟨ ap (λ f → GroupIso.f (C-FinBouquet-diag (S n) I) (Group.subsum-r (C (ℕ-to-ℤ (S n)) (⊙FinBouquet I (S n))) (–> p) f) <I) (λ= λ b → ap (CEl-fmap (ℕ-to-ℤ (S n)) f) $ C-Susp-fmap' (ℕ-to-ℤ n) (⊙bwproj JB-dec b) □$ᴳ CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))) ⟩ GroupIso.f (C-FinBouquet-diag (S n) I) (Group.subsum-r (C (ℕ-to-ℤ (S n)) (⊙FinBouquet I (S n))) (–> p) (λ b → CEl-fmap (ℕ-to-ℤ (S n)) f (CEl-fmap (ℕ-to-ℤ (S n)) (⊙Susp-fmap (⊙bwproj JB-dec b)) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))))))) <I =⟨ C-FinBouquet-diag-β (S n) I (Group.subsum-r (C (ℕ-to-ℤ (S n)) (⊙FinBouquet I (S n))) (–> p) (λ b → CEl-fmap (ℕ-to-ℤ (S n)) f (CEl-fmap (ℕ-to-ℤ (S n)) (⊙Susp-fmap (⊙bwproj JB-dec b)) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))))))) <I ⟩ GroupIso.f (C-Sphere-diag (S n)) (CEl-fmap (ℕ-to-ℤ (S n)) ⊙lower (CEl-fmap (ℕ-to-ℤ (S n)) (⊙fwin <I) (Group.subsum-r (C (ℕ-to-ℤ (S n)) (⊙FinBouquet I (S n))) (–> p) (λ b → CEl-fmap (ℕ-to-ℤ (S n)) f (CEl-fmap (ℕ-to-ℤ (S n)) (⊙Susp-fmap (⊙bwproj JB-dec b)) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))))))))) =⟨ GroupHom.pres-subsum-r ( GroupIso.f-hom (C-Sphere-diag (S n)) ∘ᴳ C-fmap (ℕ-to-ℤ (S n)) ⊙lower ∘ᴳ C-fmap (ℕ-to-ℤ (S n)) (⊙fwin <I)) (–> p) (λ b → CEl-fmap (ℕ-to-ℤ (S n)) f (CEl-fmap (ℕ-to-ℤ (S n)) (⊙Susp-fmap (⊙bwproj JB-dec b)) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b)))))) ⟩ Group.subsum-r (C2 0) (–> p) (λ b → GroupIso.f (C-Sphere-diag (S n)) (CEl-fmap (ℕ-to-ℤ (S n)) ⊙lower (CEl-fmap (ℕ-to-ℤ (S n)) (⊙fwin <I) (CEl-fmap (ℕ-to-ℤ (S n)) f (CEl-fmap (ℕ-to-ℤ (S n)) (⊙Susp-fmap (⊙bwproj JB-dec b)) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))))))))) =⟨ ap (Group.subsum-r (C2 0) (–> p)) (λ= λ b → ap (GroupIso.f (C-Sphere-diag (S n)) ∘ CEl-fmap (ℕ-to-ℤ (S n)) ⊙lower) $ ∘-CEl-fmap (ℕ-to-ℤ (S n)) (⊙fwin <I) f _ ∙ ∘-CEl-fmap (ℕ-to-ℤ (S n)) (f ⊙∘ ⊙fwin <I) (⊙Susp-fmap (⊙bwproj JB-dec b)) _ ∙ CEl-fmap-⊙Sphere-endo-η (ℕ-to-ℤ (S n)) n (⊙Susp-fmap (⊙bwproj JB-dec b) ⊙∘ f ⊙∘ ⊙fwin <I) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b))))) ⟩ Group.subsum-r (C2 0) (–> p) (λ b → GroupIso.f (C-Sphere-diag (S n)) (CEl-fmap (ℕ-to-ℤ (S n)) ⊙lower (Group.exp (C (ℕ-to-ℤ (S n)) (⊙Sphere (S n))) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b)))) (⊙SphereS-endo-degree n (⊙Susp-fmap (⊙bwproj JB-dec b) ⊙∘ f ⊙∘ ⊙fwin <I))))) =⟨ ap (Group.subsum-r (C2 0) (–> p)) (λ= λ b → GroupHom.pres-exp (GroupIso.f-hom (C-Sphere-diag (S n)) ∘ᴳ C-fmap (ℕ-to-ℤ (S n)) ⊙lower) (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b)))) (⊙SphereS-endo-degree n (⊙Susp-fmap (⊙bwproj JB-dec b) ⊙∘ f ⊙∘ ⊙fwin <I))) ⟩ Group.subsum-r (C2 0) (–> p) (λ b → Group.exp (C2 0) (GroupIso.f (C-Sphere-diag n) (–> (CEl-Susp (ℕ-to-ℤ n) (⊙Lift (⊙Sphere n))) (CEl-fmap (ℕ-to-ℤ (S n)) (⊙lift {j = lzero} ⊙∘ ⊙Susp-fmap {Y = ⊙Sphere n} ⊙lower) (CEl-fmap (ℕ-to-ℤ (S n)) ⊙lower (<– (CEl-Susp (ℕ-to-ℤ n) (⊙Sphere n)) (CEl-fmap (ℕ-to-ℤ n) ⊙lift (GroupIso.g (C-Sphere-diag n) (g b)))))))) (⊙SphereS-endo-degree n (⊙Susp-fmap (⊙bwproj JB-dec b) ⊙∘ f ⊙∘ ⊙fwin <I))) =⟨ ap (Group.subsum-r (C2 0) (–> p)) (λ= λ b → ap (λ g → Group.exp (C2 0) g (⊙SphereS-endo-degree n (⊙Susp-fmap (⊙bwproj JB-dec b) ⊙∘ f ⊙∘ ⊙fwin <I))) $ ap (GroupIso.f (C-Sphere-diag n) ∘ –> (CEl-Susp (ℕ-to-ℤ n) (⊙Lift (⊙Sphere n)))) ( CEl-fmap-∘ (ℕ-to-ℤ (S n)) ⊙lift (⊙Susp-fmap {Y = ⊙Sphere n} ⊙lower) _ ∙ ap (CEl-fmap (ℕ-to-ℤ (S n)) (⊙Susp-fmap {Y = ⊙Sphere n} ⊙lower)) ( ∘-CEl-fmap (ℕ-to-ℤ (S n)) ⊙lift ⊙lower _ ∙ CEl-fmap-idf (ℕ-to-ℤ (S n)) _)) ∙ ap (GroupIso.f (C-Sphere-diag n)) ( (C-Susp-fmap (ℕ-to-ℤ n) ⊙lower □$ᴳ _) ∙ ap (CEl-fmap (ℕ-to-ℤ n) ⊙lower) (GroupIso.f-g (C-Susp (ℕ-to-ℤ n) (⊙Sphere n)) _) ∙ ∘-CEl-fmap (ℕ-to-ℤ n) ⊙lower ⊙lift _ ∙ CEl-fmap-idf (ℕ-to-ℤ n) _) ∙ GroupIso.f-g (C-Sphere-diag n) (g b)) ⟩ Group.subsum-r (C2 0) (–> p) (λ b → Group.exp (C2 0) (g b) (⊙SphereS-endo-degree n (⊙Susp-fmap (⊙bwproj JB-dec b) ⊙∘ f ⊙∘ ⊙fwin <I))) =∎ {- the version specialzied to [Fin J]. -} rephrase-in-degree' : ∀ n {I J : ℕ} (f : ⊙FinBouquet I (S n) ⊙→ ⊙Susp (⊙FinBouquet J n)) g → GroupIso.f (C-FinBouquet-diag (S n) I) (CEl-fmap (ℕ-to-ℤ (S n)) f (<– (CEl-Susp (ℕ-to-ℤ n) (⊙FinBouquet J n)) (GroupIso.g (C-FinBouquet-diag n J) g))) ∼ λ <I → Group.sum (C2 0) (λ <J → Group.exp (C2 0) (g <J) (⊙SphereS-endo-degree n (⊙Susp-fmap (⊙fwproj <J) ⊙∘ f ⊙∘ ⊙fwin <I))) rephrase-in-degree' n {I} {J} f g = rephrase-in-degree n {I} {JA = Empty} {JB = Fin J} (Fin-has-choice 0 lzero) Fin-has-dec-eq (⊔₁-Empty (Fin J) ⁻¹) f g
programs/oeis/065/A065438.asm
jmorken/loda
1
27726
; A065438: Complement of A065039. ; 10,21,32,43,54,65,76,87,98,109,110,121,132,143,154,165,176,187,198,209,220,221,232,243,254,265,276,287,298,309,320,331,332,343,354,365,376,387,398,409,420,431,442,443,454,465,476,487,498,509,520,531,542 mov $2,$0 add $2,5 mov $4,$0 add $4,2 mov $5,$0 mov $0,$4 lpb $0 sub $0,7 trn $0,4 mov $1,2 mov $4,$2 sub $2,5 add $4,$2 mov $3,$4 lpe add $1,$3 lpb $5 add $1,9 sub $5,1 lpe add $1,3
src/main/antlr4/com/fordprog/matrix/Matrix.g4
daergoth/MatrixC
2
7858
<reponame>daergoth/MatrixC<filename>src/main/antlr4/com/fordprog/matrix/Matrix.g4<gh_stars>1-10 grammar Matrix; program : symbolDeclaration+ EOF ; symbolDeclaration : variableDeclaration SEMI | functionDecl ; variableDeclaration : type id '=' expr ; functionDecl : 'function' returnType id LPAREN functionDeclParameterList? RPAREN block ; returnType : type | 'void' ; functionDeclParameterList : functionDeclParameter (COMMA functionDeclParameter)* ; functionDeclParameter : type id ; block : LBRACE statement+ RBRACE ; statement : simpleStatement SEMI # simpleStatementStatement | controllBlock # controllBlockStatement ; simpleStatement : variableDeclaration # declareStatement | id '=' expr # assignStatement | functionCall # functionCallStatement | 'return' expr # returnStatement ; controllBlock : 'if' parenLogicExpr block # ifStatement | 'if' parenLogicExpr ifBlock=block 'else' elseBlock=block # ifElseStatement | 'while' parenLogicExpr block # whileStatement | 'for' LPAREN decl=variableDeclaration SEMI logic=logicExpr SEMI update=simpleStatement RPAREN block # forStatement | block # blockStatement ; parenLogicExpr : LPAREN logicExpr RPAREN ; logicExpr : expr # exprLogicExpression | leftExpr=expr relation rightExpr=expr # relationLogicExpression ; expr : term # termExpression | functionCall # functionCallExpression | leftOperand=expr bin_operator rightOperand=expr # binOperatorExpression | LPAREN expr RPAREN # parenthesisExpression ; functionCall : id LPAREN functionCallParameterList? RPAREN ; functionCallParameterList : expr (COMMA expr)* ; term : id # idTerm | rational # rationalTerm | matrix # matrixTerm ; bin_operator : '+' | '-' | '/' | '*' | '^' | '#' ; type : rationalType | matrixType ; rationalType : 'rational' ; matrixType : 'matrix' ; rational : INTEGER '|' INTEGER ; matrix : LBRACE matrix_row (COMMA matrix_row)* RBRACE ; matrix_row : LBRACE matrix_element (COMMA matrix_element)* RBRACE ; matrix_element : rational | id ; relation : '<' | '>' | '<=' | '>=' | '==' | '!=' ; id : ID ; INTEGER : '-'? [0-9]+ ; ID : [a-z][a-zA-Z0-9_]* ; LPAREN : '(' ; RPAREN : ')' ; LBRACE : '{' ; RBRACE : '}' ; COMMA : ',' ; SEMI : ';' ; WS : [ \r\n\t] -> skip ;
alloy4fun_models/trashltl/models/17/Ec8crWQdLnHJ93GmC.als
Kaixi26/org.alloytools.alloy
0
1009
<gh_stars>0 open main pred idEc8crWQdLnHJ93GmC_prop18 { always all f : Protected | f in Trash until f not in Protected } pred __repair { idEc8crWQdLnHJ93GmC_prop18 } check __repair { idEc8crWQdLnHJ93GmC_prop18 <=> prop18o }
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/limited_with3_pkg2.ads
best08618/asylo
7
4855
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/limited_with3_pkg2.ads limited with Limited_With3_Pkg3; package Limited_With3_Pkg2 is type T is tagged null record; procedure Proc (X : Limited_With3_Pkg3.TT; Y : T); end Limited_With3_Pkg2;
Levels/AIZ/Misc Object Data/Map - Act 2 Background Tree.asm
NatsumiFox/AMPS-Sonic-3-Knuckles
5
21039
Map_AIZ2BGTree_: dc.w word_23C24A-Map_AIZ2BGTree_ word_23C24A: dc.w 4 dc.b $C0, 7,$40, 0, 0, 0 dc.b $E0, 7,$40, 0, 0, 0 dc.b 0, 7,$40, 0, 0, 0 dc.b $20, 7,$40, 0, 0, 0
src/gen-model-operations.adb
jquorning/dynamo
15
18604
<reponame>jquorning/dynamo<filename>src/gen-model-operations.adb ----------------------------------------------------------------------- -- gen-model-operations -- Operation declarations -- Copyright (C) 2012, 2016, 2017, 2018, 2021 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body Gen.Model.Operations is -- ------------------------------ -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. -- ------------------------------ overriding function Get_Value (From : in Operation_Definition; Name : in String) return UBO.Object is begin if Name = "parameters" or Name = "columns" then return From.Parameters_Bean; elsif Name = "return" then return UBO.To_Object (From.Return_Type); elsif Name = "type" then return UBO.To_Object (Operation_Type'Image (From.Kind)); else return Definition (From).Get_Value (Name); end if; end Get_Value; -- Prepare the generation of the model. overriding procedure Prepare (O : in out Operation_Definition) is begin null; end Prepare; -- ------------------------------ -- Initialize the operation definition instance. -- ------------------------------ overriding procedure Initialize (O : in out Operation_Definition) is begin O.Parameters_Bean := UBO.To_Object (O.Parameters'Unchecked_Access, UBO.STATIC); end Initialize; -- ------------------------------ -- Add an operation parameter with the given name and type. -- ------------------------------ procedure Add_Parameter (Into : in out Operation_Definition; Name : in UString; Of_Type : in UString; Parameter : out Parameter_Definition_Access) is begin Parameter := new Parameter_Definition; Parameter.Set_Name (Name); Parameter.Type_Name := Of_Type; Into.Parameters.Append (Parameter); if Into.Kind = UNKNOWN and then Of_Type = "ASF.Parts.Part" then Into.Kind := ASF_UPLOAD; elsif Into.Kind = UNKNOWN and then Of_Type = "AWA.Events.Module_Event" then Into.Kind := AWA_EVENT; elsif Into.Kind = UNKNOWN then Into.Kind := ASF_ACTION; end if; end Add_Parameter; -- ------------------------------ -- Get the operation type. -- ------------------------------ function Get_Type (From : in Operation_Definition) return Operation_Type is begin return From.Kind; end Get_Type; -- ------------------------------ -- Create an operation with the given name. -- ------------------------------ function Create_Operation (Name : in UString) return Operation_Definition_Access is pragma Unreferenced (Name); Result : constant Operation_Definition_Access := new Operation_Definition; begin return Result; end Create_Operation; end Gen.Model.Operations;
programs/oeis/061/A061286.asm
neoneye/loda
22
247432
<filename>programs/oeis/061/A061286.asm<gh_stars>10-100 ; A061286: Smallest integer for which the number of divisors is the n-th prime. ; 2,4,16,64,1024,4096,65536,262144,4194304,268435456,1073741824,68719476736,1099511627776,4398046511104,70368744177664,4503599627370496,288230376151711744,1152921504606846976,73786976294838206464,1180591620717411303424,4722366482869645213696,302231454903657293676544,4835703278458516698824704,309485009821345068724781056,79228162514264337593543950336,1267650600228229401496703205376,5070602400912917605986812821504,81129638414606681695789005144064,324518553658426726783156020576256,5192296858534827628530496329220096 seq $0,6005 ; The odd prime numbers together with 1. max $0,2 add $0,3 mov $1,2 pow $1,$0 div $1,16 mov $0,$1
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/rep_clause5.ads
best08618/asylo
7
28446
-- { dg-do compile } pragma Implicit_Packing; package Rep_Clause5 is type Modes_Type is (Mode_0, Mode_1); for Modes_Type'size use 8; type Mode_Record_Type is record Mode_1 : aliased Modes_Type; Mode_2 : aliased Modes_Type; Mode_3 : aliased Modes_Type; Mode_4 : aliased Modes_Type; Time : aliased Float; end record; for Mode_Record_Type use record Mode_1 at 00 range 00 .. 07; Mode_2 at 01 range 00 .. 07; Mode_3 at 02 range 00 .. 07; Mode_4 at 03 range 00 .. 07; Time at 04 range 00 .. 31; end record; for Mode_Record_Type'Size use 64; for Mode_Record_Type'Alignment use 4; type Array_1_Type is array (0 .. 31) of Boolean; for Array_1_Type'size use 32; type Array_2_Type is array (0 .. 127) of Boolean; for Array_2_Type'size use 128; type Array_3_Type is array (0 .. 31) of Boolean; for Array_3_Type'size use 32; type Unsigned_Long is mod 2 ** 32; type Array_4_Type is array (1 .. 6) of unsigned_Long; type Primary_Data_Type is record Array_1 : aliased Array_1_Type; Mode_Record : aliased Mode_Record_Type; Array_2 : aliased Array_2_Type; Array_3 : Array_3_Type; Array_4 : Array_4_Type; end record; for Primary_Data_Type use record Array_1 at 0 range 0 .. 31; -- WORD 1 Mode_Record at 4 range 0 .. 63; -- WORD 2 .. 3 Array_2 at 12 range 0 .. 127; -- WORD 4 .. 7 Array_3 at 28 range 0 .. 31; -- WORD 8 Array_4 at 32 range 0 .. 191; -- WORD 9 .. 14 end record; for Primary_Data_Type'Size use 448; type Results_Record_Type is record Thirty_Two_Bit_Pad : Float; Result : Primary_Data_Type; end record; for Results_Record_Type use record Thirty_Two_Bit_Pad at 0 range 0 .. 31; Result at 4 range 0 .. 447; end record; end Rep_Clause5;
include/sf-audio-music.ads
danva994/ASFML-1.6
1
2127
-- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 <NAME> (<EMAIL>) -- // -- // This software is provided 'as-is', without any express or implied -- // warranty. -- // In no event will the authors be held liable for any damages arising from -- // the use of this software. -- // -- // Permission is granted to anyone to use this software for any purpose, -- // including commercial applications, and to alter it and redistribute it -- // freely, -- // subject to the following restrictions: -- // -- // 1. The origin of this software must not be misrepresented; -- // you must not claim that you wrote the original software. -- // If you use this software in a product, an acknowledgment -- // in the product documentation would be appreciated but is not required. -- // -- // 2. Altered source versions must be plainly marked as such, -- // and must not be misrepresented as being the original software. -- // -- // 3. This notice may not be removed or altered from any source -- // distribution. -- // -- //////////////////////////////////////////////////////////// -- //////////////////////////////////////////////////////////// -- // Headers -- //////////////////////////////////////////////////////////// with Sf.Config; with Sf.Audio.SoundStatus; with Sf.Audio.Types; package Sf.Audio.Music is use Sf.Config; use Sf.Audio.SoundStatus; use Sf.Audio.Types; -- //////////////////////////////////////////////////////////// -- /// Create a new music and load it from a file -- /// -- /// \param Filename : Path of the music file to open -- /// -- /// \return A new sfMusic object (NULL if failed) -- /// -- //////////////////////////////////////////////////////////// function sfMusic_CreateFromFile (Filename : String) return sfMusic_Ptr; -- //////////////////////////////////////////////////////////// -- /// Create a new music and load it from a file in memory -- /// -- /// \param Data : Pointer to the file data in memory -- /// \param SizeInBytes : Size of the data to load, in bytes -- /// -- /// \return A new sfMusic object (NULL if failed) -- /// -- //////////////////////////////////////////////////////////// function sfMusic_CreateFromMemory (Data : sfInt8_Ptr; SizeInBytes : sfSize_t) return sfMusic_Ptr; -- //////////////////////////////////////////////////////////// -- /// Destroy an existing music -- /// -- /// \param Music : Music to delete -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_Destroy (Music : sfMusic_Ptr); -- //////////////////////////////////////////////////////////// -- /// Set a music loop state -- /// -- /// \param Music : Music to set the loop state -- /// \param Loop : sfTrue to play in loop, sfFalse to play once -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_SetLoop (Music : sfMusic_Ptr; Enable : sfBool); -- //////////////////////////////////////////////////////////// -- /// Tell whether or not a music is looping -- /// -- /// \param Music : Music to get the loop state from -- /// -- /// \return sfTrue if the music is looping, sfFalse otherwise -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetLoop (Music : sfMusic_Ptr) return sfBool; -- //////////////////////////////////////////////////////////// -- /// Get a music duration -- /// -- /// \param Music : Music to get the duration from -- /// -- /// \return Music duration, in seconds -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetDuration (Music : sfMusic_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Start playing a music -- /// -- /// \param Music : Music to play -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_Play (Music : sfMusic_Ptr); -- //////////////////////////////////////////////////////////// -- /// Pause a music -- /// -- /// \param Music : Music to pause -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_Pause (Music : sfMusic_Ptr); -- //////////////////////////////////////////////////////////// -- /// Stop playing a music -- /// -- /// \param Music : Music to stop -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_Stop (Music : sfMusic_Ptr); -- //////////////////////////////////////////////////////////// -- /// Return the number of channels of a music (1 = mono, 2 = stereo) -- /// -- /// \param Music : Music to get the channels count from -- /// -- /// \return Number of channels -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetChannelsCount (Music : sfMusic_Ptr) return sfUint32; -- //////////////////////////////////////////////////////////// -- /// Get the stream sample rate of a music -- /// -- /// \param Music : Music to get the sample rate from -- /// -- /// \return Stream frequency (number of samples per second) -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetSampleRate (Music : sfMusic_Ptr) return sfUint32; -- //////////////////////////////////////////////////////////// -- /// Get the status of a music (stopped, paused, playing) -- /// -- /// \param Music : Music to get the status from -- /// -- /// \return Current status of the sound -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetStatus (Music : sfMusic_Ptr) return sfSoundStatus; -- //////////////////////////////////////////////////////////// -- /// Get the current playing position of a music -- /// -- /// \param Music : Music to get the position from -- /// -- /// \return Current playing position, expressed in seconds -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetPlayingOffset (Music : sfMusic_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Set the pitch of a music -- /// -- /// \param Music : Music to modify -- /// \param Pitch : New pitch -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_SetPitch (Music : sfMusic_Ptr; Pitch : Float); -- //////////////////////////////////////////////////////////// -- /// Set the volume of a music -- /// -- /// \param Music : Music to modify -- /// \param Volume : Volume (in range [0, 100]) -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_SetVolume (Music : sfMusic_Ptr; Volume : Float); -- //////////////////////////////////////////////////////////// -- /// Set the position of a music -- /// -- /// \param Music : Music to modify -- /// \param X : X position of the sound in the world -- /// \param Y : Y position of the sound in the world -- /// \param Z : Z position of the sound in the world -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_SetPosition (Music : sfMusic_Ptr; X, Y, Z : Float); -- //////////////////////////////////////////////////////////// -- /// Make the music's position relative to the listener's -- /// position, or absolute. -- /// The default value is false (absolute) -- /// -- /// \param Music : Music to modify -- /// \param Relative : True to set the position relative, false to set it absolute -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_SetRelativeToListener (Music : sfMusic_Ptr; Relative : sfBool); -- //////////////////////////////////////////////////////////// -- /// Set the minimum distance - closer than this distance, -- /// the listener will hear the music at its maximum volume. -- /// The default minimum distance is 1.0 -- /// -- /// \param Music : Music to modify -- /// \param MinDistance : New minimum distance for the music -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_SetMinDistance (Music : sfMusic_Ptr; MinDistance : Float); -- //////////////////////////////////////////////////////////// -- /// Set the attenuation factor - the higher the attenuation, the -- /// more the sound will be attenuated with distance from listener. -- /// The default attenuation factor 1.0 -- /// -- /// \param Sound : Sound to modify -- /// \param Attenuation : New attenuation factor for the sound -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_SetAttenuation (Music : sfMusic_Ptr; Attenuation : Float); -- //////////////////////////////////////////////////////////// -- /// Get the pitch of a music -- /// -- /// \param Music : Music to get the pitch from -- /// -- /// \return Pitch value -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetPitch (Music : sfMusic_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the volume of a music -- /// -- /// \param Music : Music to get the volume from -- /// -- /// \return Volume value (in range [1, 100]) -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetVolume (Music : sfMusic_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the position of a music -- /// -- /// \param Music : Music to get the position from -- /// \param X : X position of the sound in the world -- /// \param Y : Y position of the sound in the world -- /// \param Z : Z position of the sound in the world -- /// -- //////////////////////////////////////////////////////////// procedure sfMusic_GetPosition (Music : sfMusic_Ptr; X, Y, Z : access Float); -- //////////////////////////////////////////////////////////// -- /// Tell if the music's position is relative to the listener's -- /// position, or if it's absolute -- /// -- /// \param Music : Music to check -- /// -- /// \return sfTrue if the position is relative, sfFalse if it's absolute -- /// -- //////////////////////////////////////////////////////////// function sfMusic_IsRelativeToListener (Music : sfMusic_Ptr) return sfBool; -- //////////////////////////////////////////////////////////// -- /// Get the minimum distance of a music -- /// -- /// \param Music : Music to get the minimum distance from -- /// -- /// \return Minimum distance for the music -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetMinDistance (Music : sfMusic_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the attenuation factor of a music -- /// -- /// \param Music : Music to get the attenuation factor from -- /// -- /// \return Attenuation factor for the a music -- /// -- //////////////////////////////////////////////////////////// function sfMusic_GetAttenuation (Music : sfMusic_Ptr) return Float; private pragma Import (C, sfMusic_CreateFromMemory, "sfMusic_CreateFromMemory"); pragma Import (C, sfMusic_Destroy, "sfMusic_Destroy"); pragma Import (C, sfMusic_SetLoop, "sfMusic_SetLoop"); pragma Import (C, sfMusic_GetLoop, "sfMusic_GetLoop"); pragma Import (C, sfMusic_GetDuration, "sfMusic_GetDuration"); pragma Import (C, sfMusic_Play, "sfMusic_Play"); pragma Import (C, sfMusic_Pause, "sfMusic_Pause"); pragma Import (C, sfMusic_Stop, "sfMusic_Stop"); pragma Import (C, sfMusic_GetChannelsCount, "sfMusic_GetChannelsCount"); pragma Import (C, sfMusic_GetSampleRate, "sfMusic_GetSampleRate"); pragma Import (C, sfMusic_GetStatus, "sfMusic_GetStatus"); pragma Import (C, sfMusic_GetPlayingOffset, "sfMusic_GetPlayingOffset"); pragma Import (C, sfMusic_SetPitch, "sfMusic_SetPitch"); pragma Import (C, sfMusic_SetVolume, "sfMusic_SetVolume"); pragma Import (C, sfMusic_SetPosition, "sfMusic_SetPosition"); pragma Import (C, sfMusic_SetRelativeToListener, "sfMusic_SetRelativeToListener"); pragma Import (C, sfMusic_SetMinDistance, "sfMusic_SetMinDistance"); pragma Import (C, sfMusic_SetAttenuation, "sfMusic_SetAttenuation"); pragma Import (C, sfMusic_GetPitch, "sfMusic_GetPitch"); pragma Import (C, sfMusic_GetVolume, "sfMusic_GetVolume"); pragma Import (C, sfMusic_GetPosition, "sfMusic_GetPosition"); pragma Import (C, sfMusic_IsRelativeToListener, "sfMusic_IsRelativeToListener"); pragma Import (C, sfMusic_GetMinDistance, "sfMusic_GetMinDistance"); pragma Import (C, sfMusic_GetAttenuation, "sfMusic_GetAttenuation"); end Sf.Audio.Music;
source/league/ucd/matreshka-internals-unicode-ucd-core_00ff.ads
svn2github/matreshka
24
17031
<filename>source/league/ucd/matreshka-internals-unicode-ucd-core_00ff.ads ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_00FF is pragma Preelaborate; Group_00FF : aliased constant Core_Second_Stage := (16#00# => -- FF00 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#01# => -- FF01 (Other_Punctuation, Fullwidth, Other, Other, S_Term, Exclamation, (STerm | Terminal_Punctuation | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#02# => -- FF02 (Other_Punctuation, Fullwidth, Other, Other, Other, Ideographic, (Quotation_Mark | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#03# => -- FF03 (Other_Punctuation, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#04# => -- FF04 (Currency_Symbol, Fullwidth, Other, Other, Other, Prefix_Numeric, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#05# => -- FF05 (Other_Punctuation, Fullwidth, Other, Other, Other, Postfix_Numeric, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#06# => -- FF06 (Other_Punctuation, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#07# => -- FF07 (Other_Punctuation, Fullwidth, Other, Mid_Num_Let, Other, Ideographic, (Quotation_Mark | Case_Ignorable | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#08# => -- FF08 (Open_Punctuation, Fullwidth, Other, Other, Close, Open_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#09# => -- FF09 (Close_Punctuation, Fullwidth, Other, Other, Close, Close_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#0A# => -- FF0A (Other_Punctuation, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#0B# => -- FF0B (Math_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#0C# => -- FF0C (Other_Punctuation, Fullwidth, Other, Mid_Num, S_Continue, Close_Punctuation, (Terminal_Punctuation | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#0D# => -- FF0D (Dash_Punctuation, Fullwidth, Other, Other, S_Continue, Ideographic, (Dash | Hyphen | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#0E# => -- FF0E (Other_Punctuation, Fullwidth, Other, Mid_Num_Let, A_Term, Close_Punctuation, (STerm | Terminal_Punctuation | Case_Ignorable | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#0F# => -- FF0F (Other_Punctuation, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#10# .. 16#19# => -- FF10 .. FF19 (Decimal_Number, Fullwidth, Other, Other, Other, Ideographic, (Hex_Digit | Grapheme_Base | ID_Continue | XID_Continue | Changes_When_NFKC_Casefolded => True, others => False)), 16#1A# => -- FF1A (Other_Punctuation, Fullwidth, Other, Mid_Letter, S_Continue, Nonstarter, (Terminal_Punctuation | Case_Ignorable | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#1B# => -- FF1B (Other_Punctuation, Fullwidth, Other, Mid_Num, Other, Nonstarter, (Terminal_Punctuation | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#1C# .. 16#1E# => -- FF1C .. FF1E (Math_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#1F# => -- FF1F (Other_Punctuation, Fullwidth, Other, Other, S_Term, Exclamation, (STerm | Terminal_Punctuation | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#20# => -- FF20 (Other_Punctuation, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#21# .. 16#26# => -- FF21 .. FF26 (Uppercase_Letter, Fullwidth, Other, A_Letter, Upper, Ideographic, (Hex_Digit | Alphabetic | Cased | Changes_When_Lowercased | Changes_When_Casefolded | Changes_When_Casemapped | Grapheme_Base | ID_Continue | ID_Start | Uppercase | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#27# .. 16#3A# => -- FF27 .. FF3A (Uppercase_Letter, Fullwidth, Other, A_Letter, Upper, Ideographic, (Alphabetic | Cased | Changes_When_Lowercased | Changes_When_Casefolded | Changes_When_Casemapped | Grapheme_Base | ID_Continue | ID_Start | Uppercase | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#3B# => -- FF3B (Open_Punctuation, Fullwidth, Other, Other, Close, Open_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#3C# => -- FF3C (Other_Punctuation, Fullwidth, Other, Other, Other, Ideographic, (Other_Math | Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#3D# => -- FF3D (Close_Punctuation, Fullwidth, Other, Other, Close, Close_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#3E# => -- FF3E (Modifier_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Diacritic | Other_Math | Case_Ignorable | Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#3F# => -- FF3F (Connector_Punctuation, Fullwidth, Other, Extend_Num_Let, Other, Ideographic, (Grapheme_Base | ID_Continue | XID_Continue | Changes_When_NFKC_Casefolded => True, others => False)), 16#40# => -- FF40 (Modifier_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Diacritic | Case_Ignorable | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#41# .. 16#46# => -- FF41 .. FF46 (Lowercase_Letter, Fullwidth, Other, A_Letter, Lower, Ideographic, (Hex_Digit | Alphabetic | Cased | Changes_When_Uppercased | Changes_When_Titlecased | Changes_When_Casemapped | Grapheme_Base | ID_Continue | ID_Start | Lowercase | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#47# .. 16#5A# => -- FF47 .. FF5A (Lowercase_Letter, Fullwidth, Other, A_Letter, Lower, Ideographic, (Alphabetic | Cased | Changes_When_Uppercased | Changes_When_Titlecased | Changes_When_Casemapped | Grapheme_Base | ID_Continue | ID_Start | Lowercase | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#5B# => -- FF5B (Open_Punctuation, Fullwidth, Other, Other, Close, Open_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#5C# => -- FF5C (Math_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#5D# => -- FF5D (Close_Punctuation, Fullwidth, Other, Other, Close, Close_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#5E# => -- FF5E (Math_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#5F# => -- FF5F (Open_Punctuation, Fullwidth, Other, Other, Close, Open_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#60# => -- FF60 (Close_Punctuation, Fullwidth, Other, Other, Close, Close_Punctuation, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#61# => -- FF61 (Other_Punctuation, Halfwidth, Other, Other, S_Term, Close_Punctuation, (STerm | Terminal_Punctuation | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#62# => -- FF62 (Open_Punctuation, Halfwidth, Other, Other, Close, Open_Punctuation, (Quotation_Mark | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#63# => -- FF63 (Close_Punctuation, Halfwidth, Other, Other, Close, Close_Punctuation, (Quotation_Mark | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#64# => -- FF64 (Other_Punctuation, Halfwidth, Other, Other, S_Continue, Close_Punctuation, (Terminal_Punctuation | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#65# => -- FF65 (Other_Punctuation, Halfwidth, Other, Other, Other, Nonstarter, (Hyphen | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#66# => -- FF66 (Other_Letter, Halfwidth, Other, Katakana, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#67# .. 16#6F# => -- FF67 .. FF6F (Other_Letter, Halfwidth, Other, Katakana, O_Letter, Conditional_Japanese_Starter, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#70# => -- FF70 (Modifier_Letter, Halfwidth, Other, Katakana, O_Letter, Conditional_Japanese_Starter, (Diacritic | Extender | Alphabetic | Case_Ignorable | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#71# .. 16#9D# => -- FF71 .. FF9D (Other_Letter, Halfwidth, Other, Katakana, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#9E# .. 16#9F# => -- FF9E .. FF9F (Modifier_Letter, Halfwidth, Extend, Extend, Extend, Nonstarter, (Diacritic | Other_Grapheme_Extend | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | ID_Start | XID_Continue | Changes_When_NFKC_Casefolded => True, others => False)), 16#A0# => -- FFA0 (Other_Letter, Halfwidth, Other, A_Letter, O_Letter, Alphabetic, (Other_Default_Ignorable_Code_Point | Alphabetic | Default_Ignorable_Code_Point | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), 16#BF# .. 16#C1# => -- FFBF .. FFC1 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#C8# .. 16#C9# => -- FFC8 .. FFC9 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#D0# .. 16#D1# => -- FFD0 .. FFD1 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#D8# .. 16#D9# => -- FFD8 .. FFD9 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#DD# .. 16#DF# => -- FFDD .. FFDF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#E0# => -- FFE0 (Currency_Symbol, Fullwidth, Other, Other, Other, Postfix_Numeric, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#E1# => -- FFE1 (Currency_Symbol, Fullwidth, Other, Other, Other, Prefix_Numeric, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#E2# => -- FFE2 (Math_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#E3# => -- FFE3 (Modifier_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Diacritic | Case_Ignorable | Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#E4# => -- FFE4 (Other_Symbol, Fullwidth, Other, Other, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#E5# .. 16#E6# => -- FFE5 .. FFE6 (Currency_Symbol, Fullwidth, Other, Other, Other, Prefix_Numeric, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#E7# => -- FFE7 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#E8# => -- FFE8 (Other_Symbol, Halfwidth, Other, Other, Other, Alphabetic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#E9# .. 16#EC# => -- FFE9 .. FFEC (Math_Symbol, Halfwidth, Other, Other, Other, Alphabetic, (Grapheme_Base | Math | Changes_When_NFKC_Casefolded => True, others => False)), 16#ED# .. 16#EE# => -- FFED .. FFEE (Other_Symbol, Halfwidth, Other, Other, Other, Alphabetic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), 16#EF# => -- FFEF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#F0# .. 16#F8# => -- FFF0 .. FFF8 (Unassigned, Neutral, Control, Other, Other, Unknown, (Other_Default_Ignorable_Code_Point | Default_Ignorable_Code_Point | Changes_When_NFKC_Casefolded => True, others => False)), 16#F9# .. 16#FB# => -- FFF9 .. FFFB (Format, Neutral, Control, Format, Format, Combining_Mark, (Case_Ignorable => True, others => False)), 16#FC# => -- FFFC (Other_Symbol, Neutral, Other, Other, Other, Contingent_Break, (Grapheme_Base => True, others => False)), 16#FD# => -- FFFD (Other_Symbol, Ambiguous, Other, Other, Other, Ambiguous, (Grapheme_Base => True, others => False)), 16#FE# .. 16#FF# => -- FFFE .. FFFF (Unassigned, Neutral, Other, Other, Other, Unknown, (Noncharacter_Code_Point => True, others => False)), others => (Other_Letter, Halfwidth, Other, A_Letter, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_00FF;
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1156.asm
ljhsiun2/medusa
9
3893
.global s_prepare_buffers s_prepare_buffers: push %r10 push %rcx push %rdi push %rsi lea addresses_WT_ht+0x713f, %rsi lea addresses_A_ht+0x862f, %rdi clflush (%rsi) nop nop nop nop and $50817, %r10 mov $122, %rcx rep movsq nop xor %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r8 push %rax push %rbx push %rcx push %rsi // Faulty Load lea addresses_WC+0xb73f, %r8 nop nop nop nop nop sub $55686, %r10 movb (%r8), %bl lea oracles, %rsi and $0xff, %rbx shlq $12, %rbx mov (%rsi,%rbx,1), %rbx pop %rsi pop %rcx pop %rbx pop %rax pop %r8 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_658.asm
ljhsiun2/medusa
9
1472
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %rax push %rcx push %rdi push %rsi lea addresses_UC_ht+0xe58, %rsi lea addresses_WT_ht+0x8258, %rdi nop nop nop nop cmp $31857, %r13 mov $34, %rcx rep movsl nop nop inc %rcx lea addresses_normal_ht+0x1ae58, %rdi nop nop nop nop nop add $6972, %r14 movb $0x61, (%rdi) nop and %r14, %r14 lea addresses_WC_ht+0x6658, %rsi lea addresses_normal_ht+0x14658, %rdi nop nop nop nop nop and $60207, %rax mov $106, %rcx rep movsb nop nop nop inc %rsi lea addresses_normal_ht+0x6358, %r13 nop nop nop nop sub $43969, %rsi movw $0x6162, (%r13) nop xor %rax, %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r8 push %r9 push %rbp push %rbx push %rsi // Store lea addresses_A+0xf048, %r13 nop nop nop nop dec %rsi mov $0x5152535455565758, %r9 movq %r9, %xmm4 vmovups %ymm4, (%r13) add %r9, %r9 // Store lea addresses_D+0x1c158, %r9 nop cmp $59464, %rbx mov $0x5152535455565758, %r13 movq %r13, %xmm2 movups %xmm2, (%r9) nop nop nop cmp %rsi, %rsi // Store mov $0x5b99980000000058, %rsi nop nop nop nop dec %r9 movl $0x51525354, (%rsi) nop dec %r14 // Store lea addresses_normal+0xfd18, %rbx nop nop cmp %r8, %r8 mov $0x5152535455565758, %rbp movq %rbp, (%rbx) nop nop nop nop nop and $4416, %r9 // Store lea addresses_WC+0x19c3d, %rbx nop xor $37007, %rsi mov $0x5152535455565758, %r14 movq %r14, %xmm0 movups %xmm0, (%rbx) nop nop nop nop cmp %rsi, %rsi // Store lea addresses_PSE+0x1a458, %r8 nop nop nop nop nop cmp $54441, %rbx movl $0x51525354, (%r8) // Exception!!! nop mov (0), %r14 nop nop nop nop add %r14, %r14 // Faulty Load mov $0x71cf470000000258, %rsi nop nop add $38641, %r8 movntdqa (%rsi), %xmm3 vpextrq $0, %xmm3, %r13 lea oracles, %r9 and $0xff, %r13 shlq $12, %r13 mov (%r9,%r13,1), %r13 pop %rsi pop %rbx pop %rbp pop %r9 pop %r8 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D', 'AVXalign': False, 'size': 16}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_NC', 'AVXalign': True, 'size': 4}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 4}} [Faulty Load] {'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}} {'src': {'same': True, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 8, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
src/Generics/Mu/Conversion.agda
flupe/generics
11
1908
module Generics.Mu.Conversion where
CPU/cpu_test/test_storage/mips4.asm
SilenceX12138/MIPS-Microsystems
55
90098
<reponame>SilenceX12138/MIPS-Microsystems<filename>CPU/cpu_test/test_storage/mips4.asm<gh_stars>10-100 ori $a1,$0,111 ori $a2,$0,112 beq $a1,$a2,end ori $a1,$a1,111 beq $a1,$a1,out nop end: nop out: addu $a0,$a0,$a1
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2401i.ada
best08618/asylo
7
27136
-- CE2401I.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT READ (WITH AND WITHOUT PARAMETER FROM), WRITE (WITH -- AND WITHOUT PARAMETER TO), SET_INDEX, INDEX, SIZE, AND -- END_OF_FILE ARE SUPPORTED FOR DIRECT FILES WITH ELEMENT_TYPE -- FIXED POINT. -- APPLICABILITY CRITERIA: -- THIS TEST IS ONLY FOR IMPLEMENTATIONS WHICH SUPPORT CREATION OF -- DIRECT FILES WITH INOUT_FILE MODE AND OPENING OF DIRECT FILES -- WITH IN_FILE MODE. -- HISTORY: -- DWC 08/10/87 CREATED ORIGINAL VERSION. WITH REPORT; USE REPORT; WITH DIRECT_IO; PROCEDURE CE2401I IS END_SUBTEST : EXCEPTION; BEGIN TEST ("CE2401I", "CHECK THAT READ, WRITE, SET_INDEX, " & "INDEX, SIZE, AND END_OF_FILE ARE " & "SUPPORTED FOR DIRECT FILES WITH " & "ELEMENT_TYPE FIXED"); DECLARE TYPE FIX_TYPE IS DELTA 0.5 RANGE 0.0 .. 255.0; PACKAGE DIR_FIX IS NEW DIRECT_IO (FIX_TYPE); USE DIR_FIX; FILE_FIX : FILE_TYPE; BEGIN BEGIN CREATE (FILE_FIX, INOUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR | NAME_ERROR => NOT_APPLICABLE ("USE_ERROR | NAME_ERROR RAISED " & "ON CREATE - FIXED POINT"); RAISE END_SUBTEST; WHEN OTHERS => FAILED ("UNEXPECTED ERROR RAISED ON " & "CREATE - FIXED POINT"); RAISE END_SUBTEST; END; DECLARE FIX : FIX_TYPE := 16.0; ITEM_FIX : FIX_TYPE; ONE_FIX : POSITIVE_COUNT := 1; TWO_FIX : POSITIVE_COUNT := 2; BEGIN BEGIN WRITE (FILE_FIX, FIX); EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED ON WRITE FOR " & "FIXED POINT - 1"); END; BEGIN WRITE (FILE_FIX, FIX, TWO_FIX); EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED ON WRITE FOR " & "FIXED POINT - 2"); END; BEGIN IF SIZE (FILE_FIX) /= TWO_FIX THEN FAILED ("SIZE FOR TYPE FIXED POINT"); END IF; IF NOT END_OF_FILE (FILE_FIX) THEN FAILED ("WRONG END_OF_FILE VALUE FOR " & "FIXED POINT"); END IF; SET_INDEX (FILE_FIX, ONE_FIX); IF INDEX (FILE_FIX) /= ONE_FIX THEN FAILED ("WRONG INDEX VALUE FOR FIXED " & "POINT"); END IF; END; CLOSE (FILE_FIX); BEGIN OPEN (FILE_FIX, IN_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("OPEN FOR IN_FILE MODE " & "NOT SUPPORTED"); RAISE END_SUBTEST; END; BEGIN READ (FILE_FIX, ITEM_FIX); IF ITEM_FIX /= FIX THEN FAILED ("WRONG VALUE READ FOR FIXED POINT"); END IF; EXCEPTION WHEN OTHERS => FAILED ("READ WITHOUT FROM FOR FIXED " & "POINT"); END; BEGIN READ (FILE_FIX, ITEM_FIX, ONE_FIX); IF ITEM_FIX /= FIX THEN FAILED ("WRONG VALUE READ WITH INDEX " & "FOR FIXED POINT"); END IF; EXCEPTION WHEN OTHERS => FAILED ("READ WITH FROM FOR FIXED POINT"); END; BEGIN DELETE (FILE_FIX); EXCEPTION WHEN USE_ERROR => NULL; END; END; EXCEPTION WHEN END_SUBTEST => NULL; END; RESULT; END CE2401I;
PIC/mikroC/Projects/PIC18F4550/USB_HID.asm
UdayanSinha/Code_Blocks
3
100146
_interrupt: ;USB_HID.c,8 :: void interrupt(){ ;USB_HID.c,9 :: USB_Interrupt_Proc(); // USB servicing is done inside the interrupt CALL _USB_Interrupt_Proc+0, 0 ;USB_HID.c,10 :: } L_end_interrupt: L__interrupt10: RETFIE 1 ; end of _interrupt _main: ;USB_HID.c,12 :: void main(void) ;USB_HID.c,14 :: ADCON1 |= 0x0F; // Configure all ports with analog function as digital MOVLW 15 IORWF ADCON1+0, 1 ;USB_HID.c,15 :: CMCON |= 7; // Disable comparators MOVLW 7 IORWF CMCON+0, 1 ;USB_HID.c,17 :: HID_Enable(&readbuff,&writebuff); // Enable HID communication MOVLW _readbuff+0 MOVWF FARG_HID_Enable_readbuff+0 MOVLW hi_addr(_readbuff+0) MOVWF FARG_HID_Enable_readbuff+1 MOVLW _writebuff+0 MOVWF FARG_HID_Enable_writebuff+0 MOVLW hi_addr(_writebuff+0) MOVWF FARG_HID_Enable_writebuff+1 CALL _HID_Enable+0, 0 ;USB_HID.c,19 :: while(1) L_main0: ;USB_HID.c,21 :: while(!HID_Read()); //wait for getting input data from USB L_main2: CALL _HID_Read+0, 0 MOVF R0, 1 BTFSS STATUS+0, 2 GOTO L_main3 GOTO L_main2 L_main3: ;USB_HID.c,24 :: for(cnt=0;cnt<64;cnt++) CLRF _cnt+0 L_main4: MOVLW 64 SUBWF _cnt+0, 0 BTFSC STATUS+0, 0 GOTO L_main5 ;USB_HID.c,26 :: writebuff[cnt]=test_data[cnt]; MOVLW _writebuff+0 MOVWF FSR1 MOVLW hi_addr(_writebuff+0) MOVWF FSR1H MOVF _cnt+0, 0 ADDWF FSR1, 1 BTFSC STATUS+0, 0 INCF FSR1H, 1 MOVLW _test_data+0 MOVWF FSR0 MOVLW hi_addr(_test_data+0) MOVWF FSR0H MOVF _cnt+0, 0 ADDWF FSR0, 1 BTFSC STATUS+0, 0 INCF FSR0H, 1 MOVF POSTINC0+0, 0 MOVWF POSTINC1+0 ;USB_HID.c,24 :: for(cnt=0;cnt<64;cnt++) INCF _cnt+0, 1 ;USB_HID.c,27 :: } GOTO L_main4 L_main5: ;USB_HID.c,29 :: while(!HID_Write(&writebuff,64)); //send data over USB L_main7: MOVLW _writebuff+0 MOVWF FARG_HID_Write_writebuff+0 MOVLW hi_addr(_writebuff+0) MOVWF FARG_HID_Write_writebuff+1 MOVLW 64 MOVWF FARG_HID_Write_len+0 CALL _HID_Write+0, 0 MOVF R0, 1 BTFSS STATUS+0, 2 GOTO L_main8 GOTO L_main7 L_main8: ;USB_HID.c,30 :: } GOTO L_main0 ;USB_HID.c,31 :: } L_end_main: GOTO $+0 ; end of _main
programs/oeis/145/A145568.asm
karttu/loda
1
96541
; A145568: Characteristic function of numbers relatively prime to 11. ; 0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1 gcd $0,11 div $0,7 pow $1,$0
_incObj/0E Title Screen Sonic.asm
kodishmediacenter/msu-md-sonic
9
175022
; --------------------------------------------------------------------------- ; Object 0E - Sonic on the title screen ; --------------------------------------------------------------------------- TitleSonic: moveq #0,d0 move.b obRoutine(a0),d0 move.w TSon_Index(pc,d0.w),d1 jmp TSon_Index(pc,d1.w) ; =========================================================================== TSon_Index: dc.w TSon_Main-TSon_Index dc.w TSon_Delay-TSon_Index dc.w TSon_Move-TSon_Index dc.w TSon_Animate-TSon_Index ; =========================================================================== TSon_Main: ; Routine 0 addq.b #2,obRoutine(a0) move.w #$F0,obX(a0) move.w #$DE,obScreenY(a0) ; position is fixed to screen move.l #Map_TSon,obMap(a0) move.w #$2300,obGfx(a0) move.b #1,obPriority(a0) move.b #29,obDelayAni(a0) ; set time delay to 0.5 seconds lea (Ani_TSon).l,a1 bsr.w AnimateSprite TSon_Delay: ;Routine 2 subq.b #1,obDelayAni(a0) ; subtract 1 from time delay bpl.s @wait ; if time remains, branch addq.b #2,obRoutine(a0) ; go to next routine bra.w DisplaySprite @wait: rts ; =========================================================================== TSon_Move: ; Routine 4 subq.w #8,obScreenY(a0) ; move Sonic up cmpi.w #$96,obScreenY(a0) ; has Sonic reached final position? bne.s @display ; if not, branch addq.b #2,obRoutine(a0) @display: bra.w DisplaySprite rts ; =========================================================================== TSon_Animate: ; Routine 6 lea (Ani_TSon).l,a1 bsr.w AnimateSprite bra.w DisplaySprite rts
Src/primaries.asm
slowcorners/Minimal-FORTH
1
168195
; ---------------------------------------------------------------------- ; FORTH PRIMARIES ; HLIT: DB ^3 "LI" ^'T' ; ***** LIT DW 0 LIT: DW LIT0 LIT0: JPS _LIT ; R1 = (IP)+ JPA PUSH ; -(SP) = R1; NEXT HEXEC: DB ^7 "EXECUT" ^'E' ; ***** EXECUTE DW HLIT EXEC: DW EXEC0 EXEC0: LDR SP ; WA = (SP)+ STA WA.0 INW SP LDR SP STA WA.1 INW SP JPA NEXT10 ; jump @(WA)+ HBRAN: DB ^6 "BRANC" ^'H' ; ***** BRANCH DW HEXEC BRAN: DW BRAN0 BRAN0: JPS _BRAN ; IP = IP + (IP) JPA NEXT HZBRAN: DB ^7 "0BRANC" ^'H' ; ***** 0BRANCH DW HBRAN ZBRAN: DW ZBRAN0 ZBRAN0: LDR SP CPI 0 ; Low byte non-zero? BNE ZBRA10 ; YES: Do not branch INW SP LDR SP CPI 0 ; High byte non-zero? BNE ZBRA20 ; YES: Do not branch INW SP JPA BRAN0 ; IP = IP + (IP); NEXT ZBRA10: INW SP ZBRA20: INW SP INW IP ; Just skip jump offset INW IP JPA NEXT HXPLOO: DB ^7 "(+LOOP" ^')' ; ***** (+LOOP) DW HZBRAN XPLOO: DW XPLOO0 XPLOO0: JPS _GET2 ; R2 = (SP) [only copying increment] JPS _RPOP1 ; R1 = (RP)+ JPS _ADD16 ; R1 = counter' JPS _RGET2 ; R2 = limit JPS _RPUSH1 ; -(RP) = R1' JPS _POP3 ; R3 = (SP)+ [now popping incr] LDA R3.1 ; Is increment negative? CPI 0 ; : BPL XPLO10 ; Handle negative increment JPS _XCH16 ; R1 <-> R2 ; Compare counter to limit XPLO10: LDA R1.1 ; Compare MSB CPA R2.1 ; : BMI BRAN0 ; R2 is greater, continue looping BEQ XPLO20 ; MSBs are equal, check LSBs JPA XPLO30 ; R1 is greater, stop looping ; MSBs are equal XPLO20: LDA R1.0 ; Compare LSB CPA R2.0 BMI BRAN0 ; R2 is greater, continue looping ; Limit reached, cleanup rstack and stop looping XPLO30: LDI 4 ; Drop loop counter ... ADW RP ; ... and loop limit LDI 2 ; Skip branch offset ADW IP ; : JPA NEXT HXLOOP: DB ^6 "(LOOP" ^')' ; ***** (LOOP) DW HXPLOO XLOOP: DW XLOOP0 XLOOP0: CLW R1 ; Push a one INW R1 ; : JPS _PUSH1 ; : JPA XPLOO0 ; (+LOOP) HXDO: DB ^4 "(DO" ^')' ; ***** (DO) DW HXLOOP XDO: DW XDO0 XDO0: JPS _POP21 ; Loop counter, limit JPS _RPUSH1 ; Push limit onto rstack JPS _RPUSH2 ; Push loop counter onto rstack JPA NEXT HI: DB ^1 ^'I' ; ***** I DW HXDO I: DW I0 I0: JPS _RGET1 ; Get loop counter JPA PUSH ; Push it onto dstack HDIGIT: DB ^5 "DIGI" ^'T' ; ***** DIGIT DW HI DIGIT: DW DIGIT0 DIGIT0: JPS _POP21 ; R2 = base, R1 = char LDA R1.0 ; Get character into A CPI 'A' ; Greater or equal to 'A'? BMI DIGI10 ; NO: Then it has to be '0' - '9' CPI '[' ; Less than '[' (i.e. 'A' - 'Z')? BPL PUSHF ; NO: Not a digit SBI 55 ; A becomes 10 JPA DIGI20 ; Go check against base ; '0' - '9' case DIGI10: SBI '0' ; Assume '0' - '9' BMI PUSHF ; Oops! Negative, not a digit CPI 10 ; Greater than 9? BPL PUSHF ; YES: Not a digit ; Check result against base DIGI20: CPA R2.0 ; Less than base? BMI DIGI77 ; YES: Conversion done JPA PUSHF ; NO: Not a digit ; Conversion successful DIGI77: STA R1.0 ; Store binary value JPS _PUSH1 ; Push the value JPA PUSHT ; Push TRUE; NEXT HPFIND: DB ^6 "(FIND" ^')' ; ***** (FIND) DW HDIGIT PFIND: DW PFIND0 PFIND0: JPS _POP1 ; NFA JPS _POP3 ; String address PFIN10: LDA R3.0 ; R2 = R3 (string address) STA R2.0 ; : LDA R3.1 ; : STA R2.1 ; : ; Fast comparison of length bytes LDR R1 ; Get lByte STA R1.2 ; ... Store as potential result LSL ; lByte &= 0x3F LSL ; : LSR ; : LSR ; : STA R2.2 ; R2.2 is counter for string match CPR R2 ; lByte == string length? BNE PFIN25 ; NO: Move over to next header ; Length bytes match, check names PFIN20: INW R1 ; Bump pointers INW R2 ; : LDR R1 ; Get char from dictionary LSL ; char &= 0x7F LSR ; : CPR R2 ; Is it a match with search string? BNE PFIN30 ; NO: Look at next header in dictionary DEB R2.2 ; YES: Decrement character counter CPI 0 ; At end of string? BEQ PFIN77 ; YES: This is the word we are looking for JPA PFIN20 ; Match so far, try next char ; Step to next header in dictionary PFIN25: LSL ; Eliminate potential smudge bit LSL ; A = A & 0x1F LSL ; lByte consists of [^ISnnnnn] LSR ; : LSR ; : LSR ; : STA R2.2 ; : also update char counter INW R1 ; Bump NFA pointer to actual characters PFIN30: INW R1 ; Bump NFA pointer DEB R2.2 ; Decrement character counter CPI 0 ; End of name field? BNE PFIN30 ; NO: Step to next char JPS _ATR1 ; YES: R1 = (R1) LDA R1.1 ; At end of dictionary? CPI 0 ; : BNE PFIN10 ; NO: Try this word for match LDA R1.0 ; : CPI 0 ; : BNE PFIN10 ; NO: Try this word for match ; Word not found, return a single FALSE PFIN88: JPA PUSHF ; Done ; Word found, return PFA, lByte, TRUE PFIN77: LDI 5 ; Bump ptr to PFA ADW R1 ; : JPS _PUSH1 ; Push PFA LDA R1.2 ; Get stored length byte STA R1.0 ; : CLB R1.1 ; Clear MSB JPS _PUSH1 ; Push length byte JPA PUSHT ; Done HENCL: DB ^7 "ENCLOS" ^'E' ; ***** ENCLOSE DW HPFIND ENCL: DW ENCL0 ENCL0: JPS _POP3 ; Get delimiter char JPS _GET1 ; Get addr of input CLW R2 ; Initialize char index ; Scan preceeding delimiters ENCL10: LDR R1 ; Get char from input CPI 0 ; Is it <NUL>? BEQ ENCL50 ; YES: <NUL> before first non-delimiter CPA R3.0 ; Is it a delimiter? BNE ENCL20 ; NO: We have the start of next token INW R1 ; Bump to next char ... INW R2 ; ... also increase index JPA ENCL10 ; Go back to look at next char ; Start of token ENCL20: JPS _PUSH2 ; Push result n1 (first char of token) ENCL30: LDR R1 ; Get char from input CPI 0 ; Is it <NUL>? BEQ ENCL60 ; YES: <NUL> found CPA R3.0 ; Is it a delimiter? BEQ ENCL40 ; YES: We have the end of the token INW R1 ; Bump to next char ... INW R2 ; ... also increase index JPA ENCL30 ; Go back to look at next char ; End of token ENCL40: JPS _PUSH2 ; Push result n2 (ending delimiter) INW R2 ; Also push n3 ... JPS _PUSH2 ; : ... (index to first non-scanned char) JPA NEXT ; Done ; <NUL> word found ENCL50: JPS _PUSH2 ; Push i (index to <NUL>) INW R2 ; Push i + 1 (a null is one character long) ; Token ends with a <NUL> ENCL60: JPS _PUSH2 ; : JPS _PUSH2 ; : JPA NEXT ; Done ; NOTE: EMIT, KEY, ?TERMINAL and CR moved to "extras" as they have been ; implemented as vectored functions in Minimal-FORTH HCMOVE: DB ^5 "CMOV" ^'E' ; ***** CMOVE DW HENCL CMOVE: DW CMOVE0 CMOVE0: JPS _POP321 ; R3 = count, R2 = dst, R1 = src CMOV10: LDR R1 ; Get byte from source STR R2 ; Store to destination INW R1 ; Bump source pointer INW R2 ; Bump destination pointer DEW R3 ; Decrement count LDA R3.0 ; Low byte zero? CPI 0 ; : BNE CMOV10 ; NO: One more byte LDA R3.1 ; High byte zero? CPI 0 ; : BNE CMOV10 ; NO: One more byte JPA NEXT ; YES: Count zero. Done. HUSTAR: DB ^2 "U" ^'*' ; ***** U* DW HCMOVE USTAR: DW USTAR0 USTAR0: JPS _POP21 ; R2 = oper2, R1 = oper1 JPS _UMULT ; u32 = u16 * u16 DEW SP ; -(SP) = R3X LDA R3.1 ; : STR SP ; : DEW SP ; : LDA R3.0 ; : STR SP ; : DEW SP ; : LDA R3.3 ; : STR SP ; : DEW SP ; : LDA R3.2 ; : STR SP ; : JPA NEXT ; Done HUSLAS: DB ^2 "U" ^'/' ; ***** U/ DW HUSTAR USLAS: DW USLAS0 USLAS0: JPS _POP21 ; R2 = divisor, R1 = dividend-hi LDA R1.0 ; Move high part to R1.2 and R1.3 STA R1.2 ; : LDA R1.1 ; : STA R1.3 ; : JPS _POP1 ; dividend, low 16b JPS _UDIV ; u32 / u16 --> quot_u16, rem_u16 JPA IPUSH ; Push R1H; Push R1L; NEXT HAND: DB ^3 "AN" ^'D' ; ***** AND DW HUSLAS AND: DW AND0 AND0: JPS _POP21 ; R2 = oper2, R1 = oper1 JPS _AND16 ; R1 = R1 & R2 JPA PUSH ; Done HOR: DB ^2 "O" ^'R' ; ***** OR DW HAND OR: DW OR0 OR0: JPS _POP21 ; R2 = oper2, R1 = oper1 JPS _OR16 ; R1 = R1 | R2 JPA PUSH ; Done HXOR: DB ^3 "XO" ^'R' ; ***** XOR DW HOR XOR: DW XOR0 XOR0: JPS _POP21 ; R2 = oper2, R1 = oper1 JPS _XOR16 ; R1 = R1 ^ R2 JPA PUSH ; Done HNOT: DB ^3 "NO" ^'T' ; ***** NOT DW HXOR NOT: DW ZEQU HSPAT: DB ^3 "SP" ^'@' ; ***** SP@ DW HNOT SPAT: DW SPAT0 SPAT0: LDA SP.0 ; Get stack pointer STA R1.0 ; : into R1 LDA SP.1 ; : STA R1.1 ; : JPA PUSH ; Push R1; NEXT HSPSTO: DB ^3 "SP" ^'!' ; ***** SP! DW HSPAT SPSTO: DW SPSTO0 SPSTO0: LDI 18 ; Index of SP0 STA R2.0 ; : in boot table JPS _PORIG ; R3 = &bootTable[R2] JPS _LD16 ; R1 = XSP LDA R1.0 ; SP = R1 STA SP.0 ; : LDA R1.1 ; : STA SP.1 ; : JPA NEXT ; Done HRPSTO: DB ^3 "RP" ^'!' ; ***** RP! DW HSPSTO RPSTO: DW RPSTO0 RPSTO0: LDI 20 ; Index of SP0 STA R2.0 ; : in boot table JPS _PORIG ; R3 = &bootTable[R2] JPS _LD16 ; R1 = XRP LDA R1.0 ; SP = R1 STA RP.0 ; : LDA R1.1 ; : STA RP.1 ; : JPA NEXT ; Done HUPSTO: DB ^3 "UP" ^'!' ; ***** UP! DW HRPSTO UPSTO: DW UPSTO0 UPSTO0: LDI 16 ; Index of UP0 STA R2.0 ; : in boot table JPS _PORIG ; R3 = &bootTable[R2] JPS _LD16 ; R1 = XUP LDA R1.0 ; UP = R1 STA UP.0 ; : LDA R1.1 ; : STA UP.1 ; : JPA NEXT ; Done HSEMIS: DB ^2 ";" ^'S' ; ***** ;S DW HRPSTO SEMIS: DW SEMIS0 SEMIS0: LDR RP ; IP = (RP)+ STA IP.0 ; : INW RP ; : LDR RP ; : STA IP.1 ; : INW RP ; : JPA NEXT ; Done HLEAVE: DB ^5 "LEAV" ^'E' ; ***** LEAVE DW HSEMIS LEAVE: DW LEAVE0 LEAVE0: JPS _RPOP1 ; 2(RP) = (RP) JPS _RPUT1 ; : JPS _RPUSH1 ; : JPA NEXT HTOR: DB ^2 ">" ^'R' ; ***** >R DW HLEAVE TOR: DW TOR0 TOR0: JPS _POP1 ; -(RP) = (SP)+ JPS _RPUSH1 ; : JPA NEXT HFROMR: DB ^2 "R" ^'>' ; ***** R> DW HTOR FROMR: DW FROMR0 FROMR0: JPS _RPOP1 ; -(SP) = (RP)+ JPA PUSH ; : HR: DB ^1 ^'R' ; ***** R DW HFROMR R: DW R0 R0: JPS _RGET1 ; -(SP) = (RP) JPA PUSH ; : HZEQU: DB ^2 "0" ^'=' ; ***** 0= DW HR ZEQU: DW ZEQU0 ZEQU0: JPS _POP1 JPS _ZEQU JPA PUSH ; _ZEQU: LDA R1.0 ; Get LSB CPI 0 ; Is it zero? BNE _ZEQ10 ; NO: Return false flag LDA R1.1 ; Get MSB CPI 0 ; Is it zero? BNE _ZEQ10 ; NO: Return false flag ; Zero case CLW R1 ; True flag DEW R1 ; : RTS ; Done ; Non-zero case _ZEQ10: CLW R1 ; False flag RTS ; Done HZLESS: DB ^2 "0" ^'<' ; ***** 0< DW HZEQU ZLESS: DW ZLESS0 ZLESS0: JPS _POP1 JPS _ZLESS JPA PUSH ; _ZLESS: LDA R1.1 ; Get MSB CPI 0 ; Is it negative? BMI _ZLE10 ; YES: Return true flag ; Zero or positive case CLW R1 ; NO: Return false flag RTS ; Done ; Negative case _ZLE10: CLW R1 ; True flag DEW R1 ; : RTS ; Done HPLUS: DB ^1 ^'+' ; ***** + DW HZLESS PLUS: DW PLUS0 PLUS0: JPS _POP21 ; R2 = oper2, R1 = oper1 JPS _ADD16 ; R1 = R1 + R2 JPA PUSH ; -(SP) = R1; NEXT HDPLUS: DB ^2 "D" ^'+' ; ***** D+ DW HPLUS DPLUS: DW DPLUS0 DPLUS0: JPS _DPOP2 ; Get second operand JPS _DPOP1 ; Get first operand JPS _ADD32 ; R1X = R1X + R2X JPA DPUSH ; -(SP) = R1X; NEXT HMINUS: DB ^5 "MINU" ^'S' ; ***** MINUS DW HDPLUS MINUS: DW MINUS0 MINUS0: JPS _POP1 ; Get operand JPS _NEG16 ; Negate JPA PUSH HDMINU: DB ^6 "DMINU" ^'S' ; ***** DMINUS DW HMINUS DMINU: DW DMINU0 DMINU0: JPS _DPOP1 ; Get operand JPS _NEG32 ; Negate JPA DPUSH HPICK: DB ^4 "PIC" ^'K' ; ***** PICK DW HDMINU PICK: DW PICK0 PICK0: JPS _PICK JPA NEXT ; _PICK: JPS _POP1 ; Get index number LDA R1.0 ; Push onto Minimal stack PHS ; : JPS __PICK ; R1 = n(SP) PLS ; Remove index number JPS _PUSH1 ; -(SP) = R1 RTS ; Done HROLL: DB ^4 "ROL" ^'L' ; ***** ROLL DW HPICK ROLL: DW ROLL0 ROLL0: JPS _ROLL JPA NEXT ; _ROLL: JPS _POP1 ; Get index number LDA R1.0 ; Push onto Minimal stack PHS ; : JPS __ROLL ; R1 = n(SP) PLS ; Remove index number RTS ; Done HOVER: DB ^4 "OVE" ^'R' ; ***** OVER DW HROLL OVER: DW OVER0 OVER0: JPS _OVER JPA NEXT ; _OVER: JPS _POP2 ; n1 n2 -- n1 n2 n1 JPS _GET1 ; : JPS _PUSH2 ; : JPS _PUSH1 ; : RTS HDROP: DB ^4 "DRO" ^'P' ; **** DROP DW HOVER DROP: DW DROP0 DROP0: JPS _DROP JPA NEXT ; _DROP: LDI 2 ; n1 -- ADW SP ; : RTS ; Done HSWAP: DB ^4 "SWA" ^'P' ; **** SWAP DW HDROP SWAP: DW SWAP0 SWAP0: JPS _SWAP JPA NEXT ; _SWAP: JPS _POP21 ; n1 n2 -- n2 n1 JPS _PUSH2 ; : JPS _PUSH1 ; : RTS ; Done HDUP: DB ^3 "DU" ^'P' ; **** DUP DW HSWAP DUP: DW DUP0 DUP0: JPS _DUP JPA NEXT ; _DUP: JPS _GET1 ; n1 -- n1 n1 JPS _PUSH1 ; : RTS HTOVER: DB ^5 "2OVE" ^'R' ; ***** 2OVER DW HDUP TOVER: DW TOVER0 TOVER0: LDI 3 PHS JPS __PICK ; 3 PICK JPS _PUSH1 JPS __PICK ; 3 PICK PLS JPA PUSH HTDROP: DB ^5 "2DRO" ^'P' ; ***** 2DROP DW HTOVER TDROP: DW TDROP0 TDROP0: LDI 4 ADW SP JPA NEXT HTSWAP: DB ^5 "2SWA" ^'P' ; ***** 2SWAP DW HTDROP TSWAP: DW TSWAP0 TSWAP0: LDI 3 PHS JPS __ROLL ; 3 ROLL JPS __ROLL ; 3 ROLL PLS JPA NEXT HTDUP: DB ^4 "2DU" ^'P' ; ***** 2DUP DW HTSWAP TDUP: DW TDUP0 TDUP0: JPS _POP2 ; OVER JPS _GET1 ; : JPS _PUSH2 ; : JPS _PUSH1 ; : JPS _POP2 ; OVER JPS _GET1 ; : JPS _PUSH2 ; : JPA PUSH ; : HPSTOR: DB ^2 "+" ^'!' ; ***** +! DW HTDUP PSTOR: DW PSTOR0 PSTOR0: JPS _PSTOR JPA NEXT ; _PSTOR: JPS _POP3 ; R3 = addr JPS _POP2 ; R2 = incr _PSTO3: JPS _LD16 ; R1 = (R3) JPS _ADD16 ; R1 = R1 + R2 JPS _ST16 ; (R3) = R1 RTS ; Done HTOGGL: DB ^6 "TOGGL" ^'E' ; ***** TOGGLE DW HPSTOR TOGGL: DW TOGGL0 TOGGL0: JPS _POP2 ; R2 = bit mask JPS _GET3 ; R3 = addr (leave copy on stack) LDR R3 ; Get the byte STA R1.0 ; : JPS _XOR8 ; R1.0 = R1.0 ^ R2.0 JPS _POP3 ; R3 = addr LDA R1.0 ; Update the byte STR R3 ; : JPA NEXT ; Done HTBANK: DB ^5 ">BAN" ^'K' ; >BANK DW HTOGGL TBANK: DW TBANK0 TBANK0: JPS _POP1 ; Get bank number from data stack into R1 LDA R1.0 ; Get LSB STA _BANK ; Store for future reference BNK ; Do the actual bank switch JPA NEXT ; Done HAT: DB ^1 ^'@' ; ***** @ DW HTBANK AT: DW AT0 AT0: JPS _AT JPA NEXT ; _AT: JPS _POP3 ; R3 = addr JPS _LD16 ; R1 = (R3) JPS _PUSH1 ; -(SP) = R1 RTS HCAT: DB ^2 "C" ^'@' ; ***** C@ DW HAT CAT: DW CAT0 CAT0: CLW R1 ; R1 = 0 JPS _POP3 ; R3 = addr LDR R3 ; A = (R3) STA R1.0 ; R1 = A JPA PUSH ; -(SP) = R1; NEXT HSTORE: DB ^1 ^'!' ; ***** ! DW HCAT STORE: DW STORE0 STORE0: JPS _STORE JPA NEXT ; _STORE: JPS _POP3 ; R3 = addr JPS _POP1 ; R1 = data JPS _ST16 ; (R3) = R1 RTS ; Done HCSTOR: DB ^2 "C" ^'!' ; ***** C! DW HSTORE CSTOR: DW CSTOR0 CSTOR0: JPS _POP21 ; R2 = addr, R1 = data LDA R1.0 ; A = R1.0 STR R2 ; (R3) = A JPA NEXT ; Done
test/Succeed/ProjectionLike1963.agda
cruhland/agda
1,989
12627
-- Andreas, 2016-06-09 issue during refactoring for #1963 -- Shrunk this issue with projection-like functions from std-lib -- {-# OPTIONS --show-implicit #-} -- {-# OPTIONS -v tc.proj.like:10 #-} open import Common.Level open import Common.Nat renaming ( Nat to ℕ ) data ⊥ : Set where record ⊤ : Set where constructor tt postulate anything : ∀{A : Set} → A data _≤_ : (m n : ℕ) → Set where z≤n : ∀ {n} → zero ≤ n s≤s : ∀ {m n} (m≤n : m ≤ n) → suc m ≤ suc n ≤-refl : ∀{n} → n ≤ n ≤-refl {zero} = z≤n ≤-refl {suc n} = s≤s ≤-refl ≤-trans : ∀{k l m} → k ≤ l → l ≤ m → k ≤ m ≤-trans z≤n q = z≤n ≤-trans (s≤s p) (s≤s q) = s≤s (≤-trans p q) n≤m+n : ∀ m n → n ≤ (m + n) n≤m+n zero zero = z≤n n≤m+n zero (suc n) = s≤s (n≤m+n zero n) n≤m+n (suc m) zero = z≤n n≤m+n (suc m) (suc n) = s≤s anything record Preord c ℓ₁ : Set (lsuc (c ⊔ ℓ₁)) where infix 4 _∼_ field Carrier : Set c _∼_ : (x y : Carrier) → Set ℓ₁ -- The relation. refl : ∀{x} → x ∼ x trans : ∀{x y z} → x ∼ y → y ∼ z → x ∼ z Npreord : Preord _ _ Npreord = record { Carrier = ℕ ; _∼_ = _≤_ ; refl = ≤-refl; trans = ≤-trans } module Pre {p₁ p₂} (P : Preord p₁ p₂) where open Preord P infix 4 _IsRelatedTo_ infix 3 _∎ infixr 2 _≤⟨_⟩_ infix 1 begin_ data _IsRelatedTo_ (x y : Carrier) : Set p₂ where relTo : (x≤y : x ∼ y) → x IsRelatedTo y begin_ : ∀ {x y} → x IsRelatedTo y → x ∼ y begin relTo x≤y = x≤y _≤⟨_⟩_ : ∀ x {y z} → x ∼ y → y IsRelatedTo z → x IsRelatedTo z _ ≤⟨ x≤y ⟩ relTo y≤z = relTo (trans x≤y y≤z) _∎ : ∀ x → x IsRelatedTo x _∎ _ = relTo refl -- begin_ : {p₁ p₂ : Level} (P : Preord p₁ p₂) -- {x y : Preord.Carrier P} → -- x IsRelatedTo y → (P Preord.∼ x) y -- is projection like in argument 5 for type ProjectionLike1963.Pre._IsRelatedTo_ -- _∎ : {p₁ p₂ : Level} (P : Preord p₁ p₂) (x : Preord.Carrier P) → -- x IsRelatedTo x -- is projection like in argument 2 for type ProjectionLike1963.Preord open Pre Npreord _+-mono_ : ∀{m₁ m₂ n₁ n₂} → m₁ ≤ m₂ → n₁ ≤ n₂ → (m₁ + n₁) ≤ (m₂ + n₂) _+-mono_ {zero} {m₂} {n₁} {n₂} z≤n n₁≤n₂ = begin n₁ ≤⟨ n₁≤n₂ ⟩ n₂ ≤⟨ n≤m+n m₂ n₂ ⟩ m₂ + n₂ ∎ s≤s m₁≤m₂ +-mono n₁≤n₂ = s≤s (m₁≤m₂ +-mono n₁≤n₂) ISS : ∀ {n m} (p : n ≤ m) → Set ISS z≤n = ⊥ ISS (s≤s p) = ⊤ test : ISS ((z≤n {0}) +-mono (s≤s (z≤n {0}))) test = tt -- Goal display: -- C-u C-c C-, ISS (z≤n +-mono s≤s z≤n) -- C-c C-, ISS (begin 1 ≤⟨ s≤s z≤n ⟩ 1 ≤⟨ s≤s z≤n ⟩ 1 ∎) -- C-u C-u C-c C-, ISS (λ {y} → Pre.begin _)
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1928.asm
ljhsiun2/medusa
9
90358
<filename>Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1928.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x14119, %rbx dec %r13 movups (%rbx), %xmm2 vpextrq $1, %xmm2, %rsi nop add $49174, %rsi lea addresses_A_ht+0xb52d, %r11 nop nop mfence movl $0x61626364, (%r11) nop nop nop xor %r11, %r11 lea addresses_A_ht+0x10b59, %r13 nop nop nop nop cmp %rcx, %rcx movb $0x61, (%r13) nop nop nop nop inc %rdi lea addresses_WC_ht+0x12bf9, %rcx nop xor $58482, %rbx movl $0x61626364, (%rcx) nop nop nop nop and %rbx, %rbx lea addresses_UC_ht+0x14059, %rbx clflush (%rbx) nop nop nop nop inc %r12 movups (%rbx), %xmm2 vpextrq $1, %xmm2, %rsi nop nop nop nop add $58569, %r13 lea addresses_A_ht+0x14119, %rdi nop cmp %r13, %r13 vmovups (%rdi), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rbx inc %rdi lea addresses_WT_ht+0x1d19, %r12 nop nop nop nop nop xor %r13, %r13 movw $0x6162, (%r12) nop nop nop cmp $53553, %rdi lea addresses_A_ht+0x1ef79, %rsi lea addresses_WC_ht+0xf339, %rdi nop nop cmp %rdx, %rdx mov $107, %rcx rep movsl nop nop nop nop nop inc %rsi lea addresses_D_ht+0x19919, %rsi lea addresses_UC_ht+0x139a9, %rdi nop nop nop nop inc %r11 mov $117, %rcx rep movsq inc %rcx lea addresses_WT_ht+0xf719, %r11 nop dec %r13 movb $0x61, (%r11) nop cmp %r12, %r12 lea addresses_D_ht+0x18f19, %rsi lea addresses_WT_ht+0x3519, %rdi sub %r13, %r13 mov $75, %rcx rep movsw nop nop nop and $9553, %r13 lea addresses_WT_ht+0x16319, %rsi nop nop add $35262, %rbx mov (%rsi), %rdx nop sub %rbx, %rbx lea addresses_normal_ht+0x18519, %rsi lea addresses_WT_ht+0x119d9, %rdi nop nop nop nop nop cmp %r13, %r13 mov $40, %rcx rep movsl and %r11, %r11 lea addresses_A_ht+0x5919, %rsi lea addresses_WC_ht+0xbb3f, %rdi nop nop add $57103, %r13 mov $7, %rcx rep movsl xor $17246, %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r15 push %rax push %rbx push %rcx push %rdi // Store lea addresses_normal+0x1fc19, %r10 xor $8727, %rbx mov $0x5152535455565758, %r15 movq %r15, (%r10) nop nop nop sub $24767, %rbx // Store mov $0x119, %rdi nop nop and $1026, %rax movw $0x5152, (%rdi) nop nop nop nop nop inc %r15 // Load mov $0x6ed, %r10 nop nop and $36059, %r14 movups (%r10), %xmm4 vpextrq $1, %xmm4, %rdi and $55108, %rcx // Faulty Load lea addresses_PSE+0x14519, %r10 nop nop cmp %rax, %rax mov (%r10), %edi lea oracles, %rbx and $0xff, %rdi shlq $12, %rdi mov (%rbx,%rdi,1), %rdi pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'same': True, 'size': 32, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
test/interaction/Issue5695.agda
KDr2/agda
1,989
12541
<filename>test/interaction/Issue5695.agda open import Agda.Builtin.Bool open import Agda.Builtin.List open import Agda.Builtin.Nat open import Agda.Builtin.Unit open import Agda.Builtin.Reflection macro printType : Term → TC ⊤ printType hole = bindTC (inferType hole) λ t → typeError (termErr t ∷ []) test1 : (a : Nat) → Nat test1 = {! printType !} test2 : (a : Bool) → Bool test2 = {! printType !}
Assembly/Project/Memory.asm
Myself086/Project-Nested
338
82880
// 0 2 // Heapstack format: _FirstByte, _LastByte // --------------------------------------------------------------------------- .mx 0x00 .func Memory__TryAlloc // Entry: A = Bank number, X = Length // Return: A = Bank number (positive), X = Memory address, Y = HeapStack pointer // Return2: A = Negative, X = Length Memory__TryAlloc: phb .local _length .local _bank, _addr stx $.length // Which bank? Only allowing 0x7e-0x7f or cart banks. and #0x00ff sta $.bank eor #0x007e lsr a bne $+b_cart b_loop: // Can we allocate enough memory in this bank? lda $.bank ldx $.length call Memory__CanAlloc bcs $+b_1 // Can we allocate enough memory in the other bank? lda $.bank eor #0x0001 sta $.bank ldx $.length call Memory__CanAlloc bcs $+b_1 // WRAM banks are full bra $+b_oom b_1: // Change bank and set carry sep #0x21 lda $.bank pha rep #0x20 plb // Push new memory block to HeapStack, assume carry set from sep lda $_Memory_HeapStack sbc #4 tay sta $_Memory_HeapStack // Add memory to the top of the heap lda $_Memory_Top sta $.addr clc adc $.length sta $_Memory_Top // Write address range to HeapStack dec a sta $0x0002,y ldx $.addr txa sta $0x0000,y // Return lda $.bank plb return .unlocal _bank, _addr b_oom: // Out Of Memory, not Out Of Mana lda #0xffff ldx $.length plb return b_cart: // Cart range (ROM or SRAM) ldx $_Memory__CartBanks beq $-b_oom .local _bankCount, =listP lda $=Memory__CartBanks_CONSTBANK-1,x and #0x00ff beq $-b_oom sta $.bankCount ldy #_Memory__CartBanks_CONSTBANK/0x100 sty $.listP+1 stx $.listP b_loop: // Can we allocte enough memory in this bank? lda [$.listP] and #0x00ff ldx $.length call Memory__CanAllocCart bcs $+b_1 inc $.listP dec $.bankCount bne $-b_loop bra $-b_oom b_1: // Change bank and clear carry sep #0x30 lda [$.listP] tay pha rep #0x31 plb // Add memory to the top of the heap lda $_Memory_Top-0x8000 tax adc $.length sta $_Memory_Top-0x8000 // Return tya plb return // --------------------------------------------------------------------------- .mx 0x00 .func Memory__AllocInBank // Entry: A = Bank number, X = Length // Return: A = Bank number, X = Memory address, Y = HeapStack pointer // Note: Unlike Memory__Alloc, this one will throw an error if the bank is full Memory__AllocInBank: // Keep current bank number .local _bank, _length sta $.bank stx $.length call Memory__Alloc // Trap if bank is different cmp $.bank bne $+b_trap return b_trap: ldx $.length unlock trap Exception "Out Of Bank Memory{}{}{}Memory.AllocInBank attempted to allocate 0x{X:X} bytes of memory in bank 0x{a:X} but it was full.{}{}This error should not be happening under normal circumstances." // --------------------------------------------------------------------------- .mx 0x00 .func Memory__Alloc // Entry: A = Bank number, X = Length // Return: A = Bank number, X = Memory address, Y = HeapStack pointer Memory__Alloc: call Memory__TryAlloc ora #0 bmi $+b_trap return b_trap: unlock trap Exception "Out of Memory{}{}{}Memory.Alloc attempted to allocate 0x{X:X} bytes but RAM is full.{}{}Try following step 5 on the exe's main window. This will reduce memory usage and improve performance." // --------------------------------------------------------------------------- .mx 0x00 // Entry: int length // Return: int address Memory__AllocForExe: .vstack _VSTACK_START pea $0x0000 plp plb lda #_VSTACK_PAGE tcd lda #0x00ff ldx $0x0000 call Memory__Alloc stx $0x0000 sta $0x0002 stp // --------------------------------------------------------------------------- .mx 0x00 .func Memory__Trim =StackPointer, _Length Memory__Trim: phb // Change bank and set carry for later sep #0x21 lda $.StackPointer+2 pha rep #0x20 plb // Get current length ldy #0x0002 lda ($.StackPointer),y sbc ($.StackPointer) inc a // Are we allowed to trim this memory range? cmp $.Length bcc $+b_trap // Is this memory range on top of the heap? lda ($.StackPointer),y inc a cmp $_Memory_Top bne $+Memory__Trim_SkipTrimTop // Trim top of the heap as well lda ($.StackPointer) clc adc $.Length sta $_Memory_Top // Is the new size 0? lda $.Length bne $+Memory__Trim_SkipDelete // Is this memory range at the top of the stack? lda $_Memory_HeapStack cmp $.StackPointer bne $+Memory__Trim_SkipDelete // Remove from stack and return clc adc #4 sta $_Memory_HeapStack plb return Memory__Trim_SkipDelete: Memory__Trim_SkipTrimTop: // Write new size lda ($.StackPointer) clc adc $.Length dec a sta ($.StackPointer),y plb return b_trap: ldx $.Length unlock trap Exception "Memory Trim Failed{}{}{}Memory.Trim attempted to allocate more bytes than its original size.{}0x{X:X} -> 0x{A:X}" // --------------------------------------------------------------------------- .mx 0x00 .func Memory__CanAlloc // Entry: A = Bank number, X = Length // Return: Carry = true when memory can be allocated Memory__CanAlloc: phb // Change bank and set carry for later sep #0x21 pha rep #0x20 plb .local _temp stx $.temp // Get total space between Top and HeapStack, -0x10 for stack allocation lda $_Memory_HeapStack sbc $_Memory_Top sbc #0x0010 // Do we have enough space? Return carry==true if so cmp $.temp plb return // --------------------------------------------------------------------------- .mx 0x00 .func Memory__CanAllocCart // Entry: A = Bank number, X = Length // Return: Carry = true when memory can be allocated Memory__CanAllocCart: phb // Change bank and set carry for later sep #0x21 pha rep #0x20 plb .local _temp stx $.temp // Get total space between Top and HeapStack, -0x10 for stack allocation lda $_Memory_HeapStack-0x8000 sbc $_Memory_Top-0x8000 sbc #0x0010 // Do we have enough space? Return carry==true if so cmp $.temp plb return // --------------------------------------------------------------------------- .mx 0x00 .func Memory__Zero // Entry (same as Memory__Alloc's return): A = Bank number, X = Memory address, Y = HeapStack pointer Memory__Zero: phb // Change bank and set carry for later sep #0x21 pha rep #0x20 plb // Do we have the correct address? txa cmp $0x0000,y bne $+b_trap // Get array length .local _length lda $0x0002,y sbc $0x0000,y inc a sta $.length // Do we have less than 2 bytes? lsr a bne $+b_over1byte // Do we even have a byte? bcc $+b_return // Clear single byte and return lda #0xff00 and $0x0000,x sta $0x0000,x bra $+b_return b_over1byte: // Do we have an odd number of bytes? bcc $+b_notOdd // Clear first byte stz $0x0000,x inx b_notOdd: // Store number of iterations into Y and start looping tay b_loop: // Clear 2 bytes stz $0x0000,x // Next inx inx dey bne $-b_loop b_return: plb return b_trap: unlock trap Exception "Zero Memory Failed{}{}{}Memory.Zero attempted to clear the wrong array." // --------------------------------------------------------------------------- .mx 0x00 .func Memory__FormatSram Memory__FormatSram: php rep #0x30 .mx 0x00 // Is SRAM present at bank b1? lda $0xb07ffe // First test for mirror tay lda $0xb17ffe tax eor #0x55aa sta $0xb17ffe // Change last bytes of bank b1 cmp $0xb17ffe beq $+b_1 unlock trap Exception "SRAM is missing{}{}{}SRAM on your SNES emulator or flash cart device was not found. Make sure your SNES emulator or device is up to date.{}{}You can adjust the amount of SRAM on the exe's main window. Some SRAM sizes are not supported by some SNES emulators or devices." b_1: // Test for minimum SRAM requirement for feedback: 16kb tya eor $0xb07ffe // Second test for mirror smx #0x20 beq $+b_else // Deactivate SRM feedback lda #0 bra $+b_1 b_else: // Activate SRM feedback lda #0x80 b_1: sta $_Feedback_Active smx #0x00 // Test SRAM size .local _bankCount lda #2 sta $.bankCount // Write unique value to test banks, both bytes must be different to account for open bus lda #8 sta $0xa17ffe dec a sta $0xb97ffe dec a sta $0xb57ffe dec a sta $0xb37ffe dec a sta $0xb17ffe // Look for valid banks inc a cmp $0xb37ffe bne $+b_1 asl $.bankCount inc a cmp $0xb57ffe bne $+b_1 asl $.bankCount inc a cmp $0xb97ffe bne $+b_1 asl $.bankCount inc a cmp $0xa17ffe bne $+b_1 asl $.bankCount b_1: // Restore last bytes of bank b1 txa sta $0xb17ffe // Allocate some memory for a list of banks ldx $.bankCount dex cpx #2 bcs $+b_1 ldx #1 b_1: lda #_Memory__CartBanks_CONSTBANK/0x10000 call Memory__AllocInBank // Return: A = Bank number, X = Memory address, Y = HeapStack pointer .local =list xba sta $.list+1 stx $.list inx stx $_Memory__CartBanks // Write length lda $.bankCount dec a dec a smx #0x20 sta [$.list] // Copy expected valid bank numbers inc16dp list tax dex bmi $+b_1 b_loop: lda $=Memory__FormatSram_BankOrder,x txy sta [$.list],y dex bpl $-b_loop b_1: smx #0x00 // Format SRAM ldx $.bankCount dex dex dex bmi $+b_1 b_loop: // Change bank lda $=Memory__FormatSram_BankOrder,x sta $.DP_ZeroBank // Write bottom and top addresses lda #0x6000 ldy #_Memory_Bottom-0x8000 sta [$.DP_Zero],y ldy #_Memory_Top-0x8000 sta [$.DP_Zero],y lda #_Memory_HeapStack-0x8000-4 ldy #_Memory_HeapStack-0x8000 sta [$.DP_Zero],y // Next dex bpl $-b_loop b_1: // Calculate SRAM size in kilobytes lda $.bankCount cmp #3 bcs $+b_else // Between 0 and 8 kilobytes lda $=Rom_SramSize and #0x00ff cmp #5 bcc $+b_else2 // Size 5 or greater but assume 8 or 16 kilobytes lda #16 // Is feedback active? bit $_Feedback_Active-1 bmi $+b_3 lsr a b_3: tay bra $+b_1 b_else2: // Size 0 to 3 tax lda $=Memory__FormatSram_SizeKb,x and #0x00ff tay bra $+b_1 b_else: // 16+ kilobytes asl a asl a asl a ldy #16 b_1: sta $_Sram_SizeTotalKb sty $_Sram_SizeNonDynamicKb plp return Memory__FormatSram_BankOrder: .data8 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf .data8 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf Memory__FormatSram_SizeKb: .data8 0, 2, 4, 8, 16 // --------------------------------------------------------------------------- .mx 0x00 .func Memory__FormatRom Memory__FormatRom: .local _thisBank, _lastBank, _bankCount lda $=RomInfo_StaticRecBanks ora #0x4040 smx #0x20 sta $.thisBank stz $.thisBank+1 xba sta $.lastBank stz $.lastBank+1 smx #0x00 stz $.bankCount // Allocate memory for our bank list ldx #0x0090 lda #_Memory__CartBanks_CONSTBANK/0x10000 call Memory__AllocInBank // Return: A = Bank number, X = Memory address, Y = HeapStack pointer .local =list xba sta $.list+1 inx stx $.list stx $_Memory__CartBanks stz $.DP_Zero b_loop: // Set bank and add it to list lda $.thisBank sta $.DP_ZeroBank ldy $.bankCount sta [$.list],y iny sty $.bankCount // Write bottom and top addresses lda #0x0000 ldy #_Memory_Bottom-0x8000 sta [$.DP_Zero],y ldy #_Memory_Top-0x8000 sta [$.DP_Zero],y lda #_Memory_HeapStack-0x8000-4 ldy #_Memory_HeapStack-0x8000 sta [$.DP_Zero],y b_loop_next: // Are we done? lda $.thisBank cmp $.lastBank beq $+b_loop_exit // Next bank inc a ora #0x0040 sta $.thisBank eor #0x007e lsr a beq $-b_loop_next // Skip banks 0x7e and 0x7f bra $-b_loop b_loop_exit: // Set number of banks dec $.list smx #0x20 lda $.bankCount sta [$.list] // Activate SRM feedback (not necessary here but just in case this becomes an issue) lda #0x80 sta $_Feedback_Active smx #0x00 return // ---------------------------------------------------------------------------
libsrc/_DEVELOPMENT/target/sms/driver/terminal/sms_01_output_terminal_tty_z88dk/sms_01_output_terminal_tty_z88dk_01_scroll.asm
jpoikela/z88dk
640
163914
<reponame>jpoikela/z88dk SECTION code_driver SECTION code_driver_terminal_output PUBLIC sms_01_output_terminal_tty_z88dk_01_scroll EXTERN console_01_output_char_proc_putchar_scroll_adjust sms_01_output_terminal_tty_z88dk_01_scroll: ; scroll window upward one row ld a,1 jp console_01_output_char_proc_putchar_scroll_adjust
programs/oeis/279/A279318.asm
jmorken/loda
1
178660
; A279318: Permutation of the nonnegative integers [6k+3, 6k+2, 6k+1, 6k, 6k+5, 6k+4]. ; 3,2,1,0,5,4,9,8,7,6,11,10,15,14,13,12,17,16,21,20,19,18,23,22,27,26,25,24,29,28,33,32,31,30,35,34,39,38,37,36,41,40,45,44,43,42,47,46,51,50,49,48,53,52,57,56,55,54,59,58,63,62,61,60,65,64,69 mov $2,$0 gcd $0,2 mov $3,$0 trn $0,2 add $3,$2 sub $2,2 lpb $3 add $0,6 mov $1,$0 sub $3,3 lpe sub $1,$2 sub $1,5
oeis/074/A074741.asm
neoneye/loda-programs
11
19609
<reponame>neoneye/loda-programs ; A074741: Sum of squares of gaps between consecutive primes. ; Submitted by <NAME> ; 1,5,9,25,29,45,49,65,101,105,141,157,161,177,213,249,253,289,305,309,345,361,397,461,477,481,497,501,517,713,729,765,769,869,873,909,945,961,997,1033,1037,1137,1141,1157,1161,1305,1449,1465,1469,1485,1521,1525,1625,1661,1697,1733,1737,1773,1789,1793,1893,2089,2105,2109,2125,2321,2357,2457,2461,2477,2513,2577,2613,2649,2665,2701,2765,2781,2845,2945,2949,3049,3053,3089,3105,3141,3205,3221,3225,3241,3385,3449,3465,3529,3545,3581,3725,3729,4053,4089 mov $2,$0 add $2,1 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 add $0,1 seq $0,40 ; The prime numbers. div $0,2 mul $0,2 sub $0,1 seq $0,64722 ; a(1) = 0; for n >= 2, a(n) = n - (largest prime <= n). add $0,1 pow $0,2 add $3,$0 lpe mov $0,$3
waterbackground/_includes/subroutines/gradientFade.asm
ArcadeTV/megadrive-samples
5
19195
<filename>waterbackground/_includes/subroutines/gradientFade.asm gradientFade: movem.l d0-a6,-(sp) WaitVBlank move.w #$2700,sr ; Interrupts off ; set gradient to initial position: move.w #($FFFF-192),(ram_plane_a_scroll_x).l SetVRAMWrite vram_addr_hscroll move.w #($FFFF-192),vdp_data ; replace Plane A map (logos) with gradient map: SetVRAMWrite vram_addr_plane_a lea (Tilemap_Gradient),a0 ; Move the address of the first map entry into a0 move.l #(64*32)-1,d0 ; Loop counter (-1 for DBRA loop) gradientFade_writeTileMap_Loop: ; Start of loop move.w (a0)+,d1 ; Write tile line (4 bytes per line), and post-increment address or.w #$6000,d1 ; Set Palette Index to 3 (0000:0, 2000:1, 4000:2, 6000:3) addi.w #(tile_count_menu-21),d1 ; set beginning of gradient tiledata move.w d1,vdp_data dbra d0,gradientFade_writeTileMap_Loop ; Decrement d0 and loop until finished (when d0 reaches -1) move.w #(64-1),(RAM_GRADIENT_BLANK).l ; set next column index to be blanked move.w #$2300,sr ; Interrupts on WaitVBlank movem.l (sp)+,d0-a6 rts
bin/gcc/config/arm/lib1funcs.asm
aaliomer/exos
1
177486
<filename>bin/gcc/config/arm/lib1funcs.asm @ libgcc1 routines for ARM cpu. @ Division and remainder, from Appendix E of the Sparc Version 8 @ Architecture Manual, with fixes from <NAME>. @ Rewritten for the ARM by <NAME> (<EMAIL>) /* Copyright (C) 1995 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. In addition to the permissions in the GNU General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file with other programs, and to distribute those programs without any restriction coming from the use of this file. (The General Public License restrictions do apply in other respects; for example, they cover modification of the file, and distribution when not linked into another program.) This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, if you link this library with other files, some of which are compiled with GCC, to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* * Input: dividend and divisor in r0 and r1 respectively. * * m4 parameters: * NAME name of function to generate * OP OP=div => r0 / r1; OP=mod => r0 % r1 * S S=true => signed; S=false => unsigned * * Algorithm parameters: * N how many bits per iteration we try to get (4) * WORDSIZE total number of bits (32) * * Derived constants: * TOPBITS number of bits in the top `decade' of a number * * Important variables: * Q the partial quotient under development (initially 0) * R the remainder so far, initially the dividend * ITER number of main division loop iterations required; * equal to ceil(log2(quotient) / N). Note that this * is the log base (2^N) of the quotient. * V the current comparand, initially divisor*2^(ITER*N-1) * * Cost: * Current estimate for non-large dividend is * ceil(log2(quotient) / N) * (10 + 7N/2) + C * A large dividend is one greater than 2^(31-TOPBITS) and takes a * different path, as the upper bits of the quotient must be developed * one bit at a time. */ /* define(N, `4')dnl define(WORDSIZE, `32')dnl define(TOPBITS, eval(WORDSIZE - N*((WORDSIZE-1)/N)))dnl dnl define(dividend, `r0')dnl define(divisor, `r1')dnl define(Q, `r2')dnl define(R, `r3')dnl define(ITER, `ip')dnl define(V, `lr')dnl dnl dnl m4 reminder: ifelse(a,b,c,d) => if a is b, then c, else d define(T, `r4')dnl define(SC, `r5')dnl ifelse(S, `true', `define(SIGN, `r6')')dnl define(REGLIST, `ifelse(S, `true', `{r4, r5, r6,', `{r4, r5,')')dnl define(ret, `ldmia sp!, REGLIST pc}')dnl dnl dnl This is the recursive definition for developing quotient digits. dnl dnl Parameters: dnl $1 the current depth, 1 <= $1 <= N dnl $2 the current accumulation of quotient bits dnl N max depth dnl dnl We add a new bit to $2 and either recurse or insert the bits in dnl the quotient. R, Q, and V are inputs and outputs as defined above; dnl the condition codes are expected to reflect the input R, and are dnl modified to reflect the output R. dnl define(DEVELOP_QUOTIENT_BITS, ` @ depth $1, accumulated bits $2 mov V, V, lsr #1 blt L.$1.eval(2^N+$2+999) @ remainder is positive subs R, R, V ifelse($1, N, ` ifelse(eval(2*$2+1<0), `0', `add Q, Q, `#'eval($2*2+1)', `sub Q, Q, `#'eval(-($2*2+1))') b 9f ', ` DEVELOP_QUOTIENT_BITS(incr($1), `eval(2*$2+1)')') L.$1.eval(2^N+$2+999): @ remainder is negative adds R, R, V ifelse($1, N, ` ifelse(eval(2*$2-1<0), `0', `add Q, Q, `#'eval($2*2-1)', `sub Q, Q, `#'eval(-($2*2-1))') b 9f ', ` DEVELOP_QUOTIENT_BITS(incr($1), `eval(2*$2-1)')') ifelse($1, 1, `9:')')dnl #include "trap.h" ip .req r12 sp .req r13 lr .req r14 pc .req r15 .text .globl NAME .align 0 NAME: stmdb sp!, REGLIST lr} ifelse(S, `true', ` @ compute sign of result; if neither is negative, no problem ifelse(OP, `div', `eor SIGN, divisor, dividend @ compute sign', `mov SIGN, dividend') cmp divisor, #0 rsbmi divisor, divisor, #0 beq Ldiv_zero mov V, divisor movs R, dividend rsbmi R, R, #0 @ make dividend nonnegative ', ` @ Ready to divide. Compute size of quotient; scale comparand. movs V, divisor mov R, dividend beq Ldiv_zero ') cmp R, V @ if divisor exceeds dividend, done mov Q, #0 bcc Lgot_result @ (and algorithm fails otherwise) mov T, `#'(1 << (WORDSIZE - TOPBITS - 1)) cmp R, T mov ITER, #0 bcc Lnot_really_big @ `Here the dividend is >= 2^(31-N) or so. We must be careful here, @ as our usual N-at-a-shot divide step will cause overflow and havoc. @ The number of bits in the result here is N*ITER+SC, where SC <= N. @ Compute ITER in an unorthodox manner: know we need to shift V into @ the top decade: so do not even bother to compare to R.' mov SC, #1 1: cmp V, T bcs 3f mov V, V, lsl `#'N add ITER, ITER, #1 b 1b @ Now compute SC. 2: adds V, V, V add SC, SC, #1 bcc Lnot_too_big @ We get here if the divisor overflowed while shifting. @ This means that R has the high-order bit set. @ Restore V and subtract from R. mov T, T, lsl `#'TOPBITS mov V, V, lsr #1 add V, T, V sub SC, SC, #1 b Ldo_single_div Lnot_too_big: 3: cmp V, R bcc 2b @ beq Ldo_single_div /-* NB: these are commented out in the V8-Sparc manual as well *-/ /-* (I do not understand this) *-/ @ V > R: went too far: back up 1 step @ srl V, 1, V @ dec SC @ do single-bit divide steps @ @ We have to be careful here. We know that R >= V, so we can do the @ first divide step without thinking. BUT, the others are conditional, @ and are only done if R >= 0. Because both R and V may have the high- @ order bit set in the first step, just falling into the regular @ division loop will mess up the first time around. @ So we unroll slightly... Ldo_single_div: subs SC, SC, #1 blt Lend_regular_divide sub R, R, V mov Q, #1 b Lend_single_divloop Lsingle_divloop: cmp R, #0 mov Q, Q, lsl #1 mov V, V, lsr #1 @ R >= 0 subpl R, R, V addpl Q, Q, #1 @ R < 0 addmi R, R, V submi Q, Q, #1 Lend_single_divloop: subs SC, SC, #1 bge Lsingle_divloop b Lend_regular_divide 1: add ITER, ITER, #1 Lnot_really_big: mov V, V, lsl `#'N cmp V, R bls 1b @ @ HOW CAN ITER EVER BE -1 HERE ????? @ cmn ITER, #1 beq Lgot_result Ldivloop: cmp R, #0 @ set up for initial iteration mov Q, Q, lsl `#'N DEVELOP_QUOTIENT_BITS(1, 0) Lend_regular_divide: subs ITER, ITER, #1 bge Ldivloop cmp R, #0 @ non-restoring fixup here (one instruction only!) ifelse(OP, `div', ` sublt Q, Q, #1 ', ` addlt R, divisor, R ') Lgot_result: ifelse(S, `true', ` @ check to see if answer should be < 0 cmp SIGN, #0 ifelse(OP, `div', `rsbmi Q, Q, #0', `rsbmi R, R, #0') ') ifelse(OP, `div', `mov r0, Q', `mov r0, R') ret Ldiv_zero: @ Divide by zero trap. If it returns, return 0 (about as @ wrong as possible, but that is what SunOS does...). bl ___div0 mov r0, #0 ret */ #ifdef L_udivsi3 ip .req r12 sp .req r13 lr .req r14 pc .req r15 .text .globl ___udivsi3 .align 0 ___udivsi3: stmdb sp!, {r4, r5, lr} @ Ready to divide. Compute size of quotient; scale comparand. movs lr, r1 mov r3, r0 beq Ldiv_zero cmp r3, lr @ if r1 exceeds r0, done mov r2, #0 bcc Lgot_result @ (and algorithm fails otherwise) mov r4, #(1 << (32 - 4 - 1)) cmp r3, r4 mov ip, #0 bcc Lnot_really_big @ Here the dividend is >= 2^(31-N) or so. We must be careful here, @ as our usual N-at-a-shot divide step will cause overflow and havoc. @ The number of bits in the result here is N*ITER+SC, where SC <= N. @ Compute ITER in an unorthodox manner: know we need to shift V into @ the top decade: so do not even bother to compare to R. mov r5, #1 1: cmp lr, r4 bcs 3f mov lr, lr, lsl #4 add ip, ip, #1 b 1b @ Now compute r5. 2: adds lr, lr, lr add r5, r5, #1 bcc Lnot_too_big @ We get here if the r1 overflowed while shifting. @ This means that r3 has the high-order bit set. @ Restore lr and subtract from r3. mov r4, r4, lsl #4 mov lr, lr, lsr #1 add lr, r4, lr sub r5, r5, #1 b Ldo_single_div Lnot_too_big: 3: cmp lr, r3 bcc 2b @ beq Ldo_single_div /* NB: these are commented out in the V8-Sparc manual as well */ /* (I do not understand this) */ @ lr > r3: went too far: back up 1 step @ srl lr, 1, lr @ dec r5 @ do single-bit divide steps @ @ We have to be careful here. We know that r3 >= lr, so we can do the @ first divide step without thinking. BUT, the others are conditional, @ and are only done if r3 >= 0. Because both r3 and lr may have the high- @ order bit set in the first step, just falling into the regular @ division loop will mess up the first time around. @ So we unroll slightly... Ldo_single_div: subs r5, r5, #1 blt Lend_regular_divide sub r3, r3, lr mov r2, #1 b Lend_single_divloop Lsingle_divloop: cmp r3, #0 mov r2, r2, lsl #1 mov lr, lr, lsr #1 @ r3 >= 0 subpl r3, r3, lr addpl r2, r2, #1 @ r3 < 0 addmi r3, r3, lr submi r2, r2, #1 Lend_single_divloop: subs r5, r5, #1 bge Lsingle_divloop b Lend_regular_divide 1: add ip, ip, #1 Lnot_really_big: mov lr, lr, lsl #4 cmp lr, r3 bls 1b @ @ HOW CAN ip EVER BE -1 HERE ????? @ cmn ip, #1 beq Lgot_result Ldivloop: cmp r3, #0 @ set up for initial iteration mov r2, r2, lsl #4 @ depth 1, accumulated bits 0 mov lr, lr, lsr #1 blt L.1.1015 @ remainder is positive subs r3, r3, lr @ depth 2, accumulated bits 1 mov lr, lr, lsr #1 blt L.2.1016 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits 3 mov lr, lr, lsr #1 blt L.3.1018 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 7 mov lr, lr, lsr #1 blt L.4.1022 @ remainder is positive subs r3, r3, lr add r2, r2, #15 b 9f L.4.1022: @ remainder is negative adds r3, r3, lr add r2, r2, #13 b 9f L.3.1018: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 5 mov lr, lr, lsr #1 blt L.4.1020 @ remainder is positive subs r3, r3, lr add r2, r2, #11 b 9f L.4.1020: @ remainder is negative adds r3, r3, lr add r2, r2, #9 b 9f L.2.1016: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits 1 mov lr, lr, lsr #1 blt L.3.1016 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 3 mov lr, lr, lsr #1 blt L.4.1018 @ remainder is positive subs r3, r3, lr add r2, r2, #7 b 9f L.4.1018: @ remainder is negative adds r3, r3, lr add r2, r2, #5 b 9f L.3.1016: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 1 mov lr, lr, lsr #1 blt L.4.1016 @ remainder is positive subs r3, r3, lr add r2, r2, #3 b 9f L.4.1016: @ remainder is negative adds r3, r3, lr add r2, r2, #1 b 9f L.1.1015: @ remainder is negative adds r3, r3, lr @ depth 2, accumulated bits -1 mov lr, lr, lsr #1 blt L.2.1014 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits -1 mov lr, lr, lsr #1 blt L.3.1014 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -1 mov lr, lr, lsr #1 blt L.4.1014 @ remainder is positive subs r3, r3, lr sub r2, r2, #1 b 9f L.4.1014: @ remainder is negative adds r3, r3, lr sub r2, r2, #3 b 9f L.3.1014: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -3 mov lr, lr, lsr #1 blt L.4.1012 @ remainder is positive subs r3, r3, lr sub r2, r2, #5 b 9f L.4.1012: @ remainder is negative adds r3, r3, lr sub r2, r2, #7 b 9f L.2.1014: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits -3 mov lr, lr, lsr #1 blt L.3.1012 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -5 mov lr, lr, lsr #1 blt L.4.1010 @ remainder is positive subs r3, r3, lr sub r2, r2, #9 b 9f L.4.1010: @ remainder is negative adds r3, r3, lr sub r2, r2, #11 b 9f L.3.1012: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -7 mov lr, lr, lsr #1 blt L.4.1008 @ remainder is positive subs r3, r3, lr sub r2, r2, #13 b 9f L.4.1008: @ remainder is negative adds r3, r3, lr sub r2, r2, #15 b 9f 9: Lend_regular_divide: subs ip, ip, #1 bge Ldivloop cmp r3, #0 @ non-restoring fixup here (one instruction only!) sublt r2, r2, #1 Lgot_result: mov r0, r2 ldmia sp!, {r4, r5, pc} Ldiv_zero: @ Divide by zero trap. If it returns, return 0 (about as @ wrong as possible, but that is what SunOS does...). bl ___div0 mov r0, #0 ldmia sp!, {r4, r5, pc} #endif /* L_udivsi3 */ #ifdef L_divsi3 ip .req r12 sp .req r13 lr .req r14 pc .req r15 .text .globl ___divsi3 .align 0 ___divsi3: stmdb sp!, {r4, r5, r6, lr} @ compute sign of result; if neither is negative, no problem eor r6, r1, r0 @ compute sign cmp r1, #0 rsbmi r1, r1, #0 beq Ldiv_zero mov lr, r1 movs r3, r0 rsbmi r3, r3, #0 @ make dividend nonnegative cmp r3, lr @ if r1 exceeds r0, done mov r2, #0 bcc Lgot_result @ (and algorithm fails otherwise) mov r4, #(1 << (32 - 4 - 1)) cmp r3, r4 mov ip, #0 bcc Lnot_really_big @ Here the dividend is >= 2^(31-N) or so. We must be careful here, @ as our usual N-at-a-shot divide step will cause overflow and havoc. @ The number of bits in the result here is N*ITER+SC, where SC <= N. @ Compute ITER in an unorthodox manner: know we need to shift V into @ the top decade: so do not even bother to compare to R. mov r5, #1 1: cmp lr, r4 bcs 3f mov lr, lr, lsl #4 add ip, ip, #1 b 1b @ Now compute r5. 2: adds lr, lr, lr add r5, r5, #1 bcc Lnot_too_big @ We get here if the r1 overflowed while shifting. @ This means that r3 has the high-order bit set. @ Restore lr and subtract from r3. mov r4, r4, lsl #4 mov lr, lr, lsr #1 add lr, r4, lr sub r5, r5, #1 b Ldo_single_div Lnot_too_big: 3: cmp lr, r3 bcc 2b @ beq Ldo_single_div /* NB: these are commented out in the V8-Sparc manual as well */ /* (I do not understand this) */ @ lr > r3: went too far: back up 1 step @ srl lr, 1, lr @ dec r5 @ do single-bit divide steps @ @ We have to be careful here. We know that r3 >= lr, so we can do the @ first divide step without thinking. BUT, the others are conditional, @ and are only done if r3 >= 0. Because both r3 and lr may have the high- @ order bit set in the first step, just falling into the regular @ division loop will mess up the first time around. @ So we unroll slightly... Ldo_single_div: subs r5, r5, #1 blt Lend_regular_divide sub r3, r3, lr mov r2, #1 b Lend_single_divloop Lsingle_divloop: cmp r3, #0 mov r2, r2, lsl #1 mov lr, lr, lsr #1 @ r3 >= 0 subpl r3, r3, lr addpl r2, r2, #1 @ r3 < 0 addmi r3, r3, lr submi r2, r2, #1 Lend_single_divloop: subs r5, r5, #1 bge Lsingle_divloop b Lend_regular_divide 1: add ip, ip, #1 Lnot_really_big: mov lr, lr, lsl #4 cmp lr, r3 bls 1b @ @ HOW CAN ip EVER BE -1 HERE ????? @ cmn ip, #1 beq Lgot_result Ldivloop: cmp r3, #0 @ set up for initial iteration mov r2, r2, lsl #4 @ depth 1, accumulated bits 0 mov lr, lr, lsr #1 blt L.1.1015 @ remainder is positive subs r3, r3, lr @ depth 2, accumulated bits 1 mov lr, lr, lsr #1 blt L.2.1016 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits 3 mov lr, lr, lsr #1 blt L.3.1018 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 7 mov lr, lr, lsr #1 blt L.4.1022 @ remainder is positive subs r3, r3, lr add r2, r2, #15 b 9f L.4.1022: @ remainder is negative adds r3, r3, lr add r2, r2, #13 b 9f L.3.1018: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 5 mov lr, lr, lsr #1 blt L.4.1020 @ remainder is positive subs r3, r3, lr add r2, r2, #11 b 9f L.4.1020: @ remainder is negative adds r3, r3, lr add r2, r2, #9 b 9f L.2.1016: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits 1 mov lr, lr, lsr #1 blt L.3.1016 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 3 mov lr, lr, lsr #1 blt L.4.1018 @ remainder is positive subs r3, r3, lr add r2, r2, #7 b 9f L.4.1018: @ remainder is negative adds r3, r3, lr add r2, r2, #5 b 9f L.3.1016: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 1 mov lr, lr, lsr #1 blt L.4.1016 @ remainder is positive subs r3, r3, lr add r2, r2, #3 b 9f L.4.1016: @ remainder is negative adds r3, r3, lr add r2, r2, #1 b 9f L.1.1015: @ remainder is negative adds r3, r3, lr @ depth 2, accumulated bits -1 mov lr, lr, lsr #1 blt L.2.1014 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits -1 mov lr, lr, lsr #1 blt L.3.1014 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -1 mov lr, lr, lsr #1 blt L.4.1014 @ remainder is positive subs r3, r3, lr sub r2, r2, #1 b 9f L.4.1014: @ remainder is negative adds r3, r3, lr sub r2, r2, #3 b 9f L.3.1014: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -3 mov lr, lr, lsr #1 blt L.4.1012 @ remainder is positive subs r3, r3, lr sub r2, r2, #5 b 9f L.4.1012: @ remainder is negative adds r3, r3, lr sub r2, r2, #7 b 9f L.2.1014: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits -3 mov lr, lr, lsr #1 blt L.3.1012 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -5 mov lr, lr, lsr #1 blt L.4.1010 @ remainder is positive subs r3, r3, lr sub r2, r2, #9 b 9f L.4.1010: @ remainder is negative adds r3, r3, lr sub r2, r2, #11 b 9f L.3.1012: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -7 mov lr, lr, lsr #1 blt L.4.1008 @ remainder is positive subs r3, r3, lr sub r2, r2, #13 b 9f L.4.1008: @ remainder is negative adds r3, r3, lr sub r2, r2, #15 b 9f 9: Lend_regular_divide: subs ip, ip, #1 bge Ldivloop cmp r3, #0 @ non-restoring fixup here (one instruction only!) sublt r2, r2, #1 Lgot_result: @ check to see if answer should be < 0 cmp r6, #0 rsbmi r2, r2, #0 mov r0, r2 ldmia sp!, {r4, r5, r6, pc} Ldiv_zero: @ Divide by zero trap. If it returns, return 0 (about as @ wrong as possible, but that is what SunOS does...). bl ___div0 mov r0, #0 ldmia sp!, {r4, r5, r6, pc} #endif /* L_divsi3 */ #ifdef L_umodsi3 ip .req r12 sp .req r13 lr .req r14 pc .req r15 .text .globl ___umodsi3 .align 0 ___umodsi3: stmdb sp!, {r4, r5, lr} @ Ready to divide. Compute size of quotient; scale comparand. movs lr, r1 mov r3, r0 beq Ldiv_zero cmp r3, lr @ if r1 exceeds r0, done mov r2, #0 bcc Lgot_result @ (and algorithm fails otherwise) mov r4, #(1 << (32 - 4 - 1)) cmp r3, r4 mov ip, #0 bcc Lnot_really_big @ Here the dividend is >= 2^(31-N) or so. We must be careful here, @ as our usual N-at-a-shot divide step will cause overflow and havoc. @ The number of bits in the result here is N*ITER+SC, where SC <= N. @ Compute ITER in an unorthodox manner: know we need to shift V into @ the top decade: so do not even bother to compare to R. mov r5, #1 1: cmp lr, r4 bcs 3f mov lr, lr, lsl #4 add ip, ip, #1 b 1b @ Now compute r5. 2: adds lr, lr, lr add r5, r5, #1 bcc Lnot_too_big @ We get here if the r1 overflowed while shifting. @ This means that r3 has the high-order bit set. @ Restore lr and subtract from r3. mov r4, r4, lsl #4 mov lr, lr, lsr #1 add lr, r4, lr sub r5, r5, #1 b Ldo_single_div Lnot_too_big: 3: cmp lr, r3 bcc 2b @ beq Ldo_single_div /* NB: these are commented out in the V8-Sparc manual as well */ /* (I do not understand this) */ @ lr > r3: went too far: back up 1 step @ srl lr, 1, lr @ dec r5 @ do single-bit divide steps @ @ We have to be careful here. We know that r3 >= lr, so we can do the @ first divide step without thinking. BUT, the others are conditional, @ and are only done if r3 >= 0. Because both r3 and lr may have the high- @ order bit set in the first step, just falling into the regular @ division loop will mess up the first time around. @ So we unroll slightly... Ldo_single_div: subs r5, r5, #1 blt Lend_regular_divide sub r3, r3, lr mov r2, #1 b Lend_single_divloop Lsingle_divloop: cmp r3, #0 mov r2, r2, lsl #1 mov lr, lr, lsr #1 @ r3 >= 0 subpl r3, r3, lr addpl r2, r2, #1 @ r3 < 0 addmi r3, r3, lr submi r2, r2, #1 Lend_single_divloop: subs r5, r5, #1 bge Lsingle_divloop b Lend_regular_divide 1: add ip, ip, #1 Lnot_really_big: mov lr, lr, lsl #4 cmp lr, r3 bls 1b @ @ HOW CAN ip EVER BE -1 HERE ????? @ cmn ip, #1 beq Lgot_result Ldivloop: cmp r3, #0 @ set up for initial iteration mov r2, r2, lsl #4 @ depth 1, accumulated bits 0 mov lr, lr, lsr #1 blt L.1.1015 @ remainder is positive subs r3, r3, lr @ depth 2, accumulated bits 1 mov lr, lr, lsr #1 blt L.2.1016 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits 3 mov lr, lr, lsr #1 blt L.3.1018 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 7 mov lr, lr, lsr #1 blt L.4.1022 @ remainder is positive subs r3, r3, lr add r2, r2, #15 b 9f L.4.1022: @ remainder is negative adds r3, r3, lr add r2, r2, #13 b 9f L.3.1018: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 5 mov lr, lr, lsr #1 blt L.4.1020 @ remainder is positive subs r3, r3, lr add r2, r2, #11 b 9f L.4.1020: @ remainder is negative adds r3, r3, lr add r2, r2, #9 b 9f L.2.1016: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits 1 mov lr, lr, lsr #1 blt L.3.1016 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 3 mov lr, lr, lsr #1 blt L.4.1018 @ remainder is positive subs r3, r3, lr add r2, r2, #7 b 9f L.4.1018: @ remainder is negative adds r3, r3, lr add r2, r2, #5 b 9f L.3.1016: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 1 mov lr, lr, lsr #1 blt L.4.1016 @ remainder is positive subs r3, r3, lr add r2, r2, #3 b 9f L.4.1016: @ remainder is negative adds r3, r3, lr add r2, r2, #1 b 9f L.1.1015: @ remainder is negative adds r3, r3, lr @ depth 2, accumulated bits -1 mov lr, lr, lsr #1 blt L.2.1014 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits -1 mov lr, lr, lsr #1 blt L.3.1014 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -1 mov lr, lr, lsr #1 blt L.4.1014 @ remainder is positive subs r3, r3, lr sub r2, r2, #1 b 9f L.4.1014: @ remainder is negative adds r3, r3, lr sub r2, r2, #3 b 9f L.3.1014: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -3 mov lr, lr, lsr #1 blt L.4.1012 @ remainder is positive subs r3, r3, lr sub r2, r2, #5 b 9f L.4.1012: @ remainder is negative adds r3, r3, lr sub r2, r2, #7 b 9f L.2.1014: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits -3 mov lr, lr, lsr #1 blt L.3.1012 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -5 mov lr, lr, lsr #1 blt L.4.1010 @ remainder is positive subs r3, r3, lr sub r2, r2, #9 b 9f L.4.1010: @ remainder is negative adds r3, r3, lr sub r2, r2, #11 b 9f L.3.1012: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -7 mov lr, lr, lsr #1 blt L.4.1008 @ remainder is positive subs r3, r3, lr sub r2, r2, #13 b 9f L.4.1008: @ remainder is negative adds r3, r3, lr sub r2, r2, #15 b 9f 9: Lend_regular_divide: subs ip, ip, #1 bge Ldivloop cmp r3, #0 @ non-restoring fixup here (one instruction only!) addlt r3, r1, r3 Lgot_result: mov r0, r3 ldmia sp!, {r4, r5, pc} Ldiv_zero: @ Divide by zero trap. If it returns, return 0 (about as @ wrong as possible, but that is what SunOS does...). bl ___div0 mov r0, #0 ldmia sp!, {r4, r5, pc} #endif /* L_umodsi3 */ #ifdef L_modsi3 ip .req r12 sp .req r13 lr .req r14 pc .req r15 .text .globl ___modsi3 .align 0 ___modsi3: stmdb sp!, {r4, r5, r6, lr} @ compute sign of result; if neither is negative, no problem mov r6, r0 cmp r1, #0 rsbmi r1, r1, #0 beq Ldiv_zero mov lr, r1 movs r3, r0 rsbmi r3, r3, #0 @ make dividend nonnegative cmp r3, lr @ if r1 exceeds r0, done mov r2, #0 bcc Lgot_result @ (and algorithm fails otherwise) mov r4, #(1 << (32 - 4 - 1)) cmp r3, r4 mov ip, #0 bcc Lnot_really_big @ Here the dividend is >= 2^(31-N) or so. We must be careful here, @ as our usual N-at-a-shot divide step will cause overflow and havoc. @ The number of bits in the result here is N*ITER+SC, where SC <= N. @ Compute ITER in an unorthodox manner: know we need to shift V into @ the top decade: so do not even bother to compare to R. mov r5, #1 1: cmp lr, r4 bcs 3f mov lr, lr, lsl #4 add ip, ip, #1 b 1b @ Now compute r5. 2: adds lr, lr, lr add r5, r5, #1 bcc Lnot_too_big @ We get here if the r1 overflowed while shifting. @ This means that r3 has the high-order bit set. @ Restore lr and subtract from r3. mov r4, r4, lsl #4 mov lr, lr, lsr #1 add lr, r4, lr sub r5, r5, #1 b Ldo_single_div Lnot_too_big: 3: cmp lr, r3 bcc 2b @ beq Ldo_single_div /* NB: these are commented out in the V8-Sparc manual as well */ /* (I do not understand this) */ @ lr > r3: went too far: back up 1 step @ srl lr, 1, lr @ dec r5 @ do single-bit divide steps @ @ We have to be careful here. We know that r3 >= lr, so we can do the @ first divide step without thinking. BUT, the others are conditional, @ and are only done if r3 >= 0. Because both r3 and lr may have the high- @ order bit set in the first step, just falling into the regular @ division loop will mess up the first time around. @ So we unroll slightly... Ldo_single_div: subs r5, r5, #1 blt Lend_regular_divide sub r3, r3, lr mov r2, #1 b Lend_single_divloop Lsingle_divloop: cmp r3, #0 mov r2, r2, lsl #1 mov lr, lr, lsr #1 @ r3 >= 0 subpl r3, r3, lr addpl r2, r2, #1 @ r3 < 0 addmi r3, r3, lr submi r2, r2, #1 Lend_single_divloop: subs r5, r5, #1 bge Lsingle_divloop b Lend_regular_divide 1: add ip, ip, #1 Lnot_really_big: mov lr, lr, lsl #4 cmp lr, r3 bls 1b @ @ HOW CAN ip EVER BE -1 HERE ????? @ cmn ip, #1 beq Lgot_result Ldivloop: cmp r3, #0 @ set up for initial iteration mov r2, r2, lsl #4 @ depth 1, accumulated bits 0 mov lr, lr, lsr #1 blt L.1.1015 @ remainder is positive subs r3, r3, lr @ depth 2, accumulated bits 1 mov lr, lr, lsr #1 blt L.2.1016 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits 3 mov lr, lr, lsr #1 blt L.3.1018 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 7 mov lr, lr, lsr #1 blt L.4.1022 @ remainder is positive subs r3, r3, lr add r2, r2, #15 b 9f L.4.1022: @ remainder is negative adds r3, r3, lr add r2, r2, #13 b 9f L.3.1018: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 5 mov lr, lr, lsr #1 blt L.4.1020 @ remainder is positive subs r3, r3, lr add r2, r2, #11 b 9f L.4.1020: @ remainder is negative adds r3, r3, lr add r2, r2, #9 b 9f L.2.1016: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits 1 mov lr, lr, lsr #1 blt L.3.1016 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits 3 mov lr, lr, lsr #1 blt L.4.1018 @ remainder is positive subs r3, r3, lr add r2, r2, #7 b 9f L.4.1018: @ remainder is negative adds r3, r3, lr add r2, r2, #5 b 9f L.3.1016: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits 1 mov lr, lr, lsr #1 blt L.4.1016 @ remainder is positive subs r3, r3, lr add r2, r2, #3 b 9f L.4.1016: @ remainder is negative adds r3, r3, lr add r2, r2, #1 b 9f L.1.1015: @ remainder is negative adds r3, r3, lr @ depth 2, accumulated bits -1 mov lr, lr, lsr #1 blt L.2.1014 @ remainder is positive subs r3, r3, lr @ depth 3, accumulated bits -1 mov lr, lr, lsr #1 blt L.3.1014 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -1 mov lr, lr, lsr #1 blt L.4.1014 @ remainder is positive subs r3, r3, lr sub r2, r2, #1 b 9f L.4.1014: @ remainder is negative adds r3, r3, lr sub r2, r2, #3 b 9f L.3.1014: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -3 mov lr, lr, lsr #1 blt L.4.1012 @ remainder is positive subs r3, r3, lr sub r2, r2, #5 b 9f L.4.1012: @ remainder is negative adds r3, r3, lr sub r2, r2, #7 b 9f L.2.1014: @ remainder is negative adds r3, r3, lr @ depth 3, accumulated bits -3 mov lr, lr, lsr #1 blt L.3.1012 @ remainder is positive subs r3, r3, lr @ depth 4, accumulated bits -5 mov lr, lr, lsr #1 blt L.4.1010 @ remainder is positive subs r3, r3, lr sub r2, r2, #9 b 9f L.4.1010: @ remainder is negative adds r3, r3, lr sub r2, r2, #11 b 9f L.3.1012: @ remainder is negative adds r3, r3, lr @ depth 4, accumulated bits -7 mov lr, lr, lsr #1 blt L.4.1008 @ remainder is positive subs r3, r3, lr sub r2, r2, #13 b 9f L.4.1008: @ remainder is negative adds r3, r3, lr sub r2, r2, #15 b 9f 9: Lend_regular_divide: subs ip, ip, #1 bge Ldivloop cmp r3, #0 @ non-restoring fixup here (one instruction only!) addlt r3, r1, r3 Lgot_result: @ check to see if answer should be < 0 cmp r6, #0 rsbmi r3, r3, #0 mov r0, r3 ldmia sp!, {r4, r5, r6, pc} Ldiv_zero: @ Divide by zero trap. If it returns, return 0 (about as @ wrong as possible, but that is what SunOS does...). bl ___div0 mov r0, #0 ldmia sp!, {r4, r5, r6, pc} #endif /* L_modsi3 */ #ifdef L_dvmd_tls .globl ___div0 .align 0 ___div0: mov pc, lr #endif /* L_divmodsi_tools */
project/adl/testsuite/tests/wire_simulation/src/tc_virtual_wire.adb
corentingay/ada_epita
2
18350
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with HAL.GPIO; use HAL.GPIO; with Wire_Simulation; use Wire_Simulation; with Ada.Text_IO; use Ada.Text_IO; procedure TC_Virtual_Wire is pragma Assertion_Policy (Assert => Check); No_Pull_Wire : Virtual_Wire (Default_Pull => Floating, Max_Points => 2); Pull_Up_Wire : Virtual_Wire (Default_Pull => Pull_Up, Max_Points => 2); Pull_Down_Wire : Virtual_Wire (Default_Pull => Pull_Down, Max_Points => 2); Unref : Boolean with Unreferenced; begin -- Default mode -- pragma Assert (No_Pull_Wire.Point (1).Mode = Input, "Default point mode should be input"); -- State with only inputs and a wire pull resistor -- pragma Assert (Pull_Up_Wire.Point (1).Set, "Default state of pull up wire should be high"); pragma Assert (not Pull_Down_Wire.Point (1).Set, "Default state of pull down wire should be low"); -- State with only inputs and a point pull resistor -- pragma Assert (No_Pull_Wire.Point (1).Set_Pull_Resistor (Pull_Up), "It should be possible to change the pull resitor"); pragma Assert (No_Pull_Wire.Point (1).Set, "State of wire with one pull up point should be high"); Unref := No_Pull_Wire.Point (1).Set_Pull_Resistor (Pull_Down); pragma Assert (not No_Pull_Wire.Point (1).Set, "State of wire with one pull down point should be low"); -- State with one input one output and no pull resistor -- pragma Assert (No_Pull_Wire.Point (1).Set_Mode (Input), "It should be possible to change the mode"); Unref := No_Pull_Wire.Point (1).Set_Pull_Resistor (Pull_Down); Unref := No_Pull_Wire.Point (2).Set_Mode (Output); Unref := No_Pull_Wire.Point (2).Set_Pull_Resistor (Floating); No_Pull_Wire.Point (2).Set; pragma Assert (No_Pull_Wire.Point (1).Set, "Should be high"); No_Pull_Wire.Point (2).Clear; pragma Assert (not No_Pull_Wire.Point (1).Set, "Should be low"); -- State with one input one output and point pull resistor -- Unref := No_Pull_Wire.Point (1).Set_Mode (Input); Unref := No_Pull_Wire.Point (1).Set_Pull_Resistor (Pull_Up); Unref := No_Pull_Wire.Point (2).Set_Mode (Output); Unref := No_Pull_Wire.Point (2).Set_Pull_Resistor (Floating); No_Pull_Wire.Point (2).Set; pragma Assert (No_Pull_Wire.Point (1).Set, "Should be high"); No_Pull_Wire.Point (2).Clear; pragma Assert (not No_Pull_Wire.Point (1).Set, "Should be low"); Unref := No_Pull_Wire.Point (1).Set_Pull_Resistor (Pull_Down); No_Pull_Wire.Point (2).Set; pragma Assert (No_Pull_Wire.Point (1).Set, "Should be high"); No_Pull_Wire.Point (2).Clear; pragma Assert (not No_Pull_Wire.Point (1).Set, "Should be low"); -- Opposite pull on the same wire -- declare begin Unref := Pull_Down_Wire.Point (1).Set_Pull_Resistor (Pull_Up); exception when Invalid_Configuration => Put_Line ("Expected exception on oppposite pull (1)"); end; declare begin Unref := Pull_Up_Wire.Point (1).Set_Pull_Resistor (Pull_Down); exception when Invalid_Configuration => Put_Line ("Expected exception on oppposite pull (2)"); end; -- Two output point on a wire -- declare begin Unref := Pull_Up_Wire.Point (1).Set_Mode (Output); Unref := Pull_Up_Wire.Point (2).Set_Mode (Output); exception when Invalid_Configuration => Put_Line ("Expected exception on multiple output points"); end; -- Unknon state -- declare begin Unref := No_Pull_Wire.Point (1).Set_Mode (Input); Unref := No_Pull_Wire.Point (1).Set_Pull_Resistor (Floating); Unref := No_Pull_Wire.Point (2).Set_Mode (Input); Unref := No_Pull_Wire.Point (2).Set_Pull_Resistor (Floating); Unref := No_Pull_Wire.Point (2).Set; exception when Unknown_State => Put_Line ("Expected exception on unknown state"); end; end TC_Virtual_Wire;
python-ada/unit.adb
octonion/recursion
8
17528
with Interfaces.C; use Interfaces; package body unit is --type stack is array (0..9) of integer; function partitions (cards: out stack; subtotal: integer) return integer is m, total : integer; begin m := 0; -- Hit for i in integer range 0 .. 9 loop if (cards(i)>0) then total := subtotal+i+1; if (total < 21) then -- Stand m := m+1; -- Hit again cards(i) := cards(i)-1; m := m+partitions(cards, total); cards(i) := cards(i)+1; elsif (total=21) then -- Stand; hit again is an automatic bust m := m+1; end if; end if; end loop; return(m); end partitions; end unit;
programs/oeis/021/A021097.asm
neoneye/loda
22
177575
; A021097: Decimal expansion of 1/93. ; 0,1,0,7,5,2,6,8,8,1,7,2,0,4,3,0,1,0,7,5,2,6,8,8,1,7,2,0,4,3,0,1,0,7,5,2,6,8,8,1,7,2,0,4,3,0,1,0,7,5,2,6,8,8,1,7,2,0,4,3,0,1,0,7,5,2,6,8,8,1,7,2,0,4,3,0,1,0,7,5,2,6,8,8,1,7,2,0,4,3,0,1,0,7,5,2,6,8,8 add $0,2 mov $1,10 pow $1,$0 mul $1,4 div $1,3720 mod $1,10 mov $0,$1
workshop/src/parentpackage.ads
TNO/Rejuvenation-Ada
0
25917
with Ada.Text_IO; pragma Unreferenced (Ada.Text_IO); package ParentPackage is procedure ParentDummy; end ParentPackage;
programs/oeis/267/A267813.asm
jmorken/loda
1
176129
<reponame>jmorken/loda ; A267813: Triangle read by rows giving successive states of cellular automaton generated by "Rule 219" initiated with a single ON (black) cell. ; 1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1 sub $0,2 lpb $0 add $2,2 sub $0,$2 sub $0,2 lpe lpb $0 div $0,5 mov $1,1 lpe
org.alloytools.alloy.core/src/main/resources/models/util/int32bits.als
cesarcorne/org.alloytools.alloy
0
4005
module util/int32bits open util/boolean /* * * A collection of utility functions for using Integers in Alloy. * */ /** Representation of a Integer of 32 bits */ sig Number32 { b00: Bool, b01: Bool, b02: Bool, b03: Bool, b04: Bool, b05: Bool, b06: Bool, b07: Bool, b08: Bool, b09: Bool, b10: Bool, b11: Bool, b12: Bool, b13: Bool, b14: Bool, b15: Bool, b16: Bool, b17: Bool, b18: Bool, b19: Bool, b20: Bool, b21: Bool, b22: Bool, b23: Bool, b24: Bool, b25: Bool, b26: Bool, b27: Bool, b28: Bool, b29: Bool, b30: Bool, b31: Bool, } /** AdderCarry and AdderSum used as reserved functions */ fun AdderCarry[a: Bool, b: Bool, cin: Bool]: Bool { Or[ And[a,b], And[cin, Xor[a,b]]] } fun AdderSum[a: Bool, b: Bool, cin: Bool]: Bool { Xor[Xor[a, b], cin] } /**Frome here there are the well knowns preds and functions over integers provided by Alloy with 8 bits representation*/ fun add [n1, n2 : Number32] : Number32 { {result : Number32 | predAdd[n1, n2, result]} } fun plus [n1, n2 : Number32] : Number32 { {result : Number32 | predAdd[n1, n2, result]} } fun sub [n1, n2 : Number32] : Number32 { {result : Number32 | predAdd[n2, result, n1]} } fun minus [n1, n2 : Number32] : Number32 { {result : Number32 | predAdd[n2, result, n1]} } fun mul [n1, n2: Number32] : Number32 { {result : Number32 | predMul[n1, n2, result]} } fun div [n1, n2: Number32] : Number32 { {result : Number32 | predMul[n1, result, n2]} } pred predRem[n1, n2, rem: Number32]{ let div = div[n1, n2] | let aux = mul[div, n2] | rem = sub[n1, aux] } fun rem [n1, n2: Number32] : Number32{ -- {result, div, aux : Number8 | div = division[n1, n2] && aux = multiplicacion[div, n2] && result = resta[n1,aux]} {result : Number32 | predRem[n1, n2, result]} } /** Predicate to state if a is equal to b */ pred eq[a: Number32, b: Number32] { a.b00 = b.b00 a.b01 = b.b01 a.b02 = b.b02 a.b03 = b.b03 a.b04 = b.b04 a.b05 = b.b05 a.b06 = b.b06 a.b07 = b.b07 a.b08 = b.b08 a.b09 = b.b09 a.b10 = b.b10 a.b11 = b.b11 a.b12 = b.b12 a.b13 = b.b13 a.b14 = b.b14 a.b15 = b.b15 a.b16 = b.b16 a.b17 = b.b17 a.b18 = b.b18 a.b19 = b.b19 a.b20 = b.b20 a.b21 = b.b21 a.b22 = b.b22 a.b23 = b.b23 a.b24 = b.b24 a.b25 = b.b25 a.b26 = b.b26 a.b27 = b.b27 a.b28 = b.b28 a.b29 = b.b29 a.b30 = b.b30 a.b31 = b.b31 } /** Predicate to state if a is not equal to b */ pred neq[a: Number32, b: Number32] { not eq[a, b] } /** Predicate to state if a is greater than b */ pred gt[a: Number32, b: Number32] { (a.b31 = False and b.b31 = True) or (a.b31 = b.b31) and (a.b30 = True and b.b30 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = True and b.b29 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = True and b.b28 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = True and b.b27 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = True and b.b26 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = True and b.b25 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = True and b.b24 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = True and b.b23 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = True and b.b22 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = True and b.b21 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = True and b.b20 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = True and b.b19 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = True and b.b18 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = True and b.b17 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = True and b.b16 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = True and b.b15 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = True and b.b14 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = True and b.b13 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = True and b.b12 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = True and b.b11 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = True and b.b10 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = True and b.b09 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = True and b.b08 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = True and b.b07 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = b.b07) and (a.b06 = True and b.b06 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = b.b07) and (a.b06 = b.b06) and (a.b05 = True and b.b05 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = b.b07) and (a.b06 = b.b06) and (a.b05 = b.b05) and (a.b04 = True and b.b04 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = b.b07) and (a.b06 = b.b06) and (a.b05 = b.b05) and (a.b04 = b.b04) and (a.b03 = True and b.b03 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = b.b07) and (a.b06 = b.b06) and (a.b05 = b.b05) and (a.b04 = b.b04) and (a.b03 = b.b03) and (a.b02 = True and b.b02 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = b.b07) and (a.b06 = b.b06) and (a.b05 = b.b05) and (a.b04 = b.b04) and (a.b03 = b.b03) and (a.b02 = b.b02) and (a.b01 = True and b.b01 = False) or (a.b31 = b.b31) and (a.b30 = b.b30) and (a.b29 = b.b29) and (a.b28 = b.b28) and (a.b27 = b.b27) and (a.b26 = b.b26) and (a.b25 = b.b25) and (a.b24 = b.b24) and (a.b23 = b.b23) and (a.b22 = b.b22) and (a.b21 = b.b21) and (a.b20 = b.b20) and (a.b19 = b.b19) and (a.b18 = b.b18) and (a.b17 = b.b17) and (a.b16 = b.b16) and (a.b15 = b.b15) and (a.b14 = b.b14) and (a.b13 = b.b13) and (a.b12 = b.b12) and (a.b11 = b.b11) and (a.b10 = b.b10) and (a.b09 = b.b09) and (a.b08 = b.b08) and (a.b07 = b.b07) and (a.b06 = b.b06) and (a.b05 = b.b05) and (a.b04 = b.b04) and (a.b03 = b.b03) and (a.b02 = b.b02) and (a.b01 = b.b01) and (a.b00 = True and b.b00 = False) } /** Predicate to state if a is less than b */ pred lt[a: Number32, b: Number32] { not gte[a, b] } /** Predicate to state if a is greater than or equal to b */ pred gte[a: Number32, b: Number32] { gt[a, b] or eq[a, b] } /** Predicate to state if a is less or equal to b */ pred lte[a: Number32, b: Number32] { not gt[a, b] } pred zero [n1: Number32]{ n1.b00 in False n1.b01 in False n1.b02 in False n1.b03 in False n1.b04 in False n1.b05 in False n1.b06 in False n1.b07 in False n1.b08 in False n1.b09 in False n1.b10 in False n1.b11 in False n1.b12 in False n1.b13 in False n1.b14 in False n1.b15 in False n1.b16 in False n1.b17 in False n1.b18 in False n1.b19 in False n1.b20 in False n1.b21 in False n1.b22 in False n1.b23 in False n1.b24 in False n1.b25 in False n1.b26 in False n1.b27 in False n1.b28 in False n1.b29 in False n1.b30 in False n1.b31 in False } pred pos [n1: Number32]{ n1.b31 in False and not zero[n1] } pred neg [n1: Number32]{ n1.b31 in True } pred nonpos[n1: Number32]{ n1.b31 = True or zero[n1] } pred nonneg[n1: Number32]{ n1.b31 = False } fun maxInt : Number32 { {result : Number32 | result.b00 = True and result.b01 = True and result.b02 = True and result.b03 = True and result.b04 = True and result.b05 = True and result.b06 = True and result.b07 = True and result.b08 = True and result.b09 = True and result.b10 = True and result.b11 = True and result.b12 = True and result.b13 = True and result.b14 = True and result.b15 = True and result.b16 = True and result.b17 = True and result.b18 = True and result.b19 = True and result.b20 = True and result.b21 = True and result.b22 = True and result.b23 = True and result.b24 = True and result.b25 = True and result.b26 = True and result.b27 = True and result.b28 = True and result.b29 = True and result.b30 = True and result.b31 = False } } fun minInt : Number32 { {result : Number32 | result.b00 = True and result.b01 = False and result.b02 = False and result.b03 = False and result.b04 = False and result.b05 = False and result.b06 = False and result.b07 = False and result.b08 = False and result.b09 = False and result.b10 = False and result.b11 = False and result.b12 = False and result.b13 = False and result.b14 = False and result.b15 = False and result.b16 = False and result.b17 = False and result.b18 = False and result.b19 = False and result.b20 = False and result.b21 = False and result.b22 = False and result.b23 = False and result.b24 = False and result.b25 = False and result.b26 = False and result.b27 = False and result.b28 = False and result.b29 = False and result.b30 = False and result.b31 = True } } fun max[n: set Number32] : lone Number32 { {result : Number32 | all aux : n | gte[result,aux] and result in n} } fun min[n: set Number32] : lone Number32 { {result : Number32 | all aux : n | lte[result,aux] and result in n} } fun prevs[n: Number32]: set Number32 { {result : Number32 | all a : result | lt[a, n]} } fun nexts[n: Number32]: set Number32 { {result: Number32 | all a : result | gt[a,n]} } fun larger [n1, n2: Number32] : Number32 {gte[n1, n2] => n1 else n2} fun smaller [n1, n2: Number32] : Number32 {lte[n1, n2] => n1 else n2} /** Auxiliar predicate to sum two numbers, the result is kept in result*/ pred predAdd[a: Number32, b: Number32, result: Number32] { let c_0 = False | let s_0 = AdderSum[a.b00, b.b00, c_0] | let c_1 = AdderCarry[a.b00, b.b00, c_0] | let s_1 = AdderSum[a.b01, b.b01, c_1] | let c_2 = AdderCarry[a.b01, b.b01, c_1] | let s_2 = AdderSum[a.b02, b.b02, c_2] | let c_3 = AdderCarry[a.b02, b.b02, c_2] | let s_3 = AdderSum[a.b03, b.b03, c_3] | let c_4 = AdderCarry[a.b03, b.b03, c_3] | let s_4 = AdderSum[a.b04, b.b04, c_4] | let c_5 = AdderCarry[a.b04, b.b04, c_4] | let s_5 = AdderSum[a.b05, b.b05, c_5] | let c_6 = AdderCarry[a.b05, b.b05, c_5] | let s_6 = AdderSum[a.b06, b.b06, c_6] | let c_7 = AdderCarry[a.b06, b.b06, c_6] | let s_7 = AdderSum[a.b07, b.b07, c_7] | let c_8 = AdderCarry[a.b07, b.b07, c_7] | let s_8 = AdderSum[a.b08, b.b08, c_8] | let c_9 = AdderCarry[a.b08, b.b08, c_8] | let s_9 = AdderSum[a.b09, b.b09, c_9] | let c_10 = AdderCarry[a.b09, b.b09, c_9] | let s_10 = AdderSum[a.b10, b.b10, c_10] | let c_11 = AdderCarry[a.b10, b.b10, c_10] | let s_11 = AdderSum[a.b11, b.b11, c_11] | let c_12 = AdderCarry[a.b11, b.b11, c_11] | let s_12 = AdderSum[a.b12, b.b12, c_12] | let c_13 = AdderCarry[a.b12, b.b12, c_12] | let s_13 = AdderSum[a.b13, b.b13, c_13] | let c_14 = AdderCarry[a.b13, b.b13, c_13] | let s_14 = AdderSum[a.b14, b.b14, c_14] | let c_15 = AdderCarry[a.b14, b.b14, c_14] | let s_15 = AdderSum[a.b15, b.b15, c_15] | let c_16 = AdderCarry[a.b15, b.b15, c_15] | let s_16 = AdderSum[a.b16, b.b16, c_16] | let c_17 = AdderCarry[a.b16, b.b16, c_16] | let s_17 = AdderSum[a.b17, b.b17, c_17] | let c_18 = AdderCarry[a.b17, b.b17, c_17] | let s_18 = AdderSum[a.b18, b.b18, c_18] | let c_19 = AdderCarry[a.b18, b.b18, c_18] | let s_19 = AdderSum[a.b19, b.b19, c_19] | let c_20 = AdderCarry[a.b19, b.b19, c_19] | let s_20 = AdderSum[a.b20, b.b20, c_20] | let c_21 = AdderCarry[a.b20, b.b20, c_20] | let s_21 = AdderSum[a.b21, b.b21, c_21] | let c_22 = AdderCarry[a.b21, b.b21, c_21] | let s_22 = AdderSum[a.b22, b.b22, c_22] | let c_23 = AdderCarry[a.b22, b.b22, c_22] | let s_23 = AdderSum[a.b23, b.b23, c_23] | let c_24 = AdderCarry[a.b23, b.b23, c_23] | let s_24 = AdderSum[a.b24, b.b24, c_24] | let c_25 = AdderCarry[a.b24, b.b24, c_24] | let s_25 = AdderSum[a.b25, b.b25, c_25] | let c_26 = AdderCarry[a.b25, b.b25, c_25] | let s_26 = AdderSum[a.b26, b.b26, c_26] | let c_27 = AdderCarry[a.b26, b.b26, c_26] | let s_27 = AdderSum[a.b27, b.b27, c_27] | let c_28 = AdderCarry[a.b27, b.b27, c_27] | let s_28 = AdderSum[a.b28, b.b28, c_28] | let c_29 = AdderCarry[a.b28, b.b28, c_28] | let s_29 = AdderSum[a.b29, b.b29, c_29] | let c_30 = AdderCarry[a.b29, b.b29, c_29] | let s_30 = AdderSum[a.b30, b.b30, c_30] | let c_31 = AdderCarry[a.b30, b.b30, c_30] | let s_31 = AdderSum[a.b31, b.b31, c_31] | result.b00 in s_0 and result.b01 in s_1 and result.b02 in s_2 and result.b03 in s_3 and result.b04 in s_4 and result.b05 in s_5 and result.b06 in s_6 and result.b07 in s_7 and result.b08 in s_8 and result.b09 in s_9 and result.b10 in s_10 and result.b11 in s_11 and result.b12 in s_12 and result.b13 in s_13 and result.b14 in s_14 and result.b15 in s_15 and result.b16 in s_16 and result.b17 in s_17 and result.b18 in s_18 and result.b19 in s_19 and result.b20 in s_20 and result.b21 in s_21 and result.b22 in s_22 and result.b23 in s_23 and result.b24 in s_24 and result.b25 in s_25 and result.b26 in s_26 and result.b27 in s_27 and result.b28 in s_28 and result.b29 in s_29 and result.b30 in s_30 and result.b31 in s_31 } /** Auxiliar predicate to multiplies two numbers, the result is kept in result*/ pred predMul[a: Number32, b: Number32, result: Number32] { let c_0_0 = False | let s_0_0 = False | let s_0_1 = AdderSum [s_0_0, And[a.b00, b.b00], c_0_0] | let c_1_0 = False | let c_1_1 = AdderCarry[s_0_0, And[a.b00, b.b00], c_0_0] | let s_1_0 = False | let s_1_1 = AdderSum [s_1_0, And[a.b01, b.b00], c_1_0] | let s_1_2 = AdderSum [s_1_1, And[a.b00, b.b01], c_1_1] | let c_2_0 = False | let c_2_1 = AdderCarry[s_1_0, And[a.b01, b.b00], c_1_0] | let c_2_2 = AdderCarry[s_1_1, And[a.b00, b.b01], c_1_1] | let s_2_0 = False | let s_2_1 = AdderSum [s_2_0, And[a.b02, b.b00], c_2_0] | let s_2_2 = AdderSum [s_2_1, And[a.b01, b.b01], c_2_1] | let s_2_3 = AdderSum [s_2_2, And[a.b00, b.b02], c_2_2] | let c_3_0 = False | let c_3_1 = AdderCarry[s_2_0, And[a.b02, b.b00], c_2_0] | let c_3_2 = AdderCarry[s_2_1, And[a.b01, b.b01], c_2_1] | let c_3_3 = AdderCarry[s_2_2, And[a.b00, b.b02], c_2_2] | let s_3_0 = False | let s_3_1 = AdderSum [s_3_0, And[a.b03, b.b00], c_3_0] | let s_3_2 = AdderSum [s_3_1, And[a.b02, b.b01], c_3_1] | let s_3_3 = AdderSum [s_3_2, And[a.b01, b.b02], c_3_2] | let s_3_4 = AdderSum [s_3_3, And[a.b00, b.b03], c_3_3] | let c_4_0 = False | let c_4_1 = AdderCarry[s_3_0, And[a.b03, b.b00], c_3_0] | let c_4_2 = AdderCarry[s_3_1, And[a.b02, b.b01], c_3_1] | let c_4_3 = AdderCarry[s_3_2, And[a.b01, b.b02], c_3_2] | let c_4_4 = AdderCarry[s_3_3, And[a.b00, b.b03], c_3_3] | let s_4_0 = False | let s_4_1 = AdderSum [s_4_0, And[a.b04, b.b00], c_4_0] | let s_4_2 = AdderSum [s_4_1, And[a.b03, b.b01], c_4_1] | let s_4_3 = AdderSum [s_4_2, And[a.b02, b.b02], c_4_2] | let s_4_4 = AdderSum [s_4_3, And[a.b01, b.b03], c_4_3] | let s_4_5 = AdderSum [s_4_4, And[a.b00, b.b04], c_4_4] | let c_5_0 = False | let c_5_1 = AdderCarry[s_4_0, And[a.b04, b.b00], c_4_0] | let c_5_2 = AdderCarry[s_4_1, And[a.b03, b.b01], c_4_1] | let c_5_3 = AdderCarry[s_4_2, And[a.b02, b.b02], c_4_2] | let c_5_4 = AdderCarry[s_4_3, And[a.b01, b.b03], c_4_3] | let c_5_5 = AdderCarry[s_4_4, And[a.b00, b.b04], c_4_4] | let s_5_0 = False | let s_5_1 = AdderSum [s_5_0, And[a.b05, b.b00], c_5_0] | let s_5_2 = AdderSum [s_5_1, And[a.b04, b.b01], c_5_1] | let s_5_3 = AdderSum [s_5_2, And[a.b03, b.b02], c_5_2] | let s_5_4 = AdderSum [s_5_3, And[a.b02, b.b03], c_5_3] | let s_5_5 = AdderSum [s_5_4, And[a.b01, b.b04], c_5_4] | let s_5_6 = AdderSum [s_5_5, And[a.b00, b.b05], c_5_5] | let c_6_0 = False | let c_6_1 = AdderCarry[s_5_0, And[a.b05, b.b00], c_5_0] | let c_6_2 = AdderCarry[s_5_1, And[a.b04, b.b01], c_5_1] | let c_6_3 = AdderCarry[s_5_2, And[a.b03, b.b02], c_5_2] | let c_6_4 = AdderCarry[s_5_3, And[a.b02, b.b03], c_5_3] | let c_6_5 = AdderCarry[s_5_4, And[a.b01, b.b04], c_5_4] | let c_6_6 = AdderCarry[s_5_5, And[a.b00, b.b05], c_5_5] | let s_6_0 = False | let s_6_1 = AdderSum [s_6_0, And[a.b06, b.b00], c_6_0] | let s_6_2 = AdderSum [s_6_1, And[a.b05, b.b01], c_6_1] | let s_6_3 = AdderSum [s_6_2, And[a.b04, b.b02], c_6_2] | let s_6_4 = AdderSum [s_6_3, And[a.b03, b.b03], c_6_3] | let s_6_5 = AdderSum [s_6_4, And[a.b02, b.b04], c_6_4] | let s_6_6 = AdderSum [s_6_5, And[a.b01, b.b05], c_6_5] | let s_6_7 = AdderSum [s_6_6, And[a.b00, b.b06], c_6_6] | let c_7_0 = False | let c_7_1 = AdderCarry[s_6_0, And[a.b06, b.b00], c_6_0] | let c_7_2 = AdderCarry[s_6_1, And[a.b05, b.b01], c_6_1] | let c_7_3 = AdderCarry[s_6_2, And[a.b04, b.b02], c_6_2] | let c_7_4 = AdderCarry[s_6_3, And[a.b03, b.b03], c_6_3] | let c_7_5 = AdderCarry[s_6_4, And[a.b02, b.b04], c_6_4] | let c_7_6 = AdderCarry[s_6_5, And[a.b01, b.b05], c_6_5] | let c_7_7 = AdderCarry[s_6_6, And[a.b00, b.b06], c_6_6] | let s_7_0 = False | let s_7_1 = AdderSum [s_7_0, And[a.b07, b.b00], c_7_0] | let s_7_2 = AdderSum [s_7_1, And[a.b06, b.b01], c_7_1] | let s_7_3 = AdderSum [s_7_2, And[a.b05, b.b02], c_7_2] | let s_7_4 = AdderSum [s_7_3, And[a.b04, b.b03], c_7_3] | let s_7_5 = AdderSum [s_7_4, And[a.b03, b.b04], c_7_4] | let s_7_6 = AdderSum [s_7_5, And[a.b02, b.b05], c_7_5] | let s_7_7 = AdderSum [s_7_6, And[a.b01, b.b06], c_7_6] | let s_7_8 = AdderSum [s_7_7, And[a.b00, b.b07], c_7_7] | let c_8_0 = False | let c_8_1 = AdderCarry[s_7_0, And[a.b07, b.b00], c_7_0] | let c_8_2 = AdderCarry[s_7_1, And[a.b06, b.b01], c_7_1] | let c_8_3 = AdderCarry[s_7_2, And[a.b05, b.b02], c_7_2] | let c_8_4 = AdderCarry[s_7_3, And[a.b04, b.b03], c_7_3] | let c_8_5 = AdderCarry[s_7_4, And[a.b03, b.b04], c_7_4] | let c_8_6 = AdderCarry[s_7_5, And[a.b02, b.b05], c_7_5] | let c_8_7 = AdderCarry[s_7_6, And[a.b01, b.b06], c_7_6] | let c_8_8 = AdderCarry[s_7_7, And[a.b00, b.b07], c_7_7] | let s_8_0 = False | let s_8_1 = AdderSum [s_8_0, And[a.b08, b.b00], c_8_0] | let s_8_2 = AdderSum [s_8_1, And[a.b07, b.b01], c_8_1] | let s_8_3 = AdderSum [s_8_2, And[a.b06, b.b02], c_8_2] | let s_8_4 = AdderSum [s_8_3, And[a.b05, b.b03], c_8_3] | let s_8_5 = AdderSum [s_8_4, And[a.b04, b.b04], c_8_4] | let s_8_6 = AdderSum [s_8_5, And[a.b03, b.b05], c_8_5] | let s_8_7 = AdderSum [s_8_6, And[a.b02, b.b06], c_8_6] | let s_8_8 = AdderSum [s_8_7, And[a.b01, b.b07], c_8_7] | let s_8_9 = AdderSum [s_8_8, And[a.b00, b.b08], c_8_8] | let c_9_0 = False | let c_9_1 = AdderCarry[s_8_0, And[a.b08, b.b00], c_8_0] | let c_9_2 = AdderCarry[s_8_1, And[a.b07, b.b01], c_8_1] | let c_9_3 = AdderCarry[s_8_2, And[a.b06, b.b02], c_8_2] | let c_9_4 = AdderCarry[s_8_3, And[a.b05, b.b03], c_8_3] | let c_9_5 = AdderCarry[s_8_4, And[a.b04, b.b04], c_8_4] | let c_9_6 = AdderCarry[s_8_5, And[a.b03, b.b05], c_8_5] | let c_9_7 = AdderCarry[s_8_6, And[a.b02, b.b06], c_8_6] | let c_9_8 = AdderCarry[s_8_7, And[a.b01, b.b07], c_8_7] | let c_9_9 = AdderCarry[s_8_8, And[a.b00, b.b08], c_8_8] | let s_9_0 = False | let s_9_1 = AdderSum [s_9_0, And[a.b09, b.b00], c_9_0] | let s_9_2 = AdderSum [s_9_1, And[a.b08, b.b01], c_9_1] | let s_9_3 = AdderSum [s_9_2, And[a.b07, b.b02], c_9_2] | let s_9_4 = AdderSum [s_9_3, And[a.b06, b.b03], c_9_3] | let s_9_5 = AdderSum [s_9_4, And[a.b05, b.b04], c_9_4] | let s_9_6 = AdderSum [s_9_5, And[a.b04, b.b05], c_9_5] | let s_9_7 = AdderSum [s_9_6, And[a.b03, b.b06], c_9_6] | let s_9_8 = AdderSum [s_9_7, And[a.b02, b.b07], c_9_7] | let s_9_9 = AdderSum [s_9_8, And[a.b01, b.b08], c_9_8] | let s_9_10 = AdderSum [s_9_9, And[a.b00, b.b09], c_9_9] | let c_10_0 = False | let c_10_1 = AdderCarry[s_9_0, And[a.b09, b.b00], c_9_0] | let c_10_2 = AdderCarry[s_9_1, And[a.b08, b.b01], c_9_1] | let c_10_3 = AdderCarry[s_9_2, And[a.b07, b.b02], c_9_2] | let c_10_4 = AdderCarry[s_9_3, And[a.b06, b.b03], c_9_3] | let c_10_5 = AdderCarry[s_9_4, And[a.b05, b.b04], c_9_4] | let c_10_6 = AdderCarry[s_9_5, And[a.b04, b.b05], c_9_5] | let c_10_7 = AdderCarry[s_9_6, And[a.b03, b.b06], c_9_6] | let c_10_8 = AdderCarry[s_9_7, And[a.b02, b.b07], c_9_7] | let c_10_9 = AdderCarry[s_9_8, And[a.b01, b.b08], c_9_8] | let c_10_10 = AdderCarry[s_9_9, And[a.b00, b.b09], c_9_9] | let s_10_0 = False | let s_10_1 = AdderSum [s_10_0, And[a.b10, b.b00], c_10_0] | let s_10_2 = AdderSum [s_10_1, And[a.b09, b.b01], c_10_1] | let s_10_3 = AdderSum [s_10_2, And[a.b08, b.b02], c_10_2] | let s_10_4 = AdderSum [s_10_3, And[a.b07, b.b03], c_10_3] | let s_10_5 = AdderSum [s_10_4, And[a.b06, b.b04], c_10_4] | let s_10_6 = AdderSum [s_10_5, And[a.b05, b.b05], c_10_5] | let s_10_7 = AdderSum [s_10_6, And[a.b04, b.b06], c_10_6] | let s_10_8 = AdderSum [s_10_7, And[a.b03, b.b07], c_10_7] | let s_10_9 = AdderSum [s_10_8, And[a.b02, b.b08], c_10_8] | let s_10_10 = AdderSum [s_10_9, And[a.b01, b.b09], c_10_9] | let s_10_11 = AdderSum [s_10_10, And[a.b00, b.b10], c_10_10] | let c_11_0 = False | let c_11_1 = AdderCarry[s_10_0, And[a.b10, b.b00], c_10_0] | let c_11_2 = AdderCarry[s_10_1, And[a.b09, b.b01], c_10_1] | let c_11_3 = AdderCarry[s_10_2, And[a.b08, b.b02], c_10_2] | let c_11_4 = AdderCarry[s_10_3, And[a.b07, b.b03], c_10_3] | let c_11_5 = AdderCarry[s_10_4, And[a.b06, b.b04], c_10_4] | let c_11_6 = AdderCarry[s_10_5, And[a.b05, b.b05], c_10_5] | let c_11_7 = AdderCarry[s_10_6, And[a.b04, b.b06], c_10_6] | let c_11_8 = AdderCarry[s_10_7, And[a.b03, b.b07], c_10_7] | let c_11_9 = AdderCarry[s_10_8, And[a.b02, b.b08], c_10_8] | let c_11_10 = AdderCarry[s_10_9, And[a.b01, b.b09], c_10_9] | let c_11_11 = AdderCarry[s_10_10, And[a.b00, b.b10], c_10_10] | let s_11_0 = False | let s_11_1 = AdderSum [s_11_0, And[a.b11, b.b00], c_11_0] | let s_11_2 = AdderSum [s_11_1, And[a.b10, b.b01], c_11_1] | let s_11_3 = AdderSum [s_11_2, And[a.b09, b.b02], c_11_2] | let s_11_4 = AdderSum [s_11_3, And[a.b08, b.b03], c_11_3] | let s_11_5 = AdderSum [s_11_4, And[a.b07, b.b04], c_11_4] | let s_11_6 = AdderSum [s_11_5, And[a.b06, b.b05], c_11_5] | let s_11_7 = AdderSum [s_11_6, And[a.b05, b.b06], c_11_6] | let s_11_8 = AdderSum [s_11_7, And[a.b04, b.b07], c_11_7] | let s_11_9 = AdderSum [s_11_8, And[a.b03, b.b08], c_11_8] | let s_11_10 = AdderSum [s_11_9, And[a.b02, b.b09], c_11_9] | let s_11_11 = AdderSum [s_11_10, And[a.b01, b.b10], c_11_10] | let s_11_12 = AdderSum [s_11_11, And[a.b00, b.b11], c_11_11] | let c_12_0 = False | let c_12_1 = AdderCarry[s_11_0, And[a.b11, b.b00], c_11_0] | let c_12_2 = AdderCarry[s_11_1, And[a.b10, b.b01], c_11_1] | let c_12_3 = AdderCarry[s_11_2, And[a.b09, b.b02], c_11_2] | let c_12_4 = AdderCarry[s_11_3, And[a.b08, b.b03], c_11_3] | let c_12_5 = AdderCarry[s_11_4, And[a.b07, b.b04], c_11_4] | let c_12_6 = AdderCarry[s_11_5, And[a.b06, b.b05], c_11_5] | let c_12_7 = AdderCarry[s_11_6, And[a.b05, b.b06], c_11_6] | let c_12_8 = AdderCarry[s_11_7, And[a.b04, b.b07], c_11_7] | let c_12_9 = AdderCarry[s_11_8, And[a.b03, b.b08], c_11_8] | let c_12_10 = AdderCarry[s_11_9, And[a.b02, b.b09], c_11_9] | let c_12_11 = AdderCarry[s_11_10, And[a.b01, b.b10], c_11_10] | let c_12_12 = AdderCarry[s_11_11, And[a.b00, b.b11], c_11_11] | let s_12_0 = False | let s_12_1 = AdderSum [s_12_0, And[a.b12, b.b00], c_12_0] | let s_12_2 = AdderSum [s_12_1, And[a.b11, b.b01], c_12_1] | let s_12_3 = AdderSum [s_12_2, And[a.b10, b.b02], c_12_2] | let s_12_4 = AdderSum [s_12_3, And[a.b09, b.b03], c_12_3] | let s_12_5 = AdderSum [s_12_4, And[a.b08, b.b04], c_12_4] | let s_12_6 = AdderSum [s_12_5, And[a.b07, b.b05], c_12_5] | let s_12_7 = AdderSum [s_12_6, And[a.b06, b.b06], c_12_6] | let s_12_8 = AdderSum [s_12_7, And[a.b05, b.b07], c_12_7] | let s_12_9 = AdderSum [s_12_8, And[a.b04, b.b08], c_12_8] | let s_12_10 = AdderSum [s_12_9, And[a.b03, b.b09], c_12_9] | let s_12_11 = AdderSum [s_12_10, And[a.b02, b.b10], c_12_10] | let s_12_12 = AdderSum [s_12_11, And[a.b01, b.b11], c_12_11] | let s_12_13 = AdderSum [s_12_12, And[a.b00, b.b12], c_12_12] | let c_13_0 = False | let c_13_1 = AdderCarry[s_12_0, And[a.b12, b.b00], c_12_0] | let c_13_2 = AdderCarry[s_12_1, And[a.b11, b.b01], c_12_1] | let c_13_3 = AdderCarry[s_12_2, And[a.b10, b.b02], c_12_2] | let c_13_4 = AdderCarry[s_12_3, And[a.b09, b.b03], c_12_3] | let c_13_5 = AdderCarry[s_12_4, And[a.b08, b.b04], c_12_4] | let c_13_6 = AdderCarry[s_12_5, And[a.b07, b.b05], c_12_5] | let c_13_7 = AdderCarry[s_12_6, And[a.b06, b.b06], c_12_6] | let c_13_8 = AdderCarry[s_12_7, And[a.b05, b.b07], c_12_7] | let c_13_9 = AdderCarry[s_12_8, And[a.b04, b.b08], c_12_8] | let c_13_10 = AdderCarry[s_12_9, And[a.b03, b.b09], c_12_9] | let c_13_11 = AdderCarry[s_12_10, And[a.b02, b.b10], c_12_10] | let c_13_12 = AdderCarry[s_12_11, And[a.b01, b.b11], c_12_11] | let c_13_13 = AdderCarry[s_12_12, And[a.b00, b.b12], c_12_12] | let s_13_0 = False | let s_13_1 = AdderSum [s_13_0, And[a.b13, b.b00], c_13_0] | let s_13_2 = AdderSum [s_13_1, And[a.b12, b.b01], c_13_1] | let s_13_3 = AdderSum [s_13_2, And[a.b11, b.b02], c_13_2] | let s_13_4 = AdderSum [s_13_3, And[a.b10, b.b03], c_13_3] | let s_13_5 = AdderSum [s_13_4, And[a.b09, b.b04], c_13_4] | let s_13_6 = AdderSum [s_13_5, And[a.b08, b.b05], c_13_5] | let s_13_7 = AdderSum [s_13_6, And[a.b07, b.b06], c_13_6] | let s_13_8 = AdderSum [s_13_7, And[a.b06, b.b07], c_13_7] | let s_13_9 = AdderSum [s_13_8, And[a.b05, b.b08], c_13_8] | let s_13_10 = AdderSum [s_13_9, And[a.b04, b.b09], c_13_9] | let s_13_11 = AdderSum [s_13_10, And[a.b03, b.b10], c_13_10] | let s_13_12 = AdderSum [s_13_11, And[a.b02, b.b11], c_13_11] | let s_13_13 = AdderSum [s_13_12, And[a.b01, b.b12], c_13_12] | let s_13_14 = AdderSum [s_13_13, And[a.b00, b.b13], c_13_13] | let c_14_0 = False | let c_14_1 = AdderCarry[s_13_0, And[a.b13, b.b00], c_13_0] | let c_14_2 = AdderCarry[s_13_1, And[a.b12, b.b01], c_13_1] | let c_14_3 = AdderCarry[s_13_2, And[a.b11, b.b02], c_13_2] | let c_14_4 = AdderCarry[s_13_3, And[a.b10, b.b03], c_13_3] | let c_14_5 = AdderCarry[s_13_4, And[a.b09, b.b04], c_13_4] | let c_14_6 = AdderCarry[s_13_5, And[a.b08, b.b05], c_13_5] | let c_14_7 = AdderCarry[s_13_6, And[a.b07, b.b06], c_13_6] | let c_14_8 = AdderCarry[s_13_7, And[a.b06, b.b07], c_13_7] | let c_14_9 = AdderCarry[s_13_8, And[a.b05, b.b08], c_13_8] | let c_14_10 = AdderCarry[s_13_9, And[a.b04, b.b09], c_13_9] | let c_14_11 = AdderCarry[s_13_10, And[a.b03, b.b10], c_13_10] | let c_14_12 = AdderCarry[s_13_11, And[a.b02, b.b11], c_13_11] | let c_14_13 = AdderCarry[s_13_12, And[a.b01, b.b12], c_13_12] | let c_14_14 = AdderCarry[s_13_13, And[a.b00, b.b13], c_13_13] | let s_14_0 = False | let s_14_1 = AdderSum [s_14_0, And[a.b14, b.b00], c_14_0] | let s_14_2 = AdderSum [s_14_1, And[a.b13, b.b01], c_14_1] | let s_14_3 = AdderSum [s_14_2, And[a.b12, b.b02], c_14_2] | let s_14_4 = AdderSum [s_14_3, And[a.b11, b.b03], c_14_3] | let s_14_5 = AdderSum [s_14_4, And[a.b10, b.b04], c_14_4] | let s_14_6 = AdderSum [s_14_5, And[a.b09, b.b05], c_14_5] | let s_14_7 = AdderSum [s_14_6, And[a.b08, b.b06], c_14_6] | let s_14_8 = AdderSum [s_14_7, And[a.b07, b.b07], c_14_7] | let s_14_9 = AdderSum [s_14_8, And[a.b06, b.b08], c_14_8] | let s_14_10 = AdderSum [s_14_9, And[a.b05, b.b09], c_14_9] | let s_14_11 = AdderSum [s_14_10, And[a.b04, b.b10], c_14_10] | let s_14_12 = AdderSum [s_14_11, And[a.b03, b.b11], c_14_11] | let s_14_13 = AdderSum [s_14_12, And[a.b02, b.b12], c_14_12] | let s_14_14 = AdderSum [s_14_13, And[a.b01, b.b13], c_14_13] | let s_14_15 = AdderSum [s_14_14, And[a.b00, b.b14], c_14_14] | let c_15_0 = False | let c_15_1 = AdderCarry[s_14_0, And[a.b14, b.b00], c_14_0] | let c_15_2 = AdderCarry[s_14_1, And[a.b13, b.b01], c_14_1] | let c_15_3 = AdderCarry[s_14_2, And[a.b12, b.b02], c_14_2] | let c_15_4 = AdderCarry[s_14_3, And[a.b11, b.b03], c_14_3] | let c_15_5 = AdderCarry[s_14_4, And[a.b10, b.b04], c_14_4] | let c_15_6 = AdderCarry[s_14_5, And[a.b09, b.b05], c_14_5] | let c_15_7 = AdderCarry[s_14_6, And[a.b08, b.b06], c_14_6] | let c_15_8 = AdderCarry[s_14_7, And[a.b07, b.b07], c_14_7] | let c_15_9 = AdderCarry[s_14_8, And[a.b06, b.b08], c_14_8] | let c_15_10 = AdderCarry[s_14_9, And[a.b05, b.b09], c_14_9] | let c_15_11 = AdderCarry[s_14_10, And[a.b04, b.b10], c_14_10] | let c_15_12 = AdderCarry[s_14_11, And[a.b03, b.b11], c_14_11] | let c_15_13 = AdderCarry[s_14_12, And[a.b02, b.b12], c_14_12] | let c_15_14 = AdderCarry[s_14_13, And[a.b01, b.b13], c_14_13] | let c_15_15 = AdderCarry[s_14_14, And[a.b00, b.b14], c_14_14] | let s_15_0 = False | let s_15_1 = AdderSum [s_15_0, And[a.b15, b.b00], c_15_0] | let s_15_2 = AdderSum [s_15_1, And[a.b14, b.b01], c_15_1] | let s_15_3 = AdderSum [s_15_2, And[a.b13, b.b02], c_15_2] | let s_15_4 = AdderSum [s_15_3, And[a.b12, b.b03], c_15_3] | let s_15_5 = AdderSum [s_15_4, And[a.b11, b.b04], c_15_4] | let s_15_6 = AdderSum [s_15_5, And[a.b10, b.b05], c_15_5] | let s_15_7 = AdderSum [s_15_6, And[a.b09, b.b06], c_15_6] | let s_15_8 = AdderSum [s_15_7, And[a.b08, b.b07], c_15_7] | let s_15_9 = AdderSum [s_15_8, And[a.b07, b.b08], c_15_8] | let s_15_10 = AdderSum [s_15_9, And[a.b06, b.b09], c_15_9] | let s_15_11 = AdderSum [s_15_10, And[a.b05, b.b10], c_15_10] | let s_15_12 = AdderSum [s_15_11, And[a.b04, b.b11], c_15_11] | let s_15_13 = AdderSum [s_15_12, And[a.b03, b.b12], c_15_12] | let s_15_14 = AdderSum [s_15_13, And[a.b02, b.b13], c_15_13] | let s_15_15 = AdderSum [s_15_14, And[a.b01, b.b14], c_15_14] | let s_15_16 = AdderSum [s_15_15, And[a.b00, b.b15], c_15_15] | let c_16_0 = False | let c_16_1 = AdderCarry[s_15_0, And[a.b15, b.b00], c_15_0] | let c_16_2 = AdderCarry[s_15_1, And[a.b14, b.b01], c_15_1] | let c_16_3 = AdderCarry[s_15_2, And[a.b13, b.b02], c_15_2] | let c_16_4 = AdderCarry[s_15_3, And[a.b12, b.b03], c_15_3] | let c_16_5 = AdderCarry[s_15_4, And[a.b11, b.b04], c_15_4] | let c_16_6 = AdderCarry[s_15_5, And[a.b10, b.b05], c_15_5] | let c_16_7 = AdderCarry[s_15_6, And[a.b09, b.b06], c_15_6] | let c_16_8 = AdderCarry[s_15_7, And[a.b08, b.b07], c_15_7] | let c_16_9 = AdderCarry[s_15_8, And[a.b07, b.b08], c_15_8] | let c_16_10 = AdderCarry[s_15_9, And[a.b06, b.b09], c_15_9] | let c_16_11 = AdderCarry[s_15_10, And[a.b05, b.b10], c_15_10] | let c_16_12 = AdderCarry[s_15_11, And[a.b04, b.b11], c_15_11] | let c_16_13 = AdderCarry[s_15_12, And[a.b03, b.b12], c_15_12] | let c_16_14 = AdderCarry[s_15_13, And[a.b02, b.b13], c_15_13] | let c_16_15 = AdderCarry[s_15_14, And[a.b01, b.b14], c_15_14] | let c_16_16 = AdderCarry[s_15_15, And[a.b00, b.b15], c_15_15] | let s_16_0 = False | let s_16_1 = AdderSum [s_16_0, And[a.b16, b.b00], c_16_0] | let s_16_2 = AdderSum [s_16_1, And[a.b15, b.b01], c_16_1] | let s_16_3 = AdderSum [s_16_2, And[a.b14, b.b02], c_16_2] | let s_16_4 = AdderSum [s_16_3, And[a.b13, b.b03], c_16_3] | let s_16_5 = AdderSum [s_16_4, And[a.b12, b.b04], c_16_4] | let s_16_6 = AdderSum [s_16_5, And[a.b11, b.b05], c_16_5] | let s_16_7 = AdderSum [s_16_6, And[a.b10, b.b06], c_16_6] | let s_16_8 = AdderSum [s_16_7, And[a.b09, b.b07], c_16_7] | let s_16_9 = AdderSum [s_16_8, And[a.b08, b.b08], c_16_8] | let s_16_10 = AdderSum [s_16_9, And[a.b07, b.b09], c_16_9] | let s_16_11 = AdderSum [s_16_10, And[a.b06, b.b10], c_16_10] | let s_16_12 = AdderSum [s_16_11, And[a.b05, b.b11], c_16_11] | let s_16_13 = AdderSum [s_16_12, And[a.b04, b.b12], c_16_12] | let s_16_14 = AdderSum [s_16_13, And[a.b03, b.b13], c_16_13] | let s_16_15 = AdderSum [s_16_14, And[a.b02, b.b14], c_16_14] | let s_16_16 = AdderSum [s_16_15, And[a.b01, b.b15], c_16_15] | let s_16_17 = AdderSum [s_16_16, And[a.b00, b.b16], c_16_16] | let c_17_0 = False | let c_17_1 = AdderCarry[s_16_0, And[a.b16, b.b00], c_16_0] | let c_17_2 = AdderCarry[s_16_1, And[a.b15, b.b01], c_16_1] | let c_17_3 = AdderCarry[s_16_2, And[a.b14, b.b02], c_16_2] | let c_17_4 = AdderCarry[s_16_3, And[a.b13, b.b03], c_16_3] | let c_17_5 = AdderCarry[s_16_4, And[a.b12, b.b04], c_16_4] | let c_17_6 = AdderCarry[s_16_5, And[a.b11, b.b05], c_16_5] | let c_17_7 = AdderCarry[s_16_6, And[a.b10, b.b06], c_16_6] | let c_17_8 = AdderCarry[s_16_7, And[a.b09, b.b07], c_16_7] | let c_17_9 = AdderCarry[s_16_8, And[a.b08, b.b08], c_16_8] | let c_17_10 = AdderCarry[s_16_9, And[a.b07, b.b09], c_16_9] | let c_17_11 = AdderCarry[s_16_10, And[a.b06, b.b10], c_16_10] | let c_17_12 = AdderCarry[s_16_11, And[a.b05, b.b11], c_16_11] | let c_17_13 = AdderCarry[s_16_12, And[a.b04, b.b12], c_16_12] | let c_17_14 = AdderCarry[s_16_13, And[a.b03, b.b13], c_16_13] | let c_17_15 = AdderCarry[s_16_14, And[a.b02, b.b14], c_16_14] | let c_17_16 = AdderCarry[s_16_15, And[a.b01, b.b15], c_16_15] | let c_17_17 = AdderCarry[s_16_16, And[a.b00, b.b16], c_16_16] | let s_17_0 = False | let s_17_1 = AdderSum [s_17_0, And[a.b17, b.b00], c_17_0] | let s_17_2 = AdderSum [s_17_1, And[a.b16, b.b01], c_17_1] | let s_17_3 = AdderSum [s_17_2, And[a.b15, b.b02], c_17_2] | let s_17_4 = AdderSum [s_17_3, And[a.b14, b.b03], c_17_3] | let s_17_5 = AdderSum [s_17_4, And[a.b13, b.b04], c_17_4] | let s_17_6 = AdderSum [s_17_5, And[a.b12, b.b05], c_17_5] | let s_17_7 = AdderSum [s_17_6, And[a.b11, b.b06], c_17_6] | let s_17_8 = AdderSum [s_17_7, And[a.b10, b.b07], c_17_7] | let s_17_9 = AdderSum [s_17_8, And[a.b09, b.b08], c_17_8] | let s_17_10 = AdderSum [s_17_9, And[a.b08, b.b09], c_17_9] | let s_17_11 = AdderSum [s_17_10, And[a.b07, b.b10], c_17_10] | let s_17_12 = AdderSum [s_17_11, And[a.b06, b.b11], c_17_11] | let s_17_13 = AdderSum [s_17_12, And[a.b05, b.b12], c_17_12] | let s_17_14 = AdderSum [s_17_13, And[a.b04, b.b13], c_17_13] | let s_17_15 = AdderSum [s_17_14, And[a.b03, b.b14], c_17_14] | let s_17_16 = AdderSum [s_17_15, And[a.b02, b.b15], c_17_15] | let s_17_17 = AdderSum [s_17_16, And[a.b01, b.b16], c_17_16] | let s_17_18 = AdderSum [s_17_17, And[a.b00, b.b17], c_17_17] | let c_18_0 = False | let c_18_1 = AdderCarry[s_17_0, And[a.b17, b.b00], c_17_0] | let c_18_2 = AdderCarry[s_17_1, And[a.b16, b.b01], c_17_1] | let c_18_3 = AdderCarry[s_17_2, And[a.b15, b.b02], c_17_2] | let c_18_4 = AdderCarry[s_17_3, And[a.b14, b.b03], c_17_3] | let c_18_5 = AdderCarry[s_17_4, And[a.b13, b.b04], c_17_4] | let c_18_6 = AdderCarry[s_17_5, And[a.b12, b.b05], c_17_5] | let c_18_7 = AdderCarry[s_17_6, And[a.b11, b.b06], c_17_6] | let c_18_8 = AdderCarry[s_17_7, And[a.b10, b.b07], c_17_7] | let c_18_9 = AdderCarry[s_17_8, And[a.b09, b.b08], c_17_8] | let c_18_10 = AdderCarry[s_17_9, And[a.b08, b.b09], c_17_9] | let c_18_11 = AdderCarry[s_17_10, And[a.b07, b.b10], c_17_10] | let c_18_12 = AdderCarry[s_17_11, And[a.b06, b.b11], c_17_11] | let c_18_13 = AdderCarry[s_17_12, And[a.b05, b.b12], c_17_12] | let c_18_14 = AdderCarry[s_17_13, And[a.b04, b.b13], c_17_13] | let c_18_15 = AdderCarry[s_17_14, And[a.b03, b.b14], c_17_14] | let c_18_16 = AdderCarry[s_17_15, And[a.b02, b.b15], c_17_15] | let c_18_17 = AdderCarry[s_17_16, And[a.b01, b.b16], c_17_16] | let c_18_18 = AdderCarry[s_17_17, And[a.b00, b.b17], c_17_17] | let s_18_0 = False | let s_18_1 = AdderSum [s_18_0, And[a.b18, b.b00], c_18_0] | let s_18_2 = AdderSum [s_18_1, And[a.b17, b.b01], c_18_1] | let s_18_3 = AdderSum [s_18_2, And[a.b16, b.b02], c_18_2] | let s_18_4 = AdderSum [s_18_3, And[a.b15, b.b03], c_18_3] | let s_18_5 = AdderSum [s_18_4, And[a.b14, b.b04], c_18_4] | let s_18_6 = AdderSum [s_18_5, And[a.b13, b.b05], c_18_5] | let s_18_7 = AdderSum [s_18_6, And[a.b12, b.b06], c_18_6] | let s_18_8 = AdderSum [s_18_7, And[a.b11, b.b07], c_18_7] | let s_18_9 = AdderSum [s_18_8, And[a.b10, b.b08], c_18_8] | let s_18_10 = AdderSum [s_18_9, And[a.b09, b.b09], c_18_9] | let s_18_11 = AdderSum [s_18_10, And[a.b08, b.b10], c_18_10] | let s_18_12 = AdderSum [s_18_11, And[a.b07, b.b11], c_18_11] | let s_18_13 = AdderSum [s_18_12, And[a.b06, b.b12], c_18_12] | let s_18_14 = AdderSum [s_18_13, And[a.b05, b.b13], c_18_13] | let s_18_15 = AdderSum [s_18_14, And[a.b04, b.b14], c_18_14] | let s_18_16 = AdderSum [s_18_15, And[a.b03, b.b15], c_18_15] | let s_18_17 = AdderSum [s_18_16, And[a.b02, b.b16], c_18_16] | let s_18_18 = AdderSum [s_18_17, And[a.b01, b.b17], c_18_17] | let s_18_19 = AdderSum [s_18_18, And[a.b00, b.b18], c_18_18] | let c_19_0 = False | let c_19_1 = AdderCarry[s_18_0, And[a.b18, b.b00], c_18_0] | let c_19_2 = AdderCarry[s_18_1, And[a.b17, b.b01], c_18_1] | let c_19_3 = AdderCarry[s_18_2, And[a.b16, b.b02], c_18_2] | let c_19_4 = AdderCarry[s_18_3, And[a.b15, b.b03], c_18_3] | let c_19_5 = AdderCarry[s_18_4, And[a.b14, b.b04], c_18_4] | let c_19_6 = AdderCarry[s_18_5, And[a.b13, b.b05], c_18_5] | let c_19_7 = AdderCarry[s_18_6, And[a.b12, b.b06], c_18_6] | let c_19_8 = AdderCarry[s_18_7, And[a.b11, b.b07], c_18_7] | let c_19_9 = AdderCarry[s_18_8, And[a.b10, b.b08], c_18_8] | let c_19_10 = AdderCarry[s_18_9, And[a.b09, b.b09], c_18_9] | let c_19_11 = AdderCarry[s_18_10, And[a.b08, b.b10], c_18_10] | let c_19_12 = AdderCarry[s_18_11, And[a.b07, b.b11], c_18_11] | let c_19_13 = AdderCarry[s_18_12, And[a.b06, b.b12], c_18_12] | let c_19_14 = AdderCarry[s_18_13, And[a.b05, b.b13], c_18_13] | let c_19_15 = AdderCarry[s_18_14, And[a.b04, b.b14], c_18_14] | let c_19_16 = AdderCarry[s_18_15, And[a.b03, b.b15], c_18_15] | let c_19_17 = AdderCarry[s_18_16, And[a.b02, b.b16], c_18_16] | let c_19_18 = AdderCarry[s_18_17, And[a.b01, b.b17], c_18_17] | let c_19_19 = AdderCarry[s_18_18, And[a.b00, b.b18], c_18_18] | let s_19_0 = False | let s_19_1 = AdderSum [s_19_0, And[a.b19, b.b00], c_19_0] | let s_19_2 = AdderSum [s_19_1, And[a.b18, b.b01], c_19_1] | let s_19_3 = AdderSum [s_19_2, And[a.b17, b.b02], c_19_2] | let s_19_4 = AdderSum [s_19_3, And[a.b16, b.b03], c_19_3] | let s_19_5 = AdderSum [s_19_4, And[a.b15, b.b04], c_19_4] | let s_19_6 = AdderSum [s_19_5, And[a.b14, b.b05], c_19_5] | let s_19_7 = AdderSum [s_19_6, And[a.b13, b.b06], c_19_6] | let s_19_8 = AdderSum [s_19_7, And[a.b12, b.b07], c_19_7] | let s_19_9 = AdderSum [s_19_8, And[a.b11, b.b08], c_19_8] | let s_19_10 = AdderSum [s_19_9, And[a.b10, b.b09], c_19_9] | let s_19_11 = AdderSum [s_19_10, And[a.b09, b.b10], c_19_10] | let s_19_12 = AdderSum [s_19_11, And[a.b08, b.b11], c_19_11] | let s_19_13 = AdderSum [s_19_12, And[a.b07, b.b12], c_19_12] | let s_19_14 = AdderSum [s_19_13, And[a.b06, b.b13], c_19_13] | let s_19_15 = AdderSum [s_19_14, And[a.b05, b.b14], c_19_14] | let s_19_16 = AdderSum [s_19_15, And[a.b04, b.b15], c_19_15] | let s_19_17 = AdderSum [s_19_16, And[a.b03, b.b16], c_19_16] | let s_19_18 = AdderSum [s_19_17, And[a.b02, b.b17], c_19_17] | let s_19_19 = AdderSum [s_19_18, And[a.b01, b.b18], c_19_18] | let s_19_20 = AdderSum [s_19_19, And[a.b00, b.b19], c_19_19] | let c_20_0 = False | let c_20_1 = AdderCarry[s_19_0, And[a.b19, b.b00], c_19_0] | let c_20_2 = AdderCarry[s_19_1, And[a.b18, b.b01], c_19_1] | let c_20_3 = AdderCarry[s_19_2, And[a.b17, b.b02], c_19_2] | let c_20_4 = AdderCarry[s_19_3, And[a.b16, b.b03], c_19_3] | let c_20_5 = AdderCarry[s_19_4, And[a.b15, b.b04], c_19_4] | let c_20_6 = AdderCarry[s_19_5, And[a.b14, b.b05], c_19_5] | let c_20_7 = AdderCarry[s_19_6, And[a.b13, b.b06], c_19_6] | let c_20_8 = AdderCarry[s_19_7, And[a.b12, b.b07], c_19_7] | let c_20_9 = AdderCarry[s_19_8, And[a.b11, b.b08], c_19_8] | let c_20_10 = AdderCarry[s_19_9, And[a.b10, b.b09], c_19_9] | let c_20_11 = AdderCarry[s_19_10, And[a.b09, b.b10], c_19_10] | let c_20_12 = AdderCarry[s_19_11, And[a.b08, b.b11], c_19_11] | let c_20_13 = AdderCarry[s_19_12, And[a.b07, b.b12], c_19_12] | let c_20_14 = AdderCarry[s_19_13, And[a.b06, b.b13], c_19_13] | let c_20_15 = AdderCarry[s_19_14, And[a.b05, b.b14], c_19_14] | let c_20_16 = AdderCarry[s_19_15, And[a.b04, b.b15], c_19_15] | let c_20_17 = AdderCarry[s_19_16, And[a.b03, b.b16], c_19_16] | let c_20_18 = AdderCarry[s_19_17, And[a.b02, b.b17], c_19_17] | let c_20_19 = AdderCarry[s_19_18, And[a.b01, b.b18], c_19_18] | let c_20_20 = AdderCarry[s_19_19, And[a.b00, b.b19], c_19_19] | let s_20_0 = False | let s_20_1 = AdderSum [s_20_0, And[a.b20, b.b00], c_20_0] | let s_20_2 = AdderSum [s_20_1, And[a.b19, b.b01], c_20_1] | let s_20_3 = AdderSum [s_20_2, And[a.b18, b.b02], c_20_2] | let s_20_4 = AdderSum [s_20_3, And[a.b17, b.b03], c_20_3] | let s_20_5 = AdderSum [s_20_4, And[a.b16, b.b04], c_20_4] | let s_20_6 = AdderSum [s_20_5, And[a.b15, b.b05], c_20_5] | let s_20_7 = AdderSum [s_20_6, And[a.b14, b.b06], c_20_6] | let s_20_8 = AdderSum [s_20_7, And[a.b13, b.b07], c_20_7] | let s_20_9 = AdderSum [s_20_8, And[a.b12, b.b08], c_20_8] | let s_20_10 = AdderSum [s_20_9, And[a.b11, b.b09], c_20_9] | let s_20_11 = AdderSum [s_20_10, And[a.b10, b.b10], c_20_10] | let s_20_12 = AdderSum [s_20_11, And[a.b09, b.b11], c_20_11] | let s_20_13 = AdderSum [s_20_12, And[a.b08, b.b12], c_20_12] | let s_20_14 = AdderSum [s_20_13, And[a.b07, b.b13], c_20_13] | let s_20_15 = AdderSum [s_20_14, And[a.b06, b.b14], c_20_14] | let s_20_16 = AdderSum [s_20_15, And[a.b05, b.b15], c_20_15] | let s_20_17 = AdderSum [s_20_16, And[a.b04, b.b16], c_20_16] | let s_20_18 = AdderSum [s_20_17, And[a.b03, b.b17], c_20_17] | let s_20_19 = AdderSum [s_20_18, And[a.b02, b.b18], c_20_18] | let s_20_20 = AdderSum [s_20_19, And[a.b01, b.b19], c_20_19] | let s_20_21 = AdderSum [s_20_20, And[a.b00, b.b20], c_20_20] | let c_21_0 = False | let c_21_1 = AdderCarry[s_20_0, And[a.b20, b.b00], c_20_0] | let c_21_2 = AdderCarry[s_20_1, And[a.b19, b.b01], c_20_1] | let c_21_3 = AdderCarry[s_20_2, And[a.b18, b.b02], c_20_2] | let c_21_4 = AdderCarry[s_20_3, And[a.b17, b.b03], c_20_3] | let c_21_5 = AdderCarry[s_20_4, And[a.b16, b.b04], c_20_4] | let c_21_6 = AdderCarry[s_20_5, And[a.b15, b.b05], c_20_5] | let c_21_7 = AdderCarry[s_20_6, And[a.b14, b.b06], c_20_6] | let c_21_8 = AdderCarry[s_20_7, And[a.b13, b.b07], c_20_7] | let c_21_9 = AdderCarry[s_20_8, And[a.b12, b.b08], c_20_8] | let c_21_10 = AdderCarry[s_20_9, And[a.b11, b.b09], c_20_9] | let c_21_11 = AdderCarry[s_20_10, And[a.b10, b.b10], c_20_10] | let c_21_12 = AdderCarry[s_20_11, And[a.b09, b.b11], c_20_11] | let c_21_13 = AdderCarry[s_20_12, And[a.b08, b.b12], c_20_12] | let c_21_14 = AdderCarry[s_20_13, And[a.b07, b.b13], c_20_13] | let c_21_15 = AdderCarry[s_20_14, And[a.b06, b.b14], c_20_14] | let c_21_16 = AdderCarry[s_20_15, And[a.b05, b.b15], c_20_15] | let c_21_17 = AdderCarry[s_20_16, And[a.b04, b.b16], c_20_16] | let c_21_18 = AdderCarry[s_20_17, And[a.b03, b.b17], c_20_17] | let c_21_19 = AdderCarry[s_20_18, And[a.b02, b.b18], c_20_18] | let c_21_20 = AdderCarry[s_20_19, And[a.b01, b.b19], c_20_19] | let c_21_21 = AdderCarry[s_20_20, And[a.b00, b.b20], c_20_20] | let s_21_0 = False | let s_21_1 = AdderSum [s_21_0, And[a.b21, b.b00], c_21_0] | let s_21_2 = AdderSum [s_21_1, And[a.b20, b.b01], c_21_1] | let s_21_3 = AdderSum [s_21_2, And[a.b19, b.b02], c_21_2] | let s_21_4 = AdderSum [s_21_3, And[a.b18, b.b03], c_21_3] | let s_21_5 = AdderSum [s_21_4, And[a.b17, b.b04], c_21_4] | let s_21_6 = AdderSum [s_21_5, And[a.b16, b.b05], c_21_5] | let s_21_7 = AdderSum [s_21_6, And[a.b15, b.b06], c_21_6] | let s_21_8 = AdderSum [s_21_7, And[a.b14, b.b07], c_21_7] | let s_21_9 = AdderSum [s_21_8, And[a.b13, b.b08], c_21_8] | let s_21_10 = AdderSum [s_21_9, And[a.b12, b.b09], c_21_9] | let s_21_11 = AdderSum [s_21_10, And[a.b11, b.b10], c_21_10] | let s_21_12 = AdderSum [s_21_11, And[a.b10, b.b11], c_21_11] | let s_21_13 = AdderSum [s_21_12, And[a.b09, b.b12], c_21_12] | let s_21_14 = AdderSum [s_21_13, And[a.b08, b.b13], c_21_13] | let s_21_15 = AdderSum [s_21_14, And[a.b07, b.b14], c_21_14] | let s_21_16 = AdderSum [s_21_15, And[a.b06, b.b15], c_21_15] | let s_21_17 = AdderSum [s_21_16, And[a.b05, b.b16], c_21_16] | let s_21_18 = AdderSum [s_21_17, And[a.b04, b.b17], c_21_17] | let s_21_19 = AdderSum [s_21_18, And[a.b03, b.b18], c_21_18] | let s_21_20 = AdderSum [s_21_19, And[a.b02, b.b19], c_21_19] | let s_21_21 = AdderSum [s_21_20, And[a.b01, b.b20], c_21_20] | let s_21_22 = AdderSum [s_21_21, And[a.b00, b.b21], c_21_21] | let c_22_0 = False | let c_22_1 = AdderCarry[s_21_0, And[a.b21, b.b00], c_21_0] | let c_22_2 = AdderCarry[s_21_1, And[a.b20, b.b01], c_21_1] | let c_22_3 = AdderCarry[s_21_2, And[a.b19, b.b02], c_21_2] | let c_22_4 = AdderCarry[s_21_3, And[a.b18, b.b03], c_21_3] | let c_22_5 = AdderCarry[s_21_4, And[a.b17, b.b04], c_21_4] | let c_22_6 = AdderCarry[s_21_5, And[a.b16, b.b05], c_21_5] | let c_22_7 = AdderCarry[s_21_6, And[a.b15, b.b06], c_21_6] | let c_22_8 = AdderCarry[s_21_7, And[a.b14, b.b07], c_21_7] | let c_22_9 = AdderCarry[s_21_8, And[a.b13, b.b08], c_21_8] | let c_22_10 = AdderCarry[s_21_9, And[a.b12, b.b09], c_21_9] | let c_22_11 = AdderCarry[s_21_10, And[a.b11, b.b10], c_21_10] | let c_22_12 = AdderCarry[s_21_11, And[a.b10, b.b11], c_21_11] | let c_22_13 = AdderCarry[s_21_12, And[a.b09, b.b12], c_21_12] | let c_22_14 = AdderCarry[s_21_13, And[a.b08, b.b13], c_21_13] | let c_22_15 = AdderCarry[s_21_14, And[a.b07, b.b14], c_21_14] | let c_22_16 = AdderCarry[s_21_15, And[a.b06, b.b15], c_21_15] | let c_22_17 = AdderCarry[s_21_16, And[a.b05, b.b16], c_21_16] | let c_22_18 = AdderCarry[s_21_17, And[a.b04, b.b17], c_21_17] | let c_22_19 = AdderCarry[s_21_18, And[a.b03, b.b18], c_21_18] | let c_22_20 = AdderCarry[s_21_19, And[a.b02, b.b19], c_21_19] | let c_22_21 = AdderCarry[s_21_20, And[a.b01, b.b20], c_21_20] | let c_22_22 = AdderCarry[s_21_21, And[a.b00, b.b21], c_21_21] | let s_22_0 = False | let s_22_1 = AdderSum [s_22_0, And[a.b22, b.b00], c_22_0] | let s_22_2 = AdderSum [s_22_1, And[a.b21, b.b01], c_22_1] | let s_22_3 = AdderSum [s_22_2, And[a.b20, b.b02], c_22_2] | let s_22_4 = AdderSum [s_22_3, And[a.b19, b.b03], c_22_3] | let s_22_5 = AdderSum [s_22_4, And[a.b18, b.b04], c_22_4] | let s_22_6 = AdderSum [s_22_5, And[a.b17, b.b05], c_22_5] | let s_22_7 = AdderSum [s_22_6, And[a.b16, b.b06], c_22_6] | let s_22_8 = AdderSum [s_22_7, And[a.b15, b.b07], c_22_7] | let s_22_9 = AdderSum [s_22_8, And[a.b14, b.b08], c_22_8] | let s_22_10 = AdderSum [s_22_9, And[a.b13, b.b09], c_22_9] | let s_22_11 = AdderSum [s_22_10, And[a.b12, b.b10], c_22_10] | let s_22_12 = AdderSum [s_22_11, And[a.b11, b.b11], c_22_11] | let s_22_13 = AdderSum [s_22_12, And[a.b10, b.b12], c_22_12] | let s_22_14 = AdderSum [s_22_13, And[a.b09, b.b13], c_22_13] | let s_22_15 = AdderSum [s_22_14, And[a.b08, b.b14], c_22_14] | let s_22_16 = AdderSum [s_22_15, And[a.b07, b.b15], c_22_15] | let s_22_17 = AdderSum [s_22_16, And[a.b06, b.b16], c_22_16] | let s_22_18 = AdderSum [s_22_17, And[a.b05, b.b17], c_22_17] | let s_22_19 = AdderSum [s_22_18, And[a.b04, b.b18], c_22_18] | let s_22_20 = AdderSum [s_22_19, And[a.b03, b.b19], c_22_19] | let s_22_21 = AdderSum [s_22_20, And[a.b02, b.b20], c_22_20] | let s_22_22 = AdderSum [s_22_21, And[a.b01, b.b21], c_22_21] | let s_22_23 = AdderSum [s_22_22, And[a.b00, b.b22], c_22_22] | let c_23_0 = False | let c_23_1 = AdderCarry[s_22_0, And[a.b22, b.b00], c_22_0] | let c_23_2 = AdderCarry[s_22_1, And[a.b21, b.b01], c_22_1] | let c_23_3 = AdderCarry[s_22_2, And[a.b20, b.b02], c_22_2] | let c_23_4 = AdderCarry[s_22_3, And[a.b19, b.b03], c_22_3] | let c_23_5 = AdderCarry[s_22_4, And[a.b18, b.b04], c_22_4] | let c_23_6 = AdderCarry[s_22_5, And[a.b17, b.b05], c_22_5] | let c_23_7 = AdderCarry[s_22_6, And[a.b16, b.b06], c_22_6] | let c_23_8 = AdderCarry[s_22_7, And[a.b15, b.b07], c_22_7] | let c_23_9 = AdderCarry[s_22_8, And[a.b14, b.b08], c_22_8] | let c_23_10 = AdderCarry[s_22_9, And[a.b13, b.b09], c_22_9] | let c_23_11 = AdderCarry[s_22_10, And[a.b12, b.b10], c_22_10] | let c_23_12 = AdderCarry[s_22_11, And[a.b11, b.b11], c_22_11] | let c_23_13 = AdderCarry[s_22_12, And[a.b10, b.b12], c_22_12] | let c_23_14 = AdderCarry[s_22_13, And[a.b09, b.b13], c_22_13] | let c_23_15 = AdderCarry[s_22_14, And[a.b08, b.b14], c_22_14] | let c_23_16 = AdderCarry[s_22_15, And[a.b07, b.b15], c_22_15] | let c_23_17 = AdderCarry[s_22_16, And[a.b06, b.b16], c_22_16] | let c_23_18 = AdderCarry[s_22_17, And[a.b05, b.b17], c_22_17] | let c_23_19 = AdderCarry[s_22_18, And[a.b04, b.b18], c_22_18] | let c_23_20 = AdderCarry[s_22_19, And[a.b03, b.b19], c_22_19] | let c_23_21 = AdderCarry[s_22_20, And[a.b02, b.b20], c_22_20] | let c_23_22 = AdderCarry[s_22_21, And[a.b01, b.b21], c_22_21] | let c_23_23 = AdderCarry[s_22_22, And[a.b00, b.b22], c_22_22] | let s_23_0 = False | let s_23_1 = AdderSum [s_23_0, And[a.b23, b.b00], c_23_0] | let s_23_2 = AdderSum [s_23_1, And[a.b22, b.b01], c_23_1] | let s_23_3 = AdderSum [s_23_2, And[a.b21, b.b02], c_23_2] | let s_23_4 = AdderSum [s_23_3, And[a.b20, b.b03], c_23_3] | let s_23_5 = AdderSum [s_23_4, And[a.b19, b.b04], c_23_4] | let s_23_6 = AdderSum [s_23_5, And[a.b18, b.b05], c_23_5] | let s_23_7 = AdderSum [s_23_6, And[a.b17, b.b06], c_23_6] | let s_23_8 = AdderSum [s_23_7, And[a.b16, b.b07], c_23_7] | let s_23_9 = AdderSum [s_23_8, And[a.b15, b.b08], c_23_8] | let s_23_10 = AdderSum [s_23_9, And[a.b14, b.b09], c_23_9] | let s_23_11 = AdderSum [s_23_10, And[a.b13, b.b10], c_23_10] | let s_23_12 = AdderSum [s_23_11, And[a.b12, b.b11], c_23_11] | let s_23_13 = AdderSum [s_23_12, And[a.b11, b.b12], c_23_12] | let s_23_14 = AdderSum [s_23_13, And[a.b10, b.b13], c_23_13] | let s_23_15 = AdderSum [s_23_14, And[a.b09, b.b14], c_23_14] | let s_23_16 = AdderSum [s_23_15, And[a.b08, b.b15], c_23_15] | let s_23_17 = AdderSum [s_23_16, And[a.b07, b.b16], c_23_16] | let s_23_18 = AdderSum [s_23_17, And[a.b06, b.b17], c_23_17] | let s_23_19 = AdderSum [s_23_18, And[a.b05, b.b18], c_23_18] | let s_23_20 = AdderSum [s_23_19, And[a.b04, b.b19], c_23_19] | let s_23_21 = AdderSum [s_23_20, And[a.b03, b.b20], c_23_20] | let s_23_22 = AdderSum [s_23_21, And[a.b02, b.b21], c_23_21] | let s_23_23 = AdderSum [s_23_22, And[a.b01, b.b22], c_23_22] | let s_23_24 = AdderSum [s_23_23, And[a.b00, b.b23], c_23_23] | let c_24_0 = False | let c_24_1 = AdderCarry[s_23_0, And[a.b23, b.b00], c_23_0] | let c_24_2 = AdderCarry[s_23_1, And[a.b22, b.b01], c_23_1] | let c_24_3 = AdderCarry[s_23_2, And[a.b21, b.b02], c_23_2] | let c_24_4 = AdderCarry[s_23_3, And[a.b20, b.b03], c_23_3] | let c_24_5 = AdderCarry[s_23_4, And[a.b19, b.b04], c_23_4] | let c_24_6 = AdderCarry[s_23_5, And[a.b18, b.b05], c_23_5] | let c_24_7 = AdderCarry[s_23_6, And[a.b17, b.b06], c_23_6] | let c_24_8 = AdderCarry[s_23_7, And[a.b16, b.b07], c_23_7] | let c_24_9 = AdderCarry[s_23_8, And[a.b15, b.b08], c_23_8] | let c_24_10 = AdderCarry[s_23_9, And[a.b14, b.b09], c_23_9] | let c_24_11 = AdderCarry[s_23_10, And[a.b13, b.b10], c_23_10] | let c_24_12 = AdderCarry[s_23_11, And[a.b12, b.b11], c_23_11] | let c_24_13 = AdderCarry[s_23_12, And[a.b11, b.b12], c_23_12] | let c_24_14 = AdderCarry[s_23_13, And[a.b10, b.b13], c_23_13] | let c_24_15 = AdderCarry[s_23_14, And[a.b09, b.b14], c_23_14] | let c_24_16 = AdderCarry[s_23_15, And[a.b08, b.b15], c_23_15] | let c_24_17 = AdderCarry[s_23_16, And[a.b07, b.b16], c_23_16] | let c_24_18 = AdderCarry[s_23_17, And[a.b06, b.b17], c_23_17] | let c_24_19 = AdderCarry[s_23_18, And[a.b05, b.b18], c_23_18] | let c_24_20 = AdderCarry[s_23_19, And[a.b04, b.b19], c_23_19] | let c_24_21 = AdderCarry[s_23_20, And[a.b03, b.b20], c_23_20] | let c_24_22 = AdderCarry[s_23_21, And[a.b02, b.b21], c_23_21] | let c_24_23 = AdderCarry[s_23_22, And[a.b01, b.b22], c_23_22] | let c_24_24 = AdderCarry[s_23_23, And[a.b00, b.b23], c_23_23] | let s_24_0 = False | let s_24_1 = AdderSum [s_24_0, And[a.b24, b.b00], c_24_0] | let s_24_2 = AdderSum [s_24_1, And[a.b23, b.b01], c_24_1] | let s_24_3 = AdderSum [s_24_2, And[a.b22, b.b02], c_24_2] | let s_24_4 = AdderSum [s_24_3, And[a.b21, b.b03], c_24_3] | let s_24_5 = AdderSum [s_24_4, And[a.b20, b.b04], c_24_4] | let s_24_6 = AdderSum [s_24_5, And[a.b19, b.b05], c_24_5] | let s_24_7 = AdderSum [s_24_6, And[a.b18, b.b06], c_24_6] | let s_24_8 = AdderSum [s_24_7, And[a.b17, b.b07], c_24_7] | let s_24_9 = AdderSum [s_24_8, And[a.b16, b.b08], c_24_8] | let s_24_10 = AdderSum [s_24_9, And[a.b15, b.b09], c_24_9] | let s_24_11 = AdderSum [s_24_10, And[a.b14, b.b10], c_24_10] | let s_24_12 = AdderSum [s_24_11, And[a.b13, b.b11], c_24_11] | let s_24_13 = AdderSum [s_24_12, And[a.b12, b.b12], c_24_12] | let s_24_14 = AdderSum [s_24_13, And[a.b11, b.b13], c_24_13] | let s_24_15 = AdderSum [s_24_14, And[a.b10, b.b14], c_24_14] | let s_24_16 = AdderSum [s_24_15, And[a.b09, b.b15], c_24_15] | let s_24_17 = AdderSum [s_24_16, And[a.b08, b.b16], c_24_16] | let s_24_18 = AdderSum [s_24_17, And[a.b07, b.b17], c_24_17] | let s_24_19 = AdderSum [s_24_18, And[a.b06, b.b18], c_24_18] | let s_24_20 = AdderSum [s_24_19, And[a.b05, b.b19], c_24_19] | let s_24_21 = AdderSum [s_24_20, And[a.b04, b.b20], c_24_20] | let s_24_22 = AdderSum [s_24_21, And[a.b03, b.b21], c_24_21] | let s_24_23 = AdderSum [s_24_22, And[a.b02, b.b22], c_24_22] | let s_24_24 = AdderSum [s_24_23, And[a.b01, b.b23], c_24_23] | let s_24_25 = AdderSum [s_24_24, And[a.b00, b.b24], c_24_24] | let c_25_0 = False | let c_25_1 = AdderCarry[s_24_0, And[a.b24, b.b00], c_24_0] | let c_25_2 = AdderCarry[s_24_1, And[a.b23, b.b01], c_24_1] | let c_25_3 = AdderCarry[s_24_2, And[a.b22, b.b02], c_24_2] | let c_25_4 = AdderCarry[s_24_3, And[a.b21, b.b03], c_24_3] | let c_25_5 = AdderCarry[s_24_4, And[a.b20, b.b04], c_24_4] | let c_25_6 = AdderCarry[s_24_5, And[a.b19, b.b05], c_24_5] | let c_25_7 = AdderCarry[s_24_6, And[a.b18, b.b06], c_24_6] | let c_25_8 = AdderCarry[s_24_7, And[a.b17, b.b07], c_24_7] | let c_25_9 = AdderCarry[s_24_8, And[a.b16, b.b08], c_24_8] | let c_25_10 = AdderCarry[s_24_9, And[a.b15, b.b09], c_24_9] | let c_25_11 = AdderCarry[s_24_10, And[a.b14, b.b10], c_24_10] | let c_25_12 = AdderCarry[s_24_11, And[a.b13, b.b11], c_24_11] | let c_25_13 = AdderCarry[s_24_12, And[a.b12, b.b12], c_24_12] | let c_25_14 = AdderCarry[s_24_13, And[a.b11, b.b13], c_24_13] | let c_25_15 = AdderCarry[s_24_14, And[a.b10, b.b14], c_24_14] | let c_25_16 = AdderCarry[s_24_15, And[a.b09, b.b15], c_24_15] | let c_25_17 = AdderCarry[s_24_16, And[a.b08, b.b16], c_24_16] | let c_25_18 = AdderCarry[s_24_17, And[a.b07, b.b17], c_24_17] | let c_25_19 = AdderCarry[s_24_18, And[a.b06, b.b18], c_24_18] | let c_25_20 = AdderCarry[s_24_19, And[a.b05, b.b19], c_24_19] | let c_25_21 = AdderCarry[s_24_20, And[a.b04, b.b20], c_24_20] | let c_25_22 = AdderCarry[s_24_21, And[a.b03, b.b21], c_24_21] | let c_25_23 = AdderCarry[s_24_22, And[a.b02, b.b22], c_24_22] | let c_25_24 = AdderCarry[s_24_23, And[a.b01, b.b23], c_24_23] | let c_25_25 = AdderCarry[s_24_24, And[a.b00, b.b24], c_24_24] | let s_25_0 = False | let s_25_1 = AdderSum [s_25_0, And[a.b25, b.b00], c_25_0] | let s_25_2 = AdderSum [s_25_1, And[a.b24, b.b01], c_25_1] | let s_25_3 = AdderSum [s_25_2, And[a.b23, b.b02], c_25_2] | let s_25_4 = AdderSum [s_25_3, And[a.b22, b.b03], c_25_3] | let s_25_5 = AdderSum [s_25_4, And[a.b21, b.b04], c_25_4] | let s_25_6 = AdderSum [s_25_5, And[a.b20, b.b05], c_25_5] | let s_25_7 = AdderSum [s_25_6, And[a.b19, b.b06], c_25_6] | let s_25_8 = AdderSum [s_25_7, And[a.b18, b.b07], c_25_7] | let s_25_9 = AdderSum [s_25_8, And[a.b17, b.b08], c_25_8] | let s_25_10 = AdderSum [s_25_9, And[a.b16, b.b09], c_25_9] | let s_25_11 = AdderSum [s_25_10, And[a.b15, b.b10], c_25_10] | let s_25_12 = AdderSum [s_25_11, And[a.b14, b.b11], c_25_11] | let s_25_13 = AdderSum [s_25_12, And[a.b13, b.b12], c_25_12] | let s_25_14 = AdderSum [s_25_13, And[a.b12, b.b13], c_25_13] | let s_25_15 = AdderSum [s_25_14, And[a.b11, b.b14], c_25_14] | let s_25_16 = AdderSum [s_25_15, And[a.b10, b.b15], c_25_15] | let s_25_17 = AdderSum [s_25_16, And[a.b09, b.b16], c_25_16] | let s_25_18 = AdderSum [s_25_17, And[a.b08, b.b17], c_25_17] | let s_25_19 = AdderSum [s_25_18, And[a.b07, b.b18], c_25_18] | let s_25_20 = AdderSum [s_25_19, And[a.b06, b.b19], c_25_19] | let s_25_21 = AdderSum [s_25_20, And[a.b05, b.b20], c_25_20] | let s_25_22 = AdderSum [s_25_21, And[a.b04, b.b21], c_25_21] | let s_25_23 = AdderSum [s_25_22, And[a.b03, b.b22], c_25_22] | let s_25_24 = AdderSum [s_25_23, And[a.b02, b.b23], c_25_23] | let s_25_25 = AdderSum [s_25_24, And[a.b01, b.b24], c_25_24] | let s_25_26 = AdderSum [s_25_25, And[a.b00, b.b25], c_25_25] | let c_26_0 = False | let c_26_1 = AdderCarry[s_25_0, And[a.b25, b.b00], c_25_0] | let c_26_2 = AdderCarry[s_25_1, And[a.b24, b.b01], c_25_1] | let c_26_3 = AdderCarry[s_25_2, And[a.b23, b.b02], c_25_2] | let c_26_4 = AdderCarry[s_25_3, And[a.b22, b.b03], c_25_3] | let c_26_5 = AdderCarry[s_25_4, And[a.b21, b.b04], c_25_4] | let c_26_6 = AdderCarry[s_25_5, And[a.b20, b.b05], c_25_5] | let c_26_7 = AdderCarry[s_25_6, And[a.b19, b.b06], c_25_6] | let c_26_8 = AdderCarry[s_25_7, And[a.b18, b.b07], c_25_7] | let c_26_9 = AdderCarry[s_25_8, And[a.b17, b.b08], c_25_8] | let c_26_10 = AdderCarry[s_25_9, And[a.b16, b.b09], c_25_9] | let c_26_11 = AdderCarry[s_25_10, And[a.b15, b.b10], c_25_10] | let c_26_12 = AdderCarry[s_25_11, And[a.b14, b.b11], c_25_11] | let c_26_13 = AdderCarry[s_25_12, And[a.b13, b.b12], c_25_12] | let c_26_14 = AdderCarry[s_25_13, And[a.b12, b.b13], c_25_13] | let c_26_15 = AdderCarry[s_25_14, And[a.b11, b.b14], c_25_14] | let c_26_16 = AdderCarry[s_25_15, And[a.b10, b.b15], c_25_15] | let c_26_17 = AdderCarry[s_25_16, And[a.b09, b.b16], c_25_16] | let c_26_18 = AdderCarry[s_25_17, And[a.b08, b.b17], c_25_17] | let c_26_19 = AdderCarry[s_25_18, And[a.b07, b.b18], c_25_18] | let c_26_20 = AdderCarry[s_25_19, And[a.b06, b.b19], c_25_19] | let c_26_21 = AdderCarry[s_25_20, And[a.b05, b.b20], c_25_20] | let c_26_22 = AdderCarry[s_25_21, And[a.b04, b.b21], c_25_21] | let c_26_23 = AdderCarry[s_25_22, And[a.b03, b.b22], c_25_22] | let c_26_24 = AdderCarry[s_25_23, And[a.b02, b.b23], c_25_23] | let c_26_25 = AdderCarry[s_25_24, And[a.b01, b.b24], c_25_24] | let c_26_26 = AdderCarry[s_25_25, And[a.b00, b.b25], c_25_25] | let s_26_0 = False | let s_26_1 = AdderSum [s_26_0, And[a.b26, b.b00], c_26_0] | let s_26_2 = AdderSum [s_26_1, And[a.b25, b.b01], c_26_1] | let s_26_3 = AdderSum [s_26_2, And[a.b24, b.b02], c_26_2] | let s_26_4 = AdderSum [s_26_3, And[a.b23, b.b03], c_26_3] | let s_26_5 = AdderSum [s_26_4, And[a.b22, b.b04], c_26_4] | let s_26_6 = AdderSum [s_26_5, And[a.b21, b.b05], c_26_5] | let s_26_7 = AdderSum [s_26_6, And[a.b20, b.b06], c_26_6] | let s_26_8 = AdderSum [s_26_7, And[a.b19, b.b07], c_26_7] | let s_26_9 = AdderSum [s_26_8, And[a.b18, b.b08], c_26_8] | let s_26_10 = AdderSum [s_26_9, And[a.b17, b.b09], c_26_9] | let s_26_11 = AdderSum [s_26_10, And[a.b16, b.b10], c_26_10] | let s_26_12 = AdderSum [s_26_11, And[a.b15, b.b11], c_26_11] | let s_26_13 = AdderSum [s_26_12, And[a.b14, b.b12], c_26_12] | let s_26_14 = AdderSum [s_26_13, And[a.b13, b.b13], c_26_13] | let s_26_15 = AdderSum [s_26_14, And[a.b12, b.b14], c_26_14] | let s_26_16 = AdderSum [s_26_15, And[a.b11, b.b15], c_26_15] | let s_26_17 = AdderSum [s_26_16, And[a.b10, b.b16], c_26_16] | let s_26_18 = AdderSum [s_26_17, And[a.b09, b.b17], c_26_17] | let s_26_19 = AdderSum [s_26_18, And[a.b08, b.b18], c_26_18] | let s_26_20 = AdderSum [s_26_19, And[a.b07, b.b19], c_26_19] | let s_26_21 = AdderSum [s_26_20, And[a.b06, b.b20], c_26_20] | let s_26_22 = AdderSum [s_26_21, And[a.b05, b.b21], c_26_21] | let s_26_23 = AdderSum [s_26_22, And[a.b04, b.b22], c_26_22] | let s_26_24 = AdderSum [s_26_23, And[a.b03, b.b23], c_26_23] | let s_26_25 = AdderSum [s_26_24, And[a.b02, b.b24], c_26_24] | let s_26_26 = AdderSum [s_26_25, And[a.b01, b.b25], c_26_25] | let s_26_27 = AdderSum [s_26_26, And[a.b00, b.b26], c_26_26] | let c_27_0 = False | let c_27_1 = AdderCarry[s_26_0, And[a.b26, b.b00], c_26_0] | let c_27_2 = AdderCarry[s_26_1, And[a.b25, b.b01], c_26_1] | let c_27_3 = AdderCarry[s_26_2, And[a.b24, b.b02], c_26_2] | let c_27_4 = AdderCarry[s_26_3, And[a.b23, b.b03], c_26_3] | let c_27_5 = AdderCarry[s_26_4, And[a.b22, b.b04], c_26_4] | let c_27_6 = AdderCarry[s_26_5, And[a.b21, b.b05], c_26_5] | let c_27_7 = AdderCarry[s_26_6, And[a.b20, b.b06], c_26_6] | let c_27_8 = AdderCarry[s_26_7, And[a.b19, b.b07], c_26_7] | let c_27_9 = AdderCarry[s_26_8, And[a.b18, b.b08], c_26_8] | let c_27_10 = AdderCarry[s_26_9, And[a.b17, b.b09], c_26_9] | let c_27_11 = AdderCarry[s_26_10, And[a.b16, b.b10], c_26_10] | let c_27_12 = AdderCarry[s_26_11, And[a.b15, b.b11], c_26_11] | let c_27_13 = AdderCarry[s_26_12, And[a.b14, b.b12], c_26_12] | let c_27_14 = AdderCarry[s_26_13, And[a.b13, b.b13], c_26_13] | let c_27_15 = AdderCarry[s_26_14, And[a.b12, b.b14], c_26_14] | let c_27_16 = AdderCarry[s_26_15, And[a.b11, b.b15], c_26_15] | let c_27_17 = AdderCarry[s_26_16, And[a.b10, b.b16], c_26_16] | let c_27_18 = AdderCarry[s_26_17, And[a.b09, b.b17], c_26_17] | let c_27_19 = AdderCarry[s_26_18, And[a.b08, b.b18], c_26_18] | let c_27_20 = AdderCarry[s_26_19, And[a.b07, b.b19], c_26_19] | let c_27_21 = AdderCarry[s_26_20, And[a.b06, b.b20], c_26_20] | let c_27_22 = AdderCarry[s_26_21, And[a.b05, b.b21], c_26_21] | let c_27_23 = AdderCarry[s_26_22, And[a.b04, b.b22], c_26_22] | let c_27_24 = AdderCarry[s_26_23, And[a.b03, b.b23], c_26_23] | let c_27_25 = AdderCarry[s_26_24, And[a.b02, b.b24], c_26_24] | let c_27_26 = AdderCarry[s_26_25, And[a.b01, b.b25], c_26_25] | let c_27_27 = AdderCarry[s_26_26, And[a.b00, b.b26], c_26_26] | let s_27_0 = False | let s_27_1 = AdderSum [s_27_0, And[a.b27, b.b00], c_27_0] | let s_27_2 = AdderSum [s_27_1, And[a.b26, b.b01], c_27_1] | let s_27_3 = AdderSum [s_27_2, And[a.b25, b.b02], c_27_2] | let s_27_4 = AdderSum [s_27_3, And[a.b24, b.b03], c_27_3] | let s_27_5 = AdderSum [s_27_4, And[a.b23, b.b04], c_27_4] | let s_27_6 = AdderSum [s_27_5, And[a.b22, b.b05], c_27_5] | let s_27_7 = AdderSum [s_27_6, And[a.b21, b.b06], c_27_6] | let s_27_8 = AdderSum [s_27_7, And[a.b20, b.b07], c_27_7] | let s_27_9 = AdderSum [s_27_8, And[a.b19, b.b08], c_27_8] | let s_27_10 = AdderSum [s_27_9, And[a.b18, b.b09], c_27_9] | let s_27_11 = AdderSum [s_27_10, And[a.b17, b.b10], c_27_10] | let s_27_12 = AdderSum [s_27_11, And[a.b16, b.b11], c_27_11] | let s_27_13 = AdderSum [s_27_12, And[a.b15, b.b12], c_27_12] | let s_27_14 = AdderSum [s_27_13, And[a.b14, b.b13], c_27_13] | let s_27_15 = AdderSum [s_27_14, And[a.b13, b.b14], c_27_14] | let s_27_16 = AdderSum [s_27_15, And[a.b12, b.b15], c_27_15] | let s_27_17 = AdderSum [s_27_16, And[a.b11, b.b16], c_27_16] | let s_27_18 = AdderSum [s_27_17, And[a.b10, b.b17], c_27_17] | let s_27_19 = AdderSum [s_27_18, And[a.b09, b.b18], c_27_18] | let s_27_20 = AdderSum [s_27_19, And[a.b08, b.b19], c_27_19] | let s_27_21 = AdderSum [s_27_20, And[a.b07, b.b20], c_27_20] | let s_27_22 = AdderSum [s_27_21, And[a.b06, b.b21], c_27_21] | let s_27_23 = AdderSum [s_27_22, And[a.b05, b.b22], c_27_22] | let s_27_24 = AdderSum [s_27_23, And[a.b04, b.b23], c_27_23] | let s_27_25 = AdderSum [s_27_24, And[a.b03, b.b24], c_27_24] | let s_27_26 = AdderSum [s_27_25, And[a.b02, b.b25], c_27_25] | let s_27_27 = AdderSum [s_27_26, And[a.b01, b.b26], c_27_26] | let s_27_28 = AdderSum [s_27_27, And[a.b00, b.b27], c_27_27] | let c_28_0 = False | let c_28_1 = AdderCarry[s_27_0, And[a.b27, b.b00], c_27_0] | let c_28_2 = AdderCarry[s_27_1, And[a.b26, b.b01], c_27_1] | let c_28_3 = AdderCarry[s_27_2, And[a.b25, b.b02], c_27_2] | let c_28_4 = AdderCarry[s_27_3, And[a.b24, b.b03], c_27_3] | let c_28_5 = AdderCarry[s_27_4, And[a.b23, b.b04], c_27_4] | let c_28_6 = AdderCarry[s_27_5, And[a.b22, b.b05], c_27_5] | let c_28_7 = AdderCarry[s_27_6, And[a.b21, b.b06], c_27_6] | let c_28_8 = AdderCarry[s_27_7, And[a.b20, b.b07], c_27_7] | let c_28_9 = AdderCarry[s_27_8, And[a.b19, b.b08], c_27_8] | let c_28_10 = AdderCarry[s_27_9, And[a.b18, b.b09], c_27_9] | let c_28_11 = AdderCarry[s_27_10, And[a.b17, b.b10], c_27_10] | let c_28_12 = AdderCarry[s_27_11, And[a.b16, b.b11], c_27_11] | let c_28_13 = AdderCarry[s_27_12, And[a.b15, b.b12], c_27_12] | let c_28_14 = AdderCarry[s_27_13, And[a.b14, b.b13], c_27_13] | let c_28_15 = AdderCarry[s_27_14, And[a.b13, b.b14], c_27_14] | let c_28_16 = AdderCarry[s_27_15, And[a.b12, b.b15], c_27_15] | let c_28_17 = AdderCarry[s_27_16, And[a.b11, b.b16], c_27_16] | let c_28_18 = AdderCarry[s_27_17, And[a.b10, b.b17], c_27_17] | let c_28_19 = AdderCarry[s_27_18, And[a.b09, b.b18], c_27_18] | let c_28_20 = AdderCarry[s_27_19, And[a.b08, b.b19], c_27_19] | let c_28_21 = AdderCarry[s_27_20, And[a.b07, b.b20], c_27_20] | let c_28_22 = AdderCarry[s_27_21, And[a.b06, b.b21], c_27_21] | let c_28_23 = AdderCarry[s_27_22, And[a.b05, b.b22], c_27_22] | let c_28_24 = AdderCarry[s_27_23, And[a.b04, b.b23], c_27_23] | let c_28_25 = AdderCarry[s_27_24, And[a.b03, b.b24], c_27_24] | let c_28_26 = AdderCarry[s_27_25, And[a.b02, b.b25], c_27_25] | let c_28_27 = AdderCarry[s_27_26, And[a.b01, b.b26], c_27_26] | let c_28_28 = AdderCarry[s_27_27, And[a.b00, b.b27], c_27_27] | let s_28_0 = False | let s_28_1 = AdderSum [s_28_0, And[a.b28, b.b00], c_28_0] | let s_28_2 = AdderSum [s_28_1, And[a.b27, b.b01], c_28_1] | let s_28_3 = AdderSum [s_28_2, And[a.b26, b.b02], c_28_2] | let s_28_4 = AdderSum [s_28_3, And[a.b25, b.b03], c_28_3] | let s_28_5 = AdderSum [s_28_4, And[a.b24, b.b04], c_28_4] | let s_28_6 = AdderSum [s_28_5, And[a.b23, b.b05], c_28_5] | let s_28_7 = AdderSum [s_28_6, And[a.b22, b.b06], c_28_6] | let s_28_8 = AdderSum [s_28_7, And[a.b21, b.b07], c_28_7] | let s_28_9 = AdderSum [s_28_8, And[a.b20, b.b08], c_28_8] | let s_28_10 = AdderSum [s_28_9, And[a.b19, b.b09], c_28_9] | let s_28_11 = AdderSum [s_28_10, And[a.b18, b.b10], c_28_10] | let s_28_12 = AdderSum [s_28_11, And[a.b17, b.b11], c_28_11] | let s_28_13 = AdderSum [s_28_12, And[a.b16, b.b12], c_28_12] | let s_28_14 = AdderSum [s_28_13, And[a.b15, b.b13], c_28_13] | let s_28_15 = AdderSum [s_28_14, And[a.b14, b.b14], c_28_14] | let s_28_16 = AdderSum [s_28_15, And[a.b13, b.b15], c_28_15] | let s_28_17 = AdderSum [s_28_16, And[a.b12, b.b16], c_28_16] | let s_28_18 = AdderSum [s_28_17, And[a.b11, b.b17], c_28_17] | let s_28_19 = AdderSum [s_28_18, And[a.b10, b.b18], c_28_18] | let s_28_20 = AdderSum [s_28_19, And[a.b09, b.b19], c_28_19] | let s_28_21 = AdderSum [s_28_20, And[a.b08, b.b20], c_28_20] | let s_28_22 = AdderSum [s_28_21, And[a.b07, b.b21], c_28_21] | let s_28_23 = AdderSum [s_28_22, And[a.b06, b.b22], c_28_22] | let s_28_24 = AdderSum [s_28_23, And[a.b05, b.b23], c_28_23] | let s_28_25 = AdderSum [s_28_24, And[a.b04, b.b24], c_28_24] | let s_28_26 = AdderSum [s_28_25, And[a.b03, b.b25], c_28_25] | let s_28_27 = AdderSum [s_28_26, And[a.b02, b.b26], c_28_26] | let s_28_28 = AdderSum [s_28_27, And[a.b01, b.b27], c_28_27] | let s_28_29 = AdderSum [s_28_28, And[a.b00, b.b28], c_28_28] | let c_29_0 = False | let c_29_1 = AdderCarry[s_28_0, And[a.b28, b.b00], c_28_0] | let c_29_2 = AdderCarry[s_28_1, And[a.b27, b.b01], c_28_1] | let c_29_3 = AdderCarry[s_28_2, And[a.b26, b.b02], c_28_2] | let c_29_4 = AdderCarry[s_28_3, And[a.b25, b.b03], c_28_3] | let c_29_5 = AdderCarry[s_28_4, And[a.b24, b.b04], c_28_4] | let c_29_6 = AdderCarry[s_28_5, And[a.b23, b.b05], c_28_5] | let c_29_7 = AdderCarry[s_28_6, And[a.b22, b.b06], c_28_6] | let c_29_8 = AdderCarry[s_28_7, And[a.b21, b.b07], c_28_7] | let c_29_9 = AdderCarry[s_28_8, And[a.b20, b.b08], c_28_8] | let c_29_10 = AdderCarry[s_28_9, And[a.b19, b.b09], c_28_9] | let c_29_11 = AdderCarry[s_28_10, And[a.b18, b.b10], c_28_10] | let c_29_12 = AdderCarry[s_28_11, And[a.b17, b.b11], c_28_11] | let c_29_13 = AdderCarry[s_28_12, And[a.b16, b.b12], c_28_12] | let c_29_14 = AdderCarry[s_28_13, And[a.b15, b.b13], c_28_13] | let c_29_15 = AdderCarry[s_28_14, And[a.b14, b.b14], c_28_14] | let c_29_16 = AdderCarry[s_28_15, And[a.b13, b.b15], c_28_15] | let c_29_17 = AdderCarry[s_28_16, And[a.b12, b.b16], c_28_16] | let c_29_18 = AdderCarry[s_28_17, And[a.b11, b.b17], c_28_17] | let c_29_19 = AdderCarry[s_28_18, And[a.b10, b.b18], c_28_18] | let c_29_20 = AdderCarry[s_28_19, And[a.b09, b.b19], c_28_19] | let c_29_21 = AdderCarry[s_28_20, And[a.b08, b.b20], c_28_20] | let c_29_22 = AdderCarry[s_28_21, And[a.b07, b.b21], c_28_21] | let c_29_23 = AdderCarry[s_28_22, And[a.b06, b.b22], c_28_22] | let c_29_24 = AdderCarry[s_28_23, And[a.b05, b.b23], c_28_23] | let c_29_25 = AdderCarry[s_28_24, And[a.b04, b.b24], c_28_24] | let c_29_26 = AdderCarry[s_28_25, And[a.b03, b.b25], c_28_25] | let c_29_27 = AdderCarry[s_28_26, And[a.b02, b.b26], c_28_26] | let c_29_28 = AdderCarry[s_28_27, And[a.b01, b.b27], c_28_27] | let c_29_29 = AdderCarry[s_28_28, And[a.b00, b.b28], c_28_28] | let s_29_0 = False | let s_29_1 = AdderSum [s_29_0, And[a.b29, b.b00], c_29_0] | let s_29_2 = AdderSum [s_29_1, And[a.b28, b.b01], c_29_1] | let s_29_3 = AdderSum [s_29_2, And[a.b27, b.b02], c_29_2] | let s_29_4 = AdderSum [s_29_3, And[a.b26, b.b03], c_29_3] | let s_29_5 = AdderSum [s_29_4, And[a.b25, b.b04], c_29_4] | let s_29_6 = AdderSum [s_29_5, And[a.b24, b.b05], c_29_5] | let s_29_7 = AdderSum [s_29_6, And[a.b23, b.b06], c_29_6] | let s_29_8 = AdderSum [s_29_7, And[a.b22, b.b07], c_29_7] | let s_29_9 = AdderSum [s_29_8, And[a.b21, b.b08], c_29_8] | let s_29_10 = AdderSum [s_29_9, And[a.b20, b.b09], c_29_9] | let s_29_11 = AdderSum [s_29_10, And[a.b19, b.b10], c_29_10] | let s_29_12 = AdderSum [s_29_11, And[a.b18, b.b11], c_29_11] | let s_29_13 = AdderSum [s_29_12, And[a.b17, b.b12], c_29_12] | let s_29_14 = AdderSum [s_29_13, And[a.b16, b.b13], c_29_13] | let s_29_15 = AdderSum [s_29_14, And[a.b15, b.b14], c_29_14] | let s_29_16 = AdderSum [s_29_15, And[a.b14, b.b15], c_29_15] | let s_29_17 = AdderSum [s_29_16, And[a.b13, b.b16], c_29_16] | let s_29_18 = AdderSum [s_29_17, And[a.b12, b.b17], c_29_17] | let s_29_19 = AdderSum [s_29_18, And[a.b11, b.b18], c_29_18] | let s_29_20 = AdderSum [s_29_19, And[a.b10, b.b19], c_29_19] | let s_29_21 = AdderSum [s_29_20, And[a.b09, b.b20], c_29_20] | let s_29_22 = AdderSum [s_29_21, And[a.b08, b.b21], c_29_21] | let s_29_23 = AdderSum [s_29_22, And[a.b07, b.b22], c_29_22] | let s_29_24 = AdderSum [s_29_23, And[a.b06, b.b23], c_29_23] | let s_29_25 = AdderSum [s_29_24, And[a.b05, b.b24], c_29_24] | let s_29_26 = AdderSum [s_29_25, And[a.b04, b.b25], c_29_25] | let s_29_27 = AdderSum [s_29_26, And[a.b03, b.b26], c_29_26] | let s_29_28 = AdderSum [s_29_27, And[a.b02, b.b27], c_29_27] | let s_29_29 = AdderSum [s_29_28, And[a.b01, b.b28], c_29_28] | let s_29_30 = AdderSum [s_29_29, And[a.b00, b.b29], c_29_29] | let c_30_0 = False | let c_30_1 = AdderCarry[s_29_0, And[a.b29, b.b00], c_29_0] | let c_30_2 = AdderCarry[s_29_1, And[a.b28, b.b01], c_29_1] | let c_30_3 = AdderCarry[s_29_2, And[a.b27, b.b02], c_29_2] | let c_30_4 = AdderCarry[s_29_3, And[a.b26, b.b03], c_29_3] | let c_30_5 = AdderCarry[s_29_4, And[a.b25, b.b04], c_29_4] | let c_30_6 = AdderCarry[s_29_5, And[a.b24, b.b05], c_29_5] | let c_30_7 = AdderCarry[s_29_6, And[a.b23, b.b06], c_29_6] | let c_30_8 = AdderCarry[s_29_7, And[a.b22, b.b07], c_29_7] | let c_30_9 = AdderCarry[s_29_8, And[a.b21, b.b08], c_29_8] | let c_30_10 = AdderCarry[s_29_9, And[a.b20, b.b09], c_29_9] | let c_30_11 = AdderCarry[s_29_10, And[a.b19, b.b10], c_29_10] | let c_30_12 = AdderCarry[s_29_11, And[a.b18, b.b11], c_29_11] | let c_30_13 = AdderCarry[s_29_12, And[a.b17, b.b12], c_29_12] | let c_30_14 = AdderCarry[s_29_13, And[a.b16, b.b13], c_29_13] | let c_30_15 = AdderCarry[s_29_14, And[a.b15, b.b14], c_29_14] | let c_30_16 = AdderCarry[s_29_15, And[a.b14, b.b15], c_29_15] | let c_30_17 = AdderCarry[s_29_16, And[a.b13, b.b16], c_29_16] | let c_30_18 = AdderCarry[s_29_17, And[a.b12, b.b17], c_29_17] | let c_30_19 = AdderCarry[s_29_18, And[a.b11, b.b18], c_29_18] | let c_30_20 = AdderCarry[s_29_19, And[a.b10, b.b19], c_29_19] | let c_30_21 = AdderCarry[s_29_20, And[a.b09, b.b20], c_29_20] | let c_30_22 = AdderCarry[s_29_21, And[a.b08, b.b21], c_29_21] | let c_30_23 = AdderCarry[s_29_22, And[a.b07, b.b22], c_29_22] | let c_30_24 = AdderCarry[s_29_23, And[a.b06, b.b23], c_29_23] | let c_30_25 = AdderCarry[s_29_24, And[a.b05, b.b24], c_29_24] | let c_30_26 = AdderCarry[s_29_25, And[a.b04, b.b25], c_29_25] | let c_30_27 = AdderCarry[s_29_26, And[a.b03, b.b26], c_29_26] | let c_30_28 = AdderCarry[s_29_27, And[a.b02, b.b27], c_29_27] | let c_30_29 = AdderCarry[s_29_28, And[a.b01, b.b28], c_29_28] | let c_30_30 = AdderCarry[s_29_29, And[a.b00, b.b29], c_29_29] | let s_30_0 = False | let s_30_1 = AdderSum [s_30_0, And[a.b30, b.b00], c_30_0] | let s_30_2 = AdderSum [s_30_1, And[a.b29, b.b01], c_30_1] | let s_30_3 = AdderSum [s_30_2, And[a.b28, b.b02], c_30_2] | let s_30_4 = AdderSum [s_30_3, And[a.b27, b.b03], c_30_3] | let s_30_5 = AdderSum [s_30_4, And[a.b26, b.b04], c_30_4] | let s_30_6 = AdderSum [s_30_5, And[a.b25, b.b05], c_30_5] | let s_30_7 = AdderSum [s_30_6, And[a.b24, b.b06], c_30_6] | let s_30_8 = AdderSum [s_30_7, And[a.b23, b.b07], c_30_7] | let s_30_9 = AdderSum [s_30_8, And[a.b22, b.b08], c_30_8] | let s_30_10 = AdderSum [s_30_9, And[a.b21, b.b09], c_30_9] | let s_30_11 = AdderSum [s_30_10, And[a.b20, b.b10], c_30_10] | let s_30_12 = AdderSum [s_30_11, And[a.b19, b.b11], c_30_11] | let s_30_13 = AdderSum [s_30_12, And[a.b18, b.b12], c_30_12] | let s_30_14 = AdderSum [s_30_13, And[a.b17, b.b13], c_30_13] | let s_30_15 = AdderSum [s_30_14, And[a.b16, b.b14], c_30_14] | let s_30_16 = AdderSum [s_30_15, And[a.b15, b.b15], c_30_15] | let s_30_17 = AdderSum [s_30_16, And[a.b14, b.b16], c_30_16] | let s_30_18 = AdderSum [s_30_17, And[a.b13, b.b17], c_30_17] | let s_30_19 = AdderSum [s_30_18, And[a.b12, b.b18], c_30_18] | let s_30_20 = AdderSum [s_30_19, And[a.b11, b.b19], c_30_19] | let s_30_21 = AdderSum [s_30_20, And[a.b10, b.b20], c_30_20] | let s_30_22 = AdderSum [s_30_21, And[a.b09, b.b21], c_30_21] | let s_30_23 = AdderSum [s_30_22, And[a.b08, b.b22], c_30_22] | let s_30_24 = AdderSum [s_30_23, And[a.b07, b.b23], c_30_23] | let s_30_25 = AdderSum [s_30_24, And[a.b06, b.b24], c_30_24] | let s_30_26 = AdderSum [s_30_25, And[a.b05, b.b25], c_30_25] | let s_30_27 = AdderSum [s_30_26, And[a.b04, b.b26], c_30_26] | let s_30_28 = AdderSum [s_30_27, And[a.b03, b.b27], c_30_27] | let s_30_29 = AdderSum [s_30_28, And[a.b02, b.b28], c_30_28] | let s_30_30 = AdderSum [s_30_29, And[a.b01, b.b29], c_30_29] | let s_30_31 = AdderSum [s_30_30, And[a.b00, b.b30], c_30_30] | let c_31_0 = False | let c_31_1 = AdderCarry[s_30_0, And[a.b30, b.b00], c_30_0] | let c_31_2 = AdderCarry[s_30_1, And[a.b29, b.b01], c_30_1] | let c_31_3 = AdderCarry[s_30_2, And[a.b28, b.b02], c_30_2] | let c_31_4 = AdderCarry[s_30_3, And[a.b27, b.b03], c_30_3] | let c_31_5 = AdderCarry[s_30_4, And[a.b26, b.b04], c_30_4] | let c_31_6 = AdderCarry[s_30_5, And[a.b25, b.b05], c_30_5] | let c_31_7 = AdderCarry[s_30_6, And[a.b24, b.b06], c_30_6] | let c_31_8 = AdderCarry[s_30_7, And[a.b23, b.b07], c_30_7] | let c_31_9 = AdderCarry[s_30_8, And[a.b22, b.b08], c_30_8] | let c_31_10 = AdderCarry[s_30_9, And[a.b21, b.b09], c_30_9] | let c_31_11 = AdderCarry[s_30_10, And[a.b20, b.b10], c_30_10] | let c_31_12 = AdderCarry[s_30_11, And[a.b19, b.b11], c_30_11] | let c_31_13 = AdderCarry[s_30_12, And[a.b18, b.b12], c_30_12] | let c_31_14 = AdderCarry[s_30_13, And[a.b17, b.b13], c_30_13] | let c_31_15 = AdderCarry[s_30_14, And[a.b16, b.b14], c_30_14] | let c_31_16 = AdderCarry[s_30_15, And[a.b15, b.b15], c_30_15] | let c_31_17 = AdderCarry[s_30_16, And[a.b14, b.b16], c_30_16] | let c_31_18 = AdderCarry[s_30_17, And[a.b13, b.b17], c_30_17] | let c_31_19 = AdderCarry[s_30_18, And[a.b12, b.b18], c_30_18] | let c_31_20 = AdderCarry[s_30_19, And[a.b11, b.b19], c_30_19] | let c_31_21 = AdderCarry[s_30_20, And[a.b10, b.b20], c_30_20] | let c_31_22 = AdderCarry[s_30_21, And[a.b09, b.b21], c_30_21] | let c_31_23 = AdderCarry[s_30_22, And[a.b08, b.b22], c_30_22] | let c_31_24 = AdderCarry[s_30_23, And[a.b07, b.b23], c_30_23] | let c_31_25 = AdderCarry[s_30_24, And[a.b06, b.b24], c_30_24] | let c_31_26 = AdderCarry[s_30_25, And[a.b05, b.b25], c_30_25] | let c_31_27 = AdderCarry[s_30_26, And[a.b04, b.b26], c_30_26] | let c_31_28 = AdderCarry[s_30_27, And[a.b03, b.b27], c_30_27] | let c_31_29 = AdderCarry[s_30_28, And[a.b02, b.b28], c_30_28] | let c_31_30 = AdderCarry[s_30_29, And[a.b01, b.b29], c_30_29] | let c_31_31 = AdderCarry[s_30_30, And[a.b00, b.b30], c_30_30] | let s_31_0 = False | let s_31_1 = AdderSum [s_31_0, And[a.b31, b.b00], c_31_0] | let s_31_2 = AdderSum [s_31_1, And[a.b30, b.b01], c_31_1] | let s_31_3 = AdderSum [s_31_2, And[a.b29, b.b02], c_31_2] | let s_31_4 = AdderSum [s_31_3, And[a.b28, b.b03], c_31_3] | let s_31_5 = AdderSum [s_31_4, And[a.b27, b.b04], c_31_4] | let s_31_6 = AdderSum [s_31_5, And[a.b26, b.b05], c_31_5] | let s_31_7 = AdderSum [s_31_6, And[a.b25, b.b06], c_31_6] | let s_31_8 = AdderSum [s_31_7, And[a.b24, b.b07], c_31_7] | let s_31_9 = AdderSum [s_31_8, And[a.b23, b.b08], c_31_8] | let s_31_10 = AdderSum [s_31_9, And[a.b22, b.b09], c_31_9] | let s_31_11 = AdderSum [s_31_10, And[a.b21, b.b10], c_31_10] | let s_31_12 = AdderSum [s_31_11, And[a.b20, b.b11], c_31_11] | let s_31_13 = AdderSum [s_31_12, And[a.b19, b.b12], c_31_12] | let s_31_14 = AdderSum [s_31_13, And[a.b18, b.b13], c_31_13] | let s_31_15 = AdderSum [s_31_14, And[a.b17, b.b14], c_31_14] | let s_31_16 = AdderSum [s_31_15, And[a.b16, b.b15], c_31_15] | let s_31_17 = AdderSum [s_31_16, And[a.b15, b.b16], c_31_16] | let s_31_18 = AdderSum [s_31_17, And[a.b14, b.b17], c_31_17] | let s_31_19 = AdderSum [s_31_18, And[a.b13, b.b18], c_31_18] | let s_31_20 = AdderSum [s_31_19, And[a.b12, b.b19], c_31_19] | let s_31_21 = AdderSum [s_31_20, And[a.b11, b.b20], c_31_20] | let s_31_22 = AdderSum [s_31_21, And[a.b10, b.b21], c_31_21] | let s_31_23 = AdderSum [s_31_22, And[a.b09, b.b22], c_31_22] | let s_31_24 = AdderSum [s_31_23, And[a.b08, b.b23], c_31_23] | let s_31_25 = AdderSum [s_31_24, And[a.b07, b.b24], c_31_24] | let s_31_26 = AdderSum [s_31_25, And[a.b06, b.b25], c_31_25] | let s_31_27 = AdderSum [s_31_26, And[a.b05, b.b26], c_31_26] | let s_31_28 = AdderSum [s_31_27, And[a.b04, b.b27], c_31_27] | let s_31_29 = AdderSum [s_31_28, And[a.b03, b.b28], c_31_28] | let s_31_30 = AdderSum [s_31_29, And[a.b02, b.b29], c_31_29] | let s_31_31 = AdderSum [s_31_30, And[a.b01, b.b30], c_31_30] | let s_31_32 = AdderSum [s_31_31, And[a.b00, b.b31], c_31_31] | result.b00 = s_0_1 and result.b01 = s_1_2 and result.b02 = s_2_3 and result.b03 = s_3_4 and result.b04 = s_4_5 and result.b05 = s_5_6 and result.b06 = s_6_7 and result.b07 = s_7_8 and result.b08 = s_8_9 and result.b09 = s_9_10 and result.b10 = s_10_11 and result.b11 = s_11_12 and result.b12 = s_12_13 and result.b13 = s_13_14 and result.b14 = s_14_15 and result.b15 = s_15_16 and result.b16 = s_16_17 and result.b17 = s_17_18 and result.b18 = s_18_19 and result.b19 = s_19_20 and result.b20 = s_20_21 and result.b21 = s_21_22 and result.b22 = s_22_23 and result.b23 = s_23_24 and result.b24 = s_24_25 and result.b25 = s_25_26 and result.b26 = s_26_27 and result.b27 = s_27_28 and result.b28 = s_28_29 and result.b29 = s_29_30 and result.b30 = s_30_31 and result.b31 = s_31_32 } //A simple example /* one sig N32_633333 extends Number32 {} { b00 in True b01 in False b02 in True b03 in False b04 in True b05 in True b06 in True b07 in True b08 in True b09 in False b10 in False b11 in True b12 in False b13 in True b14 in False b15 in True b16 in True b17 in False b18 in False b19 in True b20 in False b21 in False b22 in False b23 in False b24 in False b25 in False b26 in False b27 in False b28 in False b29 in False b30 in False b31 in False } one sig N32_0 extends Number32 {} { b00 in False b01 in False b02 in False b03 in False b04 in False b05 in False b06 in False b07 in False b08 in False b09 in False b10 in False b11 in False b12 in False b13 in False b14 in False b15 in False b16 in False b17 in False b18 in False b19 in False b20 in False b21 in False b22 in False b23 in False b24 in False b25 in False b26 in False b27 in False b28 in False b29 in False b30 in False b31 in False } one sig X { x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 : Number32, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10: Number32, s1,s2,s3,s4,s5,s6,s7,s8,s9: Number32 } run { Mul[X.x1, X.x1, X.t1] Mul[X.x2, X.x2, X.t2] Mul[X.x3, X.x3, X.t3] Mul[X.x4, X.x4, X.t4] Mul[X.x5, X.x5, X.t5] Mul[X.x6, X.x6, X.t6] Mul[X.x7, X.x7, X.t7] Mul[X.x8, X.x8, X.t8] Mul[X.x9, X.x9, X.t9] Mul[X.x10, X.x10, X.t10] Sum[X.t1, X.t2, X.s1] Sum[X.t3, X.s1, X.s2] Sum[X.t4, X.s2, X.s3] Sum[X.t5, X.s3, X.s4] Sum[X.t6, X.s4, X.s5] Sum[X.t7, X.s5, X.s6] Sum[X.t8, X.s6, X.s7] Sum[X.t9, X.s7, X.s8] Sum[X.t10, X.s8, X.s9] eq[X.s9, N32_633333] } for 30 Number32*/
vp8/encoder/x86/dct_sse2.asm
CM-Archive/android_external_libvpx
0
173810
; ; Copyright (c) 2010 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; %include "vpx_ports/x86_abi_support.asm" ;void vp8_short_fdct4x4_sse2(short *input, short *output, int pitch) global sym(vp8_short_fdct4x4_sse2) sym(vp8_short_fdct4x4_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 3 ;; SAVE_XMM GET_GOT rbx push rsi push rdi ; end prolog mov rsi, arg(0) movsxd rax, DWORD PTR arg(2) lea rdi, [rsi + rax*2] movq xmm0, MMWORD PTR[rsi ] ;03 02 01 00 movq xmm2, MMWORD PTR[rsi + rax] ;13 12 11 10 movq xmm1, MMWORD PTR[rsi + rax*2] ;23 22 21 20 movq xmm3, MMWORD PTR[rdi + rax] ;33 32 31 30 punpcklqdq xmm0, xmm2 ;13 12 11 10 03 02 01 00 punpcklqdq xmm1, xmm3 ;33 32 31 30 23 22 21 20 mov rdi, arg(1) movdqa xmm2, xmm0 punpckldq xmm0, xmm1 ;23 22 03 02 21 20 01 00 punpckhdq xmm2, xmm1 ;33 32 13 12 31 30 11 10 movdqa xmm1, xmm0 punpckldq xmm0, xmm2 ;31 21 30 20 11 10 01 00 pshufhw xmm1, xmm1, 0b1h ;22 23 02 03 xx xx xx xx pshufhw xmm2, xmm2, 0b1h ;32 33 12 13 xx xx xx xx punpckhdq xmm1, xmm2 ;32 33 22 23 12 13 02 03 movdqa xmm3, xmm0 paddw xmm0, xmm1 ;b1 a1 b1 a1 b1 a1 b1 a1 psubw xmm3, xmm1 ;c1 d1 c1 d1 c1 d1 c1 d1 psllw xmm0, 3 ;b1 <<= 3 a1 <<= 3 psllw xmm3, 3 ;c1 <<= 3 d1 <<= 3 movdqa xmm1, xmm0 pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 movdqa xmm4, xmm3 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)];d1*2217 - c1*5352 paddd xmm3, XMMWORD PTR[GLOBAL(_14500)] paddd xmm4, XMMWORD PTR[GLOBAL(_7500)] psrad xmm3, 12 ;(c1 * 2217 + d1 * 5352 + 14500)>>12 psrad xmm4, 12 ;(d1 * 2217 - c1 * 5352 + 7500)>>12 packssdw xmm0, xmm1 ;op[2] op[0] packssdw xmm3, xmm4 ;op[3] op[1] ; 23 22 21 20 03 02 01 00 ; ; 33 32 31 30 13 12 11 10 ; movdqa xmm2, xmm0 punpcklqdq xmm0, xmm3 ;13 12 11 10 03 02 01 00 punpckhqdq xmm2, xmm3 ;23 22 21 20 33 32 31 30 movdqa xmm3, xmm0 punpcklwd xmm0, xmm2 ;32 30 22 20 12 10 02 00 punpckhwd xmm3, xmm2 ;33 31 23 21 13 11 03 01 movdqa xmm2, xmm0 punpcklwd xmm0, xmm3 ;13 12 11 10 03 02 01 00 punpckhwd xmm2, xmm3 ;33 32 31 30 23 22 21 20 movdqa xmm5, XMMWORD PTR[GLOBAL(_7)] pshufd xmm2, xmm2, 04eh movdqa xmm3, xmm0 paddw xmm0, xmm2 ;b1 b1 b1 b1 a1 a1 a1 a1 psubw xmm3, xmm2 ;c1 c1 c1 c1 d1 d1 d1 d1 pshufd xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 b1 a1 a1 movdqa xmm2, xmm3 ;save d1 for compare pshufd xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 c1 d1 d1 pshuflw xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 a1 b1 a1 pshuflw xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 d1 c1 d1 pshufhw xmm0, xmm0, 0d8h ;b1 a1 b1 a1 b1 a1 b1 a1 pshufhw xmm3, xmm3, 0d8h ;c1 d1 c1 d1 c1 d1 c1 d1 movdqa xmm1, xmm0 pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 pxor xmm4, xmm4 ;zero out for compare paddd xmm0, xmm5 paddd xmm1, xmm5 pcmpeqw xmm2, xmm4 psrad xmm0, 4 ;(a1 + b1 + 7)>>4 psrad xmm1, 4 ;(a1 - b1 + 7)>>4 pandn xmm2, XMMWORD PTR[GLOBAL(_cmp_mask)] ;clear upper, ;and keep bit 0 of lower movdqa xmm4, xmm3 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)] ;d1*2217 - c1*5352 paddd xmm3, XMMWORD PTR[GLOBAL(_12000)] paddd xmm4, XMMWORD PTR[GLOBAL(_51000)] packssdw xmm0, xmm1 ;op[8] op[0] psrad xmm3, 16 ;(c1 * 2217 + d1 * 5352 + 12000)>>16 psrad xmm4, 16 ;(d1 * 2217 - c1 * 5352 + 51000)>>16 packssdw xmm3, xmm4 ;op[12] op[4] movdqa xmm1, xmm0 paddw xmm3, xmm2 ;op[4] += (d1!=0) punpcklqdq xmm0, xmm3 ;op[4] op[0] punpckhqdq xmm1, xmm3 ;op[12] op[8] movdqa XMMWORD PTR[rdi + 0], xmm0 movdqa XMMWORD PTR[rdi + 16], xmm1 ; begin epilog pop rdi pop rsi RESTORE_GOT ;; RESTORE_XMM UNSHADOW_ARGS pop rbp ret SECTION_RODATA align 16 _5352_2217: dw 5352 dw 2217 dw 5352 dw 2217 dw 5352 dw 2217 dw 5352 dw 2217 align 16 _2217_neg5352: dw 2217 dw -5352 dw 2217 dw -5352 dw 2217 dw -5352 dw 2217 dw -5352 align 16 _mult_add: times 8 dw 1 align 16 _cmp_mask: times 4 dw 1 times 4 dw 0 align 16 _mult_sub: dw 1 dw -1 dw 1 dw -1 dw 1 dw -1 dw 1 dw -1 align 16 _7: times 4 dd 7 align 16 _14500: times 4 dd 14500 align 16 _7500: times 4 dd 7500 align 16 _12000: times 4 dd 12000 align 16 _51000: times 4 dd 51000
src/parse_args.ads
AntonMeep/parse_args
9
19360
-- parse_args.ads -- A simple command line option parser -- Copyright (c) 2014 - 2021, <NAME> -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -- PERFORMANCE OF THIS SOFTWARE. pragma Profile(No_Implementation_Extensions); with Ada.Command_Line; with Ada.Finalization; with Ada.Iterator_Interfaces; with Ada.Containers.Indefinite_Doubly_Linked_Lists; private with Ada.Strings.Unbounded; private with Ada.Containers; private with Ada.Containers.Indefinite_Hashed_Maps, Ada.Strings.Hash; private with Ada.Containers.Doubly_Linked_Lists; package Parse_Args is -- ** -- ** Option -- ** type Option is abstract new Ada.Finalization.Limited_Controlled with private; type General_Option_Ptr is access Option'Class; subtype Option_Ptr is not null General_Option_Ptr; function Set(O : in Option) return Boolean; function Image(O : in Option) return String is abstract; -- Factory functions for basic option types function Make_Boolean_Option(Default : in Boolean := False) return Option_Ptr; function Make_Repeated_Option(Default : in Natural := 0) return Option_Ptr; function Make_Integer_Option(Default : in Integer := 0; Min : in Integer := Integer'First; Max : in Integer := Integer'Last ) return Option_Ptr; function Make_Natural_Option(Default : in Natural := 0) return Option_Ptr is (Make_Integer_Option(Default => Default, Min => 0, Max => Integer'Last)); function Make_Positive_Option(Default : in Positive := 1) return Option_Ptr is (Make_Integer_Option(Default => Default, Min => 1, Max => Integer'Last)); function Make_String_Option(Default : in String := "") return Option_Ptr; -- Define interfaces to specify different possible return values type Boolean_Option is limited interface; function Value(A : in Boolean_Option) return Boolean is abstract; type Integer_Option is limited interface; function Value(A : in Integer_Option) return Integer is abstract; type String_Option is limited interface; function Value(A : in String_Option) return String is abstract; -- ** -- ** Argument_Parser -- ** type Argument_Parser is new Ada.Finalization.Limited_Controlled with private with Constant_Indexing => Constant_Reference, Default_Iterator => Iterate, Iterator_Element => Option; -- These functions shadow the standard library, but if they are used in a -- dispatching way they can be over-ridden in derived types, which is useful -- for tests function Command_Name(A : in Argument_Parser) return String with Pre'Class => not A.Ready; function Argument_Count(A : in Argument_Parser) return Natural with Pre'Class => not A.Ready; function Argument(A : in Argument_Parser; Number : in Positive) return String with Pre'Class => not A.Ready; function Ready(A : in Argument_Parser) return Boolean; -- Initialising the Argument_Parser procedure Add_Option(A : in out Argument_Parser; O : in Option_Ptr; Name : in String; Short_Option : in Character := '-'; Long_Option : in String := ""; Usage : in String := ""; Prepend_Usage : in Boolean := False ) with Pre'Class => A.Ready; procedure Append_Positional(A : in out Argument_Parser; O : in Option_Ptr; Name : in String ) with Pre'Class => A.Ready; procedure Allow_Tail_Arguments(A : in out Argument_Parser; Usage : in String := "ARGUMENTS"; Allow : in Boolean := True) with Pre'Class => A.Ready; procedure Set_Prologue(A: in out Argument_Parser; Prologue : in String) with Pre'Class => A.Ready; -- Processing the command line procedure Parse_Command_Line(A : in out Argument_Parser) with Pre'Class => Ready(Argument_Parser'Class(A)), Post'Class => not Ready(Argument_Parser'Class(A)); -- Retrieving the results function Parse_Success(A : in Argument_Parser) return Boolean with Pre'Class => not Ready(Argument_Parser'Class(A)); function Parse_Message(A : in Argument_Parser) return String with Pre'Class => not Ready(Argument_Parser'Class(A)); function Boolean_Value(A : in Argument_Parser; Name : in String) return Boolean with Pre'Class => not Ready(Argument_Parser'Class(A)); function Integer_Value(A : in Argument_Parser; Name : in String) return Integer with Pre'Class => not Ready(Argument_Parser'Class(A)); function String_Value(A : in Argument_Parser; Name : in String) return String with Pre'Class => not Ready(Argument_Parser'Class(A)); package String_Doubly_Linked_Lists is new Ada.Containers.Indefinite_Doubly_Linked_Lists(Element_Type => String); function Tail(A: in Argument_Parser) return String_Doubly_Linked_Lists.List with Pre'Class => not Ready(Argument_Parser'Class(A)); -- Convenience procedure for printing usage text procedure Usage(A : in Argument_Parser); -- The following definitions are to support the indexing, dereferencing and -- iteration over the Argument_Parser type type Cursor is private; function Has_Element(Position : Cursor) return Boolean; function Option_Name(Position : Cursor) return String; package Argument_Parser_Iterators is new Ada.Iterator_Interfaces(Cursor => Cursor, Has_Element => Has_Element); function Iterate (Container : in Argument_Parser) return Argument_Parser_Iterators.Forward_Iterator'Class; type Option_Constant_Ref(Element : not null access constant Option'Class) is private with Implicit_Dereference => Element; function Constant_Reference(C : aliased in Argument_Parser; Position : in Cursor) return Option_Constant_Ref; function Constant_Reference(C : aliased in Argument_Parser; Name : in String) return Option_Constant_Ref; function Get(C : aliased in Argument_Parser; Name : in String) return Option_Constant_Ref renames Constant_Reference; private use Ada.Strings.Unbounded; type Option is abstract new Ada.Finalization.Limited_Controlled with record Set : Boolean := False; end record; overriding procedure Finalize(Object : in out Option) is null; procedure Set_Option(O : in out Option; A : in out Argument_Parser'Class) is null; procedure Set_Option_Argument(O : in out Option; Arg : in String; A : in out Argument_Parser'Class) is null; function Set(O : in Option) return Boolean is (O.Set); -- The following instantiations of the standard containers are used as the -- basic data structures for storing information on options package Option_Maps is new Ada.Containers.Indefinite_Hashed_Maps(Key_Type => String, Element_Type => Option_Ptr, Hash => Ada.Strings.Hash, Equivalent_Keys => "="); function Char_Hash(C : in Character) return Ada.Containers.Hash_Type is (Ada.Containers.Hash_Type(Character'Pos(C))); package Option_Char_Maps is new Ada.Containers.Indefinite_Hashed_Maps(Key_Type => Character, Element_Type => Option_Ptr, Hash => Char_Hash, Equivalent_Keys => "="); package Positional_Lists is new Ada.Containers.Doubly_Linked_Lists(Element_Type => Option_Ptr); use type Positional_Lists.Cursor; type Option_Help is record Name : Unbounded_String := Null_Unbounded_String; Positional : Boolean := False; Long_Option : Unbounded_String := Null_Unbounded_String; Short_Option : Character := '-'; Usage : Unbounded_String := Null_Unbounded_String; end record; package Option_Help_Lists is new Ada.Containers.Indefinite_Doubly_Linked_Lists(Element_Type => Option_Help); -- The core of the Argument_Parser is a finite state machine that starts in -- the Init state and should end either in the Finish_Success or Finish_Erroneous -- states type Argument_Parser_State is (Init, Ready, Required_Argument, Positional_Only, Finish_Success, Finish_Erroneous); type Argument_Parser is new Ada.Finalization.Limited_Controlled with record State : Argument_Parser_State := Init; Last_Option : access Option'Class := null; Arguments : Option_Maps.Map := Option_Maps.Empty_Map; Long_Options : Option_Maps.Map := Option_Maps.Empty_Map; Short_Options : Option_Char_Maps.Map := Option_Char_Maps.Empty_Map; Current_Positional : Positional_Lists.Cursor := Positional_Lists.No_Element; Positional : Positional_Lists.List := Positional_Lists.Empty_List; Allow_Tail : Boolean := False; Tail_Usage : Unbounded_String := Null_Unbounded_String; Tail : String_Doubly_Linked_Lists.List := String_Doubly_Linked_Lists.Empty_List; Message : Unbounded_String := Null_Unbounded_String; Prologue : Unbounded_String := Null_Unbounded_String; Option_Help_Details : Option_Help_Lists.List := Option_Help_Lists.Empty_List; end record; overriding procedure Finalize(Object : in out Argument_Parser); function Argument_Count(A : in Argument_Parser) return Natural is (Ada.Command_Line.Argument_Count); function Argument(A : in Argument_Parser; Number : in Positive) return String is (Ada.Command_Line.Argument(Number)); function Ready(A : in Argument_Parser) return Boolean is (A.State = Init); function Command_Name(A : in Argument_Parser) return String is (Ada.Command_Line.Command_Name); type Option_Constant_Ref(Element : not null access constant Option'Class) is null record; type Cursor is new Option_Maps.Cursor; type Argument_Parser_Iterator is new Argument_Parser_Iterators.Forward_Iterator with record Start : Option_Maps.Cursor; end record; function First (Object : Argument_Parser_Iterator) return Cursor; function Next (Object : Argument_Parser_Iterator; Position : Cursor) return Cursor; end Parse_Args;
Cubical/Algebra/Direct-Sum/Base.agda
howsiyu/cubical
0
958
<reponame>howsiyu/cubical {-# OPTIONS --safe #-} module Cubical.Algebra.Direct-Sum.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Algebra.AbGroup -- Conventions : -- Elements of the index are named r, s, t... -- Elements of the groups are called a, b, c... -- Elements of the direct sum are named x, y, z... -- Elements in the fiber of Q x, Q y are called xs, ys... private variable ℓ ℓ' ℓ'' : Level data ⊕ (Idx : Type ℓ) (P : Idx → Type ℓ') (AGP : (r : Idx) → AbGroupStr (P r)) : Type (ℓ-max ℓ ℓ') where -- elements neutral : ⊕ Idx P AGP base : (r : Idx) → (P r) → ⊕ Idx P AGP _add_ : ⊕ Idx P AGP → ⊕ Idx P AGP → ⊕ Idx P AGP -- eq group addAssoc : (x y z : ⊕ Idx P AGP) → x add (y add z) ≡ (x add y) add z addRid : (x : ⊕ Idx P AGP) → x add neutral ≡ x addComm : (x y : ⊕ Idx P AGP) → x add y ≡ y add x -- eq base base-neutral : (r : Idx) → base r (AbGroupStr.0g (AGP r)) ≡ neutral base-add : (r : Idx) → (a b : P r) → (base r a) add (base r b) ≡ base r (AbGroupStr._+_ (AGP r) a b) -- set trunc : isSet (⊕ Idx P AGP) module _ (Idx : Type ℓ) (P : Idx → Type ℓ') (AGP : (r : Idx) → AbGroupStr (P r)) where module DS-Ind-Set (Q : (x : ⊕ Idx P AGP) → Type ℓ'') (issd : (x : ⊕ Idx P AGP) → isSet (Q x)) -- elements (neutral* : Q neutral) (base* : (r : Idx) → (a : P r) → Q (base r a)) (_add*_ : {x y : ⊕ Idx P AGP} → Q x → Q y → Q (x add y)) -- eq group (addAssoc* : {x y z : ⊕ Idx P AGP} → (xs : Q x) → (ys : Q y) → (zs : Q z) → PathP ( λ i → Q ( addAssoc x y z i)) (xs add* (ys add* zs)) ((xs add* ys) add* zs)) (addRid* : {x : ⊕ Idx P AGP} → (xs : Q x) → PathP (λ i → Q (addRid x i)) (xs add* neutral*) xs ) (addComm* : {x y : ⊕ Idx P AGP} → (xs : Q x) → (ys : Q y) → PathP (λ i → Q (addComm x y i)) (xs add* ys) (ys add* xs)) -- -- eq base (base-neutral* : (r : Idx) → PathP (λ i → Q (base-neutral r i)) (base* r (AbGroupStr.0g (AGP r))) neutral*) (base-add* : (r : Idx) → (a b : P r) → PathP (λ i → Q (base-add r a b i)) ((base* r a) add* (base* r b)) (base* r (AbGroupStr._+_ (AGP r) a b))) where f : (x : ⊕ Idx P AGP) → Q x f neutral = neutral* f (base r a) = base* r a f (x add y) = (f x) add* (f y) f (addAssoc x y z i) = addAssoc* (f x) (f y) (f z) i f (addRid x i) = addRid* (f x) i f (addComm x y i) = addComm* (f x) (f y) i f (base-neutral r i) = base-neutral* r i f (base-add r a b i) = base-add* r a b i f (trunc x y p q i j) = isOfHLevel→isOfHLevelDep 2 (issd) (f x) (f y) (cong f p) (cong f q) (trunc x y p q) i j module DS-Rec-Set (B : Type ℓ'') (iss : isSet(B)) (neutral* : B) (base* : (r : Idx) → P r → B) (_add*_ : B → B → B) (addAssoc* : (xs ys zs : B) → (xs add* (ys add* zs)) ≡ ((xs add* ys) add* zs)) (addRid* : (xs : B) → xs add* neutral* ≡ xs) (addComm* : (xs ys : B) → xs add* ys ≡ ys add* xs) (base-neutral* : (r : Idx) → base* r (AbGroupStr.0g (AGP r)) ≡ neutral*) (base-add* : (r : Idx) → (a b : P r) → (base* r a) add* (base* r b) ≡ base* r (AbGroupStr._+_ (AGP r) a b)) where f : ⊕ Idx P AGP → B f z = DS-Ind-Set.f (λ _ → B) (λ _ → iss) neutral* base* _add*_ addAssoc* addRid* addComm* base-neutral* base-add* z module DS-Ind-Prop (Q : (x : ⊕ Idx P AGP) → Type ℓ'') (ispd : (x : ⊕ Idx P AGP) → isProp (Q x)) -- elements (neutral* : Q neutral) (base* : (r : Idx) → (a : P r) → Q (base r a)) (_add*_ : {x y : ⊕ Idx P AGP} → Q x → Q y → Q (x add y)) where f : (x : ⊕ Idx P AGP) → Q x f x = DS-Ind-Set.f Q (λ x → isProp→isSet (ispd x)) neutral* base* _add*_ (λ {x} {y} {z} xs ys zs → toPathP (ispd _ (transport (λ i → Q (addAssoc x y z i)) (xs add* (ys add* zs))) ((xs add* ys) add* zs))) (λ {x} xs → toPathP (ispd _ (transport (λ i → Q (addRid x i)) (xs add* neutral*)) xs)) (λ {x} {y} xs ys → toPathP (ispd _ (transport (λ i → Q (addComm x y i)) (xs add* ys)) (ys add* xs))) (λ r → toPathP (ispd _ (transport (λ i → Q (base-neutral r i)) (base* r (AbGroupStr.0g (AGP r)))) neutral*)) (λ r a b → toPathP (ispd _ (transport (λ i → Q (base-add r a b i)) ((base* r a) add* (base* r b))) (base* r (AbGroupStr._+_ (AGP r) a b) ))) x module DS-Rec-Prop (B : Type ℓ'') (isp : isProp B) (neutral* : B) (base* : (r : Idx) → P r → B) (_add*_ : B → B → B) where f : ⊕ Idx P AGP → B f x = DS-Ind-Prop.f (λ _ → B) (λ _ → isp) neutral* base* _add*_ x
programs/oeis/038/A038502.asm
karttu/loda
0
82084
<filename>programs/oeis/038/A038502.asm ; A038502: Remove 3's from n. ; 1,2,1,4,5,2,7,8,1,10,11,4,13,14,5,16,17,2,19,20,7,22,23,8,25,26,1,28,29,10,31,32,11,34,35,4,37,38,13,40,41,14,43,44,5,46,47,16,49,50,17,52,53,2,55,56,19,58,59,20,61,62,7,64,65,22,67,68,23,70,71,8,73,74,25,76,77,26,79,80,1,82,83,28,85,86,29,88,89,10,91,92,31,94,95,32,97,98,11,100,101,34,103,104,35,106,107,4,109,110,37,112,113,38,115,116,13,118,119,40,121,122,41,124,125,14,127,128,43,130,131,44,133,134,5,136,137,46,139,140,47,142,143,16,145,146,49,148,149,50,151,152,17,154,155,52,157,158,53,160,161,2,163,164,55,166,167,56,169,170,19,172,173,58,175,176,59,178,179,20,181,182,61,184,185,62,187,188,7,190,191,64,193,194,65,196,197,22,199,200,67,202,203,68,205,206,23,208,209,70,211,212,71,214,215,8,217,218,73,220,221,74,223,224,25,226,227,76,229,230,77,232,233,26,235,236,79,238,239,80,241,242,1,244,245,82,247,248,83,250 add $0,1 mov $1,$0 lpb $1,1 mov $2,$1 bin $2,3 gcd $1,$2 lpe
Examples/system/elf64header/elf64header.asm
agguro/linux-nasm
6
173
;name: elf64header.asm ; ;build: nasm -fbin -o elf64header elf64header.asm && chmod +x elf64header ; ;description: Small, self-contained 64-bit ELF executable for NASM ; ;adapted from: http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html ;http://blog.markloiseau.com/2012/05/tiny-64-bit-elf-executables/ bits 64 [list -] %include "unistd.inc" [list +] org 0x00400000 ;Program load offset ;64-bit ELF header ehdr: ;ELF Magic + 2 (64-bit), 1 (LSB), 1 (ELF ver. 1), 0 (ABI ver.) db 0x7F, "ELF", 2, 1, 1, 0 ;e_ident times 8 db 0 ;reserved (zeroes) dw 2 ;e_type: Executable file dw 0x3e ;e_machine: AMD64 dd 1 ;e_version: current version dq _start ;e_entry: program entry address (0x78) dq phdr - $$ ;e_phoff program header offset (0x40) dq 0 ;e_shoff no section headers dd 0 ;e_flags no flags dw ehdrsize ;e_ehsize: ELF header size (0x40) dw phdrsize ;e_phentsize: program header size (0x38) dw 1 ;e_phnum: one program header dw 0 ;e_shentsize dw 0 ;e_shnum dw 0 ;e_shstrndx ehdrsize equ $ - ehdr ;64-bit ELF program header phdr: dd 1 ;p_type: loadable segment dd 5 ;p_flags read and execute dq 0 ;p_offset dq $$ ;p_vaddr: start of the current section dq $$ ;p_paddr: dq filesize ;p_filesz dq filesize ;p_memsz dq 0x200000 ;p_align: 2^11=200000=11 bit boundaries ;program header size phdrsize equ $ - phdr ;Hello World!/your program here _start: xor rax,rax ;3 bytes mov edi,1 ;5 bytes mov esi,message ;5 bytes mov edx,message.len ;5 bytes inc rax ;3 bytes syscll: syscall ;2 bytes xor rdi,rdi ;3 bytes mov al,0x3c ;2 bytes jmp syscll ;2 bytes ;---------- ;30 bytes message: db 'Hello, world!',0x0a ;message and newline .len: equ $-message ;message length calculation ; File size calculation filesize equ $ - $$
oeis/142/A142842.asm
neoneye/loda-programs
11
22556
; A142842: Primes congruent to 44 mod 61. ; Submitted by <NAME> ; 227,349,593,1447,2179,2423,2789,3643,4253,5107,5351,5717,5839,6449,6571,7547,7669,9011,9133,9377,9743,10597,11329,11939,12671,13037,13159,14867,15233,16087,16453,17551,19259,19381,19991,20113,20357,20479,21089,21211,21577,21821,21943,23041,23773,24749,25237,25603,25847,25969,26701,27067,27799,28409,29629,29873,30727,30971,31337,32069,32191,32801,33289,33533,34631,35363,35729,35851,36217,36583,38047,39023,39511,39877,40487,40609,40853,41341,42073,42683,43049,43781,44269,44879,46099,46831,47441 mov $1,52 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,61 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,121
Appl/GeoWrite/Document/documentConvert.asm
steakknife/pcgeos
504
161932
COMMENT @---------------------------------------------------------------------- Copyright (c) Berkeley Softworks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: GeoWrite FILE: documentConvert.asm REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 3/92 Initial version DESCRIPTION: This file contains the document conversion code for WriteDocumentClass $Id: documentConvert.asm,v 1.1 97/04/04 15:56:22 newdeal Exp $ ------------------------------------------------------------------------------@ DocMiscFeatures segment resource COMMENT @---------------------------------------------------------------------- MESSAGE: WriteDocumentUpdateEarlierIncompatibleDocument -- MSG_GEN_DOCUMENT_UPDATE_EARLIER_INCOMPATIBLE_DOCUMENT for WriteDocumentClass DESCRIPTION: Convert a 1.X document to 2.0 PASS: *ds:si - instance data es - segment of WriteDocumentClass ax - The message RETURN: carry - set if error ax - error code DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 10/18/92 Initial version ------------------------------------------------------------------------------@ if not DBCS_PCGEOS convertLibDir char CONVERT_LIB_DIR convertLibPath char CONVERT_LIB_PATH endif WriteDocumentUpdateEarlierIncompatibleDocument method dynamic \ WriteDocumentClass, MSG_GEN_DOCUMENT_UPDATE_EARLIER_INCOMPATIBLE_DOCUMENT if not DBCS_PCGEOS psetup local PageSetupInfo blockList local word mapBlock local word convertLibHandle local hptr fileHandle local hptr convertParams local ConvertOldGWParams transferParams local CommonTransferParams oldProtocol local ProtocolNumber endif .enter if DBCS_PCGEOS stc ;don't want to load conversion lib; error instead. else call IgnoreUndoAndFlush mov bx, ds:[di].GDI_fileHandle mov fileHandle, bx call VMGetMapBlock ;ax = map block mov mapBlock, ax ; get the old protocol and check for transfer format files segmov es, ss lea di, oldProtocol mov ax, FEA_PROTOCOL mov cx, size oldProtocol call FileGetHandleExtAttributes LONG jc done cmp oldProtocol.PN_major, 1 jz oldDocument ; this is a transfer item in the map block call createLockSuspendGetParams movdw transferParams.CTP_range.VTR_start, 0 movdw transferParams.CTP_range.VTR_end, TEXT_ADDRESS_PAST_END mov ax, mapBlock mov transferParams.CTP_vmBlock, ax mov ax, fileHandle mov transferParams.CTP_vmFile, ax mov transferParams.CTP_pasteFrame, 0 movdw bxsi, convertParams.COGWP_mainObj mov ax, MSG_VIS_TEXT_REPLACE_WITH_TEXT_TRANSFER_FORMAT clr di call ObjMessage mov bx, fileHandle mov ax, mapBlock clr bp call VMFreeVMChain jmp unsuspendCommon oldDocument: ; Load the conversion library push ds, si segmov ds, cs mov bx, CONVERT_LIB_DISK_HANDLE mov dx, offset convertLibDir call FileSetCurrentPath jc popAndDone mov si, offset convertLibPath mov ax, CONVERT_PROTO_MAJOR mov bx, CONVERT_PROTO_MINOR call GeodeUseLibrary ;bx = library popAndDone: pop ds, si LONG jc done mov convertLibHandle, bx ; save a list of the blocks in the file mov ax, enum ConvertGetVMBlockList call callConvertRoutine mov blockList, ax ; create a new file call createLockSuspendGetParams mov cx, mapBlock lea di, psetup push si lea si, convertParams mov ax, enum ConvertOldGeoWriteDocument call callConvertRoutine pop si mov cx, blockList mov ax, enum ConvertDeleteViaBlockList call callConvertRoutine mov ax, VMA_OBJECT_ATTRS mov bx, fileHandle call VMSetAttributes push es segmov es, ss lea di, psetup ;es:di = page setup call UpdateFromPSI pop es mov bx, convertLibHandle call GeodeFreeLibrary unsuspendCommon: call UnsuspendDocument call VMUnlockES clc mov ax, TRUE ;update protocol done: call AcceptUndo endif .leave ret if not DBCS_PCGEOS ;--- createLockSuspendGetParams: push bp mov ax, MSG_GEN_DOCUMENT_INITIALIZE_DOCUMENT_FILE call ObjCallInstanceNoLock pop bp call LockMapBlockES call SuspendDocument ; for this to work at all we need upward linkage from the article ; to the document mov cx, ds:[LMBH_handle] mov dx, si ;cxdx = document mov ax, MSG_WRITE_ARTICLE_SET_VIS_PARENT mov di, mask MF_RECORD call SendToAllArticles ; get the OD of the first article push si, ds segmov ds, es mov si, offset ArticleArray clr ax call ChunkArrayElementToPtr ;es:di = first article pop si, ds mov ax, es:[di].AAE_articleBlock call WriteVMBlockToMemBlock ;ax = mem block mov convertParams.COGWP_mainObj.handle, ax mov convertParams.COGWP_mainObj.offset, offset ArticleText push si, ds clr ax call SectionArrayEToP_ES ;es:di = SectionArrayEl mov ax, es:[di].SAE_masterPages[0] ;ax = master page block mov bx, fileHandle push bp call VMLock pop bp mov ds, ax ;ds = master page movdw axsi, ds:[MPBH_header] call getHdrFtr movdw convertParams.COGWP_headerObj, axsi movdw axsi, ds:[MPBH_footer] call getHdrFtr movdw convertParams.COGWP_footerObj, axsi call VMUnlockDS pop si, ds mov convertParams.COGWP_mainStyle, TEXT_STYLE_NORMAL mov convertParams.COGWP_headerStyle, TEXT_STYLE_HEADER mov convertParams.COGWP_footerStyle, TEXT_STYLE_FOOTER retn ;--- ; ax = enum, si = value for bp callConvertRoutine: push bx, si, bp push fileHandle mov bx, convertLibHandle mov bp, si pop si ;si = file handle call ProcGetLibraryEntry call ProcCallFixedOrMovable pop bx, si, bp retn ; bx = file, ax = vm block, si = chunk getHdrFtr: push bx call VMVMBlockToMemBlock ;axsi = header mov_tr bx, ax ;bxsi = header mov ax, MSG_GOVG_GET_VIS_WARD_OD mov di, mask MF_CALL call ObjMessage ;cxdx = text object movdw axsi, cxdx pop bx retn endif WriteDocumentUpdateEarlierIncompatibleDocument endm DocMiscFeatures ends