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 |
|---|---|---|---|---|
.emacs.d/elpa/wisi-2.1.1/wisitoken-generate-lr.ads | caqg/linux-home | 0 | 26923 | -- Abstract :
--
-- Common utilities for LR parser table generators.
--
-- Copyright (C) 2017 - 2019 Free Software Foundation, Inc.
--
-- This library is free software; you can redistribute it and/or modify it
-- under terms of the GNU General Public License as published by the Free
-- Software Foundation; either version 3, or (at your option) any later
-- version. This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
-- TABILITY 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.
pragma License (Modified_GPL);
with Ada.Containers.Doubly_Linked_Lists;
with WisiToken.Generate.LR1_Items;
with WisiToken.Parse.LR;
with WisiToken.Productions;
package WisiToken.Generate.LR is
use WisiToken.Parse.LR;
subtype Conflict_Parse_Actions is Parse_Action_Verbs range Shift .. Accept_It;
type Conflict is record
-- A typical conflict is:
--
-- SHIFT/REDUCE in state: 11 on token IS
--
-- State numbers change with minor changes in the grammar, so we
-- attempt to identify the state by the LHS of the two productions
-- involved; this is _not_ guarranteed to be unique, but is good
-- enough for our purposes. We also store the state number for
-- generated conflicts (not for known conflicts from the grammar
-- definition file), for debugging.
Action_A : Conflict_Parse_Actions;
LHS_A : Token_ID;
Action_B : Conflict_Parse_Actions;
LHS_B : Token_ID;
State_Index : Unknown_State_Index;
On : Token_ID;
end record;
package Conflict_Lists is new Ada.Containers.Doubly_Linked_Lists (Conflict);
type Conflict_Count is record
State : State_Index;
Accept_Reduce : Integer := 0;
Shift_Reduce : Integer := 0;
Reduce_Reduce : Integer := 0;
end record;
package Conflict_Count_Lists is new Ada.Containers.Doubly_Linked_Lists (Conflict_Count);
procedure Put
(Item : in Conflict_Lists.List;
File : in Ada.Text_IO.File_Type;
Descriptor : in WisiToken.Descriptor);
procedure Add_Action
(Symbol : in Token_ID;
Action : in Parse_Action_Rec;
Action_List : in out Action_Node_Ptr;
Closure : in LR1_Items.Item_Set;
Grammar : in WisiToken.Productions.Prod_Arrays.Vector;
Has_Empty_Production : in Token_ID_Set;
First_Nonterm_Set : in Token_Array_Token_Set;
Conflict_Counts : in out Conflict_Count_Lists.List;
Conflicts : in out Conflict_Lists.List;
Descriptor : in WisiToken.Descriptor);
-- Add (Symbol, Action) to Action_List; check for conflicts
--
-- Closure .. Conflicts are for conflict reporting
procedure Add_Actions
(Closure : in LR1_Items.Item_Set;
Table : in out Parse_Table;
Grammar : in WisiToken.Productions.Prod_Arrays.Vector;
Has_Empty_Production : in Token_ID_Set;
First_Nonterm_Set : in Token_Array_Token_Set;
Conflict_Counts : in out Conflict_Count_Lists.List;
Conflicts : in out Conflict_Lists.List;
Descriptor : in WisiToken.Descriptor);
-- Add actions for Closure to Table. Has_Empty_Production, First,
-- Conflicts used for conflict reporting.
procedure Add_Lookahead_Actions
(Item : in LR1_Items.Item;
Action_List : in out Action_Node_Ptr;
Grammar : in WisiToken.Productions.Prod_Arrays.Vector;
Has_Empty_Production : in Token_ID_Set;
First_Nonterm_Set : in Token_Array_Token_Set;
Conflict_Counts : in out Conflict_Count_Lists.List;
Conflicts : in out Conflict_Lists.List;
Closure : in LR1_Items.Item_Set;
Descriptor : in WisiToken.Descriptor);
-- Add actions for Item.Lookaheads to Action_List
-- Closure must be from the item set containing Item.
-- Has_Empty_Production .. Closure used for conflict reporting.
procedure Delete_Known
(Conflicts : in out Conflict_Lists.List;
Known_Conflicts : in out Conflict_Lists.List);
-- Delete Known_Conflicts from Conflicts.
function Find
(Closure : in LR1_Items.Item_Set;
Action : in Parse_Action_Rec;
Lookahead : in Token_ID;
Grammar : in WisiToken.Productions.Prod_Arrays.Vector;
Has_Empty_Production : in Token_ID_Set;
First : in Token_Array_Token_Set;
Descriptor : in WisiToken.Descriptor)
return Token_ID;
-- Return the LHS of a production in kernel of Closure, for an Action
-- conflict on Lookahead; for naming a Conflict object.
function Image (Item : in Conflict; Descriptor : in WisiToken.Descriptor) return String;
function Is_Present (Item : in Conflict; Conflicts : in Conflict_Lists.List) return Boolean;
function Match (Known : in Conflict; Item : in Conflict_Lists.Constant_Reference_Type) return Boolean;
----------
-- Minimal terminal sequences.
type RHS_Sequence is
record
Recursion : Recursion_Lists.List;
-- All recursion cycles involving this RHS.
Worst_Recursion : WisiToken.Recursion := None; -- worst case of all Recursion.
Sequence : Token_ID_Arrays.Vector;
end record;
package RHS_Sequence_Arrays is new SAL.Gen_Unbounded_Definite_Vectors
(Natural, RHS_Sequence, Default_Element => (others => <>));
function Image (Item : in RHS_Sequence; Descriptor : in WisiToken.Descriptor) return String;
-- Positional Ada aggregate syntax.
function Image is new RHS_Sequence_Arrays.Gen_Image_Aux (Descriptor, Trimmed_Image, Image);
function Min (Item : in RHS_Sequence_Arrays.Vector) return RHS_Sequence;
-- Return element of Item with minimum length;
type Minimal_Sequence_Array is array (Token_ID range <>) of RHS_Sequence_Arrays.Vector;
function Compute_Minimal_Terminal_Sequences
(Descriptor : in WisiToken.Descriptor;
Grammar : in WisiToken.Productions.Prod_Arrays.Vector;
Recursions : in Generate.Recursions)
return Minimal_Sequence_Array;
-- For each production in Grammar, compute the minimal sequence of
-- terminals that will complete it. Result is an empty sequence if
-- the production may be empty.
function Compute_Minimal_Terminal_First
(Descriptor : in WisiToken.Descriptor;
Minimal_Terminal_Sequences : in Minimal_Sequence_Array)
return Token_Array_Token_ID;
-- For each nonterminal in Grammar, return the first of the minimal
-- sequence of terminals that will complete it; Invalid_Token_ID if
-- the minimal sequence is empty.
procedure Set_Minimal_Complete_Actions
(State : in out Parse_State;
Kernel : in LR1_Items.Item_Set;
Descriptor : in WisiToken.Descriptor;
Grammar : in WisiToken.Productions.Prod_Arrays.Vector;
Minimal_Terminal_Sequences : in Minimal_Sequence_Array;
Minimal_Terminal_First : in Token_Array_Token_ID);
-- Set State.Minimal_Complete_Actions to the set of actions that will
-- most quickly complete the productions in Kernel (which must be for
-- State). Useful in error correction when we know the next actual
-- terminal is a block ending or statement start.
--
-- The Minimal_Complete_Actions will be empty in a state where there
-- is nothing useful to do; the accept state, or one where all
-- productions are recursive.
--
-- Also set State.Kernels; used to resolve multiple reduce actions at
-- runtime.
----------
-- Parse table output
procedure Put_Text_Rep
(Table : in Parse_Table;
File_Name : in String;
Action_Names : in Names_Array_Array;
Check_Names : in Names_Array_Array);
-- Write machine-readable text format of Table.States to a file
-- File_Name, to be read by the parser executable at startup, using
-- WisiToken.Parse.LR.Get_Text_Rep.
procedure Put (Item : in Parse_Action_Rec; Descriptor : in WisiToken.Descriptor);
procedure Put (Item : in McKenzie_Param_Type; Descriptor : in WisiToken.Descriptor);
procedure Put (Descriptor : in WisiToken.Descriptor; Item : in Parse_Action_Rec);
procedure Put (Descriptor : in WisiToken.Descriptor; Action : in Parse_Action_Node_Ptr);
procedure Put (Descriptor : in WisiToken.Descriptor; State : in Parse_State);
-- Put Item to Ada.Text_IO.Current_Output in parse table format.
procedure Put_Parse_Table
(Table : in Parse_Table_Ptr;
Title : in String;
Grammar : in WisiToken.Productions.Prod_Arrays.Vector;
Recursions : in Generate.Recursions;
Minimal_Terminal_Sequences : in Minimal_Sequence_Array;
Kernels : in LR1_Items.Item_Set_List;
Conflicts : in Conflict_Count_Lists.List;
Descriptor : in WisiToken.Descriptor;
Include_Extra : in Boolean := False);
-- "Extra" is recursions, lookaheads.
end WisiToken.Generate.LR;
|
llvm-gcc-4.2-2.9/gcc/ada/exp_intr.adb | vidkidz/crossbridge | 1 | 9888 | <gh_stars>1-10
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ I N T R --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, 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 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, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
with Exp_Ch4; use Exp_Ch4;
with Exp_Ch7; use Exp_Ch7;
with Exp_Ch11; use Exp_Ch11;
with Exp_Code; use Exp_Code;
with Exp_Disp; use Exp_Disp;
with Exp_Fixd; use Exp_Fixd;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Namet; use Namet;
with Nmake; use Nmake;
with Nlists; use Nlists;
with Restrict; use Restrict;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Snames; use Snames;
with Stand; use Stand;
with Stringt; use Stringt;
with Tbuild; use Tbuild;
with Uintp; use Uintp;
with Urealp; use Urealp;
package body Exp_Intr is
-----------------------
-- Local Subprograms --
-----------------------
procedure Expand_Is_Negative (N : Node_Id);
-- Expand a call to the intrinsic Is_Negative function
procedure Expand_Dispatching_Constructor_Call (N : Node_Id);
-- Expand a call to an instantiation of Generic_Dispatching_Constructor
-- into a dispatching call to the actual subprogram associated with the
-- Constructor formal subprogram, passing it the Parameters actual of
-- the call to the instantiation and dispatching based on call's Tag
-- parameter.
procedure Expand_Exception_Call (N : Node_Id; Ent : RE_Id);
-- Expand a call to Exception_Information/Message/Name. The first
-- parameter, N, is the node for the function call, and Ent is the
-- entity for the corresponding routine in the Ada.Exceptions package.
procedure Expand_Import_Call (N : Node_Id);
-- Expand a call to Import_Address/Longest_Integer/Value. The parameter
-- N is the node for the function call.
procedure Expand_Shift (N : Node_Id; E : Entity_Id; K : Node_Kind);
-- Expand an intrinsic shift operation, N and E are from the call to
-- Expand_Intrinsic_Call (call node and subprogram spec entity) and
-- K is the kind for the shift node
procedure Expand_Unc_Conversion (N : Node_Id; E : Entity_Id);
-- Expand a call to an instantiation of Unchecked_Convertion into a node
-- N_Unchecked_Type_Conversion.
procedure Expand_Unc_Deallocation (N : Node_Id);
-- Expand a call to an instantiation of Unchecked_Deallocation into a node
-- N_Free_Statement and appropriate context.
procedure Expand_To_Address (N : Node_Id);
procedure Expand_To_Pointer (N : Node_Id);
-- Expand a call to corresponding function, declared in an instance of
-- System.Addess_To_Access_Conversions.
procedure Expand_Source_Info (N : Node_Id; Nam : Name_Id);
-- Rewrite the node by the appropriate string or positive constant.
-- Nam can be one of the following:
-- Name_File - expand string that is the name of source file
-- Name_Line - expand integer line number
-- Name_Source_Location - expand string of form file:line
-- Name_Enclosing_Entity - expand string with name of enclosing entity
-----------------------------------------
-- Expand_Dispatching_Constructor_Call --
-----------------------------------------
-- Transform a call to an instantiation of Generic_Dispatching_Constructor
-- of the form:
-- GDC_Instance (The_Tag, Parameters'Access)
-- to a class-wide conversion of a dispatching call to the actual
-- associated with the formal subprogram Construct, designating
-- The_Tag as the controlling tag of the call:
-- T'Class (Construct'Actual (Params)) -- Controlling tag is The_Tag
-- which will eventually be expanded to the following:
-- T'Class (The_Tag.all (Construct'Actual'Index).all (Params))
-- A class-wide membership test is also generated, preceding the call,
-- to ensure that the controlling tag denotes a type in T'Class.
procedure Expand_Dispatching_Constructor_Call (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Tag_Arg : constant Node_Id := First_Actual (N);
Param_Arg : constant Node_Id := Next_Actual (Tag_Arg);
Subp_Decl : constant Node_Id := Parent (Parent (Entity (Name (N))));
Inst_Pkg : constant Node_Id := Parent (Subp_Decl);
Act_Rename : Node_Id;
Act_Constr : Entity_Id;
Result_Typ : Entity_Id;
Cnstr_Call : Node_Id;
begin
-- The subprogram is the third actual in the instantiation, and is
-- retrieved from the corresponding renaming declaration. However,
-- freeze nodes may appear before, so we retrieve the declaration
-- with an explicit loop.
Act_Rename := First (Visible_Declarations (Inst_Pkg));
while Nkind (Act_Rename) /= N_Subprogram_Renaming_Declaration loop
Next (Act_Rename);
end loop;
Act_Constr := Entity (Name (Act_Rename));
Result_Typ := Class_Wide_Type (Etype (Act_Constr));
-- Create the call to the actual Constructor function
Cnstr_Call :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Act_Constr, Loc),
Parameter_Associations => New_List (Relocate_Node (Param_Arg)));
-- Establish its controlling tag from the tag passed to the instance
Set_Controlling_Argument (Cnstr_Call, Relocate_Node (Tag_Arg));
-- Rewrite and analyze the call to the instance as a class-wide
-- conversion of the call to the actual constructor.
Rewrite (N, Convert_To (Result_Typ, Cnstr_Call));
Analyze_And_Resolve (N, Etype (Act_Constr));
-- Generate a class-wide membership test to ensure that the call's tag
-- argument denotes a type within the class.
Insert_Action (N,
Make_Implicit_If_Statement (N,
Condition =>
Make_Op_Not (Loc,
Make_DT_Access_Action (Result_Typ,
Action => CW_Membership,
Args => New_List (
Duplicate_Subexpr (Tag_Arg),
New_Reference_To (
Node (First_Elmt (Access_Disp_Table (
Root_Type (Result_Typ)))), Loc)))),
Then_Statements =>
New_List (Make_Raise_Statement (Loc,
New_Occurrence_Of (RTE (RE_Tag_Error), Loc)))));
end Expand_Dispatching_Constructor_Call;
---------------------------
-- Expand_Exception_Call --
---------------------------
-- If the function call is not within an exception handler, then the
-- call is replaced by a null string. Otherwise the appropriate routine
-- in Ada.Exceptions is called passing the choice parameter specification
-- from the enclosing handler. If the enclosing handler lacks a choice
-- parameter, then one is supplied.
procedure Expand_Exception_Call (N : Node_Id; Ent : RE_Id) is
Loc : constant Source_Ptr := Sloc (N);
P : Node_Id;
E : Entity_Id;
begin
-- Climb up parents to see if we are in exception handler
P := Parent (N);
loop
-- Case of not in exception handler, replace by null string
if No (P) then
Rewrite (N,
Make_String_Literal (Loc,
Strval => ""));
exit;
-- Case of in exception handler
elsif Nkind (P) = N_Exception_Handler then
if No (Choice_Parameter (P)) then
-- If no choice parameter present, then put one there. Note
-- that we do not need to put it on the entity chain, since
-- no one will be referencing it by normal visibility methods.
E := Make_Defining_Identifier (Loc, New_Internal_Name ('E'));
Set_Choice_Parameter (P, E);
Set_Ekind (E, E_Variable);
Set_Etype (E, RTE (RE_Exception_Occurrence));
Set_Scope (E, Current_Scope);
end if;
Rewrite (N,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (RTE (Ent), Loc),
Parameter_Associations => New_List (
New_Occurrence_Of (Choice_Parameter (P), Loc))));
exit;
-- Keep climbing!
else
P := Parent (P);
end if;
end loop;
Analyze_And_Resolve (N, Standard_String);
end Expand_Exception_Call;
------------------------
-- Expand_Import_Call --
------------------------
-- The function call must have a static string as its argument. We create
-- a dummy variable which uses this string as the external name in an
-- Import pragma. The result is then obtained as the address of this
-- dummy variable, converted to the appropriate target type.
procedure Expand_Import_Call (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ent : constant Entity_Id := Entity (Name (N));
Str : constant Node_Id := First_Actual (N);
Dum : Entity_Id;
begin
Dum := Make_Defining_Identifier (Loc, New_Internal_Name ('D'));
Insert_Actions (N, New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => Dum,
Object_Definition =>
New_Occurrence_Of (Standard_Character, Loc)),
Make_Pragma (Loc,
Chars => Name_Import,
Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Loc,
Expression => Make_Identifier (Loc, Name_Ada)),
Make_Pragma_Argument_Association (Loc,
Expression => Make_Identifier (Loc, Chars (Dum))),
Make_Pragma_Argument_Association (Loc,
Chars => Name_Link_Name,
Expression => Relocate_Node (Str))))));
Rewrite (N,
Unchecked_Convert_To (Etype (Ent),
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address,
Prefix => Make_Identifier (Loc, Chars (Dum)))));
Analyze_And_Resolve (N, Etype (Ent));
end Expand_Import_Call;
---------------------------
-- Expand_Intrinsic_Call --
---------------------------
procedure Expand_Intrinsic_Call (N : Node_Id; E : Entity_Id) is
Nam : Name_Id;
begin
-- If the intrinsic subprogram is generic, gets its original name
if Present (Parent (E))
and then Present (Generic_Parent (Parent (E)))
then
Nam := Chars (Generic_Parent (Parent (E)));
else
Nam := Chars (E);
end if;
if Nam = Name_Asm then
Expand_Asm_Call (N);
elsif Nam = Name_Divide then
Expand_Decimal_Divide_Call (N);
elsif Nam = Name_Exception_Information then
Expand_Exception_Call (N, RE_Exception_Information);
elsif Nam = Name_Exception_Message then
Expand_Exception_Call (N, RE_Exception_Message);
elsif Nam = Name_Exception_Name then
Expand_Exception_Call (N, RE_Exception_Name_Simple);
elsif Nam = Name_Generic_Dispatching_Constructor then
Expand_Dispatching_Constructor_Call (N);
elsif Nam = Name_Import_Address
or else
Nam = Name_Import_Largest_Value
or else
Nam = Name_Import_Value
then
Expand_Import_Call (N);
elsif Nam = Name_Is_Negative then
Expand_Is_Negative (N);
elsif Nam = Name_Rotate_Left then
Expand_Shift (N, E, N_Op_Rotate_Left);
elsif Nam = Name_Rotate_Right then
Expand_Shift (N, E, N_Op_Rotate_Right);
elsif Nam = Name_Shift_Left then
Expand_Shift (N, E, N_Op_Shift_Left);
elsif Nam = Name_Shift_Right then
Expand_Shift (N, E, N_Op_Shift_Right);
elsif Nam = Name_Shift_Right_Arithmetic then
Expand_Shift (N, E, N_Op_Shift_Right_Arithmetic);
elsif Nam = Name_Unchecked_Conversion then
Expand_Unc_Conversion (N, E);
elsif Nam = Name_Unchecked_Deallocation then
Expand_Unc_Deallocation (N);
elsif Nam = Name_To_Address then
Expand_To_Address (N);
elsif Nam = Name_To_Pointer then
Expand_To_Pointer (N);
elsif Nam = Name_File
or else Nam = Name_Line
or else Nam = Name_Source_Location
or else Nam = Name_Enclosing_Entity
then
Expand_Source_Info (N, Nam);
-- If we have a renaming, expand the call to the original operation,
-- which must itself be intrinsic, since renaming requires matching
-- conventions and this has already been checked.
elsif Present (Alias (E)) then
Expand_Intrinsic_Call (N, Alias (E));
-- The only other case is where an external name was specified,
-- since this is the only way that an otherwise unrecognized
-- name could escape the checking in Sem_Prag. Nothing needs
-- to be done in such a case, since we pass such a call to the
-- back end unchanged.
else
null;
end if;
end Expand_Intrinsic_Call;
------------------------
-- Expand_Is_Negative --
------------------------
procedure Expand_Is_Negative (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Opnd : constant Node_Id := Relocate_Node (First_Actual (N));
begin
-- We replace the function call by the following expression
-- if Opnd < 0.0 then
-- True
-- else
-- if Opnd > 0.0 then
-- False;
-- else
-- Float_Unsigned!(Float (Opnd)) /= 0
-- end if;
-- end if;
Rewrite (N,
Make_Conditional_Expression (Loc,
Expressions => New_List (
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr (Opnd),
Right_Opnd => Make_Real_Literal (Loc, Ureal_0)),
New_Occurrence_Of (Standard_True, Loc),
Make_Conditional_Expression (Loc,
Expressions => New_List (
Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Opnd),
Right_Opnd => Make_Real_Literal (Loc, Ureal_0)),
New_Occurrence_Of (Standard_False, Loc),
Make_Op_Ne (Loc,
Left_Opnd =>
Unchecked_Convert_To
(RTE (RE_Float_Unsigned),
Convert_To
(Standard_Float,
Duplicate_Subexpr_No_Checks (Opnd))),
Right_Opnd =>
Make_Integer_Literal (Loc, 0)))))));
Analyze_And_Resolve (N, Standard_Boolean);
end Expand_Is_Negative;
------------------
-- Expand_Shift --
------------------
-- This procedure is used to convert a call to a shift function to the
-- corresponding operator node. This conversion is not done by the usual
-- circuit for converting calls to operator functions (e.g. "+"(1,2)) to
-- operator nodes, because shifts are not predefined operators.
-- As a result, whenever a shift is used in the source program, it will
-- remain as a call until converted by this routine to the operator node
-- form which Gigi is expecting to see.
-- Note: it is possible for the expander to generate shift operator nodes
-- directly, which will be analyzed in the normal manner by calling Analyze
-- and Resolve. Such shift operator nodes will not be seen by Expand_Shift.
procedure Expand_Shift (N : Node_Id; E : Entity_Id; K : Node_Kind) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Left : constant Node_Id := First_Actual (N);
Right : constant Node_Id := Next_Actual (Left);
Ltyp : constant Node_Id := Etype (Left);
Rtyp : constant Node_Id := Etype (Right);
Snode : Node_Id;
begin
Snode := New_Node (K, Loc);
Set_Left_Opnd (Snode, Relocate_Node (Left));
Set_Right_Opnd (Snode, Relocate_Node (Right));
Set_Chars (Snode, Chars (E));
Set_Etype (Snode, Base_Type (Typ));
Set_Entity (Snode, E);
if Compile_Time_Known_Value (Type_High_Bound (Rtyp))
and then Expr_Value (Type_High_Bound (Rtyp)) < Esize (Ltyp)
then
Set_Shift_Count_OK (Snode, True);
end if;
-- Do the rewrite. Note that we don't call Analyze and Resolve on
-- this node, because it already got analyzed and resolved when
-- it was a function call!
Rewrite (N, Snode);
Set_Analyzed (N);
end Expand_Shift;
------------------------
-- Expand_Source_Info --
------------------------
procedure Expand_Source_Info (N : Node_Id; Nam : Name_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ent : Entity_Id;
procedure Write_Entity_Name (E : Entity_Id);
-- Recursive procedure to construct string for qualified name of
-- enclosing program unit. The qualification stops at an enclosing
-- scope has no source name (block or loop). If entity is a subprogram
-- instance, skip enclosing wrapper package.
-----------------------
-- Write_Entity_Name --
-----------------------
procedure Write_Entity_Name (E : Entity_Id) is
SDef : Source_Ptr;
TDef : constant Source_Buffer_Ptr :=
Source_Text (Get_Source_File_Index (Sloc (E)));
begin
-- Nothing to do if at outer level
if Scope (E) = Standard_Standard then
null;
-- If scope comes from source, write its name
elsif Comes_From_Source (Scope (E)) then
Write_Entity_Name (Scope (E));
Add_Char_To_Name_Buffer ('.');
-- If in wrapper package skip past it
elsif Is_Wrapper_Package (Scope (E)) then
Write_Entity_Name (Scope (Scope (E)));
Add_Char_To_Name_Buffer ('.');
-- Otherwise nothing to output (happens in unnamed block statements)
else
null;
end if;
-- Loop to output the name
-- is this right wrt wide char encodings ??? (no!)
SDef := Sloc (E);
while TDef (SDef) in '0' .. '9'
or else TDef (SDef) >= 'A'
or else TDef (SDef) = ASCII.ESC
loop
Add_Char_To_Name_Buffer (TDef (SDef));
SDef := SDef + 1;
end loop;
end Write_Entity_Name;
-- Start of processing for Expand_Source_Info
begin
-- Integer cases
if Nam = Name_Line then
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => UI_From_Int (Int (Get_Logical_Line_Number (Loc)))));
Analyze_And_Resolve (N, Standard_Positive);
-- String cases
else
case Nam is
when Name_File =>
Get_Decoded_Name_String
(Reference_Name (Get_Source_File_Index (Loc)));
when Name_Source_Location =>
Build_Location_String (Loc);
when Name_Enclosing_Entity =>
Name_Len := 0;
Ent := Current_Scope;
-- Skip enclosing blocks to reach enclosing unit
while Present (Ent) loop
exit when Ekind (Ent) /= E_Block
and then Ekind (Ent) /= E_Loop;
Ent := Scope (Ent);
end loop;
-- Ent now points to the relevant defining entity
Name_Len := 0;
Write_Entity_Name (Ent);
when others =>
raise Program_Error;
end case;
Rewrite (N,
Make_String_Literal (Loc, Strval => String_From_Name_Buffer));
Analyze_And_Resolve (N, Standard_String);
end if;
Set_Is_Static_Expression (N);
end Expand_Source_Info;
---------------------------
-- Expand_Unc_Conversion --
---------------------------
procedure Expand_Unc_Conversion (N : Node_Id; E : Entity_Id) is
Func : constant Entity_Id := Entity (Name (N));
Conv : Node_Id;
Ftyp : Entity_Id;
Ttyp : Entity_Id;
begin
-- Rewrite as unchecked conversion node. Note that we must convert
-- the operand to the formal type of the input parameter of the
-- function, so that the resulting N_Unchecked_Type_Conversion
-- call indicates the correct types for Gigi.
-- Right now, we only do this if a scalar type is involved. It is
-- not clear if it is needed in other cases. If we do attempt to
-- do the conversion unconditionally, it crashes 3411-018. To be
-- investigated further ???
Conv := Relocate_Node (First_Actual (N));
Ftyp := Etype (First_Formal (Func));
if Is_Scalar_Type (Ftyp) then
Conv := Convert_To (Ftyp, Conv);
Set_Parent (Conv, N);
Analyze_And_Resolve (Conv);
end if;
-- The instantiation of Unchecked_Conversion creates a wrapper package,
-- and the target type is declared as a subtype of the actual. Recover
-- the actual, which is the subtype indic. in the subtype declaration
-- for the target type. This is semantically correct, and avoids
-- anomalies with access subtypes. For entities, leave type as is.
-- We do the analysis here, because we do not want the compiler
-- to try to optimize or otherwise reorganize the unchecked
-- conversion node.
Ttyp := Etype (E);
if Is_Entity_Name (Conv) then
null;
elsif Nkind (Parent (Ttyp)) = N_Subtype_Declaration then
Ttyp := Entity (Subtype_Indication (Parent (Etype (E))));
elsif Is_Itype (Ttyp) then
Ttyp :=
Entity (Subtype_Indication (Associated_Node_For_Itype (Ttyp)));
else
raise Program_Error;
end if;
Rewrite (N, Unchecked_Convert_To (Ttyp, Conv));
Set_Etype (N, Ttyp);
Set_Analyzed (N);
if Nkind (N) = N_Unchecked_Type_Conversion then
Expand_N_Unchecked_Type_Conversion (N);
end if;
end Expand_Unc_Conversion;
-----------------------------
-- Expand_Unc_Deallocation --
-----------------------------
-- Generate the following Code :
-- if Arg /= null then
-- <Finalize_Call> (.., T'Class(Arg.all), ..); -- for controlled types
-- Free (Arg);
-- Arg := Null;
-- end if;
-- For a task, we also generate a call to Free_Task to ensure that the
-- task itself is freed if it is terminated, ditto for a simple protected
-- object, with a call to Finalize_Protection. For composite types that
-- have tasks or simple protected objects as components, we traverse the
-- structures to find and terminate those components.
procedure Expand_Unc_Deallocation (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Arg : constant Node_Id := First_Actual (N);
Typ : constant Entity_Id := Etype (Arg);
Stmts : constant List_Id := New_List;
Rtyp : constant Entity_Id := Underlying_Type (Root_Type (Typ));
Pool : constant Entity_Id := Associated_Storage_Pool (Rtyp);
Desig_T : constant Entity_Id := Designated_Type (Typ);
Gen_Code : Node_Id;
Free_Node : Node_Id;
Deref : Node_Id;
Free_Arg : Node_Id;
Free_Cod : List_Id;
Blk : Node_Id;
Arg_Known_Non_Null : constant Boolean := Known_Non_Null (N);
-- This captures whether we know the argument to be non-null so that
-- we can avoid the test. The reason that we need to capture this is
-- that we analyze some generated statements before properly attaching
-- them to the tree, and that can disturb current value settings.
begin
if No_Pool_Assigned (Rtyp) then
Error_Msg_N ("?deallocation from empty storage pool", N);
end if;
-- Nothing to do if we know the argument is null
if Known_Null (N) then
return;
end if;
-- Processing for pointer to controlled type
if Controlled_Type (Desig_T) then
Deref :=
Make_Explicit_Dereference (Loc,
Prefix => Duplicate_Subexpr_No_Checks (Arg));
-- If the type is tagged, then we must force dispatching on the
-- finalization call because the designated type may not be the
-- actual type of the object.
if Is_Tagged_Type (Desig_T)
and then not Is_Class_Wide_Type (Desig_T)
then
Deref := Unchecked_Convert_To (Class_Wide_Type (Desig_T), Deref);
elsif not Is_Tagged_Type (Desig_T) then
-- Set type of result, to force a conversion when needed (see
-- exp_ch7, Convert_View), given that Deep_Finalize may be
-- inherited from the parent type, and we need the type of the
-- expression to see whether the conversion is in fact needed.
Set_Etype (Deref, Desig_T);
end if;
Free_Cod :=
Make_Final_Call
(Ref => Deref,
Typ => Desig_T,
With_Detach => New_Reference_To (Standard_True, Loc));
if Abort_Allowed then
Prepend_To (Free_Cod,
Build_Runtime_Call (Loc, RE_Abort_Defer));
Blk :=
Make_Block_Statement (Loc, Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Free_Cod,
At_End_Proc =>
New_Occurrence_Of (RTE (RE_Abort_Undefer_Direct), Loc)));
-- We now expand the exception (at end) handler. We set a
-- temporary parent pointer since we have not attached Blk
-- to the tree yet.
Set_Parent (Blk, N);
Analyze (Blk);
Expand_At_End_Handler
(Handled_Statement_Sequence (Blk), Entity (Identifier (Blk)));
Append (Blk, Stmts);
-- We kill saved current values, since analyzing statements not
-- properly attached to the tree can set wrong current values.
Kill_Current_Values;
else
Append_List_To (Stmts, Free_Cod);
end if;
end if;
-- For a task type, call Free_Task before freeing the ATCB
if Is_Task_Type (Desig_T) then
declare
Stat : Node_Id := Prev (N);
Nam1 : Node_Id;
Nam2 : Node_Id;
begin
-- An Abort followed by a Free will not do what the user
-- expects, because the abort is not immediate. This is
-- worth a friendly warning.
while Present (Stat)
and then not Comes_From_Source (Original_Node (Stat))
loop
Prev (Stat);
end loop;
if Present (Stat)
and then Nkind (Original_Node (Stat)) = N_Abort_Statement
then
Stat := Original_Node (Stat);
Nam1 := First (Names (Stat));
Nam2 := Original_Node (First (Parameter_Associations (N)));
if Nkind (Nam1) = N_Explicit_Dereference
and then Is_Entity_Name (Prefix (Nam1))
and then Is_Entity_Name (Nam2)
and then Entity (Prefix (Nam1)) = Entity (Nam2)
then
Error_Msg_N ("abort may take time to complete?", N);
Error_Msg_N ("\deallocation might have no effect?", N);
Error_Msg_N ("\safer to wait for termination.?", N);
end if;
end if;
end;
Append_To
(Stmts, Cleanup_Task (N, Duplicate_Subexpr_No_Checks (Arg)));
-- For composite types that contain tasks, recurse over the structure
-- to build the selectors for the task subcomponents.
elsif Has_Task (Desig_T) then
if Is_Record_Type (Desig_T) then
Append_List_To (Stmts, Cleanup_Record (N, Arg, Desig_T));
elsif Is_Array_Type (Desig_T) then
Append_List_To (Stmts, Cleanup_Array (N, Arg, Desig_T));
end if;
end if;
-- Same for simple protected types. Eventually call Finalize_Protection
-- before freeing the PO for each protected component.
if Is_Simple_Protected_Type (Desig_T) then
Append_To (Stmts,
Cleanup_Protected_Object (N, Duplicate_Subexpr_No_Checks (Arg)));
elsif Has_Simple_Protected_Object (Desig_T) then
if Is_Record_Type (Desig_T) then
Append_List_To (Stmts, Cleanup_Record (N, Arg, Desig_T));
elsif Is_Array_Type (Desig_T) then
Append_List_To (Stmts, Cleanup_Array (N, Arg, Desig_T));
end if;
end if;
-- Normal processing for non-controlled types
Free_Arg := Duplicate_Subexpr_No_Checks (Arg);
Free_Node := Make_Free_Statement (Loc, Empty);
Append_To (Stmts, Free_Node);
Set_Storage_Pool (Free_Node, Pool);
-- Deal with storage pool
if Present (Pool) then
-- Freeing the secondary stack is meaningless
if Is_RTE (Pool, RE_SS_Pool) then
null;
elsif Is_Class_Wide_Type (Etype (Pool)) then
-- Case of a class-wide pool type: make a dispatching call
-- to Deallocate through the class-wide Deallocate_Any.
Set_Procedure_To_Call (Free_Node,
RTE (RE_Deallocate_Any));
else
-- Case of a specific pool type: make a statically bound call
Set_Procedure_To_Call (Free_Node,
Find_Prim_Op (Etype (Pool), Name_Deallocate));
end if;
end if;
if Present (Procedure_To_Call (Free_Node)) then
-- For all cases of a Deallocate call, the back-end needs to be
-- able to compute the size of the object being freed. This may
-- require some adjustments for objects of dynamic size.
--
-- If the type is class wide, we generate an implicit type with the
-- right dynamic size, so that the deallocate call gets the right
-- size parameter computed by GIGI. Same for an access to
-- unconstrained packed array.
if Is_Class_Wide_Type (Desig_T)
or else
(Is_Array_Type (Desig_T)
and then not Is_Constrained (Desig_T)
and then Is_Packed (Desig_T))
then
declare
Deref : constant Node_Id :=
Make_Explicit_Dereference (Loc,
Duplicate_Subexpr_No_Checks (Arg));
D_Subtyp : Node_Id;
D_Type : Entity_Id;
begin
Set_Etype (Deref, Typ);
Set_Parent (Deref, Free_Node);
D_Subtyp := Make_Subtype_From_Expr (Deref, Desig_T);
if Nkind (D_Subtyp) in N_Has_Entity then
D_Type := Entity (D_Subtyp);
else
D_Type := Make_Defining_Identifier (Loc,
New_Internal_Name ('A'));
Insert_Action (N,
Make_Subtype_Declaration (Loc,
Defining_Identifier => D_Type,
Subtype_Indication => D_Subtyp));
Freeze_Itype (D_Type, N);
end if;
Set_Actual_Designated_Subtype (Free_Node, D_Type);
end;
end if;
end if;
Set_Expression (Free_Node, Free_Arg);
-- Only remaining step is to set result to null, or generate a
-- raise of constraint error if the target object is "not null".
if Can_Never_Be_Null (Etype (Arg)) then
Append_To (Stmts,
Make_Raise_Constraint_Error (Loc,
Reason => CE_Access_Check_Failed));
else
declare
Lhs : constant Node_Id := Duplicate_Subexpr_No_Checks (Arg);
begin
Set_Assignment_OK (Lhs);
Append_To (Stmts,
Make_Assignment_Statement (Loc,
Name => Lhs,
Expression => Make_Null (Loc)));
end;
end if;
-- If we know the argument is non-null, then make a block statement
-- that contains the required statements, no need for a test.
if Arg_Known_Non_Null then
Gen_Code :=
Make_Block_Statement (Loc,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Stmts));
-- If the argument may be null, wrap the statements inside an IF that
-- does an explicit test to exclude the null case.
else
Gen_Code :=
Make_Implicit_If_Statement (N,
Condition =>
Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr (Arg),
Right_Opnd => Make_Null (Loc)),
Then_Statements => Stmts);
end if;
-- Rewrite the call
Rewrite (N, Gen_Code);
Analyze (N);
end Expand_Unc_Deallocation;
-----------------------
-- Expand_To_Address --
-----------------------
procedure Expand_To_Address (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Arg : constant Node_Id := First_Actual (N);
Obj : Node_Id;
begin
Remove_Side_Effects (Arg);
Obj := Make_Explicit_Dereference (Loc, Relocate_Node (Arg));
Rewrite (N,
Make_Conditional_Expression (Loc,
Expressions => New_List (
Make_Op_Eq (Loc,
Left_Opnd => New_Copy_Tree (Arg),
Right_Opnd => Make_Null (Loc)),
New_Occurrence_Of (RTE (RE_Null_Address), Loc),
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address,
Prefix => Obj))));
Analyze_And_Resolve (N, RTE (RE_Address));
end Expand_To_Address;
-----------------------
-- Expand_To_Pointer --
-----------------------
procedure Expand_To_Pointer (N : Node_Id) is
Arg : constant Node_Id := First_Actual (N);
begin
Rewrite (N, Unchecked_Convert_To (Etype (N), Arg));
Analyze (N);
end Expand_To_Pointer;
end Exp_Intr;
|
Task/Named-parameters/Ada/named-parameters-1.ada | LaudateCorpus1/RosettaCodeData | 1 | 19701 | <filename>Task/Named-parameters/Ada/named-parameters-1.ada
procedure Foo (Arg_1 : Integer; Arg_2 : Float := 0.0);
|
programs/oeis/171/A171473.asm | neoneye/loda | 22 | 94202 | ; A171473: a(n) = 6*a(n-1) - 8*a(n-2)-3 for n > 1; a(0) = 35, a(1) = 135.
; 35,135,527,2079,8255,32895,131327,524799,2098175,8390655,33558527,134225919,536887295,2147516415,8590000127,34359869439,137439215615,549756338175,2199024304127,8796095119359,35184376283135,140737496743935,562949970198527,2251799847239679,9007199321849855,36028797153181695,144115188344291327,576460752840294399,2305843010287435775,9223372039002259455,36893488151714070527,147573952598266347519,590295810375885520895,2361183241469182345215,9444732965808009904127,37778931863094600663039,151115727452103524745215,604462909807864343166975,2417851639230357861040127,9671406556919232420904959,38685626227672531637108735,154742504910681330455412735,618970019642707729635606527,2475880078570795734170337279,9903520314283112567937171455,39614081257132309534260330495,158456325028528956662064611327,633825300114115263698305023999,2535301200456459928893313253375,10141204801825837463773439328255,40564819207303345351494129942527,162259276829213372398777265029119,649037107316853471580710550634495,2596148429267413850294045183574015,10384593717069655329118586696368127,41538374868278621172359158709616639,166153499473114484401206258686754815,664613997892457937028364282443595775
add $0,5
mov $1,4
mov $2,2
pow $2,$0
add $1,$2
mul $1,$2
div $1,32
sub $1,1
mov $0,$1
|
oeis/340/A340883.asm | neoneye/loda-programs | 11 | 17899 | <reponame>neoneye/loda-programs
; A340883: Row sums of A340882.
; Submitted by <NAME>
; 1,5,91,6245,1658011,1729699685,7151839686811,117731539542445925,7733983187987903246491,2029827406487942179094302565,2129693923358322199845305015300251,8935240067815150709523569975709449359205
mov $1,1
mov $3,1
lpb $0
sub $0,1
add $2,1
mul $2,2
mul $1,$2
mul $2,2
sub $2,1
mul $3,$2
add $3,$1
lpe
mov $0,$3
|
libsrc/_DEVELOPMENT/math/float/math48/lm/z80/asm_dge_s.asm | meesokim/z88dk | 0 | 28414 | <filename>libsrc/_DEVELOPMENT/math/float/math48/lm/z80/asm_dge_s.asm
SECTION code_fp_math48
PUBLIC asm_dge_s
EXTERN am48_dge_s
defc asm_dge_s = am48_dge_s
|
examples/boot_02_sec1.asm | Obijuan/simplez-grammar | 3 | 167106 | <reponame>Obijuan/simplez-grammar<filename>examples/boot_02_sec1.asm
;-------------------------------------------------------------------------------------------
;-- Programa de ejemplo para Bootloader. Secuencia de dos estados que se saca por los leds
;--
;-- Este programa se carga mediante el bootloader
;--------------------------------------------------------------------------------------------
;-- Acceso a los perifericos
leds EQU 507
;-- Comienzo del programa:
;-- Direccion h'40: para cargarlo con el bootloader
org h'40
loop LD /val1 ;-- Valor secuencia 1
ST /leds
Wait
ld /val2 ;-- Valor secuencia 2
st /leds
wait
BR /loop
val1 DATA h'9
val2 DATA h'6
END
|
bssn/code/src/metric-kasner.ads | leo-brewin/adm-bssn-numerical | 1 | 15566 | with Support; use Support;
with BSSNBase; use BSSNBase;
package Metric.Kasner is
----------------------------------------------------------------------------
-- ADM data
function set_3d_lapse (t, x, y, z : Real) return Real;
function set_3d_metric (t, x, y, z : Real) return MetricPointArray;
function set_3d_extcurv (t, x, y, z : Real) return ExtcurvPointArray;
function set_3d_lapse (t : Real; point : GridPoint) return Real;
function set_3d_metric (t : Real; point : GridPoint) return MetricPointArray;
function set_3d_extcurv (t : Real; point : GridPoint) return ExtcurvPointArray;
----------------------------------------------------------------------------
-- BSSN data
function set_3d_phi (t, x, y, z : Real) return Real;
function set_3d_trK (t, x, y, z : Real) return Real;
function set_3d_gBar (t, x, y, z : Real) return MetricPointArray;
function set_3d_Abar (t, x, y, z : Real) return ExtcurvPointArray;
function set_3d_Gi (t, x, y, z : Real) return GammaPointArray;
function set_3d_phi (t : Real; point : GridPoint) return Real;
function set_3d_trK (t : Real; point : GridPoint) return Real;
function set_3d_gBar (t : Real; point : GridPoint) return MetricPointArray;
function set_3d_Abar (t : Real; point : GridPoint) return ExtcurvPointArray;
function set_3d_Gi (t : Real; point : GridPoint) return GammaPointArray;
----------------------------------------------------------------------------
procedure get_pi (p1, p2, p3 : out Real);
procedure report_kasner_params;
end Metric.Kasner;
|
programs/oeis/276/A276876.asm | neoneye/loda | 22 | 29555 | <reponame>neoneye/loda<filename>programs/oeis/276/A276876.asm<gh_stars>10-100
; A276876: Sums-complement of the Beatty sequence for 2e.
; 1,2,3,4,7,8,9,12,13,14,15,18,19,20,23,24,25,26,29,30,31,34,35,36,37,40,41,42,45,46,47,50,51,52,53,56,57,58,61,62,63,64,67,68,69,72,73,74,75,78,79,80,83,84,85,88,89,90,91,94,95,96,99,100,101,102
mov $1,1679616
mul $1,$0
div $1,5764801
add $1,1
mul $1,2
sub $1,1
add $1,$0
mov $0,$1
|
programs/oeis/026/A026054.asm | karttu/loda | 1 | 161465 | ; A026054: dot product (n,n-1,...2,1).(3,4,...,n,1,2).
; 13,28,50,80,119,168,228,300,385,484,598,728,875,1040,1224,1428,1653,1900,2170,2464,2783,3128,3500,3900,4329,4788,5278,5800,6355,6944,7568,8228,8925,9660,10434,11248,12103,13000,13940,14924,15953,17028,18150,19320,20539,21808,23128,24500,25925,27404,28938,30528,32175,33880,35644,37468,39353,41300,43310,45384,47523,49728,52000,54340,56749,59228,61778,64400,67095,69864,72708,75628,78625,81700,84854,88088,91403,94800,98280,101844,105493,109228,113050,116960,120959,125048,129228,133500,137865,142324,146878,151528,156275,161120,166064,171108,176253,181500,186850,192304,197863,203528,209300,215180,221169,227268,233478,239800,246235,252784,259448,266228,273125,280140,287274,294528,301903,309400,317020,324764,332633,340628,348750,357000,365379,373888,382528,391300,400205,409244,418418,427728,437175,446760,456484,466348,476353,486500,496790,507224,517803,528528,539400,550420,561589,572908,584378,596000,607775,619704,631788,644028,656425,668980,681694,694568,707603,720800,734160,747684,761373,775228,789250,803440,817799,832328,847028,861900,876945,892164,907558,923128,938875,954800,970904,987188,1003653,1020300,1037130,1054144,1071343,1088728,1106300,1124060,1142009,1160148,1178478,1197000,1215715,1234624,1253728,1273028,1292525,1312220,1332114,1352208,1372503,1393000,1413700,1434604,1455713,1477028,1498550,1520280,1542219,1564368,1586728,1609300,1632085,1655084,1678298,1701728,1725375,1749240,1773324,1797628,1822153,1846900,1871870,1897064,1922483,1948128,1974000,2000100,2026429,2052988,2079778,2106800,2134055,2161544,2189268,2217228,2245425,2273860,2302534,2331448,2360603,2390000,2419640,2449524,2479653,2510028,2540650,2571520,2602639,2634008,2665628,2697500,2729625,2762004
add $0,3
mov $1,10
add $1,$0
bin $0,2
mul $0,$1
mov $1,$0
div $1,3
|
programs/oeis/183/A183980.asm | neoneye/loda | 22 | 5067 | <reponame>neoneye/loda<gh_stars>10-100
; A183980: 1/4 the number of (n+1) X 4 binary arrays with all 2 X 2 subblock sums the same.
; 9,11,14,20,30,50,86,158,294,566,1094,2150,4230,8390,16646,33158,66054,131846,263174,525830,1050630,2100230,4198406,8394758,16785414,33566726,67125254,134242310,268468230,536920070,1073807366,2147581958,4295098374,8590131206,17180131334,34360131590,68720001030,137439739910,274878955526,549757386758,1099513724934,2199026401286,4398050705414,8796099313670,17592194433030,35184384671750,70368760954886,140737513521158,281475010265094,562950003752966,1125899973951494,2251799914348550,4503599761588230,9007199456067590,18014398777917446,36028797421617158,72057594574798854,144115188881162246,288230377225453574,576460753914036230,1152921506754330630,2305843012434919430,4611686022722355206,9223372043297226758,18446744082299486214,36893488160304005126,73786976312018075654,147573952615446216710,295147905213712564230,590295810410245259270,1180591620786130780166,2361183241537901821958,4722366483007084167174,9444732965945448857606,18889465931753458761734,37778931863369478569990,75557863726464079233030,151115727452653280559110,302231454904756805304326,604462909808963854794758,1208925819616828197961734,2417851639232556884295686,4835703278462914745335814,9671406556923630467416070,19342813113842862888321030,38685626227681327730130950,77371252455353859367239686,154742504910698922641457158,309485009821380253096869894,618970019642742914007695366,1237940039285450643643301894,2475880078570866102914514950,4951760157141661837084852230,9903520314283253305425526790,19807040628566365873362698246,39614081257132591009237041158,79228162514264900543497371654,158456325028529519612018032646,316912650057058476274082643974,633825300114116389598211866630
mov $1,2
mov $2,$0
lpb $0
mul $1,2
add $1,$2
sub $1,$0
sub $0,1
trn $2,2
lpe
add $1,7
mov $0,$1
|
aes128_ecbenc_x3.asm | kingwelx/intel-ipsec-mb | 17 | 88029 | <reponame>kingwelx/intel-ipsec-mb
;;
;; Copyright (c) 2012-2018, Intel Corporation
;;
;; 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 Intel Corporation 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.
;;
; Routines to do simple AES ECB Enc on one stream with 3 blocks
;void
; aes128_ecbenc_x3_sse(void *in, void *keys, void *out1, void *out2, void *out3);
;void
; aes128_ecbenc_x3_avx(void *in, void *keys, void *out1, void *out2, void *out3);
%include "os.asm"
%ifdef LINUX
%define IN rdi ; arg 1
%define KEYS rsi ; arg 2
%define OUT0 rdx ; arg 3
%define OUT1 rcx ; arg 4
%define OUT2 r8 ; arg 5
%else
%define IN rcx ; arg 1
%define KEYS rdx ; arg 2
%define OUT0 r8 ; arg 3
%define OUT1 r9 ; arg 4
%define OUT2 rax ;
%endif
%define XDATA0 xmm0
%define XDATA1 xmm1
%define XDATA2 xmm2
%define XKEYA xmm3
%define XKEYB xmm4
section .text
MKGLOBAL(aes128_ecbenc_x3_sse,function,internal)
aes128_ecbenc_x3_sse:
%ifndef LINUX
mov OUT2, [rsp + 5*8]
%endif
movdqu XDATA0, [IN + 0*16] ; load first block of plain text
movdqu XDATA1, [IN + 1*16] ; load second block of plain text
movdqu XDATA2, [IN + 2*16] ; load third block of plain text
movdqa XKEYA, [KEYS + 16*0]
movdqa XKEYB, [KEYS + 16*1]
pxor XDATA0, XKEYA ; 0. ARK
pxor XDATA1, XKEYA ; 0. ARK
pxor XDATA2, XKEYA ; 0. ARK
movdqa XKEYA, [KEYS + 16*2]
aesenc XDATA0, XKEYB ; 1. ENC
aesenc XDATA1, XKEYB ; 1. ENC
aesenc XDATA2, XKEYB ; 1. ENC
movdqa XKEYB, [KEYS + 16*3]
aesenc XDATA0, XKEYA ; 2. ENC
aesenc XDATA1, XKEYA ; 2. ENC
aesenc XDATA2, XKEYA ; 2. ENC
movdqa XKEYA, [KEYS + 16*4]
aesenc XDATA0, XKEYB ; 3. ENC
aesenc XDATA1, XKEYB ; 3. ENC
aesenc XDATA2, XKEYB ; 3. ENC
movdqa XKEYB, [KEYS + 16*5]
aesenc XDATA0, XKEYA ; 4. ENC
aesenc XDATA1, XKEYA ; 4. ENC
aesenc XDATA2, XKEYA ; 4. ENC
movdqa XKEYA, [KEYS + 16*6]
aesenc XDATA0, XKEYB ; 5. ENC
aesenc XDATA1, XKEYB ; 5. ENC
aesenc XDATA2, XKEYB ; 5. ENC
movdqa XKEYB, [KEYS + 16*7]
aesenc XDATA0, XKEYA ; 6. ENC
aesenc XDATA1, XKEYA ; 6. ENC
aesenc XDATA2, XKEYA ; 6. ENC
movdqa XKEYA, [KEYS + 16*8]
aesenc XDATA0, XKEYB ; 7. ENC
aesenc XDATA1, XKEYB ; 7. ENC
aesenc XDATA2, XKEYB ; 7. ENC
movdqa XKEYB, [KEYS + 16*9]
aesenc XDATA0, XKEYA ; 8. ENC
aesenc XDATA1, XKEYA ; 8. ENC
aesenc XDATA2, XKEYA ; 8. ENC
movdqa XKEYA, [KEYS + 16*10]
aesenc XDATA0, XKEYB ; 9. ENC
aesenc XDATA1, XKEYB ; 9. ENC
aesenc XDATA2, XKEYB ; 9. ENC
aesenclast XDATA0, XKEYA ; 10. ENC
aesenclast XDATA1, XKEYA ; 10. ENC
aesenclast XDATA2, XKEYA ; 10. ENC
movdqu [OUT0], XDATA0 ; write back ciphertext
movdqu [OUT1], XDATA1 ; write back ciphertext
movdqu [OUT2], XDATA2 ; write back ciphertext
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(aes128_ecbenc_x3_avx,function,internal)
aes128_ecbenc_x3_avx:
%ifndef LINUX
mov OUT2, [rsp + 5*8]
%endif
vmovdqu XDATA0, [IN + 0*16] ; load first block of plain text
vmovdqu XDATA1, [IN + 1*16] ; load second block of plain text
vmovdqu XDATA2, [IN + 2*16] ; load third block of plain text
vmovdqa XKEYA, [KEYS + 16*0]
vmovdqa XKEYB, [KEYS + 16*1]
vpxor XDATA0, XDATA0, XKEYA ; 0. ARK
vpxor XDATA1, XDATA1, XKEYA ; 0. ARK
vpxor XDATA2, XDATA2, XKEYA ; 0. ARK
vmovdqa XKEYA, [KEYS + 16*2]
vaesenc XDATA0, XKEYB ; 1. ENC
vaesenc XDATA1, XKEYB ; 1. ENC
vaesenc XDATA2, XKEYB ; 1. ENC
vmovdqa XKEYB, [KEYS + 16*3]
vaesenc XDATA0, XKEYA ; 2. ENC
vaesenc XDATA1, XKEYA ; 2. ENC
vaesenc XDATA2, XKEYA ; 2. ENC
vmovdqa XKEYA, [KEYS + 16*4]
vaesenc XDATA0, XKEYB ; 3. ENC
vaesenc XDATA1, XKEYB ; 3. ENC
vaesenc XDATA2, XKEYB ; 3. ENC
vmovdqa XKEYB, [KEYS + 16*5]
vaesenc XDATA0, XKEYA ; 4. ENC
vaesenc XDATA1, XKEYA ; 4. ENC
vaesenc XDATA2, XKEYA ; 4. ENC
vmovdqa XKEYA, [KEYS + 16*6]
vaesenc XDATA0, XKEYB ; 5. ENC
vaesenc XDATA1, XKEYB ; 5. ENC
vaesenc XDATA2, XKEYB ; 5. ENC
vmovdqa XKEYB, [KEYS + 16*7]
vaesenc XDATA0, XKEYA ; 6. ENC
vaesenc XDATA1, XKEYA ; 6. ENC
vaesenc XDATA2, XKEYA ; 6. ENC
vmovdqa XKEYA, [KEYS + 16*8]
vaesenc XDATA0, XKEYB ; 7. ENC
vaesenc XDATA1, XKEYB ; 7. ENC
vaesenc XDATA2, XKEYB ; 7. ENC
vmovdqa XKEYB, [KEYS + 16*9]
vaesenc XDATA0, XKEYA ; 8. ENC
vaesenc XDATA1, XKEYA ; 8. ENC
vaesenc XDATA2, XKEYA ; 8. ENC
vmovdqa XKEYA, [KEYS + 16*10]
vaesenc XDATA0, XKEYB ; 9. ENC
vaesenc XDATA1, XKEYB ; 9. ENC
vaesenc XDATA2, XKEYB ; 9. ENC
vaesenclast XDATA0, XKEYA ; 10. ENC
vaesenclast XDATA1, XKEYA ; 10. ENC
vaesenclast XDATA2, XKEYA ; 10. ENC
vmovdqu [OUT0], XDATA0 ; write back ciphertext
vmovdqu [OUT1], XDATA1 ; write back ciphertext
vmovdqu [OUT2], XDATA2 ; write back ciphertext
ret
%ifdef LINUX
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
|
libpal/intel_64bit_ms64_masm/write_cr2.asm | mars-research/pal | 26 | 90958 | .code
pal_execute_write_cr2 proc
mov cr2, rcx;
ret;
pal_execute_write_cr2 endp
end
|
src/log_filter.adb | Lyaaaaaaaaaaaaaaa/Lyaaaaa-s-Log-Filters | 1 | 21108 | ----------------------------------------------------------
-- Copyright (c), The MIT License (MIT)
-- Author: Lyaaaaaaaaaaaaaaa
--
-- Revision History:
-- 18/09/2019 Lyaaaaaaaaaaaaaaa
-- - Added file header
-- - Filter_Check becomes Check_Filters
-- 17/10/2019 Lyaaaaaaaaaaaaaaa
-- - Word (declared in Read_Line) now can be of 1000 characters
-- instead of 100
-- - Added "& ASCII.LF" to Lines in Update_Lines
-- in other words, added an end of line.
----------------------------------------------------------
package body Log_Filter is
----------------------------------------------------------
-------------------------------------------
-- Variables --
-------------------------------------------
File : File_Type;
Line : Unbounded_String;
Lines : Unbounded_String;
Lines_Count : Integer;
----------------------------------------------------------
procedure Create_Filters (P_Number_Of_Filters : Natural;
P_User_Filters_Input : String;
P_Last_Inputs_Position : Natural) is
subtype array_column_control is
Natural range 1 .. p_number_of_filters;
subtype array_line_control is
Natural range 1 .. 40;
Filters : store_filter (1 .. 40, 1..p_number_of_filters);
Columns_Position : array_column_control := 1;
Lines_Position : array_line_control := 1;
begin
for I in 1 .. P_Last_Inputs_Position loop
if P_User_Filters_Input (I) /= ' ' then
Filters (Lines_Position, Columns_Position) :=
To_Lower (P_User_Filters_Input (I));
-- We use To_Lower to store filters in lower case in a variable.
-- So we won't miss the word carl because the user entered Carl.
Lines_Position := Lines_Position + 1;
if I = P_Last_Inputs_Position then
Filters (Lines_Position, Columns_Position) := '|';
end if;
elsif P_User_Filters_Input (I) = ' ' and I /= 1 then
if P_User_Filters_Input (I-1) /= ' ' then
Filters (Lines_Position, Columns_Position) := '|';
Lines_Position := 1;
if Columns_Position < p_number_of_filters then
Columns_Position := Columns_Position + 1;
end if;
end if;
end if;
end loop;
Read_File (Filters, p_number_of_filters);
end create_filters;
----------------------------------------------------------
procedure Update_Lines is
begin
Lines := Lines & line & ASCII.LF;
Lines_Count := Lines_Count + 1;
end Update_Lines;
----------------------------------------------------------
procedure Check_Filters (P_Filters : store_Filter;
P_Number_Of_Filters : Natural;
P_Word : String;
P_Filters_State : in out store_Filters_State) is
are_characters_identical : Boolean := true;
begin
for I in 1 .. p_number_of_filters loop
are_characters_identical := true;
for Y in 1 .. 40 loop
if are_characters_identical = true then
if p_filters (Y,I) /= p_word (Y)
and p_filters (Y,I) /= '|' then
are_characters_identical := false;
elsif p_filters (Y,I) = '|'
and are_characters_identical = true then
p_Filters_State (I) := true;
end if;
end if;
end loop;
end loop;
end Check_Filters;
----------------------------------------------------------
procedure Initialize_Filters_State (p_value : Boolean;
p_Filters_State : in out store_Filters_State) is
begin
for I in p_Filters_State'Range loop
p_Filters_State (I) := p_value;
end loop;
end Initialize_Filters_State;
----------------------------------------------------------
procedure Read_File (P_Filters : store_Filter;
P_Number_Of_Filters : Natural) is
Filters_State : store_Filters_State (1.. p_number_of_filters);
begin
While not End_Of_File(file) Loop
Line := To_Unbounded_String (Get_Line(file) );
Line := Line & " ";
Initialize_Filters_State (P_Value => false,
p_Filters_State => Filters_State);
Read_Line(P_Filters => P_Filters,
P_Number_Of_Filters => P_Number_Of_Filters,
P_Filters_State => Filters_State);
if are_they_all_true (Filters_State) = true then
Update_Lines;
end if;
end loop;
close (file);
end Read_File;
----------------------------------------------------------
procedure Read_Line (P_Filters : Store_Filter;
P_Number_Of_Filters : Natural;
P_Filters_State : in out Store_Filters_State) is
Word_Length : Natural := 0;
Word : string (1 .. 1000);
begin
for I in 1 .. Length (line) loop
-- We ignore some opening characters to not miss any information
--in logs.
-- Therefore, a user doesn't need to think about logs syntax.
-- So it avoids [carl not being returned when carl is a filter.
if Element (line,I) /= ' ' then
if Element (line,I) /= '['
and Element (line,I) /= '('
and Element (line,I) /= '''
and Element (line,I) /= '"'
and Element (line,I) /= '<'
and Element (line,I) /= '*'
and Element (line,I) /= '{' then
word_length := word_length + 1;
word (word_length) := To_Lower (Element(line,I));
end if;
elsif Element (line,I) = ' ' or End_Of_Line (file) = true then
Check_Filters (P_filters => P_filters,
P_number_of_filters => P_number_of_filters,
P_word => word,
P_Filters_State => P_Filters_State);
Word_Length := 0;
end if;
end loop;
end Read_Line;
----------------------------------------------------------
procedure Select_File (p_file : String) is
begin
if Is_Open (File) = False then
Open (File => File,
Mode => In_File,
Name => p_file);
end if;
exception
when Ada.Text_IO.Name_Error =>
Ada.Text_IO.Put_Line (File => Ada.Text_IO.Standard_Error,
Item => "Can't open file!");
end Select_File;
----------------------------------------------------------
procedure Close_File is
begin
if Is_Open (File) = True then
Close(File);
end if;
end Close_File;
----------------------------------------------------------
procedure Set_Filters (P_Filters : String) is
Last_Inputs_Position : Natural;
Number_Of_Filters : Natural := 1;
begin
Last_Inputs_Position := P_Filters'Last;
for I in 1 .. Last_Inputs_Position loop
if P_Filters (I) = ' ' and I /= 1 then
if P_Filters (I-1) /= ' ' then
Number_Of_Filters := Number_Of_Filters +1;
end if;
if I = Last_Inputs_Position and P_Filters(I) = ' ' then
Number_Of_Filters := Number_Of_Filters -1;
end if;
end if;
end loop;
Create_Filters (Number_Of_Filters, P_Filters, Last_Inputs_Position);
end Set_Filters;
----------------------------------------------------------
procedure Reset_Lines is
begin
Lines := To_Unbounded_String("");
end Reset_Lines;
----------------------------------------------------------
procedure Reset_Lines_Count is
begin
Lines_Count := 0;
end Reset_Lines_Count;
----------------------------------------------------------
function Are_They_All_True (P_Filters_State : Store_Filters_State)
return Boolean is
begin
for I in P_Filters_State'Range loop
if P_Filters_State (I) = false then
return false;
end if;
end loop;
return true;
end Are_They_All_True;
----------------------------------------------------------
function Get_Lines
return String is
begin
return To_String (Lines);
end Get_Lines;
----------------------------------------------------------
function Get_File_Name
return String is
begin
return Name (File);
end Get_File_Name;
----------------------------------------------------------
function Get_Lines_Count
return Integer is
begin
return Lines_Count;
end Get_Lines_Count;
end Log_Filter;
|
src/libtcod-console.ads | csb6/libtcod-ada | 0 | 16622 | <reponame>csb6/libtcod-ada<filename>src/libtcod-console.ads
with Libtcod.Color, Interfaces.C;
private with console_h, context_h, Ada.Finalization;
use Libtcod, Libtcod.Color;
package Libtcod.Console is
-- Basic types --
type X_Pos is new Interfaces.C.int range 0 .. Interfaces.C.int'Last;
type Y_Pos is new Interfaces.C.int range 0 .. Interfaces.C.int'Last;
Error : exception;
type Renderer_Type is
(Renderer_GLSL,
Renderer_OPENGL,
Renderer_SDL,
Renderer_SDL2,
Renderer_OpenGL2)
with Convention => C;
-- Background color blend modes
type Background_Mode is
(Background_None,
Background_Set,
Background_Multiply,
Background_Lighten,
Background_Darken,
Background_Screen,
Background_Color_Dodge,
Background_Color_Burn,
Background_Add,
Background_Adda,
Background_Burn,
Background_Overlay,
Background_Alpha,
Background_Default)
with Convention => C;
-- Justification options
type Alignment_Type is
(Alignment_Left,
Alignment_Right,
Alignment_Center)
with Convention => C;
-- Root (Manages rendering)
type Context is tagged limited private;
-- Screen --
type Screen is tagged limited private;
-- Constructors --
function make_context(w : Width; h : Height; title : String;
resizable : Boolean := True; fullscreen : Boolean := False;
renderer : Renderer_Type := Renderer_SDL2) return Context;
function make_screen(w : Width; h : Height) return Screen;
-- Operations --
-- Global Operations (affect current window)
procedure set_title(title : String);
procedure set_fullscreen(val : Boolean) with Inline;
function is_fullscreen return Boolean with Inline;
function is_window_closed return Boolean with Inline;
-- Context Operations
procedure present(cxt : in out Context'Class; s : Screen);
-- Screen Operations
function get_width(s : Screen) return Width with Inline;
function get_height(s : Screen) return Height with Inline;
function has_key_color(s : Screen) return Boolean with Inline;
procedure set_key_color(s : in out Screen; key_color : RGB_Color) with Inline;
function get_key_color(s : Screen) return RGB_Color with Inline;
procedure set_default_fg(s : in out Screen; fg : RGB_Color) with Inline;
function get_default_fg(s : Screen) return RGB_Color with Inline;
procedure set_default_bg(s : in out Screen; bg : RGB_Color) with Inline;
function get_default_bg(s : Screen) return RGB_Color with Inline;
procedure clear(s : in out Screen) with Inline;
procedure resize(s : in out Screen; w : Width; h : Height) with Inline;
procedure blit(s : Screen; src_x : X_Pos; src_y : Y_Pos;
w : Width; h : Height; dest : in out Screen;
dest_x : X_Pos; dest_y : Y_Pos)
with Inline;
procedure put_char(s : in out Screen; x : X_Pos; y : Y_Pos; ch : Wide_Character)
with Inline;
procedure put_char(s : in out Screen; x : X_Pos; y : Y_Pos; ch : Wide_Character;
mode : Background_Mode) with Inline;
procedure put_char(s : in out Screen; x : X_Pos; y : Y_Pos; ch : Wide_Character;
fg_color, bg_color : RGB_Color) with Inline;
procedure print(s : in out Screen; x : X_Pos; y : Y_Pos; text : String);
function get_char(s : Screen; x : X_Pos; y : Y_Pos) return Wide_Character with Inline;
procedure set_char_fg(s : in out Screen; x : X_Pos; y : Y_Pos; color : RGB_Color)
with Inline;
function get_char_fg(s : Screen; x : X_Pos; y : Y_Pos) return RGB_Color with Inline;
procedure set_char_bg(s : in out Screen; x : X_Pos; y : Y_Pos; color : RGB_Color;
mode : Background_Mode := Background_Set) with Inline;
function get_char_bg(s : Screen; x : X_Pos; y : Y_Pos) return RGB_Color with Inline;
procedure set_bg_mode(s : in out Screen; mode : Background_Mode) with Inline;
function get_bg_mode(s : Screen) return Background_Mode with Inline;
procedure set_alignment(s : in out Screen; alignment : Alignment_Type) with Inline;
function get_alignment(s : Screen) return Alignment_Type with Inline;
-- Shape drawing
procedure rect(s : in out Screen; x : X_Pos; y : Y_Pos; w : Width; h : Height;
clear : Boolean := False; bg_flag : Background_Mode := Background_Set)
with Inline;
private
type Context is new Ada.Finalization.Limited_Controlled with record
data : aliased access context_h.TCOD_Context;
end record;
overriding procedure Finalize(self : in out Context);
type Screen is new Ada.Finalization.Limited_Controlled with record
data : access console_h.TCOD_Console;
end record;
overriding procedure Finalize(self : in out Screen);
end Libtcod.Console;
|
src/fot/FOTC/Program/ABP/Fair/PropertiesI.agda | asr/fotc | 11 | 6359 | <gh_stars>10-100
------------------------------------------------------------------------------
-- Fair properties
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOTC.Program.ABP.Fair.PropertiesI where
open import Common.FOL.Relation.Binary.EqReasoning
open import FOTC.Base
open import FOTC.Base.List
open import FOTC.Base.List.PropertiesI
open import FOTC.Data.List
open import FOTC.Data.List.PropertiesI
open import FOTC.Data.Stream.Type
open import FOTC.Program.ABP.Fair.Type
open import FOTC.Program.ABP.Terms
------------------------------------------------------------------------------
-- Because a greatest post-fixed point is a fixed-point, then the Fair
-- predicate is also a pre-fixed point of the functional FairF, i.e.
--
-- FairF Fair ≤ Fair (see FOTC.Program.ABP.Fair).
Fair-in : ∀ {os} → ∃[ ft ] ∃[ os' ] F*T ft ∧ os ≡ ft ++ os' ∧ Fair os' →
Fair os
Fair-in h = Fair-coind A h' h
where
A : D → Set
A os = ∃[ ft ] ∃[ os' ] F*T ft ∧ os ≡ ft ++ os' ∧ Fair os'
h' : ∀ {os} → A os → ∃[ ft ] ∃[ os' ] F*T ft ∧ os ≡ ft ++ os' ∧ A os'
h' (ft , os' , FTft , prf , Fos') = ft , os' , FTft , prf , Fair-out Fos'
head-tail-Fair : ∀ {os} → Fair os → os ≡ T ∷ tail₁ os ∨ os ≡ F ∷ tail₁ os
head-tail-Fair {os} Fos with Fair-out Fos
... | .(T ∷ []) , os' , f*tnil , h , Fos' = inj₁ prf₃
where
prf₁ : os ≡ T ∷ [] ++ os'
prf₁ = os ≡⟨ h ⟩
(T ∷ []) ++ os' ≡⟨ ++-∷ T [] os' ⟩
T ∷ [] ++ os' ∎
prf₂ : tail₁ os ≡ [] ++ os'
prf₂ = tail₁ os ≡⟨ tailCong prf₁ ⟩
tail₁ (T ∷ [] ++ os') ≡⟨ tail-∷ T ([] ++ os') ⟩
[] ++ os' ∎
prf₃ : os ≡ T ∷ tail₁ os
prf₃ = os ≡⟨ prf₁ ⟩
T ∷ [] ++ os' ≡⟨ ∷-rightCong (sym prf₂) ⟩
T ∷ tail₁ os ∎
... | .(F ∷ ft) , os' , f*tcons {ft} FTft , h , Fos' =
inj₂ prf₃
where
prf₁ : os ≡ F ∷ ft ++ os'
prf₁ = os ≡⟨ h ⟩
(F ∷ ft) ++ os' ≡⟨ ++-∷ F ft os' ⟩
F ∷ ft ++ os' ∎
prf₂ : tail₁ os ≡ ft ++ os'
prf₂ = tail₁ os ≡⟨ tailCong prf₁ ⟩
tail₁ (F ∷ ft ++ os') ≡⟨ tail-∷ F (ft ++ os') ⟩
ft ++ os' ∎
prf₃ : os ≡ F ∷ tail₁ os
prf₃ = os ≡⟨ prf₁ ⟩
F ∷ ft ++ os' ≡⟨ ∷-rightCong (sym prf₂) ⟩
F ∷ tail₁ os ∎
tail-Fair : ∀ {os} → Fair os → Fair (tail₁ os)
tail-Fair {os} Fos with Fair-out Fos
... | .(T ∷ []) , os' , f*tnil , h , Fos' =
subst Fair (sym prf₂) Fos'
where
prf₁ : os ≡ T ∷ os'
prf₁ = os ≡⟨ h ⟩
(T ∷ []) ++ os' ≡⟨ ++-∷ T [] os' ⟩
T ∷ [] ++ os' ≡⟨ ∷-rightCong (++-leftIdentity os') ⟩
T ∷ os' ∎
prf₂ : tail₁ os ≡ os'
prf₂ = tail₁ os ≡⟨ tailCong prf₁ ⟩
tail₁ (T ∷ os') ≡⟨ tail-∷ T os' ⟩
os' ∎
... | .(F ∷ ft) , os' , f*tcons {ft} FTft , h , Fos' =
subst Fair (sym prf₂) (Fair-in (ft , os' , FTft , refl , Fos'))
where
prf₁ : os ≡ F ∷ ft ++ os'
prf₁ = os ≡⟨ h ⟩
(F ∷ ft) ++ os' ≡⟨ ++-∷ F ft os' ⟩
F ∷ ft ++ os' ∎
prf₂ : tail₁ os ≡ ft ++ os'
prf₂ = tail₁ os ≡⟨ tailCong prf₁ ⟩
tail₁ (F ∷ ft ++ os') ≡⟨ tail-∷ F (ft ++ os') ⟩
ft ++ os' ∎
Fair→Stream : ∀ {os} → Fair os → Stream os
Fair→Stream Fos = Stream-coind A h Fos
where
A : D → Set
A xs = Fair xs
h : ∀ {os} → A os → ∃[ o' ] ∃[ os' ] os ≡ o' ∷ os' ∧ A os'
h {os} As with head-tail-Fair As
... | inj₁ prf = T , tail₁ os , prf , tail-Fair As
... | inj₂ prf = F , tail₁ os , prf , tail-Fair As
F*T→List : ∀ {xs} → F*T xs → List xs
F*T→List f*tnil = lcons T lnil
F*T→List (f*tcons {ft} FTft) = lcons F (F*T→List FTft)
|
test/asm/if-macro.asm | orbea/rgbds | 522 | 9346 | m: macro
if 0
WARN "3"
else
WARN "5"
endc
endm
if 1
m
else
WARN "12"
endc
|
Task/Identity-matrix/Ada/identity-matrix-1.ada | LaudateCorpus1/RosettaCodeData | 1 | 28414 | <filename>Task/Identity-matrix/Ada/identity-matrix-1.ada<gh_stars>1-10
-- As prototyped in the Generic_Real_Arrays specification:
-- function Unit_Matrix (Order : Positive; First_1, First_2 : Integer := 1) return Real_Matrix;
-- For the task:
mat : Real_Matrix := Unit_Matrix(5);
|
programs/oeis/171/A171501.asm | neoneye/loda | 22 | 246215 | <reponame>neoneye/loda
; A171501: Inverse binomial transform of A084640.
; 0,1,3,-1,7,-9,23,-41,87,-169,343,-681,1367,-2729,5463,-10921,21847,-43689,87383,-174761,349527,-699049,1398103,-2796201,5592407,-11184809,22369623,-44739241,89478487,-178956969,357913943,-715827881,1431655767,-2863311529,5726623063,-11453246121,22906492247,-45812984489,91625968983,-183251937961,366503875927,-733007751849,1466015503703,-2932031007401,5864062014807,-11728124029609,23456248059223,-46912496118441,93824992236887,-187649984473769,375299968947543,-750599937895081,1501199875790167,-3002399751580329,6004799503160663,-12009599006321321,24019198012642647,-48038396025285289,96076792050570583,-192153584101141161,384307168202282327,-768614336404564649,1537228672809129303,-3074457345618258601,6148914691236517207,-12297829382473034409,24595658764946068823,-49191317529892137641,98382635059784275287,-196765270119568550569,393530540239137101143,-787061080478274202281,1574122160956548404567,-3148244321913096809129,6296488643826193618263,-12592977287652387236521,25185954575304774473047,-50371909150609548946089,100743818301219097892183,-201487636602438195784361,402975273204876391568727,-805950546409752783137449,1611901092819505566274903,-3223802185639011132549801,6447604371278022265099607,-12895208742556044530199209,25790417485112089060398423,-51580834970224178120796841,103161669940448356241593687,-206323339880896712483187369,412646679761793424966374743,-825293359523586849932749481,1650586719047173699865498967,-3301173438094347399730997929,6602346876188694799461995863,-13204693752377389598923991721,26409387504754779197847983447,-52818775009509558395695966889,105637550019019116791391933783,-211275100038038233582783867561
lpb $0
mov $2,$0
mov $0,0
seq $2,140966 ; a(n) = (5 + (-2)^n)/3.
lpe
mov $0,$2
|
src/asf-applications-main.ads | jquorning/ada-asf | 12 | 22265 | <filename>src/asf-applications-main.ads
-----------------------------------------------------------------------
-- applications -- Ada Web Application
-- Copyright (C) 2009, 2010, 2011, 2012, 2017, 2018 <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.
-----------------------------------------------------------------------
with Util.Beans.Basic;
with Util.Locales;
with EL.Objects;
with EL.Contexts;
with EL.Functions;
with EL.Functions.Default;
with EL.Expressions;
with EL.Variables.Default;
with Ada.Strings.Unbounded;
with ASF.Locales;
with ASF.Factory;
with ASF.Converters;
with ASF.Validators;
with ASF.Contexts.Faces;
with ASF.Contexts.Exceptions;
with ASF.Lifecycles;
with ASF.Applications.Views;
with ASF.Navigations;
with ASF.Beans;
with ASF.Requests;
with ASF.Responses;
with ASF.Servlets;
with ASF.Events.Faces.Actions;
with Security.Policies; use Security;
with Security.OAuth.Servers;
package ASF.Applications.Main is
use ASF.Beans;
-- ------------------------------
-- Factory for creation of lifecycle, view handler
-- ------------------------------
type Application_Factory is tagged limited private;
-- Create the lifecycle handler. The lifecycle handler is created during
-- the initialization phase of the application. The default implementation
-- creates an <b>ASF.Lifecycles.Default.Default_Lifecycle</b> object.
-- It can be overriden to change the behavior of the ASF request lifecycle.
function Create_Lifecycle_Handler (App : in Application_Factory)
return ASF.Lifecycles.Lifecycle_Access;
-- Create the view handler. The view handler is created during
-- the initialization phase of the application. The default implementation
-- creates an <b>ASF.Applications.Views.View_Handler</b> object.
-- It can be overriden to change the views associated with the application.
function Create_View_Handler (App : in Application_Factory)
return ASF.Applications.Views.View_Handler_Access;
-- Create the navigation handler. The navigation handler is created during
-- the initialization phase of the application. The default implementation
-- creates an <b>ASF.Navigations.Navigation_Handler</b> object.
-- It can be overriden to change the navigations associated with the application.
function Create_Navigation_Handler (App : in Application_Factory)
return ASF.Navigations.Navigation_Handler_Access;
-- Create the security policy manager. The security policy manager is created during
-- the initialization phase of the application. The default implementation
-- creates a <b>Security.Policies.Policy_Manager</b> object.
function Create_Security_Manager (App : in Application_Factory)
return Security.Policies.Policy_Manager_Access;
-- Create the OAuth application manager. The OAuth application manager is created
-- during the initialization phase of the application. The default implementation
-- creates a <b>Security.OAuth.Servers.Auth_Manager</b> object.
function Create_OAuth_Manager (App : in Application_Factory)
return Security.OAuth.Servers.Auth_Manager_Access;
-- Create the exception handler. The exception handler is created during
-- the initialization phase of the application. The default implementation
-- creates a <b>ASF.Contexts.Exceptions.Exception_Handler</b> object.
function Create_Exception_Handler (App : in Application_Factory)
return ASF.Contexts.Exceptions.Exception_Handler_Access;
-- ------------------------------
-- Application
-- ------------------------------
type Application is new ASF.Servlets.Servlet_Registry
and ASF.Events.Faces.Actions.Action_Listener with private;
type Application_Access is access all Application'Class;
-- Get the application view handler.
function Get_View_Handler (App : access Application)
return access Views.View_Handler'Class;
-- Get the lifecycle handler.
function Get_Lifecycle_Handler (App : in Application)
return ASF.Lifecycles.Lifecycle_Access;
-- Get the navigation handler.
function Get_Navigation_Handler (App : in Application)
return ASF.Navigations.Navigation_Handler_Access;
-- Get the permission manager associated with this application.
function Get_Security_Manager (App : in Application)
return Security.Policies.Policy_Manager_Access;
-- Get the OAuth application manager associated with this application.
function Get_OAuth_Manager (App : in Application)
return Security.OAuth.Servers.Auth_Manager_Access;
-- Get the action event listener responsible for processing action
-- events and triggering the navigation to the next view using the
-- navigation handler.
function Get_Action_Listener (App : in Application)
return ASF.Events.Faces.Actions.Action_Listener_Access;
-- Get the exception handler configured for this application.
function Get_Exception_Handler (App : in Application)
return ASF.Contexts.Exceptions.Exception_Handler_Access;
-- Process the action associated with the action event. The action returns
-- and outcome which is then passed to the navigation handler to navigate to
-- the next view.
overriding
procedure Process_Action (Listener : in Application;
Event : in ASF.Events.Faces.Actions.Action_Event'Class;
Context : in out Contexts.Faces.Faces_Context'Class);
-- Execute the action method. The action returns and outcome which is then passed
-- to the navigation handler to navigate to the next view.
procedure Process_Action (Listener : in Application;
Method : in EL.Expressions.Method_Info;
Context : in out Contexts.Faces.Faces_Context'Class);
-- Initialize the application
procedure Initialize (App : in out Application;
Conf : in Config;
Factory : in out Application_Factory'Class);
-- Initialize the ASF components provided by the application.
-- This procedure is called by <b>Initialize</b>.
-- It should register the component factories used by the application.
procedure Initialize_Components (App : in out Application);
-- Initialize the application configuration properties. Properties defined in <b>Conf</b>
-- are expanded by using the EL expression resolver.
procedure Initialize_Config (App : in out Application;
Conf : in out Config);
-- Initialize the servlets provided by the application.
-- This procedure is called by <b>Initialize</b>.
-- It should register the application servlets.
procedure Initialize_Servlets (App : in out Application);
-- Initialize the filters provided by the application.
-- This procedure is called by <b>Initialize</b>.
-- It should register the application filters.
procedure Initialize_Filters (App : in out Application);
-- Finalizes the application, freeing the memory.
overriding
procedure Finalize (App : in out Application);
-- Get the configuration parameter;
function Get_Config (App : Application;
Param : Config_Param) return String;
-- Set a global variable in the global EL contexts.
procedure Set_Global (App : in out Application;
Name : in String;
Value : in String);
procedure Set_Global (App : in out Application;
Name : in String;
Value : in EL.Objects.Object);
-- Resolve a global variable and return its value.
-- Raises the <b>EL.Functions.No_Variable</b> exception if the variable does not exist.
function Get_Global (App : in Application;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Context : in EL.Contexts.ELContext'Class)
return EL.Objects.Object;
-- Get the list of supported locales for this application.
function Get_Supported_Locales (App : in Application)
return Util.Locales.Locale_Array;
-- Add the locale to the list of supported locales.
procedure Add_Supported_Locale (App : in out Application;
Locale : in Util.Locales.Locale);
-- Get the default locale defined by the application.
function Get_Default_Locale (App : in Application) return Util.Locales.Locale;
-- Set the default locale defined by the application.
procedure Set_Default_Locale (App : in out Application;
Locale : in Util.Locales.Locale);
-- Compute the locale that must be used according to the <b>Accept-Language</b> request
-- header and the application supported locales.
function Calculate_Locale (Handler : in Application;
Context : in ASF.Contexts.Faces.Faces_Context'Class)
return Util.Locales.Locale;
-- Register a bundle and bind it to a facelet variable.
procedure Register (App : in out Application;
Name : in String;
Bundle : in String);
-- Register the bean identified by <b>Name</b> and associated with the class <b>Class</b>.
-- The class must have been registered by using the <b>Register</b> class operation.
-- The scope defines the scope of the bean.
procedure Register (App : in out Application;
Name : in String;
Class : in String;
Params : in Parameter_Bean_Ref.Ref;
Scope : in Scope_Type := REQUEST_SCOPE);
-- Register under the name identified by <b>Name</b> the class instance <b>Class</b>.
procedure Register_Class (App : in out Application;
Name : in String;
Class : in ASF.Beans.Class_Binding_Access);
-- Register under the name identified by <b>Name</b> a function to create a bean.
-- This is a simplified class registration.
procedure Register_Class (App : in out Application;
Name : in String;
Handler : in ASF.Beans.Create_Bean_Access);
-- Create a bean by using the create operation registered for the name
procedure Create (App : in Application;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Context : in EL.Contexts.ELContext'Class;
Result : out Util.Beans.Basic.Readonly_Bean_Access;
Scope : out Scope_Type);
-- Add a converter in the application. The converter is referenced by
-- the specified name in the XHTML files.
procedure Add_Converter (App : in out Application;
Name : in String;
Converter : in ASF.Converters.Converter_Access);
-- Register a binding library in the factory.
procedure Add_Components (App : in out Application;
Bindings : in ASF.Factory.Factory_Bindings_Access);
-- Closes the application
procedure Close (App : in out Application);
-- Set the current faces context before processing a view.
procedure Set_Context (App : in out Application;
Context : in ASF.Contexts.Faces.Faces_Context_Access);
-- Execute the lifecycle phases on the faces context.
procedure Execute_Lifecycle (App : in Application;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Dispatch the request received on a page.
procedure Dispatch (App : in out Application;
Page : in String;
Request : in out ASF.Requests.Request'Class;
Response : in out ASF.Responses.Response'Class);
-- Dispatch a bean action request.
-- 1. Find the bean object identified by <b>Name</b>, create it if necessary.
-- 2. Resolve the bean method identified by <b>Operation</b>.
-- 3. If the method is an action method (see ASF.Events.Actions), call that method.
-- 4. Using the outcome action result, decide using the navigation handler what
-- is the result view.
-- 5. Render the result view resolved by the navigation handler.
procedure Dispatch (App : in out Application;
Name : in String;
Operation : in String;
Request : in out ASF.Requests.Request'Class;
Response : in out ASF.Responses.Response'Class;
Prepare : access procedure (Bean : access Util.Beans.Basic.Bean'Class));
-- Find the converter instance that was registered under the given name.
-- Returns null if no such converter exist.
function Find (App : in Application;
Name : in EL.Objects.Object) return ASF.Converters.Converter_Access;
-- Find the validator instance that was registered under the given name.
-- Returns null if no such validator exist.
function Find_Validator (App : in Application;
Name : in EL.Objects.Object)
return ASF.Validators.Validator_Access;
-- Register some functions
generic
with procedure Set_Functions (Mapper : in out EL.Functions.Function_Mapper'Class);
procedure Register_Functions (App : in out Application'Class);
-- Register some bean definitions.
generic
with procedure Set_Beans (Factory : in out ASF.Beans.Bean_Factory);
procedure Register_Beans (App : in out Application'Class);
-- Load the resource bundle identified by the <b>Name</b> and for the given
-- <b>Locale</b>.
procedure Load_Bundle (App : in out Application;
Name : in String;
Locale : in String;
Bundle : out ASF.Locales.Bundle);
private
type Application_Factory is tagged limited null record;
type Application is new ASF.Servlets.Servlet_Registry
and ASF.Events.Faces.Actions.Action_Listener with record
View : aliased ASF.Applications.Views.View_Handler;
Lifecycle : ASF.Lifecycles.Lifecycle_Access;
Factory : aliased ASF.Beans.Bean_Factory;
Locales : ASF.Locales.Factory;
Globals : aliased EL.Variables.Default.Default_Variable_Mapper;
Functions : aliased EL.Functions.Default.Default_Function_Mapper;
-- The component factory
Components : aliased ASF.Factory.Component_Factory;
-- The action listener.
Action_Listener : ASF.Events.Faces.Actions.Action_Listener_Access;
-- The navigation handler.
Navigation : ASF.Navigations.Navigation_Handler_Access;
-- The permission manager.
Permissions : Security.Policies.Policy_Manager_Access;
-- The OAuth application manager.
OAuth : Security.OAuth.Servers.Auth_Manager_Access;
-- Exception handler
Exceptions : ASF.Contexts.Exceptions.Exception_Handler_Access;
end record;
end ASF.Applications.Main;
|
src/firmware-tests/SunriseSunset/PollAfterSunriseSunsetDummy.asm | pete-restall/Cluck2Sesame-Prototype | 1 | 177558 | <gh_stars>1-10
#include "Mcu.inc"
#include "PollChain.inc"
radix decimal
PollAfterSunriseSunsetDummy code
global POLL_AFTER_SUNRISESUNSET
POLL_AFTER_SUNRISESUNSET:
return
end
|
out/Sum/Syntax.agda | JoeyEremondi/agda-soas | 39 | 6994 | {-
This second-order term syntax was created from the following second-order syntax description:
syntax Sum | S
type
_⊕_ : 2-ary | l30
term
inl : α -> α ⊕ β
inr : β -> α ⊕ β
case : α ⊕ β α.γ β.γ -> γ
theory
(lβ) a : α f : α.γ g : β.γ |> case (inl(a), x.f[x], y.g[y]) = f[a]
(rβ) b : β f : α.γ g : β.γ |> case (inr(b), x.f[x], y.g[y]) = g[b]
(cη) s : α ⊕ β c : (α ⊕ β).γ |> case (s, x.c[inl(x)], y.c[inr(y)]) = c[s]
-}
module Sum.Syntax where
open import SOAS.Common
open import SOAS.Context
open import SOAS.Variable
open import SOAS.Families.Core
open import SOAS.Construction.Structure
open import SOAS.ContextMaps.Inductive
open import SOAS.Metatheory.Syntax
open import Sum.Signature
private
variable
Γ Δ Π : Ctx
α β γ : ST
𝔛 : Familyₛ
-- Inductive term declaration
module S:Terms (𝔛 : Familyₛ) where
data S : Familyₛ where
var : ℐ ⇾̣ S
mvar : 𝔛 α Π → Sub S Π Γ → S α Γ
inl : S α Γ → S (α ⊕ β) Γ
inr : S β Γ → S (α ⊕ β) Γ
case : S (α ⊕ β) Γ → S γ (α ∙ Γ) → S γ (β ∙ Γ) → S γ Γ
open import SOAS.Metatheory.MetaAlgebra ⅀F 𝔛
Sᵃ : MetaAlg S
Sᵃ = record
{ 𝑎𝑙𝑔 = λ where
(inlₒ ⋮ a) → inl a
(inrₒ ⋮ a) → inr a
(caseₒ ⋮ a , b , c) → case a b c
; 𝑣𝑎𝑟 = var ; 𝑚𝑣𝑎𝑟 = λ 𝔪 mε → mvar 𝔪 (tabulate mε) }
module Sᵃ = MetaAlg Sᵃ
module _ {𝒜 : Familyₛ}(𝒜ᵃ : MetaAlg 𝒜) where
open MetaAlg 𝒜ᵃ
𝕤𝕖𝕞 : S ⇾̣ 𝒜
𝕊 : Sub S Π Γ → Π ~[ 𝒜 ]↝ Γ
𝕊 (t ◂ σ) new = 𝕤𝕖𝕞 t
𝕊 (t ◂ σ) (old v) = 𝕊 σ v
𝕤𝕖𝕞 (mvar 𝔪 mε) = 𝑚𝑣𝑎𝑟 𝔪 (𝕊 mε)
𝕤𝕖𝕞 (var v) = 𝑣𝑎𝑟 v
𝕤𝕖𝕞 (inl a) = 𝑎𝑙𝑔 (inlₒ ⋮ 𝕤𝕖𝕞 a)
𝕤𝕖𝕞 (inr a) = 𝑎𝑙𝑔 (inrₒ ⋮ 𝕤𝕖𝕞 a)
𝕤𝕖𝕞 (case a b c) = 𝑎𝑙𝑔 (caseₒ ⋮ 𝕤𝕖𝕞 a , 𝕤𝕖𝕞 b , 𝕤𝕖𝕞 c)
𝕤𝕖𝕞ᵃ⇒ : MetaAlg⇒ Sᵃ 𝒜ᵃ 𝕤𝕖𝕞
𝕤𝕖𝕞ᵃ⇒ = record
{ ⟨𝑎𝑙𝑔⟩ = λ{ {t = t} → ⟨𝑎𝑙𝑔⟩ t }
; ⟨𝑣𝑎𝑟⟩ = refl
; ⟨𝑚𝑣𝑎𝑟⟩ = λ{ {𝔪 = 𝔪}{mε} → cong (𝑚𝑣𝑎𝑟 𝔪) (dext (𝕊-tab mε)) } }
where
open ≡-Reasoning
⟨𝑎𝑙𝑔⟩ : (t : ⅀ S α Γ) → 𝕤𝕖𝕞 (Sᵃ.𝑎𝑙𝑔 t) ≡ 𝑎𝑙𝑔 (⅀₁ 𝕤𝕖𝕞 t)
⟨𝑎𝑙𝑔⟩ (inlₒ ⋮ _) = refl
⟨𝑎𝑙𝑔⟩ (inrₒ ⋮ _) = refl
⟨𝑎𝑙𝑔⟩ (caseₒ ⋮ _) = refl
𝕊-tab : (mε : Π ~[ S ]↝ Γ)(v : ℐ α Π) → 𝕊 (tabulate mε) v ≡ 𝕤𝕖𝕞 (mε v)
𝕊-tab mε new = refl
𝕊-tab mε (old v) = 𝕊-tab (mε ∘ old) v
module _ (g : S ⇾̣ 𝒜)(gᵃ⇒ : MetaAlg⇒ Sᵃ 𝒜ᵃ g) where
open MetaAlg⇒ gᵃ⇒
𝕤𝕖𝕞! : (t : S α Γ) → 𝕤𝕖𝕞 t ≡ g t
𝕊-ix : (mε : Sub S Π Γ)(v : ℐ α Π) → 𝕊 mε v ≡ g (index mε v)
𝕊-ix (x ◂ mε) new = 𝕤𝕖𝕞! x
𝕊-ix (x ◂ mε) (old v) = 𝕊-ix mε v
𝕤𝕖𝕞! (mvar 𝔪 mε) rewrite cong (𝑚𝑣𝑎𝑟 𝔪) (dext (𝕊-ix mε))
= trans (sym ⟨𝑚𝑣𝑎𝑟⟩) (cong (g ∘ mvar 𝔪) (tab∘ix≈id mε))
𝕤𝕖𝕞! (var v) = sym ⟨𝑣𝑎𝑟⟩
𝕤𝕖𝕞! (inl a) rewrite 𝕤𝕖𝕞! a = sym ⟨𝑎𝑙𝑔⟩
𝕤𝕖𝕞! (inr a) rewrite 𝕤𝕖𝕞! a = sym ⟨𝑎𝑙𝑔⟩
𝕤𝕖𝕞! (case a b c) rewrite 𝕤𝕖𝕞! a | 𝕤𝕖𝕞! b | 𝕤𝕖𝕞! c = sym ⟨𝑎𝑙𝑔⟩
-- Syntax instance for the signature
S:Syn : Syntax
S:Syn = record
{ ⅀F = ⅀F
; ⅀:CS = ⅀:CompatStr
; mvarᵢ = S:Terms.mvar
; 𝕋:Init = λ 𝔛 → let open S:Terms 𝔛 in record
{ ⊥ = S ⋉ Sᵃ
; ⊥-is-initial = record { ! = λ{ {𝒜 ⋉ 𝒜ᵃ} → 𝕤𝕖𝕞 𝒜ᵃ ⋉ 𝕤𝕖𝕞ᵃ⇒ 𝒜ᵃ }
; !-unique = λ{ {𝒜 ⋉ 𝒜ᵃ} (f ⋉ fᵃ⇒) {x = t} → 𝕤𝕖𝕞! 𝒜ᵃ f fᵃ⇒ t } } } }
-- Instantiation of the syntax and metatheory
open Syntax S:Syn public
open S:Terms public
open import SOAS.Families.Build public
open import SOAS.Syntax.Shorthands Sᵃ public
open import SOAS.Metatheory S:Syn public
|
data/wildPokemon/route21.asm | adhi-thirumala/EvoYellow | 0 | 15769 | <reponame>adhi-thirumala/EvoYellow<filename>data/wildPokemon/route21.asm
Route21Mons:
db $19
db 15,MURKROW
db 13,TAUROS
db 13,SKARMORY
db 11,TANGELA
db 17,SKARMORY
db 15,PIDGEY
db 15,RATICATE
db 17,TANGELA
db 20,NOCTOWL
db 15,PIDGEOTTO
db $05
db 5,CHINCHOU
db 10,CHINCHOU
db 15,CHINCHOU
db 5,TENTACOOL
db 10,TENTACOOL
db 15,TENTACOOL
db 20,TENTACOOL
db 30,LANTURN
db 35,LANTURN
db 40,TENTACRUEL
|
oeis/301/A301484.asm | neoneye/loda-programs | 11 | 247260 | <reponame>neoneye/loda-programs<filename>oeis/301/A301484.asm<gh_stars>10-100
; A301484: Decimal expansion of J_0(2)/J_1(2) = 1 - 1/(2 - 1/(3 - 1/(4 - ...))).
; Submitted by <NAME>
; 3,8,8,2,1,0,7,6,5,5,6,7,7,9,5,7,8,7,5,1,1,6,5,8,5,5,7,3,0,6,5,3,7,0,2,9,2,2,1,7,4,5,0,4,0,7,2,5,3,2,9,8,1,8,6,4,6,4,2,8,2,7,5,9,3,7,3,5,1,7,3,9,5,6,3,8,2,4,2,0,1,2,1,1,0,1,9,3,5,1,6,2,8,2,8,0,3,1,9,6
add $0,1
mov $3,$0
mul $3,5
lpb $3
add $2,988
mov $4,$3
cmp $4,0
add $3,$4
div $1,$3
add $2,$1
sub $1,$2
mul $2,$3
add $1,$2
mov $5,$0
div $5,3
max $5,1
div $1,$5
div $2,$5
sub $3,1
lpe
mov $6,10
pow $6,$0
div $2,$6
div $1,$2
mov $0,$1
mod $0,10
|
wf.asm | hmrten/wf | 7 | 84209 | ; Copyright (c) 2016 <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.
; register allocation
; rax - top of stack xmm0 - scratch
; rbx - data stack xmm1 - scratch
; rsp - return stack xmm2 - scratch
; rbp - locals (saved rsp) xmm4 - scratch
; rdi - addr reg (A) xmm3 - scratch
; rsi - addr reg (B) xmm5 - scratch
; rcx - scratch (win arg1) xmm6 - scratch
; rdx - scratch (win arg2) xmm7 - scratch
; r8 - scratch (win arg3) xmm8 - reserved
; r9 - scratch (win arg4) xmm9 - reserved
; r10 - scratch xmm10 - reserved
; r11 - scratch xmm11 - reserved
; r12 - loop counter xmm12 - reserved
; r13 - loop limit xmm13 - reserved
; r14 - reserved xmm14 - reserved
; r15 - user variables xmm15 - reserved
format pe64 console 6.0
entry start
macro IMPORT [lib,api] {
common
local part0,part1,first
macro part0 lib0,[api0] \{
\common lib0\#_STR db \`lib0
\forward rb 2 - RVA $ AND 1
label api0\#_STR at $-2
db \`api0
\common db 0
\}
first = 7
macro part1 lib1,[api1] \{
\common rb (8 - RVA $ AND 7) AND first
first = 15
label lib1\#_TAB
\forward api1 dq RVA api1\#_STR
\}
forward part0 lib,api
forward part1 lib,api
common data import
forward dd 0,0,0,RVA lib#_STR,RVA lib#_TAB
common rd 5
end data
}
macro SNAME name {
local i, n
i = $
db name
times 16-($-i) db 0
}
macro FORTHNAMES { SNAME '--END-OF-NAMES--' }
macro FORTHSYMBS { dq -1, -1 }
macro MACRONAMES { SNAME '--END-OF-NAMES--' }
macro MACROSYMBS { dq -1, -1 }
macro FORTHENTRY name, xt, ct=0 {
macro FORTHNAMES \{
FORTHNAMES
SNAME name
\}
macro FORTHSYMBS \{
FORTHSYMBS
dq xt, ct
\}
}
macro MACROENTRY name, xt, ct=0 {
macro MACRONAMES \{
MACRONAMES
SNAME name
\}
macro MACROSYMBS \{
MACROSYMBS
dq xt, ct
\}
}
macro FORTHCODE name, xt {
FORTHENTRY name, xt
label xt
}
macro MACROCODE name, xt {
MACROENTRY name, xt
label xt
}
macro USERVAR name, addr, val {
FORTHENTRY name, addr
addr: dq val
}
macro RELOCDICT names, symbs, space {
lea rsi, [names]
lea rdi, [space]
mov ecx, names#.size
push rcx
rep movsb
pop rcx
lea rsi, [symbs]
lea rdi, [space+16*1024]
rep movsb
}
macro WINENTER n {
mov rbp, rsp
and rsp, -16
sub rsp, n
}
macro WINLEAVE {
mov rsp, rbp
}
macro DUP {
lea rbx, [rbx-8]
mov [rbx], rax
}
macro DROP n=1 {
assert n > 0
mov rax, [rbx+8*(n-1)]
lea rbx, [rbx+8*n]
}
macro NIP {
lea rbx, [rbx+8]
}
macro CHECKSTK {
lea rcx, [stack_space]
cmp rbx, rcx
je abort.uf
}
section '.data' data readable writeable
align 16
basedigits db '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
digitmap dq $03FF000000000000, $07FFFFFE07FFFFFE
align 8
action dq interpret
sbuf_i dd 0
user_vars:
USERVAR 'fd' , fd, forth_space+forth_names.size
USERVAR 'md' , md, macro_space+macro_names.size
USERVAR 'hd' , hd, fd
USERVAR '#tib' , tib_n, 0
USERVAR '>in' , tib_i, 0
USERVAR 'base' , base, 10
USERVAR 'xhere', xhere, code_space
USERVAR 'here' , here, data_space
; == UNINITIALIZED DATA
align 8
stdin dq ?
stdout dq ?
conin dq ?
rsp0 dq ?
align 4096
forth_space rb 32*1024
macro_space rb 32*1024
BUFSIZE equ 256
tib rb BUFSIZE
tob rb BUFSIZE
nob rb BUFSIZE
sbuf rb 8*BUFSIZE
align 16
lname rb 32
lname_n db ?
align 4096
data_space rb 32*1024*1024
data_end = $
align 4096
stack_end rb 4096
stack_space = $
section '.text' code executable readable
FORTHCODE 'accept', accept ; ( adr u1 -- u2 )
mov rdi, [rbx]
WINENTER $50
virtual at rsp+$28
.nread dd ?
dd ? ; align .bi struct
.bi_dwSize dd ?
.bi_dwCursorPosition dd ?
.bi_wAttributes dw ?
.bi_srWindow rw 4
.bi_dwMaximumWindowSize dd ?
end virtual
mov rcx, [stdin]
mov rdx, rdi
mov r8d, eax
lea r9, [.nread]
mov qword [rsp+$20], 0
call [ReadFile]
mov eax, [.nread]
test eax, eax
je .empty
; trim trailing [\r]\n
mov rsi, rdi
mov ecx, eax
mov al, $0A
repne scasb
cmp byte [rdi-2], $0D
jne @f
dec rdi ; drop \r
@@:
dec rdi ; drop \n
; adjust file pointer if we read past first [\r]\n
; (can happen when stdin is redirected to a file)
neg ecx
mov edx, ecx
mov rcx, [stdin]
xor r8, r8
mov r9d, 1 ; FILE_CURRENT
call [SetFilePointer]
mov rax, rdi
sub rax, rsi
cmp qword [conin], 0
jne .leave
mov esi, eax
mov rcx, [stdout]
lea rdx, [.bi_dwSize]
call [GetConsoleScreenBufferInfo]
mov edx, [.bi_dwCursorPosition]
add edx, $FFFF0000
or edx, esi
mov rcx, [stdout]
call [SetConsoleCursorPosition]
mov eax, esi
.leave:
WINLEAVE
NIP
ret
.empty:
mov rdi, [conin]
test rdi, rdi
je .leave
mov [stdin], rdi
xor eax, eax
mov [conin], rax
jmp .leave
FORTHCODE 'refill', refill ; ( -- ZF )
lea rbx, [rbx-16]
mov [rbx+8], rax
lea rdx, [tib]
mov [rbx], rdx
mov eax, BUFSIZE
call accept
mov dword [tib_n], eax
mov dword [tib_i], 0
test eax, eax
DROP
ret
FORTHCODE 'cr', cr ; ( -- )
DUP
mov dl, $0A
jmp emit.0
FORTHCODE 'space', space ; ( -- )
DUP
mov al, ' '
FORTHCODE 'emit', emit ; ( c -- )
mov dl, al
.0:
lea rax, [tob]
mov byte [rax], dl
DUP
mov eax, 1
FORTHCODE 'type', type ; ( adr u -- )
WINENTER $30
mov rcx, [stdout]
mov rdx, [rbx]
mov r8d, eax
xor r9, r9
mov [rsp+$20], r9
call [WriteFile]
WINLEAVE
DROP 2
ret
FORTHCODE 'h.', hexdot ; ( x -- )
CHECKSTK
bswap rax
mov rcx, $F0F0F0F0F0F0F0F0
and rcx, rax
xor rax, rcx
shr rcx, 4
movq xmm0, rax
movq xmm1, rcx
punpcklbw xmm1, xmm0
movdqa xmm0, xword [basedigits]
pshufb xmm0, xmm1
lea rax, [tob]
movdqa [rax], xmm0
mov byte [rax+16], $20
DUP
mov eax, 17
jmp type
FORTHCODE '.', dot ; ( x -- )
CHECKSTK
lea rsi, [basedigits]
lea rdi, [nob+BUFSIZE-2]
mov ecx, [base]
mov r8, rax
mov byte [rdi+1], ' '
test rax, rax
jns .loop
neg rax
.loop:
xor edx, edx
div rcx
mov rdx, [rsi+rdx]
mov byte [rdi], dl
dec rdi
test rax, rax
jnz .loop
test r8, r8
jns .nosign
mov byte [rdi], '-'
dec rdi
.nosign:
inc rdi
mov rax, rdi
DUP
lea rax, [nob+BUFSIZE]
sub rax, rdi
jmp type
FORTHCODE '.s', dot_s ; ( -- )
DUP
mov rsi, rbx
lea rdi, [stack_space-8]
call cr
jmp .check
.loop:
DUP
mov rax, [rsi]
call hexdot
call cr
lea rsi, [rsi+8]
.check:
cmp rsi, rdi
jne .loop
DROP
ret
FORTHCODE '.depth', dot_depth ; ( -- )
DUP
lea rax, [stack_space]
sub rax, rbx
shr rax, 3
dec rax
jmp dot
FORTHCODE 'color', color ; ( x -- )
mov edx, eax
DROP
.set:
push rax
WINENTER $20
mov rcx, [stdout]
call [SetConsoleTextAttribute]
WINLEAVE
pop rax
ret
FORTHCODE 'red', red
mov edx, $0C ; FOREGROUND_RED | FOREGROUND_INTENSITY
jmp color.set
FORTHCODE 'silver', silver
mov edx, $07
jmp color.set
FORTHCODE 'white', white
mov edx, $0F
jmp color.set
FORTHCODE 'char', char ; ( parse: next character -- c )
call word_
cmp eax, 1
jne abort.notfnd
mov rsi, [rbx]
movzx eax, byte [rsi]
NIP
ret
MACROCODE '[char]', mchar
call char
jmp lit_comma
FORTHCODE 'parse', parse ; ( c -- adr u )
lea rsi, [tib]
mov edi, [tib_n]
mov ecx, [tib_i]
lea rbx, [rbx-8]
lea r8, [rsi+rcx]
movzx edx, al
mov [rbx], r8
xor eax, eax
cmp ecx, edi
jae .empty
.scan:
cmp byte [rsi+rcx], dl
je .done
inc ecx
cmp ecx, edi
jb .scan
.done:
lea rax, [rsi+rcx]
sub rax, r8
inc ecx
mov [tib_i], ecx
.empty:
ret
FORTHCODE 'word', word_ ; ( -- adr u )
lea rsi, [tib]
mov edx, [tib_n]
mov ecx, [tib_i]
lea rbx, [rbx-16]
mov [rbx+8], rax
xor eax, eax
mov [rbx], rax
cmp ecx, edx
jae .empty
.skip:
cmp byte [rsi+rcx], $20
ja .scan0
inc ecx
cmp ecx, edx
jb .skip
.scan0:
lea r8, [rsi+rcx]
lea r9, [lname]
lea r10, [lname+31]
pxor xmm0, xmm0
movdqa [r9], xmm0
.scan:
mov al, byte [rsi+rcx]
cmp al, $20
jbe .done
cmp r9, r10
je .next
mov byte [r9], al
inc r9
.next:
inc ecx
cmp ecx, edx
jb .scan
.done:
lea r10, [lname]
sub r9, r10
mov byte [lname_n], r9b
lea rax, [rsi+rcx]
sub rax, r8
inc ecx
mov [tib_i], ecx
mov [rbx], r8
.empty:
ret
; ZF=1 ok, entire string converted, ZF=0 not a number
FORTHCODE 'number', number ; ( adr u -- x )
test rax, rax
jz .empty
mov rsi, [rbx]
mov edi, [base]
xor r8, r8
xor r9, r9
cmp byte [rsi], '-'
sete r9b
add rsi, r9
sub rax, r9
cmp byte [rsi], '$'
jne @f
mov edi, 16
jmp .prefix
@@:
cmp byte [rsi], '#'
jne .loop
mov edi, 10
.prefix:
inc rsi
dec rax
.loop:
movzx ecx, byte [rsi]
inc rsi
and cl, $7F
bt dword [digitmap], ecx
jnc .done
sub cl, $30
mov edx, ecx
cmp cl, 9
jbe .digit
add cl, $30
and cl, $DF
lea rdx, [rcx-('0'+7)]
.digit:
cmp edx, edi
jge .error
imul r8, rdi
add r8, rdx
dec rax
jnz .loop
.error:
test r9, r9
je .done
neg r8
.done:
test eax, eax
mov rax, r8
.empty:
NIP
ret
FORTHCODE 'header', header ; ( -- )
call word_
movdqa xmm0, xword [lname]
mov rdx, [hd]
mov rdi, [rdx]
movdqa [rdi], xmm0
mov rcx, [xhere]
mov [rdi+16*1024], rcx
add rdi, 16
mov [rdx], rdi
DROP 2
ret
; allocate n bytes of data space if n > 0, otherwise deallocate
FORTHCODE 'allot', allot ; ( n -- )
add qword [here], rax
@@:
DROP
ret
; allocate n bytes of code space if n > 0, otherwise deallocate
FORTHCODE 'xallot', xallot ; ( n -- )
add qword [xhere], rax
jmp @b
; store and allocate space for a number in data space
FORTHCODE ',', comma ; ( x -- )
mov ecx, 8
@@:
mov rdi, [here]
mov [rdi], rax
add rdi, rcx
mov [here], rdi
DROP
ret
FORTHCODE 'l,', lcomma
mov ecx, 4
jmp @b
FORTHCODE 'w,', wcomma
mov ecx, 2
jmp @b
FORTHCODE 'c,', ccomma
mov ecx, 1
jmp @b
; store x in code space and advance compiler pointer by n
FORTHCODE ',,', xcomma ; ( x n -- )
mov rdi, [xhere]
mov rdx, [rbx]
mov [rdi], rdx
add rdi, rax
mov [xhere], rdi
DROP 2
ret
; try to compile a signed imm8 or imm32 value
FORTHCODE '#,,', numxcomma ; ( x -- )
mov rdi, [xhere]
movsx rdx, al
cmp rdx, rax
jne .32
mov byte [rdi], al
inc rdi
.done:
mov [xhere], rdi
DROP
ret
.32:
movsxd rdx, eax
cmp rdx, rax
jne abort.imm32
mov dword [rdi], eax
add rdi, 4
jmp .done
; switch to compiling into forth dict
FORTHCODE 'forth', forth ; ( -- )
lea rdi, [fd]
@@:
mov [hd], rdi
ret
; switch to compiling into macro dict
FORTHCODE 'macro', macro_ ; ( -- )
lea rdi, [md]
jmp @b
; switch to compiler
FORTHCODE ']', rbrack ; ( -- )
lea rdx, [compile]
mov qword [action], rdx
ret
; exit process
FORTHCODE 'bye', bye ; ( -- )
WINENTER $20
xor ecx, ecx
jmp [ExitProcess]
; comment, parse and drop rest of line
FORTHCODE '\', backslash ; ( -- )
MACROCODE '\', mbackslash
DUP
mov al, $0A
call parse
DROP 2
ret
; parse word and lookup its xt in forth dict
FORTHCODE "'", tick ; ( -- xt )
call word_
call find
jne mtick.err
.ret:
DUP
mov rax, [rsi]
ret
; parse word and lookup its xt in macro dict
FORTHCODE "''", mtick ; ( -- xt )
call word_
call mfind
je tick.ret
.err:
DROP 2
jmp abort.notfnd
; parse a string delimited by " and push its address on the stack
FORTHCODE 'z"', zquote ; ( -- adr )
DUP
mov al, '"'
call parse
mov edx, [sbuf_i]
inc dword [sbuf_i]
and edx, 7
shl edx, 8
lea rdi, [sbuf+rdx]
push rdi
mov rsi, [rbx]
mov ecx, eax
rep movsb
xor eax, eax
stosb
pop rax
NIP
ret
FORTHCODE 'dll-load', dll_load ; ( zstr -- )
WINENTER $20
mov rcx, rax
call [LoadLibraryA]
WINLEAVE
push rax
call header
pop rax
call lit_comma
jmp exit
FORTHCODE 'dll-proc', dll_proc
call header
mov rdi, [xhere]
ret
FORTHCODE 'dll-call', dll_call ; ( args.. dll zstr -- )
WINENTER $20
mov rcx, [rbx]
mov rdx, rax
call [GetProcAddress]
mov r9, [rbx+$08]
mov r8, [rbx+$10]
mov rdx, [rbx+$18]
mov rcx, [rbx+$20]
call rax
WINLEAVE
DROP 6
ret
MACROCODE 'xhere', mxhere ; ( -- adr )
DUP
mov rax, [xhere]
ret
; switch to interpreter
MACROCODE '[', lbrack ; ( -- )
lea rdx, [interpret]
mov qword [action], rdx
ret
; end current definition
MACROCODE ';', semi ; ( -- )
call lbrack
MACROCODE ';;', exit
mov rdi, [xhere]
mov byte [rdi], $C3
inc qword [xhere]
ret
MACROCODE 'then', then
ret
; parse a string delimited by " and compile code to push its address
; on the data stack
MACROCODE 'z"', mzquote ; ( -- adr )
DUP
mov al, '"'
call parse
mov rdi, [xhere]
lea rdx, [.pushstr]
add rdi, 5
sub rdx, rdi
mov byte [rdi-5], $E8
mov dword [rdi-4], edx
mov ecx, eax
inc al
stosb
mov rsi, [rbx]
rep movsb
xor eax, eax
stosb
mov [xhere], rdi
DROP 2
ret
.pushstr:
pop rdi
movzx edx, byte [rdi]
lea rdx, [rdi+rdx+1]
push rdx
DUP
lea rax, [rdi+1]
ret
;MACROCODE 'for', for
;; 0000: 41 54 push r12
;; 0002: 49 89 C4 mov r12,rax
;; 0005: 48 8B 03 mov rax,qword ptr [rbx]
;; 0008: 48 8D 5B 08 lea rbx,[rbx+8]
; DUP
; mov rax, [xhere]
; mov rdx, $038B48C489495441
; mov ecx, $085B8D48
; mov [rax+0], rdx
; mov [rax+8], ecx
; add rax, 12
; mov [xhere], rax
; ret
MACROCODE 'next', next ; ( orig -- )
; 0000: 49 FF CC dec r12
; 0003: 75 00 jne 00
; 0003: 0F 85 00 00 00 00 jne 00
; 0005: 41 5C pop r12
mov rdi, [xhere]
mov dword [rdi+$00], $CCFF49
sub rax, 5
sub rax, rdi
add rdi, 3
cmp eax, -128
jl .rel32
mov byte [rdi+$00], $75
mov byte [rdi+$01], al
add rdi, 2
jmp .rest
.rel32:
sub rax, 4
mov word [rdi+$00], $850F
mov dword [rdi+$02], eax
add rdi, 6
.rest:
mov word [rdi+$00], $5C41
add rdi, 2
mov [xhere], rdi
DROP
ret
MACROCODE 'dup', mdup ; ( x -- x x )
mov rdi, [xhere]
mov dword [rdi+$00], $F85B8D48 ; lea rbx, [rbx-8]
mov dword [rdi+$04], $038948 ; mov [rbx], rax
add rdi, 7
mov [xhere], rdi
ret
MACROCODE 'int3', _int3
int3
ret
; [m]find ( adr u -- adr u | -- )
; ZF=1 found, ZF=0 not found, symb offset in rsi
; if found, consumes string, otherwise leaves it
mfind:
mov rsi, [md]
lea rdi, [macro_space]
jmp @f
find:
mov rsi, [fd]
lea rdi, [forth_space]
@@:
movdqa xmm0, xword [lname]
jmp .next
.loop:
movdqa xmm1, [rsi]
pcmpeqb xmm1, xmm0
pmovmskb ecx, xmm1
cmp ecx, $FFFF
je .match
.next:
sub rsi, 16
cmp rsi, rdi
ja .loop
or ecx, 1
ret
.match:
lea rsi, [rsi+16*1024]
DROP 2
ret
interpret:
call find
jne .num
mov rdi, [rsi]
lea rdx, [data_end]
cmp rdi, rdx
jb .var
jmp rdi
.var:
DUP
mov rax, [rdi]
ret
.num:
call number
jne abort.notfnd
ret
compile:
call mfind
jne @f
jmp qword [rsi]
@@:
call find
jne lit_comma0
DUP
mov rax, [rsi]
; call, ( xt -- )
FORTHCODE 'call,', call_comma
mov rdi, [xhere]
mov byte [rdi], $E8 ; call rel32
inc rdi
mov [xhere], rdi
jmp @f
; rel32, ( adr -- )
FORTHCODE 'rel32,', rel32_comma
mov rdi, [xhere]
@@:
add rdi, 4
sub rax, rdi
mov dword [rdi-4], eax
mov [xhere], rdi
DROP
ret
lit_comma0:
call number
jne abort.notfnd
FORTHCODE 'lit,', lit_comma ; ( n -- )
call mdup
mov word [rdi+$00], $B848 ; mov rax, 0
mov qword [rdi+$02], rax
add rdi, 10
mov [xhere], rdi
DROP
ret
quit:
call refill
je .prompt0
call space
.loop:
call word_
test eax, eax
je .prompt
call qword [action]
jmp .loop
.prompt0:
call space
lea rbx, [rbx-16]
.prompt:
lea rdi, [tob]
mov dword [rdi+0], $3A6B6F20 ; ok:
mov [rbx], rdi
mov eax, 4
call type
call dot_depth
call cr
jmp quit
; TODO: clean this up
abort:
.uf:
lea rbx, [rbx-16]
mov [rbx+8], rax
lea rdi, [tob]
mov dword [rdi], '#UF'
mov [rbx], rdi
mov eax, 3
jmp .print
.notfnd:
lea rbx, [rbx-16]
mov [rbx+8], rax
xor eax, eax
lea rdi, [tob]
push rdi
lea rsi, [strings.abort.error]
mov ecx, strings.abort.error.size + strings.abort.notfnd.size
add eax, ecx
rep movsb
lea rsi, [lname]
movzx ecx, byte [lname_n]
add eax, ecx
rep movsb
pop qword [rbx]
jmp .print
; ( n -- )
.imm32:
lea rbx, [rbx-40] ; allocate 5 args
mov [rbx+32], rax
lea rdx, [strings.abort.error]
mov [rbx], rdx
mov eax, strings.abort.error.size
call white
call type
mov rax, [rbx+16]
call dot
lea rdx, [strings.abort.imm32]
mov [rbx], rdx
mov eax, strings.abort.imm32.size
jmp @f
.print:
call white
@@:
call type
call cr
call silver
.reset:
mov rsp, [rsp0]
lea rbx, [stack_space]
jmp quit
start:
RELOCDICT forth_names, forth_symbs, forth_space
RELOCDICT macro_names, macro_symbs, macro_space
WINENTER $40
mov ecx, -10
call [GetStdHandle]
mov [stdin], rax
mov rcx, rax
call [GetFileType]
cmp al, 2
je @f
lea rcx, [strings.conin]
mov edx, $80000000 ; GENERIC_READ
mov r8d, 1 ; FILE_SHARE_READ
xor r9, r9
mov dword [rsp+$20], 3 ; OPEN_EXISTING
mov dword [rsp+$28], r9d
mov qword [rsp+$30], r9
call [CreateFileA]
mov [conin], rax
@@:
mov ecx, -11
call [GetStdHandle]
mov [stdout], rax
lea rcx, [code_space]
mov edx, 32*1024
mov r8d, $40 ; PAGE_EXECUTE_READWRITE
lea r9, [rsp+$28]
call [VirtualProtect]
WINLEAVE
lea rbx, [stack_space]
lea r15, [user_vars]
mov [rsp0], rsp
jmp quit
align 4096
code_space rb 32*1024
section '.rdata' data readable
IMPORT \
kernel32, <\
GetProcAddress,\
LoadLibraryA,\
VirtualProtect,\
SetConsoleTextAttribute,\
GetConsoleScreenBufferInfo,\
SetConsoleCursorPosition,\
SetFilePointer,\
CreateFileA,\
ReadFile,\
WriteFile,\
GetStdHandle,\
GetFileType,\
ExitProcess>
macro STRING name, s {
.#name: db s
.#name#.size = $ - .#name
}
strings:
STRING conin, <'CONIN$', 0>
STRING abort.error, 'ERROR: '
STRING abort.notfnd, 'undefined word: '
STRING abort.imm32, 'cannot be encoded as an imm32 operand'
align 16
forth_names:
FORTHNAMES
.size = $ - forth_names
forth_symbs:
FORTHSYMBS
.size = $ - forth_symbs
macro_names:
MACRONAMES
.size = $ - macro_names
macro_symbs:
MACROSYMBS
.size = $ - macro_symbs
assert forth_names.size = forth_symbs.size
assert macro_names.size = macro_symbs.size
macro PRINT n {
local d
repeat 4
d = '0' + n shr (16-%*4) and $F
if d > '9'
d = d + 'A'-'9'-1
end if
display d
end repeat
}
display 'forths: '
PRINT (forth_names.size / 16 - 1)
display $0D, $0A, 'macros: '
PRINT (macro_names.size / 16 - 1)
|
llvm-gcc-4.2-2.9/gcc/ada/par-tchk.adb | vidkidz/crossbridge | 1 | 22566 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P A R . T C H K --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2005, 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 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, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Token scan routines
-- Error recovery: none of the T_xxx or TF_xxx routines raise Error_Resync
separate (Par)
package body Tchk is
type Position is (SC, BC, AP);
-- Specify position of error message (see Error_Msg_SC/BC/AP)
-----------------------
-- Local Subprograms --
-----------------------
procedure Check_Token (T : Token_Type; P : Position);
pragma Inline (Check_Token);
-- Called by T_xx routines to check for reserved keyword token. P is the
-- position of the error message if the token is missing (see Wrong_Token)
procedure Wrong_Token (T : Token_Type; P : Position);
-- Called when scanning a reserved keyword when the keyword is not
-- present. T is the token type for the keyword, and P indicates the
-- position to be used to place a message relative to the current
-- token if the keyword is not located nearby.
-----------------
-- Check_Token --
-----------------
procedure Check_Token (T : Token_Type; P : Position) is
begin
if Token = T then
Scan;
return;
else
Wrong_Token (T, P);
end if;
end Check_Token;
-------------
-- T_Abort --
-------------
procedure T_Abort is
begin
Check_Token (Tok_Abort, SC);
end T_Abort;
-------------
-- T_Arrow --
-------------
procedure T_Arrow is
begin
if Token = Tok_Arrow then
Scan;
-- A little recovery helper, accept then in place of =>
elsif Token = Tok_Then then
Error_Msg_BC ("missing ""='>""");
Scan; -- past THEN used in place of =>
elsif Token = Tok_Colon_Equal then
Error_Msg_SC (""":="" should be ""='>""");
Scan; -- past := used in place of =>
else
Error_Msg_AP ("missing ""='>""");
end if;
end T_Arrow;
----------
-- T_At --
----------
procedure T_At is
begin
Check_Token (Tok_At, SC);
end T_At;
------------
-- T_Body --
------------
procedure T_Body is
begin
Check_Token (Tok_Body, BC);
end T_Body;
-----------
-- T_Box --
-----------
procedure T_Box is
begin
if Token = Tok_Box then
Scan;
else
Error_Msg_AP ("missing ""'<'>""");
end if;
end T_Box;
-------------
-- T_Colon --
-------------
procedure T_Colon is
begin
if Token = Tok_Colon then
Scan;
else
Error_Msg_AP ("missing "":""");
end if;
end T_Colon;
-------------------
-- T_Colon_Equal --
-------------------
procedure T_Colon_Equal is
begin
if Token = Tok_Colon_Equal then
Scan;
elsif Token = Tok_Equal then
Error_Msg_SC ("""="" should be "":=""");
Scan;
elsif Token = Tok_Colon then
Error_Msg_SC (""":"" should be "":=""");
Scan;
elsif Token = Tok_Is then
Error_Msg_SC ("IS should be "":=""");
Scan;
else
Error_Msg_AP ("missing "":=""");
end if;
end T_Colon_Equal;
-------------
-- T_Comma --
-------------
procedure T_Comma is
begin
if Token = Tok_Comma then
Scan;
else
if Token = Tok_Pragma then
P_Pragmas_Misplaced;
end if;
if Token = Tok_Comma then
Scan;
else
Error_Msg_AP ("missing "",""");
end if;
end if;
if Token = Tok_Pragma then
P_Pragmas_Misplaced;
end if;
end T_Comma;
---------------
-- T_Dot_Dot --
---------------
procedure T_Dot_Dot is
begin
if Token = Tok_Dot_Dot then
Scan;
else
Error_Msg_AP ("missing ""..""");
end if;
end T_Dot_Dot;
-----------
-- T_For --
-----------
procedure T_For is
begin
Check_Token (Tok_For, AP);
end T_For;
-----------------------
-- T_Greater_Greater --
-----------------------
procedure T_Greater_Greater is
begin
if Token = Tok_Greater_Greater then
Scan;
else
Error_Msg_AP ("missing ""'>'>""");
end if;
end T_Greater_Greater;
------------------
-- T_Identifier --
------------------
procedure T_Identifier is
begin
if Token = Tok_Identifier then
Scan;
elsif Token in Token_Class_Literal then
Error_Msg_SC ("identifier expected");
Scan;
else
Error_Msg_AP ("identifier expected");
end if;
end T_Identifier;
----------
-- T_In --
----------
procedure T_In is
begin
Check_Token (Tok_In, AP);
end T_In;
----------
-- T_Is --
----------
procedure T_Is is
begin
if Token = Tok_Is then
Scan;
Ignore (Tok_Semicolon);
-- Allow OF, => or = to substitute for IS with complaint
elsif Token = Tok_Arrow
or else Token = Tok_Of
or else Token = Tok_Equal
then
Error_Msg_SC ("missing IS");
Scan; -- token used in place of IS
else
Wrong_Token (Tok_Is, AP);
end if;
while Token = Tok_Is loop
Error_Msg_SC ("extra IS ignored");
Scan;
end loop;
end T_Is;
------------------
-- T_Left_Paren --
------------------
procedure T_Left_Paren is
begin
if Token = Tok_Left_Paren then
Scan;
else
Error_Msg_AP ("missing ""(""");
end if;
end T_Left_Paren;
------------
-- T_Loop --
------------
procedure T_Loop is
begin
if Token = Tok_Do then
Error_Msg_SC ("LOOP expected");
Scan;
else
Check_Token (Tok_Loop, AP);
end if;
end T_Loop;
-----------
-- T_Mod --
-----------
procedure T_Mod is
begin
Check_Token (Tok_Mod, AP);
end T_Mod;
-----------
-- T_New --
-----------
procedure T_New is
begin
Check_Token (Tok_New, AP);
end T_New;
----------
-- T_Of --
----------
procedure T_Of is
begin
Check_Token (Tok_Of, AP);
end T_Of;
----------
-- T_Or --
----------
procedure T_Or is
begin
Check_Token (Tok_Or, AP);
end T_Or;
---------------
-- T_Private --
---------------
procedure T_Private is
begin
Check_Token (Tok_Private, SC);
end T_Private;
-------------
-- T_Range --
-------------
procedure T_Range is
begin
Check_Token (Tok_Range, AP);
end T_Range;
--------------
-- T_Record --
--------------
procedure T_Record is
begin
Check_Token (Tok_Record, AP);
end T_Record;
-------------------
-- T_Right_Paren --
-------------------
procedure T_Right_Paren is
begin
if Token = Tok_Right_Paren then
Scan;
else
Error_Msg_AP ("missing "")""");
end if;
end T_Right_Paren;
-----------------
-- T_Semicolon --
-----------------
procedure T_Semicolon is
begin
if Token = Tok_Semicolon then
Scan;
if Token = Tok_Semicolon then
Error_Msg_SC ("extra "";"" ignored");
Scan;
end if;
return;
elsif Token = Tok_Colon then
Error_Msg_SC (""":"" should be "";""");
Scan;
return;
elsif Token = Tok_Comma then
Error_Msg_SC (""","" should be "";""");
Scan;
return;
elsif Token = Tok_Dot then
Error_Msg_SC ("""."" should be "";""");
Scan;
return;
-- An interesting little kludge here. If the previous token is a
-- semicolon, then there is no way that we can legitimately need
-- another semicolon. This could only arise in an error situation
-- where an error has already been signalled. By simply ignoring
-- the request for a semicolon in this case, we avoid some spurious
-- missing semicolon messages.
elsif Prev_Token = Tok_Semicolon then
return;
-- If the current token is | then this is a reasonable
-- place to suggest the possibility of a "C" confusion :-)
elsif Token = Tok_Vertical_Bar then
Error_Msg_SC ("unexpected occurrence of ""'|"", did you mean OR'?");
Resync_Past_Semicolon;
return;
-- Deal with pragma. If pragma is not at start of line, it is
-- considered misplaced otherwise we treat it as a normal
-- missing semicolong case.
elsif Token = Tok_Pragma
and then not Token_Is_At_Start_Of_Line
then
P_Pragmas_Misplaced;
if Token = Tok_Semicolon then
Scan;
return;
end if;
end if;
-- If none of those tests return, we really have a missing semicolon
Error_Msg_AP ("|missing "";""");
return;
end T_Semicolon;
------------
-- T_Then --
------------
procedure T_Then is
begin
Check_Token (Tok_Then, AP);
end T_Then;
------------
-- T_Type --
------------
procedure T_Type is
begin
Check_Token (Tok_Type, BC);
end T_Type;
-----------
-- T_Use --
-----------
procedure T_Use is
begin
Check_Token (Tok_Use, SC);
end T_Use;
------------
-- T_When --
------------
procedure T_When is
begin
Check_Token (Tok_When, SC);
end T_When;
------------
-- T_With --
------------
procedure T_With is
begin
Check_Token (Tok_With, BC);
end T_With;
--------------
-- TF_Arrow --
--------------
procedure TF_Arrow is
Scan_State : Saved_Scan_State;
begin
if Token = Tok_Arrow then
Scan; -- skip arrow and we are done
elsif Token = Tok_Colon_Equal then
T_Arrow; -- Let T_Arrow give the message
else
T_Arrow; -- give missing arrow message
Save_Scan_State (Scan_State); -- at start of junk tokens
loop
if Prev_Token_Ptr < Current_Line_Start
or else Token = Tok_Semicolon
or else Token = Tok_EOF
then
Restore_Scan_State (Scan_State); -- to where we were!
return;
end if;
Scan; -- continue search!
if Token = Tok_Arrow then
Scan; -- past arrow
return;
end if;
end loop;
end if;
end TF_Arrow;
-----------
-- TF_Is --
-----------
procedure TF_Is is
Scan_State : Saved_Scan_State;
begin
if Token = Tok_Is then
T_Is; -- past IS and we are done
-- Allow OF or => or = in place of IS (with error message)
elsif Token = Tok_Of
or else Token = Tok_Arrow
or else Token = Tok_Equal
then
T_Is; -- give missing IS message and skip bad token
else
T_Is; -- give missing IS message
Save_Scan_State (Scan_State); -- at start of junk tokens
loop
if Prev_Token_Ptr < Current_Line_Start
or else Token = Tok_Semicolon
or else Token = Tok_EOF
then
Restore_Scan_State (Scan_State); -- to where we were!
return;
end if;
Scan; -- continue search!
if Token = Tok_Is
or else Token = Tok_Of
or else Token = Tok_Arrow
then
Scan; -- past IS or OF or =>
return;
end if;
end loop;
end if;
end TF_Is;
-------------
-- TF_Loop --
-------------
procedure TF_Loop is
Scan_State : Saved_Scan_State;
begin
if Token = Tok_Loop then
Scan; -- past LOOP and we are done
-- Allow DO or THEN in place of LOOP
elsif Token = Tok_Then or else Token = Tok_Do then
T_Loop; -- give missing LOOP message
else
T_Loop; -- give missing LOOP message
Save_Scan_State (Scan_State); -- at start of junk tokens
loop
if Prev_Token_Ptr < Current_Line_Start
or else Token = Tok_Semicolon
or else Token = Tok_EOF
then
Restore_Scan_State (Scan_State); -- to where we were!
return;
end if;
Scan; -- continue search!
if Token = Tok_Loop or else Token = Tok_Then then
Scan; -- past loop or then (message already generated)
return;
end if;
end loop;
end if;
end TF_Loop;
--------------
-- TF_Return--
--------------
procedure TF_Return is
Scan_State : Saved_Scan_State;
begin
if Token = Tok_Return then
Scan; -- skip RETURN and we are done
else
Error_Msg_SC ("missing RETURN");
Save_Scan_State (Scan_State); -- at start of junk tokens
loop
if Prev_Token_Ptr < Current_Line_Start
or else Token = Tok_Semicolon
or else Token = Tok_EOF
then
Restore_Scan_State (Scan_State); -- to where we were!
return;
end if;
Scan; -- continue search!
if Token = Tok_Return then
Scan; -- past RETURN
return;
end if;
end loop;
end if;
end TF_Return;
------------------
-- TF_Semicolon --
------------------
procedure TF_Semicolon is
Scan_State : Saved_Scan_State;
begin
if Token = Tok_Semicolon then
T_Semicolon;
return;
-- An interesting little kludge here. If the previous token is a
-- semicolon, then there is no way that we can legitimately need
-- another semicolon. This could only arise in an error situation
-- where an error has already been signalled. By simply ignoring
-- the request for a semicolon in this case, we avoid some spurious
-- missing semicolon messages.
elsif Prev_Token = Tok_Semicolon then
return;
else
-- Deal with pragma. If pragma is not at start of line, it is
-- considered misplaced otherwise we treat it as a normal
-- missing semicolong case.
if Token = Tok_Pragma
and then not Token_Is_At_Start_Of_Line
then
P_Pragmas_Misplaced;
if Token = Tok_Semicolon then
T_Semicolon;
return;
end if;
end if;
-- Here we definitely have a missing semicolon, so give message
T_Semicolon;
-- Scan out junk on rest of line
Save_Scan_State (Scan_State); -- at start of junk tokens
loop
if Prev_Token_Ptr < Current_Line_Start
or else Token = Tok_EOF
then
Restore_Scan_State (Scan_State); -- to where we were
return;
end if;
Scan; -- continue search
if Token = Tok_Semicolon then
T_Semicolon;
return;
elsif Token in Token_Class_After_SM then
return;
end if;
end loop;
end if;
end TF_Semicolon;
-------------
-- TF_Then --
-------------
procedure TF_Then is
Scan_State : Saved_Scan_State;
begin
if Token = Tok_Then then
Scan; -- past THEN and we are done
else
T_Then; -- give missing THEN message
Save_Scan_State (Scan_State); -- at start of junk tokens
loop
if Prev_Token_Ptr < Current_Line_Start
or else Token = Tok_Semicolon
or else Token = Tok_EOF
then
Restore_Scan_State (Scan_State); -- to where we were
return;
end if;
Scan; -- continue search!
if Token = Tok_Then then
Scan; -- past THEN
return;
end if;
end loop;
end if;
end TF_Then;
------------
-- TF_Use --
------------
procedure TF_Use is
Scan_State : Saved_Scan_State;
begin
if Token = Tok_Use then
Scan; -- past USE and we are done
else
T_Use; -- give USE expected message
Save_Scan_State (Scan_State); -- at start of junk tokens
loop
if Prev_Token_Ptr < Current_Line_Start
or else Token = Tok_Semicolon
or else Token = Tok_EOF
then
Restore_Scan_State (Scan_State); -- to where we were
return;
end if;
Scan; -- continue search!
if Token = Tok_Use then
Scan; -- past use
return;
end if;
end loop;
end if;
end TF_Use;
-----------------
-- Wrong_Token --
-----------------
procedure Wrong_Token (T : Token_Type; P : Position) is
Missing : constant String := "missing ";
Image : constant String := Token_Type'Image (T);
Tok_Name : constant String := Image (5 .. Image'Length);
M : String (1 .. Missing'Length + Tok_Name'Length);
begin
-- Set M to Missing & Tok_Name
M (1 .. Missing'Length) := Missing;
M (Missing'Length + 1 .. M'Last) := Tok_Name;
if Token = Tok_Semicolon then
Scan;
if Token = T then
Error_Msg_SP ("extra "";"" ignored");
Scan;
else
Error_Msg_SP (M);
end if;
elsif Token = Tok_Comma then
Scan;
if Token = T then
Error_Msg_SP ("extra "","" ignored");
Scan;
else
Error_Msg_SP (M);
end if;
else
case P is
when SC => Error_Msg_SC (M);
when BC => Error_Msg_BC (M);
when AP => Error_Msg_AP (M);
end case;
end if;
end Wrong_Token;
end Tchk;
|
Util/llvm/bindings/ada/llvm/llvm_link_time_optimizer-binding.ads | ianloic/unladen-swallow | 5 | 13483 | <reponame>ianloic/unladen-swallow
-- This file is generated by SWIG. Do *not* modify by hand.
--
with Interfaces.C.Strings;
package LLVM_link_time_Optimizer.Binding is
LTO_H : constant := 1;
LTO_API_VERSION : constant := 3;
function lto_get_version return Interfaces.C.Strings.chars_ptr;
function lto_get_error_message return Interfaces.C.Strings.chars_ptr;
function lto_module_is_object_file
(path : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_module_is_object_file_for_target
(path : in Interfaces.C.Strings.chars_ptr;
target_triple_prefix : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_module_is_object_file_in_memory
(mem : access Interfaces.C.Extensions.void;
length : in Interfaces.C.size_t)
return Interfaces.C.Extensions.bool;
function lto_module_is_object_file_in_memory_for_target
(mem : access Interfaces.C.Extensions.void;
length : in Interfaces.C.size_t;
target_triple_prefix : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_module_create
(path : in Interfaces.C.Strings.chars_ptr)
return LLVM_link_time_Optimizer.lto_module_t;
function lto_module_create_from_memory
(mem : access Interfaces.C.Extensions.void;
length : in Interfaces.C.size_t)
return LLVM_link_time_Optimizer.lto_module_t;
procedure lto_module_dispose
(the_mod : in LLVM_link_time_Optimizer.lto_module_t);
function lto_module_get_target_triple
(the_mod : in LLVM_link_time_Optimizer.lto_module_t)
return Interfaces.C.Strings.chars_ptr;
function lto_module_get_num_symbols
(the_mod : in LLVM_link_time_Optimizer.lto_module_t)
return Interfaces.C.unsigned;
function lto_module_get_symbol_name
(the_mod : in LLVM_link_time_Optimizer.lto_module_t;
index : in Interfaces.C.unsigned)
return Interfaces.C.Strings.chars_ptr;
function lto_module_get_symbol_attribute
(the_mod : in LLVM_link_time_Optimizer.lto_module_t;
index : in Interfaces.C.unsigned)
return LLVM_link_time_Optimizer.lto_symbol_attributes;
function lto_codegen_create return LLVM_link_time_Optimizer.lto_code_gen_t;
procedure lto_codegen_dispose
(arg_1 : in LLVM_link_time_Optimizer.lto_code_gen_t);
function lto_codegen_add_module
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
the_mod : in LLVM_link_time_Optimizer.lto_module_t)
return Interfaces.C.Extensions.bool;
function lto_codegen_set_debug_model
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
arg_1 : in LLVM_link_time_Optimizer.lto_debug_model)
return Interfaces.C.Extensions.bool;
function lto_codegen_set_pic_model
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
arg_1 : in LLVM_link_time_Optimizer.lto_codegen_model)
return Interfaces.C.Extensions.bool;
procedure lto_codegen_set_gcc_path
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
path : in Interfaces.C.Strings.chars_ptr);
procedure lto_codegen_set_assembler_path
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
path : in Interfaces.C.Strings.chars_ptr);
procedure lto_codegen_add_must_preserve_symbol
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
symbol : in Interfaces.C.Strings.chars_ptr);
function lto_codegen_write_merged_modules
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
path : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_codegen_compile
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
length : access Interfaces.C.size_t)
return access Interfaces.C.Extensions.void;
procedure lto_codegen_debug_options
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
arg_1 : in Interfaces.C.Strings.chars_ptr);
function llvm_create_optimizer return
LLVM_link_time_Optimizer.llvm_lto_t;
procedure llvm_destroy_optimizer
(lto : in LLVM_link_time_Optimizer.llvm_lto_t);
function llvm_read_object_file
(lto : in LLVM_link_time_Optimizer.llvm_lto_t;
input_filename : in Interfaces.C.Strings.chars_ptr)
return LLVM_link_time_Optimizer.llvm_lto_status_t;
function llvm_optimize_modules
(lto : in LLVM_link_time_Optimizer.llvm_lto_t;
output_filename : in Interfaces.C.Strings.chars_ptr)
return LLVM_link_time_Optimizer.llvm_lto_status_t;
private
pragma Import (C, lto_get_version, "Ada_lto_get_version");
pragma Import (C, lto_get_error_message, "Ada_lto_get_error_message");
pragma Import
(C,
lto_module_is_object_file,
"Ada_lto_module_is_object_file");
pragma Import
(C,
lto_module_is_object_file_for_target,
"Ada_lto_module_is_object_file_for_target");
pragma Import
(C,
lto_module_is_object_file_in_memory,
"Ada_lto_module_is_object_file_in_memory");
pragma Import
(C,
lto_module_is_object_file_in_memory_for_target,
"Ada_lto_module_is_object_file_in_memory_for_target");
pragma Import (C, lto_module_create, "Ada_lto_module_create");
pragma Import
(C,
lto_module_create_from_memory,
"Ada_lto_module_create_from_memory");
pragma Import (C, lto_module_dispose, "Ada_lto_module_dispose");
pragma Import
(C,
lto_module_get_target_triple,
"Ada_lto_module_get_target_triple");
pragma Import
(C,
lto_module_get_num_symbols,
"Ada_lto_module_get_num_symbols");
pragma Import
(C,
lto_module_get_symbol_name,
"Ada_lto_module_get_symbol_name");
pragma Import
(C,
lto_module_get_symbol_attribute,
"Ada_lto_module_get_symbol_attribute");
pragma Import (C, lto_codegen_create, "Ada_lto_codegen_create");
pragma Import (C, lto_codegen_dispose, "Ada_lto_codegen_dispose");
pragma Import (C, lto_codegen_add_module, "Ada_lto_codegen_add_module");
pragma Import
(C,
lto_codegen_set_debug_model,
"Ada_lto_codegen_set_debug_model");
pragma Import
(C,
lto_codegen_set_pic_model,
"Ada_lto_codegen_set_pic_model");
pragma Import
(C,
lto_codegen_set_gcc_path,
"Ada_lto_codegen_set_gcc_path");
pragma Import
(C,
lto_codegen_set_assembler_path,
"Ada_lto_codegen_set_assembler_path");
pragma Import
(C,
lto_codegen_add_must_preserve_symbol,
"Ada_lto_codegen_add_must_preserve_symbol");
pragma Import
(C,
lto_codegen_write_merged_modules,
"Ada_lto_codegen_write_merged_modules");
pragma Import (C, lto_codegen_compile, "Ada_lto_codegen_compile");
pragma Import
(C,
lto_codegen_debug_options,
"Ada_lto_codegen_debug_options");
pragma Import (C, llvm_create_optimizer, "Ada_llvm_create_optimizer");
pragma Import (C, llvm_destroy_optimizer, "Ada_llvm_destroy_optimizer");
pragma Import (C, llvm_read_object_file, "Ada_llvm_read_object_file");
pragma Import (C, llvm_optimize_modules, "Ada_llvm_optimize_modules");
end LLVM_link_time_Optimizer.Binding;
|
gdb/testsuite/gdb.ada/array_ptr_renaming/pack.ads | greyblue9/binutils-gdb | 1 | 17152 | <filename>gdb/testsuite/gdb.ada/array_ptr_renaming/pack.ads
-- Copyright 2015-2021 Free Software Foundation, Inc.
--
-- 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/>.
package Pack is
type Table_Type is
array (Natural range <>) of Integer;
type Table_Ptr_Type is access all Table_Type;
Table : Table_Type := (1 => 10, 2 => 20);
Table_Ptr : aliased Table_Ptr_Type := new Table_Type'(3 => 30, 4 => 40);
end Pack;
|
exampl05/mmfdemo/slave/slave.asm | AlexRogalskiy/Masm | 0 | 245441 | ; #########################################################################
.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include slave.inc ; local includes for this file
include dbmacros.asm
include errormac.asm
.code
; #########################################################################
start:
invoke InitCommonControls
; ------------------
; set global values
; ------------------
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke GetCommandLine
mov CommandLine, eax
invoke LoadIcon,hInstance,500 ; icon ID
mov hIcon, eax
invoke LoadCursor,NULL,IDC_ARROW
mov hCursor, eax
invoke GetSystemMetrics,SM_CXSCREEN
mov sWid, eax
invoke GetSystemMetrics,SM_CYSCREEN
mov sHgt, eax
call Main
invoke ExitProcess,eax
; #########################################################################
Main proc
LOCAL Wwd:DWORD,Wht:DWORD,Wtx:DWORD,Wty:DWORD
STRING szClassName,"Slave_Class"
SingleInstanceOnly ADDR szClassName
; --------------------------------------------
; register class name for CreateWindowEx call
; --------------------------------------------
invoke RegisterWinClass,ADDR WndProc,ADDR szClassName,
hIcon,hCursor,COLOR_BTNFACE+1
; -------------------------------------------------
; macro to autoscale window co-ordinates to screen
; percentages and centre window at those sizes.
; -------------------------------------------------
AutoScale 75, 70
invoke CreateWindowEx,WS_EX_LEFT,
ADDR szClassName,
ADDR szDisplayName,
WS_OVERLAPPEDWINDOW,
400,10,200,200,
NULL,NULL,
hInstance,NULL
mov hWnd,eax
; ---------------------------
; macros for unchanging code
; ---------------------------
DisplayWindow hWnd,SW_SHOWNORMAL
call MsgLoop
ret
Main endp
; #########################################################################
RegisterWinClass proc lpWndProc:DWORD, lpClassName:DWORD,
Icon:DWORD, Cursor:DWORD, bColor:DWORD
LOCAL wc:WNDCLASSEX
mov wc.cbSize, sizeof WNDCLASSEX
mov wc.style, CS_BYTEALIGNCLIENT or \
CS_BYTEALIGNWINDOW
m2m wc.lpfnWndProc, lpWndProc
mov wc.cbClsExtra, NULL
mov wc.cbWndExtra, NULL
m2m wc.hInstance, hInstance
m2m wc.hbrBackground, bColor
mov wc.lpszMenuName, NULL
m2m wc.lpszClassName, lpClassName
m2m wc.hIcon, Icon
m2m wc.hCursor, Cursor
m2m wc.hIconSm, Icon
invoke RegisterClassEx, ADDR wc
ret
RegisterWinClass endp
; ########################################################################
MsgLoop proc
; ------------------------------------------
; The following 4 equates are available for
; processing messages directly in the loop.
; m_hWnd - m_Msg - m_wParam - m_lParam
; ------------------------------------------
LOCAL msg:MSG
StartLoop:
invoke GetMessage,ADDR msg,NULL,0,0
cmp eax, 0
je ExitLoop
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
jmp StartLoop
ExitLoop:
mov eax, msg.wParam
ret
MsgLoop endp
; #########################################################################
WndProc proc hWin :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
LOCAL var :DWORD
LOCAL caW :DWORD
LOCAL caH :DWORD
LOCAL hExt :DWORD
LOCAL Rct :RECT
LOCAL buffer1[128]:BYTE ; these are two spare buffers
LOCAL buffer2[128]:BYTE ; for text manipulation etc..
.if uMsg == WM_COMMAND
;======== toolbar commands ========
.if wParam == 50
mov eax, lpMemFile
mov eax, [eax]
mov hExt, eax
invoke SendMessage,hExt,WM_COMMAND,1000,1
.elseif wParam == 51
mov eax, lpMemFile
mov eax, [eax]
mov hExt, eax
invoke SendMessage,hExt,WM_COMMAND,1000,2
.elseif wParam == 52
mov eax, lpMemFile
mov eax, [eax]
mov hExt, eax
invoke SendMessage,hExt,WM_COMMAND,1000,3
.elseif wParam == 1000
.if lParam == 1
invoke SendMessage,hWnd,WM_SYSCOMMAND,SC_CLOSE,0
.endif
.endif
.elseif uMsg == WM_CREATE
invoke Do_ToolBar,hWin
invoke Do_Status,hWin
; @@@@@@@@@@@@@@@@@@@@@@@@@@@
; Create the memory mapped file
; @@@@@@@@@@@@@@@@@@@@@@@@@@@
invoke CreateFileMapping,0FFFFFFFFh, ; nominates the system paging
NULL,
PAGE_READWRITE, ; read write access to memory
0,
1000000, ; size in BYTEs
SADD("My_MM_File") ; set file object name here
mov hMMF, eax
; @@@@@@@@@@@@@@@@@@@@@@@@@@@
; map a view of that file into
; this applications memory
; address space.
; @@@@@@@@@@@@@@@@@@@@@@@@@@@
invoke MapViewOfFile,hMMF,FILE_MAP_WRITE,0,0,0
mov lpMemFile, eax
add eax, 4
mov ecx, hWin
mov [eax], ecx ; put window handle at offset 4 in the memory mapped file
.elseif uMsg == WM_SYSCOLORCHANGE
invoke Do_ToolBar,hWin
.elseif uMsg == WM_SIZE
invoke SendMessage,hToolBar,TB_AUTOSIZE,0,0
invoke MoveWindow,hStatus,0,0,0,0,TRUE
.elseif uMsg == WM_CLOSE
; @@@@@@@@@@@@@@@@@@@@@@@@@@@
; unmap view and close handle
; @@@@@@@@@@@@@@@@@@@@@@@@@@@
invoke UnmapViewOfFile,lpMemFile
invoke CloseHandle,hMMF
.elseif uMsg == WM_DESTROY
invoke PostQuitMessage,NULL
return 0
.endif
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
WndProc endp
; ########################################################################
TopXY proc wDim:DWORD, sDim:DWORD
shr sDim, 1 ; divide screen dimension by 2
shr wDim, 1 ; divide window dimension by 2
mov eax, wDim ; copy window dimension into eax
sub sDim, eax ; sub half win dimension from half screen dimension
return sDim
TopXY endp
; ########################################################################
end start
|
source/amf/uml/amf-internals-tables-standard_profile_l2_metamodel.adb | svn2github/matreshka | 24 | 20330 | <filename>source/amf/uml/amf-internals-tables-standard_profile_l2_metamodel.adb
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <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$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.Standard_Profile_L2_Metamodel is
------------------------------------------------
-- MM_Standard_Profile_L2_Standard_Profile_L2 --
------------------------------------------------
function MM_Standard_Profile_L2_Standard_Profile_L2 return AMF.Internals.CMOF_Element is
begin
return Base + 95;
end MM_Standard_Profile_L2_Standard_Profile_L2;
--------------------------------------
-- MC_Standard_Profile_L2_Auxiliary --
--------------------------------------
function MC_Standard_Profile_L2_Auxiliary return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_Standard_Profile_L2_Auxiliary;
---------------------------------
-- MC_Standard_Profile_L2_Call --
---------------------------------
function MC_Standard_Profile_L2_Call return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MC_Standard_Profile_L2_Call;
-----------------------------------
-- MC_Standard_Profile_L2_Create --
-----------------------------------
function MC_Standard_Profile_L2_Create return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MC_Standard_Profile_L2_Create;
-----------------------------------
-- MC_Standard_Profile_L2_Derive --
-----------------------------------
function MC_Standard_Profile_L2_Derive return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MC_Standard_Profile_L2_Derive;
------------------------------------
-- MC_Standard_Profile_L2_Destroy --
------------------------------------
function MC_Standard_Profile_L2_Destroy return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MC_Standard_Profile_L2_Destroy;
-------------------------------------
-- MC_Standard_Profile_L2_Document --
-------------------------------------
function MC_Standard_Profile_L2_Document return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MC_Standard_Profile_L2_Document;
-----------------------------------
-- MC_Standard_Profile_L2_Entity --
-----------------------------------
function MC_Standard_Profile_L2_Entity return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MC_Standard_Profile_L2_Entity;
---------------------------------------
-- MC_Standard_Profile_L2_Executable --
---------------------------------------
function MC_Standard_Profile_L2_Executable return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MC_Standard_Profile_L2_Executable;
---------------------------------
-- MC_Standard_Profile_L2_File --
---------------------------------
function MC_Standard_Profile_L2_File return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MC_Standard_Profile_L2_File;
----------------------------------
-- MC_Standard_Profile_L2_Focus --
----------------------------------
function MC_Standard_Profile_L2_Focus return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MC_Standard_Profile_L2_Focus;
--------------------------------------
-- MC_Standard_Profile_L2_Framework --
--------------------------------------
function MC_Standard_Profile_L2_Framework return AMF.Internals.CMOF_Element is
begin
return Base + 11;
end MC_Standard_Profile_L2_Framework;
--------------------------------------
-- MC_Standard_Profile_L2_Implement --
--------------------------------------
function MC_Standard_Profile_L2_Implement return AMF.Internals.CMOF_Element is
begin
return Base + 12;
end MC_Standard_Profile_L2_Implement;
-------------------------------------------------
-- MC_Standard_Profile_L2_Implementation_Class --
-------------------------------------------------
function MC_Standard_Profile_L2_Implementation_Class return AMF.Internals.CMOF_Element is
begin
return Base + 13;
end MC_Standard_Profile_L2_Implementation_Class;
----------------------------------------
-- MC_Standard_Profile_L2_Instantiate --
----------------------------------------
function MC_Standard_Profile_L2_Instantiate return AMF.Internals.CMOF_Element is
begin
return Base + 14;
end MC_Standard_Profile_L2_Instantiate;
------------------------------------
-- MC_Standard_Profile_L2_Library --
------------------------------------
function MC_Standard_Profile_L2_Library return AMF.Internals.CMOF_Element is
begin
return Base + 15;
end MC_Standard_Profile_L2_Library;
--------------------------------------
-- MC_Standard_Profile_L2_Metaclass --
--------------------------------------
function MC_Standard_Profile_L2_Metaclass return AMF.Internals.CMOF_Element is
begin
return Base + 16;
end MC_Standard_Profile_L2_Metaclass;
------------------------------------------
-- MC_Standard_Profile_L2_Model_Library --
------------------------------------------
function MC_Standard_Profile_L2_Model_Library return AMF.Internals.CMOF_Element is
begin
return Base + 17;
end MC_Standard_Profile_L2_Model_Library;
------------------------------------
-- MC_Standard_Profile_L2_Process --
------------------------------------
function MC_Standard_Profile_L2_Process return AMF.Internals.CMOF_Element is
begin
return Base + 18;
end MC_Standard_Profile_L2_Process;
----------------------------------------
-- MC_Standard_Profile_L2_Realization --
----------------------------------------
function MC_Standard_Profile_L2_Realization return AMF.Internals.CMOF_Element is
begin
return Base + 19;
end MC_Standard_Profile_L2_Realization;
-----------------------------------
-- MC_Standard_Profile_L2_Refine --
-----------------------------------
function MC_Standard_Profile_L2_Refine return AMF.Internals.CMOF_Element is
begin
return Base + 20;
end MC_Standard_Profile_L2_Refine;
-------------------------------------------
-- MC_Standard_Profile_L2_Responsibility --
-------------------------------------------
function MC_Standard_Profile_L2_Responsibility return AMF.Internals.CMOF_Element is
begin
return Base + 21;
end MC_Standard_Profile_L2_Responsibility;
-----------------------------------
-- MC_Standard_Profile_L2_Script --
-----------------------------------
function MC_Standard_Profile_L2_Script return AMF.Internals.CMOF_Element is
begin
return Base + 22;
end MC_Standard_Profile_L2_Script;
---------------------------------
-- MC_Standard_Profile_L2_Send --
---------------------------------
function MC_Standard_Profile_L2_Send return AMF.Internals.CMOF_Element is
begin
return Base + 23;
end MC_Standard_Profile_L2_Send;
------------------------------------
-- MC_Standard_Profile_L2_Service --
------------------------------------
function MC_Standard_Profile_L2_Service return AMF.Internals.CMOF_Element is
begin
return Base + 24;
end MC_Standard_Profile_L2_Service;
-----------------------------------
-- MC_Standard_Profile_L2_Source --
-----------------------------------
function MC_Standard_Profile_L2_Source return AMF.Internals.CMOF_Element is
begin
return Base + 25;
end MC_Standard_Profile_L2_Source;
------------------------------------------
-- MC_Standard_Profile_L2_Specification --
------------------------------------------
function MC_Standard_Profile_L2_Specification return AMF.Internals.CMOF_Element is
begin
return Base + 26;
end MC_Standard_Profile_L2_Specification;
--------------------------------------
-- MC_Standard_Profile_L2_Subsystem --
--------------------------------------
function MC_Standard_Profile_L2_Subsystem return AMF.Internals.CMOF_Element is
begin
return Base + 27;
end MC_Standard_Profile_L2_Subsystem;
----------------------------------
-- MC_Standard_Profile_L2_Trace --
----------------------------------
function MC_Standard_Profile_L2_Trace return AMF.Internals.CMOF_Element is
begin
return Base + 28;
end MC_Standard_Profile_L2_Trace;
---------------------------------
-- MC_Standard_Profile_L2_Type --
---------------------------------
function MC_Standard_Profile_L2_Type return AMF.Internals.CMOF_Element is
begin
return Base + 29;
end MC_Standard_Profile_L2_Type;
------------------------------------
-- MC_Standard_Profile_L2_Utility --
------------------------------------
function MC_Standard_Profile_L2_Utility return AMF.Internals.CMOF_Element is
begin
return Base + 30;
end MC_Standard_Profile_L2_Utility;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_Auxiliary_Base_Class_A_Extension_Auxiliary --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_Auxiliary_Base_Class_A_Extension_Auxiliary return AMF.Internals.CMOF_Element is
begin
return Base + 31;
end MP_Standard_Profile_L2_Auxiliary_Base_Class_A_Extension_Auxiliary;
-------------------------------------------------------------
-- MP_Standard_Profile_L2_Call_Base_Usage_A_Extension_Call --
-------------------------------------------------------------
function MP_Standard_Profile_L2_Call_Base_Usage_A_Extension_Call return AMF.Internals.CMOF_Element is
begin
return Base + 32;
end MP_Standard_Profile_L2_Call_Base_Usage_A_Extension_Call;
------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Create_Base_Behavioral_Feature_A_Extension_Create --
------------------------------------------------------------------------------
function MP_Standard_Profile_L2_Create_Base_Behavioral_Feature_A_Extension_Create return AMF.Internals.CMOF_Element is
begin
return Base + 33;
end MP_Standard_Profile_L2_Create_Base_Behavioral_Feature_A_Extension_Create;
-----------------------------------------------------------------
-- MP_Standard_Profile_L2_Create_Base_Usage_A_Extension_Create --
-----------------------------------------------------------------
function MP_Standard_Profile_L2_Create_Base_Usage_A_Extension_Create return AMF.Internals.CMOF_Element is
begin
return Base + 34;
end MP_Standard_Profile_L2_Create_Base_Usage_A_Extension_Create;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_Derive_Base_Abstraction_A_Extension_Derive --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_Derive_Base_Abstraction_A_Extension_Derive return AMF.Internals.CMOF_Element is
begin
return Base + 35;
end MP_Standard_Profile_L2_Derive_Base_Abstraction_A_Extension_Derive;
------------------------------------------------------------------
-- MP_Standard_Profile_L2_Derive_Computation_A_Extension_Derive --
------------------------------------------------------------------
function MP_Standard_Profile_L2_Derive_Computation_A_Extension_Derive return AMF.Internals.CMOF_Element is
begin
return Base + 36;
end MP_Standard_Profile_L2_Derive_Computation_A_Extension_Derive;
--------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Destroy_Base_Behavioral_Feature_A_Extension_Destroy --
--------------------------------------------------------------------------------
function MP_Standard_Profile_L2_Destroy_Base_Behavioral_Feature_A_Extension_Destroy return AMF.Internals.CMOF_Element is
begin
return Base + 37;
end MP_Standard_Profile_L2_Destroy_Base_Behavioral_Feature_A_Extension_Destroy;
------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Document_Base_Artifact_A_Extension_Document --
------------------------------------------------------------------------
function MP_Standard_Profile_L2_Document_Base_Artifact_A_Extension_Document return AMF.Internals.CMOF_Element is
begin
return Base + 38;
end MP_Standard_Profile_L2_Document_Base_Artifact_A_Extension_Document;
---------------------------------------------------------------------
-- MP_Standard_Profile_L2_Entity_Base_Component_A_Extension_Entity --
---------------------------------------------------------------------
function MP_Standard_Profile_L2_Entity_Base_Component_A_Extension_Entity return AMF.Internals.CMOF_Element is
begin
return Base + 39;
end MP_Standard_Profile_L2_Entity_Base_Component_A_Extension_Entity;
----------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Executable_Base_Artifact_A_Extension_Executable --
----------------------------------------------------------------------------
function MP_Standard_Profile_L2_Executable_Base_Artifact_A_Extension_Executable return AMF.Internals.CMOF_Element is
begin
return Base + 40;
end MP_Standard_Profile_L2_Executable_Base_Artifact_A_Extension_Executable;
----------------------------------------------------------------
-- MP_Standard_Profile_L2_File_Base_Artifact_A_Extension_File --
----------------------------------------------------------------
function MP_Standard_Profile_L2_File_Base_Artifact_A_Extension_File return AMF.Internals.CMOF_Element is
begin
return Base + 41;
end MP_Standard_Profile_L2_File_Base_Artifact_A_Extension_File;
---------------------------------------------------------------
-- MP_Standard_Profile_L2_Focus_Base_Class_A_Extension_Focus --
---------------------------------------------------------------
function MP_Standard_Profile_L2_Focus_Base_Class_A_Extension_Focus return AMF.Internals.CMOF_Element is
begin
return Base + 42;
end MP_Standard_Profile_L2_Focus_Base_Class_A_Extension_Focus;
-------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Framework_Base_Package_A_Extension_Framework --
-------------------------------------------------------------------------
function MP_Standard_Profile_L2_Framework_Base_Package_A_Extension_Framework return AMF.Internals.CMOF_Element is
begin
return Base + 43;
end MP_Standard_Profile_L2_Framework_Base_Package_A_Extension_Framework;
---------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Implement_Base_Component_A_Extension_Implement --
---------------------------------------------------------------------------
function MP_Standard_Profile_L2_Implement_Base_Component_A_Extension_Implement return AMF.Internals.CMOF_Element is
begin
return Base + 44;
end MP_Standard_Profile_L2_Implement_Base_Component_A_Extension_Implement;
---------------------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Implementation_Class_Base_Class_A_Extension_Implementation_Class --
---------------------------------------------------------------------------------------------
function MP_Standard_Profile_L2_Implementation_Class_Base_Class_A_Extension_Implementation_Class return AMF.Internals.CMOF_Element is
begin
return Base + 45;
end MP_Standard_Profile_L2_Implementation_Class_Base_Class_A_Extension_Implementation_Class;
---------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Instantiate_Base_Usage_A_Extension_Instantiate --
---------------------------------------------------------------------------
function MP_Standard_Profile_L2_Instantiate_Base_Usage_A_Extension_Instantiate return AMF.Internals.CMOF_Element is
begin
return Base + 46;
end MP_Standard_Profile_L2_Instantiate_Base_Usage_A_Extension_Instantiate;
----------------------------------------------------------------------
-- MP_Standard_Profile_L2_Library_Base_Artifact_A_Extension_Library --
----------------------------------------------------------------------
function MP_Standard_Profile_L2_Library_Base_Artifact_A_Extension_Library return AMF.Internals.CMOF_Element is
begin
return Base + 47;
end MP_Standard_Profile_L2_Library_Base_Artifact_A_Extension_Library;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_Metaclass_Base_Class_A_Extension_Metaclass --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_Metaclass_Base_Class_A_Extension_Metaclass return AMF.Internals.CMOF_Element is
begin
return Base + 48;
end MP_Standard_Profile_L2_Metaclass_Base_Class_A_Extension_Metaclass;
---------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Model_Library_Base_Package_A_Extension_Model_Library --
---------------------------------------------------------------------------------
function MP_Standard_Profile_L2_Model_Library_Base_Package_A_Extension_Model_Library return AMF.Internals.CMOF_Element is
begin
return Base + 49;
end MP_Standard_Profile_L2_Model_Library_Base_Package_A_Extension_Model_Library;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_Process_Base_Component_A_Extension_Process --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_Process_Base_Component_A_Extension_Process return AMF.Internals.CMOF_Element is
begin
return Base + 50;
end MP_Standard_Profile_L2_Process_Base_Component_A_Extension_Process;
--------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Realization_Base_Classifier_A_Extension_Realization --
--------------------------------------------------------------------------------
function MP_Standard_Profile_L2_Realization_Base_Classifier_A_Extension_Realization return AMF.Internals.CMOF_Element is
begin
return Base + 51;
end MP_Standard_Profile_L2_Realization_Base_Classifier_A_Extension_Realization;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_Refine_Base_Abstraction_A_Extension_Refine --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_Refine_Base_Abstraction_A_Extension_Refine return AMF.Internals.CMOF_Element is
begin
return Base + 52;
end MP_Standard_Profile_L2_Refine_Base_Abstraction_A_Extension_Refine;
---------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Responsibility_Base_Usage_A_Extension_Responsibility --
---------------------------------------------------------------------------------
function MP_Standard_Profile_L2_Responsibility_Base_Usage_A_Extension_Responsibility return AMF.Internals.CMOF_Element is
begin
return Base + 53;
end MP_Standard_Profile_L2_Responsibility_Base_Usage_A_Extension_Responsibility;
--------------------------------------------------------------------
-- MP_Standard_Profile_L2_Script_Base_Artifact_A_Extension_Script --
--------------------------------------------------------------------
function MP_Standard_Profile_L2_Script_Base_Artifact_A_Extension_Script return AMF.Internals.CMOF_Element is
begin
return Base + 54;
end MP_Standard_Profile_L2_Script_Base_Artifact_A_Extension_Script;
-------------------------------------------------------------
-- MP_Standard_Profile_L2_Send_Base_Usage_A_Extension_Send --
-------------------------------------------------------------
function MP_Standard_Profile_L2_Send_Base_Usage_A_Extension_Send return AMF.Internals.CMOF_Element is
begin
return Base + 55;
end MP_Standard_Profile_L2_Send_Base_Usage_A_Extension_Send;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_Service_Base_Component_A_Extension_Service --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_Service_Base_Component_A_Extension_Service return AMF.Internals.CMOF_Element is
begin
return Base + 56;
end MP_Standard_Profile_L2_Service_Base_Component_A_Extension_Service;
--------------------------------------------------------------------
-- MP_Standard_Profile_L2_Source_Base_Artifact_A_Extension_Source --
--------------------------------------------------------------------
function MP_Standard_Profile_L2_Source_Base_Artifact_A_Extension_Source return AMF.Internals.CMOF_Element is
begin
return Base + 57;
end MP_Standard_Profile_L2_Source_Base_Artifact_A_Extension_Source;
------------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Specification_Base_Classifier_A_Extension_Specification --
------------------------------------------------------------------------------------
function MP_Standard_Profile_L2_Specification_Base_Classifier_A_Extension_Specification return AMF.Internals.CMOF_Element is
begin
return Base + 58;
end MP_Standard_Profile_L2_Specification_Base_Classifier_A_Extension_Specification;
---------------------------------------------------------------------------
-- MP_Standard_Profile_L2_Subsystem_Base_Component_A_Extension_Subsystem --
---------------------------------------------------------------------------
function MP_Standard_Profile_L2_Subsystem_Base_Component_A_Extension_Subsystem return AMF.Internals.CMOF_Element is
begin
return Base + 59;
end MP_Standard_Profile_L2_Subsystem_Base_Component_A_Extension_Subsystem;
---------------------------------------------------------------------
-- MP_Standard_Profile_L2_Trace_Base_Abstraction_A_Extension_Trace --
---------------------------------------------------------------------
function MP_Standard_Profile_L2_Trace_Base_Abstraction_A_Extension_Trace return AMF.Internals.CMOF_Element is
begin
return Base + 60;
end MP_Standard_Profile_L2_Trace_Base_Abstraction_A_Extension_Trace;
-------------------------------------------------------------
-- MP_Standard_Profile_L2_Type_Base_Class_A_Extension_Type --
-------------------------------------------------------------
function MP_Standard_Profile_L2_Type_Base_Class_A_Extension_Type return AMF.Internals.CMOF_Element is
begin
return Base + 61;
end MP_Standard_Profile_L2_Type_Base_Class_A_Extension_Type;
-------------------------------------------------------------------
-- MP_Standard_Profile_L2_Utility_Base_Class_A_Extension_Utility --
-------------------------------------------------------------------
function MP_Standard_Profile_L2_Utility_Base_Class_A_Extension_Utility return AMF.Internals.CMOF_Element is
begin
return Base + 62;
end MP_Standard_Profile_L2_Utility_Base_Class_A_Extension_Utility;
---------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Focus_Focus_Base_Class --
---------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Focus_Focus_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 109;
end MP_Standard_Profile_L2_A_Extension_Focus_Focus_Base_Class;
---------------------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Implementation_Class_Implementation_Class_Base_Class --
---------------------------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Implementation_Class_Implementation_Class_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 110;
end MP_Standard_Profile_L2_A_Extension_Implementation_Class_Implementation_Class_Base_Class;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Metaclass_Metaclass_Base_Class --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Metaclass_Metaclass_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 111;
end MP_Standard_Profile_L2_A_Extension_Metaclass_Metaclass_Base_Class;
-------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Type_Type_Base_Class --
-------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Type_Type_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 112;
end MP_Standard_Profile_L2_A_Extension_Type_Type_Base_Class;
-------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Utility_Utility_Base_Class --
-------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Utility_Utility_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 113;
end MP_Standard_Profile_L2_A_Extension_Utility_Utility_Base_Class;
--------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Realization_Realization_Base_Classifier --
--------------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Realization_Realization_Base_Classifier return AMF.Internals.CMOF_Element is
begin
return Base + 114;
end MP_Standard_Profile_L2_A_Extension_Realization_Realization_Base_Classifier;
------------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Specification_Specification_Base_Classifier --
------------------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Specification_Specification_Base_Classifier return AMF.Internals.CMOF_Element is
begin
return Base + 115;
end MP_Standard_Profile_L2_A_Extension_Specification_Specification_Base_Classifier;
---------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Entity_Entity_Base_Component --
---------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Entity_Entity_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 116;
end MP_Standard_Profile_L2_A_Extension_Entity_Entity_Base_Component;
---------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Implement_Implement_Base_Component --
---------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Implement_Implement_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 117;
end MP_Standard_Profile_L2_A_Extension_Implement_Implement_Base_Component;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Process_Process_Base_Component --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Process_Process_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 118;
end MP_Standard_Profile_L2_A_Extension_Process_Process_Base_Component;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Service_Service_Base_Component --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Service_Service_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 119;
end MP_Standard_Profile_L2_A_Extension_Service_Service_Base_Component;
---------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Subsystem_Subsystem_Base_Component --
---------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Subsystem_Subsystem_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 120;
end MP_Standard_Profile_L2_A_Extension_Subsystem_Subsystem_Base_Component;
-------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Framework_Framework_Base_Package --
-------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Framework_Framework_Base_Package return AMF.Internals.CMOF_Element is
begin
return Base + 121;
end MP_Standard_Profile_L2_A_Extension_Framework_Framework_Base_Package;
---------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Model_Library_Model_Library_Base_Package --
---------------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Model_Library_Model_Library_Base_Package return AMF.Internals.CMOF_Element is
begin
return Base + 122;
end MP_Standard_Profile_L2_A_Extension_Model_Library_Model_Library_Base_Package;
-------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Call_Call_Base_Usage --
-------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Call_Call_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 123;
end MP_Standard_Profile_L2_A_Extension_Call_Call_Base_Usage;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Derive_Derive_Base_Abstraction --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Derive_Derive_Base_Abstraction return AMF.Internals.CMOF_Element is
begin
return Base + 97;
end MP_Standard_Profile_L2_A_Extension_Derive_Derive_Base_Abstraction;
-----------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Create_Create_Base_Usage --
-----------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Create_Create_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 124;
end MP_Standard_Profile_L2_A_Extension_Create_Create_Base_Usage;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Refine_Refine_Base_Abstraction --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Refine_Refine_Base_Abstraction return AMF.Internals.CMOF_Element is
begin
return Base + 98;
end MP_Standard_Profile_L2_A_Extension_Refine_Refine_Base_Abstraction;
------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Derive_Derive_Computation --
------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Derive_Derive_Computation return AMF.Internals.CMOF_Element is
begin
return Base + 125;
end MP_Standard_Profile_L2_A_Extension_Derive_Derive_Computation;
---------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Trace_Trace_Base_Abstraction --
---------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Trace_Trace_Base_Abstraction return AMF.Internals.CMOF_Element is
begin
return Base + 99;
end MP_Standard_Profile_L2_A_Extension_Trace_Trace_Base_Abstraction;
---------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Instantiate_Instantiate_Base_Usage --
---------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Instantiate_Instantiate_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 126;
end MP_Standard_Profile_L2_A_Extension_Instantiate_Instantiate_Base_Usage;
------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Document_Document_Base_Artifact --
------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Document_Document_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 100;
end MP_Standard_Profile_L2_A_Extension_Document_Document_Base_Artifact;
---------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Responsibility_Responsibility_Base_Usage --
---------------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Responsibility_Responsibility_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 127;
end MP_Standard_Profile_L2_A_Extension_Responsibility_Responsibility_Base_Usage;
----------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Executable_Executable_Base_Artifact --
----------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Executable_Executable_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 101;
end MP_Standard_Profile_L2_A_Extension_Executable_Executable_Base_Artifact;
-------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Send_Send_Base_Usage --
-------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Send_Send_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 128;
end MP_Standard_Profile_L2_A_Extension_Send_Send_Base_Usage;
----------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_File_File_Base_Artifact --
----------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_File_File_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 102;
end MP_Standard_Profile_L2_A_Extension_File_File_Base_Artifact;
----------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Library_Library_Base_Artifact --
----------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Library_Library_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 103;
end MP_Standard_Profile_L2_A_Extension_Library_Library_Base_Artifact;
--------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Script_Script_Base_Artifact --
--------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Script_Script_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 104;
end MP_Standard_Profile_L2_A_Extension_Script_Script_Base_Artifact;
--------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Source_Source_Base_Artifact --
--------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Source_Source_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 105;
end MP_Standard_Profile_L2_A_Extension_Source_Source_Base_Artifact;
------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Create_Create_Base_Behavioral_Feature --
------------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Create_Create_Base_Behavioral_Feature return AMF.Internals.CMOF_Element is
begin
return Base + 106;
end MP_Standard_Profile_L2_A_Extension_Create_Create_Base_Behavioral_Feature;
--------------------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Destroy_Destroy_Base_Behavioral_Feature --
--------------------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Destroy_Destroy_Base_Behavioral_Feature return AMF.Internals.CMOF_Element is
begin
return Base + 107;
end MP_Standard_Profile_L2_A_Extension_Destroy_Destroy_Base_Behavioral_Feature;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L2_A_Extension_Auxiliary_Auxiliary_Base_Class --
-----------------------------------------------------------------------
function MP_Standard_Profile_L2_A_Extension_Auxiliary_Auxiliary_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 108;
end MP_Standard_Profile_L2_A_Extension_Auxiliary_Auxiliary_Base_Class;
---------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Focus_Base_Class --
---------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Focus_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 63;
end MA_Standard_Profile_L2_A_Extension_Focus_Base_Class;
------------------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Implementation_Class_Base_Class --
------------------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Implementation_Class_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 64;
end MA_Standard_Profile_L2_A_Extension_Implementation_Class_Base_Class;
-------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Metaclass_Base_Class --
-------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Metaclass_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 65;
end MA_Standard_Profile_L2_A_Extension_Metaclass_Base_Class;
--------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Type_Base_Class --
--------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Type_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 66;
end MA_Standard_Profile_L2_A_Extension_Type_Base_Class;
-----------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Utility_Base_Class --
-----------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Utility_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 67;
end MA_Standard_Profile_L2_A_Extension_Utility_Base_Class;
--------------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Realization_Base_Classifier --
--------------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Realization_Base_Classifier return AMF.Internals.CMOF_Element is
begin
return Base + 68;
end MA_Standard_Profile_L2_A_Extension_Realization_Base_Classifier;
----------------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Specification_Base_Classifier --
----------------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Specification_Base_Classifier return AMF.Internals.CMOF_Element is
begin
return Base + 69;
end MA_Standard_Profile_L2_A_Extension_Specification_Base_Classifier;
--------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Entity_Base_Component --
--------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Entity_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 70;
end MA_Standard_Profile_L2_A_Extension_Entity_Base_Component;
-----------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Implement_Base_Component --
-----------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Implement_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 71;
end MA_Standard_Profile_L2_A_Extension_Implement_Base_Component;
---------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Process_Base_Component --
---------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Process_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 72;
end MA_Standard_Profile_L2_A_Extension_Process_Base_Component;
---------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Service_Base_Component --
---------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Service_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 73;
end MA_Standard_Profile_L2_A_Extension_Service_Base_Component;
-----------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Subsystem_Base_Component --
-----------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Subsystem_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 74;
end MA_Standard_Profile_L2_A_Extension_Subsystem_Base_Component;
---------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Framework_Base_Package --
---------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Framework_Base_Package return AMF.Internals.CMOF_Element is
begin
return Base + 75;
end MA_Standard_Profile_L2_A_Extension_Framework_Base_Package;
-------------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Model_Library_Base_Package --
-------------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Model_Library_Base_Package return AMF.Internals.CMOF_Element is
begin
return Base + 76;
end MA_Standard_Profile_L2_A_Extension_Model_Library_Base_Package;
--------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Call_Base_Usage --
--------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Call_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 77;
end MA_Standard_Profile_L2_A_Extension_Call_Base_Usage;
----------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Derive_Base_Abstraction --
----------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Derive_Base_Abstraction return AMF.Internals.CMOF_Element is
begin
return Base + 78;
end MA_Standard_Profile_L2_A_Extension_Derive_Base_Abstraction;
----------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Create_Base_Usage --
----------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Create_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 79;
end MA_Standard_Profile_L2_A_Extension_Create_Base_Usage;
----------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Refine_Base_Abstraction --
----------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Refine_Base_Abstraction return AMF.Internals.CMOF_Element is
begin
return Base + 80;
end MA_Standard_Profile_L2_A_Extension_Refine_Base_Abstraction;
-----------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Derive_Computation --
-----------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Derive_Computation return AMF.Internals.CMOF_Element is
begin
return Base + 81;
end MA_Standard_Profile_L2_A_Extension_Derive_Computation;
---------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Trace_Base_Abstraction --
---------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Trace_Base_Abstraction return AMF.Internals.CMOF_Element is
begin
return Base + 82;
end MA_Standard_Profile_L2_A_Extension_Trace_Base_Abstraction;
---------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Instantiate_Base_Usage --
---------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Instantiate_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 83;
end MA_Standard_Profile_L2_A_Extension_Instantiate_Base_Usage;
---------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Document_Base_Artifact --
---------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Document_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 84;
end MA_Standard_Profile_L2_A_Extension_Document_Base_Artifact;
------------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Responsibility_Base_Usage --
------------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Responsibility_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 85;
end MA_Standard_Profile_L2_A_Extension_Responsibility_Base_Usage;
-----------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Executable_Base_Artifact --
-----------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Executable_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 86;
end MA_Standard_Profile_L2_A_Extension_Executable_Base_Artifact;
--------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Send_Base_Usage --
--------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Send_Base_Usage return AMF.Internals.CMOF_Element is
begin
return Base + 87;
end MA_Standard_Profile_L2_A_Extension_Send_Base_Usage;
-----------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_File_Base_Artifact --
-----------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_File_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 88;
end MA_Standard_Profile_L2_A_Extension_File_Base_Artifact;
--------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Library_Base_Artifact --
--------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Library_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 89;
end MA_Standard_Profile_L2_A_Extension_Library_Base_Artifact;
-------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Script_Base_Artifact --
-------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Script_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 90;
end MA_Standard_Profile_L2_A_Extension_Script_Base_Artifact;
-------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Source_Base_Artifact --
-------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Source_Base_Artifact return AMF.Internals.CMOF_Element is
begin
return Base + 91;
end MA_Standard_Profile_L2_A_Extension_Source_Base_Artifact;
-----------------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Create_Base_Behavioral_Feature --
-----------------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Create_Base_Behavioral_Feature return AMF.Internals.CMOF_Element is
begin
return Base + 92;
end MA_Standard_Profile_L2_A_Extension_Create_Base_Behavioral_Feature;
------------------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Destroy_Base_Behavioral_Feature --
------------------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Destroy_Base_Behavioral_Feature return AMF.Internals.CMOF_Element is
begin
return Base + 93;
end MA_Standard_Profile_L2_A_Extension_Destroy_Base_Behavioral_Feature;
-------------------------------------------------------------
-- MA_Standard_Profile_L2_A_Extension_Auxiliary_Base_Class --
-------------------------------------------------------------
function MA_Standard_Profile_L2_A_Extension_Auxiliary_Base_Class return AMF.Internals.CMOF_Element is
begin
return Base + 94;
end MA_Standard_Profile_L2_A_Extension_Auxiliary_Base_Class;
----------------------------
-- MB_Standard_Profile_L2 --
----------------------------
function MB_Standard_Profile_L2 return AMF.Internals.AMF_Element is
begin
return Base;
end MB_Standard_Profile_L2;
----------------------------
-- MB_Standard_Profile_L2 --
----------------------------
function ML_Standard_Profile_L2 return AMF.Internals.AMF_Element is
begin
return Base + 180;
end ML_Standard_Profile_L2;
end AMF.Internals.Tables.Standard_Profile_L2_Metamodel;
|
src/main/fragment/mos6502-common/vdsm1=_sdword_vwsm2.asm | jbrandwood/kickc | 2 | 1476 | // sign-extend the byte
lda {m2}
sta {m1}
lda {m2}+1
sta {m1}+1
ora #$7f
bmi !+
lda #0
!:
sta {m1}+2
sta {m1}+3
|
.build/ada/asis-gela-elements-decl.ads | faelys/gela-asis | 4 | 22610 | <filename>.build/ada/asis-gela-elements-decl.ads
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, <NAME>
-- 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 Maxim Reznik, 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 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.
------------------------------------------------------------------------------
package Asis.Gela.Elements.Decl is
--------------------------------
-- Base_Type_Declaration_Node --
--------------------------------
type Base_Type_Declaration_Node is abstract
new Declaration_Node with private;
type Base_Type_Declaration_Ptr is
access all Base_Type_Declaration_Node;
for Base_Type_Declaration_Ptr'Storage_Pool use Lists.Pool;
function Discriminant_Part
(Element : Base_Type_Declaration_Node) return Asis.Definition;
procedure Set_Discriminant_Part
(Element : in out Base_Type_Declaration_Node;
Value : in Asis.Definition);
function Type_Declaration_View
(Element : Base_Type_Declaration_Node) return Asis.Definition;
procedure Set_Type_Declaration_View
(Element : in out Base_Type_Declaration_Node;
Value : in Asis.Definition);
function Children (Element : access Base_Type_Declaration_Node)
return Traverse_List;
------------------------------------
-- Ordinary_Type_Declaration_Node --
------------------------------------
type Ordinary_Type_Declaration_Node is
new Base_Type_Declaration_Node with private;
type Ordinary_Type_Declaration_Ptr is
access all Ordinary_Type_Declaration_Node;
for Ordinary_Type_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Ordinary_Type_Declaration_Node
(The_Context : ASIS.Context)
return Ordinary_Type_Declaration_Ptr;
function Corresponding_Type_Declaration
(Element : Ordinary_Type_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Type_Declaration
(Element : in out Ordinary_Type_Declaration_Node;
Value : in Asis.Declaration);
function Declaration_Kind (Element : Ordinary_Type_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Ordinary_Type_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Ordinary_Type_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------------
-- Protected_Type_Declaration_Node --
-------------------------------------
type Protected_Type_Declaration_Node is
new Ordinary_Type_Declaration_Node with private;
type Protected_Type_Declaration_Ptr is
access all Protected_Type_Declaration_Node;
for Protected_Type_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Protected_Type_Declaration_Node
(The_Context : ASIS.Context)
return Protected_Type_Declaration_Ptr;
function Is_Name_Repeated
(Element : Protected_Type_Declaration_Node) return Boolean;
procedure Set_Is_Name_Repeated
(Element : in out Protected_Type_Declaration_Node;
Value : in Boolean);
function Corresponding_Body
(Element : Protected_Type_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Body
(Element : in out Protected_Type_Declaration_Node;
Value : in Asis.Declaration);
function Progenitor_List
(Element : Protected_Type_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Progenitor_List
(Element : in out Protected_Type_Declaration_Node;
Value : in Asis.Element);
function Progenitor_List_List
(Element : Protected_Type_Declaration_Node) return Asis.Element;
function Declaration_Kind (Element : Protected_Type_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Protected_Type_Declaration_Node)
return Traverse_List;
function Clone
(Element : Protected_Type_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Protected_Type_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------
-- Task_Type_Declaration_Node --
--------------------------------
type Task_Type_Declaration_Node is
new Protected_Type_Declaration_Node with private;
type Task_Type_Declaration_Ptr is
access all Task_Type_Declaration_Node;
for Task_Type_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Task_Type_Declaration_Node
(The_Context : ASIS.Context)
return Task_Type_Declaration_Ptr;
function Declaration_Kind (Element : Task_Type_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Task_Type_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Task_Type_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-----------------------------------
-- Private_Type_Declaration_Node --
-----------------------------------
type Private_Type_Declaration_Node is
new Ordinary_Type_Declaration_Node with private;
type Private_Type_Declaration_Ptr is
access all Private_Type_Declaration_Node;
for Private_Type_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Private_Type_Declaration_Node
(The_Context : ASIS.Context)
return Private_Type_Declaration_Ptr;
function Trait_Kind
(Element : Private_Type_Declaration_Node) return Asis.Trait_Kinds;
procedure Set_Trait_Kind
(Element : in out Private_Type_Declaration_Node;
Value : in Asis.Trait_Kinds);
function Declaration_Kind (Element : Private_Type_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Private_Type_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Private_Type_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------------
-- Private_Extension_Declaration_Node --
----------------------------------------
type Private_Extension_Declaration_Node is
new Private_Type_Declaration_Node with private;
type Private_Extension_Declaration_Ptr is
access all Private_Extension_Declaration_Node;
for Private_Extension_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Private_Extension_Declaration_Node
(The_Context : ASIS.Context)
return Private_Extension_Declaration_Ptr;
function Progenitor_List
(Element : Private_Extension_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Progenitor_List
(Element : in out Private_Extension_Declaration_Node;
Value : in Asis.Element);
function Progenitor_List_List
(Element : Private_Extension_Declaration_Node) return Asis.Element;
function Declaration_Kind (Element : Private_Extension_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Private_Extension_Declaration_Node)
return Traverse_List;
function Clone
(Element : Private_Extension_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Private_Extension_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------
-- Formal_Type_Declaration_Node --
----------------------------------
type Formal_Type_Declaration_Node is
new Base_Type_Declaration_Node with private;
type Formal_Type_Declaration_Ptr is
access all Formal_Type_Declaration_Node;
for Formal_Type_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Formal_Type_Declaration_Node
(The_Context : ASIS.Context)
return Formal_Type_Declaration_Ptr;
function Generic_Actual
(Element : Formal_Type_Declaration_Node) return Asis.Expression;
procedure Set_Generic_Actual
(Element : in out Formal_Type_Declaration_Node;
Value : in Asis.Expression);
function Declaration_Kind (Element : Formal_Type_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Formal_Type_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Formal_Type_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------------
-- Base_Callable_Declaration_Node --
------------------------------------
type Base_Callable_Declaration_Node is abstract
new Declaration_Node with private;
type Base_Callable_Declaration_Ptr is
access all Base_Callable_Declaration_Node;
for Base_Callable_Declaration_Ptr'Storage_Pool use Lists.Pool;
function Parameter_Profile
(Element : Base_Callable_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Parameter_Profile
(Element : in out Base_Callable_Declaration_Node;
Value : in Asis.Element);
function Parameter_Profile_List
(Element : Base_Callable_Declaration_Node) return Asis.Element;
function Corresponding_Body
(Element : Base_Callable_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Body
(Element : in out Base_Callable_Declaration_Node;
Value : in Asis.Declaration);
function Specification
(Element : Base_Callable_Declaration_Node) return Asis.Element;
procedure Set_Specification
(Element : in out Base_Callable_Declaration_Node;
Value : in Asis.Element);
function Children (Element : access Base_Callable_Declaration_Node)
return Traverse_List;
--------------------------------
-- Procedure_Declaration_Node --
--------------------------------
type Procedure_Declaration_Node is
new Base_Callable_Declaration_Node with private;
type Procedure_Declaration_Ptr is
access all Procedure_Declaration_Node;
for Procedure_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Procedure_Declaration_Node
(The_Context : ASIS.Context)
return Procedure_Declaration_Ptr;
function Corresponding_Subprogram_Derivation
(Element : Procedure_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Subprogram_Derivation
(Element : in out Procedure_Declaration_Node;
Value : in Asis.Declaration);
function Corresponding_Type
(Element : Procedure_Declaration_Node) return Asis.Type_Definition;
procedure Set_Corresponding_Type
(Element : in out Procedure_Declaration_Node;
Value : in Asis.Type_Definition);
function Is_Dispatching_Operation
(Element : Procedure_Declaration_Node) return Boolean;
procedure Set_Is_Dispatching_Operation
(Element : in out Procedure_Declaration_Node;
Value : in Boolean);
function Trait_Kind
(Element : Procedure_Declaration_Node) return Asis.Trait_Kinds;
procedure Set_Trait_Kind
(Element : in out Procedure_Declaration_Node;
Value : in Asis.Trait_Kinds);
function Overriding_Indicator_Kind
(Element : Procedure_Declaration_Node) return Asis.Overriding_Indicator_Kinds;
procedure Set_Overriding_Indicator_Kind
(Element : in out Procedure_Declaration_Node;
Value : in Asis.Overriding_Indicator_Kinds);
function Has_Abstract
(Element : Procedure_Declaration_Node) return Boolean;
procedure Set_Has_Abstract
(Element : in out Procedure_Declaration_Node;
Value : in Boolean);
function Is_Null_Procedure
(Element : Procedure_Declaration_Node) return Boolean;
procedure Set_Is_Null_Procedure
(Element : in out Procedure_Declaration_Node;
Value : in Boolean);
function Generic_Formal_Part
(Element : Procedure_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Generic_Formal_Part
(Element : in out Procedure_Declaration_Node;
Value : in Asis.Element);
function Generic_Formal_Part_List
(Element : Procedure_Declaration_Node) return Asis.Element;
function Declaration_Kind (Element : Procedure_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Procedure_Declaration_Node)
return Traverse_List;
function Clone
(Element : Procedure_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Procedure_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------
-- Function_Declaration_Node --
-------------------------------
type Function_Declaration_Node is
new Procedure_Declaration_Node with private;
type Function_Declaration_Ptr is
access all Function_Declaration_Node;
for Function_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Function_Declaration_Node
(The_Context : ASIS.Context)
return Function_Declaration_Ptr;
function Result_Subtype
(Element : Function_Declaration_Node) return Asis.Definition;
procedure Set_Result_Subtype
(Element : in out Function_Declaration_Node;
Value : in Asis.Definition);
function Corresponding_Equality_Operator
(Element : Function_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Equality_Operator
(Element : in out Function_Declaration_Node;
Value : in Asis.Declaration);
function Declaration_Kind (Element : Function_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Function_Declaration_Node)
return Traverse_List;
function Clone
(Element : Function_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Function_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-----------------------------------------
-- Procedure_Renaming_Declaration_Node --
-----------------------------------------
type Procedure_Renaming_Declaration_Node is
new Base_Callable_Declaration_Node with private;
type Procedure_Renaming_Declaration_Ptr is
access all Procedure_Renaming_Declaration_Node;
for Procedure_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Procedure_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Procedure_Renaming_Declaration_Ptr;
function Is_Dispatching_Operation
(Element : Procedure_Renaming_Declaration_Node) return Boolean;
procedure Set_Is_Dispatching_Operation
(Element : in out Procedure_Renaming_Declaration_Node;
Value : in Boolean);
function Renamed_Entity
(Element : Procedure_Renaming_Declaration_Node) return Asis.Expression;
procedure Set_Renamed_Entity
(Element : in out Procedure_Renaming_Declaration_Node;
Value : in Asis.Expression);
function Corresponding_Base_Entity
(Element : Procedure_Renaming_Declaration_Node) return Asis.Expression;
procedure Set_Corresponding_Base_Entity
(Element : in out Procedure_Renaming_Declaration_Node;
Value : in Asis.Expression);
function Corresponding_Declaration
(Element : Procedure_Renaming_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Declaration
(Element : in out Procedure_Renaming_Declaration_Node;
Value : in Asis.Declaration);
function Overriding_Indicator_Kind
(Element : Procedure_Renaming_Declaration_Node) return Asis.Overriding_Indicator_Kinds;
procedure Set_Overriding_Indicator_Kind
(Element : in out Procedure_Renaming_Declaration_Node;
Value : in Asis.Overriding_Indicator_Kinds);
function Declaration_Kind (Element : Procedure_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Procedure_Renaming_Declaration_Node)
return Traverse_List;
function Clone
(Element : Procedure_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Procedure_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------------
-- Function_Renaming_Declaration_Node --
----------------------------------------
type Function_Renaming_Declaration_Node is
new Procedure_Renaming_Declaration_Node with private;
type Function_Renaming_Declaration_Ptr is
access all Function_Renaming_Declaration_Node;
for Function_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Function_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Function_Renaming_Declaration_Ptr;
function Result_Subtype
(Element : Function_Renaming_Declaration_Node) return Asis.Definition;
procedure Set_Result_Subtype
(Element : in out Function_Renaming_Declaration_Node;
Value : in Asis.Definition);
function Corresponding_Equality_Operator
(Element : Function_Renaming_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Equality_Operator
(Element : in out Function_Renaming_Declaration_Node;
Value : in Asis.Declaration);
function Declaration_Kind (Element : Function_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Function_Renaming_Declaration_Node)
return Traverse_List;
function Clone
(Element : Function_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Function_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------
-- Entry_Declaration_Node --
----------------------------
type Entry_Declaration_Node is
new Base_Callable_Declaration_Node with private;
type Entry_Declaration_Ptr is
access all Entry_Declaration_Node;
for Entry_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Entry_Declaration_Node
(The_Context : ASIS.Context)
return Entry_Declaration_Ptr;
function Entry_Family_Definition
(Element : Entry_Declaration_Node) return Asis.Discrete_Subtype_Definition;
procedure Set_Entry_Family_Definition
(Element : in out Entry_Declaration_Node;
Value : in Asis.Discrete_Subtype_Definition);
function Overriding_Indicator_Kind
(Element : Entry_Declaration_Node) return Asis.Overriding_Indicator_Kinds;
procedure Set_Overriding_Indicator_Kind
(Element : in out Entry_Declaration_Node;
Value : in Asis.Overriding_Indicator_Kinds);
function Declaration_Kind (Element : Entry_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Entry_Declaration_Node)
return Traverse_List;
function Clone
(Element : Entry_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Entry_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------
-- Procedure_Body_Stub_Node --
------------------------------
type Procedure_Body_Stub_Node is
new Base_Callable_Declaration_Node with private;
type Procedure_Body_Stub_Ptr is
access all Procedure_Body_Stub_Node;
for Procedure_Body_Stub_Ptr'Storage_Pool use Lists.Pool;
function New_Procedure_Body_Stub_Node
(The_Context : ASIS.Context)
return Procedure_Body_Stub_Ptr;
function Corresponding_Subunit
(Element : Procedure_Body_Stub_Node) return Asis.Declaration;
procedure Set_Corresponding_Subunit
(Element : in out Procedure_Body_Stub_Node;
Value : in Asis.Declaration);
function Corresponding_Declaration
(Element : Procedure_Body_Stub_Node) return Asis.Declaration;
procedure Set_Corresponding_Declaration
(Element : in out Procedure_Body_Stub_Node;
Value : in Asis.Declaration);
function Overriding_Indicator_Kind
(Element : Procedure_Body_Stub_Node) return Asis.Overriding_Indicator_Kinds;
procedure Set_Overriding_Indicator_Kind
(Element : in out Procedure_Body_Stub_Node;
Value : in Asis.Overriding_Indicator_Kinds);
function Declaration_Kind (Element : Procedure_Body_Stub_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Procedure_Body_Stub_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Procedure_Body_Stub_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-----------------------------
-- Function_Body_Stub_Node --
-----------------------------
type Function_Body_Stub_Node is
new Procedure_Body_Stub_Node with private;
type Function_Body_Stub_Ptr is
access all Function_Body_Stub_Node;
for Function_Body_Stub_Ptr'Storage_Pool use Lists.Pool;
function New_Function_Body_Stub_Node
(The_Context : ASIS.Context)
return Function_Body_Stub_Ptr;
function Result_Subtype
(Element : Function_Body_Stub_Node) return Asis.Definition;
procedure Set_Result_Subtype
(Element : in out Function_Body_Stub_Node;
Value : in Asis.Definition);
function Declaration_Kind (Element : Function_Body_Stub_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Function_Body_Stub_Node)
return Traverse_List;
function Clone
(Element : Function_Body_Stub_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Function_Body_Stub_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------------
-- Generic_Procedure_Declaration_Node --
----------------------------------------
type Generic_Procedure_Declaration_Node is
new Base_Callable_Declaration_Node with private;
type Generic_Procedure_Declaration_Ptr is
access all Generic_Procedure_Declaration_Node;
for Generic_Procedure_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Generic_Procedure_Declaration_Node
(The_Context : ASIS.Context)
return Generic_Procedure_Declaration_Ptr;
function Generic_Formal_Part
(Element : Generic_Procedure_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Generic_Formal_Part
(Element : in out Generic_Procedure_Declaration_Node;
Value : in Asis.Element);
function Generic_Formal_Part_List
(Element : Generic_Procedure_Declaration_Node) return Asis.Element;
function Declaration_Kind (Element : Generic_Procedure_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Generic_Procedure_Declaration_Node)
return Traverse_List;
function Clone
(Element : Generic_Procedure_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Generic_Procedure_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
---------------------------------------
-- Generic_Function_Declaration_Node --
---------------------------------------
type Generic_Function_Declaration_Node is
new Generic_Procedure_Declaration_Node with private;
type Generic_Function_Declaration_Ptr is
access all Generic_Function_Declaration_Node;
for Generic_Function_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Generic_Function_Declaration_Node
(The_Context : ASIS.Context)
return Generic_Function_Declaration_Ptr;
function Result_Subtype
(Element : Generic_Function_Declaration_Node) return Asis.Definition;
procedure Set_Result_Subtype
(Element : in out Generic_Function_Declaration_Node;
Value : in Asis.Definition);
function Declaration_Kind (Element : Generic_Function_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Generic_Function_Declaration_Node)
return Traverse_List;
function Clone
(Element : Generic_Function_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Generic_Function_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------
-- Base_Body_Declaration_Node --
--------------------------------
type Base_Body_Declaration_Node is abstract
new Declaration_Node with private;
type Base_Body_Declaration_Ptr is
access all Base_Body_Declaration_Node;
for Base_Body_Declaration_Ptr'Storage_Pool use Lists.Pool;
function Body_Declarative_Items
(Element : Base_Body_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Body_Declarative_Items
(Element : in out Base_Body_Declaration_Node;
Value : in Asis.Element);
function Body_Declarative_Items_List
(Element : Base_Body_Declaration_Node) return Asis.Element;
function Body_Statements
(Element : Base_Body_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Body_Statements
(Element : in out Base_Body_Declaration_Node;
Value : in Asis.Element);
function Body_Statements_List
(Element : Base_Body_Declaration_Node) return Asis.Element;
function Body_Exception_Handlers
(Element : Base_Body_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Body_Exception_Handlers
(Element : in out Base_Body_Declaration_Node;
Value : in Asis.Element);
function Body_Exception_Handlers_List
(Element : Base_Body_Declaration_Node) return Asis.Element;
function Corresponding_Declaration
(Element : Base_Body_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Declaration
(Element : in out Base_Body_Declaration_Node;
Value : in Asis.Declaration);
function Corresponding_Body_Stub
(Element : Base_Body_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Body_Stub
(Element : in out Base_Body_Declaration_Node;
Value : in Asis.Declaration);
function Is_Name_Repeated
(Element : Base_Body_Declaration_Node) return Boolean;
procedure Set_Is_Name_Repeated
(Element : in out Base_Body_Declaration_Node;
Value : in Boolean);
function Handled_Statements
(Element : Base_Body_Declaration_Node) return Asis.Element;
procedure Set_Handled_Statements
(Element : in out Base_Body_Declaration_Node;
Value : in Asis.Element);
function Compound_Name
(Element : Base_Body_Declaration_Node) return Asis.Element;
procedure Set_Compound_Name
(Element : in out Base_Body_Declaration_Node;
Value : in Asis.Element);
function Children (Element : access Base_Body_Declaration_Node)
return Traverse_List;
-------------------------------------
-- Procedure_Body_Declaration_Node --
-------------------------------------
type Procedure_Body_Declaration_Node is
new Base_Body_Declaration_Node with private;
type Procedure_Body_Declaration_Ptr is
access all Procedure_Body_Declaration_Node;
for Procedure_Body_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Procedure_Body_Declaration_Node
(The_Context : ASIS.Context)
return Procedure_Body_Declaration_Ptr;
function Parameter_Profile
(Element : Procedure_Body_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Parameter_Profile
(Element : in out Procedure_Body_Declaration_Node;
Value : in Asis.Element);
function Parameter_Profile_List
(Element : Procedure_Body_Declaration_Node) return Asis.Element;
function Specification
(Element : Procedure_Body_Declaration_Node) return Asis.Element;
procedure Set_Specification
(Element : in out Procedure_Body_Declaration_Node;
Value : in Asis.Element);
function Overriding_Indicator_Kind
(Element : Procedure_Body_Declaration_Node) return Asis.Overriding_Indicator_Kinds;
procedure Set_Overriding_Indicator_Kind
(Element : in out Procedure_Body_Declaration_Node;
Value : in Asis.Overriding_Indicator_Kinds);
function Declaration_Kind (Element : Procedure_Body_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Procedure_Body_Declaration_Node)
return Traverse_List;
function Clone
(Element : Procedure_Body_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Procedure_Body_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------------
-- Function_Body_Declaration_Node --
------------------------------------
type Function_Body_Declaration_Node is
new Procedure_Body_Declaration_Node with private;
type Function_Body_Declaration_Ptr is
access all Function_Body_Declaration_Node;
for Function_Body_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Function_Body_Declaration_Node
(The_Context : ASIS.Context)
return Function_Body_Declaration_Ptr;
function Result_Subtype
(Element : Function_Body_Declaration_Node) return Asis.Definition;
procedure Set_Result_Subtype
(Element : in out Function_Body_Declaration_Node;
Value : in Asis.Definition);
function Declaration_Kind (Element : Function_Body_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Function_Body_Declaration_Node)
return Traverse_List;
function Clone
(Element : Function_Body_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Function_Body_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-----------------------------------
-- Package_Body_Declaration_Node --
-----------------------------------
type Package_Body_Declaration_Node is
new Base_Body_Declaration_Node with private;
type Package_Body_Declaration_Ptr is
access all Package_Body_Declaration_Node;
for Package_Body_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Package_Body_Declaration_Node
(The_Context : ASIS.Context)
return Package_Body_Declaration_Ptr;
function Declaration_Kind (Element : Package_Body_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Package_Body_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Package_Body_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------
-- Task_Body_Declaration_Node --
--------------------------------
type Task_Body_Declaration_Node is
new Package_Body_Declaration_Node with private;
type Task_Body_Declaration_Ptr is
access all Task_Body_Declaration_Node;
for Task_Body_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Task_Body_Declaration_Node
(The_Context : ASIS.Context)
return Task_Body_Declaration_Ptr;
function Declaration_Kind (Element : Task_Body_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Task_Body_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Task_Body_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
---------------------------------
-- Entry_Body_Declaration_Node --
---------------------------------
type Entry_Body_Declaration_Node is
new Base_Body_Declaration_Node with private;
type Entry_Body_Declaration_Ptr is
access all Entry_Body_Declaration_Node;
for Entry_Body_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Entry_Body_Declaration_Node
(The_Context : ASIS.Context)
return Entry_Body_Declaration_Ptr;
function Parameter_Profile
(Element : Entry_Body_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Parameter_Profile
(Element : in out Entry_Body_Declaration_Node;
Value : in Asis.Element);
function Parameter_Profile_List
(Element : Entry_Body_Declaration_Node) return Asis.Element;
function Entry_Index_Specification
(Element : Entry_Body_Declaration_Node) return Asis.Declaration;
procedure Set_Entry_Index_Specification
(Element : in out Entry_Body_Declaration_Node;
Value : in Asis.Declaration);
function Entry_Barrier
(Element : Entry_Body_Declaration_Node) return Asis.Expression;
procedure Set_Entry_Barrier
(Element : in out Entry_Body_Declaration_Node;
Value : in Asis.Expression);
function Specification
(Element : Entry_Body_Declaration_Node) return Asis.Element;
procedure Set_Specification
(Element : in out Entry_Body_Declaration_Node;
Value : in Asis.Element);
function Declaration_Kind (Element : Entry_Body_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Entry_Body_Declaration_Node)
return Traverse_List;
function Clone
(Element : Entry_Body_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Entry_Body_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------------
-- Base_Renaming_Declaration_Node --
------------------------------------
type Base_Renaming_Declaration_Node is abstract
new Declaration_Node with private;
type Base_Renaming_Declaration_Ptr is
access all Base_Renaming_Declaration_Node;
for Base_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function Renamed_Entity
(Element : Base_Renaming_Declaration_Node) return Asis.Expression;
procedure Set_Renamed_Entity
(Element : in out Base_Renaming_Declaration_Node;
Value : in Asis.Expression);
function Corresponding_Base_Entity
(Element : Base_Renaming_Declaration_Node) return Asis.Expression;
procedure Set_Corresponding_Base_Entity
(Element : in out Base_Renaming_Declaration_Node;
Value : in Asis.Expression);
function Children (Element : access Base_Renaming_Declaration_Node)
return Traverse_List;
--------------------------------------
-- Object_Renaming_Declaration_Node --
--------------------------------------
type Object_Renaming_Declaration_Node is
new Base_Renaming_Declaration_Node with private;
type Object_Renaming_Declaration_Ptr is
access all Object_Renaming_Declaration_Node;
for Object_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Object_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Object_Renaming_Declaration_Ptr;
function Object_Declaration_Subtype
(Element : Object_Renaming_Declaration_Node) return Asis.Definition;
procedure Set_Object_Declaration_Subtype
(Element : in out Object_Renaming_Declaration_Node;
Value : in Asis.Definition);
function Has_Null_Exclusion
(Element : Object_Renaming_Declaration_Node) return Boolean;
procedure Set_Has_Null_Exclusion
(Element : in out Object_Renaming_Declaration_Node;
Value : in Boolean);
function Declaration_Kind (Element : Object_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Object_Renaming_Declaration_Node)
return Traverse_List;
function Clone
(Element : Object_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Object_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-----------------------------------------
-- Exception_Renaming_Declaration_Node --
-----------------------------------------
type Exception_Renaming_Declaration_Node is
new Base_Renaming_Declaration_Node with private;
type Exception_Renaming_Declaration_Ptr is
access all Exception_Renaming_Declaration_Node;
for Exception_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Exception_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Exception_Renaming_Declaration_Ptr;
function Declaration_Kind (Element : Exception_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Exception_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Exception_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
---------------------------------------
-- Package_Renaming_Declaration_Node --
---------------------------------------
type Package_Renaming_Declaration_Node is
new Base_Renaming_Declaration_Node with private;
type Package_Renaming_Declaration_Ptr is
access all Package_Renaming_Declaration_Node;
for Package_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Package_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Package_Renaming_Declaration_Ptr;
function Declaration_Kind (Element : Package_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Package_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Package_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-----------------------------------------------
-- Generic_Package_Renaming_Declaration_Node --
-----------------------------------------------
type Generic_Package_Renaming_Declaration_Node is
new Package_Renaming_Declaration_Node with private;
type Generic_Package_Renaming_Declaration_Ptr is
access all Generic_Package_Renaming_Declaration_Node;
for Generic_Package_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Generic_Package_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Generic_Package_Renaming_Declaration_Ptr;
function Empty_Generic_Part
(Element : Generic_Package_Renaming_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Empty_Generic_Part
(Element : in out Generic_Package_Renaming_Declaration_Node;
Value : in Asis.Element);
function Empty_Generic_Part_List
(Element : Generic_Package_Renaming_Declaration_Node) return Asis.Element;
function Declaration_Kind (Element : Generic_Package_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Generic_Package_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Generic_Package_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------------------------
-- Generic_Procedure_Renaming_Declaration_Node --
-------------------------------------------------
type Generic_Procedure_Renaming_Declaration_Node is
new Generic_Package_Renaming_Declaration_Node with private;
type Generic_Procedure_Renaming_Declaration_Ptr is
access all Generic_Procedure_Renaming_Declaration_Node;
for Generic_Procedure_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Generic_Procedure_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Generic_Procedure_Renaming_Declaration_Ptr;
function Specification
(Element : Generic_Procedure_Renaming_Declaration_Node) return Asis.Element;
procedure Set_Specification
(Element : in out Generic_Procedure_Renaming_Declaration_Node;
Value : in Asis.Element);
function Declaration_Kind (Element : Generic_Procedure_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Generic_Procedure_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Generic_Procedure_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------------------------
-- Generic_Function_Renaming_Declaration_Node --
------------------------------------------------
type Generic_Function_Renaming_Declaration_Node is
new Generic_Procedure_Renaming_Declaration_Node with private;
type Generic_Function_Renaming_Declaration_Ptr is
access all Generic_Function_Renaming_Declaration_Node;
for Generic_Function_Renaming_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Generic_Function_Renaming_Declaration_Node
(The_Context : ASIS.Context)
return Generic_Function_Renaming_Declaration_Ptr;
function Declaration_Kind (Element : Generic_Function_Renaming_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Generic_Function_Renaming_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Generic_Function_Renaming_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------------
-- Incomplete_Type_Declaration_Node --
--------------------------------------
type Incomplete_Type_Declaration_Node is
new Declaration_Node with private;
type Incomplete_Type_Declaration_Ptr is
access all Incomplete_Type_Declaration_Node;
for Incomplete_Type_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Incomplete_Type_Declaration_Node
(The_Context : ASIS.Context)
return Incomplete_Type_Declaration_Ptr;
function Discriminant_Part
(Element : Incomplete_Type_Declaration_Node) return Asis.Definition;
procedure Set_Discriminant_Part
(Element : in out Incomplete_Type_Declaration_Node;
Value : in Asis.Definition);
function Corresponding_Type_Declaration
(Element : Incomplete_Type_Declaration_Node) return Asis.Definition;
procedure Set_Corresponding_Type_Declaration
(Element : in out Incomplete_Type_Declaration_Node;
Value : in Asis.Definition);
function Type_Declaration_View
(Element : Incomplete_Type_Declaration_Node) return Asis.Definition;
procedure Set_Type_Declaration_View
(Element : in out Incomplete_Type_Declaration_Node;
Value : in Asis.Definition);
function Declaration_Kind (Element : Incomplete_Type_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Incomplete_Type_Declaration_Node)
return Traverse_List;
function Clone
(Element : Incomplete_Type_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Incomplete_Type_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------
-- Subtype_Declaration_Node --
------------------------------
type Subtype_Declaration_Node is
new Declaration_Node with private;
type Subtype_Declaration_Ptr is
access all Subtype_Declaration_Node;
for Subtype_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Subtype_Declaration_Node
(The_Context : ASIS.Context)
return Subtype_Declaration_Ptr;
function Type_Declaration_View
(Element : Subtype_Declaration_Node) return Asis.Definition;
procedure Set_Type_Declaration_View
(Element : in out Subtype_Declaration_Node;
Value : in Asis.Definition);
function Corresponding_First_Subtype
(Element : Subtype_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_First_Subtype
(Element : in out Subtype_Declaration_Node;
Value : in Asis.Declaration);
function Corresponding_Last_Constraint
(Element : Subtype_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Last_Constraint
(Element : in out Subtype_Declaration_Node;
Value : in Asis.Declaration);
function Corresponding_Last_Subtype
(Element : Subtype_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Last_Subtype
(Element : in out Subtype_Declaration_Node;
Value : in Asis.Declaration);
function Declaration_Kind (Element : Subtype_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Subtype_Declaration_Node)
return Traverse_List;
function Clone
(Element : Subtype_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Subtype_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------
-- Component_Declaration_Node --
--------------------------------
type Component_Declaration_Node is
new Declaration_Node with private;
type Component_Declaration_Ptr is
access all Component_Declaration_Node;
for Component_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Component_Declaration_Node
(The_Context : ASIS.Context)
return Component_Declaration_Ptr;
function Object_Declaration_Subtype
(Element : Component_Declaration_Node) return Asis.Definition;
procedure Set_Object_Declaration_Subtype
(Element : in out Component_Declaration_Node;
Value : in Asis.Definition);
function Initialization_Expression
(Element : Component_Declaration_Node) return Asis.Expression;
procedure Set_Initialization_Expression
(Element : in out Component_Declaration_Node;
Value : in Asis.Expression);
function Declaration_Kind (Element : Component_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Component_Declaration_Node)
return Traverse_List;
function Clone
(Element : Component_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Component_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------
-- Variable_Declaration_Node --
-------------------------------
type Variable_Declaration_Node is
new Component_Declaration_Node with private;
type Variable_Declaration_Ptr is
access all Variable_Declaration_Node;
for Variable_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Variable_Declaration_Node
(The_Context : ASIS.Context)
return Variable_Declaration_Ptr;
function Trait_Kind
(Element : Variable_Declaration_Node) return Asis.Trait_Kinds;
procedure Set_Trait_Kind
(Element : in out Variable_Declaration_Node;
Value : in Asis.Trait_Kinds);
function Declaration_Kind (Element : Variable_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Variable_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Variable_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------
-- Constant_Declaration_Node --
-------------------------------
type Constant_Declaration_Node is
new Variable_Declaration_Node with private;
type Constant_Declaration_Ptr is
access all Constant_Declaration_Node;
for Constant_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Constant_Declaration_Node
(The_Context : ASIS.Context)
return Constant_Declaration_Ptr;
function Declaration_Kind (Element : Constant_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Constant_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Constant_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------------
-- Return_Object_Specification_Node --
--------------------------------------
type Return_Object_Specification_Node is
new Variable_Declaration_Node with private;
type Return_Object_Specification_Ptr is
access all Return_Object_Specification_Node;
for Return_Object_Specification_Ptr'Storage_Pool use Lists.Pool;
function New_Return_Object_Specification_Node
(The_Context : ASIS.Context)
return Return_Object_Specification_Ptr;
function Declaration_Kind (Element : Return_Object_Specification_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Return_Object_Specification_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Return_Object_Specification_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------------
-- Deferred_Constant_Declaration_Node --
----------------------------------------
type Deferred_Constant_Declaration_Node is
new Declaration_Node with private;
type Deferred_Constant_Declaration_Ptr is
access all Deferred_Constant_Declaration_Node;
for Deferred_Constant_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Deferred_Constant_Declaration_Node
(The_Context : ASIS.Context)
return Deferred_Constant_Declaration_Ptr;
function Object_Declaration_Subtype
(Element : Deferred_Constant_Declaration_Node) return Asis.Definition;
procedure Set_Object_Declaration_Subtype
(Element : in out Deferred_Constant_Declaration_Node;
Value : in Asis.Definition);
function Trait_Kind
(Element : Deferred_Constant_Declaration_Node) return Asis.Trait_Kinds;
procedure Set_Trait_Kind
(Element : in out Deferred_Constant_Declaration_Node;
Value : in Asis.Trait_Kinds);
function Declaration_Kind (Element : Deferred_Constant_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Deferred_Constant_Declaration_Node)
return Traverse_List;
function Clone
(Element : Deferred_Constant_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Deferred_Constant_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
---------------------------------------
-- Single_Protected_Declaration_Node --
---------------------------------------
type Single_Protected_Declaration_Node is
new Declaration_Node with private;
type Single_Protected_Declaration_Ptr is
access all Single_Protected_Declaration_Node;
for Single_Protected_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Single_Protected_Declaration_Node
(The_Context : ASIS.Context)
return Single_Protected_Declaration_Ptr;
function Progenitor_List
(Element : Single_Protected_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Progenitor_List
(Element : in out Single_Protected_Declaration_Node;
Value : in Asis.Element);
function Progenitor_List_List
(Element : Single_Protected_Declaration_Node) return Asis.Element;
function Object_Declaration_Subtype
(Element : Single_Protected_Declaration_Node) return Asis.Definition;
procedure Set_Object_Declaration_Subtype
(Element : in out Single_Protected_Declaration_Node;
Value : in Asis.Definition);
function Is_Name_Repeated
(Element : Single_Protected_Declaration_Node) return Boolean;
procedure Set_Is_Name_Repeated
(Element : in out Single_Protected_Declaration_Node;
Value : in Boolean);
function Corresponding_Body
(Element : Single_Protected_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Body
(Element : in out Single_Protected_Declaration_Node;
Value : in Asis.Declaration);
function Declaration_Kind (Element : Single_Protected_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Single_Protected_Declaration_Node)
return Traverse_List;
function Clone
(Element : Single_Protected_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Single_Protected_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------
-- Single_Task_Declaration_Node --
----------------------------------
type Single_Task_Declaration_Node is
new Single_Protected_Declaration_Node with private;
type Single_Task_Declaration_Ptr is
access all Single_Task_Declaration_Node;
for Single_Task_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Single_Task_Declaration_Node
(The_Context : ASIS.Context)
return Single_Task_Declaration_Ptr;
function Declaration_Kind (Element : Single_Task_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Single_Task_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Single_Task_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------------
-- Integer_Number_Declaration_Node --
-------------------------------------
type Integer_Number_Declaration_Node is
new Declaration_Node with private;
type Integer_Number_Declaration_Ptr is
access all Integer_Number_Declaration_Node;
for Integer_Number_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Integer_Number_Declaration_Node
(The_Context : ASIS.Context)
return Integer_Number_Declaration_Ptr;
function Initialization_Expression
(Element : Integer_Number_Declaration_Node) return Asis.Expression;
procedure Set_Initialization_Expression
(Element : in out Integer_Number_Declaration_Node;
Value : in Asis.Expression);
function Declaration_Kind
(Element : Integer_Number_Declaration_Node) return Asis.Declaration_Kinds;
procedure Set_Declaration_Kind
(Element : in out Integer_Number_Declaration_Node;
Value : in Asis.Declaration_Kinds);
function Children (Element : access Integer_Number_Declaration_Node)
return Traverse_List;
function Clone
(Element : Integer_Number_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Integer_Number_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------------------
-- Enumeration_Literal_Specification_Node --
--------------------------------------------
type Enumeration_Literal_Specification_Node is
new Declaration_Node with private;
type Enumeration_Literal_Specification_Ptr is
access all Enumeration_Literal_Specification_Node;
for Enumeration_Literal_Specification_Ptr'Storage_Pool use Lists.Pool;
function New_Enumeration_Literal_Specification_Node
(The_Context : ASIS.Context)
return Enumeration_Literal_Specification_Ptr;
function Declaration_Kind (Element : Enumeration_Literal_Specification_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Enumeration_Literal_Specification_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Enumeration_Literal_Specification_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------------
-- Discriminant_Specification_Node --
-------------------------------------
type Discriminant_Specification_Node is
new Declaration_Node with private;
type Discriminant_Specification_Ptr is
access all Discriminant_Specification_Node;
for Discriminant_Specification_Ptr'Storage_Pool use Lists.Pool;
function New_Discriminant_Specification_Node
(The_Context : ASIS.Context)
return Discriminant_Specification_Ptr;
function Object_Declaration_Subtype
(Element : Discriminant_Specification_Node) return Asis.Definition;
procedure Set_Object_Declaration_Subtype
(Element : in out Discriminant_Specification_Node;
Value : in Asis.Definition);
function Initialization_Expression
(Element : Discriminant_Specification_Node) return Asis.Expression;
procedure Set_Initialization_Expression
(Element : in out Discriminant_Specification_Node;
Value : in Asis.Expression);
function Trait_Kind
(Element : Discriminant_Specification_Node) return Asis.Trait_Kinds;
procedure Set_Trait_Kind
(Element : in out Discriminant_Specification_Node;
Value : in Asis.Trait_Kinds);
function Has_Null_Exclusion
(Element : Discriminant_Specification_Node) return Boolean;
procedure Set_Has_Null_Exclusion
(Element : in out Discriminant_Specification_Node;
Value : in Boolean);
function Declaration_Kind (Element : Discriminant_Specification_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Discriminant_Specification_Node)
return Traverse_List;
function Clone
(Element : Discriminant_Specification_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Discriminant_Specification_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------------
-- Entry_Index_Specification_Node --
------------------------------------
type Entry_Index_Specification_Node is
new Declaration_Node with private;
type Entry_Index_Specification_Ptr is
access all Entry_Index_Specification_Node;
for Entry_Index_Specification_Ptr'Storage_Pool use Lists.Pool;
function New_Entry_Index_Specification_Node
(The_Context : ASIS.Context)
return Entry_Index_Specification_Ptr;
function Specification_Subtype_Definition
(Element : Entry_Index_Specification_Node) return Asis.Discrete_Subtype_Definition;
procedure Set_Specification_Subtype_Definition
(Element : in out Entry_Index_Specification_Node;
Value : in Asis.Discrete_Subtype_Definition);
function Declaration_Kind (Element : Entry_Index_Specification_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Entry_Index_Specification_Node)
return Traverse_List;
function Clone
(Element : Entry_Index_Specification_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Entry_Index_Specification_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
---------------------------------------
-- Loop_Parameter_Specification_Node --
---------------------------------------
type Loop_Parameter_Specification_Node is
new Entry_Index_Specification_Node with private;
type Loop_Parameter_Specification_Ptr is
access all Loop_Parameter_Specification_Node;
for Loop_Parameter_Specification_Ptr'Storage_Pool use Lists.Pool;
function New_Loop_Parameter_Specification_Node
(The_Context : ASIS.Context)
return Loop_Parameter_Specification_Ptr;
function Trait_Kind
(Element : Loop_Parameter_Specification_Node) return Asis.Trait_Kinds;
procedure Set_Trait_Kind
(Element : in out Loop_Parameter_Specification_Node;
Value : in Asis.Trait_Kinds);
function Declaration_Kind (Element : Loop_Parameter_Specification_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Loop_Parameter_Specification_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Loop_Parameter_Specification_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------------
-- Formal_Object_Declaration_Node --
------------------------------------
type Formal_Object_Declaration_Node is
new Declaration_Node with private;
type Formal_Object_Declaration_Ptr is
access all Formal_Object_Declaration_Node;
for Formal_Object_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Formal_Object_Declaration_Node
(The_Context : ASIS.Context)
return Formal_Object_Declaration_Ptr;
function Mode_Kind
(Element : Formal_Object_Declaration_Node) return Asis.Mode_Kinds;
procedure Set_Mode_Kind
(Element : in out Formal_Object_Declaration_Node;
Value : in Asis.Mode_Kinds);
function Object_Declaration_Subtype
(Element : Formal_Object_Declaration_Node) return Asis.Definition;
procedure Set_Object_Declaration_Subtype
(Element : in out Formal_Object_Declaration_Node;
Value : in Asis.Definition);
function Initialization_Expression
(Element : Formal_Object_Declaration_Node) return Asis.Expression;
procedure Set_Initialization_Expression
(Element : in out Formal_Object_Declaration_Node;
Value : in Asis.Expression);
function Has_Null_Exclusion
(Element : Formal_Object_Declaration_Node) return Boolean;
procedure Set_Has_Null_Exclusion
(Element : in out Formal_Object_Declaration_Node;
Value : in Boolean);
function Generic_Actual
(Element : Formal_Object_Declaration_Node) return Asis.Expression;
procedure Set_Generic_Actual
(Element : in out Formal_Object_Declaration_Node;
Value : in Asis.Expression);
function Declaration_Kind (Element : Formal_Object_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Formal_Object_Declaration_Node)
return Traverse_List;
function Clone
(Element : Formal_Object_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Formal_Object_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------
-- Parameter_Specification_Node --
----------------------------------
type Parameter_Specification_Node is
new Formal_Object_Declaration_Node with private;
type Parameter_Specification_Ptr is
access all Parameter_Specification_Node;
for Parameter_Specification_Ptr'Storage_Pool use Lists.Pool;
function New_Parameter_Specification_Node
(The_Context : ASIS.Context)
return Parameter_Specification_Ptr;
function Trait_Kind
(Element : Parameter_Specification_Node) return Asis.Trait_Kinds;
procedure Set_Trait_Kind
(Element : in out Parameter_Specification_Node;
Value : in Asis.Trait_Kinds);
function Declaration_Kind (Element : Parameter_Specification_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Parameter_Specification_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Parameter_Specification_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------
-- Package_Declaration_Node --
------------------------------
type Package_Declaration_Node is
new Declaration_Node with private;
type Package_Declaration_Ptr is
access all Package_Declaration_Node;
for Package_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Package_Declaration_Node
(The_Context : ASIS.Context)
return Package_Declaration_Ptr;
function Is_Name_Repeated
(Element : Package_Declaration_Node) return Boolean;
procedure Set_Is_Name_Repeated
(Element : in out Package_Declaration_Node;
Value : in Boolean);
function Corresponding_Declaration
(Element : Package_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Declaration
(Element : in out Package_Declaration_Node;
Value : in Asis.Declaration);
function Corresponding_Body
(Element : Package_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Body
(Element : in out Package_Declaration_Node;
Value : in Asis.Declaration);
function Is_Private_Present
(Element : Package_Declaration_Node) return Boolean;
procedure Set_Is_Private_Present
(Element : in out Package_Declaration_Node;
Value : in Boolean);
function Generic_Formal_Part
(Element : Package_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Generic_Formal_Part
(Element : in out Package_Declaration_Node;
Value : in Asis.Element);
function Generic_Formal_Part_List
(Element : Package_Declaration_Node) return Asis.Element;
function Visible_Part_Declarative_Items
(Element : Package_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Visible_Part_Declarative_Items
(Element : in out Package_Declaration_Node;
Value : in Asis.Element);
function Visible_Part_Declarative_Items_List
(Element : Package_Declaration_Node) return Asis.Element;
function Private_Part_Declarative_Items
(Element : Package_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Private_Part_Declarative_Items
(Element : in out Package_Declaration_Node;
Value : in Asis.Element);
function Private_Part_Declarative_Items_List
(Element : Package_Declaration_Node) return Asis.Element;
function Package_Specification
(Element : Package_Declaration_Node) return Asis.Element;
procedure Set_Package_Specification
(Element : in out Package_Declaration_Node;
Value : in Asis.Element);
function Declaration_Kind (Element : Package_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Package_Declaration_Node)
return Traverse_List;
function Clone
(Element : Package_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Package_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------------
-- Protected_Body_Declaration_Node --
-------------------------------------
type Protected_Body_Declaration_Node is
new Declaration_Node with private;
type Protected_Body_Declaration_Ptr is
access all Protected_Body_Declaration_Node;
for Protected_Body_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Protected_Body_Declaration_Node
(The_Context : ASIS.Context)
return Protected_Body_Declaration_Ptr;
function Is_Name_Repeated
(Element : Protected_Body_Declaration_Node) return Boolean;
procedure Set_Is_Name_Repeated
(Element : in out Protected_Body_Declaration_Node;
Value : in Boolean);
function Corresponding_Declaration
(Element : Protected_Body_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Declaration
(Element : in out Protected_Body_Declaration_Node;
Value : in Asis.Declaration);
function Protected_Operation_Items
(Element : Protected_Body_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Protected_Operation_Items
(Element : in out Protected_Body_Declaration_Node;
Value : in Asis.Element);
function Protected_Operation_Items_List
(Element : Protected_Body_Declaration_Node) return Asis.Element;
function Corresponding_Body_Stub
(Element : Protected_Body_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Body_Stub
(Element : in out Protected_Body_Declaration_Node;
Value : in Asis.Declaration);
function Get_Identifier
(Element : Protected_Body_Declaration_Node) return Asis.Element;
procedure Set_Identifier
(Element : in out Protected_Body_Declaration_Node;
Value : in Asis.Element);
function Declaration_Kind (Element : Protected_Body_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Protected_Body_Declaration_Node)
return Traverse_List;
function Clone
(Element : Protected_Body_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Protected_Body_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------
-- Package_Body_Stub_Node --
----------------------------
type Package_Body_Stub_Node is
new Declaration_Node with private;
type Package_Body_Stub_Ptr is
access all Package_Body_Stub_Node;
for Package_Body_Stub_Ptr'Storage_Pool use Lists.Pool;
function New_Package_Body_Stub_Node
(The_Context : ASIS.Context)
return Package_Body_Stub_Ptr;
function Corresponding_Subunit
(Element : Package_Body_Stub_Node) return Asis.Declaration;
procedure Set_Corresponding_Subunit
(Element : in out Package_Body_Stub_Node;
Value : in Asis.Declaration);
function Corresponding_Declaration
(Element : Package_Body_Stub_Node) return Asis.Declaration;
procedure Set_Corresponding_Declaration
(Element : in out Package_Body_Stub_Node;
Value : in Asis.Declaration);
function Declaration_Kind (Element : Package_Body_Stub_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Package_Body_Stub_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Package_Body_Stub_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------
-- Task_Body_Stub_Node --
-------------------------
type Task_Body_Stub_Node is
new Package_Body_Stub_Node with private;
type Task_Body_Stub_Ptr is
access all Task_Body_Stub_Node;
for Task_Body_Stub_Ptr'Storage_Pool use Lists.Pool;
function New_Task_Body_Stub_Node
(The_Context : ASIS.Context)
return Task_Body_Stub_Ptr;
function Declaration_Kind (Element : Task_Body_Stub_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Task_Body_Stub_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Task_Body_Stub_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
------------------------------
-- Protected_Body_Stub_Node --
------------------------------
type Protected_Body_Stub_Node is
new Package_Body_Stub_Node with private;
type Protected_Body_Stub_Ptr is
access all Protected_Body_Stub_Node;
for Protected_Body_Stub_Ptr'Storage_Pool use Lists.Pool;
function New_Protected_Body_Stub_Node
(The_Context : ASIS.Context)
return Protected_Body_Stub_Ptr;
function Declaration_Kind (Element : Protected_Body_Stub_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Protected_Body_Stub_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Protected_Body_Stub_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------
-- Exception_Declaration_Node --
--------------------------------
type Exception_Declaration_Node is
new Declaration_Node with private;
type Exception_Declaration_Ptr is
access all Exception_Declaration_Node;
for Exception_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Exception_Declaration_Node
(The_Context : ASIS.Context)
return Exception_Declaration_Ptr;
function Declaration_Kind (Element : Exception_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Exception_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Exception_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-----------------------------------------
-- Choice_Parameter_Specification_Node --
-----------------------------------------
type Choice_Parameter_Specification_Node is
new Declaration_Node with private;
type Choice_Parameter_Specification_Ptr is
access all Choice_Parameter_Specification_Node;
for Choice_Parameter_Specification_Ptr'Storage_Pool use Lists.Pool;
function New_Choice_Parameter_Specification_Node
(The_Context : ASIS.Context)
return Choice_Parameter_Specification_Ptr;
function Declaration_Kind (Element : Choice_Parameter_Specification_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Choice_Parameter_Specification_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Choice_Parameter_Specification_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------------
-- Generic_Package_Declaration_Node --
--------------------------------------
type Generic_Package_Declaration_Node is
new Declaration_Node with private;
type Generic_Package_Declaration_Ptr is
access all Generic_Package_Declaration_Node;
for Generic_Package_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Generic_Package_Declaration_Node
(The_Context : ASIS.Context)
return Generic_Package_Declaration_Ptr;
function Is_Name_Repeated
(Element : Generic_Package_Declaration_Node) return Boolean;
procedure Set_Is_Name_Repeated
(Element : in out Generic_Package_Declaration_Node;
Value : in Boolean);
function Corresponding_Body
(Element : Generic_Package_Declaration_Node) return Asis.Declaration;
procedure Set_Corresponding_Body
(Element : in out Generic_Package_Declaration_Node;
Value : in Asis.Declaration);
function Is_Private_Present
(Element : Generic_Package_Declaration_Node) return Boolean;
procedure Set_Is_Private_Present
(Element : in out Generic_Package_Declaration_Node;
Value : in Boolean);
function Visible_Part_Declarative_Items
(Element : Generic_Package_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Visible_Part_Declarative_Items
(Element : in out Generic_Package_Declaration_Node;
Value : in Asis.Element);
function Visible_Part_Declarative_Items_List
(Element : Generic_Package_Declaration_Node) return Asis.Element;
function Private_Part_Declarative_Items
(Element : Generic_Package_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Private_Part_Declarative_Items
(Element : in out Generic_Package_Declaration_Node;
Value : in Asis.Element);
function Private_Part_Declarative_Items_List
(Element : Generic_Package_Declaration_Node) return Asis.Element;
function Generic_Formal_Part
(Element : Generic_Package_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Generic_Formal_Part
(Element : in out Generic_Package_Declaration_Node;
Value : in Asis.Element);
function Generic_Formal_Part_List
(Element : Generic_Package_Declaration_Node) return Asis.Element;
function Specification
(Element : Generic_Package_Declaration_Node) return Asis.Element;
procedure Set_Specification
(Element : in out Generic_Package_Declaration_Node;
Value : in Asis.Element);
function Declaration_Kind (Element : Generic_Package_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Generic_Package_Declaration_Node)
return Traverse_List;
function Clone
(Element : Generic_Package_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Generic_Package_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------------------
-- Formal_Package_Declaration_With_Box_Node --
----------------------------------------------
type Formal_Package_Declaration_With_Box_Node is
new Declaration_Node with private;
type Formal_Package_Declaration_With_Box_Ptr is
access all Formal_Package_Declaration_With_Box_Node;
for Formal_Package_Declaration_With_Box_Ptr'Storage_Pool use Lists.Pool;
function New_Formal_Package_Declaration_With_Box_Node
(The_Context : ASIS.Context)
return Formal_Package_Declaration_With_Box_Ptr;
function Corresponding_Declaration
(Element : Formal_Package_Declaration_With_Box_Node) return Asis.Declaration;
procedure Set_Corresponding_Declaration
(Element : in out Formal_Package_Declaration_With_Box_Node;
Value : in Asis.Declaration);
function Corresponding_Body
(Element : Formal_Package_Declaration_With_Box_Node) return Asis.Declaration;
procedure Set_Corresponding_Body
(Element : in out Formal_Package_Declaration_With_Box_Node;
Value : in Asis.Declaration);
function Generic_Unit_Name
(Element : Formal_Package_Declaration_With_Box_Node) return Asis.Expression;
procedure Set_Generic_Unit_Name
(Element : in out Formal_Package_Declaration_With_Box_Node;
Value : in Asis.Expression);
function Normalized_Generic_Actual_Part
(Element : Formal_Package_Declaration_With_Box_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Add_To_Normalized_Generic_Actual_Part
(Element : in out Formal_Package_Declaration_With_Box_Node;
Item : in Asis.Element);
function Generic_Actual
(Element : Formal_Package_Declaration_With_Box_Node) return Asis.Expression;
procedure Set_Generic_Actual
(Element : in out Formal_Package_Declaration_With_Box_Node;
Value : in Asis.Expression);
function Declaration_Kind (Element : Formal_Package_Declaration_With_Box_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Formal_Package_Declaration_With_Box_Node)
return Traverse_List;
function Clone
(Element : Formal_Package_Declaration_With_Box_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Formal_Package_Declaration_With_Box_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------
-- Package_Instantiation_Node --
--------------------------------
type Package_Instantiation_Node is
new Formal_Package_Declaration_With_Box_Node with private;
type Package_Instantiation_Ptr is
access all Package_Instantiation_Node;
for Package_Instantiation_Ptr'Storage_Pool use Lists.Pool;
function New_Package_Instantiation_Node
(The_Context : ASIS.Context)
return Package_Instantiation_Ptr;
function Generic_Actual_Part
(Element : Package_Instantiation_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Generic_Actual_Part
(Element : in out Package_Instantiation_Node;
Value : in Asis.Element);
function Generic_Actual_Part_List
(Element : Package_Instantiation_Node) return Asis.Element;
function Declaration_Kind (Element : Package_Instantiation_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Package_Instantiation_Node)
return Traverse_List;
function Clone
(Element : Package_Instantiation_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Package_Instantiation_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
----------------------------------
-- Procedure_Instantiation_Node --
----------------------------------
type Procedure_Instantiation_Node is
new Package_Instantiation_Node with private;
type Procedure_Instantiation_Ptr is
access all Procedure_Instantiation_Node;
for Procedure_Instantiation_Ptr'Storage_Pool use Lists.Pool;
function New_Procedure_Instantiation_Node
(The_Context : ASIS.Context)
return Procedure_Instantiation_Ptr;
function Specification
(Element : Procedure_Instantiation_Node) return Asis.Element;
procedure Set_Specification
(Element : in out Procedure_Instantiation_Node;
Value : in Asis.Element);
function Overriding_Indicator_Kind
(Element : Procedure_Instantiation_Node) return Asis.Overriding_Indicator_Kinds;
procedure Set_Overriding_Indicator_Kind
(Element : in out Procedure_Instantiation_Node;
Value : in Asis.Overriding_Indicator_Kinds);
function Declaration_Kind (Element : Procedure_Instantiation_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Procedure_Instantiation_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Procedure_Instantiation_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
---------------------------------
-- Function_Instantiation_Node --
---------------------------------
type Function_Instantiation_Node is
new Procedure_Instantiation_Node with private;
type Function_Instantiation_Ptr is
access all Function_Instantiation_Node;
for Function_Instantiation_Ptr'Storage_Pool use Lists.Pool;
function New_Function_Instantiation_Node
(The_Context : ASIS.Context)
return Function_Instantiation_Ptr;
function Declaration_Kind (Element : Function_Instantiation_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Function_Instantiation_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Function_Instantiation_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
-------------------------------------
-- Formal_Package_Declaration_Node --
-------------------------------------
type Formal_Package_Declaration_Node is
new Package_Instantiation_Node with private;
type Formal_Package_Declaration_Ptr is
access all Formal_Package_Declaration_Node;
for Formal_Package_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Formal_Package_Declaration_Node
(The_Context : ASIS.Context)
return Formal_Package_Declaration_Ptr;
function Declaration_Kind (Element : Formal_Package_Declaration_Node)
return Asis.Declaration_Kinds;
function Clone
(Element : Formal_Package_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Formal_Package_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
---------------------------------------
-- Formal_Procedure_Declaration_Node --
---------------------------------------
type Formal_Procedure_Declaration_Node is
new Declaration_Node with private;
type Formal_Procedure_Declaration_Ptr is
access all Formal_Procedure_Declaration_Node;
for Formal_Procedure_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Formal_Procedure_Declaration_Node
(The_Context : ASIS.Context)
return Formal_Procedure_Declaration_Ptr;
function Parameter_Profile
(Element : Formal_Procedure_Declaration_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List;
procedure Set_Parameter_Profile
(Element : in out Formal_Procedure_Declaration_Node;
Value : in Asis.Element);
function Parameter_Profile_List
(Element : Formal_Procedure_Declaration_Node) return Asis.Element;
function Default_Kind
(Element : Formal_Procedure_Declaration_Node) return Asis.Subprogram_Default_Kinds;
procedure Set_Default_Kind
(Element : in out Formal_Procedure_Declaration_Node;
Value : in Asis.Subprogram_Default_Kinds);
function Formal_Subprogram_Default
(Element : Formal_Procedure_Declaration_Node) return Asis.Expression;
procedure Set_Formal_Subprogram_Default
(Element : in out Formal_Procedure_Declaration_Node;
Value : in Asis.Expression);
function Specification
(Element : Formal_Procedure_Declaration_Node) return Asis.Element;
procedure Set_Specification
(Element : in out Formal_Procedure_Declaration_Node;
Value : in Asis.Element);
function Has_Abstract
(Element : Formal_Procedure_Declaration_Node) return Boolean;
procedure Set_Has_Abstract
(Element : in out Formal_Procedure_Declaration_Node;
Value : in Boolean);
function Generic_Actual
(Element : Formal_Procedure_Declaration_Node) return Asis.Expression;
procedure Set_Generic_Actual
(Element : in out Formal_Procedure_Declaration_Node;
Value : in Asis.Expression);
function Declaration_Kind (Element : Formal_Procedure_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Formal_Procedure_Declaration_Node)
return Traverse_List;
function Clone
(Element : Formal_Procedure_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Formal_Procedure_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
--------------------------------------
-- Formal_Function_Declaration_Node --
--------------------------------------
type Formal_Function_Declaration_Node is
new Formal_Procedure_Declaration_Node with private;
type Formal_Function_Declaration_Ptr is
access all Formal_Function_Declaration_Node;
for Formal_Function_Declaration_Ptr'Storage_Pool use Lists.Pool;
function New_Formal_Function_Declaration_Node
(The_Context : ASIS.Context)
return Formal_Function_Declaration_Ptr;
function Result_Subtype
(Element : Formal_Function_Declaration_Node) return Asis.Definition;
procedure Set_Result_Subtype
(Element : in out Formal_Function_Declaration_Node;
Value : in Asis.Definition);
function Declaration_Kind (Element : Formal_Function_Declaration_Node)
return Asis.Declaration_Kinds;
function Children (Element : access Formal_Function_Declaration_Node)
return Traverse_List;
function Clone
(Element : Formal_Function_Declaration_Node;
Parent : Asis.Element)
return Asis.Element;
procedure Copy
(Source : in Asis.Element;
Target : access Formal_Function_Declaration_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element);
private
type Base_Type_Declaration_Node is abstract
new Declaration_Node with
record
Discriminant_Part : aliased Asis.Definition;
Type_Declaration_View : aliased Asis.Definition;
end record;
type Ordinary_Type_Declaration_Node is
new Base_Type_Declaration_Node with
record
Corresponding_Type_Declaration : aliased Asis.Declaration;
end record;
type Protected_Type_Declaration_Node is
new Ordinary_Type_Declaration_Node with
record
Is_Name_Repeated : aliased Boolean := False;
Corresponding_Body : aliased Asis.Declaration;
Progenitor_List : aliased Primary_Expression_Lists.List;
end record;
type Task_Type_Declaration_Node is
new Protected_Type_Declaration_Node with
record
null;
end record;
type Private_Type_Declaration_Node is
new Ordinary_Type_Declaration_Node with
record
Trait_Kind : aliased Asis.Trait_Kinds := An_Ordinary_Trait;
end record;
type Private_Extension_Declaration_Node is
new Private_Type_Declaration_Node with
record
Progenitor_List : aliased Primary_Expression_Lists.List;
end record;
type Formal_Type_Declaration_Node is
new Base_Type_Declaration_Node with
record
Generic_Actual : aliased Asis.Expression;
end record;
type Base_Callable_Declaration_Node is abstract
new Declaration_Node with
record
Parameter_Profile : aliased Primary_Parameter_Lists.List;
Corresponding_Body : aliased Asis.Declaration;
Specification : aliased Asis.Element;
end record;
type Procedure_Declaration_Node is
new Base_Callable_Declaration_Node with
record
Corresponding_Subprogram_Derivation : aliased Asis.Declaration;
Corresponding_Type : aliased Asis.Type_Definition;
Is_Dispatching_Operation : aliased Boolean := False;
Trait_Kind : aliased Asis.Trait_Kinds := An_Ordinary_Trait;
Overriding_Indicator_Kind : aliased Asis.Overriding_Indicator_Kinds := No_Overriding_Indicator;
Has_Abstract : aliased Boolean := False;
Is_Null_Procedure : aliased Boolean := False;
Generic_Formal_Part : aliased Primary_Declaration_Lists.List;
end record;
type Function_Declaration_Node is
new Procedure_Declaration_Node with
record
Result_Subtype : aliased Asis.Definition;
Corresponding_Equality_Operator : aliased Asis.Declaration;
end record;
type Procedure_Renaming_Declaration_Node is
new Base_Callable_Declaration_Node with
record
Is_Dispatching_Operation : aliased Boolean := False;
Renamed_Entity : aliased Asis.Expression;
Corresponding_Base_Entity : aliased Asis.Expression;
Corresponding_Declaration : aliased Asis.Declaration;
Overriding_Indicator_Kind : aliased Asis.Overriding_Indicator_Kinds := No_Overriding_Indicator;
end record;
type Function_Renaming_Declaration_Node is
new Procedure_Renaming_Declaration_Node with
record
Result_Subtype : aliased Asis.Definition;
Corresponding_Equality_Operator : aliased Asis.Declaration;
end record;
type Entry_Declaration_Node is
new Base_Callable_Declaration_Node with
record
Entry_Family_Definition : aliased Asis.Discrete_Subtype_Definition;
Overriding_Indicator_Kind : aliased Asis.Overriding_Indicator_Kinds := No_Overriding_Indicator;
end record;
type Procedure_Body_Stub_Node is
new Base_Callable_Declaration_Node with
record
Corresponding_Subunit : aliased Asis.Declaration;
Corresponding_Declaration : aliased Asis.Declaration;
Overriding_Indicator_Kind : aliased Asis.Overriding_Indicator_Kinds := No_Overriding_Indicator;
end record;
type Function_Body_Stub_Node is
new Procedure_Body_Stub_Node with
record
Result_Subtype : aliased Asis.Definition;
end record;
type Generic_Procedure_Declaration_Node is
new Base_Callable_Declaration_Node with
record
Generic_Formal_Part : aliased Primary_Declaration_Lists.List;
end record;
type Generic_Function_Declaration_Node is
new Generic_Procedure_Declaration_Node with
record
Result_Subtype : aliased Asis.Definition;
end record;
type Base_Body_Declaration_Node is abstract
new Declaration_Node with
record
Body_Declarative_Items : aliased Primary_Declaration_Lists.List;
Body_Statements : aliased Primary_Statement_Lists.List;
Body_Exception_Handlers : aliased Primary_Handler_Lists.List;
Corresponding_Declaration : aliased Asis.Declaration;
Corresponding_Body_Stub : aliased Asis.Declaration;
Is_Name_Repeated : aliased Boolean := False;
Handled_Statements : aliased Asis.Element;
Compound_Name : aliased Asis.Element;
end record;
type Procedure_Body_Declaration_Node is
new Base_Body_Declaration_Node with
record
Parameter_Profile : aliased Primary_Parameter_Lists.List;
Specification : aliased Asis.Element;
Overriding_Indicator_Kind : aliased Asis.Overriding_Indicator_Kinds := No_Overriding_Indicator;
end record;
type Function_Body_Declaration_Node is
new Procedure_Body_Declaration_Node with
record
Result_Subtype : aliased Asis.Definition;
end record;
type Package_Body_Declaration_Node is
new Base_Body_Declaration_Node with
record
null;
end record;
type Task_Body_Declaration_Node is
new Package_Body_Declaration_Node with
record
null;
end record;
type Entry_Body_Declaration_Node is
new Base_Body_Declaration_Node with
record
Parameter_Profile : aliased Primary_Parameter_Lists.List;
Entry_Index_Specification : aliased Asis.Declaration;
Entry_Barrier : aliased Asis.Expression;
Specification : aliased Asis.Element;
end record;
type Base_Renaming_Declaration_Node is abstract
new Declaration_Node with
record
Renamed_Entity : aliased Asis.Expression;
Corresponding_Base_Entity : aliased Asis.Expression;
end record;
type Object_Renaming_Declaration_Node is
new Base_Renaming_Declaration_Node with
record
Object_Declaration_Subtype : aliased Asis.Definition;
Has_Null_Exclusion : aliased Boolean := False;
end record;
type Exception_Renaming_Declaration_Node is
new Base_Renaming_Declaration_Node with
record
null;
end record;
type Package_Renaming_Declaration_Node is
new Base_Renaming_Declaration_Node with
record
null;
end record;
type Generic_Package_Renaming_Declaration_Node is
new Package_Renaming_Declaration_Node with
record
Empty_Generic_Part : aliased Primary_Declaration_Lists.List;
end record;
type Generic_Procedure_Renaming_Declaration_Node is
new Generic_Package_Renaming_Declaration_Node with
record
Specification : aliased Asis.Element;
end record;
type Generic_Function_Renaming_Declaration_Node is
new Generic_Procedure_Renaming_Declaration_Node with
record
null;
end record;
type Incomplete_Type_Declaration_Node is
new Declaration_Node with
record
Discriminant_Part : aliased Asis.Definition;
Corresponding_Type_Declaration : aliased Asis.Definition;
Type_Declaration_View : aliased Asis.Definition;
end record;
type Subtype_Declaration_Node is
new Declaration_Node with
record
Type_Declaration_View : aliased Asis.Definition;
Corresponding_First_Subtype : aliased Asis.Declaration;
Corresponding_Last_Constraint : aliased Asis.Declaration;
Corresponding_Last_Subtype : aliased Asis.Declaration;
end record;
type Component_Declaration_Node is
new Declaration_Node with
record
Object_Declaration_Subtype : aliased Asis.Definition;
Initialization_Expression : aliased Asis.Expression;
end record;
type Variable_Declaration_Node is
new Component_Declaration_Node with
record
Trait_Kind : aliased Asis.Trait_Kinds := An_Ordinary_Trait;
end record;
type Constant_Declaration_Node is
new Variable_Declaration_Node with
record
null;
end record;
type Return_Object_Specification_Node is
new Variable_Declaration_Node with
record
null;
end record;
type Deferred_Constant_Declaration_Node is
new Declaration_Node with
record
Object_Declaration_Subtype : aliased Asis.Definition;
Trait_Kind : aliased Asis.Trait_Kinds := An_Ordinary_Trait;
end record;
type Single_Protected_Declaration_Node is
new Declaration_Node with
record
Progenitor_List : aliased Primary_Expression_Lists.List;
Object_Declaration_Subtype : aliased Asis.Definition;
Is_Name_Repeated : aliased Boolean := False;
Corresponding_Body : aliased Asis.Declaration;
end record;
type Single_Task_Declaration_Node is
new Single_Protected_Declaration_Node with
record
null;
end record;
type Integer_Number_Declaration_Node is
new Declaration_Node with
record
Initialization_Expression : aliased Asis.Expression;
Declaration_Kind : aliased Asis.Declaration_Kinds
:= An_Integer_Number_Declaration;
end record;
type Enumeration_Literal_Specification_Node is
new Declaration_Node with
record
null;
end record;
type Discriminant_Specification_Node is
new Declaration_Node with
record
Object_Declaration_Subtype : aliased Asis.Definition;
Initialization_Expression : aliased Asis.Expression;
Trait_Kind : aliased Asis.Trait_Kinds := An_Ordinary_Trait;
Has_Null_Exclusion : aliased Boolean := False;
end record;
type Entry_Index_Specification_Node is
new Declaration_Node with
record
Specification_Subtype_Definition : aliased Asis.Discrete_Subtype_Definition;
end record;
type Loop_Parameter_Specification_Node is
new Entry_Index_Specification_Node with
record
Trait_Kind : aliased Asis.Trait_Kinds := An_Ordinary_Trait;
end record;
type Formal_Object_Declaration_Node is
new Declaration_Node with
record
Mode_Kind : aliased Asis.Mode_Kinds := A_Default_In_Mode;
Object_Declaration_Subtype : aliased Asis.Definition;
Initialization_Expression : aliased Asis.Expression;
Has_Null_Exclusion : aliased Boolean := False;
Generic_Actual : aliased Asis.Expression;
end record;
type Parameter_Specification_Node is
new Formal_Object_Declaration_Node with
record
Trait_Kind : aliased Asis.Trait_Kinds := An_Ordinary_Trait;
end record;
type Package_Declaration_Node is
new Declaration_Node with
record
Is_Name_Repeated : aliased Boolean := False;
Corresponding_Declaration : aliased Asis.Declaration;
Corresponding_Body : aliased Asis.Declaration;
Is_Private_Present : aliased Boolean := False;
Generic_Formal_Part : aliased Primary_Declaration_Lists.List;
Visible_Part_Declarative_Items : aliased Primary_Declaration_Lists.List;
Private_Part_Declarative_Items : aliased Primary_Declaration_Lists.List;
Package_Specification : aliased Asis.Element;
end record;
type Protected_Body_Declaration_Node is
new Declaration_Node with
record
Is_Name_Repeated : aliased Boolean := False;
Corresponding_Declaration : aliased Asis.Declaration;
Protected_Operation_Items : aliased Primary_Declaration_Lists.List;
Corresponding_Body_Stub : aliased Asis.Declaration;
Identifier : aliased Asis.Element;
end record;
type Package_Body_Stub_Node is
new Declaration_Node with
record
Corresponding_Subunit : aliased Asis.Declaration;
Corresponding_Declaration : aliased Asis.Declaration;
end record;
type Task_Body_Stub_Node is
new Package_Body_Stub_Node with
record
null;
end record;
type Protected_Body_Stub_Node is
new Package_Body_Stub_Node with
record
null;
end record;
type Exception_Declaration_Node is
new Declaration_Node with
record
null;
end record;
type Choice_Parameter_Specification_Node is
new Declaration_Node with
record
null;
end record;
type Generic_Package_Declaration_Node is
new Declaration_Node with
record
Is_Name_Repeated : aliased Boolean := False;
Corresponding_Body : aliased Asis.Declaration;
Is_Private_Present : aliased Boolean := False;
Visible_Part_Declarative_Items : aliased Primary_Declaration_Lists.List;
Private_Part_Declarative_Items : aliased Primary_Declaration_Lists.List;
Generic_Formal_Part : aliased Primary_Declaration_Lists.List;
Specification : aliased Asis.Element;
end record;
type Formal_Package_Declaration_With_Box_Node is
new Declaration_Node with
record
Corresponding_Declaration : aliased Asis.Declaration;
Corresponding_Body : aliased Asis.Declaration;
Generic_Unit_Name : aliased Asis.Expression;
Normalized_Generic_Actual_Part : aliased Secondary_Association_Lists.List_Node;
Generic_Actual : aliased Asis.Expression;
end record;
type Package_Instantiation_Node is
new Formal_Package_Declaration_With_Box_Node with
record
Generic_Actual_Part : aliased Primary_Association_Lists.List;
end record;
type Procedure_Instantiation_Node is
new Package_Instantiation_Node with
record
Specification : aliased Asis.Element;
Overriding_Indicator_Kind : aliased Asis.Overriding_Indicator_Kinds := No_Overriding_Indicator;
end record;
type Function_Instantiation_Node is
new Procedure_Instantiation_Node with
record
null;
end record;
type Formal_Package_Declaration_Node is
new Package_Instantiation_Node with
record
null;
end record;
type Formal_Procedure_Declaration_Node is
new Declaration_Node with
record
Parameter_Profile : aliased Primary_Parameter_Lists.List;
Default_Kind : aliased Asis.Subprogram_Default_Kinds := Not_A_Default;
Formal_Subprogram_Default : aliased Asis.Expression;
Specification : aliased Asis.Element;
Has_Abstract : aliased Boolean := False;
Generic_Actual : aliased Asis.Expression;
end record;
type Formal_Function_Declaration_Node is
new Formal_Procedure_Declaration_Node with
record
Result_Subtype : aliased Asis.Definition;
end record;
end Asis.Gela.Elements.Decl;
|
programs/oeis/008/A008642.asm | neoneye/loda | 22 | 8055 | ; A008642: Quarter-squares repeated.
; 1,1,2,2,4,4,6,6,9,9,12,12,16,16,20,20,25,25,30,30,36,36,42,42,49,49,56,56,64,64,72,72,81,81,90,90,100,100,110,110,121,121,132,132,144,144,156,156,169,169,182,182,196,196,210,210,225,225,240,240,256,256,272,272,289,289,306,306,324,324,342,342,361,361,380,380,400,400,420,420,441,441,462,462,484,484,506,506,529,529,552,552,576,576,600,600,625,625,650,650
add $0,4
div $0,2
pow $0,2
div $0,4
|
contrib/mac/watch-workers.applescript | gthb/celery | 2 | 2110 | set broker to "h8.opera.com"
set workers to {"h6.opera.com", "h8.opera.com", "h9.opera.com", "h10.opera.com"}
set clock to "h6.opera.com"
tell application "iTerm"
activate
set myterm to (make new terminal)
tell myterm
set number of columns to 80
set number of rows to 50
repeat with workerhost in workers
set worker to (make new session at the end of sessions)
tell worker
set name to workerhost
set foreground color to "white"
set background color to "black"
set transparency to 0.1
exec command "/bin/sh -i"
write text "ssh root@" & workerhost & " 'tail -f /var/log/celeryd.log'"
end tell
end repeat
set celerybeat to (make new session at the end of sessions)
tell celerybeat
set name to "celerybeat.log"
set foreground color to "white"
set background color to "black"
set transparency to 0.1
exec command "/bin/sh -i"
write text "ssh root@" & clock & " 'tail -f /var/log/celerybeat.log'"
end tell
set rabbit to (make new session at the end of sessions)
tell rabbit
set name to "rabbit.log"
set foreground color to "white"
set background color to "black"
set transparency to 0.1
exec command "/bin/sh -i"
write text "ssh root@" & broker & " 'tail -f /var/log/rabbitmq/rabbit.log'"
end tell
tell the first session
activate
end tell
end tell
end tell
|
programs/oeis/085/A085425.asm | karttu/loda | 1 | 178700 | ; A085425: Number of minus ones in the symmetric signed digit expansion of n with q=2 (i.e., the representation of n in the (-1,0,1)_2 number system).
; 0,0,1,0,0,1,1,0,0,0,2,1,1,1,1,0,0,0,1,0,0,2,2,1,1,1,2,1,1,1,1,0,0,0,1,0,0,1,1,0,0,0,3,2,2,2,2,1,1,1,2,1,1,2,2,1,1,1,2,1,1,1,1,0,0,0,1,0,0,1,1,0,0,0,2,1,1,1,1,0,0,0,1,0,0,3,3,2,2,2,3,2,2,2,2,1
sub $0,131327
mul $0,2
cal $0,114285 ; Expansion of (1-3*x)/((1-x)*(1-x^2)).
cal $0,85424 ; Number of ones in the symmetric signed digit expansion of n with q=2 (i.e., the representation of n in the (-1,0,1)_2 number system).
mov $1,$0
sub $1,2
|
Library/GDI/GenPC/genpcKbd.asm | steakknife/pcgeos | 504 | 243421 | <filename>Library/GDI/GenPC/genpcKbd.asm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1996 -- All Rights Reserved
PROJECT:
MODULE:
FILE: genpcKbd.asm
AUTHOR: <NAME>, Apr 26, 1996
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/26/96 Initial revision
DESCRIPTION:
Keyboard handler for Generic PC GDI driver.
$Id: genpcKbd.asm,v 1.1 97/04/04 18:04:00 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardInit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize the keyboard hardware
CALLED BY: GDIInitInterface
PASS: ds -> dgroup
RETURN: ax <- ErrorCode
carry set on error
DESTROYED: bx, cx, dx, es allowed
SIDE EFFECTS:
Latches new interrupt vector
Enables keyboard interrupt
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/30/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if NT_DRIVER
DllName DB "GEOSVDD.DLL",0
InitFunc DB "VDDRegisterInit",0
DispFunc DB "VDDDispatch",0
endif
HWKeyboardInit proc near
uses si
.enter
;
; Update ES with segment
MOV_SEG es, ds
if not NT_DRIVER
;
; See if the controller is XT- or AT-style.
;
call KbdCheckControllerType ; ax, bx, cx,
; dx, si
; destroyed
endif ; ! NT_DRIVER
;
; Set the isSwapCtrl variable, we need to know this info.
;
call KbdSetSwapCtrl
;
; Set up to catch the keyboard interrupt.
;
INT_OFF ;disable ints while setting
mov ax, SDI_KEYBOARD ; ax -> IRQ level
mov bx, segment KbdInterrupt ; bx:cx -> new vector
mov cx, offset KbdInterrupt
mov di, offset oldKbdVector ; es:di -> old vector
call SysCatchDeviceInterrupt ; ax, bx, di destroyed
if not NT_DRIVER
;
; Flush BIOS keyboard buffer by setting the head
; pointer to equal tail pointer..
;
push ds, ax
mov ax, BIOS_SEG
mov ds, ax
mov ax, ds:[BIOS_KEYBOARD_BUFFER_TAIL_POINTER]
mov ds:[BIOS_KEYBOARD_BUFFER_HEAD_POINTER], ax
pop ds, ax
;
; Enable keyboard interrupt in controller.
;
in al, IC1_MASKPORT
and al, not (1 shl SDI_KEYBOARD)
out IC1_MASKPORT, al
else ; NT_DRIVER
;;
;; Register with VDD
;;
; if we have already registered, don't do it again, buddy.
cmp ds:[vddHandle], 0
jne done
mov ax, cs
mov ds, ax
mov es, ax
;
; Register the dll
;
; Load ioctlvdd.dll
mov si, offset DllName ; ds:si = dll name
mov di, offset InitFunc ; es:di = init routine
mov bx, offset DispFunc ; ds:bx = dispatch routine
RegisterModule
nop
mov bx, dgroup
mov ds, bx
mov ds:[vddHandle], ax
endif
INT_ON ;turn interrupts back on
;
done:
mov ax, EC_NO_ERROR
clc
.leave
ret
HWKeyboardInit endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdSetSwapCtrl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read the .ini file and get the swapCtrl setting.
CALLED BY: INTERNAL: HWKeyboardInit
PASS: ds -> dgroup
RETURN: nothing
DESTROYED: cx, dx, si, ax
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
kliu 7/15/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdSetSwapCtrl proc near
.enter
push ds
segmov ds, cs, cx
mov si, offset GDIKeyboardCategoryStr
mov dx, offset keyboardSwapCtrl
call InitFileReadBoolean
pop ds
jc done ; => no entry
mov ds:[isSwapCtrl], al ; set isSwapCtrl
done:
.leave
ret
KbdSetSwapCtrl endp
if not NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdResetCommandByte
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: INTERNAL: KbdExitFar
PASS: ds -> dgroup
RETURN: nothing
DESTROYED: ax, cx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 5/ 6/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdResetCommandByteFar proc far
call KbdResetCommandByte
ret
KbdResetCommandByteFar endp
KbdResetCommandByte proc near
.enter
test ds:[kbdHotkeyFlags], mask KHF_HOTKEY_PENDING
jnz reset
;
; First check to see if the command byte has changed. If not,
; we're done. The reason we do this is that the controllers
; on some machines don't respond quickly enough. Rather than
; put in delay loops (which I first tried, and couldn't find
; delays long enough that worked), this approach was used.
; Without this, the keyboard will behave fine in PC/GEOS, but
; locks up when exiting (and hence when back in DOS) -- eca 5/20/92
;
call KbdGetCCB
cmp al, ds:[kbdCmdByte] ;command byte changed?
je done
reset:
;
; The command byte is actually different, so set it back.
;
mov ah, KBD_CMD_SET_CCB ; Set controller command byte
call KbdWriteCmd
mov ah, ds:[kbdCmdByte] ; back the way
; it was
test ds:[kbdHotkeyFlags], mask KHF_HOTKEY_PENDING
jz writeCmdByte
ornf ah, mask KCB_DISABLE_KEYBOARD ; keep it disabled
writeCmdByte:
call KbdWriteData
done:
.leave
ret
KbdResetCommandByte endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdCheckControllerType
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check to see if this keyboard communicates as an XT or AT.
CALLED BY: HWKeyboardInit
PASS: ds -> seg addr of dgroup
RETURN: nothing
DESTROYED: ax, bx, cx, dx, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 4/12/91 Initial version
todd 5/1/96 Stolen for GDI library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdCheckControllerType proc near
.enter
;
; See if the INI file tells us anything
mov dx, offset keyboardForceAT ; dx -> key offset
mov bl, mask KO_FORCE_AT ; bl -> option to set
call KbdCheckOption ; carry clear if set
; si destroyed
jnc isAT ; => Must be AT
mov dx, offset keyboardForceXT ; dx -> key offset
mov bl, mask KO_FORCE_XT ; bl -> option to set
call KbdCheckOption ; carry clear if set
; si destroyed
jnc isXT ; => Must be XT
INT_OFF
;
; Try to determine whether we are on PC or AT to handle different
; keyboards. On the AT the KBD_PC_CTRL_PORT location can not
; have its high bit changed. So we try and change it. If it
; changes, voila, it's not an AT.
;
in al, KBD_PC_CTRL_PORT ;al <- get special info
mov ah,al ;ah <- save info
or al, KBD_ACKNOWLEDGE ;set high bit
out KBD_PC_CTRL_PORT, al ;
in al,KBD_PC_CTRL_PORT ;al <- new special info
xchg al,ah ;ah <- changed? results
out KBD_PC_CTRL_PORT, al ;return kbd to orig state
test ah, KBD_ACKNOWLEDGE ;high bit changed?
jz isAT ; => not set
isXT:
;
; The controller is XT-style, so we must send ACKs.
;
mov ds:[isXTKeyboard], -1
done:
INT_ON
.leave
ret
isAT:
;
; The controller is AT-style. Tell it to emulate
; an XT-style controller since that's what we
; speak to.
INT_OFF
clr ds:[isXTKeyboard]
;
; NOTE: This causes anything already buffered to be overwritten
;
; For some reason, some keyboard controllers (eg. Gateway)
; have the "disable keyboard" bit set when we read the command
; byte. This is bad thing, so we ignore this bit. Whether this
; is due to timing (too little time between writing to the command
; port and reading from the data port), cosmic rays, or what, I'm
; not sure, but this seems a reasonable precaution -- eca 5/20/92
;
call KbdGetCCB ; al <- command byte
; ah, cx destroyed
andnf al, not (mask KCB_DISABLE_KEYBOARD)
mov ds:[kbdCmdByte], al ;save the command value
push ax
mov ah, KBD_CMD_SET_CCB ;Request setting of controller
call KbdWriteCmd ; ax, cx destroyed
pop ax
;
; Set our version of the command byte. If the controller is set
; to support an XT keyboard or to interrupt on its auxiliary port, we
; maintain those settings. We always tell it to xlate from AT to XT
; scan codes (in theory, this should not conflict with KCB_XT_KEYBOARD)
; and to interrupt when data are available.
;
mov ah, mask KCB_XLATE_SCAN_CODES or \
mask KCB_INTERRUPT_ENABLE
andnf al, mask KCB_XT_KEYBOARD or mask KCB_AUX_IEN or \
mask KCB_SYSTEM_FLAG
or ah, al
call KbdWriteData ; ax, cx destroyed
jmp done
KbdCheckControllerType endp
endif ; !NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdCheckOption
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check a keyboard driver geos.ini file option
CALLED BY: KbdInit(), KbdSetOptions()
PASS: cs:dx -> ptr to key ASCIIZ string
ds -> seg addr of idata
bl -> KeyboardOptions to set
RETURN: carry clear if keyboard option set
DESTROYED: si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 1/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
keyboardCategoryStr char "keyboard", 0
keyboardForceXT char "forceXT", 0
keyboardForceAT char "forceAT", 0
GDIKeyboardCategoryStr char "GDI keyboard", 0
keyboardSwapCtrl char "swapCtrl", 0
KbdCheckOption proc near
uses ds
.enter
;
; Check the appropriate category
;
MOV_SEG ds, cs
mov cx, cs
mov si, offset keyboardCategoryStr
call InitFileReadBoolean
jc done ; => No entry
tst_clc al
jnz done ; => True
stc ; false
done:
.leave
ret
KbdCheckOption endp
if not NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdGetCCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read the Controller Command Byte from the 8042.
CALLED BY: (INTERNAL) KbdResetCommandByte, CheckControllerType
PASS: nothing
RETURN: al <- command byte
DESTROYED: ah, cx
SIDE EFFECTS: any received ACK or RESEND from the keyboard is *dropped*
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdGetCCB proc near
.enter
;
; Disable keyboard interrupts for the duration, so the command byte
; is not interpreted as a keystroke (the command byte we use happens
; to also be the scan code for the NumLock key; reading the byte as
; a keystroke results in the set-LED sequence being sent, the ACKs for
; which overwrite the command byte and we, and the keyboard, get mighty
; confused).
;
in al, IC1_MASKPORT
push ax
ornf al, (1 shl SDI_KEYBOARD) ;keyboard interrupts at level 1
out IC1_MASKPORT, al
tryAgain:
mov ah, KBD_CMD_GET_CCB ;ah <- info requested
call KbdWriteCmd ; ax, cx destroyed
call KbdReadData ; al <- data
; ah, cx destroyed
cmp al, KBD_RESP_ACK
je tryAgain ; don't treat ACK coming back
; from the keyboard (WHY IS
cmp al, KBD_RESP_RESEND ; IT COMING BACK? WE DIDN'T
je tryAgain ; TALK TO THE SILLY THING)
; as a command byte.
;
; Reset the SDI_KEYBOARD bit to what it was before
;
pop cx
xchg ax, cx
out IC1_MASKPORT, al
mov_tr ax, cx
.leave
ret
KbdGetCCB endp
endif ;!NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdClearShiftState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: INTERNAL: HWKeyboardShutdown
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 5/ 6/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdClearShiftStateFar proc far
call KbdClearShiftState
ret
KbdClearShiftStateFar endp
KbdClearShiftState proc near
.enter
.leave
ret
KbdClearShiftState endp
if not NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdWriteCmd, KbdWriteData
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sends a byte to the keyboard controller command or
data port, making sure the buffer is empty first. Since
the controller provides no interrupt for its input buffer
being empty, we have to busy wait (generally a very small
amount of time, if any, fortunately).
CALLED BY: INTERNAL
PASS: ah -> CMD/data to send
RETURN: none
DESTROYED: ax, cx
KNOWN BUGS/SIDE EFFECTS/IDEAS:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdWriteCmd proc near
call WaitABit ;cx <- timeout count = 0
KSC10:
in al, KBD_STATUS_PORT ;wait for buffer empty
test al, mask KSB_INPUT_BUFFER_FULL ;test for input buffer full
loopnz KSC10 ;if full, loop & wait
mov al,ah ;al <- command byte
out KBD_COMMAND_PORT, al ;out to KBD_COMMAND_PORT
ret
KbdWriteCmd endp
KbdWriteData proc near
call WaitABit ;cx <- timeout count = 0
KSD10:
in al, KBD_STATUS_PORT ;wait for buffer empty
test al, mask KSB_INPUT_BUFFER_FULL ;test for input buffer full
loopnz KSD10 ;if full, loop & wait
mov al,ah ;al <- data byte
out KBD_DATA_PORT, al ;out to KBD_DATA_PORT
ret
KbdWriteData endp
KbdReadData proc near
call WaitABit ;cx <- timeout count = 0
KGD10:
in al, KBD_STATUS_PORT ;wait for buffer full
test al, mask KSB_OUTPUT_BUFFER_FULL ;test for ouput buffer full
loopz KGD10 ;if not, loop & wait
in al, KBD_DATA_PORT ;al <- byte from KBD_DATA_PORT
ret
KbdReadData endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WaitABit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Wait a small amount of time for hardware to catch up...
CALLED BY: (F)UTILITY
PASS: none
RETURN: cx <- 0
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine exists simply because PC keyboard hardware is
sometimes scrod. This routine waits a little bit, the idea
being allowing the keyboard hardware some time to do what it
was told to do.
This is only called during DR_INIT and DR_EXIT when we are
writing to and reading from the keyboard controller, so the
concept of a delay loop isn't as horrendous as it may sound.
-- eca 5/20/92
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 5/20/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WaitABit proc near
mov cx, 0xeca
waitLoop:
jmp $+2 ;clear ye olde pre-fetch queue
loop waitLoop
ret
WaitABit endp
endif ; not NT_DRIVER
InitCode ends
ShutdownCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardShutdown
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clean up
CALLED BY: INTERNAL: GDIShutdownInterface
PASS: ds -> dgroup
RETURN: ax <- KeyboardErrorCodes
carry set if error
DESTROYED: es, bx, cx, di
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/30/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
HWKeyboardShutdown proc near
.enter
MOV_SEG es, ds ; ds, es = dgroup
if not NT_DRIVER
;
; Set keyboard back to "boring" state
call KbdClearShiftStateFar
endif ; ! NT_DRIVER
INT_OFF
if NT_DRIVER
pushf
push ax, ds
mov ax, dgroup
mov ds, ax
mov ax, ds:[vddHandle]
UnRegisterModule
pop ax, ds
popf
endif ; NT_DRIVER
if not NT_DRIVER
;
; If this an AT, put the controller back the way we found it
;
tst ds:[isXTKeyboard]
jnz skipReset ; => no need
call KbdResetCommandByteFar
skipReset:
endif ; !NT_DRIVER
;
; Reset the interrupt vector. NOTE: we do this after resetting
; the command byte, because on some machines, namely those
; with the new AMI extended BIOS, the act of reading the
; keyboard status via KBD_CMD_GET_CCB causes a spurious keyboard
; interrupt. The old interrupt vector sees the status value 45h
; as a scan code for <Num Lock>, which causes it to toggle the
; LED. However, because this isn't a real press, it never
; gets a release, leaving the keyboard in a sort of <Num Lock>
; limbo where it is neither on nor off. Our interrupt vector
; is already hacked to deal with spurious interrupts, and so
; we blissfully ignore the silly thing. -- eca 2/23/93
;
mov ax, SDI_KEYBOARD
mov di, offset oldKbdVector
call SysResetDeviceInterrupt
INT_ON
mov ax, EC_NO_ERROR
clc ;no error
.leave
ret
HWKeyboardShutdown endp
ShutdownCode ends
CallbackCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GDIKbdInt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Generic keyboard interrupt routine
CALLED BY: IRQ2
PASS: nothing
RETURN: nothing
DESTROYED: Nothing at all -- we're interrupt code!
PSEUDO CODE/STRATEGY:
save registers we can't trash at interrupt time;
if data waiting in keyboard buffer [
read data;
if keyboard response (ACK or above) [
If RESEND, resend else [
move queue up to remove last byte;
send next byte if queue not empty;
]
] else [
send event containing scan code;
] else error;
signal interrupt controller that interrupt is complete;
restore registers;
return (from interrupt);
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 7/29/88 Initial version
Doug 8/19/88 Changed so that int routine sends scan code
only, moving translation code to IOCTL routine
Todd 4/26/96 Steal for GDI code.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdInterrupt proc far
uses ds, es
pusha
.enter
;
; Be a nice little interrupt...
call SysEnterInterrupt
cld ;clear direction flag
INT_ON
; Get handls on dgroup
mov ax, segment dgroup
mov ds, ax ;ds <- seg addr of driver
mov es, ax ; es too, for KbdCheckHotkey
if not NT_DRIVER
;
; See if we're on an AT or XT keyboard
tst ds:[isXTKeyboard]
jnz handleScancode
;
; Look for screwy PS/2 Model 40SX BIOS
in al, KBD_STATUS_PORT ; get kbd state
test al, mask KSB_OUTPUT_BUFFER_FULL ; possible problem?
in al, KBD_DATA_PORT ; get scan code
jz sendEOI ; => PS/2 BIOS jerking us around
;
; We've grabbed a byte off the keyboard.
; It's either a scan-code, or status update.
tst al ; what did we get?
jz sendPCAck ; => buffer is overflowing
cmp al, KBD_RESP_ACK
jae handleFunkyCode ; => kbd controller code
handleScancode:
;
; See if we've got an extended scan code here...
mov ah, al ; assume we do
cmp al, ds:kbdExtendedScanCodes[0]
je handleExtension
cmp al, ds:kbdExtendedScanCodes[1]
je handleExtension
cmp al, ds:kbdExtendedScanCodes[2]
je handleExtension
cmp al, ds:kbdExtendedScanCodes[3]
je handleExtension
;
; Nope. We're fine. Make sure next extension
; is clear for the next scancode.
clr ah
handleExtension:
tst ah ; do we have an extension?
xchg ah, ds:[kbdScanExtension] ; get/clear scan code ext.
jnz sendPCAck ; => extended scan
;
; Okay, we've got the complete scancode in AX.
; Now we need to tell everyone about it
mov cx, -1 ; assume press
test al, 080h ; is it release?
jz tellEm ; => release
clr cx ; actualyl release
andnf al, not (080h) ; clear release bit
tellEm:
;
; Before telling them, we now handle the extended scan
; in here. For PC, we are converting the 16 bit extended scan to
; 8 bit before handing that to the GDI driver.
;
tst ah
jz callCallback
call ConvertExtCodes ; al = converted scan
; bx, dl destroyed
clr ah
callCallback:
;
; Hack for now...if scan code is 0 don't bother sending it
;
tst ax
jz sendPCAck
;
; We can pass the scan code now
mov bx, ax ; bx -> scancode
mov ax, EC_NO_ERROR ; ax -> ErrorCode
mov di, offset keyboardCallbackTable ; di -> table to use
mov bp, offset GDINoCallback ; bp -> update routine
; call GDICallCallbacks
call GDIHWGenerateEvents
sendPCAck:
;
; We're done if we're an AT keyboard...
tst ds:[isXTKeyboard]
jz sendEOI
;
; Strove msb to send ACK for XT keyboard
in al, KBD_PC_CTRL_PORT ; get state
or al, KBD_ACKNOWLEDGE ; set high bit
out KBD_PC_CTRL_PORT, al ; set state
xor al, KBD_ACKNOWLEDGE ; clear high bit
out KBD_PC_CTRL_PORT, al ; set state
else ; NT_DRIVER
mov ax, ds:[vddHandle]
;;
;; Decide if this is caused be a keyboard event or a mouse event
mov bx, VDD_FUNC_GET_EVENT_TYPE
DispatchCall
jcxz sendEOI
cmp cx, EVENT_KEYBD
je isKeyboard
; must be a mouse event
mov bx, si ; buttonState
mov ax, 1
call MouseDevHandler
jmp sendEOI
isKeyboard:
mov bx, VDD_FUNC_GET_LAST_KEY ; get event type and arguments
DispatchCall
nop
;;
;; Get key from windows
;;
; bx <- trashed
; cx <- scancode
; dx <- 0 for release, -1 for press
NTcallCallback:
;
; We can pass the scan code now
mov bx, cx ; bx -> scancode
mov cx, dx ; cx -> press/release
mov ax, EC_NO_ERROR ; ax -> ErrorCode
mov di, offset keyboardCallbackTable ; di -> table to use
mov bp, offset GDINoCallback ; bp -> update routine
; call GDICallCallbacks
;;
;; See args fo KbdCallback in gdi keyboard driver
call GDIHWGenerateEvents
endif
sendEOI:
mov al, IC_GENEOI ; al <- Interrupt ACK
out IC1_CMDPORT,al ; set to controller
call SysExitInterrupt
.leave
popa
iret
if not NT_DRIVER
handleFunkyCode:
;
; See if we're sending stuff TO the keyboard...
tst ds:[kbdSQSize] ; anything in buffer?
jz handleScancode ; => Nope.
cmp al, KBD_RESP_RESEND ; should we send again?
je sendAgain ; => Yup.
;
; Send next byte of outgoing packet
dec ds:[kbdSQSize] ; got any more left?
jz sendPCAck ; => Nope.
;
; Shuffle everything left one char
mov cx, size kbdSendQueue - 1
mov bx, offset kbdSendQueue
sidestepLeft:
mov al, ds:[bx] + 1
mov ds:[bx] + 0, al
inc bx
loop sidestepLeft
sendAgain:
mov al, ds:[kbdSendQueue + 0] ;get next char
out KBD_DATA_PORT, al ;out to KBD_DATA_PORT
jmp sendPCAck
endif
KbdInterrupt endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardGetKey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get any additional scancodes for interrupt
CALLED BY: GDIKeyboardGetKey
PASS: ds -> dgroup
RETURN: bx <- scancode
cx <- TRUE if press, FALSE if release
ax <- KeyboardErrorCode
DESTROYED: nothing
SIDE EFFECTS:
None
PSEUDO CODE/STRATEGY:
We only report one scancode per interrupt.
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 5/ 8/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
HWKeyboardGetKey proc near
.enter
mov ax, KEC_NO_ADDITIONAL_SCANCODES
.leave
ret
HWKeyboardGetKey endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConvertExtCodes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Convert extended keyboard scan codes.
CALLED BY: INTERNAL: ProcessKeyElement
PASS: ax -> 16 bit scan code value
RETURN: al <- 8 bit scan code value
carry set if extended shift
DESTROYED: bx, dl
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 9/1/88 Initial version
Gene 2/27/90 Added extended shift checks
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConvertExtCodes proc near
push cx
;
; Some keyboards have separate arrow and navigation keys
; in addition to the ones on the numeric keypad. When the
; keyboard is in the lowest emulation level that we use,
; <shift><ext-arrow>
; comes through as:
; <shift><ext-unshift><ext-arrow><ext-shift>
; This means that we would normally not be able to get
; an extended arrow key with <shift> being down. This is
; bad because some UIs specify <shift><arrow> as being a
; shortcut (distinct from just <arrow>). To get around this
; problem, we simply ignore extended shifts presses and
; releases, and the rest of the keyboard driver does the
; right thing...
;
cmp ax, EXT_LSHIFT_PRESS
je extendedShift
cmp ax, EXT_RSHIFT_PRESS
je extendedShift
;
; The <Break> key is an extended key similar to the separate
; arrow keys mentioned above, except it sents out <ext-ctrl>
; and the like.
;
cmp ax, EXT_LCTRL_PRESS
je extendedCtrl
afterCtrl:
mov bx, offset KbdExtendedScanTable
mov cx, KBD_NUM_EXTSCANMAPS ;cx <- number of entries
CEC_10:
cmp ax, ds:[bx].EMD_extScanCode
je CEC_30 ;branch if match
add bx, size ExtendedScanDef ;move to next entry
loop CEC_10 ;loop to try all entries
jmp short CEC_100 ;exit w/same code if no match
CEC_30:
mov al, ds:[bx].EMD_mappedScanCode ;al <- translated char
CEC_90:
clc
pop cx
ret
CEC_100:
;
; New scheme that we use, we map the code to the new extension
;
add al, EXT_CODE_OFFSET
jmp CEC_90
extendedShift:
clr al
stc
pop cx
ret
;
; Here's the story: the <Break> character is on a variety
; of different keys on different types of keyboards, and is
; accessed by <ctrl>+<key>. On extended keyboards, it is on
; a special key with <Pause>. This key sends out an <ext-unctrl>
; the way the extended arrow keys send out <ext-unshift>, and
; then sends out the same scan code as <Num Lock>. On
; non-extended keyboards, the <Break> character is on the
; <Scroll Lock> key.
;
; Given the above, if the "swap <Ctrl> and <Caps Lock>" option
; is selected, and an <ext-Ctrl> comes through, it should actually
; be treated as <Caps Lock> since that's where the <Ctrl> actually
; is now. -- eca 2/22/91
;
extendedCtrl:
tst ds:[isSwapCtrl]
jz afterCtrl
mov ax, SCANCODE_CAPS_LOCK
jmp afterCtrl
ConvertExtCodes endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardPassHotkey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Pass control to the previous keyboard-interrupt
handler so it can recognize the hotkey
CALLED BY: GDIKeyboardPassHotkey
PASS: ds -> dgroup
RETURN: ax <- KeyboardErrorCode
carry set if error
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
kliu 7/15/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
HWKeyboardPassHotkey proc near
.enter
;
; Pass control off as if it were an interrupt
;
pushf
cli
call ds:[oldKbdVector]
;
; Flush keyboard buffer on return, in case no one was actually
; interested in the keystroke we just passed on.
;
INT_OFF
push ds
mov ax, BIOS_SEG
mov ds, ax
mov ax, ds:[BIOS_KEYBOARD_BUFFER_TAIL_POINTER]
mov ds:[BIOS_KEYBOARD_BUFFER_HEAD_POINTER], ax
pop ds
INT_ON
;
; Re-enable the keyboard interface
;
call HWKeyboardCancelHotkey
mov ax, EC_NO_ERROR
clc
.leave
ret
HWKeyboardPassHotkey endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardCancelHotkey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: We've decided not to hand off the keypress afterall,
so re-enable the keyboard interface
CALLED BY: GDIKeyboardCancelHotkey
PASS: ds -> dgroup
RETURN: ax <- KeyboardErrorCode
carry set if error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
kliu 7/15/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
HWKeyboardCancelHotkey proc near
.enter
if not NT_DRIVER
andnf ds:[kbdHotkeyFlags], not mask KHF_HOTKEY_PENDING
;
; Now enable the interface. For an 8042, we send just
; the appropiate command to its command port
;
tst ds:isXTKeyboard
jnz enableXT
mov al, KBD_CMD_ENABLE_INTERFACE
out KBD_COMMAND_PORT, al
jmp done
enableXT:
;
; For an XT, set the appropiate bit in the KBD_PC_CTRL_PORT
;
in al, KBD_PC_CTRL_PORT
ornf al, mask XP61_KBD_DISABLE
out KBD_PC_CTRL_PORT, al
done:
endif
mov ax, EC_NO_ERROR
clc
.leave
ret
HWKeyboardCancelHotkey endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardAddHotkey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a hotkey to watch for.
CALLED BY: GDIKeyboardAddHotkey
PASS: ah -> ShiftState
cx -> character (ch = CharacterSet, cl =
Chars/VChars)
^lbx:si -> object to notify when the key is pressed
bp -> message to send it
ds -> dgroup
RETURN: ax <- KeyboardErrorCode
carry set if error
DESTROYED: none
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
kliu 7/15/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
HWKeyboardAddHotkey proc near
uses dx
.enter
mov dx, offset KbdAddHotkeyLow
call KbdAddDelHotkeyCommon
mov ax, EC_NO_ERROR
clc
.leave
ret
HWKeyboardAddHotkey endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardDelHotkey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Remove a hotkey being watched for.
CALLED BY: GDIKeyboardDelHotkey
PASS: ah -> ShiftState
cx -> character (ch = CharacterSet, cl =
Chars/VChars)
ds -> dgroup
RETURN: ax <- KeyboardErrorCode
carry set if error
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
kliu 7/17/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
HWKeyboardDelHotkey proc near
uses dx
.enter
mov dx, offset KbdDelHotkeyLow
call KbdAddDelHotkeyCommon ; nothing destroyed
mov ax, EC_NO_ERROR
clc
.leave
ret
HWKeyboardDelHotkey endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdAddHotkeyLow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add another entry into the hotkey table, if possible.
CALLED BY: KbdAddHotkey via KbdAddDelHotkeyCommon
PASS: ax -> ShiftState/scan code pair
ds:di -> existing entry in table with same pair; di = 0 if
none
^lbx:si -> object to notify when typed
bp -> message to send it.
RETURN: carry set if no room
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdAddHotkeyLow proc near
uses cx, di
.enter
tst di
jnz haveSlot
;
; Not passed a slot, so we have to find one that contains 0.
;
mov cx, MAX_HOTKEYS
mov di, offset keyboardHotkeys
push ax
clr ax
repne scasw
pop ax
jne error
;
; Found a slot. Figure what index it is in the array and set
; keyboardNumHotkeys as appropriate..
;
dec di
dec di
sub cx, MAX_HOTKEYS
neg cx
cmp cx, ds:[keyboardNumHotkeys]
jbe haveSlot
mov ds:[keyboardNumHotkeys], cx
haveSlot:
;
; Set flag indicating that we have hotkey
;
cmp ax, SCANCODE_ILLEGAL
jne haveHotkey
ORNF ds:[kbdHotkeyFlags], mask KHF_ALL_HOTKEY
haveHotkey:
ORNF ds:[kbdHotkeyFlags], mask KHF_HAVE_HOTKEY
;
; Store the combination and the action descriptor in their respective
; arrays.
;
INT_OFF
mov ds:[di], ax
mov ds:[di][keyboardADHandles-keyboardHotkeys], bx
mov ds:[di][keyboardADChunks-keyboardHotkeys], si
mov ds:[di][keyboardADMessages-keyboardHotkeys], bp
INT_ON
clc
done:
.leave
ret
error:
stc
jmp done
KbdAddHotkeyLow endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdDelHotkeyLow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Nuke a hotkey from the table
CALLED BY: KbdDelHotkey via KbdAddDelHotkeyCommon
PASS: ax -> ShiftState/scanc code pair
ds:di -> slot i table where it may be found;
di = 0 if not there.
RETURN: carry set to stop enumerating scan codes
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
kliu 7/17/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdDelHotkeyLow proc near
.enter
tst di
jz done ; not in table
cmp ax, SCANCODE_ILLEGAL
jne numHotkeys
ANDNF ds:[kbdHotkeyFlags], not (mask KHF_ALL_HOTKEY)
numHotkeys:
dec ds:[keyboardNumHotkeys]
jnz done
ANDNF ds:[kbdHotkeyFlags], not (mask KHF_HAVE_HOTKEY)
done:
.leave
ret
KbdDelHotkeyLow endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdAddDelHotkeyCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Figure all the various modifier/scancode combinations
required to watch for a given modifier/character pair and
call a callback function for each one, after seeing if
the m/s combination is already in the table of known ones.
CALLED BY: KbdAddHotkey, KbdDelHotkey
PASS: ah -> ShiftState
cx -> character (ch = CharacterSet, cl = Chars/VChars)
ds -> dgroup
cs:dx -> near routine to call:
RETURN: carry set if callback returned carry set
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
figure out where we should look for the character (KeyDef or
ExtendedDef) based on the modifiers
foreach entry in the keymap:
if KD_char matches character, ShiftState+current scan
is a combination
else if KD_keyType != KEY_PAD, KEY_SHIFT, KEY_TOGGLE,
KEY_XSHIFT or KEY_XTOGGLE and
appropriate char matches chararcter,
ShiftState+current scan is a combination
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdAddDelHotkeyCommon proc near
uses ds, es, di
.enter
;
; If we get CharacterSet = VC_ISCTRL, and VChars =
; VC_INVALID_KEY, we redirect all keys.
;
SBCS < cmp cx, (VC_ISCTRL shl 8) or VC_INVALID_KEY >
DBCS < cmp cx, C_NOT_A_CHARACTER >
jne normalAddDel
push ax
clr ah ; say we have no ShiftState
call KbdHKFoundScan
pop ax
jmp short done
normalAddDel:
call KbdFigureModifiedCharOffset
MOV_SEG es, ds es <- dgroup
push ax
mov ax, segment InfoResource
mov ds, ax
pop ax
mov di, offset keyDefs
scanLoop:
call KbdHKCheckScan
jnc nextScan
call KbdHKFoundScan
jc done ; => callback returned
; carry set, so stop
nextScan:
add di, size KeyDef
cmp di, offset keyDefs + length keyDefs *size KeyDef
jb scanLoop
done:
.leave
ret
KbdAddDelHotkeyCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdHKCheckScan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See if the character matches this scan code's character.
CALLED BY: KbdAddDelHotkeyCommon
PASS: al -> second offset to check in key definition
cx -> character against which to match
ds:di -> KeyDef to check
es -> dgroup
RETURN: carry set if matches
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdHKCheckScan proc near
uses ax
.enter
;
; Check modified form first.
;
call KbdHKCheckChar
jc done
;
; No match. Try unmodified form.
;
mov al, KD_char
call KbdHKCheckChar
done:
.leave
ret
KbdHKCheckScan endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdHKCheckChar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See if the character matches that generated from a particular
slot within a key definition.
CALLED BY: KbdHKCheckScan
PASS: al -> if b7=0: offset within KeyDef to check
if b7=1: offset within ExtendedDef to check
cx -> character to compare
ds:di -> KeyDef to use
RETURN: carry set if matches
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdHKCheckChar proc near
uses ax, bx, dx, di
.enter
mov ah, ds:[di].KD_keyType
tst ah
jz done ; => scan not valid (carry clear)
;
; If the key is KEY_SOLO, it can never produce any char but
; what's in KD_char (Chars/VChars) and KD_shiftChar (CharacterSet)
;
mov dh, ah
andnf dh, mask KDF_TYPE
cmp dh, KEY_SOLO
jne fetchChar
mov ax, {word}ds:[di].KD_char
jmp compare
fetchChar:
;
; State keys don't good hotkeys make...
;
test ah, mask KDF_STATE_KEY
jnz mismatch
;
; We'll need the offset in bx for fetching a byte...
;
mov bx, ax
andnf bx, 0x7f
;
; Fetch the character from the KeyDef or the ExtendedDef.
;
test al, 0x80 ; requires extended def?
jnz checkExtended
;
; Fetch the char from the key def.
;
mov al, ds:[di][bx]
;
; Figure if it's virtual (ah <- CS_CONTROL) or normal (ah <- CS_BSW):
; KEY_PAD, KEY_MISC
;
SBCS < CheckHack <CS_BSW eq 0> >
clr ah ; assume not virtual
cmp dh, KEY_PAD
je makeVirtual
cmp dh, KEY_MISC
jne compare
makeVirtual:
SBCS < mov ah, CS_CONTROL >
DBCS < mov ah, CS_CONTROL_HB >
jmp compare
checkExtended:
;
; If key has no extended definition, there's nowhere to check.
;
test ah, mask KDF_EXTENDED
jz mismatch
;
; Figure offset of extended entry in KbdExtendedDefTable
;
mov al, ds:[di].KD_extEntry
clr ah
shl ax
shl ax
shl ax
if DBCS_PCGEOS
CheckHack <size ExtendedDef eq 16>
shl ax
else
CheckHack <size ExtendedDef eq 8>
endif
add ax, offset extendedKeyDefs
;
; Fetch the bit that must be set in EDD_charSysFlags for the character
; to be virtual and that must not be set in EDD_charAccents for the
; character to be valid....?
;
mov dl, cs:[hkVirtBits-EDD_ctrlChar][bx]
mov dh, dl
xchg ax, bx
SBCS < and dx, {word}ds:[bx].EDD_charSysFlags >
add bx, ax ; ds:bx <- &char
mov al, ds:[bx]
SBCS < CheckHack <CS_BSW eq 0> >
clr ah ; assume not virtual
tst dl
jnz makeVirtual
compare:
;
; AX is now the Chars/VChars + CharacterSet that would be generated
; from the provided slot in the definition. See if it matches what we
; were asked about.
;
cmp ax, cx
je flipCarry ; => yes; carry is clear, but want it
; set
mismatch:
stc ; ensure carry will be clear when we
; complement it, signalling a mismatch
flipCarry:
cmc
done:
.leave
ret
hkVirtBits ExtVirtualBits mask EVB_CTRL, ; EDD_ctrlChar
mask EVB_SHIFT_CTRL, ; EDD_shiftCtrlChar
mask EVB_ALT, ; EDD_altChar
mask EVB_SHIFT_ALT, ; EDD_shiftAltChar
mask EVB_CTRL_ALT, ; EDD_ctrlAltChar
mask EVB_SHIFT_CTRL_ALT ; EDD_shiftCtrlAltChar
KbdHKCheckChar endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdHKFoundScan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Found a scan code that's acceptable. See if it's in the
table of known hotkeys and call the callback appropriately.
CALLED BY: KbdAddDelHotkeyCommon
PASS: ah -> ShiftState
cx -> character (ch = CharacterSet, cl = Chars/VChars)
ds:di -> KeyDef
cs:dx -> callback routine
es -> dgroup
RETURN: carry set if callback returned carry set
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
callback is called:
Pass: ax = ShiftState/scan code pair
ds:di = slot in table where pair is
located. di is 0 if not already
in the table
es = ds
bx, si, bp as passed to KbdAddDelHotkeyCommon
Return: carry set to stop going through the table
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdHKFoundScan proc near
uses ax, cx, di
.enter
;
; Check character to see if all characters need to be redirected
;
mov al, SCANCODE_ILLEGAL
SBCS < cmp cx, (VC_ISCTRL shl 8) or VC_INVALID_KEY >
DBCS < cmp cx, C_NOT_A_CHARACTER >
je haveScanCode
;
; Figure the scan code. We subtract size KeyDef from the start of
; KbdKeyDefTable since scan codes start at 1.
;
sub di, offset keyDefs-size KeyDef
shr di
shr di
if DBCS_PCGEOS
CheckHack <size KeyDef eq 8>
shl di
else
CheckHack <size KeyDef eq 4>
endif
;
; Put the scan code into al.
;
mov cx, di
mov al, cl
haveScanCode:
;
; Now see if the thing's already in the table.
;
mov di, offset keyboardHotkeys
segmov ds, es
mov cx, ds:[keyboardNumHotkeys]
jcxz notInTable
repne scasw
lea di, ds:[di-2]
je callCallback
notInTable:
clr di
callCallback:
call dx
.leave
ret
KbdHKFoundScan endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KbdFigureModifiedCharOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Figure the offset of the place to look for the character
within a key definition, given the set of modifiers to
be applied.
CALLED BY: KbdAddDelHotkeyCommon
PASS: ah -> ShiftState
RETURN: al <- if b7 is 0:
offset of slot in KeyDef to check
if b7 is 1:
offset of slot in ExtendedDef to check
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KbdFigureModifiedCharOffset proc near
.enter
;
; Assume no modifiers.
;
mov al, offset KD_char
tst ah
jz done
test ah, mask SS_LSHIFT or mask SS_RSHIFT
jz notShifted
mov al, offset KD_shiftChar ; assume just shift
test ah, mask SS_LCTRL or mask SS_RCTRL
jz notShiftCtrl
mov al, offset EDD_shiftCtrlChar or 0x80
test ah, mask SS_LALT or mask SS_RALT
jz done
mov al, offset EDD_shiftCtrlAltChar or 0x80
jmp done
notShiftCtrl:
test ah, mask SS_LALT or mask SS_RALT
jz done ; => just shift
mov al, offset EDD_shiftAltChar or 0x80
jmp done
notShifted:
mov al, offset EDD_altChar or 0x80
test ah, mask SS_LCTRL or mask SS_RCTRL
jz done
mov al, offset EDD_ctrlChar or 0x80
test ah, mask SS_LALT or mask SS_RALT
jz done
mov al, offset EDD_ctrlAltChar or 0x80
done:
.leave
ret
KbdFigureModifiedCharOffset endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HWKeyboardCheckHotkey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: GDIKeyboardCheckHotkey
PASS: al -> ShiftState
bx -> scancode
RETURN: ax <- KeyboardErrorCode
carry set if key processed
carry clear if key not processed
DESTROYED: bx, ds, es, dx, cx, di, si
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
kliu 7/17/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
HWKeyboardCheckHotkey proc near
.enter
if not NT_DRIVER
mov ah, al ; ah <- ShiftState
mov_tr al, bl ; al <- scancode (PC's
; scancode is a byte)
mov bl, ah ; store shiftState in bl
mov dx, segment dgroup
mov ds, dx ; ds <- dgroup
MOV_SEG es, ds
test ds:[kbdHotkeyFlags], mask KHF_HAVE_HOTKEY
jz done
push ax
mov cx, ds:[keyboardNumHotkeys]
mov di, offset keyboardHotkeys
test ds:[kbdHotkeyFlags], mask KHF_ALL_HOTKEY
jz search
mov ax, SCANCODE_ILLEGAL ; search for special
; key
search:
repne scasw
pop ax
clc
jne done
;
; Pass the scan code and shift state in the message.
;
mov ah, bl
mov_tr cx, ax ; cx = <ShiftState,
; scan code>
;
; Found a match. Disable the keyboard interface so the keyboard
; continues to store scan codes, but can't send them to
; us, thereby keeping the scancode in the keyboard data
; latch for the interested external party to read.
;
tst ds:[isXTKeyboard]
jnz disableXT
mov al, KBD_CMD_DISABLE_INTERFACE
out KBD_COMMAND_PORT, al
jmp sendNotification
disableXT:
in al, KBD_PC_CTRL_PORT
andnf al, not mask XP61_KBD_DISABLE
out KBD_PC_CTRL_PORT, al
sendNotification:
;
; Flag the hotkey as pending so we know to keep tht
; interface disabled if we suspend
;
ornf ds:[kbdHotkeyFlags], mask KHF_HOTKEY_PENDING
;
; Load up the notification message and queue it.
;
mov bx, ds:[di-2][keyboardADHandles-keyboardHotkeys]
mov si, ds:[di-2][keyboardADChunks-keyboardHotkeys]
mov ax, ds:[di-2][keyboardADMessages-keyboardHotkeys]
mov di, mask MF_FORCE_QUEUE
call ObjMessage
stc
done:
endif
mov ax, EC_NO_ERROR
clc
.leave
ret
HWKeyboardCheckHotkey endp
CallbackCode ends
|
src/test/ref/for-empty-increment.asm | jbrandwood/kickc | 2 | 96712 | <filename>src/test/ref/for-empty-increment.asm
// Tests that for()-loops can have empty increments
// Commodore 64 PRG executable file
.file [name="for-empty-increment.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.segment Code
main: {
.label SCREEN = $400
ldx #0
__b1:
// for(unsigned char i=0;i<10;)
cpx #$a
bcc __b2
// }
rts
__b2:
// SCREEN[i] = i++
txa
sta SCREEN,x
// SCREEN[i] = i++;
inx
jmp __b1
}
|
lab09/0-fibo/fibo.asm | adinasm/iocla-demos | 0 | 24208 | %include "../utils/printf32.asm"
%define NUM_FIBO 10
section .text
extern printf
global main
main:
mov ebp, esp
; TODO - replace below instruction with the algorithm for the Fibonacci sequence
sub esp, NUM_FIBO * 4
mov ecx, NUM_FIBO
print:
mov eax, dword [esp + (ecx - 1) * 4]
PRINTF32 `%d \x0`, eax
dec ecx
cmp ecx, 0
ja print
PRINTF32 `\n\x0`
mov esp, ebp
xor eax, eax
ret
|
programs/oeis/152/A152114.asm | neoneye/loda | 22 | 14999 | <reponame>neoneye/loda
; A152114: Numbers a(n) are obtained by the application of an algorithm which is similar to sieve of Eratosthenes for A000045: retaining A000045(3)=2, we delete all multiples of 2, which are more than 2; retaining A000045(4)=3, we delete all multiples of 3, which are more than 3, etc.
; 2,3,5,13,89,233,1597,4181,28657,514229,1346269,24157817,165580141,433494437,2971215073,53316291173,956722026041,2504730781961,44945570212853,308061521170129,806515533049393,14472334024676221,99194853094755497,1779979416004714189
seq $0,40 ; The prime numbers.
seq $0,22086 ; Fibonacci sequence beginning 0, 3.
sub $0,8
div $0,3
add $0,3
|
Tyme/Tyme-to-OmniFocus/tyme3_applescript_hooks.scpt | zdong1995/OmniFocus-Tyme-Script | 30 | 3588 | <gh_stars>10-100
(*
Applescript hook for Tyme to automate with OmniFocus. For each task you completed in Tyme,
the script will automatically complete the task with same name in OmniFocus, and then update
the task name with a pair of time: real spend time / planned time.
Copyright © 2020 <NAME>
Licensed under MIT License
*)
on taskCompletedChanged(tskid)
tell application "Tyme"
set spent to 0.0
GetTaskRecordIDs startDate ((current date) - (168 * 60 * 60)) endDate (current date) taskID tskid
set fetchedRecords to fetchedTaskRecordIDs as list
repeat with recordID in fetchedRecords
GetRecordWithID recordID
set duration to timedDuration of lastFetchedTaskRecord
set spent to (spent + duration / 3600)
end repeat
set spent to (round (spent * 10)) / 10
set tsk to the first item of (every task of every project whose id = tskid)
set prj to the first item of (every project whose id = (relatedProjectID of tsk))
set pname to name of prj
set tname to name of tsk
tell application "OmniFocus"
tell default document
set opro to the first item of (flattened projects whose name is pname)
set otsk to the first item of ((flattened tasks of opro) whose name is tname)
mark complete otsk
set plan to estimated minutes of otsk
set name of otsk to (name of otsk & " ✅ " & spent as string) & " / " & (plan / 60) as string
end tell
end tell
end tell
end taskCompletedChanged
|
oeis/121/A121693.asm | neoneye/loda-programs | 11 | 175542 | ; A121693: Number of deco polyominoes of height n and vertical height 3 (i.e., having 3 rows).
; Submitted by <NAME>
; 0,0,1,12,57,216,741,2412,7617,23616,72381,220212,666777,2012616,6062421,18236412,54807537,164619216,494250861,1483539012,4452189897,13359715416,40085437701,120268896012,360831853857,1082545893216
lpb $0
sub $0,1
add $1,$3
mul $2,2
mov $3,2
add $3,$2
mov $2,$1
sub $3,1
max $4,1
add $4,1
mul $4,2
add $2,$4
add $2,$3
lpe
mov $0,$1
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1427.asm | ljhsiun2/medusa | 9 | 101298 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xdff9, %r10
nop
nop
nop
nop
nop
sub %rax, %rax
and $0xffffffffffffffc0, %r10
movaps (%r10), %xmm2
vpextrq $1, %xmm2, %r9
add $1528, %rdi
lea addresses_UC_ht+0x8d9, %rsi
lea addresses_normal_ht+0x1a5f9, %rdi
nop
nop
nop
nop
sub %r13, %r13
mov $21, %rcx
rep movsq
nop
nop
nop
nop
and $33220, %rsi
lea addresses_D_ht+0x1bb59, %rsi
lea addresses_WC_ht+0xd399, %rdi
clflush (%rsi)
nop
nop
nop
nop
cmp $60892, %r12
mov $83, %rcx
rep movsb
nop
nop
nop
xor %rcx, %rcx
lea addresses_WT_ht+0xa4b9, %rsi
lea addresses_UC_ht+0x1d2d9, %rdi
sub %r9, %r9
mov $73, %rcx
rep movsl
nop
inc %r13
lea addresses_normal_ht+0x112d9, %rcx
nop
cmp $15422, %rsi
movl $0x61626364, (%rcx)
nop
nop
nop
add $52588, %r12
lea addresses_UC_ht+0x8821, %rcx
nop
nop
nop
nop
nop
and $32437, %r13
mov (%rcx), %r9
nop
nop
nop
add %rdi, %rdi
lea addresses_D_ht+0x13e09, %rsi
nop
xor %r12, %r12
movw $0x6162, (%rsi)
xor %r13, %r13
lea addresses_A_ht+0x175ad, %r10
nop
nop
nop
nop
nop
and $2842, %rax
mov $0x6162636465666768, %r13
movq %r13, %xmm2
movups %xmm2, (%r10)
nop
nop
nop
add $62677, %r9
lea addresses_WC_ht+0x1c2e, %rsi
lea addresses_A_ht+0x15179, %rdi
nop
nop
nop
nop
nop
cmp $60643, %r9
mov $89, %rcx
rep movsl
nop
nop
nop
add $16038, %r10
lea addresses_WT_ht+0xfb1, %rsi
lea addresses_A_ht+0x5ad9, %rdi
clflush (%rsi)
clflush (%rdi)
nop
add %r9, %r9
mov $43, %rcx
rep movsw
nop
nop
nop
nop
and $21565, %r13
lea addresses_normal_ht+0x1aba9, %rsi
nop
nop
nop
nop
sub $5100, %r9
mov (%rsi), %cx
add %rsi, %rsi
lea addresses_normal_ht+0xead9, %rsi
lea addresses_WT_ht+0x54d9, %rdi
cmp %r12, %r12
mov $103, %rcx
rep movsw
nop
nop
nop
nop
dec %rax
lea addresses_WC_ht+0x20d9, %r9
nop
nop
and $47045, %rsi
movb (%r9), %cl
nop
cmp $27034, %r12
lea addresses_UC_ht+0x5ed9, %rsi
nop
sub $46765, %r9
and $0xffffffffffffffc0, %rsi
vmovaps (%rsi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r12
nop
sub %r9, %r9
lea addresses_D_ht+0xe6d9, %rax
nop
inc %r12
mov (%rax), %cx
nop
nop
and $14860, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r8
push %rbx
push %rcx
push %rsi
// Store
lea addresses_PSE+0xe4c1, %rsi
and %r15, %r15
movw $0x5152, (%rsi)
nop
sub %r15, %r15
// Store
lea addresses_WT+0x17739, %r8
nop
and %r10, %r10
mov $0x5152535455565758, %r12
movq %r12, %xmm5
vmovups %ymm5, (%r8)
// Exception!!!
nop
nop
mov (0), %rcx
nop
nop
nop
inc %rcx
// Faulty Load
lea addresses_RW+0x9ad9, %rsi
nop
nop
nop
sub $48466, %rcx
mov (%rsi), %r8
lea oracles, %r10
and $0xff, %r8
shlq $12, %r8
mov (%r10,%r8,1), %r8
pop %rsi
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'size': 16, 'NT': False, 'same': True, 'congruent': 2}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 2}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': True}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
tests/fn_le/5.asm | NullMember/customasm | 414 | 246927 | #d le(0x00ff) ; = 0xff00 |
programs/oeis/163/A163095.asm | neoneye/loda | 22 | 95120 | ; A163095: a(n) = A000788(n)^2.
; 0,1,4,16,25,49,81,144,169,225,289,400,484,625,784,1024,1089,1225,1369,1600,1764,2025,2304,2704,2916,3249,3600,4096,4489,5041,5625,6400,6561,6889,7225,7744,8100,8649,9216,10000,10404,11025,11664,12544,13225
seq $0,788 ; Total number of 1's in binary expansions of 0, ..., n.
pow $0,2
|
Applications/VLC/mute/mute.applescript | looking-for-a-job/applescript-examples | 1 | 1742 | #!/usr/bin/osascript
tell application "VLC"
mute
end tell
|
test/Fail/ColistMutual.agda | alhassy/agda | 3 | 982 | <filename>test/Fail/ColistMutual.agda
-- {-# OPTIONS -v term:30 #-}
{-# OPTIONS --copatterns #-}
module ColistMutual where
mutual
data CoList (A : Set) : Set where
[] : CoList A
_∷_ : (x : A)(xs : ∞CoList A) → CoList A
record ∞CoList (A : Set) : Set where
coinductive
field out : CoList A
open ∞CoList
mutual
repeat : {A : Set}(a : A) → CoList A
repeat a = a ∷ ∞repeat a
∞repeat : {A : Set}(a : A) → ∞CoList A
out (∞repeat a) = repeat a
-- example by <NAME> Nisse, PAR 2010
data Tree : Set where
node : CoList Tree → Tree
mutual
bad : Tree
bad = node (node [] ∷ bads)
bads : ∞CoList Tree
out bads = bad ∷ bads
-- should not termination check
CRASH -- TODO fix termination checker
{-
data Bool : Set where
true false : Bool
mutual
shape : Tree → Bool
shape (node []) = false
shape (node (_ ∷ l)) = shapes (out l)
shapes : CoList Tree → Bool
shapes [] = false
shapes (t ∷ _) = shape t
-- shape/shapes may not termination check
-}
|
dev/driver/driver.asm | minblock/msdos | 0 | 23620 | ;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
PAGE 64,132
;
; External block device driver
; Hooks into existing routines in IBMBIO block driver via Int 2F mpx # 8.
; This technique minimizes the size of the driver.
;
; Revised Try_h: to test for flagheads as msg was being displayed on bds_formfactor
; this caused the bds_formfactor to be set in the Head
; Revised the # of sectors/cluster for F0h to 1
;
; Revision History
; ================
;
; M000 SR 10/19/90 Changed F_Val to handle the formfactor
; value 9 for 2.88M media.
;
;
code segment byte public
assume cs:code,ds:code,es:code
;
.xlist
include SYSMSG.INC ;equates and macros
.list
MSG_UTILNAME <DRIVER>
iTEST = 0
;---------------------------------------------------
;
; Device entry point
;
DSKDEV LABEL WORD
DW -1,-1 ; link to next device
DW 0000100001000000B ; bit 6 indicates DOS 3.20 driver
DW STRATEGY
DW DSK$IN
DRVMAX DB 1
;
; Various equates
;
CMDLEN equ 0 ;LENGTH OF THIS COMMAND
UNIT equ 1 ;SUB UNIT SPECIFIER
CMD equ 2 ;COMMAND CODE
STATUS equ 3 ;STATUS
MEDIA equ 13 ;MEDIA DESCRIPTOR
TRANS equ 14 ;TRANSFER ADDRESS
COUNT equ 18 ;COUNT OF BLOCKS OR CHARACTERS
START equ 20 ;FIRST BLOCK TO TRANSFER
EXTRA equ 22 ;Usually a pointer to Vol Id for error 15
CONFIG_ERRMSG equ 23 ; To set this field to Non-zero
; to display "Error in CONFIG.SYS..."
PTRSAV DD 0
STRATP PROC FAR
STRATEGY:
MOV WORD PTR CS:[PTRSAV],BX
MOV WORD PTR CS:[PTRSAV+2],ES
RET
STRATP ENDP
DSK$IN:
push es
push bx
push ax
les bx,cs:[ptrsav]
cmp byte ptr es:[bx].cmd,0
jnz Not_Init
jmp DSK$INIT
not_init:
; Because we are passing the call onto the block driver in IBMBIO, we need to
; ensure that the unit number corresponds to the logical (DOS) unit number, as
; opposed to the one that is relevant to this device driver.
mov al,byte ptr cs:[DOS_Drive_Letter]
mov byte ptr es:[bx].UNIT,al
mov ax,0802H
int 2fH
;
; We need to preserve the flags that are returned by IBMBIO. YUK!!!!!
;
pushf
pop bx
add sp,2
push bx
popf
exitp proc far
DOS_Exit:
pop ax
POP BX
POP ES
RET ;RESTORE REGS AND RETURN
EXITP ENDP
TINY_BPB = 1 ; use short form of bpb.inc
TINY_BDS = 1 ; use short form of msbds.inc
include bpb.inc ; include BPB structure
include msbds.inc ; include BDS structures
BDS DW -1 ;Link to next structure
DW -1
DB 1 ;Int 13 Drive Number
DB 3 ;Logical Drive Letter
FDRIVE:
DW 512 ;Physical sector size in bytes
DB -1 ;Sectors/allocation unit
DW 1 ;Reserved sectors for DOS
DB 2 ;No. allocation tables
DW 64 ;Number directory entries
DW 9*40 ;Number sectors (at 512 bytes ea.)
DB 00000000B ;Media descriptor, initially 00H.
DW 2 ;Number of FAT sectors
DW 9 ;Sector limit
DW 1 ;Head limit
DW 0 ;Hidden sector count
dw 0 ; Hidden sector count (High)
dw 0 ; Number sectors (low)
dw 0 ; Number sectors (high)
DB 0 ; TRUE => Large fats
OPCNT1 DW 0 ;Open Ref. Count
DB 2 ;Form factor
FLAGS1 DW 0020H ;Various flags
DW 80 ;Number of cylinders in device
RecBPB1 DW 512 ; default is that of 3.5" disk
DB 2
DW 1
DB 2
DW 70h
DW 2*9*80
DB 0F9H
DW 3
DW 9
DW 2
DW 0
dw 0
dw 0
dw 0
db 6 dup (0) ;AC000;
TRACK1 DB -1 ;Last track accessed on this drive
TIM_LO1 DW -1 ;Keep these two contiguous (?)
TIM_HI1 DW -1
VOLID1 DB "NO NAME ",0 ;Volume ID for this disk
VOLSER dd 0
FILE_ID db "FAT12 ",0 ;
DOS_Drive_Letter db ? ; Logical drive associated with this unit
ENDCODE LABEL WORD ; Everything below this is thrown away
; after initialisation.
DskDrv dw offset FDRIVE ; "array" of BPBs
; For system parser;
FarSW equ 0 ; Near call expected
DateSW equ 0 ; Check date format
TimeSW equ 0 ; Check time format
FileSW equ 0 ; Check file specification
CAPSW equ 0 ; Perform CAPS if specified
CmpxSW equ 0 ; Check complex list
NumSW equ 1 ; Check numeric value
KeySW equ 0 ; Support keywords
SwSW equ 1 ; Support switches
Val1SW equ 1 ; Support value definition 1
Val2SW equ 1 ; Support value definition 2
Val3SW equ 0 ; Support value definition 3
DrvSW equ 0 ; Support drive only format
QusSW equ 0 ; Support quoted string format
;---------------------------------------------------
;.xlist
assume ds:nothing ;!!!Parse.ASM sometimes assumes DS
; to access its own variable!!!
include version.inc
include PARSE.ASM ;together with PSDATA.INC
assume ds:code
;.list
;Control block definitions for PARSER.
;---------------------------------------------------
Parms label byte
dw Parmsx
db 0 ;No extras
Parmsx label byte
db 0,0 ;No positionals
db 5 ;5 switch control definitions
dw D_Control ;/D
dw T_Control ;/T
dw HS_Control ;/H, /S
dw CN_Control ;/C, /N
dw F_Control ;/F
db 0 ;no keywords
D_Control label word
dw 8000h ;numeric value
dw 0 ;no functions
dw Result_Val ;result buffer
dw D_Val ;value defintions
db 1 ;# of switch in the following list
Switch_D label byte
db '/D',0 ;
D_Val label byte
db 1 ;# of value defintions
db 1 ;# of ranges
db 1 ;Tag value when match
; dd 0,255 ;
dd 0,127 ;Do not allow a Fixed disk.
Result_Val label byte
db ?
Item_Tag label byte
db ?
Synonym_ptr label word
dw ? ;es:offset -> found Synonym
RV_Byte label byte
RV_Word label word
RV_Dword label dword
dd ? ;value if number, or seg:off to string
T_Control label word
dw 8000h ;numeric value
dw 0 ;no functions
dw Result_Val ;result buffer
dw T_Val ;value defintions
db 1 ;# of switch in the following list
Switch_T label byte
db '/T',0 ;
T_Val label byte
db 1 ;# of value defintions
db 1 ;# of ranges
db 1 ;Tag value when match
dd 1,999
HS_Control label word
dw 8000h ;numeric value
dw 0 ;no function flag
dw Result_Val ;Result_buffer
dw HS_VAL ;value definition
db 2 ;# of switch in following list
Switch_H label byte
db '/H',0 ;
Switch_S label byte
db '/S',0 ;
HS_Val label byte
db 1 ;# of value defintions
db 1 ;# of ranges
db 1 ;Tag value when match
dd 1,99
CN_Control label word
dw 0 ;no match flags
dw 0 ;no function flag
dw Result_Val ;no values returned
dw NoVal ;no value definition
; db 2 ;# of switch in following list
db 1
Switch_C label byte
db '/C',0 ;
;Switch_N label byte ;
; db '/N',0 ;
Noval db 0
F_Control label word
dw 8000h ;numeric value
dw 0 ;no function flag
dw Result_Val ;Result_buffer
dw F_VAL ;value definition
db 1 ;# of switch in following list
Switch_F label byte
db '/F',0 ;
F_Val label byte
db 2 ;# of value definitions (Order dependent)
db 0 ;no ranges
db 5 ;# of numeric choices ;M000; 5 now
F_Choices label byte
db 1 ;1st choice (item tag)
dd 0 ;0
db 2 ;2nd choice
dd 1 ;1
db 3 ;3rd choice
dd 2 ;2
db 4 ;4th choice
dd 7 ;7
db 5 ;5th choice ;M000
dd 9 ;9 ;M000
;System messages handler data
;Put the data here
.sall
MSG_SERVICES <MSGDATA>
;Place the messages here
MSG_SERVICES <DRIVER.CL1, DRIVER.CL2, DRIVER.CLA>
;Put messages handler code here.
MSG_SERVICES <LOADmsg,DISPLAYmsg,CHARmsg>
.xall
;
; Sets ds:di -> BDS for this drive
;
SetDrive:
push cs
pop ds
mov di,offset BDS
ret
;
; Place for DSK$INIT to exit
;
ERR$EXIT:
MOV AH,10000001B ;MARK ERROR RETURN
lds bx, cs:[ptrsav]
mov byte ptr ds:[bx.MEDIA], 0 ; # of units
mov word ptr ds:[bx.CONFIG_ERRMSG], -1 ;Show IBMBIO error message too.
JMP SHORT ERR1
Public EXIT
EXIT: MOV AH,00000001B
ERR1: LDS BX,CS:[PTRSAV]
MOV WORD PTR [BX].STATUS,AX ;MARK OPERATION COMPLETE
RestoreRegsAndReturn:
POP DS
POP BP
POP DI
POP DX
POP CX
POP AX
POP SI
jmp dos_exit
drivenumb db 5
cyln dw 80
heads dw 2
ffactor db 2
slim dw 9
Switches dw 0
Drive_Let_Sublist label dword
db 11 ;length of this table
db 0 ;reserved
dw D_Letter;
D_Seg dw ? ;Segment value. Should be CS
db 1 ;DRIVER.SYS has only %1
db 00000000b ;left align(in fact, Don't care), a character.
db 1 ;max field width 1
db 1 ;min field width 1
db ' ' ;character for pad field (Don't care).
D_Letter db "A"
if iTEST
Message:
push ax
push ds
push cs
pop ds
mov ah,9
int 21h
pop ds
pop ax
ret
extrn nodrive:byte,loadokmsg:byte,letter:byte, badvermsg:byte
endif
if iTEST
%OUT Testing On
initmsg db "Initializing device driver",13,10,"$"
stratmsg db "In strategy of driver",10,13,"$"
dskinmsg db "In DSKIN part of driver",10,13,"$"
outinitmsg db "Out of init code ",10,13,"$"
exitmsg db "Exiting from driver",10,13,"$"
parsemsg db "Parsing switches",10,13,"$"
errmsg db "Error occurred",10,13,"$"
linemsg db "Parsed line",10,13,"$"
int2fokmsg db "****************Int2f loaded**************",10,13,"$"
mediamsg db "Media check ok",10,13,"$"
getbpbmsg db "getbpb ok",10,13,"$"
iookmsg db "Successful I/O",10,13,"$"
parseokmsg db "Parsing done fine",10,13,"$"
nummsg db "Number read is "
number db "00 ",10,13,"$"
drvmsg db "Process drive "
driven db "0",10,13,"$"
cylnmsg db "Process cylinder ",10,13,"$"
slimmsg db "Process sec/trk ",10,13,"$"
hdmsg db "Process head "
hdnum db "0",10,13,"$"
ffmsg db "Process form factor "
ffnum db "0",10,13,"$"
nxtmsg db "Next switch ",10,13,"$"
msg48tpi db "Got a 48 tpi drive",10,13,"$"
ENDIF
DSK$INIT:
PUSH SI
PUSH AX
PUSH CX
PUSH DX
PUSH DI
PUSH BP
PUSH DS
LDS BX,CS:[PTRSAV] ;GET POINTER TO I/O PACKET
MOV AL,BYTE PTR DS:[BX].UNIT ;AL = UNIT CODE
MOV AH,BYTE PTR DS:[BX].MEDIA ;AH = MEDIA DESCRIP
MOV CX,WORD PTR DS:[BX].COUNT ;CX = COUNT
MOV DX,WORD PTR DS:[BX].START ;DX = START SECTOR
LES DI,DWORD PTR DS:[BX].TRANS
PUSH CS
POP DS
ASSUME DS:CODE
cld
push cs ; Initialize Segment of Sub list.
pop [D_Seg]
call SYSLOADMSG ; linitialize message handler
jnc GoodVer ; Error. Do not install driver.
mov cx, 0 ; No substitution
mov dh, -1 ; Utility message
call Show_Message ; Show message
jmp short err$exitj2 ; and exit
;; check for correct DOS version
; mov ah,30h
; int 21H
; cmp ax,expected_version
; je GoodVer
; cmp al,DOSVER_HI
; jnz BadDOSVer
; cmp ah,DOSVER_LO
; jz GoodVer
;BadDOSVer:
; Mov dx,offset BadVerMsg
; call message
; jmp err$exitj2 ; do not install driver
GoodVer:
mov ax,0800H
int 2fH ; see if installed
cmp al,0FFH
jnz err$exitj2 ; do not install driver if not present
lds bx,[ptrsav]
mov si,word ptr [bx].count ; get pointer to line to be parsed
mov ax,word ptr [bx].count+2
mov ds,ax
call Skip_Over_Name ; skip over file name of driver
mov di,offset BDS ; point to BDS for drive
push cs
pop es ; es:di -> BDS
Call ParseLine
jc err$exitj2
LDS BX,cs:[PTRSAV]
mov al,byte ptr [bx].extra ; get DOS drive letter
mov byte ptr es:[di].bds_drivelet,al
mov cs:[DOS_Drive_Letter],al
add al,"A"
; mov cs:[letter],al ; set up for printing final message
mov cs:[D_Letter], al
call SetDrvParms ; Set up BDS according to switches
jc err$exitj2
mov ah,8 ; Int 2f multiplex number
mov al,1 ; install the BDS into the list
push cs
pop ds ; ds:di -> BDS for drive
mov di,offset BDS
int 2FH
lds bx,dword ptr cs:[ptrsav]
mov ah,1
mov cs:[DRVMAX],ah
mov byte ptr [bx].media,ah
mov ax,offset ENDCODE
mov word ptr [bx].TRANS,AX ; set address of end of code
mov word ptr [bx].TRANS+2,CS
mov word ptr [bx].count,offset DskDrv
mov word ptr [bx].count+2,cs
push dx
push cs
pop ds
mov si, offset Drive_Let_SubList ;AC000;
mov ax, LOADOK_MSG_NUM ;load ok message
mov cx, 1 ; 1 substitution
mov dh, -1 ; utility message
call Show_Message
; mov dx,offset loadokmsg
; call message
pop dx
jmp EXIT
err$exitj2:
stc
jmp err$exit
;
; Skips over characters at ds:si until it hits a `/` which indicates a switch
; J.K. If it hits 0Ah or 0Dh, then will return with SI points to that character.
Skip_Over_Name:
call scanblanks
loop_name:
lodsb
cmp al,CR
je End_SkipName
cmp al,LF
je End_SkipName
cmp al,'/'
jnz loop_name
End_SkipName:
dec si ; go back one character
RET
;ParseLine:
; push di
; push ds
; push si
; push es
;Next_Swt:
;IF iTEST
; mov dx,offset nxtmsg
; call message
;ENDIF
; call ScanBlanks
; lodsb
; cmp al,'/'
; jz getparm
; cmp al,13 ; carriage return
; jz done_line
; CMP AL,10 ; line feed
; jz done_line
; cmp al,0 ; null string
; jz done_line
; mov ax,-2 ; mark error invalid-character-in-input
; stc
; jmp short exitparse
;
;getparm:
; call Check_Switch
; mov cs:Switches,BX ; save switches read so far
; jnc Next_Swt
; cmp ax,-1 ; mark error number-too-large
; stc
; jz exitparse
; mov ax,-2 ; mark invalid parameter
; stc
; jmp short exitparse
;
;done_line:
; test cs:Switches,flagdrive ; see if drive specified
; jnz okay
; push dx
; mov ax, 2
; call Show_Message
; mov dx,offset nodrive
; call message
; pop dx
; mov ax,-3 ; mark error no-drive-specified
; stc
; jmp short exitparse
;
;okay:
; call SetDrive ; ds:di points to BDS now.
; mov ax,cs:Switches
; and ax,fChangeline+fNon_Removable ; get switches for Non_Removable and Changeline
; or ds:[di].flags,ax
; xor ax,ax ; everything is fine
;
;;
;; Can detect status of parsing by examining value in AX.
;; 0 ==> Successful
;; -1 ==> Number too large
;; -2 ==> Invalid character in input
;; -3 ==> No drive specified
;
; clc
;exitparse:
; pop es
; pop si
; pop ds
; pop di
; ret
ParseLine proc near
;In) DS:SI -> Input string
; ES = CS
; ES:DI -> BDS table inside this program
;
;Out)
; if successfule, then { AX will be set according to the switch
; flag value. BDS.Flag, Drivenumb, cylin,
; slim, heads ffactor are set }
; else
; {
; If (no drive specified) then { display messages };
; Set carry;
; }
;
;Subroutine to be called:
; SYSPARSE:NEAR, SHOW_MESSAGE:NEAR, GET_RESULT:NEAR
;
;Logic:
;{ While (Not end_of_Line)
; {
; SYSPARSE ();
; if (no error) then
; GET_RESULT ()
; else
; Set carry;
; };
;
; if (carry set) then Exit; /* Initialization failed */
; if (No drive number entered) /* Drive number is a requirement */
; then { Show_Message ();
; exit;
; };
;
assume ds:nothing ;make sure
push di ;save BDS pointer
mov di, offset PARMS ;now, es:di -> parse control definition
SysP_While:
xor cx, cx ; I don't have positionals.
xor dx, dx
call SYSPARSE
cmp ax, $P_RC_EOL ;end of line?
je SysP_End
cmp ax, $P_NO_ERROR ;no error?
jne SysP_Fail
call Get_Result
jmp SysP_While
SysP_End:
test Switches, FLAGDRIVE ;drive number specified?
jnz SysP_Ok ;Drive number is a requirement
push ds
mov ax, NODRIVE_MSG_NUM ;no drive specification
mov cx, 0 ;no substitutions
mov dh, -1 ;utility message
call Show_Message
pop ds
jmp short SysP_Err
SysP_Fail:
mov dh, 2 ; parse error
mov cx, 0
call Show_Message ; Show parse error
SysP_Err:
stc
jmp short PL_Ret
SysP_Ok:
clc
PL_Ret:
pop di ;restore BDS pointer
ret
ParseLine endp
;
Get_Result proc near
;In) A successful result of SYSPARSE in Result_Val
; es = cs, ds = command line segment
;Out)
; Switches set according to the user option.
; Drivenumb, Cyln, Heads, Slim, ffactor set if specified.
;Logic)
; Switch (Synonym_Ptr)
; { case Switch_D: Switches = Switches | FLAGDRIVE; /* Set switches */
; Drivenumb = Reg_DX.Value_L;
; break;
;
; case Switch_T: Switches = Switches | Flagcyln;
; Cyln = Reg_DX.Value_L;
; break;
;
; case Switch_H: Switches = Switches | Flagheads;
; Heads = Reg_DX.Value_L;
; break;
;
; case Switch_S: Switches = Switches | FlagSecLim;
; Slim = Reg_DX.Value_L;
; break;
;
; case Switch_C: Switches = Switches | fChangeline;
; break;
;
;; case Switch_N: Switches = Switches | fNon_Removable;
;; break;
;
; case Switch_F: Switches = Switches | Flagff;
; Reg_DX = (Reg_DX.ITEM_Tag - 1)*5;/*Get the offset of
; /*the choice.
; ffactor = byte ptr (F_Choices + DX + 1);
; /*Get the value of it */
; break;
;
; }
;
mov ax, Synonym_Ptr
push ax ; save Synonym_ptr
cmp ax, offset Switch_D
jne Stch_T
or Switches, FLAGDRIVE
mov al, RV_Byte
mov Drivenumb, al
jmp short GR_Ret
Stch_T:
cmp ax, offset Switch_T
jne Stch_H
or Switches, FLAGCYLN
mov ax, RV_Word
mov Cyln, ax
jmp short GR_Ret
Stch_H:
cmp ax, offset Switch_H
jne Stch_S
or Switches, FLAGHEADS
mov ax, RV_Word
mov Heads, ax
jmp short GR_Ret
Stch_S:
cmp ax, offset Switch_S
jne Stch_C
or Switches, FLAGSECLIM
mov ax, RV_Word
mov Slim, ax
jmp short GR_Ret
Stch_C:
cmp ax, offset Switch_C
; jne Stch_N ;
jne Stch_F
or Switches, fCHANGELINE
jmp short GR_Ret
;Stch_N: ;
; cmp ax, offset Switch_N ;
; jne Stch_F ;
; or Switches, fNON_REMOVABLE ;
; jmp GR_Ret ;
Stch_F:
cmp ax, offset Switch_F
jne GR_Not_Found_Ret ;error in SYSPARSE
or Switches, FLAGFF
push si
mov si, offset F_Choices
xor ax, ax
mov al, Item_Tag
dec al
mov cl, 5
mul cl
add si, ax
mov al, byte ptr es:[si+1] ;get the result of choices
mov ffactor, al ;set form factor
pop si
GR_Ret:
pop ax ; Restore Synonym ptr
push di ; Save di
push ax
pop di
mov byte ptr es:[di], ' ' ;We don't have this switch any more.
pop di
jmp short Gr_Done_Ret
GR_Not_Found_Ret:
pop ax ;adjust stack
GR_Done_Ret:
ret
Get_Result endp
;
; Scans an input line for blank or tab characters. On return, the line pointer
; will be pointing to the next non-blank character.
;
ScanBlanks:
lodsb
cmp al,' '
jz ScanBlanks
cmp al,9 ; Tab character
jz ScanBlanks
dec si
ret
;
; Gets a number from the input stream, reading it as a string of characters.
; It returns the number in AX. It assumes the end of the number in the input
; stream when the first non-numeric character is read. It is considered an error
; if the number is too large to be held in a 16 bit register. In this case, AX
; contains -1 on return.
;
;GetNum:
; push bx
; push dx
; xor ax,ax
; xor bx,bx
; xor dx,dx
;
;next_char:
; lodsb
; cmp al,'0' ; check for valid numeric input
; jb num_ret
; cmp al,'9'
; ja num_ret
; sub al,'0'
; xchg ax,bx ; save intermediate value
; push bx
; mov bx,10
; mul bx
; pop bx
; add al,bl
; adc ah,0
; xchg ax,bx ; stash total
; jc got_large
; cmp dx,0
; jz next_char
;got_large:
; mov ax,-1
; jmp short get_ret
;
;num_ret:
; mov ax,bx
; dec si ; put last character back into buffer
;
;get_ret:
; pop dx
; pop bx
; ret
;
; Processes a switch in the input. It ensures that the switch is valid, and
; gets the number, if any required, following the switch. The switch and the
; number *must* be separated by a colon. Carry is set if there is any kind of
; error.
;
;Check_Switch:
; lodsb
; and al,0DFH ; convert it to upper case
; cmp al,'A'
; jb err_swtch
; cmp al,'Z'
; ja err_swtch
; mov cl,cs:switchlist ; get number of valid switches
; mov ch,0
; push es
; push cs
; pop es ; set es:di -> switches
; push di
; mov di,1+offset switchlist ; point to string of valid switches
; repne scasb
; pop di
; pop es
; jnz err_swtch
; mov ax,1
; shl ax,cl ; set bit to indicate switch
; mov bx,cs:switches
; or bx,ax ; save this with other switches
; mov cx,ax
; test ax,7cH ; test against switches that require number to follow
; jz done_swtch
; lodsb
; cmp al,':'
; jnz reset_swtch
; call ScanBlanks
; call GetNum
; cmp ax,-1 ; was number too large?
; jz reset_swtch
;IF iTEST
; push ax
; add al,'0'
; add ah,'0'
; mov cs:number,ah
; mov cs:number+1,al
; mov dx,offset nummsg
; call message
; pop ax
;ENDIF
; call Process_Num
;
;done_swtch:
; ret
;
;reset_swtch:
; xor bx,cx ; remove this switch from the records
;err_swtch:
; stc
; jmp short done_swtch
;
; This routine takes the switch just input, and the number following (if any),
; and sets the value in the appropriate variable. If the number input is zero
; then it does nothing - it assumes the default value that is present in the
; variable at the beginning.
;
;Process_Num:
; push ds
; push cs
; pop ds
; test Switches,cx ; if this switch has been done before,
; jnz done_ret ; ignore this one.
; test cx,flagdrive
; jz try_f
; mov drivenumb,al
;IF iTEST
; add al,"0"
; mov driven,al
; mov dx,offset drvmsg
; call message
;ENDIF
; jmp short done_ret
;
;try_f:
; test cx,flagff
; jz try_t
; mov ffactor,al
;IF iTEST
; add al,"0"
; mov ffnum,al
; mov dx,offset ffmsg
; call message
;ENDIF
;
;try_t:
; cmp ax,0
; jz done_ret ; if number entered was 0, assume default value
; test cx,flagcyln
; jz try_s
; mov cyln,ax
;IF iTEST
; mov dx,offset cylnmsg
; call message
;ENDIF
; jmp short done_ret
;
;try_s:
; test cx,flagseclim
; jz try_h
; mov slim,ax
;IF iTEST
; mov dx,offset slimmsg
; call message
;ENDIF
; jmp short done_ret
;
;; Switch must be one for number of Heads.
;try_h:
; test cx,flagheads
; jz done_ret
; mov heads,ax
;IF iTEST
; add al,"0"
; mov hdnum,al
; mov dx,offset hdmsg
; call message
;ENDIF
;
;done_ret:
; pop ds
; ret
;
; SetDrvParms sets up the recommended BPB in each BDS in the system based on
; the form factor. It is assumed that the BPBs for the various form factors
; are present in the BPBTable. For hard files, the Recommended BPB is the same
; as the BPB on the drive.
; No attempt is made to preserve registers since we are going to jump to
; SYSINIT straight after this routine.
;
SetDrvParms:
push cs
pop es
xor bx,bx
call SetDrive ; ds:di -> BDS
mov bl,cs:[ffactor]
mov byte ptr [di].bds_formfactor,bl ; replace with new value
formfcont:
mov bl,[di].bds_formfactor
cmp bl,ff48tpi
jnz Got_80_cyln
IF iTEST
mov dx,offset msg48tpi
call message
ENDIF
mov cx,40
mov cs:[cyln],cx
Got_80_cyln:
shl bx,1 ; bx is word index into table of BPBs
mov si,ds:word ptr BPBTable[bx] ; get address of BPB
Set_RecBPB:
add di,BDS_RBPB ; es:di -> Recommended BPB
mov cx,size A_BPB - 12 ; don't move whole thing!!!!!
cld
repe movsb
call Handle_Switches ; replace with 'new' values as
; specified in switches.
;
; We need to set the media byte and the total number of sectors to reflect the
; number of heads. We do this by multiplying the number of heads by the number
; of 'sectors per head'. This is not a fool-proof scheme!!
;
mov ax,[di].BDS_RBPB.BPB_TOTALSECTORS ; this is OK for two heads
sar ax,1 ; ax contains # of sectors/head
mov cx,[di].BDS_RBPB.BPB_HEADS
dec cl ; get it 0-based
sal ax,cl
jc Set_All_Done_BRG ; We have too many sectors - overflow!!
mov [di].BDS_RBPB.BPB_TOTALSECTORS,ax
cmp cl,1
; We use media descriptor byte F0H for any type of medium that is not currently
; defined i.e. one that does not fall into the categories defined by media
; bytes F8H, F9H, FCH-FFH.
JE HEAD_2_DRV
MOV AL, 1 ;1 sector/cluster
MOV BL, [DI].BDS_RBPB.BPB_MEDIADESCRIPTOR
CMP BYTE PTR [DI].bds_formfactor, ffOther
JE GOT_CORRECT_MEDIAD
MOV CH, BYTE PTR [DI].bds_formfactor
CMP CH, ff48tpi
JE SINGLE_MEDIAD
MOV BL, 0F0h
JMP short GOT_CORRECT_MEDIAD
Set_All_Done_BRG:
jmp short Set_All_Done
SINGLE_MEDIAD:
CMP [DI].BDS_RBPB.BPB_SECTORSPERTRACK, 8 ;8 SEC/TRACK?
JNE SINGLE_9_SEC
MOV BL, 0FEh
JMP short GOT_CORRECT_MEDIAD
SINGLE_9_SEC:
MOV BL, 0FCh
JMP short GOT_CORRECT_MEDIAD
HEAD_2_DRV:
MOV BL, 0F0h ;default 0F0h
MOV AL, 1 ;1 sec/cluster
CMP BYTE PTR [DI].bds_formfactor, ffOther
JE GOT_CORRECT_MEDIAD
CMP BYTE PTR [DI].bds_formfactor, ff48tpi
JNE NOT_48TPI
MOV AL, 2
CMP [DI].BDS_RBPB.BPB_SECTORSPERTRACK, 8 ;8 SEC/TRACK?
JNE DOUBLE_9_SEC
MOV BL, 0FFh
JMP short GOT_CORRECT_MEDIAD
DOUBLE_9_SEC:
MOV BL, 0FDh
JMP short GOT_CORRECT_MEDIAD
NOT_48TPI:
CMP BYTE PTR [DI].bds_formfactor, ff96tpi
JNE NOT_96TPI
MOV AL, 1 ;1 sec/cluster
MOV BL, 0F9h
JMP short GOT_CORRECT_MEDIAD
NOT_96TPI:
CMP BYTE PTR [DI].bds_formfactor, ffSmall ;3-1/2, 720kb
JNE GOT_CORRECT_MEDIAD ;Not ffSmall. Strange Media device.
MOV AL, 2 ;2 sec/cluster
MOV BL, 0F9h
Got_Correct_Mediad:
mov [di].BDS_RBPB.BPB_SECTORSPERCLUSTER,al
mov [di].BDS_RBPB.BPB_MEDIADESCRIPTOR,bl
; Calculate the correct number of Total Sectors on medium
mov ax,[di].bds_ccyln
mov bx,[di].BDS_RBPB.BPB_HEADS
mul bx
mov bx,[di].BDS_RBPB.BPB_SECTORSPERTRACK
mul bx
; AX contains the total number of sectors on the disk
mov [di].BDS_RBPB.BPB_TOTALSECTORS,ax
;J.K. For ffOther type of media, we should set Sec/FAT, and # of Root directory
;J.K. accordingly.
cmp byte ptr [di].bds_formfactor, ffOther ;
jne Set_All_Ok
xor dx, dx
dec ax ; TOTALSECTORS - 1.
mov bx, 3 ; Assume 12 bit fat.
mul bx ; = 1.5 byte
mov bx, 2
div bx
xor dx, dx
mov bx, 512
div bx
inc ax
mov [di].BDS_RBPB.BPB_SECTORSPERFAT, ax
mov [di].BDS_RBPB.BPB_ROOTENTRIES, 0E0h ; directory entry # = 224
Set_All_Ok:
clc
Set_All_Done:
RET
;
; Handle_Switches replaces the values that were entered on the command line in
; config.sys into the recommended BPB area in the BDS.
; NOTE:
; No checking is done for a valid BPB here.
;
Handle_Switches:
call setdrive ; ds:di -> BDS
test cs:switches,flagdrive
jz done_handle ; if drive not specified, exit
mov al,cs:[drivenumb]
mov byte ptr [di].bds_drivenum,al
; test cs:switches,flagcyln
; jz no_cyln
mov ax,cs:[cyln]
mov [di].bds_ccyln,ax
no_cyln:
test cs:switches,flagseclim
jz no_seclim
mov ax,cs:[slim]
mov [di].BDS_RBPB.BPB_SECTORSPERTRACK,ax
no_seclim:
test cs:switches,flagheads
jz done_handle
mov ax,cs:[heads]
mov [di].BDS_RBPB.BPB_HEADS,ax
done_handle:
RET
Show_Message proc near
;In) AX = message number
; DS:SI -> Substitution list if necessary.
; CX = 0 or n depending on the substitution number
; DH = -1 FOR UTILITY MSG CLASS, 2 FOR PARSE ERROR
;Out) Message displayed using DOS function 9 with no keyboard input.
push cs
pop ds
mov bx, -1
mov dl, 0 ;no input
call SYSDISPMSG
ret
Show_Message endp
;
; The following are the recommended BPBs for the media that we know of so
; far.
; 48 tpi diskettes
BPB48T DW 512
DB 2
DW 1
DB 2
DW 112
DW 2*9*40
DB 0FDH
DW 2
DW 9
DW 2
DW 0
; 96tpi diskettes
BPB96T DW 512
DB 1
DW 1
DB 2
DW 224
DW 2*15*80
DB 0F9H
DW 7
DW 15
DW 2
DW 0
; 3 1/2 inch diskette BPB
BPB35 DW 512
DB 2
DW 1 ; Double sided with 9 sec/trk
DB 2
DW 70h
DW 2*9*80
DB 0F9H
DW 3
DW 9
DW 2
DW 0
bpb35h dw 0200h
db 01h
dw 0001h
db 02h
dw 0e0h
dw 0b40h
db 0f0h
dw 0009h
dw 0012h
dw 0002h
dd 0
dd 0
bpb288 dw 0200h
db 02h
dw 0001h
db 02h
dw 240
dw 2*36*80
db 0f0h
dw 0009h
dw 36
dw 0002h
dd 0
dd 0
BPBTable dw BPB48T ; 48tpi drives
dw BPB96T ; 96tpi drives
dw BPB35 ; 3.5" drives
; The following are not supported, so we default to 3.5" layout
dw BPB35 ; Not used - 8" drives
dw BPB35 ; Not Used - 8" drives
dw BPB35 ; Not Used - hard files
dw BPB35 ; Not Used - tape drives
dw bpb35h ; 3.5" - 1.44 MB diskette
dw BPB35 ; ERIMO
dw bpb288 ; 2.88 mb diskette
switchlist db 7,"FHSTDCN" ; Preserve the positions of N and C.
; The following depend on the positions of the various letters in SwitchList
flagdrive equ 0004H
flagcyln equ 0008H
flagseclim equ 0010H
flagheads equ 0020H
flagff equ 0040H
;
;Equates for message number
NODRIVE_MSG_NUM equ 2
LOADOK_MSG_NUM equ 3
code ends
end
|
kernel/src/core/tsshelper.asm | Remco123/CactusOS | 87 | 8433 | global flush_tss
flush_tss:
mov ax, 0x28
ltr ax
ret |
programs/oeis/208/A208599.asm | jmorken/loda | 1 | 179685 | <reponame>jmorken/loda
; A208599: Number of 5-bead necklaces labeled with numbers -n..n not allowing reversal, with sum zero.
; 11,77,291,791,1761,3431,6077,10021,15631,23321,33551,46827,63701,84771,110681,142121,179827,224581,277211,338591,409641,491327,584661,690701,810551,945361,1096327,1264691,1451741,1658811,1887281,2138577,2414171
add $0,1
cal $0,83669 ; Number of ordered quintuples (a,b,c,d,e), -n <= a,b,c,d,e <= n, such that a+b+c+d+e = 0.
mov $1,$0
sub $1,51
div $1,10
mul $1,2
add $1,11
|
enemizer/blindboss_hooks.asm | m0zes/z3randomizer | 1 | 177034 |
;================================================================================
; Blind Boss fight
;--------------------------------------------------------------------------------
org $1DA081 ; Original Code
JML check_blind_boss_room
Check_for_Blind_Fight:
org $1DA090
Initialize_Blind_Fight: |
oeis/277/A277939.asm | neoneye/loda-programs | 11 | 177982 | <filename>oeis/277/A277939.asm
; A277939: Number of n X 2 0..2 arrays with every element plus 1 mod 3 equal to some element at offset (-1,0) (-1,1) (0,-1) (0,1) or (1,0), with upper left element zero.
; Submitted by <NAME>
; 0,3,14,74,377,1932,9888,50619,259118,1326434,6790049,34758444,177929400,910825347,4662539246,23867662778,122179202441,625438596492,3201636859344,16389264488331,83897082108014,429471401309714,2198475559679921,11254055035493292,57609807934526952,294906143588768211,1509632415807381422,7727848606756621418,39559063162412952089,202503899587206619020,1036622863884932804352,5306500092687044736603,27164115528145743249326,139053832005645895374530,711820275371001130648769,3643826977804360062119724
mov $1,1
lpb $0
sub $0,1
add $1,$3
add $1,$3
add $2,$3
add $4,1
mov $5,$4
mov $4,$2
mov $2,$3
add $4,$1
mul $5,2
add $5,$4
mov $3,$5
lpe
mov $0,$3
|
libsrc/_DEVELOPMENT/adt/w_array/c/sdcc_iy/w_array_data_fastcall.asm | meesokim/z88dk | 0 | 28396 | <filename>libsrc/_DEVELOPMENT/adt/w_array/c/sdcc_iy/w_array_data_fastcall.asm
; void *w_array_data_fastcall(w_array_t *a)
SECTION code_adt_w_array
PUBLIC _w_array_data_fastcall
defc _w_array_data_fastcall = asm_w_array_data
INCLUDE "adt/w_array/z80/asm_w_array_data.asm"
|
iAlloy-dataset-master/mutant_version_set/balancedBST/v2/balancedBST.als | jringert/alloy-diff | 1 | 2725 | module unknown
//JOR//open util/integer [] as integer
one sig BinaryTree {
root: (lone Node)
}
sig Node {
left,right: (lone Node),
elem: (one Int)
}
pred Sorted[] {
(all n: (one Node) {
((all nl: (one ((n.left).(*(left + right)))) {
((nl.elem) < (n.elem))
}) && (all nr: (one ((n.right).(*(left + right)))) {
((nr.elem) > (n.elem))
}))
})
}
pred HasAtMostOneChild[n: Node] {
((no (n.left)) || (no (n.right)))
}
pred Balanced[] {
(all n1,n2: (one Node) {
(((HasAtMostOneChild[n1]) && (HasAtMostOneChild[n2])) => (let diff = (integer/minus[(Depth[n1]),(Depth[n2])]) {
((-1 <= diff) && (diff <= 1))
}))
})
}
pred RepOk[] {
((Sorted[]) && (Balanced[]))
}
fun Depth[n: Node] : (one Int) {
(#(n.(*(~(left + right)))))
}
fact Reachable {
(Node = ((BinaryTree.root).(*(left + right))))
}
fact Acyclic {
(all n: (one Node) {
((n != (n.(^(left + right)))) && (lone (n.(~(left + right)))) && (no ((n.left) & (n.right))))
})
}
run Sorted for 12
run HasAtMostOneChild for 20
run Balanced for 10
run RepOk for 10
|
programs/oeis/000/A000346.asm | karttu/loda | 1 | 7999 | <filename>programs/oeis/000/A000346.asm
; A000346: a(n) = 2^(2*n+1) - binomial(2*n+1, n+1).
; 1,5,22,93,386,1586,6476,26333,106762,431910,1744436,7036530,28354132,114159428,459312152,1846943453,7423131482,29822170718,119766321572,480832549478,1929894318332,7744043540348,31067656725032,124613686513778,499744650202436,2003840547211196,8033729541916936
mov $2,$0
add $2,1
mov $1,$2
cal $1,68551 ; a(n) = 4^n - binomial(2*n,n).
sub $1,2
div $1,2
add $1,1
|
sacred-grove/model.als | mk12/zeldalloy | 0 | 493 | open util/ordering[State]
-- Initial configuration:
--
-- -2 -1 0 +1 +2 Legend
-- +--------------- ===========
-- -3 | . . . . . = square
-- -2 | . x A x . x = goal
-- -1 | . . . . . L = Link
-- 0 | . L . A = StatueA
-- +1 | . . . B = StatueB
-- +2 | B
--
-- We use negative integers so that we can have a smaller
-- bit-width scope (Alloy only supports signed integers).
-- It's also nice to have Link start at the origin.
-- There are 3 objects: Link and the two statues.
abstract sig Object {}
one sig Link, StatueA, StatueB extends Object {}
-- A coordinate is an (x,y) pair on the grid.
-- The x-axis is horizontal and the y-axis is vertical.
sig Coord {
x, y: Int
}{
-- Restrict to valid coordinates.
x >= -2 and x <= 2
y >= -3 and y <= 2
not (x = 0 and y = -3)
not (x in -2 + 2 and y >= 0)
not (x in -1 + 1 and y = 2)
}
-- There are no duplicate coordinates.
fact {
no c, c': Coord | c != c' and c.x = c'.x and c.y = c'.y
}
-- Each state maps the objects to coordinates.
sig State {
-- `Object lone ->` means no two objects are at the same coordinate.
-- `-> one Coord` means each object occupies exactly one coordinate.
pos: Object lone -> one Coord
}
-- Set up the initial state.
fact {
first.pos[Link].x = 0 and first.pos[Link].y = 0
first.pos[StatueA].x = 0 and first.pos[StatueA].y = -2
first.pos[StatueB].x = 0 and first.pos[StatueB].y = 2
}
-- Define the solution criteria.
pred solved[s: State] {
s.pos[StatueA].x + s.pos[StatueB].x = -1 + 1
s.pos[StatueA].y + s.pos[StatueB].y = -2
}
-- Specify the rules of the puzzle.
fact {
all s: State, s': s.next {
let
-- Position of Link.
Lx = s.pos[Link].x,
Lx' = s'.pos[Link].x,
Ly = s.pos[Link].y,
Ly' = s'.pos[Link].y,
-- Position of StatueA.
Ax = s.pos[StatueA].x,
Ax' = s'.pos[StatueA].x,
Ay = s.pos[StatueA].y,
Ay' = s'.pos[StatueA].y,
-- Position of StatueB.
Bx = s.pos[StatueB].x,
Bx' = s'.pos[StatueB].x,
By = s.pos[StatueB].y,
By' = s'.pos[StatueB].y,
-- Displacement of Link.
Ldx = Lx'.minus[Lx],
Ldy = Ly'.minus[Ly],
-- Displacement of StatueA (negated).
Adx = Ax.minus[Ax'],
Ady = Ay.minus[Ay'],
-- Displacement of StatueB (not negated).
Bdx = Bx'.minus[Bx],
Bdy = By'.minus[By]
{
-- Link can move left, right, up, or down.
Ldx + Ldy = 0 + 1 or Ldx + Ldy = 0 + -1
-- Link cannot move into one of the statues.
not (Lx' = Ax and Ly' = Ay)
not (Lx' = Bx and Ly' = By)
(
-- StatueA goes in the opposite direction, if possible.
((Adx = Ldx and Ady = Ldy)
or (Adx + Ady = 0
and no c: Coord | c.x = Ax.minus[Ldx] and c.y = Ay.minus[Ldy]))
and
-- StatueB goes in the same direction, if possible.
((Bdx = Ldx and Bdy = Ldy)
or (Bdx + Bdy = 0
and no c: Coord | c.x = Bx.plus[Ldx] and c.y = By.plus[Ldy]))
) or (
-- Or, the statues don't move because they bang into each other.
Adx + Ady + Bdx + Bdy = 0
and Ax.minus[Ldx] = Bx.plus[Ldx]
and Ay.minus[Ldy] = By.plus[Ldy]
)
}
}
}
-- Solve the puzzle.
run { solved[last] } for 3 Int, exactly 21 Coord, exactly 13 State
|
libsrc/target/tiki100/graphics/l_graphics_cmp.asm | ahjelm/z88dk | 640 | 178051 | <reponame>ahjelm/z88dk
; We need a copy of this routine in himem
SECTION code_graphics
PUBLIC l_graphics_cmp
.l_graphics_cmp
ld a,h
add $80
ld b,a
ld a,d
add $80
cp b
ret nz
ld a,e
cp l
ret
|
adagl/linux/gl.ads | Lucretia/old_nehe_ada95 | 0 | 2540 | <gh_stars>0
--
-- Copyright (c) 2002-2003, <NAME>
-- 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.
-- * The names of its contributors may not 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;
-- 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 Interfaces.C;
package GL is
pragma Link_With("-lGL");
package C renames Interfaces.C;
GL_VERSION_1_1 : constant := 1;
GL_VERSION_1_2 : constant := 1;
GL_VERSION_1_3 : constant := 1;
GL_ARB_IMAGING : constant := 1;
------------------------------------------------------------------------------
-- Base types
------------------------------------------------------------------------------
type GLbitfield is new C.unsigned; -- 4-byte unsigned
type GLbyte is new C.char; -- 1-byte signed
type GLshort is new C.short; -- 2-byte signed
type GLint is new C.int; -- 4-byte signed
type GLubyte is new C.unsigned_char; -- 1-byte unsigned
type GLushort is new C.unsigned_short; -- 2-byte unsigned
type GLuint is new C.unsigned; -- 4-byte unsigned
type GLsizei is new C.int; -- 4-byte signed
type GLfloat is new C.C_float; -- single precision float
type GLclampf is new C.C_float; -- single precision float in [0,1]
type GLdouble is new C.double; -- double precision float
type GLclampd is new C.double; -- double precision float in [0,1]
------------------------------------------------------------------------------
-- Pointer types
------------------------------------------------------------------------------
type GLbytePtr is access all GLbyte;
type GLshortPtr is access all GLshort;
type GLintPtr is access all GLint;
type GLubytePtr is access all GLubyte;
type GLushortPtr is access all GLushort;
type GLuintPtr is access all GLuint;
type GLfloatPtr is access all GLfloat;
type GLclampfPtr is access all GLclampf;
type GLdoublePtr is access all GLdouble;
type GLpointer is access all GLubyte; -- our substitute for "void *"
------------------------------------------------------------------------------
-- GLenum is used only for sizing of the real enumeration types
------------------------------------------------------------------------------
type GLenum is new C.unsigned;
------------------------------------------------------------------------------
-- Boolean values
------------------------------------------------------------------------------
type GLboolean is (
GL_FALSE,
GL_TRUE);
for GLboolean use (
GL_FALSE => 0,
GL_TRUE => 1);
for GLboolean'Size use C.unsigned_char'Size;
type GLbooleanPtr is access all GLboolean;
------------------------------------------------------------------------------
-- Data types
------------------------------------------------------------------------------
GL_BYTE : constant := 16#1400#;
GL_UNSIGNED_BYTE : constant := 16#1401#;
GL_SHORT : constant := 16#1402#;
GL_UNSIGNED_SHORT : constant := 16#1403#;
GL_INT : constant := 16#1404#;
GL_UNSIGNED_INT : constant := 16#1405#;
GL_FLOAT : constant := 16#1406#;
GL_DOUBLE : constant := 16#140A#;
GL_2_BYTES : constant := 16#1407#;
GL_3_BYTES : constant := 16#1408#;
GL_4_BYTES : constant := 16#1409#;
------------------------------------------------------------------------------
-- Primitives
------------------------------------------------------------------------------
type PrimitiveType is (
GL_POINTS,
GL_LINES,
GL_LINE_LOOP,
GL_LINE_STRIP,
GL_TRIANGLES,
GL_TRIANGLE_STRIP,
GL_TRIANGLE_FAN,
GL_QUADS,
GL_QUAD_STRIP,
GL_POLYGON);
for PrimitiveType use (
GL_POINTS => 16#0000#,
GL_LINES => 16#0001#,
GL_LINE_LOOP => 16#0002#,
GL_LINE_STRIP => 16#0003#,
GL_TRIANGLES => 16#0004#,
GL_TRIANGLE_STRIP => 16#0005#,
GL_TRIANGLE_FAN => 16#0006#,
GL_QUADS => 16#0007#,
GL_QUAD_STRIP => 16#0008#,
GL_POLYGON => 16#0009#);
for PrimitiveType'Size use GLenum'Size;
------------------------------------------------------------------------------
-- Vertex Arrays
------------------------------------------------------------------------------
GL_VERTEX_ARRAY : constant := 16#0000_8074#;
GL_NORMAL_ARRAY : constant := 16#0000_8075#;
GL_COLOR_ARRAY : constant := 16#0000_8076#;
GL_INDEX_ARRAY : constant := 16#0000_8077#;
GL_TEXTURE_COORD_ARRAY : constant := 16#0000_8078#;
GL_EDGE_FLAG_ARRAY : constant := 16#0000_8079#;
GL_VERTEX_ARRAY_SIZE : constant := 16#0000_807A#;
GL_VERTEX_ARRAY_TYPE : constant := 16#0000_807B#;
GL_VERTEX_ARRAY_STRIDE : constant := 16#0000_807C#;
GL_NORMAL_ARRAY_TYPE : constant := 16#0000_807E#;
GL_NORMAL_ARRAY_STRIDE : constant := 16#0000_807F#;
GL_COLOR_ARRAY_SIZE : constant := 16#0000_8081#;
GL_COLOR_ARRAY_TYPE : constant := 16#0000_8082#;
GL_COLOR_ARRAY_STRIDE : constant := 16#0000_8083#;
GL_INDEX_ARRAY_TYPE : constant := 16#0000_8085#;
GL_INDEX_ARRAY_STRIDE : constant := 16#0000_8086#;
GL_TEXTURE_COORD_ARRAY_SIZE : constant := 16#0000_8088#;
GL_TEXTURE_COORD_ARRAY_TYPE : constant := 16#0000_8089#;
GL_TEXTURE_COORD_ARRAY_STRIDE : constant := 16#0000_808A#;
GL_EDGE_FLAG_ARRAY_STRIDE : constant := 16#0000_808C#;
GL_VERTEX_ARRAY_POINTER : constant := 16#0000_808E#;
GL_NORMAL_ARRAY_POINTER : constant := 16#0000_808F#;
GL_COLOR_ARRAY_POINTER : constant := 16#0000_8090#;
GL_INDEX_ARRAY_POINTER : constant := 16#0000_8091#;
GL_TEXTURE_COORD_ARRAY_POINTER : constant := 16#0000_8092#;
GL_EDGE_FLAG_ARRAY_POINTER : constant := 16#0000_8093#;
GL_V2F : constant := 16#2A20#;
GL_V3F : constant := 16#2A21#;
GL_C4UB_V2F : constant := 16#2A22#;
GL_C4UB_V3F : constant := 16#2A23#;
GL_C3F_V3F : constant := 16#2A24#;
GL_N3F_V3F : constant := 16#2A25#;
GL_C4F_N3F_V3F : constant := 16#2A26#;
GL_T2F_V3F : constant := 16#2A27#;
GL_T4F_V4F : constant := 16#2A28#;
GL_T2F_C4UB_V3F : constant := 16#2A29#;
GL_T2F_C3F_V3F : constant := 16#2A2A#;
GL_T2F_N3F_V3F : constant := 16#2A2B#;
GL_T2F_C4F_N3F_V3F : constant := 16#2A2C#;
GL_T4F_C4F_N3F_V4F : constant := 16#2A2D#;
------------------------------------------------------------------------------
-- Matrix Mode
------------------------------------------------------------------------------
GL_MATRIX_MODE : constant := 16#0BA0#;
type MatrixType is (
GL_MODELVIEW,
GL_PROJECTION,
GL_TEXTURE);
for MatrixType use (
GL_MODELVIEW => 16#1700#,
GL_PROJECTION => 16#1701#,
GL_TEXTURE => 16#1702#);
for MatrixType'Size use GLenum'Size;
------------------------------------------------------------------------------
-- Points
------------------------------------------------------------------------------
GL_POINT_SMOOTH : constant := 16#0B10#;
GL_POINT_SIZE : constant := 16#0B11#;
GL_POINT_SIZE_GRANULARITY : constant := 16#0B13#;
GL_POINT_SIZE_RANGE : constant := 16#0B12#;
------------------------------------------------------------------------------
-- Lines
------------------------------------------------------------------------------
GL_LINE_SMOOTH : constant := 16#0B20#;
GL_LINE_STIPPLE : constant := 16#0B24#;
GL_LINE_STIPPLE_PATTERN : constant := 16#0B25#;
GL_LINE_STIPPLE_REPEAT : constant := 16#0B26#;
GL_LINE_WIDTH : constant := 16#0B21#;
GL_LINE_WIDTH_GRANULARITY : constant := 16#0B23#;
GL_LINE_WIDTH_RANGE : constant := 16#0B22#;
------------------------------------------------------------------------------
-- Polygons
------------------------------------------------------------------------------
GL_POINT : constant := 16#1B00#;
GL_LINE : constant := 16#1B01#;
GL_FILL : constant := 16#1B02#;
GL_CW : constant := 16#0900#;
GL_CCW : constant := 16#0901#;
GL_FRONT : constant := 16#0404#;
GL_BACK : constant := 16#0405#;
GL_POLYGON_MODE : constant := 16#0B40#;
GL_POLYGON_SMOOTH : constant := 16#0B41#;
GL_POLYGON_STIPPLE : constant := 16#0B42#;
GL_EDGE_FLAG : constant := 16#0B43#;
GL_CULL_FACE : constant := 16#0B44#;
GL_CULL_FACE_MODE : constant := 16#0B45#;
GL_FRONT_FACE : constant := 16#0B46#;
GL_POLYGON_OFFSET_FACTOR : constant := 16#0000_8038#;
GL_POLYGON_OFFSET_UNITS : constant := 16#2A00#;
GL_POLYGON_OFFSET_POINT : constant := 16#2A01#;
GL_POLYGON_OFFSET_LINE : constant := 16#2A02#;
GL_POLYGON_OFFSET_FILL : constant := 16#0000_8037#;
------------------------------------------------------------------------------
-- Display lists
------------------------------------------------------------------------------
GL_COMPILE : constant := 16#1300#;
GL_COMPILE_AND_EXECUTE : constant := 16#1301#;
GL_LIST_BASE : constant := 16#0B32#;
GL_LIST_INDEX : constant := 16#0B33#;
GL_LIST_MODE : constant := 16#0B30#;
------------------------------------------------------------------------------
-- Depth buffer
------------------------------------------------------------------------------
GL_NEVER : constant := 16#0200#;
GL_LESS : constant := 16#0201#;
GL_EQUAL : constant := 16#0202#;
GL_LEQUAL : constant := 16#0203#;
GL_GREATER : constant := 16#0204#;
GL_NOTEQUAL : constant := 16#0205#;
GL_GEQUAL : constant := 16#0206#;
GL_ALWAYS : constant := 16#0207#;
GL_DEPTH_TEST : constant := 16#0B71#;
GL_DEPTH_BITS : constant := 16#0D56#;
GL_DEPTH_CLEAR_VALUE : constant := 16#0B73#;
GL_DEPTH_FUNC : constant := 16#0B74#;
GL_DEPTH_RANGE : constant := 16#0B70#;
GL_DEPTH_WRITEMASK : constant := 16#0B72#;
GL_DEPTH_COMPONENT : constant := 16#1902#;
------------------------------------------------------------------------------
-- Lighting
------------------------------------------------------------------------------
GL_LIGHTING : constant := 16#0B50#;
GL_LIGHT0 : constant := 16#4000#;
GL_LIGHT1 : constant := 16#4001#;
GL_LIGHT2 : constant := 16#4002#;
GL_LIGHT3 : constant := 16#4003#;
GL_LIGHT4 : constant := 16#4004#;
GL_LIGHT5 : constant := 16#4005#;
GL_LIGHT6 : constant := 16#4006#;
GL_LIGHT7 : constant := 16#4007#;
GL_SPOT_EXPONENT : constant := 16#1205#;
GL_SPOT_CUTOFF : constant := 16#1206#;
GL_CONSTANT_ATTENUATION : constant := 16#1207#;
GL_LINEAR_ATTENUATION : constant := 16#1208#;
GL_QUADRATIC_ATTENUATION : constant := 16#1209#;
GL_AMBIENT : constant := 16#1200#;
GL_DIFFUSE : constant := 16#1201#;
GL_SPECULAR : constant := 16#1202#;
GL_SHININESS : constant := 16#1601#;
GL_EMISSION : constant := 16#1600#;
GL_POSITION : constant := 16#1203#;
GL_SPOT_DIRECTION : constant := 16#1204#;
GL_AMBIENT_AND_DIFFUSE : constant := 16#1602#;
GL_COLOR_INDEXES : constant := 16#1603#;
GL_LIGHT_MODEL_TWO_SIDE : constant := 16#0B52#;
GL_LIGHT_MODEL_LOCAL_VIEWER : constant := 16#0B51#;
GL_LIGHT_MODEL_AMBIENT : constant := 16#0B53#;
GL_FRONT_AND_BACK : constant := 16#0408#;
GL_SHADE_MODEL : constant := 16#0B54#;
GL_FLAT : constant := 16#1D00#;
GL_SMOOTH : constant := 16#1D01#;
GL_COLOR_MATERIAL : constant := 16#0B57#;
GL_COLOR_MATERIAL_FACE : constant := 16#0B55#;
GL_COLOR_MATERIAL_PARAMETER : constant := 16#0B56#;
GL_NORMALIZE : constant := 16#0BA1#;
------------------------------------------------------------------------------
-- User clipping planes
------------------------------------------------------------------------------
GL_CLIP_PLANE0 : constant := 16#3000#;
GL_CLIP_PLANE1 : constant := 16#3001#;
GL_CLIP_PLANE2 : constant := 16#3002#;
GL_CLIP_PLANE3 : constant := 16#3003#;
GL_CLIP_PLANE4 : constant := 16#3004#;
GL_CLIP_PLANE5 : constant := 16#3005#;
------------------------------------------------------------------------------
-- Accumulation buffer
------------------------------------------------------------------------------
GL_ACCUM_RED_BITS : constant := 16#0D58#;
GL_ACCUM_GREEN_BITS : constant := 16#0D59#;
GL_ACCUM_BLUE_BITS : constant := 16#0D5A#;
GL_ACCUM_ALPHA_BITS : constant := 16#0D5B#;
GL_ACCUM_CLEAR_VALUE : constant := 16#0B80#;
GL_ACCUM : constant := 16#0100#;
GL_ADD : constant := 16#0104#;
GL_LOAD : constant := 16#0101#;
GL_MULT : constant := 16#0103#;
GL_RETURN : constant := 16#0102#;
------------------------------------------------------------------------------
-- Alpha testing
------------------------------------------------------------------------------
GL_ALPHA_TEST : constant := 16#0BC0#;
GL_ALPHA_TEST_REF : constant := 16#0BC2#;
GL_ALPHA_TEST_FUNC : constant := 16#0BC1#;
------------------------------------------------------------------------------
-- Blending
------------------------------------------------------------------------------
GL_BLEND : constant := 16#0BE2#;
GL_BLEND_SRC : constant := 16#0BE1#;
GL_BLEND_DST : constant := 16#0BE0#;
GL_ZERO : constant := 16#0000#;
GL_ONE : constant := 16#0001#;
GL_SRC_COLOR : constant := 16#0300#;
GL_ONE_MINUS_SRC_COLOR : constant := 16#0301#;
GL_SRC_ALPHA : constant := 16#0302#;
GL_ONE_MINUS_SRC_ALPHA : constant := 16#0303#;
GL_DST_ALPHA : constant := 16#0304#;
GL_ONE_MINUS_DST_ALPHA : constant := 16#0305#;
GL_DST_COLOR : constant := 16#0306#;
GL_ONE_MINUS_DST_COLOR : constant := 16#0307#;
GL_SRC_ALPHA_SATURATE : constant := 16#0308#;
------------------------------------------------------------------------------
-- Render mode
------------------------------------------------------------------------------
GL_FEEDBACK : constant := 16#1C01#;
GL_RENDER : constant := 16#1C00#;
GL_SELECT : constant := 16#1C02#;
------------------------------------------------------------------------------
-- Feedback
------------------------------------------------------------------------------
GL_2D : constant := 16#0600#;
GL_3D : constant := 16#0601#;
GL_3D_COLOR : constant := 16#0602#;
GL_3D_COLOR_TEXTURE : constant := 16#0603#;
GL_4D_COLOR_TEXTURE : constant := 16#0604#;
GL_POINT_TOKEN : constant := 16#<PASSWORD>#;
GL_LINE_TOKEN : constant := 16#<PASSWORD>#;
GL_LINE_RESET_TOKEN : constant := 16#0<PASSWORD>#;
GL_POLYGON_TOKEN : constant := 16#<PASSWORD>#;
GL_BITMAP_TOKEN : constant := 16#0<PASSWORD>#;
GL_DRAW_PIXEL_TOKEN : constant := 16#0<PASSWORD>#;
GL_COPY_PIXEL_TOKEN : constant := 16#0706#;
GL_PASS_THROUGH_TOKEN : constant := 16#0700#;
GL_FEEDBACK_BUFFER_POINTER : constant := 16#0DF0#;
GL_FEEDBACK_BUFFER_SIZE : constant := 16#0DF1#;
GL_FEEDBACK_BUFFER_TYPE : constant := 16#0DF2#;
------------------------------------------------------------------------------
-- Selection
------------------------------------------------------------------------------
GL_SELECTION_BUFFER_POINTER : constant := 16#0DF3#;
GL_SELECTION_BUFFER_SIZE : constant := 16#0DF4#;
------------------------------------------------------------------------------
-- Fog
------------------------------------------------------------------------------
GL_FOG : constant := 16#0B60#;
GL_FOG_MODE : constant := 16#0B65#;
GL_FOG_DENSITY : constant := 16#0B62#;
GL_FOG_COLOR : constant := 16#0B66#;
GL_FOG_INDEX : constant := 16#0B61#;
GL_FOG_START : constant := 16#0B63#;
GL_FOG_END : constant := 16#0B64#;
GL_LINEAR : constant := 16#2601#;
GL_EXP : constant := 16#0800#;
GL_EXP2 : constant := 16#0801#;
------------------------------------------------------------------------------
-- Logic ops
------------------------------------------------------------------------------
GL_LOGIC_OP : constant := 16#0BF1#;
GL_INDEX_LOGIC_OP : constant := 16#0BF1#;
GL_COLOR_LOGIC_OP : constant := 16#0BF2#;
GL_LOGIC_OP_MODE : constant := 16#0BF0#;
GL_CLEAR : constant := 16#1500#;
GL_SET : constant := 16#150F#;
GL_COPY : constant := 16#1503#;
GL_COPY_INVERTED : constant := 16#150C#;
GL_NOOP : constant := 16#1505#;
GL_INVERT : constant := 16#150A#;
GL_AND : constant := 16#1501#;
GL_NAND : constant := 16#150E#;
GL_OR : constant := 16#1507#;
GL_NOR : constant := 16#1508#;
GL_XOR : constant := 16#1506#;
GL_EQUIV : constant := 16#1509#;
GL_AND_REVERSE : constant := 16#1502#;
GL_AND_INVERTED : constant := 16#1504#;
GL_OR_REVERSE : constant := 16#150B#;
GL_OR_INVERTED : constant := 16#150D#;
------------------------------------------------------------------------------
-- Stencil
------------------------------------------------------------------------------
GL_STENCIL_TEST : constant := 16#0B90#;
GL_STENCIL_WRITEMASK : constant := 16#0B98#;
GL_STENCIL_BITS : constant := 16#0D57#;
GL_STENCIL_FUNC : constant := 16#0B92#;
GL_STENCIL_VALUE_MASK : constant := 16#0B93#;
GL_STENCIL_REF : constant := 16#0B97#;
GL_STENCIL_FAIL : constant := 16#0B94#;
GL_STENCIL_PASS_DEPTH_PASS : constant := 16#0B96#;
GL_STENCIL_PASS_DEPTH_FAIL : constant := 16#0B95#;
GL_STENCIL_CLEAR_VALUE : constant := 16#0B91#;
GL_STENCIL_INDEX : constant := 16#1901#;
GL_KEEP : constant := 16#1E00#;
GL_REPLACE : constant := 16#1E01#;
GL_INCR : constant := 16#1E02#;
GL_DECR : constant := 16#1E03#;
------------------------------------------------------------------------------
-- Buffers, Pixel Drawing/Reading
------------------------------------------------------------------------------
GL_NONE : constant := 16#0000#;
GL_LEFT : constant := 16#0406#;
GL_RIGHT : constant := 16#0407#;
-- GL_FRONT ;
-- GL_BACK ;
-- GL_FRONT_AND_BACK ;
GL_FRONT_LEFT : constant := 16#0400#;
GL_FRONT_RIGHT : constant := 16#0401#;
GL_BACK_LEFT : constant := 16#0402#;
GL_BACK_RIGHT : constant := 16#0403#;
GL_AUX0 : constant := 16#0409#;
GL_AUX1 : constant := 16#040A#;
GL_AUX2 : constant := 16#040B#;
GL_AUX3 : constant := 16#040C#;
GL_COLOR_INDEX : constant := 16#1900#;
GL_RED : constant := 16#1903#;
GL_GREEN : constant := 16#1904#;
GL_BLUE : constant := 16#1905#;
GL_ALPHA : constant := 16#1906#;
GL_LUMINANCE : constant := 16#1909#;
GL_LUMINANCE_ALPHA : constant := 16#190A#;
GL_ALPHA_BITS : constant := 16#0D55#;
GL_RED_BITS : constant := 16#0D52#;
GL_GREEN_BITS : constant := 16#0D53#;
GL_BLUE_BITS : constant := 16#0D54#;
GL_INDEX_BITS : constant := 16#0D51#;
GL_SUBPIXEL_BITS : constant := 16#0D50#;
GL_AUX_BUFFERS : constant := 16#0C00#;
GL_READ_BUFFER : constant := 16#0C02#;
GL_DRAW_BUFFER : constant := 16#0C01#;
GL_DOUBLEBUFFER : constant := 16#0C32#;
GL_STEREO : constant := 16#0C33#;
GL_BITMAP : constant := 16#1A00#;
GL_COLOR : constant := 16#1800#;
GL_DEPTH : constant := 16#1801#;
GL_STENCIL : constant := 16#1802#;
GL_DITHER : constant := 16#0BD0#;
GL_RGB : constant := 16#1907#;
GL_RGBA : constant := 16#1908#;
------------------------------------------------------------------------------
-- Implementation limits
------------------------------------------------------------------------------
GL_MAX_LIST_NESTING : constant := 16#0B31#;
GL_MAX_ATTRIB_STACK_DEPTH : constant := 16#0D35#;
GL_MAX_MODELVIEW_STACK_DEPTH : constant := 16#0D36#;
GL_MAX_NAME_STACK_DEPTH : constant := 16#0D37#;
GL_MAX_PROJECTION_STACK_DEPTH : constant := 16#0D38#;
GL_MAX_TEXTURE_STACK_DEPTH : constant := 16#0D39#;
GL_MAX_EVAL_ORDER : constant := 16#0D30#;
GL_MAX_LIGHTS : constant := 16#0D31#;
GL_MAX_CLIP_PLANES : constant := 16#0D32#;
GL_MAX_TEXTURE_SIZE : constant := 16#0D33#;
GL_MAX_PIXEL_MAP_TABLE : constant := 16#0D34#;
GL_MAX_VIEWPORT_DIMS : constant := 16#0D3A#;
GL_MAX_CLIENT_ATTRIB_STACK_DEPTH : constant := 16#0D3B#;
------------------------------------------------------------------------------
-- Gets
------------------------------------------------------------------------------
GL_ATTRIB_STACK_DEPTH : constant := 16#0BB0#;
GL_CLIENT_ATTRIB_STACK_DEPTH : constant := 16#0BB1#;
GL_COLOR_CLEAR_VALUE : constant := 16#0C22#;
GL_COLOR_WRITEMASK : constant := 16#0C23#;
GL_CURRENT_INDEX : constant := 16#0B01#;
GL_CURRENT_COLOR : constant := 16#0B00#;
GL_CURRENT_NORMAL : constant := 16#0B02#;
GL_CURRENT_RASTER_COLOR : constant := 16#0B04#;
GL_CURRENT_RASTER_DISTANCE : constant := 16#0B09#;
GL_CURRENT_RASTER_INDEX : constant := 16#0B05#;
GL_CURRENT_RASTER_POSITION : constant := 16#0B07#;
GL_CURRENT_RASTER_TEXTURE_COORDS : constant := 16#0B06#;
GL_CURRENT_RASTER_POSITION_VALID : constant := 16#0B08#;
GL_CURRENT_TEXTURE_COORDS : constant := 16#0B03#;
GL_INDEX_CLEAR_VALUE : constant := 16#0C20#;
GL_INDEX_MODE : constant := 16#0C30#;
GL_INDEX_WRITEMASK : constant := 16#0C21#;
GL_MODELVIEW_MATRIX : constant := 16#0BA6#;
GL_MODELVIEW_STACK_DEPTH : constant := 16#0BA3#;
GL_NAME_STACK_DEPTH : constant := 16#0D70#;
GL_PROJECTION_MATRIX : constant := 16#0BA7#;
GL_PROJECTION_STACK_DEPTH : constant := 16#0BA4#;
GL_RENDER_MODE : constant := 16#0C40#;
GL_RGBA_MODE : constant := 16#0C31#;
GL_TEXTURE_MATRIX : constant := 16#0BA8#;
GL_TEXTURE_STACK_DEPTH : constant := 16#0BA5#;
GL_VIEWPORT : constant := 16#0BA2#;
------------------------------------------------------------------------------
-- Evaluators
------------------------------------------------------------------------------
GL_AUTO_NORMAL : constant := 16#0D80#;
GL_MAP1_COLOR_4 : constant := 16#0D90#;
GL_MAP1_INDEX : constant := 16#0D91#;
GL_MAP1_NORMAL : constant := 16#0D92#;
GL_MAP1_TEXTURE_COORD_1 : constant := 16#0D93#;
GL_MAP1_TEXTURE_COORD_2 : constant := 16#0D94#;
GL_MAP1_TEXTURE_COORD_3 : constant := 16#0D95#;
GL_MAP1_TEXTURE_COORD_4 : constant := 16#0D96#;
GL_MAP1_VERTEX_3 : constant := 16#0D97#;
GL_MAP1_VERTEX_4 : constant := 16#0D98#;
GL_MAP2_COLOR_4 : constant := 16#0DB0#;
GL_MAP2_INDEX : constant := 16#0DB1#;
GL_MAP2_NORMAL : constant := 16#0DB2#;
GL_MAP2_TEXTURE_COORD_1 : constant := 16#0DB3#;
GL_MAP2_TEXTURE_COORD_2 : constant := 16#0DB4#;
GL_MAP2_TEXTURE_COORD_3 : constant := 16#0DB5#;
GL_MAP2_TEXTURE_COORD_4 : constant := 16#0DB6#;
GL_MAP2_VERTEX_3 : constant := 16#0DB7#;
GL_MAP2_VERTEX_4 : constant := 16#0DB8#;
GL_MAP1_GRID_DOMAIN : constant := 16#0DD0#;
GL_MAP1_GRID_SEGMENTS : constant := 16#0DD1#;
GL_MAP2_GRID_DOMAIN : constant := 16#0DD2#;
GL_MAP2_GRID_SEGMENTS : constant := 16#0DD3#;
GL_COEFF : constant := 16#0A00#;
GL_DOMAIN : constant := 16#0A02#;
GL_ORDER : constant := 16#0A01#;
------------------------------------------------------------------------------
-- Hints
------------------------------------------------------------------------------
GL_FOG_HINT : constant := 16#0C54#;
GL_LINE_SMOOTH_HINT : constant := 16#0C52#;
GL_PERSPECTIVE_CORRECTION_HINT : constant := 16#0C50#;
GL_POINT_SMOOTH_HINT : constant := 16#0C51#;
GL_POLYGON_SMOOTH_HINT : constant := 16#0C53#;
GL_DONT_CARE : constant := 16#1100#;
GL_FASTEST : constant := 16#1101#;
GL_NICEST : constant := 16#1102#;
------------------------------------------------------------------------------
-- Scissor box
------------------------------------------------------------------------------
GL_SCISSOR_TEST : constant := 16#0C11#;
GL_SCISSOR_BOX : constant := 16#0C10#;
------------------------------------------------------------------------------
-- Pixel Mode / Transfer
------------------------------------------------------------------------------
GL_MAP_COLOR : constant := 16#0D10#;
GL_MAP_STENCIL : constant := 16#0D11#;
GL_INDEX_SHIFT : constant := 16#0D12#;
GL_INDEX_OFFSET : constant := 16#0D13#;
GL_RED_SCALE : constant := 16#0D14#;
GL_RED_BIAS : constant := 16#0D15#;
GL_GREEN_SCALE : constant := 16#0D18#;
GL_GREEN_BIAS : constant := 16#0D19#;
GL_BLUE_SCALE : constant := 16#0D1A#;
GL_BLUE_BIAS : constant := 16#0D1B#;
GL_ALPHA_SCALE : constant := 16#0D1C#;
GL_ALPHA_BIAS : constant := 16#0D1D#;
GL_DEPTH_SCALE : constant := 16#0D1E#;
GL_DEPTH_BIAS : constant := 16#0D1F#;
GL_PIXEL_MAP_S_TO_S_SIZE : constant := 16#0CB1#;
GL_PIXEL_MAP_I_TO_I_SIZE : constant := 16#0CB0#;
GL_PIXEL_MAP_I_TO_R_SIZE : constant := 16#0CB2#;
GL_PIXEL_MAP_I_TO_G_SIZE : constant := 16#0CB3#;
GL_PIXEL_MAP_I_TO_B_SIZE : constant := 16#0CB4#;
GL_PIXEL_MAP_I_TO_A_SIZE : constant := 16#0CB5#;
GL_PIXEL_MAP_R_TO_R_SIZE : constant := 16#0CB6#;
GL_PIXEL_MAP_G_TO_G_SIZE : constant := 16#0CB7#;
GL_PIXEL_MAP_B_TO_B_SIZE : constant := 16#0CB8#;
GL_PIXEL_MAP_A_TO_A_SIZE : constant := 16#0CB9#;
GL_PIXEL_MAP_S_TO_S : constant := 16#0C71#;
GL_PIXEL_MAP_I_TO_I : constant := 16#0C70#;
GL_PIXEL_MAP_I_TO_R : constant := 16#0C72#;
GL_PIXEL_MAP_I_TO_G : constant := 16#0C73#;
GL_PIXEL_MAP_I_TO_B : constant := 16#0C74#;
GL_PIXEL_MAP_I_TO_A : constant := 16#0C75#;
GL_PIXEL_MAP_R_TO_R : constant := 16#0C76#;
GL_PIXEL_MAP_G_TO_G : constant := 16#0C77#;
GL_PIXEL_MAP_B_TO_B : constant := 16#0C78#;
GL_PIXEL_MAP_A_TO_A : constant := 16#0C79#;
GL_PACK_ALIGNMENT : constant := 16#0D05#;
GL_PACK_LSB_FIRST : constant := 16#0D01#;
GL_PACK_ROW_LENGTH : constant := 16#0D02#;
GL_PACK_SKIP_PIXELS : constant := 16#0D04#;
GL_PACK_SKIP_ROWS : constant := 16#0D03#;
GL_PACK_SWAP_BYTES : constant := 16#0D00#;
GL_UNPACK_ALIGNMENT : constant := 16#0CF5#;
GL_UNPACK_LSB_FIRST : constant := 16#0CF1#;
GL_UNPACK_ROW_LENGTH : constant := 16#0CF2#;
GL_UNPACK_SKIP_PIXELS : constant := 16#0CF4#;
GL_UNPACK_SKIP_ROWS : constant := 16#0CF3#;
GL_UNPACK_SWAP_BYTES : constant := 16#0CF0#;
GL_ZOOM_X : constant := 16#0D16#;
GL_ZOOM_Y : constant := 16#0D17#;
------------------------------------------------------------------------------
-- Texture mapping
------------------------------------------------------------------------------
GL_TEXTURE_ENV : constant := 16#2300#;
GL_TEXTURE_ENV_MODE : constant := 16#2200#;
GL_TEXTURE_1D : constant := 16#0DE0#;
GL_TEXTURE_2D : constant := 16#0DE1#;
GL_TEXTURE_WRAP_S : constant := 16#2802#;
GL_TEXTURE_WRAP_T : constant := 16#2803#;
GL_TEXTURE_MAG_FILTER : constant := 16#2800#;
GL_TEXTURE_MIN_FILTER : constant := 16#2801#;
GL_TEXTURE_ENV_COLOR : constant := 16#2201#;
GL_TEXTURE_GEN_S : constant := 16#0C60#;
GL_TEXTURE_GEN_T : constant := 16#0C61#;
GL_TEXTURE_GEN_MODE : constant := 16#2500#;
GL_TEXTURE_BORDER_COLOR : constant := 16#1004#;
GL_TEXTURE_WIDTH : constant := 16#1000#;
GL_TEXTURE_HEIGHT : constant := 16#1001#;
GL_TEXTURE_BORDER : constant := 16#1005#;
GL_TEXTURE_COMPONENTS : constant := 16#1003#;
GL_TEXTURE_RED_SIZE : constant := 16#0000_805C#;
GL_TEXTURE_GREEN_SIZE : constant := 16#0000_805D#;
GL_TEXTURE_BLUE_SIZE : constant := 16#0000_805E#;
GL_TEXTURE_ALPHA_SIZE : constant := 16#0000_805F#;
GL_TEXTURE_LUMINANCE_SIZE : constant := 16#0000_8060#;
GL_TEXTURE_INTENSITY_SIZE : constant := 16#0000_8061#;
GL_NEAREST_MIPMAP_NEAREST : constant := 16#2700#;
GL_NEAREST_MIPMAP_LINEAR : constant := 16#2702#;
GL_LINEAR_MIPMAP_NEAREST : constant := 16#2701#;
GL_LINEAR_MIPMAP_LINEAR : constant := 16#2703#;
GL_OBJECT_LINEAR : constant := 16#2401#;
GL_OBJECT_PLANE : constant := 16#2501#;
GL_EYE_LINEAR : constant := 16#2400#;
GL_EYE_PLANE : constant := 16#2502#;
GL_SPHERE_MAP : constant := 16#2402#;
GL_DECAL : constant := 16#2101#;
GL_MODULATE : constant := 16#2100#;
GL_NEAREST : constant := 16#2600#;
GL_REPEAT : constant := 16#2901#;
GL_CLAMP : constant := 16#2900#;
GL_S : constant := 16#2000#;
GL_T : constant := 16#2001#;
GL_R : constant := 16#2002#;
GL_Q : constant := 16#2003#;
GL_TEXTURE_GEN_R : constant := 16#0C62#;
GL_TEXTURE_GEN_Q : constant := 16#0C63#;
------------------------------------------------------------------------------
-- Utility
------------------------------------------------------------------------------
GL_VENDOR : constant := 16#1F00#;
GL_RENDERER : constant := 16#1F01#;
GL_VERSION : constant := 16#1F02#;
GL_EXTENSIONS : constant := 16#1F03#;
------------------------------------------------------------------------------
-- Errors
------------------------------------------------------------------------------
GL_NO_ERROR : constant := 16#0000#;
GL_INVALID_VALUE : constant := 16#0501#;
GL_INVALID_ENUM : constant := 16#0500#;
GL_INVALID_OPERATION : constant := 16#0502#;
GL_STACK_OVERFLOW : constant := 16#0503#;
GL_STACK_UNDERFLOW : constant := 16#0504#;
GL_OUT_OF_MEMORY : constant := 16#0505#;
------------------------------------------------------------------------------
-- glPushAttrib/glPopAttrib bits
------------------------------------------------------------------------------
GL_CURRENT_BIT : constant := 16#0001#;
GL_POINT_BIT : constant := 16#0002#;
GL_LINE_BIT : constant := 16#0004#;
GL_POLYGON_BIT : constant := 16#0008#;
GL_POLYGON_STIPPLE_BIT : constant := 16#0010#;
GL_PIXEL_MODE_BIT : constant := 16#0020#;
GL_LIGHTING_BIT : constant := 16#0040#;
GL_FOG_BIT : constant := 16#0080#;
GL_DEPTH_BUFFER_BIT : constant := 16#0100#;
GL_ACCUM_BUFFER_BIT : constant := 16#0200#;
GL_STENCIL_BUFFER_BIT : constant := 16#0400#;
GL_VIEWPORT_BIT : constant := 16#0800#;
GL_TRANSFORM_BIT : constant := 16#1000#;
GL_ENABLE_BIT : constant := 16#2000#;
GL_COLOR_BUFFER_BIT : constant := 16#4000#;
GL_HINT_BIT : constant := 16#8000#;
GL_EVAL_BIT : constant := 16#0001_0000#;
GL_LIST_BIT : constant := 16#0002_0000#;
GL_TEXTURE_BIT : constant := 16#0004_0000#;
GL_SCISSOR_BIT : constant := 16#0008_0000#;
GL_ALL_ATTRIB_BITS : constant := 16#000F_FFFF#;
------------------------------------------------------------------------------
-- OpenGL 1.1
------------------------------------------------------------------------------
GL_PROXY_TEXTURE_1D : constant := 16#0000_8063#;
GL_PROXY_TEXTURE_2D : constant := 16#0000_8064#;
GL_TEXTURE_PRIORITY : constant := 16#0000_8066#;
GL_TEXTURE_RESIDENT : constant := 16#0000_8067#;
GL_TEXTURE_BINDING_1D : constant := 16#0000_8068#;
GL_TEXTURE_BINDING_2D : constant := 16#0000_8069#;
GL_TEXTURE_INTERNAL_FORMAT : constant := 16#1003#;
GL_ALPHA4 : constant := 16#0000_803B#;
GL_ALPHA8 : constant := 16#0000_803C#;
GL_ALPHA12 : constant := 16#0000_803D#;
GL_ALPHA16 : constant := 16#0000_803E#;
GL_LUMINANCE4 : constant := 16#0000_803F#;
GL_LUMINANCE8 : constant := 16#0000_8040#;
GL_LUMINANCE12 : constant := 16#0000_8041#;
GL_LUMINANCE16 : constant := 16#0000_8042#;
GL_LUMINANCE4_ALPHA4 : constant := 16#0000_8043#;
GL_LUMINANCE6_ALPHA2 : constant := 16#0000_8044#;
GL_LUMINANCE8_ALPHA8 : constant := 16#0000_8045#;
GL_LUMINANCE12_ALPHA4 : constant := 16#0000_8046#;
GL_LUMINANCE12_ALPHA12 : constant := 16#0000_8047#;
GL_LUMINANCE16_ALPHA16 : constant := 16#0000_8048#;
GL_INTENSITY : constant := 16#0000_8049#;
GL_INTENSITY4 : constant := 16#0000_804A#;
GL_INTENSITY8 : constant := 16#0000_804B#;
GL_INTENSITY12 : constant := 16#0000_804C#;
GL_INTENSITY16 : constant := 16#0000_804D#;
GL_R3_G3_B2 : constant := 16#2A10#;
GL_RGB4 : constant := 16#0000_804F#;
GL_RGB5 : constant := 16#0000_8050#;
GL_RGB8 : constant := 16#0000_8051#;
GL_RGB10 : constant := 16#0000_8052#;
GL_RGB12 : constant := 16#0000_8053#;
GL_RGB16 : constant := 16#0000_8054#;
GL_RGBA2 : constant := 16#0000_8055#;
GL_RGBA4 : constant := 16#0000_8056#;
GL_RGB5_A1 : constant := 16#0000_8057#;
GL_RGBA8 : constant := 16#0000_8058#;
GL_RGB10_A2 : constant := 16#0000_8059#;
GL_RGBA12 : constant := 16#0000_805A#;
GL_RGBA16 : constant := 16#0000_805B#;
GL_CLIENT_PIXEL_STORE_BIT : constant := 16#0001#;
GL_CLIENT_VERTEX_ARRAY_BIT : constant := 16#0002#;
GL_ALL_CLIENT_ATTRIB_BITS : constant := 16#FFFF_FFFF#;
GL_CLIENT_ALL_ATTRIB_BITS : constant := 16#FFFF_FFFF#;
------------------------------------------------------------------------------
-- OpenGL 1.2
------------------------------------------------------------------------------
GL_RESCALE_NORMAL : constant := 16#0000_803A#;
GL_CLAMP_TO_EDGE : constant := 16#0000_812F#;
GL_MAX_ELEMENTS_VERTICES : constant := 16#0000_80E8#;
GL_MAX_ELEMENTS_INDICES : constant := 16#0000_80E9#;
GL_BGR : constant := 16#0000_80E0#;
GL_BGRA : constant := 16#0000_80E1#;
GL_UNSIGNED_BYTE_3_3_2 : constant := 16#0000_8032#;
GL_UNSIGNED_BYTE_2_3_3_REV : constant := 16#0000_8362#;
GL_UNSIGNED_SHORT_5_6_5 : constant := 16#0000_8363#;
GL_UNSIGNED_SHORT_5_6_5_REV : constant := 16#0000_8364#;
GL_UNSIGNED_SHORT_4_4_4_4 : constant := 16#0000_8033#;
GL_UNSIGNED_SHORT_4_4_4_4_REV : constant := 16#0000_8365#;
GL_UNSIGNED_SHORT_5_5_5_1 : constant := 16#0000_8034#;
GL_UNSIGNED_SHORT_1_5_5_5_REV : constant := 16#0000_8366#;
GL_UNSIGNED_INT_8_8_8_8 : constant := 16#0000_8035#;
GL_UNSIGNED_INT_8_8_8_8_REV : constant := 16#0000_8367#;
GL_UNSIGNED_INT_10_10_10_2 : constant := 16#0000_8036#;
GL_UNSIGNED_INT_2_10_10_10_REV : constant := 16#0000_8368#;
GL_LIGHT_MODEL_COLOR_CONTROL : constant := 16#0000_81F8#;
GL_SINGLE_COLOR : constant := 16#0000_81F9#;
GL_SEPARATE_SPECULAR_COLOR : constant := 16#0000_81FA#;
GL_TEXTURE_MIN_LOD : constant := 16#0000_813A#;
GL_TEXTURE_MAX_LOD : constant := 16#0000_813B#;
GL_TEXTURE_BASE_LEVEL : constant := 16#0000_813C#;
GL_TEXTURE_MAX_LEVEL : constant := 16#0000_813D#;
GL_SMOOTH_POINT_SIZE_RANGE : constant := 16#0B12#;
GL_SMOOTH_POINT_SIZE_GRANULARITY : constant := 16#0B13#;
GL_SMOOTH_LINE_WIDTH_RANGE : constant := 16#0B22#;
GL_SMOOTH_LINE_WIDTH_GRANULARITY : constant := 16#0B23#;
GL_ALIASED_POINT_SIZE_RANGE : constant := 16#0000_846D#;
GL_ALIASED_LINE_WIDTH_RANGE : constant := 16#0000_846E#;
GL_PACK_SKIP_IMAGES : constant := 16#0000_806B#;
GL_PACK_IMAGE_HEIGHT : constant := 16#0000_806C#;
GL_UNPACK_SKIP_IMAGES : constant := 16#0000_806D#;
GL_UNPACK_IMAGE_HEIGHT : constant := 16#0000_806E#;
GL_TEXTURE_3D : constant := 16#0000_806F#;
GL_PROXY_TEXTURE_3D : constant := 16#0000_8070#;
GL_TEXTURE_DEPTH : constant := 16#0000_8071#;
GL_TEXTURE_WRAP_R : constant := 16#0000_8072#;
GL_MAX_3D_TEXTURE_SIZE : constant := 16#0000_8073#;
GL_TEXTURE_BINDING_3D : constant := 16#0000_806A#;
------------------------------------------------------------------------------
-- GL_ARB_imaging
------------------------------------------------------------------------------
GL_CONSTANT_COLOR : constant := 16#0000_8001#;
GL_ONE_MINUS_CONSTANT_COLOR : constant := 16#0000_8002#;
GL_CONSTANT_ALPHA : constant := 16#0000_8003#;
GL_ONE_MINUS_CONSTANT_ALPHA : constant := 16#0000_8004#;
GL_COLOR_TABLE : constant := 16#0000_80D0#;
GL_POST_CONVOLUTION_COLOR_TABLE : constant := 16#0000_80D1#;
GL_POST_COLOR_MATRIX_COLOR_TABLE : constant := 16#0000_80D2#;
GL_PROXY_COLOR_TABLE : constant := 16#0000_80D3#;
GL_PROXY_POST_CONVOLUTION_COLOR_TABLE : constant := 16#0000_80D4#;
GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE : constant := 16#0000_80D5#;
GL_COLOR_TABLE_SCALE : constant := 16#0000_80D6#;
GL_COLOR_TABLE_BIAS : constant := 16#0000_80D7#;
GL_COLOR_TABLE_FORMAT : constant := 16#0000_80D8#;
GL_COLOR_TABLE_WIDTH : constant := 16#0000_80D9#;
GL_COLOR_TABLE_RED_SIZE : constant := 16#0000_80DA#;
GL_COLOR_TABLE_GREEN_SIZE : constant := 16#0000_80DB#;
GL_COLOR_TABLE_BLUE_SIZE : constant := 16#0000_80DC#;
GL_COLOR_TABLE_ALPHA_SIZE : constant := 16#0000_80DD#;
GL_COLOR_TABLE_LUMINANCE_SIZE : constant := 16#0000_80DE#;
GL_COLOR_TABLE_INTENSITY_SIZE : constant := 16#0000_80DF#;
GL_CONVOLUTION_1D : constant := 16#0000_8010#;
GL_CONVOLUTION_2D : constant := 16#0000_8011#;
GL_SEPARABLE_2D : constant := 16#0000_8012#;
GL_CONVOLUTION_BORDER_MODE : constant := 16#0000_8013#;
GL_CONVOLUTION_FILTER_SCALE : constant := 16#0000_8014#;
GL_CONVOLUTION_FILTER_BIAS : constant := 16#0000_8015#;
GL_REDUCE : constant := 16#0000_8016#;
GL_CONVOLUTION_FORMAT : constant := 16#0000_8017#;
GL_CONVOLUTION_WIDTH : constant := 16#0000_8018#;
GL_CONVOLUTION_HEIGHT : constant := 16#0000_8019#;
GL_MAX_CONVOLUTION_WIDTH : constant := 16#0000_801A#;
GL_MAX_CONVOLUTION_HEIGHT : constant := 16#0000_801B#;
GL_POST_CONVOLUTION_RED_SCALE : constant := 16#0000_801C#;
GL_POST_CONVOLUTION_GREEN_SCALE : constant := 16#0000_801D#;
GL_POST_CONVOLUTION_BLUE_SCALE : constant := 16#0000_801E#;
GL_POST_CONVOLUTION_ALPHA_SCALE : constant := 16#0000_801F#;
GL_POST_CONVOLUTION_RED_BIAS : constant := 16#0000_8020#;
GL_POST_CONVOLUTION_GREEN_BIAS : constant := 16#0000_8021#;
GL_POST_CONVOLUTION_BLUE_BIAS : constant := 16#0000_8022#;
GL_POST_CONVOLUTION_ALPHA_BIAS : constant := 16#0000_8023#;
GL_CONSTANT_BORDER : constant := 16#0000_8151#;
GL_REPLICATE_BORDER : constant := 16#0000_8153#;
GL_CONVOLUTION_BORDER_COLOR : constant := 16#0000_8154#;
GL_COLOR_MATRIX : constant := 16#0000_80B1#;
GL_COLOR_MATRIX_STACK_DEPTH : constant := 16#0000_80B2#;
GL_MAX_COLOR_MATRIX_STACK_DEPTH : constant := 16#0000_80B3#;
GL_POST_COLOR_MATRIX_RED_SCALE : constant := 16#0000_80B4#;
GL_POST_COLOR_MATRIX_GREEN_SCALE : constant := 16#0000_80B5#;
GL_POST_COLOR_MATRIX_BLUE_SCALE : constant := 16#0000_80B6#;
GL_POST_COLOR_MATRIX_ALPHA_SCALE : constant := 16#0000_80B7#;
GL_POST_COLOR_MATRIX_RED_BIAS : constant := 16#0000_80B8#;
GL_POST_COLOR_MATRIX_GREEN_BIAS : constant := 16#0000_80B9#;
GL_POST_COLOR_MATRIX_BLUE_BIAS : constant := 16#0000_80BA#;
GL_POST_COLOR_MATRIX_ALPHA_BIAS : constant := 16#0000_80BB#;
GL_HISTOGRAM : constant := 16#0000_8024#;
GL_PROXY_HISTOGRAM : constant := 16#0000_8025#;
GL_HISTOGRAM_WIDTH : constant := 16#0000_8026#;
GL_HISTOGRAM_FORMAT : constant := 16#0000_8027#;
GL_HISTOGRAM_RED_SIZE : constant := 16#0000_8028#;
GL_HISTOGRAM_GREEN_SIZE : constant := 16#0000_8029#;
GL_HISTOGRAM_BLUE_SIZE : constant := 16#0000_802A#;
GL_HISTOGRAM_ALPHA_SIZE : constant := 16#0000_802B#;
GL_HISTOGRAM_LUMINANCE_SIZE : constant := 16#0000_802C#;
GL_HISTOGRAM_SINK : constant := 16#0000_802D#;
GL_MINMAX : constant := 16#0000_802E#;
GL_MINMAX_FORMAT : constant := 16#0000_802F#;
GL_MINMAX_SINK : constant := 16#0000_8030#;
GL_TABLE_TOO_LARGE : constant := 16#0000_8031#;
GL_BLEND_EQUATION : constant := 16#0000_8009#;
GL_MIN : constant := 16#0000_8007#;
GL_MAX : constant := 16#0000_8008#;
GL_FUNC_ADD : constant := 16#0000_8006#;
GL_FUNC_SUBTRACT : constant := 16#0000_800A#;
GL_FUNC_REVERSE_SUBTRACT : constant := 16#0000_800B#;
GL_BLEND_COLOR : constant := 16#0000_8005#;
------------------------------------------------------------------------------
-- OpenGL 1.3
------------------------------------------------------------------------------
-- multitexture
------------------------------------------------------------------------------
GL_TEXTURE0 : constant := 16#0000_84C0#;
GL_TEXTURE1 : constant := 16#0000_84C1#;
GL_TEXTURE2 : constant := 16#0000_84C2#;
GL_TEXTURE3 : constant := 16#0000_84C3#;
GL_TEXTURE4 : constant := 16#0000_84C4#;
GL_TEXTURE5 : constant := 16#0000_84C5#;
GL_TEXTURE6 : constant := 16#0000_84C6#;
GL_TEXTURE7 : constant := 16#0000_84C7#;
GL_TEXTURE8 : constant := 16#0000_84C8#;
GL_TEXTURE9 : constant := 16#0000_84C9#;
GL_TEXTURE10 : constant := 16#0000_84CA#;
GL_TEXTURE11 : constant := 16#0000_84CB#;
GL_TEXTURE12 : constant := 16#0000_84CC#;
GL_TEXTURE13 : constant := 16#0000_84CD#;
GL_TEXTURE14 : constant := 16#0000_84CE#;
GL_TEXTURE15 : constant := 16#0000_84CF#;
GL_TEXTURE16 : constant := 16#0000_84D0#;
GL_TEXTURE17 : constant := 16#0000_84D1#;
GL_TEXTURE18 : constant := 16#0000_84D2#;
GL_TEXTURE19 : constant := 16#0000_84D3#;
GL_TEXTURE20 : constant := 16#0000_84D4#;
GL_TEXTURE21 : constant := 16#0000_84D5#;
GL_TEXTURE22 : constant := 16#0000_84D6#;
GL_TEXTURE23 : constant := 16#0000_84D7#;
GL_TEXTURE24 : constant := 16#0000_84D8#;
GL_TEXTURE25 : constant := 16#0000_84D9#;
GL_TEXTURE26 : constant := 16#0000_84DA#;
GL_TEXTURE27 : constant := 16#0000_84DB#;
GL_TEXTURE28 : constant := 16#0000_84DC#;
GL_TEXTURE29 : constant := 16#0000_84DD#;
GL_TEXTURE30 : constant := 16#0000_84DE#;
GL_TEXTURE31 : constant := 16#0000_84DF#;
GL_ACTIVE_TEXTURE : constant := 16#0000_84E0#;
GL_CLIENT_ACTIVE_TEXTURE : constant := 16#0000_84E1#;
GL_MAX_TEXTURE_UNITS : constant := 16#0000_84E2#;
------------------------------------------------------------------------------
-- texture_cube_map
------------------------------------------------------------------------------
GL_NORMAL_MAP : constant := 16#0000_8511#;
GL_REFLECTION_MAP : constant := 16#0000_8512#;
GL_TEXTURE_CUBE_MAP : constant := 16#0000_8513#;
GL_TEXTURE_BINDING_CUBE_MAP : constant := 16#0000_8514#;
GL_TEXTURE_CUBE_MAP_POSITIVE_X : constant := 16#0000_8515#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_X : constant := 16#0000_8516#;
GL_TEXTURE_CUBE_MAP_POSITIVE_Y : constant := 16#0000_8517#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y : constant := 16#0000_8518#;
GL_TEXTURE_CUBE_MAP_POSITIVE_Z : constant := 16#0000_8519#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z : constant := 16#0000_851A#;
GL_PROXY_TEXTURE_CUBE_MAP : constant := 16#0000_851B#;
GL_MAX_CUBE_MAP_TEXTURE_SIZE : constant := 16#0000_851C#;
------------------------------------------------------------------------------
-- texture_compression
------------------------------------------------------------------------------
GL_COMPRESSED_ALPHA : constant := 16#0000_84E9#;
GL_COMPRESSED_LUMINANCE : constant := 16#0000_84EA#;
GL_COMPRESSED_LUMINANCE_ALPHA : constant := 16#0000_84EB#;
GL_COMPRESSED_INTENSITY : constant := 16#0000_84EC#;
GL_COMPRESSED_RGB : constant := 16#0000_84ED#;
GL_COMPRESSED_RGBA : constant := 16#0000_84EE#;
GL_TEXTURE_COMPRESSION_HINT : constant := 16#0000_84EF#;
GL_TEXTURE_COMPRESSED_IMAGE_SIZE : constant := 16#0000_86A0#;
GL_TEXTURE_COMPRESSED : constant := 16#0000_86A1#;
GL_NUM_COMPRESSED_TEXTURE_FORMATS : constant := 16#0000_86A2#;
GL_COMPRESSED_TEXTURE_FORMATS : constant := 16#0000_86A3#;
------------------------------------------------------------------------------
-- multisample
------------------------------------------------------------------------------
GL_MULTISAMPLE : constant := 16#0000_809D#;
GL_SAMPLE_ALPHA_TO_COVERAGE : constant := 16#0000_809E#;
GL_SAMPLE_ALPHA_TO_ONE : constant := 16#0000_809F#;
GL_SAMPLE_COVERAGE : constant := 16#0000_80A0#;
GL_SAMPLE_BUFFERS : constant := 16#0000_80A8#;
GL_SAMPLES : constant := 16#0000_80A9#;
GL_SAMPLE_COVERAGE_VALUE : constant := 16#0000_80AA#;
GL_SAMPLE_COVERAGE_INVERT : constant := 16#0000_80AB#;
GL_MULTISAMPLE_BIT : constant := 16#2000_0000#;
------------------------------------------------------------------------------
-- transpose_matrix
------------------------------------------------------------------------------
GL_TRANSPOSE_MODELVIEW_MATRIX : constant := 16#0000_84E3#;
GL_TRANSPOSE_PROJECTION_MATRIX : constant := 16#0000_84E4#;
GL_TRANSPOSE_TEXTURE_MATRIX : constant := 16#0000_84E5#;
GL_TRANSPOSE_COLOR_MATRIX : constant := 16#0000_84E6#;
------------------------------------------------------------------------------
-- texture_env_combine
------------------------------------------------------------------------------
GL_COMBINE : constant := 16#0000_8570#;
GL_COMBINE_RGB : constant := 16#0000_8571#;
GL_COMBINE_ALPHA : constant := 16#0000_8572#;
GL_SOURCE0_RGB : constant := 16#0000_8580#;
GL_SOURCE1_RGB : constant := 16#0000_8581#;
GL_SOURCE2_RGB : constant := 16#0000_8582#;
GL_SOURCE0_ALPHA : constant := 16#0000_8588#;
GL_SOURCE1_ALPHA : constant := 16#0000_8589#;
GL_SOURCE2_ALPHA : constant := 16#0000_858A#;
GL_OPERAND0_RGB : constant := 16#0000_8590#;
GL_OPERAND1_RGB : constant := 16#0000_8591#;
GL_OPERAND2_RGB : constant := 16#0000_8592#;
GL_OPERAND0_ALPHA : constant := 16#0000_8598#;
GL_OPERAND1_ALPHA : constant := 16#0000_8599#;
GL_OPERAND2_ALPHA : constant := 16#0000_859A#;
GL_RGB_SCALE : constant := 16#0000_8573#;
GL_ADD_SIGNED : constant := 16#0000_8574#;
GL_INTERPOLATE : constant := 16#0000_8575#;
GL_SUBTRACT : constant := 16#0000_84E7#;
GL_CONSTANT : constant := 16#0000_8576#;
GL_PRIMARY_COLOR : constant := 16#0000_8577#;
GL_PREVIOUS : constant := 16#0000_8578#;
------------------------------------------------------------------------------
-- texture_env_dot3
------------------------------------------------------------------------------
GL_DOT3_RGB : constant := 16#0000_86AE#;
GL_DOT3_RGBA : constant := 16#0000_86AF#;
------------------------------------------------------------------------------
-- texture_border_clamp
------------------------------------------------------------------------------
GL_CLAMP_TO_BORDER : constant := 16#0000_812D#;
------------------------------------------------------------------------------
-- GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
------------------------------------------------------------------------------
GL_ARB_MULTITEXTURE : constant := 1;
GL_TEXTURE0_ARB : constant := 16#0000_84C0#;
GL_TEXTURE1_ARB : constant := 16#0000_84C1#;
GL_TEXTURE2_ARB : constant := 16#0000_84C2#;
GL_TEXTURE3_ARB : constant := 16#0000_84C3#;
GL_TEXTURE4_ARB : constant := 16#0000_84C4#;
GL_TEXTURE5_ARB : constant := 16#0000_84C5#;
GL_TEXTURE6_ARB : constant := 16#0000_84C6#;
GL_TEXTURE7_ARB : constant := 16#0000_84C7#;
GL_TEXTURE8_ARB : constant := 16#0000_84C8#;
GL_TEXTURE9_ARB : constant := 16#0000_84C9#;
GL_TEXTURE10_ARB : constant := 16#0000_84CA#;
GL_TEXTURE11_ARB : constant := 16#0000_84CB#;
GL_TEXTURE12_ARB : constant := 16#0000_84CC#;
GL_TEXTURE13_ARB : constant := 16#0000_84CD#;
GL_TEXTURE14_ARB : constant := 16#0000_84CE#;
GL_TEXTURE15_ARB : constant := 16#0000_84CF#;
GL_TEXTURE16_ARB : constant := 16#0000_84D0#;
GL_TEXTURE17_ARB : constant := 16#0000_84D1#;
GL_TEXTURE18_ARB : constant := 16#0000_84D2#;
GL_TEXTURE19_ARB : constant := 16#0000_84D3#;
GL_TEXTURE20_ARB : constant := 16#0000_84D4#;
GL_TEXTURE21_ARB : constant := 16#0000_84D5#;
GL_TEXTURE22_ARB : constant := 16#0000_84D6#;
GL_TEXTURE23_ARB : constant := 16#0000_84D7#;
GL_TEXTURE24_ARB : constant := 16#0000_84D8#;
GL_TEXTURE25_ARB : constant := 16#0000_84D9#;
GL_TEXTURE26_ARB : constant := 16#0000_84DA#;
GL_TEXTURE27_ARB : constant := 16#0000_84DB#;
GL_TEXTURE28_ARB : constant := 16#0000_84DC#;
GL_TEXTURE29_ARB : constant := 16#0000_84DD#;
GL_TEXTURE30_ARB : constant := 16#0000_84DE#;
GL_TEXTURE31_ARB : constant := 16#0000_84DF#;
GL_ACTIVE_TEXTURE_ARB : constant := 16#0000_84E0#;
GL_CLIENT_ACTIVE_TEXTURE_ARB : constant := 16#0000_84E1#;
GL_MAX_TEXTURE_UNITS_ARB : constant := 16#0000_84E2#;
------------------------------------------------------------------------------
-- GL_MESA_trace
------------------------------------------------------------------------------
GL_MESA_TRACE : constant := 1;
GL_TRACE_ALL_BITS_MESA : constant := 16#0000_FFFF#;
GL_TRACE_OPERATIONS_BIT_MESA : constant := 16#0001#;
GL_TRACE_PRIMITIVES_BIT_MESA : constant := 16#0002#;
GL_TRACE_ARRAYS_BIT_MESA : constant := 16#0004#;
GL_TRACE_TEXTURES_BIT_MESA : constant := 16#0008#;
GL_TRACE_PIXELS_BIT_MESA : constant := 16#0010#;
GL_TRACE_ERRORS_BIT_MESA : constant := 16#0020#;
GL_TRACE_MASK_MESA : constant := 16#0000_8755#;
GL_TRACE_NAME_MESA : constant := 16#0000_8756#;
------------------------------------------------------------------------------
-- GL_MESA_packed_depth_stencil
------------------------------------------------------------------------------
GL_MESA_PACKED_DEPTH_STENCIL : constant := 1;
GL_DEPTH_STENCIL_MESA : constant := 16#0000_8750#;
GL_UNSIGNED_INT_24_8_MESA : constant := 16#0000_8751#;
GL_UNSIGNED_INT_8_24_REV_MESA : constant := 16#0000_8752#;
GL_UNSIGNED_SHORT_15_1_MESA : constant := 16#0000_8753#;
GL_UNSIGNED_SHORT_1_15_REV_MESA : constant := 16#0000_8754#;
------------------------------------------------------------------------------
-- GL_MESA_texture_ycbcr
------------------------------------------------------------------------------
GL_MESA_YCBCR_TEXTURE : constant := 1;
GL_YCBCR_MESA : constant := 16#0000_8757#;
GL_UNSIGNED_SHORT_8_8_MESA : constant := 16#0000_85BA#;
GL_UNSIGNED_SHORT_8_8_REV_MESA : constant := 16#0000_85BB#;
------------------------------------------------------------------------------
-- GL_MESA_pack_invert
------------------------------------------------------------------------------
GL_MESA_PACK_INVERT : constant := 1;
GL_PACK_INVERT_MESA : constant := 16#0000_8758#;
------------------------------------------------------------------------------
-- GL_DEPTH_BOUNDS
------------------------------------------------------------------------------
GL_DEPTH_BOUNDS_TEST_EXT : constant := 16#0000_8890#;
GL_DEPTH_BOUNDS_EXT : constant := 16#0000_8891#;
------------------------------------------------------------------------------
-- GL_ARB_occlusion_query
------------------------------------------------------------------------------
GL_ARB_OCCLUSION_QUERY : constant := 1;
------------------------------------------------------------------------------
-- GL_ARB
------------------------------------------------------------------------------
GL_SAMPLES_PASSED_ARB : constant := 16#0000_8914#;
GL_QUERY_COUNTER_BITS_ARB : constant := 16#0000_8864#;
GL_CURRENT_QUERY_ARB : constant := 16#0000_8865#;
GL_QUERY_RESULT_ARB : constant := 16#0000_8866#;
GL_QUERY_RESULT_AVAILABLE_ARB : constant := 16#0000_8867#;
------------------------------------------------------------------------------
procedure glClearIndex(c : in GLfloat);
procedure glClearColor(Red, Green, Blue, Alpha : in GLclampf);
procedure glClear(Mask : in GLbitfield);
procedure glIndexMask(Mask : in GLuint);
procedure glColorMask(Red, Green, Blue, Alpha : in GLboolean);
procedure glAlphaFunc(Func : in GLenum; Ref : in GLclampf);
procedure glBlendFunc(SFactor : in GLenum; DFactor : in GLenum);
procedure glLogicOp(OpCode : in GLenum);
procedure glCullFace(Mode : in GLenum);
procedure glFrontFace(Mode : in GLenum);
procedure glPointSize(Size : in GLfloat);
procedure glLineWidth(Width : in GLfloat);
procedure glLineStipple(Factor : in GLint; Pattern : in GLushort);
procedure glPolygonMode(Face : in GLenum; Mode : in GLenum);
procedure glPolygonOffset(Factor : in GLfloat; Units : in GLfloat);
procedure glPolygonStipple(Mask : in GLubytePtr);
procedure glGetPolygonStipple(Mask : in GLubytePtr);
procedure glEdgeFlag(Flag : in GLboolean);
procedure glEdgeFlagv(Flag : in GLbooleanPtr);
procedure glScissor(X : in GLint; Y : in GLint; Width : in GLsizei; Height : in GLsizei);
procedure glClipPlane(Plane : in GLenum; Equation : in GLdoublePtr);
procedure glGetClipPlane(Plane : in GLenum; Equation : in GLdoublePtr);
procedure glDrawBuffer(Mode : in GLenum);
procedure glReadBuffer(Mode : in GLenum);
procedure glEnable(Cap : in GLenum);
procedure glDisable(Cap : in GLenum);
function glIsEnabled(Cap : in GLenum) return GLboolean;
procedure glEnableClientState(Cap : in GLenum);
procedure glDisableClientState(Cap : in GLenum);
procedure glGetBooleanv(PName : in GLenum; Params : in GLbooleanPtr);
procedure glGetDoublev(PName : in GLenum; Params : in GLdoublePtr);
procedure glGetFloatv(PName : in GLenum; Params : in GLfloatPtr);
procedure glGetIntegerv(PName : in GLenum; Params : in GLintPtr);
procedure glPushAttrib(Mask : in GLbitfield);
procedure glPopAttrib;
procedure glPushClientAttrib(Mask : in GLbitfield);
procedure glPopClientAttrib;
function glRenderMode(Mode : in GLenum) return GLint;
function glGetError return GLenum;
function glGetString(Name : in GLenum) return GLubytePtr;
procedure glFinish;
procedure glFlush;
procedure glHint(Target : in GLenum; Mode : in GLenum);
procedure glClearDepth(Depth : in GLclampd);
procedure glDepthFunc(Func : in GLenum);
procedure glDepthMask(Flag : in GLboolean);
procedure glDepthRange(Near_Val : in GLclampd; Far_Val : in GLclampd);
procedure glDepthBoundsEXT(ZMin : in GLclampd; ZMax : in GLclampd);
procedure glClearAccum(Red, Green, Blue, Alpha : in GLfloat);
procedure glAccum(Op : in GLenum; Value : in GLfloat);
procedure glMatrixMode(Mode : in MatrixType);
procedure glOrtho(Left, Right, Bottom, Top, Near_Val, Far_Val : in GLdouble);
procedure glFrustum(Left, Right, Bottom, Top, Near_Val, Far_Val : in GLdouble);
procedure glViewport(X, Y : in GLint; Width, Height : in GLsizei);
procedure glPushMatrix;
procedure glPopMatrix;
procedure glLoadIdentity;
procedure glLoadMatrixd(M : in GLdoublePtr);
procedure glLoadMatrixf(M : in GLfloatPtr);
procedure glMultMatrixd(M : in GLdoublePtr);
procedure glMultMatrixf(M : in GLfloatPtr);
procedure glRotated(Angle, X, Y, Z : in GLdouble);
procedure glRotatef(Angle, X, Y, Z : in GLfloat);
procedure glScaled(X, Y, Z : in GLdouble);
procedure glScalef(X, Y, Z : in GLfloat);
procedure glTranslated(X, Y, Z : in GLdouble);
procedure glTranslatef(X, Y, Z : in GLfloat);
function glIsList(list : in GLuint) return GLboolean;
procedure glDeleteLists(List : in GLuint; C_Range : in GLsizei);
function glGenLists(C_Range : in GLsizei) return GLuint;
procedure glNewList(List : in GLuint; Mode : in GLenum);
procedure glEndList;
procedure glCallList(List : in GLuint);
procedure glCallLists(N : in GLsizei; C_Type : in GLenum; Lists : in GLpointer);
procedure glListBase(Base : in GLuint);
procedure glBegin(Mode : in PrimitiveType);
procedure glEnd;
procedure glVertex2d(X, Y : in GLdouble);
procedure glVertex2f(X, Y : in GLfloat);
procedure glVertex2i(X, Y : in GLint);
procedure glVertex2s(X, Y : in GLshort);
procedure glVertex3d(X, Y, Z : in GLdouble);
procedure glVertex3f(X, Y, Z : in GLfloat);
procedure glVertex3i(X, Y, Z : in GLint);
procedure glVertex3s(X, Y, Z : in GLshort);
procedure glVertex4d(X, Y, Z, W : in GLdouble);
procedure glVertex4f(X, Y, Z, W : in GLfloat);
procedure glVertex4i(X, Y, Z, W : in GLint);
procedure glVertex4s(X, Y, Z, W : in GLshort);
procedure glVertex2dv(V : in GLdoublePtr);
procedure glVertex2fv(V : in GLfloatPtr);
procedure glVertex2iv(V : in GLintPtr);
procedure glVertex2sv(V : in GLshortPtr);
procedure glVertex3dv(V : in GLdoublePtr);
procedure glVertex3fv(V : in GLfloatPtr);
procedure glVertex3iv(V : in GLintPtr);
procedure glVertex3sv(V : in GLshortPtr);
procedure glVertex4dv(V : in GLdoublePtr);
procedure glVertex4fv(V : in GLfloatPtr);
procedure glVertex4iv(V : in GLintPtr);
procedure glVertex4sv(V : in GLshortPtr);
procedure glNormal3b(NX, NY, NZ : in GLbyte);
procedure glNormal3d(NX, NY, NZ : in GLdouble);
procedure glNormal3f(NX, NY, NZ : in GLfloat);
procedure glNormal3i(NX, NY, NZ : in GLint);
procedure glNormal3s(NX, NY, NZ : in GLshort);
procedure glNormal3bv(V : in GLbytePtr);
procedure glNormal3dv(V : in GLdoublePtr);
procedure glNormal3fv(V : in GLfloatPtr);
procedure glNormal3iv(V : in GLintPtr);
procedure glNormal3sv(V : in GLshortPtr);
procedure glIndexd(C : in GLdouble);
procedure glIndexf(C : in GLfloat);
procedure glIndexi(C : in GLint);
procedure glIndexs(C : in GLshort);
procedure glIndexub(C : in GLubyte);
procedure glIndexdv(C : in GLdoublePtr);
procedure glIndexfv(C : in GLfloatPtr);
procedure glIndexiv(C : in GLintPtr);
procedure glIndexsv(C : in GLshortPtr);
procedure glIndexubv(C : in GLubytePtr);
procedure glColor3b(Red, Green, Blue : in GLbyte);
procedure glColor3d(Red, Green, Blue : in GLdouble);
procedure glColor3f(Red, Green, Blue : in GLfloat);
procedure glColor3i(Red, Green, Blue : in GLint);
procedure glColor3s(Red, Green, Blue : in GLshort);
procedure glColor3ub(Red, Green, Blue : in GLubyte);
procedure glColor3ui(Red, Green, Blue : in GLuint);
procedure glColor3us(Red, Green, Blue : in GLushort);
procedure glColor4b(Red, Green, Blue, Alpha : in GLbyte);
procedure glColor4d(Red, Green, Blue, Alpha : in GLdouble);
procedure glColor4f(Red, Green, Blue, Alpha : in GLfloat);
procedure glColor4i(Red, Green, Blue, Alpha : in GLint);
procedure glColor4s(Red, Green, Blue, Alpha : in GLshort);
procedure glColor4ub(Red, Green, Blue, Alpha : in GLubyte);
procedure glColor4ui(Red, Green, Blue, Alpha : in GLuint);
procedure glColor4us(Red, Green, Blue, Alpha : in GLushort);
procedure glColor3bv(V : in GLbytePtr);
procedure glColor3dv(V : in GLdoublePtr);
procedure glColor3fv(V : in GLfloatPtr);
procedure glColor3iv(V : in GLintPtr);
procedure glColor3sv(V : in GLshortPtr);
procedure glColor3ubv(V : in GLubytePtr);
procedure glColor3uiv(V : in GLuintPtr);
procedure glColor3usv(V : in GLushortPtr);
procedure glColor4bv(V : in GLbytePtr);
procedure glColor4dv(V : in GLdoublePtr);
procedure glColor4fv(V : in GLfloatPtr);
procedure glColor4iv(V : in GLintPtr);
procedure glColor4sv(V : in GLshortPtr);
procedure glColor4ubv(V : in GLubytePtr);
procedure glColor4uiv(V : in GLuintPtr);
procedure glColor4usv(V : in GLushortPtr);
procedure glTexCoord1d(S : in GLdouble);
procedure glTexCoord1f(S : in GLfloat);
procedure glTexCoord1i(S : in GLint);
procedure glTexCoord1s(S : in GLshort);
procedure glTexCoord2d(S, T : in GLdouble);
procedure glTexCoord2f(S, T : in GLfloat);
procedure glTexCoord2i(S, T : in GLint);
procedure glTexCoord2s(S, T : in GLshort);
procedure glTexCoord3d(S, T, R : in GLdouble);
procedure glTexCoord3f(S, T, R : in GLfloat);
procedure glTexCoord3i(S, T, R : in GLint);
procedure glTexCoord3s(S, T, R : in GLshort);
procedure glTexCoord4d(S, T, R, Q : in GLdouble);
procedure glTexCoord4f(S, T, R, Q : in GLfloat);
procedure glTexCoord4i(S, T, R, Q : in GLint);
procedure glTexCoord4s(S, T, R, Q : in GLshort);
procedure glTexCoord1dv(V : in GLdoublePtr);
procedure glTexCoord1fv(V : in GLfloatPtr);
procedure glTexCoord1iv(V : in GLintPtr);
procedure glTexCoord1sv(V : in GLshortPtr);
procedure glTexCoord2dv(V : in GLdoublePtr);
procedure glTexCoord2fv(V : in GLfloatPtr);
procedure glTexCoord2iv(V : in GLintPtr);
procedure glTexCoord2sv(V : in GLshortPtr);
procedure glTexCoord3dv(V : in GLdoublePtr);
procedure glTexCoord3fv(V : in GLfloatPtr);
procedure glTexCoord3iv(V : in GLintPtr);
procedure glTexCoord3sv(V : in GLshortPtr);
procedure glTexCoord4dv(V : in GLdoublePtr);
procedure glTexCoord4fv(V : in GLfloatPtr);
procedure glTexCoord4iv(V : in GLintPtr);
procedure glTexCoord4sv(V : in GLshortPtr);
procedure glRasterPos2d(X, Y : in GLdouble);
procedure glRasterPos2f(X, Y : in GLfloat);
procedure glRasterPos2i(X, Y : in GLint);
procedure glRasterPos2s(X, Y : in GLshort);
procedure glRasterPos3d(X, Y, Z : in GLdouble);
procedure glRasterPos3f(X, Y, Z : in GLfloat);
procedure glRasterPos3i(X, Y, Z : in GLint);
procedure glRasterPos3s(X, Y, Z : in GLshort);
procedure glRasterPos4d(X, Y, Z, W : in GLdouble);
procedure glRasterPos4f(X, Y, Z, W : in GLfloat);
procedure glRasterPos4i(X, Y, Z, W : in GLint);
procedure glRasterPos4s(X, Y, Z, W : in GLshort);
procedure glRasterPos2dv(V : in GLdoublePtr);
procedure glRasterPos2fv(V : in GLfloatPtr);
procedure glRasterPos2iv(V : in GLintPtr);
procedure glRasterPos2sv(V : in GLshortPtr);
procedure glRasterPos3dv(V : in GLdoublePtr);
procedure glRasterPos3fv(V : in GLfloatPtr);
procedure glRasterPos3iv(V : in GLintPtr);
procedure glRasterPos3sv(V : in GLshortPtr);
procedure glRasterPos4dv(V : in GLdoublePtr);
procedure glRasterPos4fv(V : in GLfloatPtr);
procedure glRasterPos4iv(V : in GLintPtr);
procedure glRasterPos4sv(V : in GLshortPtr);
procedure glRectd(X1, Y1, X2, Y2 : in GLdouble);
procedure glRectf(X1, Y1, X2, Y2 : in GLfloat);
procedure glRecti(X1, Y1, X2, Y2 : in GLint);
procedure glRects(X1, Y1, X2, Y2 : in GLshort);
procedure glRectdv(V1, V2 : in GLdoublePtr);
procedure glRectfv(V1, V2 : in GLfloatPtr);
procedure glRectiv(V1, V2 : in GLintPtr);
procedure glRectsv(V1, V2 : in GLshortPtr);
procedure glVertexPointer(Size : in GLint; C_Type : in GLenum; Stride : in GLsizei; Ptr : in GLpointer);
procedure glNormalPointer(C_Type : in GLenum; Stride : in GLsizei; Ptr : in GLpointer);
procedure glColorPointer(Size : in GLint; C_Type : in GLenum; Stride : in GLsizei; Ptr : in GLpointer);
procedure glIndexPointer(C_Type : in GLenum; Stride : in GLsizei; Ptr : in GLpointer);
procedure glTexCoordPointer(Size : in GLint; C_Type : in GLenum; Stride : in GLsizei; Ptr : in GLpointer);
procedure glEdgeFlagPointer(Stride : in GLsizei; Ptr : in GLpointer);
procedure glGetPointerv(PName : in GLenum; Params : in GLpointer); -- Don't know about this parameter!
procedure glArrayElement(I : in GLint);
procedure glDrawArrays(Mode : in PrimitiveType; First : in GLint; Count : in GLsizei);
procedure glDrawElements(Mode : in PrimitiveType; Count : in GLsizei; C_Type : in GLenum; Indices : in GLpointer);
procedure glInterleavedArrays(Format : in GLenum; Stride : in GLsizei; Pointer : in GLpointer);
procedure glShadeModel(Mode : in GLenum);
procedure glLightf(Light : in GLenum; PName : in GLenum; Param : in GLfloat);
procedure glLighti(Light : in GLenum; PName : in GLenum; Param : in GLint);
procedure glLightfv(Light : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glLightiv(Light : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glGetLightfv(Light : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetLightiv(Light : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glLightModelf(PName : in GLenum; Param : in GLfloat);
procedure glLightModeli(PName : in GLenum; Param : in GLint);
procedure glLightModelfv(PName : in GLenum; Params : in GLfloatPtr);
procedure glLightModeliv(PName : in GLenum; Params : in GLintPtr);
procedure glMaterialf(Face : in GLenum; PName : in GLenum; Param : in GLfloat);
procedure glMateriali(Face : in GLenum; PName : in GLenum; Param : in GLint);
procedure glMaterialfv(Face : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glMaterialiv(Face : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glGetMaterialfv(Face : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetMaterialiv(Face : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glColorMaterial(Face : in GLenum; Mode : in GLenum);
procedure glPixelZoom(XFactor : in GLfloat; YFactor : in GLfloat);
procedure glPixelStoref(PName : in GLenum; Param : in GLfloat);
procedure glPixelStorei(PName : in GLenum; Param : in GLint);
procedure glPixelTransferf(PName : in GLenum; Param : in GLfloat);
procedure glPixelTransferi(PName : in GLenum; Param : in GLint);
procedure glPixelMapfv(Map : in GLenum; MapSize : in GLint; Values : in GLfloatPtr);
procedure glPixelMapuiv(Map : in GLenum; MapSize : in GLint; Values : in GLuintPtr);
procedure glPixelMapusv(Map : in GLenum; MapSize : in GLint; Values : in GLushortPtr);
procedure glGetPixelMapfv(Map : in GLenum; Values : in GLfloatPtr);
procedure glGetPixelMapuiv(Map : in GLenum; Values : in GLuintPtr);
procedure glGetPixelMapusv(Map : in GLenum; Values : in GLushortPtr);
procedure glBitmap(Width, Height : in GLsizei; XOrig, YOrig, XMove, YMove : in GLfloat; Bitmap : in GLubytePtr);
procedure glReadPixels(X, Y : in GLint; Width, Height : in GLsizei; Format :in GLenum; C_Type : in GLenum; Pixels : in GLpointer);
procedure glDrawPixels(Width, Height : in GLsizei; Format : GLenum; C_Type : GLenum; Pixels : in GLpointer);
procedure glCopyPixels(X, Y : in GLint; Width, Height : in GLsizei; C_Type : in GLenum);
procedure glStencilFunc(Func : in GLenum; Ref : in GLint; Mask : in GLuint);
procedure glStencilMask(Mask : in GLuint);
procedure glStencilOp(Fail : in GLenum; ZFail : in GLenum; ZPass : in GLenum);
procedure glClearStencil(S : in GLint);
procedure glTexGend(Coord : in GLenum; PName : in GLenum; Param : in GLdouble);
procedure glTexGenf(Coord : in GLenum; PName : in GLenum; Param : in GLfloat);
procedure glTexGeni(Coord : in GLenum; PName : in GLenum; Param : in GLint);
procedure glTexGendv(Coord : in GLenum; PName : in GLenum; Params : in GLdoublePtr);
procedure glTexGenfv(Coord : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glTexGeniv(Coord : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glGetTexGendv(Coord : in GLenum; PName : in GLenum; Params : in GLdoublePtr);
procedure glGetTexGenfv(Coord : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetTexGeniv(Coord : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glTexEnvf(Target : in GLenum; PName : in GLenum; Param : in GLfloat);
procedure glTexEnvi(Target : in GLenum; PName : in GLenum; Param : in GLint);
procedure glTexEnvfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glTexEnviv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glGetTexEnvfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetTexEnviv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glTexParameterf(Target : in GLenum; PName : in GLenum; Param : in GLfloat);
procedure glTexParameteri(Target : in GLenum; PName : in GLenum; Param : in GLint);
procedure glTexParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glTexParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glGetTexParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetTexParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glGetTexLevelParameterfv(Target : in GLenum; Level : in GLint; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetTexLevelParameteriv(Target : in GLenum; Level : in GLint; PName : in GLenum; Params : in GLintPtr);
procedure glTexImage1D(Target : in GLenum; Level, InternalFormat : in GLint; Width : in GLsizei; Border : in GLint; Format : in GLenum; C_Type : in GLenum; Pixels : in GLpointer);
procedure glTexImage2D(Target : in GLenum; Level, InternalFormat : in GLint; Width, Height : in GLsizei; Border : in GLint; Format : in GLenum; C_Type : in GLenum; Pixels : in GLpointer);
procedure glGetTexImage(Target : in GLenum; Level : in GLint; Format : in GLenum; C_Type : in GLenum; Pixels : in GLpointer);
procedure glGenTextures(N : in GLsizei; Textures : in GLuintPtr);
procedure glDeleteTextures(N : in GLsizei; Textures : in GLuintPtr);
procedure glBindTexture(Target : in GLenum; Texture : in GLuint);
procedure glPrioritizeTextures(N : in GLsizei; Textures : in GLuintPtr; Priorities : in GLclampfPtr);
function glAreTexturesResident(N : in GLsizei; Textures : in GLuintPtr; Residences : in GLbooleanPtr) return GLboolean;
function glIsTexture(Texture : in GLuint) return GLboolean;
procedure glTexSubImage1D(Target : in GLenum; Level, XOffset : in GLint; Width : in GLsizei; Format : in GLenum; C_Type : in GLenum; Pixels : in GLpointer);
procedure glTexSubImage2D(Target : in GLenum; Level, XOffset, YOffset : in GLint; Width, Height : in GLsizei; Format : in GLenum; C_Type : in GLenum; Pixels : in GLpointer);
procedure glCopyTexImage1D(Target : in GLenum; Level : in GLint; Internalformat : in GLenum; X, Y : in GLint; Width : in GLsizei; Border : in GLint);
procedure glCopyTexImage2D(Target : in GLenum; Level : in GLint; Internalformat : in GLenum; X, Y : in GLint; Width : in GLsizei; Height : in GLsizei; Border : in GLint);
procedure glCopyTexSubImage1D(Target : in GLenum; Level, XOffset, X, Y : in GLint; Width : in GLsizei);
procedure glCopyTexSubImage2D(Target : in GLenum; Level, XOffset, YOffset, X, Y : in GLint; Width, Height : in GLsizei);
procedure glMap1d(Target : in GLenum; U1, U2 : in GLdouble; Stride, Order : in GLint; Points : in GLdoublePtr);
procedure glMap1f(Target : in GLenum; U1, U2 : in GLfloat; Stride, Order : in GLint; Points : in GLfloatPtr);
procedure glMap2d(Target : in GLenum; U1, U2 : in GLdouble; UStride, UOrder : in GLint; V1, V2 : in GLdouble; VStride, VOrder : in GLint; Points : in GLdoublePtr);
procedure glMap2f(Target : in GLenum; U1, U2 : in GLfloat; UStride, UOrder : in GLint; V1, V2 : in GLfloat; VStride, VOrder : in GLint; Points : in GLfloatPtr);
procedure glGetMapdv(Target : in GLenum; Query : in GLenum; V : in GLdoublePtr);
procedure glGetMapfv(Target : in GLenum; Query : in GLenum; V : in GLfloatPtr);
procedure glGetMapiv(Target : in GLenum; Query : in GLenum; V : in GLintPtr);
procedure glEvalCoord1d(U : in GLdouble);
procedure glEvalCoord1f(U : in GLfloat);
procedure glEvalCoord1dv(U : in GLdoublePtr);
procedure glEvalCoord1fv(U : in GLfloatPtr);
procedure glEvalCoord2d(U, V : in GLdouble);
procedure glEvalCoord2f(U, V : in GLfloat);
procedure glEvalCoord2dv(U : in GLdoublePtr);
procedure glEvalCoord2fv(U : in GLfloatPtr);
procedure glMapGrid1d(UN : in GLint; U1, U2 : in GLdouble);
procedure glMapGrid1f(UN : in GLint; U1, U2 : in GLfloat);
procedure glMapGrid2d(UN : in GLint; U1, U2 : in GLdouble; VN : in GLint; V1, V2 : in GLdouble);
procedure glMapGrid2f(UN : in GLint; U1, U2 : in GLfloat; VN : in GLint; V1, V2 : in GLfloat);
procedure glEvalPoint1(I : in GLint);
procedure glEvalPoint2(I, J : in GLint);
procedure glEvalMesh1(Mode : in GLenum; I1, i2 : in GLint);
procedure glEvalMesh2(Mode : in GLenum; I1, I2, J1, J2 : in GLint);
procedure glFogf(PName : in GLenum; Param : in GLfloat);
procedure glFogi(PName : in GLenum; Param : in GLint);
procedure glFogfv(PName : in GLenum; Params : in GLfloatPtr);
procedure glFogiv(PName : in GLenum; Params : in GLintPtr);
procedure glFeedbackBuffer(Size : in GLsizei; C_Type : in GLenum; Buffer : in GLfloatPtr);
procedure glPassThrough(Token : in GLfloat);
procedure glSelectBuffer(Size : in GLsizei; Buffer : in GLuintPtr);
procedure glInitNames;
procedure glLoadName(Name : in GLuint);
procedure glPushName(Name : in GLuint);
procedure glPopName;
procedure glDrawRangeElements(Mode : in PrimitiveType; Start, C_End : in GLuint; Count : in GLsizei; C_Type : in GLenum; Indices : in GLpointer);
procedure glTexImage3D(Target : in GLenum; Level, InternalFormat : in GLint; Width, Height, Depth : in GLsizei; Border : in GLint; Format, C_Type : in GLenum; Pixels : in GLpointer);
procedure glTexSubImage3D(Target : in GLenum; Level, XOffset, YOffset, ZOffset : in GLint; Width : in GLsizei; Height, Depth : in GLsizei; Format, C_Type : in GLenum; Pixels : in GLpointer);
procedure glCopyTexSubImage3D(Target : in GLenum; Level, XOffset, YOffset, ZOffset, X, Y : in GLint; Width, Height : in GLsizei);
procedure glColorTable(Target : in GLenum; Internalformat : in GLenum; Width : in GLsizei; Format : in GLenum; C_Type : in GLenum; Table : in GLpointer);
procedure glColorSubTable(Target : in GLenum; Start, Count : in GLsizei; Format : in GLenum; C_Type : in GLenum; Data : in GLpointer);
procedure glColorTableParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glColorTableParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glCopyColorSubTable(Target : in GLenum; Start : in GLsizei; X, Y : in GLint; Width : GLsizei);
procedure glCopyColorTable(Target : in GLenum; Internalformat : GLenum; X, Y : in GLint; width : in GLsizei);
procedure glGetColorTable(Target : in GLenum; Format : in GLenum; C_Type : in GLenum; Table : in GLpointer);
procedure glGetColorTableParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetColorTableParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glBlendEquation(Mode : in GLenum);
procedure glBlendColor(Red, Green, Blue, Alpha : in GLclampf);
procedure glHistogram(Target : in GLenum; Width : in GLsizei; Internalformat : in GLenum; Sink : in GLboolean);
procedure glResetHistogram(Target : in GLenum);
procedure glGetHistogram(Target : in GLenum; Reset : in GLboolean; Format : in GLenum; C_Type : in GLenum; Values : in GLpointer);
procedure glGetHistogramParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetHistogramParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glMinmax(Target : in GLenum; Internalformat : in GLenum; Sink : in GLboolean);
procedure glResetMinmax(Target : in GLenum);
procedure glGetMinmax(Target : in GLenum; Reset : in GLboolean; Format : in GLenum; Types : in GLenum; Values : in GLpointer);
procedure glGetMinmaxParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetMinmaxParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glConvolutionFilter1D(Target : in GLenum; Internalformat : in GLenum; Width : in GLsizei; Format : in GLenum; C_Type : in GLenum; Image : in GLpointer);
procedure glConvolutionFilter2D(Target : in GLenum; Internalformat : in GLenum; Width, Height : in GLsizei; Format : in GLenum; C_Type : in GLenum; Image : in GLpointer);
procedure glConvolutionParameterf(Target : in GLenum; PName : in GLenum; Params : in GLfloat);
procedure glConvolutionParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glConvolutionParameteri(Target : in GLenum; PName : in GLenum; Params : in GLint);
procedure glConvolutionParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glCopyConvolutionFilter1D(Target : in GLenum; Internalformat : in GLenum; X, Y : in GLint; Width : in GLsizei);
procedure glCopyConvolutionFilter2D(Target : in GLenum; Internalformat : in GLenum; X, Y : in GLint; Width, Height : in GLsizei);
procedure glGetConvolutionFilter(Target : in GLenum; Format : in GLenum; C_Type : in GLenum; Image : in GLpointer);
procedure glGetConvolutionParameterfv(Target : in GLenum; PName : in GLenum; Params : in GLfloatPtr);
procedure glGetConvolutionParameteriv(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glSeparableFilter2D(Target : in GLenum; Internalformat : in GLenum; Width, Height : in GLsizei; Format : in GLenum; C_Type : in GLenum; Row, Column : in GLpointer);
procedure glGetSeparableFilter(Target : in GLenum; Format : in GLenum; C_type : in GLenum; Row, Column, Span : in GLpointer);
procedure glActiveTexture(Texture : in GLenum);
procedure glClientActiveTexture(Texture : in GLenum);
procedure glCompressedTexImage1D(Target : in GLenum; Level : in GLint; Internalformat : in GLenum; Width : in GLsizei; Border : in GLint; ImageSize : in GLsizei; Data : in GLpointer);
procedure glCompressedTexImage2D(Target : in GLenum; Level : in GLint; Internalformat : in GLenum; Width, Height : in GLsizei; Border : in GLint; ImageSize : in GLsizei; Data : in GLpointer);
procedure glCompressedTexImage3D(Target : in GLenum; Level : in GLint; Internalformat : in GLenum; Width, Height, Depth : in GLsizei; Border : in GLint; ImageSize : in GLsizei; Data : in GLpointer);
procedure glCompressedTexSubImage1D(Target : in GLenum; Level, XOffset : in GLint; Width : in GLsizei; Format : in GLenum; ImageSize : in GLsizei; Data : in GLpointer);
procedure glCompressedTexSubImage2D(Target : in GLenum; Level, XOffset, YOffset : in GLint; Width, Height : in GLsizei; Format : in GLenum; ImageSize : in GLsizei; Data : in GLpointer);
procedure glCompressedTexSubImage3D(Target : in GLenum; Level, XOffset, YOffset, ZOffset : in GLint; Width, Height, Depth : in GLsizei; Format : in GLenum; ImageSize : in GLsizei; Data : in GLpointer);
procedure glGetCompressedTexImage(Target : in GLenum; LOD : in GLint; Img : in GLpointer);
procedure glMultiTexCoord1d(Target : in GLenum; S : in GLdouble);
procedure glMultiTexCoord1dv(Target : in GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord1f(Target : in GLenum; S : in GLfloat);
procedure glMultiTexCoord1fv(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord1i(Target : in GLenum; S : in GLint);
procedure glMultiTexCoord1iv(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord1s(Target : in GLenum; S : in GLshort);
procedure glMultiTexCoord1sv(Target : in GLenum; V : in GLshortPtr);
procedure glMultiTexCoord2d(Target : in GLenum; S, T : in GLdouble);
procedure glMultiTexCoord2dv(Target : in GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord2f(Target : in GLenum; S, T : in GLfloat);
procedure glMultiTexCoord2fv(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord2i(Target : in GLenum; S, T : in GLint);
procedure glMultiTexCoord2iv(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord2s(Target : in GLenum; S, T : in GLshort);
procedure glMultiTexCoord2sv(Target : in GLenum; V : in GLshortPtr);
procedure glMultiTexCoord3d(Target : in GLenum; S, T, R : in GLdouble);
procedure glMultiTexCoord3dv(Target : in GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord3f(Target : in GLenum; S, T, R : in GLfloat);
procedure glMultiTexCoord3fv(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord3i(Target : in GLenum; S, T, R : in GLint);
procedure glMultiTexCoord3iv(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord3s(Target : in GLenum; S, T, R : in GLshort);
procedure glMultiTexCoord3sv(Target : in GLenum; V : in GLshortPtr);
procedure glMultiTexCoord4d(Target : in GLenum; S, T, R, Q : in GLdouble);
procedure glMultiTexCoord4dv(target : GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord4f(Target : in GLenum; S, T, R, Q : in GLfloat);
procedure glMultiTexCoord4fv(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord4i(target : in GLenum; S, T, R, Q : in GLint);
procedure glMultiTexCoord4iv(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord4s(Target : in GLenum; S, T, R, Q : in GLshort);
procedure glMultiTexCoord4sv(Target : in GLenum; V : in GLshortPtr);
procedure glLoadTransposeMatrixd(M : in GLdoublePtr);
procedure glLoadTransposeMatrixf(M : in GLfloatPtr);
procedure glMultTransposeMatrixd(M : in GLdoublePtr);
procedure glMultTransposeMatrixf(M : in GLfloatPtr);
procedure glSampleCoverage(Value : in GLclampf; Invert : in GLboolean);
procedure glActiveTextureARB(Texture : in GLenum);
procedure glClientActiveTextureARB(Texture : in GLenum);
procedure glMultiTexCoord1dARB(Target : in GLenum; S : in GLdouble);
procedure glMultiTexCoord1dvARB(Target : in GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord1fARB(Target : in GLenum; S : in GLfloat);
procedure glMultiTexCoord1fvARB(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord1iARB(Target : in GLenum; S : in GLint);
procedure glMultiTexCoord1ivARB(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord1sARB(Target : in GLenum; S : in GLshort);
procedure glMultiTexCoord1svARB(Target : in GLenum; V : in GLshortPtr);
procedure glMultiTexCoord2dARB(Target : in GLenum; S, T : in GLdouble);
procedure glMultiTexCoord2dvARB(Target : in GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord2fARB(Target : in GLenum; S, T : in GLfloat);
procedure glMultiTexCoord2fvARB(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord2iARB(Target : in GLenum; S, T : in GLint);
procedure glMultiTexCoord2ivARB(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord2sARB(Target : in GLenum; S, T : in GLshort);
procedure glMultiTexCoord2svARB(Target : in GLenum; V : in GLshortPtr);
procedure glMultiTexCoord3dARB(Target : in GLenum; S, T, R : in GLdouble);
procedure glMultiTexCoord3dvARB(Target : in GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord3fARB(Target : in GLenum; S, T, R : in GLfloat);
procedure glMultiTexCoord3fvARB(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord3iARB(Target : in GLenum; S, T, R : in GLint);
procedure glMultiTexCoord3ivARB(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord3sARB(Target : in GLenum; S, T, R : in GLshort);
procedure glMultiTexCoord3svARB(Target : in GLenum; V : in GLshortPtr);
procedure glMultiTexCoord4dARB(Target : in GLenum; S, T, R, Q : in GLdouble);
procedure glMultiTexCoord4dvARB(Target : in GLenum; V : in GLdoublePtr);
procedure glMultiTexCoord4fARB(Target : in GLenum; S, T, R, Q : in GLfloat);
procedure glMultiTexCoord4fvARB(Target : in GLenum; V : in GLfloatPtr);
procedure glMultiTexCoord4iARB(Target : in GLenum; S, T, R, Q : in GLint);
procedure glMultiTexCoord4ivARB(Target : in GLenum; V : in GLintPtr);
procedure glMultiTexCoord4sARB(Target : in GLenum; S, T, R, Q : in GLshort);
procedure glMultiTexCoord4svARB(Target : in GLenum; V : in GLshortPtr);
procedure glGenQueriesARB(N : in GLsizei; Ids : in GLuintPtr);
procedure glDeleteQueriesARB(N : in GLsizei; Ids : in GLuintPtr);
function glIsQueryARB(Id : in GLuint) return GLboolean;
procedure glBeginQueryARB(Target : in GLenum; Id : in GLuint);
procedure glEndQueryARB(Target : in GLenum);
procedure glGetQueryivARB(Target : in GLenum; PName : in GLenum; Params : in GLintPtr);
procedure glGetQueryObjectivARB(Id : in GLuint; PName : in GLenum; Params : in GLintPtr);
procedure glGetQueryObjectuivARB(Id : in GLuint; PName : in GLenum; Params : in GLuintPtr);
procedure glEnableTraceMESA(Mask : in GLbitfield);
procedure glDisableTraceMESA(Mask : in GLbitfield);
procedure glNewTraceMESA(Mask : in GLbitfield; TraceName : in GLubytePtr);
procedure glEndTraceMESA;
procedure glTraceAssertAttribMESA(AttribMask : in GLbitfield);
procedure glTraceCommentMESA(Comment : in GLubytePtr);
procedure glTraceTextureMESA(Name : in GLuint; Comment : in GLubytePtr);
procedure glTraceListMESA(Name : in GLuint; Comment : in GLubytePtr);
procedure glTracePointerMESA(Pointer : in GLpointer; Comment : in GLubytePtr);
procedure glTracePointerRangeMESA(First, Last : in GLpointer; Comment : in GLubytePtr);
private
pragma Import(C, glClearIndex, "glClearIndex");
pragma Import(C, glClearColor, "glClearColor");
pragma Import(C, glClear, "glClear");
pragma Import(C, glIndexMask, "glIndexMask");
pragma Import(C, glColorMask, "glColorMask");
pragma Import(C, glAlphaFunc, "glAlphaFunc");
pragma Import(C, glBlendFunc, "glBlendFunc");
pragma Import(C, glLogicOp, "glLogicOp");
pragma Import(C, glCullFace, "glCullFace");
pragma Import(C, glFrontFace, "glFrontFace");
pragma Import(C, glPointSize, "glPointSize");
pragma Import(C, glLineWidth, "glLineWidth");
pragma Import(C, glLineStipple, "glLineStipple");
pragma Import(C, glPolygonMode, "glPolygonMode");
pragma Import(C, glPolygonOffset, "glPolygonOffset");
pragma Import(C, glPolygonStipple, "glPolygonStipple");
pragma Import(C, glGetPolygonStipple, "glGetPolygonStipple");
pragma Import(C, glEdgeFlag, "glEdgeFlag");
pragma Import(C, glEdgeFlagv, "glEdgeFlagv");
pragma Import(C, glScissor, "glScissor");
pragma Import(C, glClipPlane, "glClipPlane");
pragma Import(C, glGetClipPlane, "glGetClipPlane");
pragma Import(C, glDrawBuffer, "glDrawBuffer");
pragma Import(C, glReadBuffer, "glReadBuffer");
pragma Import(C, glEnable, "glEnable");
pragma Import(C, glDisable, "glDisable");
pragma Import(C, glIsEnabled, "glIsEnabled");
pragma Import(C, glEnableClientState, "glEnableClientState");
pragma Import(C, glDisableClientState, "glDisableClientState");
pragma Import(C, glGetBooleanv, "glGetBooleanv");
pragma Import(C, glGetDoublev, "glGetDoublev");
pragma Import(C, glGetFloatv, "glGetFloatv");
pragma Import(C, glGetIntegerv, "glGetIntegerv");
pragma Import(C, glPushAttrib, "glPushAttrib");
pragma Import(C, glPopAttrib, "glPopAttrib");
pragma Import(C, glPushClientAttrib, "glPushClientAttrib");
pragma Import(C, glPopClientAttrib, "glPopClientAttrib");
pragma Import(C, glRenderMode, "glRenderMode");
pragma Import(C, glGetError, "glGetError");
pragma Import(C, glGetString, "glGetString");
pragma Import(C, glFinish, "glFinish");
pragma Import(C, glFlush, "glFlush");
pragma Import(C, glHint, "glHint");
pragma Import(C, glClearDepth, "glClearDepth");
pragma Import(C, glDepthFunc, "glDepthFunc");
pragma Import(C, glDepthMask, "glDepthMask");
pragma Import(C, glDepthRange, "glDepthRange");
pragma Import(C, glDepthBoundsEXT, "glDepthBoundsEXT");
pragma Import(C, glClearAccum, "glClearAccum");
pragma Import(C, glAccum, "glAccum");
pragma Import(C, glMatrixMode, "glMatrixMode");
pragma Import(C, glOrtho, "glOrtho");
pragma Import(C, glFrustum, "glFrustum");
pragma Import(C, glViewport, "glViewport");
pragma Import(C, glPushMatrix, "glPushMatrix");
pragma Import(C, glPopMatrix, "glPopMatrix");
pragma Import(C, glLoadIdentity, "glLoadIdentity");
pragma Import(C, glLoadMatrixd, "glLoadMatrixd");
pragma Import(C, glLoadMatrixf, "glLoadMatrixf");
pragma Import(C, glMultMatrixd, "glMultMatrixd");
pragma Import(C, glMultMatrixf, "glMultMatrixf");
pragma Import(C, glRotated, "glRotated");
pragma Import(C, glRotatef, "glRotatef");
pragma Import(C, glScaled, "glScaled");
pragma Import(C, glScalef, "glScalef");
pragma Import(C, glTranslated, "glTranslated");
pragma Import(C, glTranslatef, "glTranslatef");
pragma Import(C, glIsList, "glIsList");
pragma Import(C, glDeleteLists, "glDeleteLists");
pragma Import(C, glGenLists, "glGenLists");
pragma Import(C, glNewList, "glNewList");
pragma Import(C, glEndList, "glEndList");
pragma Import(C, glCallList, "glCallList");
pragma Import(C, glCallLists, "glCallLists");
pragma Import(C, glListBase, "glListBase");
pragma Import(C, glBegin, "glBegin");
pragma Import(C, glEnd, "glEnd");
pragma Import(C, glVertex2d, "glVertex2d");
pragma Import(C, glVertex2f, "glVertex2f");
pragma Import(C, glVertex2i, "glVertex2i");
pragma Import(C, glVertex2s, "glVertex2s");
pragma Import(C, glVertex3d, "glVertex3d");
pragma Import(C, glVertex3f, "glVertex3f");
pragma Import(C, glVertex3i, "glVertex3i");
pragma Import(C, glVertex3s, "glVertex3s");
pragma Import(C, glVertex4d, "glVertex4d");
pragma Import(C, glVertex4f, "glVertex4f");
pragma Import(C, glVertex4i, "glVertex4i");
pragma Import(C, glVertex4s, "glVertex4s");
pragma Import(C, glVertex2dv, "glVertex2dv");
pragma Import(C, glVertex2fv, "glVertex2fv");
pragma Import(C, glVertex2iv, "glVertex2iv");
pragma Import(C, glVertex2sv, "glVertex2sv");
pragma Import(C, glVertex3dv, "glVertex3dv");
pragma Import(C, glVertex3fv, "glVertex3fv");
pragma Import(C, glVertex3iv, "glVertex3iv");
pragma Import(C, glVertex3sv, "glVertex3sv");
pragma Import(C, glVertex4dv, "glVertex4dv");
pragma Import(C, glVertex4fv, "glVertex4fv");
pragma Import(C, glVertex4iv, "glVertex4iv");
pragma Import(C, glVertex4sv, "glVertex4sv");
pragma Import(C, glNormal3b, "glNormal3b");
pragma Import(C, glNormal3d, "glNormal3d");
pragma Import(C, glNormal3f, "glNormal3f");
pragma Import(C, glNormal3i, "glNormal3i");
pragma Import(C, glNormal3s, "glNormal3s");
pragma Import(C, glNormal3bv, "glNormal3bv");
pragma Import(C, glNormal3dv, "glNormal3dv");
pragma Import(C, glNormal3fv, "glNormal3fv");
pragma Import(C, glNormal3iv, "glNormal3iv");
pragma Import(C, glNormal3sv, "glNormal3sv");
pragma Import(C, glIndexd, "glIndexd");
pragma Import(C, glIndexf, "glIndexf");
pragma Import(C, glIndexi, "glIndexi");
pragma Import(C, glIndexs, "glIndexs");
pragma Import(C, glIndexub, "glIndexub");
pragma Import(C, glIndexdv, "glIndexdv");
pragma Import(C, glIndexfv, "glIndexfv");
pragma Import(C, glIndexiv, "glIndexiv");
pragma Import(C, glIndexsv, "glIndexsv");
pragma Import(C, glIndexubv, "glIndexubv");
pragma Import(C, glColor3b, "glColor3b");
pragma Import(C, glColor3d, "glColor3d");
pragma Import(C, glColor3f, "glColor3f");
pragma Import(C, glColor3i, "glColor3i");
pragma Import(C, glColor3s, "glColor3s");
pragma Import(C, glColor3ub, "glColor3ub");
pragma Import(C, glColor3ui, "glColor3ui");
pragma Import(C, glColor3us, "glColor3us");
pragma Import(C, glColor4b, "glColor4b");
pragma Import(C, glColor4d, "glColor4d");
pragma Import(C, glColor4f, "glColor4f");
pragma Import(C, glColor4i, "glColor4i");
pragma Import(C, glColor4s, "glColor4s");
pragma Import(C, glColor4ub, "glColor4ub");
pragma Import(C, glColor4ui, "glColor4ui");
pragma Import(C, glColor4us, "glColor4us");
pragma Import(C, glColor3bv, "glColor3bv");
pragma Import(C, glColor3dv, "glColor3dv");
pragma Import(C, glColor3fv, "glColor3fv");
pragma Import(C, glColor3iv, "glColor3iv");
pragma Import(C, glColor3sv, "glColor3sv");
pragma Import(C, glColor3ubv, "glColor3ubv");
pragma Import(C, glColor3uiv, "glColor3uiv");
pragma Import(C, glColor3usv, "glColor3usv");
pragma Import(C, glColor4bv, "glColor4bv");
pragma Import(C, glColor4dv, "glColor4dv");
pragma Import(C, glColor4fv, "glColor4fv");
pragma Import(C, glColor4iv, "glColor4iv");
pragma Import(C, glColor4sv, "glColor4sv");
pragma Import(C, glColor4ubv, "glColor4ubv");
pragma Import(C, glColor4uiv, "glColor4uiv");
pragma Import(C, glColor4usv, "glColor4usv");
pragma Import(C, glTexCoord1d, "glTexCoord1d");
pragma Import(C, glTexCoord1f, "glTexCoord1f");
pragma Import(C, glTexCoord1i, "glTexCoord1i");
pragma Import(C, glTexCoord1s, "glTexCoord1s");
pragma Import(C, glTexCoord2d, "glTexCoord2d");
pragma Import(C, glTexCoord2f, "glTexCoord2f");
pragma Import(C, glTexCoord2i, "glTexCoord2i");
pragma Import(C, glTexCoord2s, "glTexCoord2s");
pragma Import(C, glTexCoord3d, "glTexCoord3d");
pragma Import(C, glTexCoord3f, "glTexCoord3f");
pragma Import(C, glTexCoord3i, "glTexCoord3i");
pragma Import(C, glTexCoord3s, "glTexCoord3s");
pragma Import(C, glTexCoord4d, "glTexCoord4d");
pragma Import(C, glTexCoord4f, "glTexCoord4f");
pragma Import(C, glTexCoord4i, "glTexCoord4i");
pragma Import(C, glTexCoord4s, "glTexCoord4s");
pragma Import(C, glTexCoord1dv, "glTexCoord1dv");
pragma Import(C, glTexCoord1fv, "glTexCoord1fv");
pragma Import(C, glTexCoord1iv, "glTexCoord1iv");
pragma Import(C, glTexCoord1sv, "glTexCoord1sv");
pragma Import(C, glTexCoord2dv, "glTexCoord2dv");
pragma Import(C, glTexCoord2fv, "glTexCoord2fv");
pragma Import(C, glTexCoord2iv, "glTexCoord2iv");
pragma Import(C, glTexCoord2sv, "glTexCoord2sv");
pragma Import(C, glTexCoord3dv, "glTexCoord3dv");
pragma Import(C, glTexCoord3fv, "glTexCoord3fv");
pragma Import(C, glTexCoord3iv, "glTexCoord3iv");
pragma Import(C, glTexCoord3sv, "glTexCoord3sv");
pragma Import(C, glTexCoord4dv, "glTexCoord4dv");
pragma Import(C, glTexCoord4fv, "glTexCoord4fv");
pragma Import(C, glTexCoord4iv, "glTexCoord4iv");
pragma Import(C, glTexCoord4sv, "glTexCoord4sv");
pragma Import(C, glRasterPos2d, "glRasterPos2d");
pragma Import(C, glRasterPos2f, "glRasterPos2f");
pragma Import(C, glRasterPos2i, "glRasterPos2i");
pragma Import(C, glRasterPos2s, "glRasterPos2s");
pragma Import(C, glRasterPos3d, "glRasterPos3d");
pragma Import(C, glRasterPos3f, "glRasterPos3f");
pragma Import(C, glRasterPos3i, "glRasterPos3i");
pragma Import(C, glRasterPos3s, "glRasterPos3s");
pragma Import(C, glRasterPos4d, "glRasterPos4d");
pragma Import(C, glRasterPos4f, "glRasterPos4f");
pragma Import(C, glRasterPos4i, "glRasterPos4i");
pragma Import(C, glRasterPos4s, "glRasterPos4s");
pragma Import(C, glRasterPos2dv, "glRasterPos2dv");
pragma Import(C, glRasterPos2fv, "glRasterPos2fv");
pragma Import(C, glRasterPos2iv, "glRasterPos2iv");
pragma Import(C, glRasterPos2sv, "glRasterPos2sv");
pragma Import(C, glRasterPos3dv, "glRasterPos3dv");
pragma Import(C, glRasterPos3fv, "glRasterPos3fv");
pragma Import(C, glRasterPos3iv, "glRasterPos3iv");
pragma Import(C, glRasterPos3sv, "glRasterPos3sv");
pragma Import(C, glRasterPos4dv, "glRasterPos4dv");
pragma Import(C, glRasterPos4fv, "glRasterPos4fv");
pragma Import(C, glRasterPos4iv, "glRasterPos4iv");
pragma Import(C, glRasterPos4sv, "glRasterPos4sv");
pragma Import(C, glRectd, "glRectd");
pragma Import(C, glRectf, "glRectf");
pragma Import(C, glRecti, "glRecti");
pragma Import(C, glRects, "glRects");
pragma Import(C, glRectdv, "glRectdv");
pragma Import(C, glRectfv, "glRectfv");
pragma Import(C, glRectiv, "glRectiv");
pragma Import(C, glRectsv, "glRectsv");
pragma Import(C, glVertexPointer, "glVertexPointer");
pragma Import(C, glNormalPointer, "glNormalPointer");
pragma Import(C, glColorPointer, "glColorPointer");
pragma Import(C, glIndexPointer, "glIndexPointer");
pragma Import(C, glTexCoordPointer, "glTexCoordPointer");
pragma Import(C, glEdgeFlagPointer, "glEdgeFlagPointer");
pragma Import(C, glGetPointerv, "glGetPointerv");
pragma Import(C, glArrayElement, "glArrayElement");
pragma Import(C, glDrawArrays, "glDrawArrays");
pragma Import(C, glDrawElements, "glDrawElements");
pragma Import(C, glInterleavedArrays, "glInterleavedArrays");
pragma Import(C, glShadeModel, "glShadeModel");
pragma Import(C, glLightf, "glLightf");
pragma Import(C, glLighti, "glLighti");
pragma Import(C, glLightfv, "glLightfv");
pragma Import(C, glLightiv, "glLightiv");
pragma Import(C, glGetLightfv, "glGetLightfv");
pragma Import(C, glGetLightiv, "glGetLightiv");
pragma Import(C, glLightModelf, "glLightModelf");
pragma Import(C, glLightModeli, "glLightModeli");
pragma Import(C, glLightModelfv, "glLightModelfv");
pragma Import(C, glLightModeliv, "glLightModeliv");
pragma Import(C, glMaterialf, "glMaterialf");
pragma Import(C, glMateriali, "glMateriali");
pragma Import(C, glMaterialfv, "glMaterialfv");
pragma Import(C, glMaterialiv, "glMaterialiv");
pragma Import(C, glGetMaterialfv, "glGetMaterialfv");
pragma Import(C, glGetMaterialiv, "glGetMaterialiv");
pragma Import(C, glColorMaterial, "glColorMaterial");
pragma Import(C, glPixelZoom, "glPixelZoom");
pragma Import(C, glPixelStoref, "glPixelStoref");
pragma Import(C, glPixelStorei, "glPixelStorei");
pragma Import(C, glPixelTransferf, "glPixelTransferf");
pragma Import(C, glPixelTransferi, "glPixelTransferi");
pragma Import(C, glPixelMapfv, "glPixelMapfv");
pragma Import(C, glPixelMapuiv, "glPixelMapuiv");
pragma Import(C, glPixelMapusv, "glPixelMapusv");
pragma Import(C, glGetPixelMapfv, "glGetPixelMapfv");
pragma Import(C, glGetPixelMapuiv, "glGetPixelMapuiv");
pragma Import(C, glGetPixelMapusv, "glGetPixelMapusv");
pragma Import(C, glBitmap, "glBitmap");
pragma Import(C, glReadPixels, "glReadPixels");
pragma Import(C, glDrawPixels, "glDrawPixels");
pragma Import(C, glCopyPixels, "glCopyPixels");
pragma Import(C, glStencilFunc, "glStencilFunc");
pragma Import(C, glStencilMask, "glStencilMask");
pragma Import(C, glStencilOp, "glStencilOp");
pragma Import(C, glClearStencil, "glClearStencil");
pragma Import(C, glTexGend, "glTexGend");
pragma Import(C, glTexGenf, "glTexGenf");
pragma Import(C, glTexGeni, "glTexGeni");
pragma Import(C, glTexGendv, "glTexGendv");
pragma Import(C, glTexGenfv, "glTexGenfv");
pragma Import(C, glTexGeniv, "glTexGeniv");
pragma Import(C, glGetTexGendv, "glGetTexGendv");
pragma Import(C, glGetTexGenfv, "glGetTexGenfv");
pragma Import(C, glGetTexGeniv, "glGetTexGeniv");
pragma Import(C, glTexEnvf, "glTexEnvf");
pragma Import(C, glTexEnvi, "glTexEnvi");
pragma Import(C, glTexEnvfv, "glTexEnvfv");
pragma Import(C, glTexEnviv, "glTexEnviv");
pragma Import(C, glGetTexEnvfv, "glGetTexEnvfv");
pragma Import(C, glGetTexEnviv, "glGetTexEnviv");
pragma Import(C, glTexParameterf, "glTexParameterf");
pragma Import(C, glTexParameteri, "glTexParameteri");
pragma Import(C, glTexParameterfv, "glTexParameterfv");
pragma Import(C, glTexParameteriv, "glTexParameteriv");
pragma Import(C, glGetTexParameterfv, "glGetTexParameterfv");
pragma Import(C, glGetTexParameteriv, "glGetTexParameteriv");
pragma Import(C, glGetTexLevelParameterfv, "glGetTexLevelParameterfv");
pragma Import(C, glGetTexLevelParameteriv, "glGetTexLevelParameteriv");
pragma Import(C, glTexImage1D, "glTexImage1D");
pragma Import(C, glTexImage2D, "glTexImage2D");
pragma Import(C, glGetTexImage, "glGetTexImage");
pragma Import(C, glGenTextures, "glGenTextures");
pragma Import(C, glDeleteTextures, "glDeleteTextures");
pragma Import(C, glBindTexture, "glBindTexture");
pragma Import(C, glPrioritizeTextures, "glPrioritizeTextures");
pragma Import(C, glAreTexturesResident, "glAreTexturesResident");
pragma Import(C, glIsTexture, "glIsTexture");
pragma Import(C, glTexSubImage1D, "glTexSubImage1D");
pragma Import(C, glTexSubImage2D, "glTexSubImage2D");
pragma Import(C, glCopyTexImage1D, "glCopyTexImage1D");
pragma Import(C, glCopyTexImage2D, "glCopyTexImage2D");
pragma Import(C, glCopyTexSubImage1D, "glCopyTexSubImage1D");
pragma Import(C, glCopyTexSubImage2D, "glCopyTexSubImage2D");
pragma Import(C, glMap1d, "glMap1d");
pragma Import(C, glMap1f, "glMap1f");
pragma Import(C, glMap2d, "glMap2d");
pragma Import(C, glMap2f, "glMap2f");
pragma Import(C, glGetMapdv, "glGetMapdv");
pragma Import(C, glGetMapfv, "glGetMapfv");
pragma Import(C, glGetMapiv, "glGetMapiv");
pragma Import(C, glEvalCoord1d, "glEvalCoord1d");
pragma Import(C, glEvalCoord1f, "glEvalCoord1f");
pragma Import(C, glEvalCoord1dv, "glEvalCoord1dv");
pragma Import(C, glEvalCoord1fv, "glEvalCoord1fv");
pragma Import(C, glEvalCoord2d, "glEvalCoord2d");
pragma Import(C, glEvalCoord2f, "glEvalCoord2f");
pragma Import(C, glEvalCoord2dv, "glEvalCoord2dv");
pragma Import(C, glEvalCoord2fv, "glEvalCoord2fv");
pragma Import(C, glMapGrid1d, "glMapGrid1d");
pragma Import(C, glMapGrid1f, "glMapGrid1f");
pragma Import(C, glMapGrid2d, "glMapGrid2d");
pragma Import(C, glMapGrid2f, "glMapGrid2f");
pragma Import(C, glEvalPoint1, "glEvalPoint1");
pragma Import(C, glEvalPoint2, "glEvalPoint2");
pragma Import(C, glEvalMesh1, "glEvalMesh1");
pragma Import(C, glEvalMesh2, "glEvalMesh2");
pragma Import(C, glFogf, "glFogf");
pragma Import(C, glFogi, "glFogi");
pragma Import(C, glFogfv, "glFogfv");
pragma Import(C, glFogiv, "glFogiv");
pragma Import(C, glFeedbackBuffer, "glFeedbackBuffer");
pragma Import(C, glPassThrough, "glPassThrough");
pragma Import(C, glSelectBuffer, "glSelectBuffer");
pragma Import(C, glInitNames, "glInitNames");
pragma Import(C, glLoadName, "glLoadName");
pragma Import(C, glPushName, "glPushName");
pragma Import(C, glPopName, "glPopName");
pragma Import(C, glDrawRangeElements, "glDrawRangeElements");
pragma Import(C, glTexImage3D, "glTexImage3D");
pragma Import(C, glTexSubImage3D, "glTexSubImage3D");
pragma Import(C, glCopyTexSubImage3D, "glCopyTexSubImage3D");
pragma Import(C, glColorTable, "glColorTable");
pragma Import(C, glColorSubTable, "glColorSubTable");
pragma Import(C, glColorTableParameteriv, "glColorTableParameteriv");
pragma Import(C, glColorTableParameterfv, "glColorTableParameterfv");
pragma Import(C, glCopyColorSubTable, "glCopyColorSubTable");
pragma Import(C, glCopyColorTable, "glCopyColorTable");
pragma Import(C, glGetColorTable, "glGetColorTable");
pragma Import(C, glGetColorTableParameterfv, "glGetColorTableParameterfv");
pragma Import(C, glGetColorTableParameteriv, "glGetColorTableParameteriv");
pragma Import(C, glBlendEquation, "glBlendEquation");
pragma Import(C, glBlendColor, "glBlendColor");
pragma Import(C, glHistogram, "glHistogram");
pragma Import(C, glResetHistogram, "glResetHistogram");
pragma Import(C, glGetHistogram, "glGetHistogram");
pragma Import(C, glGetHistogramParameterfv, "glGetHistogramParameterfv");
pragma Import(C, glGetHistogramParameteriv, "glGetHistogramParameteriv");
pragma Import(C, glMinmax, "glMinmax");
pragma Import(C, glResetMinmax, "glResetMinmax");
pragma Import(C, glGetMinmax, "glGetMinmax");
pragma Import(C, glGetMinmaxParameterfv, "glGetMinmaxParameterfv");
pragma Import(C, glGetMinmaxParameteriv, "glGetMinmaxParameteriv");
pragma Import(C, glConvolutionFilter1D, "glConvolutionFilter1D");
pragma Import(C, glConvolutionFilter2D, "glConvolutionFilter2D");
pragma Import(C, glConvolutionParameterf, "glConvolutionParameterf");
pragma Import(C, glConvolutionParameterfv, "glConvolutionParameterfv");
pragma Import(C, glConvolutionParameteri, "glConvolutionParameteri");
pragma Import(C, glConvolutionParameteriv, "glConvolutionParameteriv");
pragma Import(C, glCopyConvolutionFilter1D, "glCopyConvolutionFilter1D");
pragma Import(C, glCopyConvolutionFilter2D, "glCopyConvolutionFilter2D");
pragma Import(C, glGetConvolutionFilter, "glGetConvolutionFilter");
pragma Import(C, glGetConvolutionParameterfv, "glGetConvolutionParameterfv");
pragma Import(C, glGetConvolutionParameteriv, "glGetConvolutionParameteriv");
pragma Import(C, glSeparableFilter2D, "glSeparableFilter2D");
pragma Import(C, glGetSeparableFilter, "glGetSeparableFilter");
pragma Import(C, glActiveTexture, "glActiveTexture");
pragma Import(C, glClientActiveTexture, "glClientActiveTexture");
pragma Import(C, glCompressedTexImage1D, "glCompressedTexImage1D");
pragma Import(C, glCompressedTexImage2D, "glCompressedTexImage2D");
pragma Import(C, glCompressedTexImage3D, "glCompressedTexImage3D");
pragma Import(C, glCompressedTexSubImage1D, "glCompressedTexSubImage1D");
pragma Import(C, glCompressedTexSubImage2D, "glCompressedTexSubImage2D");
pragma Import(C, glCompressedTexSubImage3D, "glCompressedTexSubImage3D");
pragma Import(C, glGetCompressedTexImage, "glGetCompressedTexImage");
pragma Import(C, glMultiTexCoord1d, "glMultiTexCoord1d");
pragma Import(C, glMultiTexCoord1dv, "glMultiTexCoord1dv");
pragma Import(C, glMultiTexCoord1f, "glMultiTexCoord1f");
pragma Import(C, glMultiTexCoord1fv, "glMultiTexCoord1fv");
pragma Import(C, glMultiTexCoord1i, "glMultiTexCoord1i");
pragma Import(C, glMultiTexCoord1iv, "glMultiTexCoord1iv");
pragma Import(C, glMultiTexCoord1s, "glMultiTexCoord1s");
pragma Import(C, glMultiTexCoord1sv, "glMultiTexCoord1sv");
pragma Import(C, glMultiTexCoord2d, "glMultiTexCoord2d");
pragma Import(C, glMultiTexCoord2dv, "glMultiTexCoord2dv");
pragma Import(C, glMultiTexCoord2f, "glMultiTexCoord2f");
pragma Import(C, glMultiTexCoord2fv, "glMultiTexCoord2fv");
pragma Import(C, glMultiTexCoord2i, "glMultiTexCoord2i");
pragma Import(C, glMultiTexCoord2iv, "glMultiTexCoord2iv");
pragma Import(C, glMultiTexCoord2s, "glMultiTexCoord2s");
pragma Import(C, glMultiTexCoord2sv, "glMultiTexCoord2sv");
pragma Import(C, glMultiTexCoord3d, "glMultiTexCoord3d");
pragma Import(C, glMultiTexCoord3dv, "glMultiTexCoord3dv");
pragma Import(C, glMultiTexCoord3f, "glMultiTexCoord3f");
pragma Import(C, glMultiTexCoord3fv, "glMultiTexCoord3fv");
pragma Import(C, glMultiTexCoord3i, "glMultiTexCoord3i");
pragma Import(C, glMultiTexCoord3iv, "glMultiTexCoord3iv");
pragma Import(C, glMultiTexCoord3s, "glMultiTexCoord3s");
pragma Import(C, glMultiTexCoord3sv, "glMultiTexCoord3sv");
pragma Import(C, glMultiTexCoord4d, "glMultiTexCoord4d");
pragma Import(C, glMultiTexCoord4dv, "glMultiTexCoord4dv");
pragma Import(C, glMultiTexCoord4f, "glMultiTexCoord4f");
pragma Import(C, glMultiTexCoord4fv, "glMultiTexCoord4fv");
pragma Import(C, glMultiTexCoord4i, "glMultiTexCoord4i");
pragma Import(C, glMultiTexCoord4iv, "glMultiTexCoord4iv");
pragma Import(C, glMultiTexCoord4s, "glMultiTexCoord4s");
pragma Import(C, glMultiTexCoord4sv, "glMultiTexCoord4sv");
pragma Import(C, glLoadTransposeMatrixd, "glLoadTransposeMatrixd");
pragma Import(C, glLoadTransposeMatrixf, "glLoadTransposeMatrixf");
pragma Import(C, glMultTransposeMatrixd, "glMultTransposeMatrixd");
pragma Import(C, glMultTransposeMatrixf, "glMultTransposeMatrixf");
pragma Import(C, glSampleCoverage, "glSampleCoverage");
pragma Import(C, glActiveTextureARB, "glActiveTextureARB");
pragma Import(C, glClientActiveTextureARB, "glClientActiveTextureARB");
pragma Import(C, glMultiTexCoord1dARB, "glMultiTexCoord1dARB");
pragma Import(C, glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB");
pragma Import(C, glMultiTexCoord1fARB, "glMultiTexCoord1fARB");
pragma Import(C, glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB");
pragma Import(C, glMultiTexCoord1iARB, "glMultiTexCoord1iARB");
pragma Import(C, glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB");
pragma Import(C, glMultiTexCoord1sARB, "glMultiTexCoord1sARB");
pragma Import(C, glMultiTexCoord1svARB, "glMultiTexCoord1svARB");
pragma Import(C, glMultiTexCoord2dARB, "glMultiTexCoord2dARB");
pragma Import(C, glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB");
pragma Import(C, glMultiTexCoord2fARB, "glMultiTexCoord2fARB");
pragma Import(C, glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB");
pragma Import(C, glMultiTexCoord2iARB, "glMultiTexCoord2iARB");
pragma Import(C, glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB");
pragma Import(C, glMultiTexCoord2sARB, "glMultiTexCoord2sARB");
pragma Import(C, glMultiTexCoord2svARB, "glMultiTexCoord2svARB");
pragma Import(C, glMultiTexCoord3dARB, "glMultiTexCoord3dARB");
pragma Import(C, glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB");
pragma Import(C, glMultiTexCoord3fARB, "glMultiTexCoord3fARB");
pragma Import(C, glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB");
pragma Import(C, glMultiTexCoord3iARB, "glMultiTexCoord3iARB");
pragma Import(C, glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB");
pragma Import(C, glMultiTexCoord3sARB, "glMultiTexCoord3sARB");
pragma Import(C, glMultiTexCoord3svARB, "glMultiTexCoord3svARB");
pragma Import(C, glMultiTexCoord4dARB, "glMultiTexCoord4dARB");
pragma Import(C, glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB");
pragma Import(C, glMultiTexCoord4fARB, "glMultiTexCoord4fARB");
pragma Import(C, glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB");
pragma Import(C, glMultiTexCoord4iARB, "glMultiTexCoord4iARB");
pragma Import(C, glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB");
pragma Import(C, glMultiTexCoord4sARB, "glMultiTexCoord4sARB");
pragma Import(C, glMultiTexCoord4svARB, "glMultiTexCoord4svARB");
pragma Import(C, glGenQueriesARB, "glGenQueriesARB");
pragma Import(C, glDeleteQueriesARB, "glDeleteQueriesARB");
pragma Import(C, glIsQueryARB, "glIsQueryARB");
pragma Import(C, glBeginQueryARB, "glBeginQueryARB");
pragma Import(C, glEndQueryARB, "glEndQueryARB");
pragma Import(C, glGetQueryivARB, "glGetQueryivARB");
pragma Import(C, glGetQueryObjectivARB, "glGetQueryObjectivARB");
pragma Import(C, glGetQueryObjectuivARB, "glGetQueryObjectuivARB");
pragma Import(C, glEnableTraceMESA, "glEnableTraceMESA");
pragma Import(C, glDisableTraceMESA, "glDisableTraceMESA");
pragma Import(C, glNewTraceMESA, "glNewTraceMESA");
pragma Import(C, glEndTraceMESA, "glEndTraceMESA");
pragma Import(C, glTraceAssertAttribMESA, "glTraceAssertAttribMESA");
pragma Import(C, glTraceCommentMESA, "glTraceCommentMESA");
pragma Import(C, glTraceTextureMESA, "glTraceTextureMESA");
pragma Import(C, glTraceListMESA, "glTraceListMESA");
pragma Import(C, glTracePointerMESA, "glTracePointerMESA");
pragma Import(C, glTracePointerRangeMESA, "glTracePointerRangeMESA");
end GL;
|
programs/oeis/004/A004092.asm | neoneye/loda | 22 | 240244 | <gh_stars>10-100
; A004092: Sum of digits of even numbers.
; 0,2,4,6,8,1,3,5,7,9,2,4,6,8,10,3,5,7,9,11,4,6,8,10,12,5,7,9,11,13,6,8,10,12,14,7,9,11,13,15,8,10,12,14,16,9,11,13,15,17,1,3,5,7,9,2,4,6,8,10,3,5,7,9,11,4,6,8,10,12,5,7,9,11,13,6,8,10,12,14,7,9,11,13,15,8,10,12,14,16,9,11,13,15,17,10,12,14,16,18
mul $0,2
lpb $0
mov $2,$0
div $0,10
mod $2,10
add $1,$2
lpe
mov $0,$1
|
programs/oeis/102/A102091.asm | neoneye/loda | 22 | 26724 | ; A102091: Number of perfect matchings in the C_{2n} X P_3 graph (C_{2n} is the cycle graph on 2n vertices and P_3 is the path graph on 3 vertices).
; 12,32,108,392,1452,5408,20172,75272,280908,1048352,3912492,14601608,54493932,203374112,759002508,2832635912,10571541132,39453528608,147242573292,549516764552,2050824484908,7653781175072,28564300215372,106603419686408,397849378530252,1484794094434592,5541326999208108,20680513902397832,77180728610383212,288042400539135008,1074988873546156812,4011913093645492232,14972663501035812108,55878740910497756192,208542300140955212652,778290459653323094408,2904619538472337164972,10840187694236025565472,40456131238471765096908,150984337259651034822152,563481217800132374191692,2102940533940878461944608,7848280917963381473586732,29290183137912647432402312,109312451633687208256022508,407959623396836185591687712,1522526041953657534110728332,5682144544417793950851225608,21206052135717518269294174092,79142063998452279126325470752,295362203858091598236007708908,1102306751433914113817705364872,4113864801877564857034813750572,15353152456076345314321549637408,57298745022427816400251384799052,213841827633634920286683989558792,798068565512111864746484573436108,2978432434414812538699254304185632,11115661172147138290050532643306412,41484212254173740621502876269040008,154821187844547824195960972432853612,577800539124017556162341013462374432
mov $1,2
mov $2,1
lpb $0
sub $0,1
add $1,$2
add $2,$1
add $1,$2
lpe
add $1,1
mul $1,4
mov $0,$1
|
test/Fail/WrongNamedArgument.agda | cruhland/agda | 1,989 | 3430 | <filename>test/Fail/WrongNamedArgument.agda
module WrongNamedArgument where
postulate
f : {A : Set₁} → A → A
test : Set → Set
test = f {B = Set}
-- Good error:
-- Function does not accept argument {B = _}
-- when checking that {B = Set} are valid arguments to a function of
-- type {A : Set₁} → A → A
|
src/apsepp-test_reporter_class-instant_standard.adb | thierr26/ada-apsepp | 0 | 6161 | <filename>src/apsepp-test_reporter_class-instant_standard.adb
-- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Ada.Text_IO;
with Apsepp.Test_Node_Class;
with Apsepp.Abstract_Early_Test_Case;
package body Apsepp.Test_Reporter_Class.Instant_Standard is
use Test_Node_Class;
----------------------------------------------------------------------------
Child_Acc : constant String := "accessing child";
Child_Acc_1 : constant String := "accessing first child";
Early_R : constant String := "early test routine";
Start : constant String := "Start ";
Cond_Checking : constant String := "condition checking";
Cond_Assert : constant String := "condition assertion";
Early_R_Not_Run : constant String := " (" & Early_R & " not run)";
Test_Assert : constant String := "test assertion";
Ru : constant String := "run";
Unexp_Error : constant String := "UNEXPECTED ERROR while ";
----------------------------------------------------------------------------
function Is_Early_Test (Node_Tag : Tag) return Boolean
is (Is_Descendant_At_Same_Level
(Node_Tag,
Abstract_Early_Test_Case.Early_Test_Case'Tag));
----------------------------------------------------------------------------
function Early_R_Not_Run_Compliment (Node_Tag : Tag;
Str : String) return String
is (Str & (if Is_Early_Test (Node_Tag) then
Early_R_Not_Run
else
""));
----------------------------------------------------------------------------
generic
type Integer_Type is range <>;
Designation : String;
function Kth (K : Integer_Type; K_Avail : Boolean := True) return String;
----------------------------------------------------------------------------
function Kth (K : Integer_Type; K_Avail : Boolean := True) return String is
K_Str : String := (if K_Avail then
Integer_Type'Image (K)
else
" [unavailable]");
begin
K_Str(K_Str'First) := '#';
return Designation & " " & K_Str;
end Kth;
----------------------------------------------------------------------------
function Kth_Routine_Access is new Kth
(Integer_Type => Test_Routine_Count,
Designation => "access to test routine");
----------------------------------------------------------------------------
function Kth_Routine_Setup is new Kth
(Integer_Type => Test_Routine_Count,
Designation => "setup of test routine");
----------------------------------------------------------------------------
function Kth_Routine is new Kth (Integer_Type => Test_Routine_Count,
Designation => "test routine");
----------------------------------------------------------------------------
function From_Kth_Routine is new Kth (Integer_Type => Test_Routine_Count,
Designation => "test routines");
----------------------------------------------------------------------------
function To_Kth_Routine is new Kth (Integer_Type => Test_Routine_Count,
Designation => " to");
----------------------------------------------------------------------------
function Kth_Test_Assert is new Kth (Integer_Type => Test_Assert_Count,
Designation => Test_Assert);
----------------------------------------------------------------------------
function Kth_Kth (K_A_Avail : Boolean;
K_A : Test_Assert_Count;
K_R : Test_Routine_Count) return String
is (Kth_Test_Assert (K_A, K_A_Avail) & " for " & Kth_Routine (K_R));
----------------------------------------------------------------------------
function Routine_Range (First_K, Last_K : Test_Routine_Count) return String
is (if Last_K = First_K then
Kth_Routine (First_K)
else
From_Kth_Routine (First_K) & To_Kth_Routine (Last_K));
----------------------------------------------------------------------------
function Outcome_Prepended (Outcome : Test_Outcome;
Head : String) return String
is ((case Outcome is
when Failed => "FAILED",
when Passed => "Passed") & " " & Head);
----------------------------------------------------------------------------
function Test_Node_W_Tag (Node_Tag : Tag) return String
is (" test node with tag " & Expanded_Name (Node_Tag));
----------------------------------------------------------------------------
procedure Put_Exception_Message
(Name, Message : String;
Quiet_If_Zero_Length_Message : Boolean := False) is
Zero_Length_Name : constant Boolean := Name'Length = 0;
Zero_Length_Message : constant Boolean := Message'Length = 0;
Quiet : constant Boolean := Zero_Length_Message
and then
Quiet_If_Zero_Length_Message;
begin
if not Quiet then
Ada.Text_IO.New_Line;
if Zero_Length_Message then
Ada.Text_IO.Put_Line(Name);
else
Ada.Text_IO.Put_Line(Name & (if Zero_Length_Name then
""
else
": ") & Message);
end if;
Ada.Text_IO.New_Line;
end if;
end Put_Exception_Message;
----------------------------------------------------------------------------
procedure Put_Report_Line (Head : String;
Node_Tag : Tag;
Prev_Brother : Tag := No_Tag) is
use Ada.Text_IO;
Next_Brother : constant String
:= (if Prev_Brother = No_Tag then
""
else
" (next sibling of" & Test_Node_W_Tag (Prev_Brother) & ")");
begin
Put_Line (Head & " for" & Test_Node_W_Tag (Node_Tag) & Next_Brother);
end Put_Report_Line;
----------------------------------------------------------------------------
procedure Report_Test_Assert_Outcome
(Node_Tag : Tag;
Outcome : Test_Outcome;
K : Test_Routine_Count;
Assert_Num_Avail : Boolean;
Assert_Num : Test_Assert_Count) is
begin
Put_Report_Line
(Outcome_Prepended (Outcome,
(if Is_Early_Test (Node_Tag) then
Early_R
else
Kth_Kth (Assert_Num_Avail, Assert_Num, K))),
Node_Tag);
end Report_Test_Assert_Outcome;
----------------------------------------------------------------------------
protected body Test_Reporter_Instant_Standard is
-----------------------------------------------------
function Is_Conflicting_Node_Tag (Node_Tag : Tag) return Boolean
is (False);
-----------------------------------------------------
procedure Provide_Node_Lineage (Node_Lineage : Tag_Array) is
pragma Unreferenced (Node_Lineage);
begin
null;
end Provide_Node_Lineage;
-----------------------------------------------------
procedure Report_Failed_Child_Test_Node_Access
(Node_Tag : Tag;
Previous_Child_Tag : Tag;
E : Exception_Occurrence) is
begin
if Previous_Child_Tag = No_Tag then
Put_Report_Line
(Outcome_Prepended (Failed, Child_Acc_1), Node_Tag);
else
Put_Report_Line (Outcome_Prepended (Failed, Child_Acc),
Node_Tag,
Previous_Child_Tag);
end if;
Put_Exception_Message (Exception_Name (E), Exception_Message (E));
end Report_Failed_Child_Test_Node_Access;
-----------------------------------------------------
procedure Report_Unexpected_Node_Cond_Check_Error
(Node_Tag : Tag;
E : Exception_Occurrence) is
begin
Put_Report_Line (Unexp_Error & "checking condition", Node_Tag);
Put_Exception_Message (Exception_Name (E), Exception_Message (E));
end Report_Unexpected_Node_Cond_Check_Error;
-----------------------------------------------------
procedure Report_Unexpected_Node_Run_Error
(Node_Tag : Tag;
E : Exception_Occurrence) is
use Ada.Text_IO;
begin
Put_Line (Unexp_Error & "running" & Test_Node_W_Tag (Node_Tag));
Put_Exception_Message (Exception_Name (E), Exception_Message (E));
end Report_Unexpected_Node_Run_Error;
-----------------------------------------------------
procedure Report_Node_Cond_Check_Start (Node_Tag : Tag) is
begin
Put_Report_Line (Start & Cond_Checking, Node_Tag);
end Report_Node_Cond_Check_Start;
-----------------------------------------------------
procedure Report_Passed_Node_Cond_Check (Node_Tag : Tag) is
begin
Put_Report_Line (Outcome_Prepended (Passed, Cond_Checking), Node_Tag);
end Report_Passed_Node_Cond_Check;
-----------------------------------------------------
procedure Report_Failed_Node_Cond_Check (Node_Tag : Tag) is
begin
Put_Report_Line (Outcome_Prepended
(Failed,
Early_R_Not_Run_Compliment (Node_Tag,
Cond_Checking)),
Node_Tag);
end Report_Failed_Node_Cond_Check;
-----------------------------------------------------
procedure Report_Passed_Node_Cond_Assert (Node_Tag : Tag) is
begin
Put_Report_Line (Outcome_Prepended (Passed, Cond_Assert), Node_Tag);
end Report_Passed_Node_Cond_Assert;
-----------------------------------------------------
procedure Report_Failed_Node_Cond_Assert (Node_Tag : Tag) is
begin
Put_Report_Line (Outcome_Prepended
(Failed,
Early_R_Not_Run_Compliment (Node_Tag,
Cond_Assert)),
Node_Tag);
end Report_Failed_Node_Cond_Assert;
-----------------------------------------------------
procedure Report_Node_Run_Start (Node_Tag : Tag) is
begin
Put_Report_Line (Start & Ru, Node_Tag);
end Report_Node_Run_Start;
-----------------------------------------------------
procedure Report_Test_Routine_Start
(Node_Tag : Tag;
K : Test_Routine_Count) is
begin
if not Is_Early_Test (Node_Tag) then
Put_Report_Line (Start & Kth_Routine (K), Node_Tag);
end if;
end Report_Test_Routine_Start;
-----------------------------------------------------
procedure Report_Test_Routines_Cancellation
(Node_Tag : Tag;
First_K, Last_K : Test_Routine_Count) is
begin
Put_Report_Line ("CANCELLED " & Routine_Range (First_K, Last_K),
Node_Tag);
end Report_Test_Routines_Cancellation;
-----------------------------------------------------
procedure Report_Failed_Test_Routine_Access
(Node_Tag : Tag;
K : Test_Routine_Count;
E : Exception_Occurrence) is
begin
Put_Report_Line
(Outcome_Prepended (Failed, Kth_Routine_Access (K)), Node_Tag);
Put_Exception_Message (Exception_Name (E), Exception_Message (E));
end Report_Failed_Test_Routine_Access;
-----------------------------------------------------
procedure Report_Failed_Test_Routine_Setup
(Node_Tag : Tag;
K : Test_Routine_Count;
E : Exception_Occurrence) is
begin
Put_Report_Line
(Outcome_Prepended (Failed, Kth_Routine_Setup (K)), Node_Tag);
Put_Exception_Message (Exception_Name (E), Exception_Message (E));
end Report_Failed_Test_Routine_Setup;
-----------------------------------------------------
procedure Report_Passed_Test_Assert
(Node_Tag : Tag;
K : Test_Routine_Count;
Assert_Num_Avail : Boolean;
Assert_Num : Test_Assert_Count) is
begin
Report_Test_Assert_Outcome
(Node_Tag, Passed, K, Assert_Num_Avail, Assert_Num);
end Report_Passed_Test_Assert;
-----------------------------------------------------
procedure Report_Failed_Test_Assert
(Node_Tag : Tag;
K : Test_Routine_Count;
Assert_Num_Avail : Boolean;
Assert_Num : Test_Assert_Count;
E : Exception_Occurrence) is
begin
Report_Test_Assert_Outcome
(Node_Tag, Failed, K, Assert_Num_Avail, Assert_Num);
Put_Exception_Message ((if Is_Early_Test (Node_Tag) then
""
else
"Message"), Exception_Message (E), True);
end Report_Failed_Test_Assert;
-----------------------------------------------------
procedure Report_Unexpected_Routine_Exception
(Node_Tag : Tag;
K : Test_Routine_Count;
E : Exception_Occurrence) is
begin
Put_Report_Line
(Unexp_Error & "running " & Kth_Routine (K), Node_Tag);
Put_Exception_Message (Exception_Name (E), Exception_Message (E));
end Report_Unexpected_Routine_Exception;
-----------------------------------------------------
procedure Report_Passed_Test_Routine
(Node_Tag : Tag;
K : Test_Routine_Count) is
begin
if not Is_Early_Test (Node_Tag) then
Put_Report_Line
(Outcome_Prepended (Passed, Kth_Routine (K)), Node_Tag);
end if;
end Report_Passed_Test_Routine;
-----------------------------------------------------
procedure Report_Failed_Test_Routine
(Node_Tag : Tag;
K : Test_Routine_Count) is
begin
if not Is_Early_Test (Node_Tag) then
Put_Report_Line
(Outcome_Prepended (Failed, Kth_Routine (K)), Node_Tag);
end if;
end Report_Failed_Test_Routine;
-----------------------------------------------------
procedure Report_Passed_Node_Run (Node_Tag : Tag) is
begin
Put_Report_Line (Outcome_Prepended (Passed, Ru), Node_Tag);
end Report_Passed_Node_Run;
-----------------------------------------------------
procedure Report_Failed_Node_Run (Node_Tag : Tag) is
begin
Put_Report_Line (Outcome_Prepended (Failed, Ru), Node_Tag);
end Report_Failed_Node_Run;
-----------------------------------------------------
end Test_Reporter_Instant_Standard;
----------------------------------------------------------------------------
end Apsepp.Test_Reporter_Class.Instant_Standard;
|
Commands/Miscellaneous Commands suite/system info/host name of (get system info).applescript | looking-for-a-job/applescript-examples | 1 | 1827 | #!/usr/bin/osascript
host name of (get system info) |
Grammar/xpath.g4 | vijaygill/GillSoft.ExpressionEvaluator | 1 | 446 | <gh_stars>1-10
grammar xpath;
path: (PATHSEP pathElement)+;
pathElement: ax = axis ? elem = element (LBRAC filt = expression RBRAC)?
| attr = attribute;
expression: LPAREN subExpr = expression RPAREN
| left = expression (AND | OR) right = expression
| attr = attribute (NOT_EQ | EQ) value = string
| constVal = (TRUE | FALSE);
axis: name = AXIS COLONCOLON;
namespacePrefix: name = IDENT;
attribute: AT (ns = namespacePrefix COLON)? name = IDENT;
element: (ns = namespacePrefix COLON)? name = IDENT;
string: stringSingleQuote | stringDoubleQuote;
stringSingleQuote: '\'' (~'\'')* '\'';
stringDoubleQuote: '"' (~'"')* '"';
unknowns: Unknown*;
AND: 'and';
OR: 'or';
NOT_EQ: '!=';
TRUE: 'true';
FALSE: 'false';
AXIS:
AXIS_ANCESTOR
| AXIS_ANCESTOR_OR_SELF
| AXIS_ATTRIBUTE
| AXIS_CHILD
| AXIS_DESCENDANT
| AXIS_DESCENDANT_OR_SELF
| AXIS_FOLLOWING
| AXIS_FOLLOWNG_SUBLING
| AXIS_NAMESPACE
| AXIS_PARENT
| AXIS_PRECEDING
| AXIS_PRECEDING_SIBLING
| AXIS_SELF;
AXIS_ANCESTOR: 'ancestor';
AXIS_ANCESTOR_OR_SELF: 'ancestor-or-self';
AXIS_ATTRIBUTE: 'attribute';
AXIS_CHILD: 'child';
AXIS_DESCENDANT: 'descendant';
AXIS_DESCENDANT_OR_SELF: 'descendant-or-self';
AXIS_FOLLOWING: 'following';
AXIS_NAMESPACE: 'namespace';
AXIS_PARENT: 'parent';
AXIS_PRECEDING: 'preceding';
AXIS_PRECEDING_SIBLING: 'preceding-sibling';
AXIS_FOLLOWNG_SUBLING: 'following-sibling';
AXIS_SELF: 'self';
fragment HASH: '#';
fragment HYPHEN: '-';
fragment UNDERSCORE: '_';
fragment DIGIT: '0' ..'9';
fragment LETTER: 'a' ..'z' | 'A' ..'Z';
fragment NUMBER: DIGIT+;
fragment WORD: LETTER+;
fragment DOT: '.';
IDENT:
HASH
| LETTER (LETTER | DIGIT | HYPHEN | UNDERSCORE | DOT)*;
PATHSEP: '/';
LBRAC: '[';
RBRAC: ']';
AT: '@';
EQ: '==' | '=';
COLON: ':';
COLONCOLON: '::';
LPAREN : '(';
RPAREN : ')';
WS: (' ' | '\t' ) -> skip;
Whitespace: ('\n' | '\r') -> skip;
Unknown: .; |
src/DTGP/State.agda | larrytheliquid/dtgp | 9 | 855 | <reponame>larrytheliquid/dtgp
module DTGP.State where
open import Data.Product
infixl 1 _>>=_ _=<<_
data State (S A : Set) : Set where
state : (S → A × S) → State S A
runState : ∀ {S A} → State S A → S → A × S
runState (state f) = f
return : ∀ {S A} → A → State S A
return a = state (λ s → a , s)
_>>=_ : {S A B : Set} → State S A → (A → State S B) → State S B
state h >>= f = state λ s →
let a,newState = h s
stateg = f (proj₁ a,newState)
in
runState stateg (proj₂ a,newState)
_=<<_ : {S A B : Set} → (A → State S B) → State S A → State S B
f =<< stateh = stateh >>= f
|
_build/dispatcher/jmp_ippsGFpGetSize_d62217af.asm | zyktrcn/ippcp | 1 | 86260 | extern m7_ippsGFpGetSize:function
extern n8_ippsGFpGetSize:function
extern y8_ippsGFpGetSize:function
extern e9_ippsGFpGetSize:function
extern l9_ippsGFpGetSize:function
extern n0_ippsGFpGetSize:function
extern k0_ippsGFpGetSize:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpGetSize
.Larraddr_ippsGFpGetSize:
dq m7_ippsGFpGetSize
dq n8_ippsGFpGetSize
dq y8_ippsGFpGetSize
dq e9_ippsGFpGetSize
dq l9_ippsGFpGetSize
dq n0_ippsGFpGetSize
dq k0_ippsGFpGetSize
segment .text
global ippsGFpGetSize:function (ippsGFpGetSize.LEndippsGFpGetSize - ippsGFpGetSize)
.Lin_ippsGFpGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpGetSize]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpGetSize:
|
programs/oeis/059/A059015.asm | neoneye/loda | 22 | 97785 | ; A059015: Total number of 0's in binary expansions of 0, ..., n.
; 1,1,2,2,4,5,6,6,9,11,13,14,16,17,18,18,22,25,28,30,33,35,37,38,41,43,45,46,48,49,50,50,55,59,63,66,70,73,76,78,82,85,88,90,93,95,97,98,102,105,108,110,113,115,117,118,121,123,125,126,128,129,130,130,136,141,146,150,155,159,163,166,171,175,179,182,186,189,192,194,199,203,207,210,214,217,220,222,226,229,232,234,237,239,241,242,247,251,255,258
lpb $0
mov $2,$0
sub $0,1
seq $2,80791 ; Number of nonleading 0's in binary expansion of n.
add $1,$2
lpe
add $1,1
mov $0,$1
|
test/Fail/NoTerminationCheck2.agda | redfish64/autonomic-agda | 3 | 3360 | -- 2012-03-08 Andreas
module NoTerminationCheck2 where
{-# NON_TERMINATING #-}
data D : Set where
lam : (D -> D) -> D
-- error: works only for function definitions
|
Variables/CopyXX12ScaledToXX18.asm | ped7g/EliteNext | 9 | 11542 | <filename>Variables/CopyXX12ScaledToXX18.asm
CopyXX12ScaledToXX18:
CopyResultToDrawCam:
ldCopyByte XX12 ,XX18 ; XX12+0 => XX18+0 Set XX18(2 0) = dot_sidev
ldCopyByte XX12+1 ,XX18+2 ; XX12+1 => XX18+2
ldCopyByte XX12+2 ,XX18+3 ; XX12+2 => XX18+3 Set XX12+1 => XX18+2
ldCopyByte XX12+3 ,XX18+5 ; XX12+3 => XX18+5
ldCopyByte XX12+4 ,XX18+6 ; XX12+4 => XX18+6 Set XX18(8 6) = dot_nosev
ldCopyByte XX12+5 ,XX18+8 ; XX12+5 => XX18+8
ret
|
Rune.g4 | mikijov/rune | 0 | 6942 | grammar Rune;
// put imports here
@header {
import (
"github.com/mikijov/rune/vm"
)
var _ vm.Type // inhibit unused import error
}
// generally not needed at all as everything in current and imported packages is accessible
@members {
}
/* tokens { EOF } */
program
: statements+=statement* EOF
;
//programStatement
//: declaration
//| typeDeclaration
//| function
//;
statement
: declaration
| typeDeclaration
| function
| returnStatement
| expression ';'
| ifStatement
| loop
;
declaration
: identifier=IDENTIFIER ':=' value=expression ';'
| identifier=IDENTIFIER ':' type_=typeName ('=' value=expression ';')?
;
typeDeclaration
: 'type' identifier=IDENTIFIER ':' type_=typeName
;
typeName: typeName2 (isarray='[' ']')?;
typeName2
: 'int' # SimpleType
| 'real' # SimpleType
| 'string' # SimpleType
| 'bool' # SimpleType
| 'func' '(' (paramTypes+=typeName2 (',' paramTypes+=typeName2)*)? ')' (':' returnType=typeName2)? # FunctionType
| 'struct' '{' combinedField* '}' # StructType
| name=IDENTIFIER # CustomType
// | 'list' | 'map'
;
function
: 'func' (iface=IDENTIFIER '.')? identifier=IDENTIFIER params=paramDecl (':' returnType=typeName)? body=scope
;
paramDecl
: '(' (paramGroup+=combinedParam (',' paramGroup+=combinedParam)*)? ')'
;
combinedParam
: names+=IDENTIFIER (',' names+=IDENTIFIER)* ':' paramType=typeName
;
combinedField
: names+=IDENTIFIER (',' names+=IDENTIFIER)* ':' paramType=typeName
;
scope
: '{' statements+=statement* '}'
;
returnStatement
: 'return' (retVal=expression ';')?
;
ifStatement
: 'if' conditions+=expression effects+=scope
('else' 'if' conditions+=expression effects+=scope)*
('else' alternative=scope)?
;
// loop: 'loop' (kind=('while'|'until') condition=expression)? body=scope
loop: 'loop' (kind='while' condition=expression)? body=scope
;
expression: expression2;
expression2
: '(' value=expression2 ')' # ExpressionPassthrough
| name=IDENTIFIER '(' (params+=expression2 (',' params+=expression2)*)? ')' # FunctionCall
| base=expression2 '.' name=IDENTIFIER '(' (params+=expression2 (',' params+=expression2)*)? ')' # MethodCall
| base=expression2 '.' field=IDENTIFIER # FieldSelector
| array=expression2 '[' index=expression2 ']' # ArraySelector
| op=unaryOp value=expression2 # UnaryExpression
| left=expression2 op=('*'|'/'|'%'|'&') right=expression2 # BinaryExpression
| left=expression2 op=('+'|'-'|'|'|'^') right=expression2 # BinaryExpression
// | left=expression2 op=('<<'|'>>') right=expression2 # BinaryExpression
| left=expression2 op=('<'|'>'|'=='|'>='|'<='|'!=') right=expression2 # BinaryExpression
| left=expression2 op='and' right=expression2 # BinaryExpression
| left=expression2 op='or' right=expression2 # BinaryExpression
| left=expression2 op=assignmentOp right=expression2 # Assignment
| value=literal # LiteralPassthrough
| 'func' params=paramDecl (':' returnType=typeName)? body=scope # Lambda
| name=IDENTIFIER # VariableExpression
;
unaryOp
/* 'not' | '!' | '+' | '*' | '&' | '~' etc... */
: '-'
;
assignmentOp
/* : '<<=' | '>>=' | '**=' | '//=' */
: '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^='
;
literal
: value=REAL_LITERAL # RealLiteral
| value=INTEGER_LITERAL # IntegerLiteral
| value=BOOLEAN_LITERAL # BooleanLiteral
;
INTEGER_LITERAL: [0-9]+ ;
REAL_LITERAL: [0-9]* '.' [0-9]+ ;
BOOLEAN_LITERAL: 'true' | 'false' ;
IDENTIFIER: [a-zA-Z_] [a-zA-Z0-9_]* ;
LINENDING: '\r'? '\n' -> skip;
WHITESPACE: ('\t' | ' ')+ -> skip;
COMMENT: '#' ~[\r\n]* -> skip;
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_384.asm | ljhsiun2/medusa | 9 | 8068 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xd8cf, %rsi
lea addresses_UC_ht+0x299c, %rdi
nop
nop
nop
inc %rdx
mov $28, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $22690, %r12
lea addresses_A_ht+0x1e25f, %rsi
lea addresses_A_ht+0xc20f, %rdi
dec %r14
mov $23, %rcx
rep movsl
nop
nop
cmp $41782, %r14
lea addresses_UC_ht+0x190f, %rcx
nop
cmp $16473, %r15
movups (%rcx), %xmm5
vpextrq $1, %xmm5, %r12
nop
nop
nop
nop
nop
xor $27175, %rsi
lea addresses_A_ht+0x50f, %r14
nop
nop
nop
nop
nop
xor %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
and $0xffffffffffffffc0, %r14
movntdq %xmm6, (%r14)
nop
dec %r12
lea addresses_WC_ht+0x588f, %r14
nop
nop
and %r15, %r15
mov (%r14), %r12
nop
nop
nop
nop
xor $12486, %r12
lea addresses_UC_ht+0x90f, %r15
nop
nop
nop
nop
nop
xor %r14, %r14
movb (%r15), %r12b
nop
nop
inc %rsi
lea addresses_WC_ht+0x3b8f, %rdi
nop
nop
nop
nop
lfence
mov (%rdi), %r14d
nop
nop
inc %rdi
lea addresses_UC_ht+0xdd0f, %rsi
lea addresses_normal_ht+0x9ef5, %rdi
nop
nop
nop
nop
and %rax, %rax
mov $57, %rcx
rep movsw
nop
nop
nop
nop
cmp $50852, %rdi
lea addresses_WT_ht+0x124b3, %rcx
inc %r15
mov $0x6162636465666768, %rdi
movq %rdi, (%rcx)
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x1be0f, %r14
nop
sub %rsi, %rsi
mov (%r14), %rax
nop
inc %r12
lea addresses_normal_ht+0x101cf, %rsi
lea addresses_WT_ht+0x143d3, %rdi
nop
sub $37020, %r14
mov $23, %rcx
rep movsb
nop
nop
nop
xor %r15, %r15
lea addresses_WT_ht+0x1771f, %rsi
lea addresses_WT_ht+0x1160f, %rdi
nop
nop
dec %r12
mov $49, %rcx
rep movsb
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_UC_ht+0x18ff7, %r15
cmp $15837, %rax
vmovups (%r15), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %r14
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_WC_ht+0x1734f, %rax
cmp $1502, %rdx
mov (%rax), %r14
and %r12, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %rax
// Faulty Load
lea addresses_D+0xde0f, %r13
add %r15, %r15
mov (%r13), %r8w
lea oracles, %r14
and $0xff, %r8
shlq $12, %r8
mov (%r14,%r8,1), %r8
pop %rax
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_A_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': True, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
src/test/ref/struct-28.asm | jbrandwood/kickc | 2 | 25478 | // Minimal struct with C-Standard behavior - member is array, copy assignment
// Commodore 64 PRG executable file
.file [name="struct-28.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.const SIZEOF_STRUCT_POINT = 3
.const OFFSET_STRUCT_POINT_INITIALS = 1
.label SCREEN = $400
.segment Code
main: {
.label point1 = 2
// __ma struct Point point1 = { 2, { 'j', 'g' } }
ldy #SIZEOF_STRUCT_POINT
!:
lda __0-1,y
sta point1-1,y
dey
bne !-
// SCREEN[0] = point1.x
lda.z point1
sta SCREEN
// SCREEN[1] = point1.initials[0]
lda.z point1+OFFSET_STRUCT_POINT_INITIALS
sta SCREEN+1
// SCREEN[2] = point1.initials[1]
lda.z point1+OFFSET_STRUCT_POINT_INITIALS+1
sta SCREEN+2
// }
rts
}
.segment Data
__0: .byte 2, 'j', 'g'
|
oeis/142/A142743.asm | neoneye/loda-programs | 11 | 81030 | ; A142743: Primes congruent to 16 mod 59.
; Submitted by <NAME>
; 193,311,547,1019,1373,1609,2081,2671,2789,3733,3851,4441,5503,5857,6211,6329,8689,8807,9043,9161,9397,10223,10459,12347,12583,13291,13763,13999,15061,15887,16477,16831,17539,17657,18719,19073,19309,19427,21433,21787,22259,22613,23203,23321,23557,23911,24029,25799,26153,26861,28277,28513,28631,28867,29221,29339,30047,30637,31699,31817,33469,33587,33941,34649,35593,37363,37717,38189,38543,39133,39251,39841,40903,41257,41611,41729,42083,42437,43499,43853,44089,44207,44797,46567,47629,48337,48809
mov $1,37
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,59
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,117
|
Source/P-Numbers.asm | Svarov-RZM/xci | 0 | 86200 | ; P-Numbers.asm
;
; Copyright (c) 2019, <NAME> (Svarov-RZM)
; You may distribute under the terms of BSD 2-Clause License
; as specified in the LICENSE.TXT file.
;
; >>>=== NUMBERS-SPECIFIC PROCEDURES ===<<<
; => Do simple calculations <=
; IN:
; AX = [CHAR] Indicates mode:
; '=' = Perform assignment
; '+' = Perform addition
; '-' = Perform subtraction
; '(' = Perform decrement
; ')' = Perform increment
; ECX = [INT] LHS
; EDX = [INT] RHS: Not used for '()'
; OUT:
; EAX = [INT] Result
CALCULATE.SIMPLE:
; Determine action
cmp al,'='
je C.S.ASS; He-he, ass... it's from assignment
cmp al,'+'
je C.S.ADD
cmp al,'-'
je C.S.SUB
cmp al,'('
je C.S.DEC
cmp al,')'
je C.S.INC
jmp short C.S.RET; Unknown action
; Assignment
C.S.ASS:
mov ecx,edx
jmp short C.S.RET
; Addition
C.S.ADD:
add ecx,edx
jmp short C.S.RET
; Subtraction
C.S.SUB:
sub ecx,edx
jmp short C.S.RET
; Decrement
C.S.DEC:
dec ecx
jmp short C.S.RET
; Increment
C.S.INC:
inc ecx
C.S.RET:
xchg eax,ecx; EAX = Result
Ret
; => Convert binary number to string as DEC <=
; TO FIX: This procedure can't handle negative numbers
; IN:
; EAX = [INT] Convert what
; ESI = [POINTER] Where to save converted number
CONVERT.BIN.TO.STR:
; Start of resulting string
push esi
; Indicate a sign
; By default it's a positive number (0)
; if change to -1 - we'll add '-' as prefix
push ebx
; Check for negative sign and invert it if so
; It's just easier to work with positive numbers
cmp eax,MAX_POSITIVE_INT
jnae C.B.T.S.POS
neg eax
mov [esp],eax
; Set up temp space
C.B.T.S.POS:
mov ecx,32; Place to hold a 32/64bit integer
Call SKIP.CHARACTERS
Call ADD.NULL.TERMINATOR
; Convert the number
; We continuously divide EAX by decimal base (10) and write down
; the remainder until there's nothing left (EAX = 0)
C.B.T.S.LOOP:
mov ecx,10; Divider
Call DIVIDE.INTEGER
; To next position
Call REWIND.CHAR
; Add char to destination and set next position
; 30h = '0' in ACSII
add cx,30h
mov [esi],cx
; Continue until we have nothing to divide
test eax,eax
jne C.B.T.S.LOOP
; Check if we need to add sign
pop eax
test eax,eax
je C.B.T.S.COPY; Nope
; Add negative sign
Call REWIND.CHAR
mov ax,'-'
mov [esi],ax
; Restore pointer where we should place result
; and transfer string to requested position
C.B.T.S.COPY:
pop edi
Call COPY.NT.STR
Ret
; => Convert decimal number to binary <=
; IN:
; ESI = [POINTER] Decimal string
; OUT:
; EAX = [INT] Binary representation
CONVERT.DECIMAL.STRING.TO.INTEGER:
; Place for sign flag and result
push ebx; Sign
push ebx; Result
; Check for positive/negative number
Call GET.DIRECTION.OF.DEC.NUMBER
test ecx,ecx
je C.D.S.T.I.FIN
mov [esp+4],ecx
; Convert to binary
C.D.S.T.I.LOOP:
; Validate character
xor eax,eax
Call ACQUIRE.CHAR
cmp ax,'0'
jb C.D.S.T.I.FIN
cmp ax,'9'
ja C.D.S.T.I.FIN
push eax; Save char
; Multiply previous result by 10
mov eax,10
mov ecx,[esp+4]; Previous result
Call MULTIPLY.INTEGER
mov [esp+4],eax; Previous result
; Convert ASCII number to binary
pop eax
sub eax,'0'
add [esp],eax; Add current digit
jmp short C.D.S.T.I.LOOP
; Finalize
C.D.S.T.I.FIN:
pop eax; Result
pop ecx; Sign
; Invert sign if negative number
cmp ecx,-1
jne C.D.S.T.I.RET
neg eax
C.D.S.T.I.RET:
Ret
; => Convert hexadecimal number to binary <=
; IN:
; ESI = [POINTER] Hex string
; OUT:
; EAX = [INT] Binary representation
CONVERT.HEXADECIMAL.STRING.TO.INTEGER:
; Place for sign flag and result
push ebx; Sign
push ebx; Result
; Check for positive/negative number
Call GET.DIRECTION.OF.HEX.NUMBER
test ecx,ecx
je C.H.S.T.I.FIN
mov [esp+4],ecx
C.H.S.T.I.LOOP:
; Validate character
xor eax,eax
Call ACQUIRE.CHAR
cmp ax,'a'
jb C.H.S.T.I.HEXA; Lower: Maybe user typed 'A' instead of 'a'?
cmp ax,'f'
ja C.H.S.T.I.FIN; Greater: Not a number - abort here
sub ax,'a'
add ax,10
jmp short C.H.S.T.I.SAVE
C.H.S.T.I.HEXA:
cmp al,'A'
jb C.H.S.T.I.DEC; Lower: Maybe it's a decimal value?
cmp al,'F'
ja C.H.S.T.I.FIN; Greater: Not a number - abort here
sub ax,'A'
add ax,10
jmp short C.H.S.T.I.SAVE
C.H.S.T.I.DEC:
cmp ax,'0'
jb C.H.S.T.I.FIN
cmp ax,'9'
ja C.H.S.T.I.FIN
sub ax,'0'
; Save char
C.H.S.T.I.SAVE:
push eax
; Multiply previous result by 10
mov eax,16
mov ecx,[esp+4]; Previous result
Call MULTIPLY.INTEGER
mov [esp+4],eax; Previous result
; Convert ASCII number to binary
pop eax
add [esp],eax; Add current digit
jmp short C.H.S.T.I.LOOP
; Finalize
C.H.S.T.I.FIN:
pop eax; Result
pop ecx; Sign
; Invert sign if negative number
cmp ecx,-1
jne C.H.S.T.I.RET
neg eax
C.H.S.T.I.RET:
Ret
; => Convert array of numbers to binary representation (WORD array) <=
; IN:
; ESI = [POINTER] Numbers array (hex)
; EDI = [POINTER] Save where [PRESERVED]
; OUT:
; ECX = [INT] How many numbers were copied
CONVERT.STR.ARRAY.TO.WORD:
push edi
sub esp,4; Local var: Array counter
mov [esp],ebx; Null array counter
; Loop over all numbers
C.S.A.T.W.LOOP:
cmp [esi],bx
je C.S.A.T.W.END; No more numbers
; Convert to binary
Call CONVERT.HEXADECIMAL.STRING.TO.INTEGER
; Save result
mov [edi],ax
add edi,2; Next number
inc dword [esp]; Array counter
jmp short C.S.A.T.W.LOOP
; Finalizing
C.S.A.T.W.END:
pop ecx; Array counter (WORD)
pop edi; Start of numbers
Ret
; => Divide integer using CPU <=
; IN:
; EAX = [INT] Divident
; ECX = [INT] Divider
; OUT:
; EAX = [INT] Result
; ECX = [INT] Remainder
DIVIDE.INTEGER.CPU:
DIVIDE.INTEGER:; Alias
; Check for division by zero
; We don't want to destroy the Universe... yet.
test ecx,ecx
je EXIT
; Convert EAX to EDX:EAX
cdq
; Divide and place remainder in ECX
idiv ecx
xchg ecx,edx
Ret
; => Get direction of decimal number <=
; IN:
; ESI = [POINTER] Number
; OUT:
; ESI = [POINTER] Number, '-' will be skipped if negative
; ECX = [INT] -1 if negative, 1 if positive, 0 if not a number
GET.DIRECTION.OF.DEC.NUMBER:
; Temp result, will be OUT in the end
; Positive by default
mov ecx,1
; See if negative
Call GET.CHAR
cmp ax,'-'
jne G.D.O.D.N.NUM
Call SKIP.CHAR.FORWARD
neg ecx
; See if it's number at all
Call GET.CHAR
G.D.O.D.N.NUM:
cmp ax,'0'
jb G.D.O.D.N.BAD
cmp ax,'9'
ja G.D.O.D.N.BAD
Ret
; Not a number
G.D.O.D.N.BAD:
xor ecx,ecx
Ret
; => Get direction of hexadecimal number <=
; IN:
; ESI = [POINTER] Number
; OUT:
; ESI = [POINTER] Number, '-' will be skipped if negative
; ECX = [INT] -1 if negative, 1 if positive, 0 if not a number
GET.DIRECTION.OF.HEX.NUMBER:
; Temp result, will be OUT in the end
; Positive by default
mov ecx,1
; See if negative
Call GET.CHAR
cmp ax,'-'
jne G.D.O.H.N.NUM
Call SKIP.CHAR.FORWARD
neg ecx
; See if it's number at all
Call GET.CHAR
G.D.O.H.N.NUM:
cmp ax,'a'
jb G.D.O.H.N.HEXA; Lower: Maybe user typed 'A' instead of 'a'?
cmp ax,'f'
ja G.D.O.H.N.BAD; Greater: Not a number - abort here
jmp short G.D.O.H.N.OK
G.D.O.H.N.HEXA:
cmp al,'A'
jb G.D.O.H.N.DEC; Lower: Maybe it's a decimal value?
cmp al,'F'
ja G.D.O.H.N.BAD; Greater: Not a number - abort here
jmp short G.D.O.H.N.OK
G.D.O.H.N.DEC:
cmp ax,'0'
jb G.D.O.H.N.BAD
cmp ax,'9'
ja G.D.O.H.N.BAD
G.D.O.H.N.OK:
Ret
; Not a number
G.D.O.H.N.BAD:
xor ecx,ecx
Ret
; => Multiply (using CPU) <=
; IN:
; ECX = [INT] Multiplicand
; EAX = [INT] Multiplier
; OUT:
; EAX = [INT] Result
; NOTE: We omit EDX part so result can't be greater than 32bit
MULTIPLY.INTEGER.CPU.OPTIMIZED:
MULTIPLY.INTEGER:; Alias
xchg ecx,eax
imul ecx
Ret
; => Process numerical comparison <=
; IN:
; EAX = [DWORD] Type: eq/ne/gt/etc
; ECX = [INT] LHS
; EDX = [INT] RHS
; OUT:
; AL = [BYTE] TRUE/FALSE
PROCESS.NUMERICAL.COMPARISON:
; Check type
cmp eax,PREFIX_EQU
je P.N.C.EQU
cmp eax,PREFIX_NEQ
je P.N.C.NEQ
cmp eax,PREFIX_GEQ
je P.N.C.GEQ
cmp eax,PREFIX_LEQ
je P.N.C.LEQ
cmp eax,PREFIX_GTR
je P.N.C.GTR
cmp eax,PREFIX_LSS
je P.N.C.LSS
; Check if equals
P.N.C.EQU:
cmp ecx,edx
je P.N.C.RET.GOOD
jmp short P.N.C.RET.BAD
; Check if not equals
P.N.C.NEQ:
cmp ecx,edx
jne P.N.C.RET.GOOD
jmp short P.N.C.RET.BAD
; Check if greater or equals
P.N.C.GEQ:
cmp ecx,edx
jge P.N.C.RET.GOOD
jmp short P.N.C.RET.BAD
; Check if less or equals
P.N.C.LEQ:
cmp ecx,edx
jle P.N.C.RET.GOOD
jmp short P.N.C.RET.BAD
; Check if greater
P.N.C.GTR:
cmp ecx,edx
jg P.N.C.RET.GOOD
jmp short P.N.C.RET.BAD
; Check if less
P.N.C.LSS:
cmp ecx,edx
jl P.N.C.RET.GOOD
jmp short P.N.C.RET.BAD
P.N.C.RET.GOOD:
mov al,1
jmp short P.N.C.RET
P.N.C.RET.BAD:
xor al,al
P.N.C.RET:
Ret |
src/x86-64/syscalls/debug.asm | ohnx/ge | 0 | 1432 | ; =============================================================================
; BareMetal -- a 64-bit OS written in Assembly for x86-64 systems
; Copyright (C) 2008-2015 Return Infinity -- see LICENSE.TXT
;
; Debug functions
; =============================================================================
; -----------------------------------------------------------------------------
; os_debug_dump_reg -- Dump the values on the registers to the screen (For debug purposes)
; IN: Nothing
; OUT: Nothing, all registers preserved
os_debug_dump_reg:
pushfq ; Push the registers used by this function
push rsi
push rbx
push rax
pushfq ; Push the flags to the stack
push r15 ; Push all of the registers to the stack
push r14
push r13
push r12
push r11
push r10
push r9
push r8
push rsp
push rbp
push rdi
push rsi
push rdx
push rcx
push rbx
push rax
mov byte [os_debug_dump_reg_stage], 0x00 ; Reset the stage to 0 since we are starting
os_debug_dump_reg_next:
mov rsi, os_debug_dump_reg_string00
xor rax, rax
xor rbx, rbx
mov al, [os_debug_dump_reg_stage]
mov bl, 5 ; Each string is 5 bytes
mul bl ; AX = BL x AL
add rsi, rax ; Add the offset to get to the correct string
call os_output ; Print the register name
pop rax ; Pop the register from the stack
call os_debug_dump_rax ; Print the hex string value of RAX
inc byte [os_debug_dump_reg_stage]
cmp byte [os_debug_dump_reg_stage], 0x11 ; Check to see if all 16 registers as well as the flags are displayed
jne os_debug_dump_reg_next
os_debug_dump_reg_done:
call os_print_newline
pop rax
pop rbx
pop rsi
popfq
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; os_debug_dump_mem -- Dump some memory content to the screen
; IN: RSI = Start of memory address to dump
; RCX = Number of bytes to dump
; OUT: Nothing, all registers preserved
os_debug_dump_mem:
push rsi
push rcx ; Counter
push rdx ; Total number of bytes to display
push rax
cmp rcx, 0 ; Bail out if no bytes were requested
je os_debug_dump_mem_done
mov rax, rsi
and rax, 0x0F ; Isolate the low 4 bytes of RSI
add rcx, rax ; Add to round up the number of bytes needed
mov rdx, rcx ; Save the total number of bytes to display
add rdx, 15 ; Make sure we print out another line if needed
and cl, 0xF0
and dl, 0xF0
shr rsi, 4 ; Round the starting memory address
shl rsi, 4
os_debug_dump_mem_print_address:
mov rax, rsi
call os_debug_dump_rax
push rsi
mov rsi, divider4
call os_output
pop rsi
os_debug_dump_mem_print_contents:
lodsq
bswap rax ; Switch Endianness
call os_debug_dump_rax
push rsi
mov rsi, divider2
call os_output
pop rsi
lodsq
bswap rax ; Switch Endianness
call os_debug_dump_rax
push rsi
mov rsi, divider4
call os_output
pop rsi
os_debug_dump_mem_print_ascii:
sub rsi, 0x10
xor rcx, rcx ; Clear the counter
os_debug_dump_mem_print_ascii_next:
lodsb
call os_output_char
add rcx, 1
cmp rcx, 16
jne os_debug_dump_mem_print_ascii_next
sub rdx, 16
cmp rdx, 0
je os_debug_dump_mem_done
call os_print_newline
jmp os_debug_dump_mem_print_address
os_debug_dump_mem_done:
pop rax
pop rcx
pop rdx
pop rsi
ret
divider4: db ' ', 0
divider2: db ' ', 0
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; os_debug_dump_(rax|eax|ax|al) -- Dump content of RAX, EAX, AX, or AL to the screen in hex format
; IN: RAX = content to dump
; OUT: Nothing, all registers preserved
os_debug_dump_rax:
rol rax, 8
call os_debug_dump_al
rol rax, 8
call os_debug_dump_al
rol rax, 8
call os_debug_dump_al
rol rax, 8
call os_debug_dump_al
rol rax, 32
os_debug_dump_eax:
rol eax, 8
call os_debug_dump_al
rol eax, 8
call os_debug_dump_al
rol eax, 16
os_debug_dump_ax:
rol ax, 8
call os_debug_dump_al
rol ax, 8
os_debug_dump_al:
push rbx
push rax
mov rbx, hextable
push rax ; Save RAX since we work in 2 parts
shr al, 4 ; Shift high 4 bits into low 4 bits
xlatb
call os_output_char
pop rax
and al, 0x0f ; Clear the high 4 bits
xlatb
call os_output_char
pop rax
pop rbx
ret
; -----------------------------------------------------------------------------
; =============================================================================
; EOF
|
examples/io/main.adb | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 26560 | with Interfaces; use Interfaces;
with STM32GD.Board;
procedure Main is
begin
STM32GD.Board.Init;
STM32GD.Board.Text_IO.Put_Line ("Hello, World!");
STM32GD.Board.Text_IO.Put_Integer (Integer'Last); STM32GD.Board.Text_IO.New_Line;
STM32GD.Board.Text_IO.Put_Integer (Integer'First + 1); STM32GD.Board.Text_IO.New_Line;
STM32GD.Board.Text_IO.Put_Hex (Unsigned_32'Last); STM32GD.Board.Text_IO.New_Line;
STM32GD.Board.Text_IO.Put_Hex (16#1234_5678#, 4); STM32GD.Board.Text_IO.New_Line;
STM32GD.Board.Text_IO.Put_Hex (16#1234#, 8); STM32GD.Board.Text_IO.New_Line;
STM32GD.Board.Text_IO.Hex_Dump ("Short string");
STM32GD.Board.Text_IO.Hex_Dump ("Hex dump of a longer string 1234");
end Main;
|
programs/oeis/163/A163812.asm | karttu/loda | 0 | 166249 | <gh_stars>0
; A163812: Expansion of (1 - x^5) * (1 - x^6) / ((1 - x) * (1 - x^10)) in powers of x.
; 1,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1
mov $1,$0
mov $0,2
mov $3,4
mov $4,$1
sub $4,4
lpb $0,1
sub $4,2
mov $0,$4
add $0,1
add $0,$4
add $0,12
mov $2,$0
div $0,10
mov $1,1
mul $1,$3
mod $2,10
mul $2,2
mov $3,$0
mov $0,1
sub $1,$2
trn $1,1
mov $5,1
lpe
sub $1,$5
pow $1,$3
|
thesisExamples/VecFlip.agda | JoeyEremondi/lambda-pi-constraint | 16 | 5627 | <gh_stars>10-100
module VecFlip where
open import AgdaPrelude
goodNil : Vec Nat Zero
goodNil = Nil Nat
badNil : Vec Zero Nat
badNil = Nil Nat
|
include/sf-network-packet.ads | danva994/ASFML-1.6 | 1 | 11816 | -- ////////////////////////////////////////////////////////////
-- //
-- // 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.Network.Types;
package Sf.Network.Packet is
use Sf.Config;
use Sf.Network.Types;
-- ////////////////////////////////////////////////////////////
-- /// Create a new empty packet
-- ///
-- /// \return A new sfPacket object
-- ///
-- ////////////////////////////////////////////////////////////
function sfPacket_Create return sfPacket_Ptr;
-- ////////////////////////////////////////////////////////////
-- /// Destroy an existing packet
-- ///
-- /// \param Packet : Packet to delete
-- ///
-- ////////////////////////////////////////////////////////////
procedure sfPacket_Destroy (Packet : sfPacket_Ptr);
-- ////////////////////////////////////////////////////////////
-- /// Append data to the end of a packet
-- ///
-- /// \param Packet : Packet to fill
-- /// \param Data : Pointer to the bytes to append
-- /// \param SizeInBytes : Number of bytes to append
-- ///
-- ////////////////////////////////////////////////////////////
procedure sfPacket_Append (Packet : sfPacket_Ptr; Data : sfVoid_Ptr; SizeInBytes : sfSize_t);
-- ////////////////////////////////////////////////////////////
-- /// Clear all the data of a packet
-- ///
-- /// \param Packet : Packet to clear
-- ///
-- ///////////////////////////////////////////////////////////
procedure sfPacket_Clear (Packet : sfPacket_Ptr);
-- ////////////////////////////////////////////////////////////
-- /// Get a pointer to the data contained in a packet
-- /// Warning : the returned pointer may be invalid after you
-- /// append data to the packet
-- ///
-- /// \param Packet : Packet to get data from
-- ///
-- /// \return Pointer to the data
-- ///
-- ////////////////////////////////////////////////////////////
function sfPacket_GetData (Packet : sfPacket_Ptr) return sfInt8_Ptr;
-- ////////////////////////////////////////////////////////////
-- /// Get the size of the data contained in a packet
-- ///
-- /// \param Packet : Packet to get data size from
-- ///
-- /// \return Data size, in bytes
-- ///
-- ////////////////////////////////////////////////////////////
function sfPacket_GetDataSize (Packet : sfPacket_Ptr) return sfSize_t;
-- ////////////////////////////////////////////////////////////
-- /// Tell if the reading position has reached the end of the packet
-- ///
-- /// \param Packet : Packet to check
-- ///
-- /// \return sfTrue if all data have been read into the packet
-- ///
-- ////////////////////////////////////////////////////////////
function sfPacket_EndOfPacket (Packet : sfPacket_Ptr) return sfBool;
-- ////////////////////////////////////////////////////////////
-- /// Return the validity of packet
-- ///
-- /// \param Packet : Packet to check
-- ///
-- /// \return sfTrue if last data extraction from packet was successful
-- ///
-- ////////////////////////////////////////////////////////////
function sfPacket_CanRead (Packet : sfPacket_Ptr) return sfBool;
-- ////////////////////////////////////////////////////////////
-- /// Functions to extract data from a packet
-- ///
-- /// \param Packet : Packet to read
-- ///
-- ////////////////////////////////////////////////////////////
function sfPacket_ReadBool (Packet : sfPacket_Ptr) return sfBool;
function sfPacket_ReadInt8 (Packet : sfPacket_Ptr) return sfInt8;
function sfPacket_ReadUint8 (Packet : sfPacket_Ptr) return sfUint8;
function sfPacket_ReadInt16 (Packet : sfPacket_Ptr) return sfInt16;
function sfPacket_ReadUint16 (Packet : sfPacket_Ptr) return sfUint16;
function sfPacket_ReadInt32 (Packet : sfPacket_Ptr) return sfInt32;
function sfPacket_ReadUint32 (Packet : sfPacket_Ptr) return sfUint32;
function sfPacket_ReadFloat (Packet : sfPacket_Ptr) return Float;
function sfPacket_ReadDouble (Packet : sfPacket_Ptr) return Long_Float;
procedure sfPacket_ReadString (Packet : sfPacket_Ptr; Str : out String);
procedure sfPacket_ReadWideString (Packet : sfPacket_Ptr; Str : sfUint32_Ptr);
-- ////////////////////////////////////////////////////////////
-- /// Functions to insert data into a packet
-- ///
-- /// \param Packet : Packet to write
-- ///
-- ////////////////////////////////////////////////////////////
procedure sfPacket_WriteBool (Packet : sfPacket_Ptr; arg2 : sfBool);
procedure sfPacket_WriteInt8 (Packet : sfPacket_Ptr; arg2 : sfInt8);
procedure sfPacket_WriteUint8 (Packet : sfPacket_Ptr; arg2 : sfUint8);
procedure sfPacket_WriteInt16 (Packet : sfPacket_Ptr; arg2 : sfInt16);
procedure sfPacket_WriteUint16 (Packet : sfPacket_Ptr; arg2 : sfUint16);
procedure sfPacket_WriteInt32 (Packet : sfPacket_Ptr; arg2 : sfInt32);
procedure sfPacket_WriteUint32 (Packet : sfPacket_Ptr; arg2 : sfUint32);
procedure sfPacket_WriteFloat (Packet : sfPacket_Ptr; arg2 : Float);
procedure sfPacket_WriteDouble (Packet : sfPacket_Ptr; arg2 : Long_Float);
procedure sfPacket_WriteString (Packet : sfPacket_Ptr; Str : String);
procedure sfPacket_WriteWideString (Packet : sfPacket_Ptr; Str : sfUint32_Ptr);
private
pragma Import (C, sfPacket_Create, "sfPacket_Create");
pragma Import (C, sfPacket_Destroy, "sfPacket_Destroy");
pragma Import (C, sfPacket_Append, "sfPacket_Append");
pragma Import (C, sfPacket_Clear, "sfPacket_Clear");
pragma Import (C, sfPacket_GetData, "sfPacket_GetData");
pragma Import (C, sfPacket_GetDataSize, "sfPacket_GetDataSize");
pragma Import (C, sfPacket_EndOfPacket, "sfPacket_EndOfPacket");
pragma Import (C, sfPacket_CanRead, "sfPacket_CanRead");
pragma Import (C, sfPacket_ReadBool, "sfPacket_ReadBool");
pragma Import (C, sfPacket_ReadInt8, "sfPacket_ReadInt8");
pragma Import (C, sfPacket_ReadUint8, "sfPacket_ReadUint8");
pragma Import (C, sfPacket_ReadInt16, "sfPacket_ReadInt16");
pragma Import (C, sfPacket_ReadUint16, "sfPacket_ReadUint16");
pragma Import (C, sfPacket_ReadInt32, "sfPacket_ReadInt32");
pragma Import (C, sfPacket_ReadUint32, "sfPacket_ReadUint32");
pragma Import (C, sfPacket_ReadFloat, "sfPacket_ReadFloat");
pragma Import (C, sfPacket_ReadDouble, "sfPacket_ReadDouble");
pragma Import (C, sfPacket_ReadWideString, "sfPacket_ReadWideString");
pragma Import (C, sfPacket_WriteBool, "sfPacket_WriteBool");
pragma Import (C, sfPacket_WriteInt8, "sfPacket_WriteInt8");
pragma Import (C, sfPacket_WriteUint8, "sfPacket_WriteUint8");
pragma Import (C, sfPacket_WriteInt16, "sfPacket_WriteInt16");
pragma Import (C, sfPacket_WriteUint16, "sfPacket_WriteUint16");
pragma Import (C, sfPacket_WriteInt32, "sfPacket_WriteInt32");
pragma Import (C, sfPacket_WriteUint32, "sfPacket_WriteUint32");
pragma Import (C, sfPacket_WriteFloat, "sfPacket_WriteFloat");
pragma Import (C, sfPacket_WriteDouble, "sfPacket_WriteDouble");
pragma Import (C, sfPacket_WriteWideString, "sfPacket_WriteWideString");
end Sf.Network.Packet;
|
gasp/source/mmi-applet-gasp.adb | charlie5/playAda | 0 | 29704 | <reponame>charlie5/playAda<gh_stars>0
with
openGL.Palette,
mmi.Camera.forge,
mmi.Sprite,
mmi.Events,
lace.Observer,
lace.event.Utility.local,
ada.Unchecked_Deallocation;
package body mmi.Applet.gasp
is
use Math;
package std_Gasp renames standard.Gasp;
gasp_world_Id : constant mmi. world_Id := 1;
gasp_camera_Id : constant mmi.camera_Id := 1;
procedure define (Self : in View; Name : in String)
is
use openGL.Palette,
lace.event.Utility;
the_world_Info : constant world_Info_view := new world_Info;
the_World : constant std_Gasp.World.view := std_Gasp.World.forge.new_World (Name,
Self.Renderer);
the_Camera : constant mmi.Camera.View := mmi.Camera.forge.new_Camera;
begin
the_World.restore;
the_world_Info.World := mmi.World.view (the_World);
the_Camera.set_viewport_Size (Self.Window.Width, Self.Window.Height);
the_Camera.Renderer_is (Self.Renderer);
the_Camera.Site_is ((0.0, 0.0, 100.0));
the_world_Info.Cameras.append (the_Camera);
Self.Worlds .append (the_world_Info);
Self.Renderer.Background_is (Black);
end define;
package body Forge
is
function new_Applet (Name : in String;
use_Window : in mmi.Window.view) return View
is
Self : constant View := new Item' (mmi.Applet.Forge.to_Applet (Name, use_Window)
with others => <>);
begin
define (Self, Name);
return Self;
end new_Applet;
end Forge;
procedure free (Self : in out View)
is
procedure deallocate is new ada.Unchecked_Deallocation (Item'Class, View);
begin
Self.gasp_World.store;
Self.destroy;
deallocate (Self);
end free;
function gasp_World (Self : in Item) return standard.gasp.World.view
is
begin
return standard.gasp.World.view (Self.World (gasp_world_Id));
end gasp_World;
function mmi_World (Self : in Item) return mmi.World.view
is
begin
return Self.World (gasp_world_Id);
end mmi_World;
function mmi_Camera (Self : in Item) return mmi.Camera.view
is
begin
return Self.Camera (gasp_world_Id, gasp_camera_Id);
end mmi_Camera;
overriding
procedure freshen (Self : in out Item)
is
use MMI.Keyboard, linear_Algebra, Algebra_3d;
begin
freshen (mmi.Applet.item (Self));
if Self.gasp_World.Pod.Speed /= (0.0, 0.0, 0.0)
then
if Self.pod_Direction /= Normalised (Self.gasp_World.Pod.Speed)
then
Self.pod_Direction := Normalised (Self.gasp_World.Pod.Speed);
end if;
end if;
Self.gasp_World.Pod.Spin_is (get_Rotation (Look_at (Eye => Self.gasp_World.Pod.Site,
Center => Self.gasp_World.Pod.Site + Self.pod_Direction * 10.0,
Up => z_Rotation_from (Self.pod_Roll) * (0.0, 1.0, 0.0))));
Self.Camera (1, 1).Site_is (Self.gasp_World.Pod.Site);
Self.Camera (1, 1).world_Rotation_is (Self.gasp_World.Pod.Spin);
case Self.last_Keypress
is
when KP1 => Self.pod_Roll := Self.pod_Roll + 0.05;
when KP2 => null;
when KP3 => Self.pod_Roll := Self.pod_Roll - 0.05;
when KP4 => Self.gasp_World.Pod.apply_Force ( ((-1.0, 0.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when KP5 => Self.gasp_World.Pod.apply_Force ( (( 0.0, 0.0, 1.0) * 0.1) * (Self.gasp_World.Pod.Spin));
when KP6 => Self.gasp_World.Pod.apply_Force ( (( 1.0, 0.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when KP8 => Self.gasp_World.Pod.apply_Force ( (( 0.0, 0.0, -1.0) * 0.1) * (Self.gasp_World.Pod.Spin));
when KP7 => Self.gasp_World.Pod.apply_Torque_impulse (0.005 * ( 0.0, -1.0, 0.0));
when KP9 => Self.gasp_World.Pod.apply_Torque_impulse (0.005 * ( 0.0, 1.0, 0.0));
when KP_PLUS => Self.gasp_World.Pod.apply_Force ( (( 0.0, 1.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when ENTER => Self.gasp_World.Pod.apply_Force ( (( 0.0, -1.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when others => null;
end case;
end freshen;
end mmi.Applet.gasp;
|
ls.asm | joeofportland/project4final | 0 | 397 |
_ls: file format elf32-i386
Disassembly of section .text:
00000000 <fmtname>:
#include "user.h"
#include "fs.h"
char*
fmtname(char *path)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 53 push %ebx
4: 83 ec 24 sub $0x24,%esp
static char buf[DIRSIZ+1];
char *p;
// Find first character after last slash.
for(p=path+strlen(path); p >= path && *p != '/'; p--)
7: 8b 45 08 mov 0x8(%ebp),%eax
a: 89 04 24 mov %eax,(%esp)
d: e8 dd 03 00 00 call 3ef <strlen>
12: 8b 55 08 mov 0x8(%ebp),%edx
15: 01 d0 add %edx,%eax
17: 89 45 f4 mov %eax,-0xc(%ebp)
1a: eb 04 jmp 20 <fmtname+0x20>
1c: 83 6d f4 01 subl $0x1,-0xc(%ebp)
20: 8b 45 f4 mov -0xc(%ebp),%eax
23: 3b 45 08 cmp 0x8(%ebp),%eax
26: 72 0a jb 32 <fmtname+0x32>
28: 8b 45 f4 mov -0xc(%ebp),%eax
2b: 0f b6 00 movzbl (%eax),%eax
2e: 3c 2f cmp $0x2f,%al
30: 75 ea jne 1c <fmtname+0x1c>
;
p++;
32: 83 45 f4 01 addl $0x1,-0xc(%ebp)
// Return blank-padded name.
if(strlen(p) >= DIRSIZ)
36: 8b 45 f4 mov -0xc(%ebp),%eax
39: 89 04 24 mov %eax,(%esp)
3c: e8 ae 03 00 00 call 3ef <strlen>
41: 83 f8 0d cmp $0xd,%eax
44: 76 05 jbe 4b <fmtname+0x4b>
return p;
46: 8b 45 f4 mov -0xc(%ebp),%eax
49: eb 5f jmp aa <fmtname+0xaa>
memmove(buf, p, strlen(p));
4b: 8b 45 f4 mov -0xc(%ebp),%eax
4e: 89 04 24 mov %eax,(%esp)
51: e8 99 03 00 00 call 3ef <strlen>
56: 89 44 24 08 mov %eax,0x8(%esp)
5a: 8b 45 f4 mov -0xc(%ebp),%eax
5d: 89 44 24 04 mov %eax,0x4(%esp)
61: c7 04 24 54 0e 00 00 movl $0xe54,(%esp)
68: e8 11 05 00 00 call 57e <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
6d: 8b 45 f4 mov -0xc(%ebp),%eax
70: 89 04 24 mov %eax,(%esp)
73: e8 77 03 00 00 call 3ef <strlen>
78: ba 0e 00 00 00 mov $0xe,%edx
7d: 89 d3 mov %edx,%ebx
7f: 29 c3 sub %eax,%ebx
81: 8b 45 f4 mov -0xc(%ebp),%eax
84: 89 04 24 mov %eax,(%esp)
87: e8 63 03 00 00 call 3ef <strlen>
8c: 05 54 0e 00 00 add $0xe54,%eax
91: 89 5c 24 08 mov %ebx,0x8(%esp)
95: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
9c: 00
9d: 89 04 24 mov %eax,(%esp)
a0: e8 71 03 00 00 call 416 <memset>
return buf;
a5: b8 54 0e 00 00 mov $0xe54,%eax
}
aa: 83 c4 24 add $0x24,%esp
ad: 5b pop %ebx
ae: 5d pop %ebp
af: c3 ret
000000b0 <ls>:
void
ls(char *path)
{
b0: 55 push %ebp
b1: 89 e5 mov %esp,%ebp
b3: 57 push %edi
b4: 56 push %esi
b5: 53 push %ebx
b6: 81 ec 5c 02 00 00 sub $0x25c,%esp
char buf[512], *p;
int fd;
struct dirent de;
struct stat st;
if((fd = open(path, 0)) < 0){
bc: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
c3: 00
c4: 8b 45 08 mov 0x8(%ebp),%eax
c7: 89 04 24 mov %eax,(%esp)
ca: e8 34 05 00 00 call 603 <open>
cf: 89 45 e4 mov %eax,-0x1c(%ebp)
d2: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
d6: 79 20 jns f8 <ls+0x48>
printf(2, "ls: cannot open %s\n", path);
d8: 8b 45 08 mov 0x8(%ebp),%eax
db: 89 44 24 08 mov %eax,0x8(%esp)
df: c7 44 24 04 57 0b 00 movl $0xb57,0x4(%esp)
e6: 00
e7: c7 04 24 02 00 00 00 movl $0x2,(%esp)
ee: e8 98 06 00 00 call 78b <printf>
return;
f3: e9 01 02 00 00 jmp 2f9 <ls+0x249>
}
if(fstat(fd, &st) < 0){
f8: 8d 85 bc fd ff ff lea -0x244(%ebp),%eax
fe: 89 44 24 04 mov %eax,0x4(%esp)
102: 8b 45 e4 mov -0x1c(%ebp),%eax
105: 89 04 24 mov %eax,(%esp)
108: e8 0e 05 00 00 call 61b <fstat>
10d: 85 c0 test %eax,%eax
10f: 79 2b jns 13c <ls+0x8c>
printf(2, "ls: cannot stat %s\n", path);
111: 8b 45 08 mov 0x8(%ebp),%eax
114: 89 44 24 08 mov %eax,0x8(%esp)
118: c7 44 24 04 6b 0b 00 movl $0xb6b,0x4(%esp)
11f: 00
120: c7 04 24 02 00 00 00 movl $0x2,(%esp)
127: e8 5f 06 00 00 call 78b <printf>
close(fd);
12c: 8b 45 e4 mov -0x1c(%ebp),%eax
12f: 89 04 24 mov %eax,(%esp)
132: e8 b4 04 00 00 call 5eb <close>
return;
137: e9 bd 01 00 00 jmp 2f9 <ls+0x249>
}
switch(st.type){
13c: 0f b7 85 bc fd ff ff movzwl -0x244(%ebp),%eax
143: 98 cwtl
144: 83 f8 01 cmp $0x1,%eax
147: 74 53 je 19c <ls+0xec>
149: 83 f8 02 cmp $0x2,%eax
14c: 0f 85 9c 01 00 00 jne 2ee <ls+0x23e>
case T_FILE:
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
152: 8b bd cc fd ff ff mov -0x234(%ebp),%edi
158: 8b b5 c4 fd ff ff mov -0x23c(%ebp),%esi
15e: 0f b7 85 bc fd ff ff movzwl -0x244(%ebp),%eax
165: 0f bf d8 movswl %ax,%ebx
168: 8b 45 08 mov 0x8(%ebp),%eax
16b: 89 04 24 mov %eax,(%esp)
16e: e8 8d fe ff ff call 0 <fmtname>
173: 89 7c 24 14 mov %edi,0x14(%esp)
177: 89 74 24 10 mov %esi,0x10(%esp)
17b: 89 5c 24 0c mov %ebx,0xc(%esp)
17f: 89 44 24 08 mov %eax,0x8(%esp)
183: c7 44 24 04 7f 0b 00 movl $0xb7f,0x4(%esp)
18a: 00
18b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
192: e8 f4 05 00 00 call 78b <printf>
break;
197: e9 52 01 00 00 jmp 2ee <ls+0x23e>
case T_DIR:
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
19c: 8b 45 08 mov 0x8(%ebp),%eax
19f: 89 04 24 mov %eax,(%esp)
1a2: e8 48 02 00 00 call 3ef <strlen>
1a7: 83 c0 10 add $0x10,%eax
1aa: 3d 00 02 00 00 cmp $0x200,%eax
1af: 76 19 jbe 1ca <ls+0x11a>
printf(1, "ls: path too long\n");
1b1: c7 44 24 04 8c 0b 00 movl $0xb8c,0x4(%esp)
1b8: 00
1b9: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1c0: e8 c6 05 00 00 call 78b <printf>
break;
1c5: e9 24 01 00 00 jmp 2ee <ls+0x23e>
}
strcpy(buf, path);
1ca: 8b 45 08 mov 0x8(%ebp),%eax
1cd: 89 44 24 04 mov %eax,0x4(%esp)
1d1: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax
1d7: 89 04 24 mov %eax,(%esp)
1da: e8 a1 01 00 00 call 380 <strcpy>
p = buf+strlen(buf);
1df: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax
1e5: 89 04 24 mov %eax,(%esp)
1e8: e8 02 02 00 00 call 3ef <strlen>
1ed: 8d 95 e0 fd ff ff lea -0x220(%ebp),%edx
1f3: 01 d0 add %edx,%eax
1f5: 89 45 e0 mov %eax,-0x20(%ebp)
*p++ = '/';
1f8: 8b 45 e0 mov -0x20(%ebp),%eax
1fb: 8d 50 01 lea 0x1(%eax),%edx
1fe: 89 55 e0 mov %edx,-0x20(%ebp)
201: c6 00 2f movb $0x2f,(%eax)
while(read(fd, &de, sizeof(de)) == sizeof(de)){
204: e9 be 00 00 00 jmp 2c7 <ls+0x217>
if(de.inum == 0)
209: 0f b7 85 d0 fd ff ff movzwl -0x230(%ebp),%eax
210: 66 85 c0 test %ax,%ax
213: 75 05 jne 21a <ls+0x16a>
continue;
215: e9 ad 00 00 00 jmp 2c7 <ls+0x217>
memmove(p, de.name, DIRSIZ);
21a: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
221: 00
222: 8d 85 d0 fd ff ff lea -0x230(%ebp),%eax
228: 83 c0 02 add $0x2,%eax
22b: 89 44 24 04 mov %eax,0x4(%esp)
22f: 8b 45 e0 mov -0x20(%ebp),%eax
232: 89 04 24 mov %eax,(%esp)
235: e8 44 03 00 00 call 57e <memmove>
p[DIRSIZ] = 0;
23a: 8b 45 e0 mov -0x20(%ebp),%eax
23d: 83 c0 0e add $0xe,%eax
240: c6 00 00 movb $0x0,(%eax)
if(stat(buf, &st) < 0){
243: 8d 85 bc fd ff ff lea -0x244(%ebp),%eax
249: 89 44 24 04 mov %eax,0x4(%esp)
24d: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax
253: 89 04 24 mov %eax,(%esp)
256: e8 88 02 00 00 call 4e3 <stat>
25b: 85 c0 test %eax,%eax
25d: 79 20 jns 27f <ls+0x1cf>
printf(1, "ls: cannot stat %s\n", buf);
25f: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax
265: 89 44 24 08 mov %eax,0x8(%esp)
269: c7 44 24 04 6b 0b 00 movl $0xb6b,0x4(%esp)
270: 00
271: c7 04 24 01 00 00 00 movl $0x1,(%esp)
278: e8 0e 05 00 00 call 78b <printf>
continue;
27d: eb 48 jmp 2c7 <ls+0x217>
}
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
27f: 8b bd cc fd ff ff mov -0x234(%ebp),%edi
285: 8b b5 c4 fd ff ff mov -0x23c(%ebp),%esi
28b: 0f b7 85 bc fd ff ff movzwl -0x244(%ebp),%eax
292: 0f bf d8 movswl %ax,%ebx
295: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax
29b: 89 04 24 mov %eax,(%esp)
29e: e8 5d fd ff ff call 0 <fmtname>
2a3: 89 7c 24 14 mov %edi,0x14(%esp)
2a7: 89 74 24 10 mov %esi,0x10(%esp)
2ab: 89 5c 24 0c mov %ebx,0xc(%esp)
2af: 89 44 24 08 mov %eax,0x8(%esp)
2b3: c7 44 24 04 7f 0b 00 movl $0xb7f,0x4(%esp)
2ba: 00
2bb: c7 04 24 01 00 00 00 movl $0x1,(%esp)
2c2: e8 c4 04 00 00 call 78b <printf>
break;
}
strcpy(buf, path);
p = buf+strlen(buf);
*p++ = '/';
while(read(fd, &de, sizeof(de)) == sizeof(de)){
2c7: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
2ce: 00
2cf: 8d 85 d0 fd ff ff lea -0x230(%ebp),%eax
2d5: 89 44 24 04 mov %eax,0x4(%esp)
2d9: 8b 45 e4 mov -0x1c(%ebp),%eax
2dc: 89 04 24 mov %eax,(%esp)
2df: e8 f7 02 00 00 call 5db <read>
2e4: 83 f8 10 cmp $0x10,%eax
2e7: 0f 84 1c ff ff ff je 209 <ls+0x159>
printf(1, "ls: cannot stat %s\n", buf);
continue;
}
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
}
break;
2ed: 90 nop
}
close(fd);
2ee: 8b 45 e4 mov -0x1c(%ebp),%eax
2f1: 89 04 24 mov %eax,(%esp)
2f4: e8 f2 02 00 00 call 5eb <close>
}
2f9: 81 c4 5c 02 00 00 add $0x25c,%esp
2ff: 5b pop %ebx
300: 5e pop %esi
301: 5f pop %edi
302: 5d pop %ebp
303: c3 ret
00000304 <main>:
int
main(int argc, char *argv[])
{
304: 55 push %ebp
305: 89 e5 mov %esp,%ebp
307: 83 e4 f0 and $0xfffffff0,%esp
30a: 83 ec 20 sub $0x20,%esp
int i;
if(argc < 2){
30d: 83 7d 08 01 cmpl $0x1,0x8(%ebp)
311: 7f 11 jg 324 <main+0x20>
ls(".");
313: c7 04 24 9f 0b 00 00 movl $0xb9f,(%esp)
31a: e8 91 fd ff ff call b0 <ls>
exit();
31f: e8 9f 02 00 00 call 5c3 <exit>
}
for(i=1; i<argc; i++)
324: c7 44 24 1c 01 00 00 movl $0x1,0x1c(%esp)
32b: 00
32c: eb 1f jmp 34d <main+0x49>
ls(argv[i]);
32e: 8b 44 24 1c mov 0x1c(%esp),%eax
332: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
339: 8b 45 0c mov 0xc(%ebp),%eax
33c: 01 d0 add %edx,%eax
33e: 8b 00 mov (%eax),%eax
340: 89 04 24 mov %eax,(%esp)
343: e8 68 fd ff ff call b0 <ls>
if(argc < 2){
ls(".");
exit();
}
for(i=1; i<argc; i++)
348: 83 44 24 1c 01 addl $0x1,0x1c(%esp)
34d: 8b 44 24 1c mov 0x1c(%esp),%eax
351: 3b 45 08 cmp 0x8(%ebp),%eax
354: 7c d8 jl 32e <main+0x2a>
ls(argv[i]);
exit();
356: e8 68 02 00 00 call 5c3 <exit>
0000035b <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
35b: 55 push %ebp
35c: 89 e5 mov %esp,%ebp
35e: 57 push %edi
35f: 53 push %ebx
asm volatile("cld; rep stosb" :
360: 8b 4d 08 mov 0x8(%ebp),%ecx
363: 8b 55 10 mov 0x10(%ebp),%edx
366: 8b 45 0c mov 0xc(%ebp),%eax
369: 89 cb mov %ecx,%ebx
36b: 89 df mov %ebx,%edi
36d: 89 d1 mov %edx,%ecx
36f: fc cld
370: f3 aa rep stos %al,%es:(%edi)
372: 89 ca mov %ecx,%edx
374: 89 fb mov %edi,%ebx
376: 89 5d 08 mov %ebx,0x8(%ebp)
379: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
37c: 5b pop %ebx
37d: 5f pop %edi
37e: 5d pop %ebp
37f: c3 ret
00000380 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
380: 55 push %ebp
381: 89 e5 mov %esp,%ebp
383: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
386: 8b 45 08 mov 0x8(%ebp),%eax
389: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
38c: 90 nop
38d: 8b 45 08 mov 0x8(%ebp),%eax
390: 8d 50 01 lea 0x1(%eax),%edx
393: 89 55 08 mov %edx,0x8(%ebp)
396: 8b 55 0c mov 0xc(%ebp),%edx
399: 8d 4a 01 lea 0x1(%edx),%ecx
39c: 89 4d 0c mov %ecx,0xc(%ebp)
39f: 0f b6 12 movzbl (%edx),%edx
3a2: 88 10 mov %dl,(%eax)
3a4: 0f b6 00 movzbl (%eax),%eax
3a7: 84 c0 test %al,%al
3a9: 75 e2 jne 38d <strcpy+0xd>
;
return os;
3ab: 8b 45 fc mov -0x4(%ebp),%eax
}
3ae: c9 leave
3af: c3 ret
000003b0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
3b0: 55 push %ebp
3b1: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
3b3: eb 08 jmp 3bd <strcmp+0xd>
p++, q++;
3b5: 83 45 08 01 addl $0x1,0x8(%ebp)
3b9: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
3bd: 8b 45 08 mov 0x8(%ebp),%eax
3c0: 0f b6 00 movzbl (%eax),%eax
3c3: 84 c0 test %al,%al
3c5: 74 10 je 3d7 <strcmp+0x27>
3c7: 8b 45 08 mov 0x8(%ebp),%eax
3ca: 0f b6 10 movzbl (%eax),%edx
3cd: 8b 45 0c mov 0xc(%ebp),%eax
3d0: 0f b6 00 movzbl (%eax),%eax
3d3: 38 c2 cmp %al,%dl
3d5: 74 de je 3b5 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
3d7: 8b 45 08 mov 0x8(%ebp),%eax
3da: 0f b6 00 movzbl (%eax),%eax
3dd: 0f b6 d0 movzbl %al,%edx
3e0: 8b 45 0c mov 0xc(%ebp),%eax
3e3: 0f b6 00 movzbl (%eax),%eax
3e6: 0f b6 c0 movzbl %al,%eax
3e9: 29 c2 sub %eax,%edx
3eb: 89 d0 mov %edx,%eax
}
3ed: 5d pop %ebp
3ee: c3 ret
000003ef <strlen>:
uint
strlen(char *s)
{
3ef: 55 push %ebp
3f0: 89 e5 mov %esp,%ebp
3f2: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
3f5: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
3fc: eb 04 jmp 402 <strlen+0x13>
3fe: 83 45 fc 01 addl $0x1,-0x4(%ebp)
402: 8b 55 fc mov -0x4(%ebp),%edx
405: 8b 45 08 mov 0x8(%ebp),%eax
408: 01 d0 add %edx,%eax
40a: 0f b6 00 movzbl (%eax),%eax
40d: 84 c0 test %al,%al
40f: 75 ed jne 3fe <strlen+0xf>
;
return n;
411: 8b 45 fc mov -0x4(%ebp),%eax
}
414: c9 leave
415: c3 ret
00000416 <memset>:
void*
memset(void *dst, int c, uint n)
{
416: 55 push %ebp
417: 89 e5 mov %esp,%ebp
419: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
41c: 8b 45 10 mov 0x10(%ebp),%eax
41f: 89 44 24 08 mov %eax,0x8(%esp)
423: 8b 45 0c mov 0xc(%ebp),%eax
426: 89 44 24 04 mov %eax,0x4(%esp)
42a: 8b 45 08 mov 0x8(%ebp),%eax
42d: 89 04 24 mov %eax,(%esp)
430: e8 26 ff ff ff call 35b <stosb>
return dst;
435: 8b 45 08 mov 0x8(%ebp),%eax
}
438: c9 leave
439: c3 ret
0000043a <strchr>:
char*
strchr(const char *s, char c)
{
43a: 55 push %ebp
43b: 89 e5 mov %esp,%ebp
43d: 83 ec 04 sub $0x4,%esp
440: 8b 45 0c mov 0xc(%ebp),%eax
443: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
446: eb 14 jmp 45c <strchr+0x22>
if(*s == c)
448: 8b 45 08 mov 0x8(%ebp),%eax
44b: 0f b6 00 movzbl (%eax),%eax
44e: 3a 45 fc cmp -0x4(%ebp),%al
451: 75 05 jne 458 <strchr+0x1e>
return (char*)s;
453: 8b 45 08 mov 0x8(%ebp),%eax
456: eb 13 jmp 46b <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
458: 83 45 08 01 addl $0x1,0x8(%ebp)
45c: 8b 45 08 mov 0x8(%ebp),%eax
45f: 0f b6 00 movzbl (%eax),%eax
462: 84 c0 test %al,%al
464: 75 e2 jne 448 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
466: b8 00 00 00 00 mov $0x0,%eax
}
46b: c9 leave
46c: c3 ret
0000046d <gets>:
char*
gets(char *buf, int max)
{
46d: 55 push %ebp
46e: 89 e5 mov %esp,%ebp
470: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
473: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
47a: eb 4c jmp 4c8 <gets+0x5b>
cc = read(0, &c, 1);
47c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
483: 00
484: 8d 45 ef lea -0x11(%ebp),%eax
487: 89 44 24 04 mov %eax,0x4(%esp)
48b: c7 04 24 00 00 00 00 movl $0x0,(%esp)
492: e8 44 01 00 00 call 5db <read>
497: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
49a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
49e: 7f 02 jg 4a2 <gets+0x35>
break;
4a0: eb 31 jmp 4d3 <gets+0x66>
buf[i++] = c;
4a2: 8b 45 f4 mov -0xc(%ebp),%eax
4a5: 8d 50 01 lea 0x1(%eax),%edx
4a8: 89 55 f4 mov %edx,-0xc(%ebp)
4ab: 89 c2 mov %eax,%edx
4ad: 8b 45 08 mov 0x8(%ebp),%eax
4b0: 01 c2 add %eax,%edx
4b2: 0f b6 45 ef movzbl -0x11(%ebp),%eax
4b6: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
4b8: 0f b6 45 ef movzbl -0x11(%ebp),%eax
4bc: 3c 0a cmp $0xa,%al
4be: 74 13 je 4d3 <gets+0x66>
4c0: 0f b6 45 ef movzbl -0x11(%ebp),%eax
4c4: 3c 0d cmp $0xd,%al
4c6: 74 0b je 4d3 <gets+0x66>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
4c8: 8b 45 f4 mov -0xc(%ebp),%eax
4cb: 83 c0 01 add $0x1,%eax
4ce: 3b 45 0c cmp 0xc(%ebp),%eax
4d1: 7c a9 jl 47c <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
4d3: 8b 55 f4 mov -0xc(%ebp),%edx
4d6: 8b 45 08 mov 0x8(%ebp),%eax
4d9: 01 d0 add %edx,%eax
4db: c6 00 00 movb $0x0,(%eax)
return buf;
4de: 8b 45 08 mov 0x8(%ebp),%eax
}
4e1: c9 leave
4e2: c3 ret
000004e3 <stat>:
int
stat(char *n, struct stat *st)
{
4e3: 55 push %ebp
4e4: 89 e5 mov %esp,%ebp
4e6: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
4e9: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
4f0: 00
4f1: 8b 45 08 mov 0x8(%ebp),%eax
4f4: 89 04 24 mov %eax,(%esp)
4f7: e8 07 01 00 00 call 603 <open>
4fc: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
4ff: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
503: 79 07 jns 50c <stat+0x29>
return -1;
505: b8 ff ff ff ff mov $0xffffffff,%eax
50a: eb 23 jmp 52f <stat+0x4c>
r = fstat(fd, st);
50c: 8b 45 0c mov 0xc(%ebp),%eax
50f: 89 44 24 04 mov %eax,0x4(%esp)
513: 8b 45 f4 mov -0xc(%ebp),%eax
516: 89 04 24 mov %eax,(%esp)
519: e8 fd 00 00 00 call 61b <fstat>
51e: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
521: 8b 45 f4 mov -0xc(%ebp),%eax
524: 89 04 24 mov %eax,(%esp)
527: e8 bf 00 00 00 call 5eb <close>
return r;
52c: 8b 45 f0 mov -0x10(%ebp),%eax
}
52f: c9 leave
530: c3 ret
00000531 <atoi>:
int
atoi(const char *s)
{
531: 55 push %ebp
532: 89 e5 mov %esp,%ebp
534: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
537: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
53e: eb 25 jmp 565 <atoi+0x34>
n = n*10 + *s++ - '0';
540: 8b 55 fc mov -0x4(%ebp),%edx
543: 89 d0 mov %edx,%eax
545: c1 e0 02 shl $0x2,%eax
548: 01 d0 add %edx,%eax
54a: 01 c0 add %eax,%eax
54c: 89 c1 mov %eax,%ecx
54e: 8b 45 08 mov 0x8(%ebp),%eax
551: 8d 50 01 lea 0x1(%eax),%edx
554: 89 55 08 mov %edx,0x8(%ebp)
557: 0f b6 00 movzbl (%eax),%eax
55a: 0f be c0 movsbl %al,%eax
55d: 01 c8 add %ecx,%eax
55f: 83 e8 30 sub $0x30,%eax
562: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
565: 8b 45 08 mov 0x8(%ebp),%eax
568: 0f b6 00 movzbl (%eax),%eax
56b: 3c 2f cmp $0x2f,%al
56d: 7e 0a jle 579 <atoi+0x48>
56f: 8b 45 08 mov 0x8(%ebp),%eax
572: 0f b6 00 movzbl (%eax),%eax
575: 3c 39 cmp $0x39,%al
577: 7e c7 jle 540 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
579: 8b 45 fc mov -0x4(%ebp),%eax
}
57c: c9 leave
57d: c3 ret
0000057e <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
57e: 55 push %ebp
57f: 89 e5 mov %esp,%ebp
581: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
584: 8b 45 08 mov 0x8(%ebp),%eax
587: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
58a: 8b 45 0c mov 0xc(%ebp),%eax
58d: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
590: eb 17 jmp 5a9 <memmove+0x2b>
*dst++ = *src++;
592: 8b 45 fc mov -0x4(%ebp),%eax
595: 8d 50 01 lea 0x1(%eax),%edx
598: 89 55 fc mov %edx,-0x4(%ebp)
59b: 8b 55 f8 mov -0x8(%ebp),%edx
59e: 8d 4a 01 lea 0x1(%edx),%ecx
5a1: 89 4d f8 mov %ecx,-0x8(%ebp)
5a4: 0f b6 12 movzbl (%edx),%edx
5a7: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
5a9: 8b 45 10 mov 0x10(%ebp),%eax
5ac: 8d 50 ff lea -0x1(%eax),%edx
5af: 89 55 10 mov %edx,0x10(%ebp)
5b2: 85 c0 test %eax,%eax
5b4: 7f dc jg 592 <memmove+0x14>
*dst++ = *src++;
return vdst;
5b6: 8b 45 08 mov 0x8(%ebp),%eax
}
5b9: c9 leave
5ba: c3 ret
000005bb <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
5bb: b8 01 00 00 00 mov $0x1,%eax
5c0: cd 40 int $0x40
5c2: c3 ret
000005c3 <exit>:
SYSCALL(exit)
5c3: b8 02 00 00 00 mov $0x2,%eax
5c8: cd 40 int $0x40
5ca: c3 ret
000005cb <wait>:
SYSCALL(wait)
5cb: b8 03 00 00 00 mov $0x3,%eax
5d0: cd 40 int $0x40
5d2: c3 ret
000005d3 <pipe>:
SYSCALL(pipe)
5d3: b8 04 00 00 00 mov $0x4,%eax
5d8: cd 40 int $0x40
5da: c3 ret
000005db <read>:
SYSCALL(read)
5db: b8 05 00 00 00 mov $0x5,%eax
5e0: cd 40 int $0x40
5e2: c3 ret
000005e3 <write>:
SYSCALL(write)
5e3: b8 10 00 00 00 mov $0x10,%eax
5e8: cd 40 int $0x40
5ea: c3 ret
000005eb <close>:
SYSCALL(close)
5eb: b8 15 00 00 00 mov $0x15,%eax
5f0: cd 40 int $0x40
5f2: c3 ret
000005f3 <kill>:
SYSCALL(kill)
5f3: b8 06 00 00 00 mov $0x6,%eax
5f8: cd 40 int $0x40
5fa: c3 ret
000005fb <exec>:
SYSCALL(exec)
5fb: b8 07 00 00 00 mov $0x7,%eax
600: cd 40 int $0x40
602: c3 ret
00000603 <open>:
SYSCALL(open)
603: b8 0f 00 00 00 mov $0xf,%eax
608: cd 40 int $0x40
60a: c3 ret
0000060b <mknod>:
SYSCALL(mknod)
60b: b8 11 00 00 00 mov $0x11,%eax
610: cd 40 int $0x40
612: c3 ret
00000613 <unlink>:
SYSCALL(unlink)
613: b8 12 00 00 00 mov $0x12,%eax
618: cd 40 int $0x40
61a: c3 ret
0000061b <fstat>:
SYSCALL(fstat)
61b: b8 08 00 00 00 mov $0x8,%eax
620: cd 40 int $0x40
622: c3 ret
00000623 <link>:
SYSCALL(link)
623: b8 13 00 00 00 mov $0x13,%eax
628: cd 40 int $0x40
62a: c3 ret
0000062b <mkdir>:
SYSCALL(mkdir)
62b: b8 14 00 00 00 mov $0x14,%eax
630: cd 40 int $0x40
632: c3 ret
00000633 <chdir>:
SYSCALL(chdir)
633: b8 09 00 00 00 mov $0x9,%eax
638: cd 40 int $0x40
63a: c3 ret
0000063b <dup>:
SYSCALL(dup)
63b: b8 0a 00 00 00 mov $0xa,%eax
640: cd 40 int $0x40
642: c3 ret
00000643 <getpid>:
SYSCALL(getpid)
643: b8 0b 00 00 00 mov $0xb,%eax
648: cd 40 int $0x40
64a: c3 ret
0000064b <sbrk>:
SYSCALL(sbrk)
64b: b8 0c 00 00 00 mov $0xc,%eax
650: cd 40 int $0x40
652: c3 ret
00000653 <sleep>:
SYSCALL(sleep)
653: b8 0d 00 00 00 mov $0xd,%eax
658: cd 40 int $0x40
65a: c3 ret
0000065b <uptime>:
SYSCALL(uptime)
65b: b8 0e 00 00 00 mov $0xe,%eax
660: cd 40 int $0x40
662: c3 ret
00000663 <date>:
SYSCALL(date)
663: b8 16 00 00 00 mov $0x16,%eax
668: cd 40 int $0x40
66a: c3 ret
0000066b <timem>:
SYSCALL(timem)
66b: b8 17 00 00 00 mov $0x17,%eax
670: cd 40 int $0x40
672: c3 ret
00000673 <getuid>:
SYSCALL(getuid)
673: b8 18 00 00 00 mov $0x18,%eax
678: cd 40 int $0x40
67a: c3 ret
0000067b <getgid>:
SYSCALL(getgid)
67b: b8 19 00 00 00 mov $0x19,%eax
680: cd 40 int $0x40
682: c3 ret
00000683 <getppid>:
SYSCALL(getppid)
683: b8 1a 00 00 00 mov $0x1a,%eax
688: cd 40 int $0x40
68a: c3 ret
0000068b <setuid>:
SYSCALL(setuid)
68b: b8 1b 00 00 00 mov $0x1b,%eax
690: cd 40 int $0x40
692: c3 ret
00000693 <setgid>:
SYSCALL(setgid)
693: b8 1c 00 00 00 mov $0x1c,%eax
698: cd 40 int $0x40
69a: c3 ret
0000069b <getprocs>:
SYSCALL(getprocs)
69b: b8 1d 00 00 00 mov $0x1d,%eax
6a0: cd 40 int $0x40
6a2: c3 ret
000006a3 <setpriority>:
SYSCALL(setpriority)
6a3: b8 1e 00 00 00 mov $0x1e,%eax
6a8: cd 40 int $0x40
6aa: c3 ret
000006ab <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
6ab: 55 push %ebp
6ac: 89 e5 mov %esp,%ebp
6ae: 83 ec 18 sub $0x18,%esp
6b1: 8b 45 0c mov 0xc(%ebp),%eax
6b4: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
6b7: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
6be: 00
6bf: 8d 45 f4 lea -0xc(%ebp),%eax
6c2: 89 44 24 04 mov %eax,0x4(%esp)
6c6: 8b 45 08 mov 0x8(%ebp),%eax
6c9: 89 04 24 mov %eax,(%esp)
6cc: e8 12 ff ff ff call 5e3 <write>
}
6d1: c9 leave
6d2: c3 ret
000006d3 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
6d3: 55 push %ebp
6d4: 89 e5 mov %esp,%ebp
6d6: 56 push %esi
6d7: 53 push %ebx
6d8: 83 ec 30 sub $0x30,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
6db: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
6e2: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
6e6: 74 17 je 6ff <printint+0x2c>
6e8: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
6ec: 79 11 jns 6ff <printint+0x2c>
neg = 1;
6ee: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
6f5: 8b 45 0c mov 0xc(%ebp),%eax
6f8: f7 d8 neg %eax
6fa: 89 45 ec mov %eax,-0x14(%ebp)
6fd: eb 06 jmp 705 <printint+0x32>
} else {
x = xx;
6ff: 8b 45 0c mov 0xc(%ebp),%eax
702: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
705: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
70c: 8b 4d f4 mov -0xc(%ebp),%ecx
70f: 8d 41 01 lea 0x1(%ecx),%eax
712: 89 45 f4 mov %eax,-0xc(%ebp)
715: 8b 5d 10 mov 0x10(%ebp),%ebx
718: 8b 45 ec mov -0x14(%ebp),%eax
71b: ba 00 00 00 00 mov $0x0,%edx
720: f7 f3 div %ebx
722: 89 d0 mov %edx,%eax
724: 0f b6 80 40 0e 00 00 movzbl 0xe40(%eax),%eax
72b: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
72f: 8b 75 10 mov 0x10(%ebp),%esi
732: 8b 45 ec mov -0x14(%ebp),%eax
735: ba 00 00 00 00 mov $0x0,%edx
73a: f7 f6 div %esi
73c: 89 45 ec mov %eax,-0x14(%ebp)
73f: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
743: 75 c7 jne 70c <printint+0x39>
if(neg)
745: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
749: 74 10 je 75b <printint+0x88>
buf[i++] = '-';
74b: 8b 45 f4 mov -0xc(%ebp),%eax
74e: 8d 50 01 lea 0x1(%eax),%edx
751: 89 55 f4 mov %edx,-0xc(%ebp)
754: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
759: eb 1f jmp 77a <printint+0xa7>
75b: eb 1d jmp 77a <printint+0xa7>
putc(fd, buf[i]);
75d: 8d 55 dc lea -0x24(%ebp),%edx
760: 8b 45 f4 mov -0xc(%ebp),%eax
763: 01 d0 add %edx,%eax
765: 0f b6 00 movzbl (%eax),%eax
768: 0f be c0 movsbl %al,%eax
76b: 89 44 24 04 mov %eax,0x4(%esp)
76f: 8b 45 08 mov 0x8(%ebp),%eax
772: 89 04 24 mov %eax,(%esp)
775: e8 31 ff ff ff call 6ab <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
77a: 83 6d f4 01 subl $0x1,-0xc(%ebp)
77e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
782: 79 d9 jns 75d <printint+0x8a>
putc(fd, buf[i]);
}
784: 83 c4 30 add $0x30,%esp
787: 5b pop %ebx
788: 5e pop %esi
789: 5d pop %ebp
78a: c3 ret
0000078b <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
78b: 55 push %ebp
78c: 89 e5 mov %esp,%ebp
78e: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
791: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
798: 8d 45 0c lea 0xc(%ebp),%eax
79b: 83 c0 04 add $0x4,%eax
79e: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
7a1: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
7a8: e9 7c 01 00 00 jmp 929 <printf+0x19e>
c = fmt[i] & 0xff;
7ad: 8b 55 0c mov 0xc(%ebp),%edx
7b0: 8b 45 f0 mov -0x10(%ebp),%eax
7b3: 01 d0 add %edx,%eax
7b5: 0f b6 00 movzbl (%eax),%eax
7b8: 0f be c0 movsbl %al,%eax
7bb: 25 ff 00 00 00 and $0xff,%eax
7c0: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
7c3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
7c7: 75 2c jne 7f5 <printf+0x6a>
if(c == '%'){
7c9: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
7cd: 75 0c jne 7db <printf+0x50>
state = '%';
7cf: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
7d6: e9 4a 01 00 00 jmp 925 <printf+0x19a>
} else {
putc(fd, c);
7db: 8b 45 e4 mov -0x1c(%ebp),%eax
7de: 0f be c0 movsbl %al,%eax
7e1: 89 44 24 04 mov %eax,0x4(%esp)
7e5: 8b 45 08 mov 0x8(%ebp),%eax
7e8: 89 04 24 mov %eax,(%esp)
7eb: e8 bb fe ff ff call 6ab <putc>
7f0: e9 30 01 00 00 jmp 925 <printf+0x19a>
}
} else if(state == '%'){
7f5: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
7f9: 0f 85 26 01 00 00 jne 925 <printf+0x19a>
if(c == 'd'){
7ff: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
803: 75 2d jne 832 <printf+0xa7>
printint(fd, *ap, 10, 1);
805: 8b 45 e8 mov -0x18(%ebp),%eax
808: 8b 00 mov (%eax),%eax
80a: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
811: 00
812: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
819: 00
81a: 89 44 24 04 mov %eax,0x4(%esp)
81e: 8b 45 08 mov 0x8(%ebp),%eax
821: 89 04 24 mov %eax,(%esp)
824: e8 aa fe ff ff call 6d3 <printint>
ap++;
829: 83 45 e8 04 addl $0x4,-0x18(%ebp)
82d: e9 ec 00 00 00 jmp 91e <printf+0x193>
} else if(c == 'x' || c == 'p'){
832: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
836: 74 06 je 83e <printf+0xb3>
838: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
83c: 75 2d jne 86b <printf+0xe0>
printint(fd, *ap, 16, 0);
83e: 8b 45 e8 mov -0x18(%ebp),%eax
841: 8b 00 mov (%eax),%eax
843: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
84a: 00
84b: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
852: 00
853: 89 44 24 04 mov %eax,0x4(%esp)
857: 8b 45 08 mov 0x8(%ebp),%eax
85a: 89 04 24 mov %eax,(%esp)
85d: e8 71 fe ff ff call 6d3 <printint>
ap++;
862: 83 45 e8 04 addl $0x4,-0x18(%ebp)
866: e9 b3 00 00 00 jmp 91e <printf+0x193>
} else if(c == 's'){
86b: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
86f: 75 45 jne 8b6 <printf+0x12b>
s = (char*)*ap;
871: 8b 45 e8 mov -0x18(%ebp),%eax
874: 8b 00 mov (%eax),%eax
876: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
879: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
87d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
881: 75 09 jne 88c <printf+0x101>
s = "(null)";
883: c7 45 f4 a1 0b 00 00 movl $0xba1,-0xc(%ebp)
while(*s != 0){
88a: eb 1e jmp 8aa <printf+0x11f>
88c: eb 1c jmp 8aa <printf+0x11f>
putc(fd, *s);
88e: 8b 45 f4 mov -0xc(%ebp),%eax
891: 0f b6 00 movzbl (%eax),%eax
894: 0f be c0 movsbl %al,%eax
897: 89 44 24 04 mov %eax,0x4(%esp)
89b: 8b 45 08 mov 0x8(%ebp),%eax
89e: 89 04 24 mov %eax,(%esp)
8a1: e8 05 fe ff ff call 6ab <putc>
s++;
8a6: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
8aa: 8b 45 f4 mov -0xc(%ebp),%eax
8ad: 0f b6 00 movzbl (%eax),%eax
8b0: 84 c0 test %al,%al
8b2: 75 da jne 88e <printf+0x103>
8b4: eb 68 jmp 91e <printf+0x193>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
8b6: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
8ba: 75 1d jne 8d9 <printf+0x14e>
putc(fd, *ap);
8bc: 8b 45 e8 mov -0x18(%ebp),%eax
8bf: 8b 00 mov (%eax),%eax
8c1: 0f be c0 movsbl %al,%eax
8c4: 89 44 24 04 mov %eax,0x4(%esp)
8c8: 8b 45 08 mov 0x8(%ebp),%eax
8cb: 89 04 24 mov %eax,(%esp)
8ce: e8 d8 fd ff ff call 6ab <putc>
ap++;
8d3: 83 45 e8 04 addl $0x4,-0x18(%ebp)
8d7: eb 45 jmp 91e <printf+0x193>
} else if(c == '%'){
8d9: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
8dd: 75 17 jne 8f6 <printf+0x16b>
putc(fd, c);
8df: 8b 45 e4 mov -0x1c(%ebp),%eax
8e2: 0f be c0 movsbl %al,%eax
8e5: 89 44 24 04 mov %eax,0x4(%esp)
8e9: 8b 45 08 mov 0x8(%ebp),%eax
8ec: 89 04 24 mov %eax,(%esp)
8ef: e8 b7 fd ff ff call 6ab <putc>
8f4: eb 28 jmp 91e <printf+0x193>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
8f6: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
8fd: 00
8fe: 8b 45 08 mov 0x8(%ebp),%eax
901: 89 04 24 mov %eax,(%esp)
904: e8 a2 fd ff ff call 6ab <putc>
putc(fd, c);
909: 8b 45 e4 mov -0x1c(%ebp),%eax
90c: 0f be c0 movsbl %al,%eax
90f: 89 44 24 04 mov %eax,0x4(%esp)
913: 8b 45 08 mov 0x8(%ebp),%eax
916: 89 04 24 mov %eax,(%esp)
919: e8 8d fd ff ff call 6ab <putc>
}
state = 0;
91e: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
925: 83 45 f0 01 addl $0x1,-0x10(%ebp)
929: 8b 55 0c mov 0xc(%ebp),%edx
92c: 8b 45 f0 mov -0x10(%ebp),%eax
92f: 01 d0 add %edx,%eax
931: 0f b6 00 movzbl (%eax),%eax
934: 84 c0 test %al,%al
936: 0f 85 71 fe ff ff jne 7ad <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
93c: c9 leave
93d: c3 ret
0000093e <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
93e: 55 push %ebp
93f: 89 e5 mov %esp,%ebp
941: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
944: 8b 45 08 mov 0x8(%ebp),%eax
947: 83 e8 08 sub $0x8,%eax
94a: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
94d: a1 6c 0e 00 00 mov 0xe6c,%eax
952: 89 45 fc mov %eax,-0x4(%ebp)
955: eb 24 jmp 97b <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
957: 8b 45 fc mov -0x4(%ebp),%eax
95a: 8b 00 mov (%eax),%eax
95c: 3b 45 fc cmp -0x4(%ebp),%eax
95f: 77 12 ja 973 <free+0x35>
961: 8b 45 f8 mov -0x8(%ebp),%eax
964: 3b 45 fc cmp -0x4(%ebp),%eax
967: 77 24 ja 98d <free+0x4f>
969: 8b 45 fc mov -0x4(%ebp),%eax
96c: 8b 00 mov (%eax),%eax
96e: 3b 45 f8 cmp -0x8(%ebp),%eax
971: 77 1a ja 98d <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
973: 8b 45 fc mov -0x4(%ebp),%eax
976: 8b 00 mov (%eax),%eax
978: 89 45 fc mov %eax,-0x4(%ebp)
97b: 8b 45 f8 mov -0x8(%ebp),%eax
97e: 3b 45 fc cmp -0x4(%ebp),%eax
981: 76 d4 jbe 957 <free+0x19>
983: 8b 45 fc mov -0x4(%ebp),%eax
986: 8b 00 mov (%eax),%eax
988: 3b 45 f8 cmp -0x8(%ebp),%eax
98b: 76 ca jbe 957 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
98d: 8b 45 f8 mov -0x8(%ebp),%eax
990: 8b 40 04 mov 0x4(%eax),%eax
993: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
99a: 8b 45 f8 mov -0x8(%ebp),%eax
99d: 01 c2 add %eax,%edx
99f: 8b 45 fc mov -0x4(%ebp),%eax
9a2: 8b 00 mov (%eax),%eax
9a4: 39 c2 cmp %eax,%edx
9a6: 75 24 jne 9cc <free+0x8e>
bp->s.size += p->s.ptr->s.size;
9a8: 8b 45 f8 mov -0x8(%ebp),%eax
9ab: 8b 50 04 mov 0x4(%eax),%edx
9ae: 8b 45 fc mov -0x4(%ebp),%eax
9b1: 8b 00 mov (%eax),%eax
9b3: 8b 40 04 mov 0x4(%eax),%eax
9b6: 01 c2 add %eax,%edx
9b8: 8b 45 f8 mov -0x8(%ebp),%eax
9bb: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
9be: 8b 45 fc mov -0x4(%ebp),%eax
9c1: 8b 00 mov (%eax),%eax
9c3: 8b 10 mov (%eax),%edx
9c5: 8b 45 f8 mov -0x8(%ebp),%eax
9c8: 89 10 mov %edx,(%eax)
9ca: eb 0a jmp 9d6 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
9cc: 8b 45 fc mov -0x4(%ebp),%eax
9cf: 8b 10 mov (%eax),%edx
9d1: 8b 45 f8 mov -0x8(%ebp),%eax
9d4: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
9d6: 8b 45 fc mov -0x4(%ebp),%eax
9d9: 8b 40 04 mov 0x4(%eax),%eax
9dc: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
9e3: 8b 45 fc mov -0x4(%ebp),%eax
9e6: 01 d0 add %edx,%eax
9e8: 3b 45 f8 cmp -0x8(%ebp),%eax
9eb: 75 20 jne a0d <free+0xcf>
p->s.size += bp->s.size;
9ed: 8b 45 fc mov -0x4(%ebp),%eax
9f0: 8b 50 04 mov 0x4(%eax),%edx
9f3: 8b 45 f8 mov -0x8(%ebp),%eax
9f6: 8b 40 04 mov 0x4(%eax),%eax
9f9: 01 c2 add %eax,%edx
9fb: 8b 45 fc mov -0x4(%ebp),%eax
9fe: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
a01: 8b 45 f8 mov -0x8(%ebp),%eax
a04: 8b 10 mov (%eax),%edx
a06: 8b 45 fc mov -0x4(%ebp),%eax
a09: 89 10 mov %edx,(%eax)
a0b: eb 08 jmp a15 <free+0xd7>
} else
p->s.ptr = bp;
a0d: 8b 45 fc mov -0x4(%ebp),%eax
a10: 8b 55 f8 mov -0x8(%ebp),%edx
a13: 89 10 mov %edx,(%eax)
freep = p;
a15: 8b 45 fc mov -0x4(%ebp),%eax
a18: a3 6c 0e 00 00 mov %eax,0xe6c
}
a1d: c9 leave
a1e: c3 ret
00000a1f <morecore>:
static Header*
morecore(uint nu)
{
a1f: 55 push %ebp
a20: 89 e5 mov %esp,%ebp
a22: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
a25: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
a2c: 77 07 ja a35 <morecore+0x16>
nu = 4096;
a2e: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
a35: 8b 45 08 mov 0x8(%ebp),%eax
a38: c1 e0 03 shl $0x3,%eax
a3b: 89 04 24 mov %eax,(%esp)
a3e: e8 08 fc ff ff call 64b <sbrk>
a43: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
a46: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
a4a: 75 07 jne a53 <morecore+0x34>
return 0;
a4c: b8 00 00 00 00 mov $0x0,%eax
a51: eb 22 jmp a75 <morecore+0x56>
hp = (Header*)p;
a53: 8b 45 f4 mov -0xc(%ebp),%eax
a56: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
a59: 8b 45 f0 mov -0x10(%ebp),%eax
a5c: 8b 55 08 mov 0x8(%ebp),%edx
a5f: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
a62: 8b 45 f0 mov -0x10(%ebp),%eax
a65: 83 c0 08 add $0x8,%eax
a68: 89 04 24 mov %eax,(%esp)
a6b: e8 ce fe ff ff call 93e <free>
return freep;
a70: a1 6c 0e 00 00 mov 0xe6c,%eax
}
a75: c9 leave
a76: c3 ret
00000a77 <malloc>:
void*
malloc(uint nbytes)
{
a77: 55 push %ebp
a78: 89 e5 mov %esp,%ebp
a7a: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
a7d: 8b 45 08 mov 0x8(%ebp),%eax
a80: 83 c0 07 add $0x7,%eax
a83: c1 e8 03 shr $0x3,%eax
a86: 83 c0 01 add $0x1,%eax
a89: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
a8c: a1 6c 0e 00 00 mov 0xe6c,%eax
a91: 89 45 f0 mov %eax,-0x10(%ebp)
a94: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
a98: 75 23 jne abd <malloc+0x46>
base.s.ptr = freep = prevp = &base;
a9a: c7 45 f0 64 0e 00 00 movl $0xe64,-0x10(%ebp)
aa1: 8b 45 f0 mov -0x10(%ebp),%eax
aa4: a3 6c 0e 00 00 mov %eax,0xe6c
aa9: a1 6c 0e 00 00 mov 0xe6c,%eax
aae: a3 64 0e 00 00 mov %eax,0xe64
base.s.size = 0;
ab3: c7 05 68 0e 00 00 00 movl $0x0,0xe68
aba: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
abd: 8b 45 f0 mov -0x10(%ebp),%eax
ac0: 8b 00 mov (%eax),%eax
ac2: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
ac5: 8b 45 f4 mov -0xc(%ebp),%eax
ac8: 8b 40 04 mov 0x4(%eax),%eax
acb: 3b 45 ec cmp -0x14(%ebp),%eax
ace: 72 4d jb b1d <malloc+0xa6>
if(p->s.size == nunits)
ad0: 8b 45 f4 mov -0xc(%ebp),%eax
ad3: 8b 40 04 mov 0x4(%eax),%eax
ad6: 3b 45 ec cmp -0x14(%ebp),%eax
ad9: 75 0c jne ae7 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
adb: 8b 45 f4 mov -0xc(%ebp),%eax
ade: 8b 10 mov (%eax),%edx
ae0: 8b 45 f0 mov -0x10(%ebp),%eax
ae3: 89 10 mov %edx,(%eax)
ae5: eb 26 jmp b0d <malloc+0x96>
else {
p->s.size -= nunits;
ae7: 8b 45 f4 mov -0xc(%ebp),%eax
aea: 8b 40 04 mov 0x4(%eax),%eax
aed: 2b 45 ec sub -0x14(%ebp),%eax
af0: 89 c2 mov %eax,%edx
af2: 8b 45 f4 mov -0xc(%ebp),%eax
af5: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
af8: 8b 45 f4 mov -0xc(%ebp),%eax
afb: 8b 40 04 mov 0x4(%eax),%eax
afe: c1 e0 03 shl $0x3,%eax
b01: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
b04: 8b 45 f4 mov -0xc(%ebp),%eax
b07: 8b 55 ec mov -0x14(%ebp),%edx
b0a: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
b0d: 8b 45 f0 mov -0x10(%ebp),%eax
b10: a3 6c 0e 00 00 mov %eax,0xe6c
return (void*)(p + 1);
b15: 8b 45 f4 mov -0xc(%ebp),%eax
b18: 83 c0 08 add $0x8,%eax
b1b: eb 38 jmp b55 <malloc+0xde>
}
if(p == freep)
b1d: a1 6c 0e 00 00 mov 0xe6c,%eax
b22: 39 45 f4 cmp %eax,-0xc(%ebp)
b25: 75 1b jne b42 <malloc+0xcb>
if((p = morecore(nunits)) == 0)
b27: 8b 45 ec mov -0x14(%ebp),%eax
b2a: 89 04 24 mov %eax,(%esp)
b2d: e8 ed fe ff ff call a1f <morecore>
b32: 89 45 f4 mov %eax,-0xc(%ebp)
b35: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
b39: 75 07 jne b42 <malloc+0xcb>
return 0;
b3b: b8 00 00 00 00 mov $0x0,%eax
b40: eb 13 jmp b55 <malloc+0xde>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
b42: 8b 45 f4 mov -0xc(%ebp),%eax
b45: 89 45 f0 mov %eax,-0x10(%ebp)
b48: 8b 45 f4 mov -0xc(%ebp),%eax
b4b: 8b 00 mov (%eax),%eax
b4d: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
b50: e9 70 ff ff ff jmp ac5 <malloc+0x4e>
}
b55: c9 leave
b56: c3 ret
|
overloading/level.agda | HoTT/M-types | 27 | 3301 | {-# OPTIONS --without-K #-}
module overloading.level where
open import sum
open import equality.core
open import overloading.bundle
open import function.isomorphism
open import hott.level.core
open import sets.unit
open Bundle
bundle-structure-iso : ∀ {i j}{Base : Set i}
(Struct : Base → Set j)
→ Σ Base Struct ≅ Bundle Struct
bundle-structure-iso Struct = record
{ to = λ { (X , s) → bundle X s }
; from = λ { (bundle X s) → X , s }
; iso₁ = λ _ → refl
; iso₂ = λ _ → refl }
bundle-equality-iso : ∀ {i j}{Base : Set i}
(Struct : Base → Set j)
→ ((B : Base) → h 1 (Struct B))
→ {X Y : Bundle Struct}
→ (parent X ≡ parent Y)
≅ (X ≡ Y)
bundle-equality-iso Struct hS {X}{Y} = begin
parent X ≡ parent Y
≅⟨ sym≅ ×-right-unit ⟩
((parent X ≡ parent Y) × ⊤)
≅⟨ Σ-ap-iso refl≅ (λ p → sym≅ (contr-⊤-iso (hS _ _ _))) ⟩
( Σ (parent X ≡ parent Y) λ p
→ (subst Struct p (struct X) ≡ struct Y) )
≅⟨ Σ-split-iso ⟩
(parent X , struct X) ≡ (parent Y , struct Y)
≅⟨ iso≡ (bundle-structure-iso Struct) ⟩
X ≡ Y
∎
where open ≅-Reasoning
|
utils/src/main/resources/growl.applescript | bluefoot/scripts | 0 | 2464 | set messageToShow to "%s"
tell application id "com.Growl.GrowlHelperApp"
set the allNotificationsList to {"%s"}
set the enabledNotificationsList to {"%s"}
register as application "%s" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Script Editor"
notify with name "%s" %s title "%s" description messageToShow application name "%s" sticky %s
end tell |
source/tabula.ads | ytomino/vampire | 1 | 29871 | -- The Village of Vampire by YT, このソースコードはNYSLです
with Ada.Formatting;
package Tabula is
pragma Pure;
type Static_String_Access is access constant String;
for Static_String_Access'Storage_Size use 0;
-- string of Natural without spacing
function Image is
new Ada.Formatting.Integer_Image (
Natural,
Signs => Ada.Formatting.Triming_Sign_Marks);
end Tabula;
|
programs/oeis/254/A254729.asm | neoneye/loda | 22 | 85765 | ; A254729: Number of numbers j + k*sqrt(2) of length n, where the length is the least number of steps to reach 0, the allowable steps being x -> x + 1 and x -> x*sqrt(2).
; 1,1,2,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204,710647,1149851,1860498,3010349,4870847,7881196,12752043,20633239,33385282,54018521,87403803,141422324,228826127,370248451,599074578,969323029,1568397607,2537720636,4106118243,6643838879,10749957122,17393796001,28143753123,45537549124,73681302247,119218851371,192900153618,312119004989,505019158607,817138163596,1322157322203,2139295485799,3461452808002,5600748293801,9062201101803,14662949395604,23725150497407,38388099893011,62113250390418,100501350283429,162614600673847,263115950957276,425730551631123,688846502588399,1114577054219522,1803423556807921,2918000611027443,4721424167835364,7639424778862807,12360848946698171,20000273725560978,32361122672259149,52361396397820127,84722519070079276,137083915467899403,221806434537978679,358890350005878082,580696784543856761,939587134549734843,1520283919093591604,2459871053643326447,3980154972736918051,6440026026380244498,10420180999117162549,16860207025497407047,27280388024614569596,44140595050111976643,71420983074726546239,115561578124838522882,186982561199565069121,302544139324403592003
trn $0,1
seq $0,324015 ; Number of nonempty subsets of {1, ..., n} containing no two cyclically successive elements.
add $0,1
|
LanguageServer/BisonLexer.g4 | studentmain/AntlrVSIX | 67 | 6776 | <gh_stars>10-100
// Author -- <NAME>
// Copyright 2020
// MIT License
lexer grammar BisonLexer;
options {
superClass = BisonLexerAdaptor ;
}
channels {
OFF_CHANNEL // non-default channel for whitespace and comments
}
tokens {
SC_EPILOGUE
}
// ======================= Common fragments =========================
fragment Underscore
: '_'
;
fragment NameStartChar
: 'A'..'Z'
| 'a'..'z'
| '_'
| '\u00C0'..'\u00D6'
| '\u00D8'..'\u00F6'
| '\u00F8'..'\u02FF'
| '\u0370'..'\u037D'
| '\u037F'..'\u1FFF'
| '\u200C'..'\u200D'
| '\u2070'..'\u218F'
| '\u2C00'..'\u2FEF'
| '\u3001'..'\uD7FF'
| '\uF900'..'\uFDCF'
| '\uFDF0'..'\uFFFD'
| '$' // For PHP
; // ignores | ['\u10000-'\uEFFFF] ;
fragment DQuoteLiteral
: DQuote ( EscSeq | ~["\r\n\\] | ( '\\' [\n\r]*) )* DQuote
;
fragment DQuote
: '"'
;
fragment SQuote
: '\''
;
fragment CharLiteral
: SQuote ( EscSeq | ~['\r\n\\] ) SQuote
;
fragment SQuoteLiteral
: SQuote ( EscSeq | ~['\r\n\\] )* SQuote
;
fragment Esc
: '\\'
;
fragment EscSeq
: Esc
([abefnrtv?"'\\] // The standard escaped character set such as tab, newline, etc.
| [xuU]?[0-9]+) // C-style
;
fragment EscAny
: Esc .
;
fragment Id
: NameStartChar NameChar*
;
fragment Type
: ([\t\r\n\f a-zA-Z0-9] | '[' | ']' | '{' | '}' | '.' | '_' | '(' | ')' | ',')+
;
fragment NameChar
: NameStartChar
| '0'..'9'
| Underscore
| '\u00B7'
| '\u0300'..'\u036F'
| '\u203F'..'\u2040'
| '.'
| '-'
;
fragment BlockComment
: '/*'
(
('/' ~'*')
| ~'/'
)*
'*/'
;
fragment LineComment
: '//' ~[\r\n]*
;
fragment LineCommentExt
: '//' ~'\n'* ( '\n' Hws* '//' ~'\n'* )*
;
fragment Ws
: Hws
| Vws
;
fragment Hws
: [ \t]
;
fragment Vws
: [\r\n\f]
;
/* Four types of user code:
- prologue (code between '%{' '%}' in the first section, before %%);
- actions, printers, union, etc, (between braced in the middle section);
- epilogue (everything after the second %%).
- predicate (code between '%?{' and '{' in middle section); */
// -------------------------
// Actions
fragment LBrace
: '{'
;
fragment RBrace
: '}'
;
fragment PercentLBrace
: '%{'
;
fragment PercentRBrace
: '%}'
;
fragment PercentQuestion
: '%?{'
;
fragment ActionCode
: Stuff*
;
fragment Stuff
: EscAny
| DQuoteLiteral
| SQuoteLiteral
| BlockComment
| LineComment
| NestedAction
| ~('{' | '}' | '\'' | '"')
;
fragment NestedPrologue
: PercentLBrace ActionCode PercentRBrace
;
fragment NestedAction
: LBrace ActionCode RBrace
;
fragment NestedPredicate
: PercentQuestion ActionCode RBrace
;
fragment Sp
: Ws*
;
fragment Eqopt
: (Sp [=])?
;
PercentPercent: '%%'
{
++percent_percent_count;
if (percent_percent_count == 1)
{
//this.PushMode(BisonLexer.RuleMode);
return;
} else if (percent_percent_count == 2)
{
this.PushMode(BisonLexer.EpilogueMode);
return;
} else
{
this.Type = BisonLexer.PERCENT_PERCENT;
return;
}
}
;
/*----------------------------.
| Scanning Bison directives. |
`----------------------------*/
/* For directives that are also command line options, the regex must be
"%..."
after "[-_]"s are removed, and the directive must match the --long
option name, with a single string argument. Otherwise, add exceptions
to ../build-aux/cross-options.pl. */
NONASSOC
: '%binary'
;
CODE
: '%code'
;
PERCENT_DEBUG
: '%debug'
;
DEFAULT_PREC
: '%default-prec'
;
DEFINE
: '%define'
;
DEFINES
: '%defines'
;
DESTRUCTOR
: '%destructor'
;
DPREC
: '%dprec'
;
EMPTY_RULE
: '%empty'
;
EXPECT
: '%expect'
;
EXPECT_RR
: '%expect-rr'
;
PERCENT_FILE_PREFIX
: '%file-prefix'
;
INITIAL_ACTION
: '%initial-action'
;
GLR_PARSER
: '%glr-parser'
;
LANGUAGE
: '%language'
;
PERCENT_LEFT
: '%left'
;
LEX
: '%lex-param'
;
LOCATIONS
: '%locations'
;
MERGE
: '%merge'
;
NO_DEFAULT_PREC
: '%no-default-prec'
;
NO_LINES
: '%no-lines'
;
PERCENT_NONASSOC
: '%nonassoc'
;
NONDETERMINISTIC_PARSER
: '%nondeterministic-parser'
;
NTERM
: '%nterm'
;
PARAM
: '%param'
;
PARSE
: '%parse-param'
;
PERCENT_PREC
: '%prec'
;
PRECEDENCE
: '%precedence'
;
PRINTER
: '%printer'
;
REQUIRE
: '%require'
;
PERCENT_RIGHT
: '%right'
;
SKELETON
: '%skeleton'
;
PERCENT_START
: '%start'
;
TOKEN
: '%term'
;
PERCENT_TOKEN
: '%token'
;
TOKEN_TABLE
: '%token'[-_]'table'
;
PERCENT_TYPE
: '%type'
;
PERCENT_UNION
: '%union'
;
VERBOSE
: '%verbose'
;
PERCENT_YACC
: '%yacc'
;
/* Deprecated since Bison 2.3b (2008-05-27), but the warning is
issued only since Bison 3.4. */
PERCENT_PURE_PARSER
: '%pure'[-_]'parser'
;
/* Deprecated since Bison 2.6 (2012-07-19), but the warning is
issued only since Bison 3.3. */
PERCENT_NAME_PREFIX
: '%name'[-_]'prefix'(Eqopt)?(Sp)
;
/* Deprecated since Bison 2.7.90, 2012. */
OBS_DEFAULT_PREC
: '%default'[-_]'prec'
;
OBS_PERCENT_ERROR_VERBOSE
: '%error'[-_]'verbose'
;
OBS_EXPECT_RR
: '%expect'[-_]'rr'
;
OBS_PERCENT_FILE_PREFIX
: '%file-prefix'(Eqopt)
;
OBS_FIXED_OUTPUT
: '%fixed'[-_]'output'[-_]'files'
;
OBS_NO_DEFAULT_PREC
: '%no'[-_]'default'[-_]'prec'
;
OBS_NO_LINES
: '%no'[-_]'lines'
;
OBS_OUTPUT
: '%output' Eqopt
;
OBS_TOKEN_TABLE
: '%token'[-_]'table'
;
BRACED_CODE: NestedAction;
BRACED_PREDICATE: NestedPredicate;
BRACKETED_ID: '[' Id ']';
CHAR: CharLiteral;
COLON: ':';
//EPILOGUE: 'epilogue';
EQUAL: '=';
//ID_COLON: Id ':';
ID: Id;
PERCENT_PERCENT
: PercentPercent
;
PIPE: '|';
SEMICOLON: ';';
TAG: '<' Type '>';
TAG_ANY: '<*>';
TAG_NONE: '<>';
STRING: DQuoteLiteral;
INT: [0-9]+;
LPAREN: '(';
RPAREN: ')';
BLOCK_COMMENT
: BlockComment -> channel(OFF_CHANNEL)
;
LINE_COMMENT
: LineComment -> channel(OFF_CHANNEL)
;
WS
: ( Hws | Vws )+ -> channel(OFF_CHANNEL)
;
PROLOGUE
: NestedPrologue
;
// ==============================================================
// Note, all prologue rules can be used in grammar declarations.
// ==============================================================
//mode RuleMode;
mode EpilogueMode;
// Expected: Warning AC0131 greedy block ()+ contains wildcard; the non-greedy syntax ()+? may be preferred LanguageServer
EPILOGUE: .+ ;
|
libsrc/interrupts/im1/im1_uninstall_isr.asm | Frodevan/z88dk | 640 | 162893 |
SECTION code_clib
PUBLIC im1_uninstall_isr
PUBLIC _im1_uninstall_isr
PUBLIC asm_im1_uninstall_isr
EXTERN im1_vectors
EXTERN CLIB_IM1_VECTOR_COUNT
EXTERN asm_interrupt_remove_handler
im1_uninstall_isr:
_im1_uninstall_isr:
pop bc
pop de
push de
push bc
; Entry de = vector to remove
asm_im1_uninstall_isr:
ld hl, im1_vectors
ld b, CLIB_IM1_VECTOR_COUNT
call asm_interrupt_remove_handler
ld hl,0
IF __CPU_INTEL__
ld a,l
rla
ld l,a
ELSE
rl l
ENDIf
ret
|
dv3/qpc/fd/mformat.asm | olifink/smsqe | 0 | 80834 | ; DV3 QPC Floppy Disk Format v1.01 1993 <NAME>
; 2000 <NAME>
;
; 2006-06-18 1.01 Use density from FLP_DENSITY if no density given (MK)
section dv3
xdef fd_mformat
xref dv3_slen
xref fd_hold
xref fd_release
xref fd_ckwp
xref gu_achp0
xref gu_rchp
include 'dev8_keys_err'
include 'dev8_smsq_qpc_keys'
include 'dev8_dv3_keys'
include 'dev8_dv3_fd_keys'
include 'dev8_mac_assert'
;+++
; This routine formats a medium
;
; d0 cr format type / error code
; d1 cr format dependent flag or zero / good sectors
; d2 r total sectors
; d7 c p drive ID / number
; a3 c p linkage block
; a4 c p drive definition
;
; status return standard
;---
fd_mformat
fmf.reg reg d3/d4/d5/a0/a1/a2/a5
movem.l fmf.reg,-(sp)
fmf_wstart
jsr fd_hold
bne.s fmf_wstart
move.l #(36*2*80+7)/8,d0 ; space 512 byte sector map
jsr gu_achp0 ; on 80 track DS ED drive
bne.l fmf_exit
cmp.b #2,d7
bhi.l fmf_fmtf
jsr fd_ckwp
blt.l fmf_exrt ; ... oops
tst.b ddf_wprot(a4) ; write protected?
bne.l fmf_ro
move.b #2,ddf_slflag(a4) ; set sector length flag
jsr dv3_slen
move.b ddf_density(a4),d2 ; specified density
bge.s fmf_sssct
move.b fdl_defd(a3),d2 ; default density
bge.s fmf_sssct
moveq #-1,d2 ; auto detect
bra.s fmf_sdensity
fmf_sssct
assert 0,ddf.dd-1,ddf.hd-2
mulu #9,d2 ; now number of sectors
cmp.w #18,d2
bgt.l fmf_fmtf
fmf_sdensity
move.w fdl_maxt(a3),d3 ; number of tracks
moveq #2,d4 ; number of sides
dc.w qpc.fdfmt
dc.w $4AFB ; for security
tst.l d2 ; any disk?
beq.s fmf_fmtf ; ... no
move.b #ddf.dd,ddf_density(a4) ; set density (assumed)
cmp.b #9,d2 ; more than 9?
ble.s fmf_shdc ; ... no
move.b #ddf.hd,ddf_density(a4) ; reset density
fmf_shdc
lea dff_size+dff.size*6(a0),a0
clr.l -(a0) ; no 4096 byte
clr.l -(a0) ; no 2048 byte
clr.l -(a0) ; no 1024 byte
move.l d2,-(a0) ; track size in 512 byte
clr.l -(a0) ; no 256 byte
clr.l -(a0) ; no 128 byte
move.w d3,-(a0) ; cylinders
move.w d4,-(a0) ; heads
; d1 is format dependent flag!!
jsr ddf_fselect(a4) ; select format
bne.s fmf_exrt ; exit and return sector table
clr.l dff_size+dff.size*ddf.512(a0) ; all OK!
clr.l (a0)
bset d7,fdl_stpb(a3) ; this drive will not have stopped
moveq #ddf.full,d0 ; ... the only type of format we can do
jsr ddf_format(a4) ; so do it!
st ddf_slbl(a4) ; set slave block range
fmf_exrt
jsr gu_rchp ; return bit of heap
fmf_exit
jsr fd_release
movem.l (sp)+,fmf.reg
tst.l d0
rts
fmf_fmtf
moveq #err.fmtf,d0
bra.s fmf_exrt
fmf_ro
moveq #err.rdo,d0
bra.s fmf_exrt
end
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1919.asm | ljhsiun2/medusa | 9 | 83246 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_D+0x14ac8, %rax
and %r11, %r11
movb $0x51, (%rax)
nop
nop
nop
xor %r15, %r15
// Store
lea addresses_WT+0xb5d8, %r9
nop
nop
nop
nop
nop
add %rsi, %rsi
mov $0x5152535455565758, %rax
movq %rax, %xmm0
vmovups %ymm0, (%r9)
nop
nop
cmp %rdi, %rdi
// Load
lea addresses_normal+0x9958, %r11
nop
add %r9, %r9
mov (%r11), %rdi
nop
nop
nop
nop
dec %rdi
// Load
lea addresses_PSE+0x17558, %r11
clflush (%r11)
nop
nop
nop
nop
cmp $23134, %rax
movups (%r11), %xmm6
vpextrq $1, %xmm6, %rsi
nop
and %rax, %rax
// Store
lea addresses_WC+0x15958, %rax
nop
nop
cmp %rdi, %rdi
movw $0x5152, (%rax)
nop
nop
sub %rbx, %rbx
// Store
lea addresses_WT+0x5558, %r15
nop
nop
add %rax, %rax
movb $0x51, (%r15)
nop
nop
nop
inc %rsi
// Store
lea addresses_A+0x34fa, %r11
clflush (%r11)
nop
nop
xor %rax, %rax
movb $0x51, (%r11)
nop
nop
nop
nop
xor $59042, %r15
// REPMOV
lea addresses_WT+0x17438, %rsi
lea addresses_A+0x121a9, %rdi
clflush (%rsi)
nop
xor %rbx, %rbx
mov $99, %rcx
rep movsw
nop
nop
nop
nop
nop
and %rbx, %rbx
// Store
lea addresses_normal+0x9518, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
xor %r11, %r11
movl $0x51525354, (%rbx)
nop
nop
nop
and $34557, %rcx
// Faulty Load
lea addresses_normal+0x9958, %rax
nop
nop
nop
sub %r11, %r11
mov (%rax), %rsi
lea oracles, %rdi
and $0xff, %rsi
shlq $12, %rsi
mov (%rdi,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}}
{'src': {'type': 'addresses_WT', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 6}}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
ejemp1.asm | alfreedom/Z80-ASM-Programs | 0 | 7639 |
X .EQU 0FEFEH
LD A,0
LD B,A
LD A,1
LD C,A
LD A,5
LD D,A
LD A,0
LD E,A
TEST:
LD A,B
INC A
LD (HL),C
CP (HL)
JP Z,FIN
CALL CALCUL
INC (HL)
JP TEST
JP FIN
CALCUL:
LD A,(R)
ADD A,(X)
LD (R),A
LD A,(X)
ADD A,(X)
LD (X),A
RET
FIN: .END
|
enigma.asm | HibaZubair/x86-Enigma | 17 | 23105 | <reponame>HibaZubair/x86-Enigma<gh_stars>10-100
title enigma
include Irvine32.inc
; Created by <NAME>
; Created on November 01, 2011, 12:32 PM
;Copyright (c) 2010-2011, <NAME>
;All rights reserved.
;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. All advertising materials mentioning features or use of this software must display the following acknowledgement:
; This product includes software developed by the <NAME>.
;4. Neither the name of the <NAME> 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 <NAME> ''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 <NAME>shall 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.
.data
menu_title byte "Select an option: ",0
menu_select byte "Select a menu item: ",0
setup_rotor_title byte "Setup Rotors:",0
rotor_str1 byte "Current Rotors:",0
rtr_a byte "1. A: ",0
rtr_b byte "2. B: ",0
rtr_c byte "3. C: ",0
rtr_r byte "4. R: ",0
rtr_1_menu byte " 1. Edit a Rotor"
byte 0dh,0ah," 2. Use these Rotors",0
rtrprompt byte "Enter the Rotor you want to edit (1-4): ",0
rtr_1_title byte "Rotor Properties:",0
rtr_1_prop1 byte " Rotor: ",0
rtr_1_prop2 byte " Reverse: ",0
rtr_1_prop3 byte " Position: ",0
rtr_1_prop4 byte " Step: ",0
rtr_1_menu_item1 byte " 1. Select a Rotor",0
rtr_1_menu_item2 byte " 2. Create a Rotor",0
rtr_1_menu_item3 byte " 3. Set a position",0
rtr_1_menu_item4 byte " 4. Set step increment",0
rtr_1_menu_item5 byte " 5. Back",0
rtr_1_menu_item6 byte " 3. Back",0
rtr_2_menu byte "Select a Rotor: ",0dh,0ah," 1. Service - I",0dh,0ah," 2. Service - II",0dh,0ah," 3. Service - III",0dh,0ah," 4. Service - IV",0dh,0ah," 5. Service - V",0dh,0ah," 6. Service - VI",0dh,0ah," 7. Service - VII",0dh,0ah," 8. Service - VIII",0dh,0ah," 9. Service - UKW A",0dh,0ah," 10. Service - UKW B",0dh,0ah," 11. Service - UKW C",0
rtr_input_prompt byte "Enter a rotor sequence: ",0
rtr_input byte 26 dup(" ")
rtr_term byte 0
rtr_pos_prompt byte "Enter the starting position for this rotor: ",0
rtr_step_prompt byte "Enter the step increment for this rotor: ",0
setup_plugboard_title byte "Setup Plugboard:",0
pb_str1 byte "Current Plugboard: ",0
pb_menu byte " 1. Add a connection",0dh,0ah," 2. Reset Plugboard",0dh,0ah," 3. Use this Plugboard",0
pb_str2 byte "Enter Plugboard Key: ",0
pkey1 byte "0",0
pkey2 byte "0",0
p1index byte 0
p2index byte 0
inputprompt byte "Enter text to encode: ",0
input byte 255 dup(?),0
inputlen byte 0
output byte 255 dup(?),0
s1 byte "EKMFLGDQVZNTOWYHXUSPAIBRCJ"
s2 byte "AJDKSIRUXBLHWTMCQGZNPYFVOE"
s3 byte "BDFHJLCPRTXVZNYEIWGAKMUSQO"
s4 byte "ESOVPZJAYQUIRHXLNFTGKDCMWB"
s5 byte "VZBRGITYUPSDNHLXAWMJQOFECK"
s6 byte "JPGVOUMFYQBENHZRDKASXLICTW"
s7 byte "NZJHGRCXMYSWBOUFAIVLPEKQDT"
s8 byte "FKQHTLXOCBJSPDZRAMEWNIUYGV"
s9 byte "EJMZALYXVBWFCRQUONTSPIKHGD"
s10 byte "YRUHQSLDPXNGOKMIEBFZCWVJAT"
s11 byte "FVPJIAOYEDRZXWGCTKUQSBNMHL"
E byte "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
A_ byte 26 dup(" ")
byte 0
A_R byte 26 dup(" ")
byte 0
astep byte 0
ashift byte 1
B_ byte 26 dup(" ")
byte 0
B_R byte 26 dup(" ")
byte 0
bstep byte 0
bshift byte 2
C_ byte 26 dup(" ")
byte 0
C_R byte 26 dup(" ")
byte 0
cstep byte 0
cshift byte 1
R byte 26 dup(" ")
byte 0
plug byte "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
byte 0
.code
main proc
call ClearRegisters
call SetupRotors
call SetupPlugBoard
call GetInputString
call ClearRegisters
mov cl, inputlen
mov esi, offset input
mov edi, offset output
Encrypt:
;check character
mov eax, [esi]
cmp al, 65
jl isfalse
cmp al, 90
jg isfalse
;we are working with a letter
mov bl, ashift
add astep, bl
cmp astep, 26
jge incb
jmp startencoding
incb:
sub astep, 26
movzx ebx, bshift
add bstep, bl
cmp bstep, 26
jl startencoding
incc:
sub bstep, 26
movzx ebx, cshift
add cstep, bl
cmp cstep, 26
jl startencoding
resetc:
sub cstep, 26
startencoding:
push esi
push ecx
;send to plugboard
mov esi, offset plug
mov edx, 0
mov ecx, lengthof plug
call PassThroughRotor
mov esi, offset A_
movzx edx, astep
mov ecx, lengthof A_
call PassThroughRotor
mov esi, offset B_
movzx edx, bstep
mov ecx, lengthof B_
call PassThroughRotor
mov esi, offset C_
movzx edx, cstep
mov ecx, lengthof C_
call PassThroughRotor
mov esi, offset R
mov edx, 0
mov ecx, lengthof R
call PassThroughRotor
mov esi, offset C_R
movzx edx, cstep
mov ecx, lengthof C_R
call PassThroughRotor
mov esi, offset B_R
movzx edx, bstep
mov ecx, lengthof B_R
call PassThroughRotor
mov esi, offset A_R
movzx edx, astep
mov ecx, lengthof A_R
call PassThroughRotor
mov esi, offset plug
mov edx, 0
mov ecx, lengthof plug
call PassThroughRotor
pop ecx
pop esi
isfalse: ;add non-letter character to output
mov [edi], al
;next character
inc esi
inc edi
dec ecx
cmp ecx, 0
jne Encrypt
call crlf
call crlf
mov edx, offset output
call writeline
exit
main endp
ClearRegisters proc
mov eax, 0
mov ebx, 0
mov ecx, 0
mov edx, 0
mov esi, 0
mov edi, 0
ret
ClearRegisters endp
GetInputString proc
mov edx, offset inputprompt
call writestring
mov edx, offset input
mov ecx, lengthof input
mov eax, 0
call readstring
mov inputlen, al
invoke str_ucase, addr input
ret
GetInputString endp
GetIndexInEntry proc uses ebx ecx esi
mov ecx, lengthof E
mov esi, offset E
ScanEntry:
cmp al, [esi]
je FoundIndex
inc esi
loop ScanEntry
jmp gotoEnd
FoundIndex:
mov ebx, lengthof E
sub ebx, ecx
mov eax, ebx
gotoEnd:
ret
GetIndexInEntry endp
PassThroughRotor proc uses ebx ecx edx edi esi
; eax input letter
push esi
push ecx
call GetIndexInEntry
pop ecx
pop esi
; eax is positon
; esi offset of rotor array
; edx steps for rotor
; ecx lengthof rotor array
mov edi, ecx
add esi, edx
movzx ebx, dl
add ebx, eax
;bl = distance from (offset + steps) (0 - 25)
sub edi, ebx
;ecx = distance from (offset + steps) to position 26
sub ecx, edi
add esi, ecx
mov ecx, [esi]
mov eax, ecx
ret
PassThroughRotor endp
SetupPlugBoard proc uses edx eax esi edi
Setupkey:
call clrscr
mov edx, offset setup_plugboard_title
call writestring
call crlf
mov edx, offset pb_str1
call writestring
mov edx, offset plug
call writestring
call crlf
mov edx, offset menu_title
call writeline
mov edx, offset pb_menu
call writeline
call crlf
mov edx, offset menu_select
call writestring
mov eax, 0
call readint
cmp al, 1
jl invalid
jmp valid1
valid1:
cmp al, 3
jg invalid
jmp valid2
valid2:
cmp al, 2
jl one
je two
jg three
one:
call crlf
mov edx, offset pb_str2
call writestring
mov edx, offset pkey1
mov ecx, lengthof pkey1
call readstring
mov edx, offset pb_str2
call writestring
mov edx, offset pkey2
mov ecx, lengthof pkey2
call readstring
call ClearRegisters
mov esi, offset pkey1
mov al, [esi]
call GetIndexInEntry
mov p1index, al
call ClearRegisters
mov esi, offset pkey2
mov al, [esi]
call GetIndexInEntry
mov p2index, al
mov eax, offset E
mov ebx, offset plug
add al, p1index
add bl, p1index
mov ecx, [eax]
mov edx, [ebx]
cmp ecx, edx
jne usedplug
plug1ok:
call ClearRegisters
mov eax, offset E
mov ebx, offset plug
add al, p2index
add bl, p2index
mov ecx, [eax]
mov edx, [ebx]
cmp ecx, edx
jne usedplug
plug2ok:
call ClearRegisters
mov eax, offset plug
mov ebx, offset plug
mov cl, p1index
mov dl, p2index
add al, cl
add bl, dl
mov ecx, 0
mov edx, 0
mov cl, [eax]
mov dl, [ebx]
xchg ecx, edx
mov [eax], cl
mov [ebx], dl
usedplug:
jmp Setupkey
two:
mov esi, offset E
mov edi, offset plug
mov ecx, lengthof E
resetPlug:
mov eax, [esi]
mov [edi], al
inc esi
inc edi
loop resetPlug
invalid:
jmp Setupkey
three:
call clrscr
ret
SetupPlugBoard endp
SetupRotors proc uses eax edx ecx edx esi edi
Setuprtr:
call clrscr
mov edx, offset setup_rotor_title
call writeline
call crlf
mov edx, offset rtr_a
call writestring
mov edx, offset A_
call writeline
mov edx, offset rtr_b
call writestring
mov edx, offset B_
call writeline
mov edx, offset rtr_c
call writestring
mov edx, offset C_
call writeline
mov edx, offset rtr_r
call writestring
mov edx, offset R
call writeline
call crlf
mov edx, offset menu_title
call writeline
mov edx, offset rtr_1_menu
call writeline
mov edx, offset menu_select
call writestring
mov eax, 0
call readint
cmp eax, 1
je rtredit
cmp eax, 2
je rtruse
jne Setuprtr
rtredit:
call crlf
mov edx, offset rtrprompt
call writestring
mov eax, 0
call readint
cmp eax, 1
je rtrone
cmp eax, 2
je rtrtwo
cmp eax, 3
je rtrthree
cmp eax, 4
je rtrfour
cmp eax, 5
je Setuprtr
jne rtredit
rtrone:
call ClearRegisters
movzx ebx, astep
movzx ecx, ashift
mov esi, offset A_
mov edi, offset A_R
call SetRotorProp
mov astep, bl
mov ashift, cl
jmp Setuprtr
rtrtwo:
call ClearRegisters
movzx ebx, bstep
movzx ecx, bshift
mov esi, offset B_
mov edi, offset B_R
call SetRotorProp
mov bstep, bl
mov bshift, cl
jmp Setuprtr
rtrthree:
call ClearRegisters
movzx ebx, cstep
movzx ecx, cshift
mov esi, offset C_
mov edi, offset C_R
call SetRotorProp
mov cstep, bl
mov cshift, cl
jmp Setuprtr
rtrfour:
call ClearRegisters
mov esi, offset R
call SetReflectorProp
jmp Setuprtr
rtruse:
ret
SetupRotors endp
;ebx = step
;ecx = start
;esi = rotor array
;edi = reverse rotor array
SetRotorProp proc uses edx eax
setproperty:
call clrscr
mov edx, offset rtr_1_title
call writeline
call crlf
mov edx, offset rtr_1_prop1
call writestring
mov edx, esi
call writeline
mov edx, offset rtr_1_prop2
call writestring
mov edx, edi
call writeline
mov edx, offset rtr_1_prop3
call writestring
mov eax, ebx
call writeint
call crlf
mov edx, offset rtr_1_prop4
call writestring
mov eax, ecx
call writeint
call crlf
call crlf
mov edx, offset menu_title
call writeline
mov edx, offset rtr_1_menu_item1
call writeline
mov edx, offset rtr_1_menu_item2
call writeline
mov edx, offset rtr_1_menu_item3
call writeline
mov edx, offset rtr_1_menu_item4
call writeline
mov edx, offset rtr_1_menu_item5
call writeline
call crlf
mov edx, offset menu_select
call writestring
mov eax, 0
call readint
cmp eax, 1
je selectrtr
cmp eax, 2
je creatertr
cmp eax, 3
je setpos
cmp eax, 4
je setstep
cmp eax, 5
je gotoend
jmp setproperty
selectrtr:
call clrscr
push ebx
call ExistingRotorSelect
cmp eax, 0
jle selectrtr
cmp eax, 12
jge selectrtr
SetTheRotor:
push ecx
push edi
mov edi, esi
mov ecx, 26
FillRotor:
mov edx, [ebx]
mov [edi], dl
inc ebx
inc edi
loop FillRotor
pop edi
mov ebx, esi
call GenerateReverse
mov esi, ebx
pop ecx
pop ebx
jmp setproperty
creatertr:
push ebx
push ecx
call crlf
mov edx, offset rtr_input_prompt
call writestring
mov edx, offset rtr_input
mov ecx, 27
mov eax, 0
call readstring
push esi
mov esi, edx
push eax
call VerifyRotor
pop eax
pop esi
cmp ebx, 0
je creatertr
call writeint
cmp eax, 26
jne creatertr
pop ecx
mov ebx, edx
jmp SetTheRotor
setpos:
mov edx, offset rtr_pos_prompt
call writestring
mov eax, 0
call readint
mov ebx, 0
mov ebx, eax
jmp setproperty
setstep:
mov edx, offset rtr_step_prompt
call writestring
mov eax, 0
call readint
mov ecx, 0
mov ecx, eax
jmp setproperty
gotoend:
ret
SetRotorProp endp
GenerateReverse proc uses ebx ecx eax edx
; edi reverse rotor
; esi rotor
; ebx E
; eax value
mov ebx, offset E
mov ecx, 26
FillReverse:
mov eax, [esi]
call GetIndexInEntry
mov edx, [ebx]
push esi
mov esi, edi
add edi, eax
mov [edi], dl
mov edi, esi
pop esi
inc esi
inc ebx
loop FillReverse
ret
GenerateReverse endp
ExistingRotorSelect proc
invalidrotor:
call clrscr
mov edx, offset rtr_2_menu
call writeline
call crlf
mov edx, offset menu_select
call writestring
mov eax, 0
call readint
cmp eax, 0
jle invalidrotor
cmp eax, 12
jge invalidrotor
cmp eax, 1
mov ebx, offset s1
je fill_loop
cmp eax, 2
mov ebx, offset s2
je fill_loop
cmp eax, 3
mov ebx, offset s3
je fill_loop
cmp eax, 4
mov ebx, offset s4
je fill_loop
cmp eax, 5
mov ebx, offset s5
je fill_loop
cmp eax, 6
mov ebx, offset s6
je fill_loop
cmp eax, 7
mov ebx, offset s7
je fill_loop
cmp eax, 8
mov ebx, offset s8
je fill_loop
cmp eax, 9
mov ebx, offset s9
je fill_loop
cmp eax, 10
mov ebx, offset s10
je fill_loop
cmp eax, 11
mov ebx, offset s11
fill_loop:
ret
ExistingRotorSelect endp
SetReflectorProp proc uses edx eax ebx edx ecx edi
setreflect:
call clrscr
mov edx, offset rtr_1_title
call writeline
call crlf
mov edx, offset rtr_1_prop1
call writestring
mov edx, esi
call writeline
call crlf
mov edx, offset menu_title
call writeline
mov edx, offset rtr_1_menu_item1
call writeline
mov edx, offset rtr_1_menu_item2
call writeline
mov edx, offset rtr_1_menu_item6
call writeline
call crlf
mov edx, offset menu_select
call writestring
mov eax, 0
call readint
cmp eax, 1
je selectref
cmp eax, 2
je customref
cmp eax, 3
je GotoEndRef
jmp setreflect
selectref:
call clrscr
call ExistingRotorSelect
cmp eax, 0
jle setreflect
cmp eax, 12
jge setreflect
chooseref:
mov edi, esi
mov ecx, 26
FillReflector:
mov edx, [ebx]
mov [edi], dl
inc ebx
inc edi
loop FillReflector
jmp setreflect
customref:
push ecx
call crlf
mov edx, offset rtr_input_prompt
call writestring
mov edx, offset rtr_input
mov ecx, 27
mov eax, 0
call readstring
push esi
mov esi, edx
push eax
call VerifyRotor
pop eax
pop esi
cmp ebx, 0
je customref
call writeint
cmp eax, 26
jne customref
pop ecx
mov ebx, edx
jmp chooseref
GotoEndRef:
ret
SetReflectorProp endp
writeline proc
call writestring
call crlf
ret
writeline endp
VerifyRotor proc uses ecx edx
push edi
mov edi, esi
mov ebx, 1
mov edx, 64
Nextletter:
inc edx
mov ecx, 26
mov esi, edi
CheckLetters:
mov eax, [esi]
cmp eax, edx
je Nextletter
inc esi
loop CheckLetters
cmp edx, 90
jge GotoEndVerify
mov ebx, 0
GotoEndVerify:
mov esi, edi
pop edi
ret
VerifyRotor endp
end main
|
Cubical/Algebra/Group.agda | dan-iel-lee/cubical | 0 | 253 | <reponame>dan-iel-lee/cubical
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Group where
open import Cubical.Algebra.Group.Base public
open import Cubical.Algebra.Group.Properties public
open import Cubical.Algebra.Group.Morphism public
open import Cubical.Algebra.Group.MorphismProperties public
open import Cubical.Algebra.Group.Algebra public
|
aspectj/AspectJParser.g4 | ChristianWulf/grammars-v4 | 4 | 2064 |
/*
[The "BSD licence"]
Copyright (c) 2015 <NAME>
All rights reserved.
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. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
/*
Derived from
https://eclipse.org/aspectj/doc/next/quick5.pdf
https://eclipse.org/aspectj/doc/next/progguide/starting.html
https://eclipse.org/aspectj/doc/next/adk15notebook/grammar.html
*/
/*
This grammar builds on top of the ANTLR4 Java grammar, but it uses
lexical modes to lex the annotation form of AspectJ; hence in order to use it
you need to break Java.g4 into Separate Lexer (JavaLexer.g4) and Parser (JavaParser.g4) grammars.
*/
parser grammar AspectJParser;
options { tokenVocab=AspectJLexer; }
import JavaParser;
typeDeclaration
: classOrInterfaceModifier* classDeclaration
| classOrInterfaceModifier* enumDeclaration
| classOrInterfaceModifier* interfaceDeclaration
| classOrInterfaceModifier* annotationTypeDeclaration
| classOrInterfaceModifier* aspectDeclaration
| ';'
;
aspectBody
: '{' aspectBodyDeclaration* '}'
;
classBodyDeclaration
: ';'
| 'static'? block
| modifier* memberDeclaration
| 'static' aspectDeclaration
;
aspectBodyDeclaration
: classBodyDeclaration
| advice
| interTypeMemberDeclaration
| interTypeDeclaration
;
memberDeclaration
: methodDeclaration
| genericMethodDeclaration
| fieldDeclaration
| constructorDeclaration
| genericConstructorDeclaration
| interfaceDeclaration
| annotationTypeDeclaration
| classDeclaration
| enumDeclaration
| pointcutDeclaration
;
// ANNOTATIONS
annotation
: '@' annotationName ( '(' ( elementValuePairs | elementValue )? ')' )?
| '@' 'After' '(' '"' pointcutExpression '"' ')'
| '@' 'AfterReturning' '(' '"' pointcutExpression '"' ')'
| '@' 'AfterReturning' '(' 'pointcut' '=' '"' pointcutExpression '"' ',' 'returning' '=' '"' id '"' ')'
| '@' 'AfterThrowing' '(' '"' pointcutExpression '"' ')'
| '@' 'Around' '(' '"' pointcutExpression '"' ')'
| '@' 'Aspect' ( '(' '"' perClause '"' ')' )?
| '@' 'Before' '(' '"' pointcutExpression '"' ')'
| '@' 'DeclareError' '(' '"' pointcutExpression '"' ')'
| '@' 'DeclareMixin' '(' 'value' '=' '"' typePattern '"' ',' 'interfaces' '=' '{' classPatternList '}' ')'
| '@' 'DeclareParents' '(' '"' typePattern '"' ')'
| '@' 'DeclareParents' '(' 'value' '=' '"' typePattern '"' ',' 'defaultImpl' '=' classPattern ')'
| '@' 'DeclarePrecedence' '(' '"' typePatternList '"' ')'
| '@' 'DeclareWarning' '(' '"' pointcutExpression '"' ')'
| '@' 'Pointcut' '(' '"' pointcutExpression? '"' ')'
;
classPattern
: id ('.' id)* '.' 'class'
;
classPatternList
: classPattern (',' classPattern)*
;
aspectDeclaration
: 'privileged'? modifier* 'aspect' id
('extends' type)?
('implements' typeList)?
perClause?
aspectBody
;
advice
: 'strictfp'? adviceSpec ('throws' typeList)? ':' pointcutExpression methodBody
;
adviceSpec
: 'before' formalParameters
| 'after' formalParameters
| 'after' formalParameters 'returning' ('(' formalParameter? ')')?
| 'after' formalParameters 'throwing' ('(' formalParameter? ')')?
| (type | 'void') 'around' formalParameters
;
perClause
: 'pertarget' '(' pointcutExpression ')'
| 'perthis' '(' pointcutExpression ')'
| 'percflow' '(' pointcutExpression ')'
| 'percflowbelow' '(' pointcutExpression ')'
| 'pertypewithin' '(' typePattern ')'
| 'issingleton' '(' ')'
;
pointcutDeclaration
: 'abstract' modifier* 'pointcut' id formalParameters ';'
| modifier* 'pointcut' id formalParameters ':' pointcutExpression ';'
;
pointcutExpression
: (pointcutPrimitive | referencePointcut)
| '!' pointcutExpression
| '(' pointcutExpression ')'
| pointcutExpression '&&' pointcutExpression
| pointcutExpression '||' pointcutExpression
;
pointcutPrimitive
: 'call' '(' methodOrConstructorPattern ')' #CallPointcut
| 'execution' '(' methodOrConstructorPattern ')' #ExecutionPointcut
| 'initialization' '(' constructorPattern ')' #InitializationPointcut
| 'preinitialization' '(' constructorPattern ')' #PreInitializationPointcut
| 'staticinitialization' '(' optionalParensTypePattern ')' #StaticInitializationPointcut
| 'get' '(' fieldPattern ')' #GetPointcut
| 'set' '(' fieldPattern ')' #SetPointcut
| 'handler' '(' optionalParensTypePattern ')' #HandlerPointcut
| 'adviceexecution' '(' ')' #AdviceExecutionPointcut
| 'within' '(' optionalParensTypePattern ')' #WithinPointcut
| 'withincode' '(' methodOrConstructorPattern ')' #WithinCodePointcut
| 'cflow' '(' pointcutExpression ')' #CFlowPointcut
| 'cflowbelow' '(' pointcutExpression ')' #CFlowBelowPointcut
| 'if' '(' expression? ')' #IfPointcut
| 'this' '(' typeOrIdentifier ')' #ThisPointcutPointcut
| 'target' '(' typeOrIdentifier ')' #TargetPointcut
| 'args' '(' argsPatternList ')' #ArgsPointcut
| '@' 'this' '(' annotationOrIdentifer ')' #AnnotationThisPointcut
| '@' 'target' '(' annotationOrIdentifer ')' #AnnotationTargetPointcut
| '@' 'args' '(' annotationsOrIdentifiersPattern ')' #AnnotationArgsPointcut
| '@' 'within' '(' annotationOrIdentifer ')' #AnnotationWithinPointcut
| '@' 'withincode' '(' annotationOrIdentifer ')' #AnnotationWithinCodePointcut
| '@' 'annotation' '(' annotationOrIdentifer ')' #AnnotationPointcut
;
referencePointcut
: (typePattern '.')? id formalParametersPattern
;
interTypeMemberDeclaration
: modifier* (type|'void') type '.' id formalParameters ('throws' typeList)? methodBody
| modifier* 'abstract' modifier* (type|'void') type '.' id formalParameters ('throws' typeList)? ';'
| modifier* type '.' 'new' formalParameters ('throws' typeList)? methodBody
| modifier* (type|'void') type '.' id ('=' expression)? ';'
;
interTypeDeclaration
: 'declare' 'parents' ':' typePattern 'extends' type ';'
| 'declare' 'parents' ':' typePattern 'implements' typeList ';'
| 'declare' 'warning' ':' pointcutExpression ':' StringLiteral ';'
| 'declare' 'error' ':' pointcutExpression ':' StringLiteral ';'
| 'declare' 'soft' ':' type ':' pointcutExpression ';'
| 'declare' 'precedence' ':' typePatternList ';'
| 'declare' '@' 'type' ':' typePattern ':' annotation ';'
| 'declare' '@' 'method' ':' methodPattern ':' annotation ';'
| 'declare' '@' 'constructor' ':' constructorPattern ':' annotation ';'
| 'declare' '@' 'field' ':' fieldPattern ':' annotation ';'
;
typePattern
: simpleTypePattern
| '!' typePattern
| '(' annotationPattern? typePattern ')'
| typePattern '&&' typePattern
| typePattern '||' typePattern
;
simpleTypePattern
: dottedNamePattern '+'? ('[' ']')*
;
dottedNamePattern
: (type | id | '*' | '.' | '..')+
| 'void'
;
optionalParensTypePattern
: '(' annotationPattern? typePattern ')'
| annotationPattern? typePattern
;
fieldPattern
: annotationPattern? fieldModifiersPattern? typePattern (typePattern dotOrDotDot)? simpleNamePattern
;
fieldModifiersPattern
: '!'? fieldModifier fieldModifiersPattern*
;
fieldModifier
: ( 'public'
| 'private'
| 'protected'
| 'static'
| 'transient'
| 'final'
)
;
dotOrDotDot
: '.'
| '..'
;
simpleNamePattern
: id ('*' id)* '*'?
| '*' (id '*')* id?
;
methodOrConstructorPattern
: methodPattern
| constructorPattern
;
methodPattern
: annotationPattern? methodModifiersPattern? typePattern (typePattern dotOrDotDot)? simpleNamePattern formalParametersPattern throwsPattern?
;
methodModifiersPattern
: '!'? methodModifier methodModifiersPattern*
;
methodModifier
: ( 'public'
| 'private'
| 'protected'
| 'static'
| 'synchronized'
| 'final'
)
;
formalsPattern
: '..' (',' formalsPatternAfterDotDot)*
| optionalParensTypePattern (',' formalsPattern)*
| typePattern '...'
;
formalsPatternAfterDotDot
: optionalParensTypePattern (',' formalsPatternAfterDotDot)*
| typePattern '...'
;
throwsPattern
: 'throws' typePatternList
;
typePatternList
: typePattern (',' typePattern)*
;
constructorPattern
: annotationPattern? constructorModifiersPattern? (typePattern dotOrDotDot)? 'new' formalParametersPattern throwsPattern?
;
constructorModifiersPattern
: '!'? constructorModifier constructorModifiersPattern*
;
constructorModifier
: ('public' | 'private' | 'protected')
;
annotationPattern
: '!'? '@' annotationTypePattern annotationPattern*
;
annotationTypePattern
: qualifiedName
| '(' typePattern ')'
;
formalParametersPattern
: '(' formalsPattern? ')'
;
typeOrIdentifier
: type
| variableDeclaratorId
;
annotationOrIdentifer
: qualifiedName | id
;
annotationsOrIdentifiersPattern
: '..' (',' annotationsOrIdentifiersPatternAfterDotDot)?
| annotationOrIdentifer (',' annotationsOrIdentifiersPattern)*
| '*' (',' annotationsOrIdentifiersPattern)*
;
annotationsOrIdentifiersPatternAfterDotDot
: annotationOrIdentifer (',' annotationsOrIdentifiersPatternAfterDotDot)*
| '*' (',' annotationsOrIdentifiersPatternAfterDotDot)*
;
argsPattern
: typeOrIdentifier
| ('*' | '..')
;
argsPatternList
: argsPattern (',' argsPattern)*
;
// all of the following rules are only necessary to change rules in the original Java grammar from 'Identifier' to 'id'
id
: ( ARGS
| AFTER
| AROUND
| ASPECT
| BEFORE
| CALL
| CFLOW
| CFLOWBELOW
| DECLARE
| ERROR
| EXECUTION
| GET
| HANDLER
| INITIALIZATION
| ISSINGLETON
| PARENTS
| PERCFLOW
| PERCFLOWBELOW
| PERTARGET
| PERTHIS
| PERTYPEWITHIN
| POINTCUT
| PRECEDENCE
| PREINITIALIZATION
| PRIVILEGED
| RETURNING
| SET
| SOFT
| STATICINITIALIZATION
| TARGET
| THROWING
| WARNING
| WITHIN
| WITHINCODE
)
| Identifier
;
classDeclaration
: 'class' id typeParameters?
('extends' type)?
('implements' typeList)?
classBody
;
typeParameter
: id ('extends' typeBound)?
;
enumDeclaration
: ENUM id ('implements' typeList)?
'{' enumConstants? ','? enumBodyDeclarations? '}'
;
enumConstant
: annotation* id arguments? classBody?
;
interfaceDeclaration
: 'interface' id typeParameters? ('extends' typeList)? interfaceBody
;
methodDeclaration
: (type|'void') id formalParameters ('[' ']')*
('throws' qualifiedNameList)?
( methodBody
| ';'
)
;
constructorDeclaration
: id formalParameters ('throws' qualifiedNameList)?
constructorBody
;
constantDeclarator
: id ('[' ']')* '=' variableInitializer
;
interfaceMethodDeclaration
: (type|'void') id formalParameters ('[' ']')*
('throws' qualifiedNameList)?
';'
;
variableDeclaratorId
: id ('[' ']')*
;
enumConstantName
: id
;
classOrInterfaceType
: id typeArguments? ('.' id typeArguments? )*
;
qualifiedName
: id ('.' id)*
;
elementValuePair
: id '=' elementValue
;
annotationTypeDeclaration
: '@' 'interface' id annotationTypeBody
;
annotationMethodRest
: id '(' ')' defaultValue?
;
statement
: block
| ASSERT expression (':' expression)? ';'
| 'if' parExpression statement ('else' statement)?
| 'for' '(' forControl ')' statement
| 'while' parExpression statement
| 'do' statement 'while' parExpression ';'
| 'try' block (catchClause+ finallyBlock? | finallyBlock)
| 'try' resourceSpecification block catchClause* finallyBlock?
| 'switch' parExpression '{' switchBlockStatementGroup* switchLabel* '}'
| 'synchronized' parExpression block
| 'return' expression? ';'
| 'throw' expression ';'
| 'break' id? ';'
| 'continue' id? ';'
| ';'
| statementExpression ';'
| id ':' statement
;
catchClause
: 'catch' '(' variableModifier* catchType id ')' block
;
expression
: primary
| expression '.' id
| expression '.' 'this'
| expression '.' 'new' nonWildcardTypeArguments? innerCreator
| expression '.' 'super' superSuffix
| expression '.' explicitGenericInvocation
| expression '[' expression ']'
| expression '(' expressionList? ')'
| 'new' creator
| '(' type ')' expression
| expression ('++' | '--')
| ('+'|'-'|'++'|'--') expression
| ('~'|'!') expression
| expression ('*'|'/'|'%') expression
| expression ('+'|'-') expression
| expression ('<' '<' | '>' '>' '>' | '>' '>') expression
| expression ('<=' | '>=' | '>' | '<') expression
| expression 'instanceof' type
| expression ('==' | '!=') expression
| expression '&' expression
| expression '^' expression
| expression '|' expression
| expression '&&' expression
| expression '||' expression
| expression '?' expression ':' expression
| /*<assoc=right>*/ expression
( '='
| '+='
| '-='
| '*='
| '/='
| '&='
| '|='
| '^='
| '>>='
| '>>>='
| '<<='
| '%='
)
expression
;
primary
: '(' expression ')'
| 'this'
| 'super'
| literal
| id
| type '.' 'class'
| 'void' '.' 'class'
| nonWildcardTypeArguments (explicitGenericInvocationSuffix | 'this' arguments)
;
createdName
: id typeArgumentsOrDiamond? ('.' id typeArgumentsOrDiamond?)*
| primitiveType
;
innerCreator
: id nonWildcardTypeArgumentsOrDiamond? classCreatorRest
;
superSuffix
: arguments
| '.' id arguments?
;
explicitGenericInvocationSuffix
: 'super' superSuffix
| id arguments
;
|
programs/oeis/017/A017777.asm | neoneye/loda | 22 | 246054 | ; A017777: Binomial coefficients C(61,n).
; 1,61,1830,35990,521855,5949147,55525372,436270780,2944827765,17341763505,90177170226,418094152866,1742058970275,6566222272575,22512762077400,70539987842520,202802465047245,536830054536825,1312251244423350,2969831763694950,6236646703759395,12176310231149295,22138745874816900,37539612570341700,59437719903041025,87967825456500717,121801604478231762,157890968768078210,191724747789809255,218169540588403635,232714176627630544,232714176627630544,218169540588403635,191724747789809255,157890968768078210,121801604478231762,87967825456500717,59437719903041025,37539612570341700,22138745874816900,12176310231149295,6236646703759395,2969831763694950,1312251244423350,536830054536825,202802465047245,70539987842520,22512762077400,6566222272575,1742058970275,418094152866,90177170226,17341763505,2944827765,436270780,55525372,5949147,521855,35990,1830,61,1
mov $1,61
bin $1,$0
mov $0,$1
|
alloy4fun_models/trainstlt/models/2/MQeaKWF4jwqyeaxBn.als | Kaixi26/org.alloytools.alloy | 0 | 3832 | open main
pred idMQeaKWF4jwqyeaxBn_prop3 {
always pos = pos and (all t : (Train - pos.Track) | t.pos not in Track implies always t.pos not in Track)
}
pred __repair { idMQeaKWF4jwqyeaxBn_prop3 }
check __repair { idMQeaKWF4jwqyeaxBn_prop3 <=> prop3o } |
programs/oeis/132/A132760.asm | karttu/loda | 1 | 20605 | ; A132760: a(n) = n*(n+15).
; 0,16,34,54,76,100,126,154,184,216,250,286,324,364,406,450,496,544,594,646,700,756,814,874,936,1000,1066,1134,1204,1276,1350,1426,1504,1584,1666,1750,1836,1924,2014,2106,2200,2296,2394,2494
mov $1,$0
add $0,15
mul $1,$0
|
source/echo.asm | hamedmiir/OS-Lab-Scheduling | 0 | 81027 |
_echo: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 56 push %esi
e: 53 push %ebx
f: 51 push %ecx
10: 83 ec 0c sub $0xc,%esp
13: 8b 01 mov (%ecx),%eax
15: 8b 51 04 mov 0x4(%ecx),%edx
int i;
for(i = 1; i < argc; i++)
18: 83 f8 01 cmp $0x1,%eax
1b: 7e 3f jle 5c <main+0x5c>
1d: 8d 5a 04 lea 0x4(%edx),%ebx
20: 8d 34 82 lea (%edx,%eax,4),%esi
23: eb 18 jmp 3d <main+0x3d>
25: 8d 76 00 lea 0x0(%esi),%esi
printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n");
28: 68 c8 07 00 00 push $0x7c8
2d: 50 push %eax
2e: 68 ca 07 00 00 push $0x7ca
33: 6a 01 push $0x1
35: e8 36 04 00 00 call 470 <printf>
3a: 83 c4 10 add $0x10,%esp
3d: 83 c3 04 add $0x4,%ebx
40: 8b 43 fc mov -0x4(%ebx),%eax
43: 39 f3 cmp %esi,%ebx
45: 75 e1 jne 28 <main+0x28>
47: 68 cf 07 00 00 push $0x7cf
4c: 50 push %eax
4d: 68 ca 07 00 00 push $0x7ca
52: 6a 01 push $0x1
54: e8 17 04 00 00 call 470 <printf>
59: 83 c4 10 add $0x10,%esp
exit();
5c: e8 96 02 00 00 call 2f7 <exit>
61: 66 90 xchg %ax,%ax
63: 66 90 xchg %ax,%ax
65: 66 90 xchg %ax,%ax
67: 66 90 xchg %ax,%ax
69: 66 90 xchg %ax,%ax
6b: 66 90 xchg %ax,%ax
6d: 66 90 xchg %ax,%ax
6f: 90 nop
00000070 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
70: 55 push %ebp
71: 89 e5 mov %esp,%ebp
73: 53 push %ebx
74: 8b 45 08 mov 0x8(%ebp),%eax
77: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
7a: 89 c2 mov %eax,%edx
7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80: 83 c1 01 add $0x1,%ecx
83: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
87: 83 c2 01 add $0x1,%edx
8a: 84 db test %bl,%bl
8c: 88 5a ff mov %bl,-0x1(%edx)
8f: 75 ef jne 80 <strcpy+0x10>
;
return os;
}
91: 5b pop %ebx
92: 5d pop %ebp
93: c3 ret
94: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
9a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000000a0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
a0: 55 push %ebp
a1: 89 e5 mov %esp,%ebp
a3: 53 push %ebx
a4: 8b 55 08 mov 0x8(%ebp),%edx
a7: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
aa: 0f b6 02 movzbl (%edx),%eax
ad: 0f b6 19 movzbl (%ecx),%ebx
b0: 84 c0 test %al,%al
b2: 75 1c jne d0 <strcmp+0x30>
b4: eb 2a jmp e0 <strcmp+0x40>
b6: 8d 76 00 lea 0x0(%esi),%esi
b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
c0: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
c3: 0f b6 02 movzbl (%edx),%eax
p++, q++;
c6: 83 c1 01 add $0x1,%ecx
c9: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
cc: 84 c0 test %al,%al
ce: 74 10 je e0 <strcmp+0x40>
d0: 38 d8 cmp %bl,%al
d2: 74 ec je c0 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
d4: 29 d8 sub %ebx,%eax
}
d6: 5b pop %ebx
d7: 5d pop %ebp
d8: c3 ret
d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
e0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
e2: 29 d8 sub %ebx,%eax
}
e4: 5b pop %ebx
e5: 5d pop %ebp
e6: c3 ret
e7: 89 f6 mov %esi,%esi
e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000000f0 <strlen>:
uint
strlen(const char *s)
{
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
f6: 80 39 00 cmpb $0x0,(%ecx)
f9: 74 15 je 110 <strlen+0x20>
fb: 31 d2 xor %edx,%edx
fd: 8d 76 00 lea 0x0(%esi),%esi
100: 83 c2 01 add $0x1,%edx
103: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
107: 89 d0 mov %edx,%eax
109: 75 f5 jne 100 <strlen+0x10>
;
return n;
}
10b: 5d pop %ebp
10c: c3 ret
10d: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
110: 31 c0 xor %eax,%eax
}
112: 5d pop %ebp
113: c3 ret
114: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
11a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000120 <memset>:
void*
memset(void *dst, int c, uint n)
{
120: 55 push %ebp
121: 89 e5 mov %esp,%ebp
123: 57 push %edi
124: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
127: 8b 4d 10 mov 0x10(%ebp),%ecx
12a: 8b 45 0c mov 0xc(%ebp),%eax
12d: 89 d7 mov %edx,%edi
12f: fc cld
130: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
132: 89 d0 mov %edx,%eax
134: 5f pop %edi
135: 5d pop %ebp
136: c3 ret
137: 89 f6 mov %esi,%esi
139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000140 <strchr>:
char*
strchr(const char *s, char c)
{
140: 55 push %ebp
141: 89 e5 mov %esp,%ebp
143: 53 push %ebx
144: 8b 45 08 mov 0x8(%ebp),%eax
147: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
14a: 0f b6 10 movzbl (%eax),%edx
14d: 84 d2 test %dl,%dl
14f: 74 1d je 16e <strchr+0x2e>
if(*s == c)
151: 38 d3 cmp %dl,%bl
153: 89 d9 mov %ebx,%ecx
155: 75 0d jne 164 <strchr+0x24>
157: eb 17 jmp 170 <strchr+0x30>
159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
160: 38 ca cmp %cl,%dl
162: 74 0c je 170 <strchr+0x30>
for(; *s; s++)
164: 83 c0 01 add $0x1,%eax
167: 0f b6 10 movzbl (%eax),%edx
16a: 84 d2 test %dl,%dl
16c: 75 f2 jne 160 <strchr+0x20>
return (char*)s;
return 0;
16e: 31 c0 xor %eax,%eax
}
170: 5b pop %ebx
171: 5d pop %ebp
172: c3 ret
173: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
179: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000180 <gets>:
char*
gets(char *buf, int max)
{
180: 55 push %ebp
181: 89 e5 mov %esp,%ebp
183: 57 push %edi
184: 56 push %esi
185: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
186: 31 f6 xor %esi,%esi
188: 89 f3 mov %esi,%ebx
{
18a: 83 ec 1c sub $0x1c,%esp
18d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
190: eb 2f jmp 1c1 <gets+0x41>
192: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
198: 8d 45 e7 lea -0x19(%ebp),%eax
19b: 83 ec 04 sub $0x4,%esp
19e: 6a 01 push $0x1
1a0: 50 push %eax
1a1: 6a 00 push $0x0
1a3: e8 67 01 00 00 call 30f <read>
if(cc < 1)
1a8: 83 c4 10 add $0x10,%esp
1ab: 85 c0 test %eax,%eax
1ad: 7e 1c jle 1cb <gets+0x4b>
break;
buf[i++] = c;
1af: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
1b3: 83 c7 01 add $0x1,%edi
1b6: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
1b9: 3c 0a cmp $0xa,%al
1bb: 74 23 je 1e0 <gets+0x60>
1bd: 3c 0d cmp $0xd,%al
1bf: 74 1f je 1e0 <gets+0x60>
for(i=0; i+1 < max; ){
1c1: 83 c3 01 add $0x1,%ebx
1c4: 3b 5d 0c cmp 0xc(%ebp),%ebx
1c7: 89 fe mov %edi,%esi
1c9: 7c cd jl 198 <gets+0x18>
1cb: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
1cd: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
1d0: c6 03 00 movb $0x0,(%ebx)
}
1d3: 8d 65 f4 lea -0xc(%ebp),%esp
1d6: 5b pop %ebx
1d7: 5e pop %esi
1d8: 5f pop %edi
1d9: 5d pop %ebp
1da: c3 ret
1db: 90 nop
1dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1e0: 8b 75 08 mov 0x8(%ebp),%esi
1e3: 8b 45 08 mov 0x8(%ebp),%eax
1e6: 01 de add %ebx,%esi
1e8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
1ea: c6 03 00 movb $0x0,(%ebx)
}
1ed: 8d 65 f4 lea -0xc(%ebp),%esp
1f0: 5b pop %ebx
1f1: 5e pop %esi
1f2: 5f pop %edi
1f3: 5d pop %ebp
1f4: c3 ret
1f5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000200 <stat>:
int
stat(const char *n, struct stat *st)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 56 push %esi
204: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
205: 83 ec 08 sub $0x8,%esp
208: 6a 00 push $0x0
20a: ff 75 08 pushl 0x8(%ebp)
20d: e8 25 01 00 00 call 337 <open>
if(fd < 0)
212: 83 c4 10 add $0x10,%esp
215: 85 c0 test %eax,%eax
217: 78 27 js 240 <stat+0x40>
return -1;
r = fstat(fd, st);
219: 83 ec 08 sub $0x8,%esp
21c: ff 75 0c pushl 0xc(%ebp)
21f: 89 c3 mov %eax,%ebx
221: 50 push %eax
222: e8 28 01 00 00 call 34f <fstat>
close(fd);
227: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
22a: 89 c6 mov %eax,%esi
close(fd);
22c: e8 ee 00 00 00 call 31f <close>
return r;
231: 83 c4 10 add $0x10,%esp
}
234: 8d 65 f8 lea -0x8(%ebp),%esp
237: 89 f0 mov %esi,%eax
239: 5b pop %ebx
23a: 5e pop %esi
23b: 5d pop %ebp
23c: c3 ret
23d: 8d 76 00 lea 0x0(%esi),%esi
return -1;
240: be ff ff ff ff mov $0xffffffff,%esi
245: eb ed jmp 234 <stat+0x34>
247: 89 f6 mov %esi,%esi
249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000250 <atoi>:
int
atoi(const char *s)
{
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 53 push %ebx
254: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
257: 0f be 11 movsbl (%ecx),%edx
25a: 8d 42 d0 lea -0x30(%edx),%eax
25d: 3c 09 cmp $0x9,%al
n = 0;
25f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
264: 77 1f ja 285 <atoi+0x35>
266: 8d 76 00 lea 0x0(%esi),%esi
269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
270: 8d 04 80 lea (%eax,%eax,4),%eax
273: 83 c1 01 add $0x1,%ecx
276: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
27a: 0f be 11 movsbl (%ecx),%edx
27d: 8d 5a d0 lea -0x30(%edx),%ebx
280: 80 fb 09 cmp $0x9,%bl
283: 76 eb jbe 270 <atoi+0x20>
return n;
}
285: 5b pop %ebx
286: 5d pop %ebp
287: c3 ret
288: 90 nop
289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000290 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
290: 55 push %ebp
291: 89 e5 mov %esp,%ebp
293: 56 push %esi
294: 53 push %ebx
295: 8b 5d 10 mov 0x10(%ebp),%ebx
298: 8b 45 08 mov 0x8(%ebp),%eax
29b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
29e: 85 db test %ebx,%ebx
2a0: 7e 14 jle 2b6 <memmove+0x26>
2a2: 31 d2 xor %edx,%edx
2a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
2a8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
2ac: 88 0c 10 mov %cl,(%eax,%edx,1)
2af: 83 c2 01 add $0x1,%edx
while(n-- > 0)
2b2: 39 d3 cmp %edx,%ebx
2b4: 75 f2 jne 2a8 <memmove+0x18>
return vdst;
}
2b6: 5b pop %ebx
2b7: 5e pop %esi
2b8: 5d pop %ebp
2b9: c3 ret
2ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000002c0 <delay>:
void delay(int numberOfClocks)
{
2c0: 55 push %ebp
2c1: 89 e5 mov %esp,%ebp
2c3: 53 push %ebx
2c4: 83 ec 04 sub $0x4,%esp
int firstClock = uptime();
2c7: e8 c3 00 00 00 call 38f <uptime>
2cc: 89 c3 mov %eax,%ebx
int incClock = uptime();
2ce: e8 bc 00 00 00 call 38f <uptime>
while(incClock >= (firstClock + numberOfClocks) )
2d3: 03 5d 08 add 0x8(%ebp),%ebx
2d6: 39 d8 cmp %ebx,%eax
2d8: 7c 0f jl 2e9 <delay+0x29>
2da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
{
incClock = uptime();
2e0: e8 aa 00 00 00 call 38f <uptime>
while(incClock >= (firstClock + numberOfClocks) )
2e5: 39 d8 cmp %ebx,%eax
2e7: 7d f7 jge 2e0 <delay+0x20>
}
}
2e9: 83 c4 04 add $0x4,%esp
2ec: 5b pop %ebx
2ed: 5d pop %ebp
2ee: c3 ret
000002ef <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2ef: b8 01 00 00 00 mov $0x1,%eax
2f4: cd 40 int $0x40
2f6: c3 ret
000002f7 <exit>:
SYSCALL(exit)
2f7: b8 02 00 00 00 mov $0x2,%eax
2fc: cd 40 int $0x40
2fe: c3 ret
000002ff <wait>:
SYSCALL(wait)
2ff: b8 03 00 00 00 mov $0x3,%eax
304: cd 40 int $0x40
306: c3 ret
00000307 <pipe>:
SYSCALL(pipe)
307: b8 04 00 00 00 mov $0x4,%eax
30c: cd 40 int $0x40
30e: c3 ret
0000030f <read>:
SYSCALL(read)
30f: b8 05 00 00 00 mov $0x5,%eax
314: cd 40 int $0x40
316: c3 ret
00000317 <write>:
SYSCALL(write)
317: b8 10 00 00 00 mov $0x10,%eax
31c: cd 40 int $0x40
31e: c3 ret
0000031f <close>:
SYSCALL(close)
31f: b8 15 00 00 00 mov $0x15,%eax
324: cd 40 int $0x40
326: c3 ret
00000327 <kill>:
SYSCALL(kill)
327: b8 06 00 00 00 mov $0x6,%eax
32c: cd 40 int $0x40
32e: c3 ret
0000032f <exec>:
SYSCALL(exec)
32f: b8 07 00 00 00 mov $0x7,%eax
334: cd 40 int $0x40
336: c3 ret
00000337 <open>:
SYSCALL(open)
337: b8 0f 00 00 00 mov $0xf,%eax
33c: cd 40 int $0x40
33e: c3 ret
0000033f <mknod>:
SYSCALL(mknod)
33f: b8 11 00 00 00 mov $0x11,%eax
344: cd 40 int $0x40
346: c3 ret
00000347 <unlink>:
SYSCALL(unlink)
347: b8 12 00 00 00 mov $0x12,%eax
34c: cd 40 int $0x40
34e: c3 ret
0000034f <fstat>:
SYSCALL(fstat)
34f: b8 08 00 00 00 mov $0x8,%eax
354: cd 40 int $0x40
356: c3 ret
00000357 <link>:
SYSCALL(link)
357: b8 13 00 00 00 mov $0x13,%eax
35c: cd 40 int $0x40
35e: c3 ret
0000035f <mkdir>:
SYSCALL(mkdir)
35f: b8 14 00 00 00 mov $0x14,%eax
364: cd 40 int $0x40
366: c3 ret
00000367 <chdir>:
SYSCALL(chdir)
367: b8 09 00 00 00 mov $0x9,%eax
36c: cd 40 int $0x40
36e: c3 ret
0000036f <dup>:
SYSCALL(dup)
36f: b8 0a 00 00 00 mov $0xa,%eax
374: cd 40 int $0x40
376: c3 ret
00000377 <getpid>:
SYSCALL(getpid)
377: b8 0b 00 00 00 mov $0xb,%eax
37c: cd 40 int $0x40
37e: c3 ret
0000037f <sbrk>:
SYSCALL(sbrk)
37f: b8 0c 00 00 00 mov $0xc,%eax
384: cd 40 int $0x40
386: c3 ret
00000387 <sleep>:
SYSCALL(sleep)
387: b8 0d 00 00 00 mov $0xd,%eax
38c: cd 40 int $0x40
38e: c3 ret
0000038f <uptime>:
SYSCALL(uptime)
38f: b8 0e 00 00 00 mov $0xe,%eax
394: cd 40 int $0x40
396: c3 ret
00000397 <incNum>:
SYSCALL(incNum)
397: b8 16 00 00 00 mov $0x16,%eax
39c: cd 40 int $0x40
39e: c3 ret
0000039f <getprocs>:
SYSCALL(getprocs)
39f: b8 17 00 00 00 mov $0x17,%eax
3a4: cd 40 int $0x40
3a6: c3 ret
000003a7 <set_burst_time>:
SYSCALL(set_burst_time)
3a7: b8 18 00 00 00 mov $0x18,%eax
3ac: cd 40 int $0x40
3ae: c3 ret
000003af <set_priority>:
SYSCALL(set_priority)
3af: b8 19 00 00 00 mov $0x19,%eax
3b4: cd 40 int $0x40
3b6: c3 ret
000003b7 <set_lottery_ticket>:
SYSCALL(set_lottery_ticket)
3b7: b8 1a 00 00 00 mov $0x1a,%eax
3bc: cd 40 int $0x40
3be: c3 ret
000003bf <set_sched_queue>:
SYSCALL(set_sched_queue)
3bf: b8 1b 00 00 00 mov $0x1b,%eax
3c4: cd 40 int $0x40
3c6: c3 ret
000003c7 <show_processes_scheduling>:
SYSCALL(show_processes_scheduling)
3c7: b8 1c 00 00 00 mov $0x1c,%eax
3cc: cd 40 int $0x40
3ce: c3 ret
3cf: 90 nop
000003d0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
3d0: 55 push %ebp
3d1: 89 e5 mov %esp,%ebp
3d3: 57 push %edi
3d4: 56 push %esi
3d5: 53 push %ebx
3d6: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
3d9: 85 d2 test %edx,%edx
{
3db: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
3de: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
3e0: 79 76 jns 458 <printint+0x88>
3e2: f6 45 08 01 testb $0x1,0x8(%ebp)
3e6: 74 70 je 458 <printint+0x88>
x = -xx;
3e8: f7 d8 neg %eax
neg = 1;
3ea: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
3f1: 31 f6 xor %esi,%esi
3f3: 8d 5d d7 lea -0x29(%ebp),%ebx
3f6: eb 0a jmp 402 <printint+0x32>
3f8: 90 nop
3f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do{
buf[i++] = digits[x % base];
400: 89 fe mov %edi,%esi
402: 31 d2 xor %edx,%edx
404: 8d 7e 01 lea 0x1(%esi),%edi
407: f7 f1 div %ecx
409: 0f b6 92 d8 07 00 00 movzbl 0x7d8(%edx),%edx
}while((x /= base) != 0);
410: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
412: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
415: 75 e9 jne 400 <printint+0x30>
if(neg)
417: 8b 45 c4 mov -0x3c(%ebp),%eax
41a: 85 c0 test %eax,%eax
41c: 74 08 je 426 <printint+0x56>
buf[i++] = '-';
41e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
423: 8d 7e 02 lea 0x2(%esi),%edi
426: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
42a: 8b 7d c0 mov -0x40(%ebp),%edi
42d: 8d 76 00 lea 0x0(%esi),%esi
430: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
433: 83 ec 04 sub $0x4,%esp
436: 83 ee 01 sub $0x1,%esi
439: 6a 01 push $0x1
43b: 53 push %ebx
43c: 57 push %edi
43d: 88 45 d7 mov %al,-0x29(%ebp)
440: e8 d2 fe ff ff call 317 <write>
while(--i >= 0)
445: 83 c4 10 add $0x10,%esp
448: 39 de cmp %ebx,%esi
44a: 75 e4 jne 430 <printint+0x60>
putc(fd, buf[i]);
}
44c: 8d 65 f4 lea -0xc(%ebp),%esp
44f: 5b pop %ebx
450: 5e pop %esi
451: 5f pop %edi
452: 5d pop %ebp
453: c3 ret
454: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
458: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
45f: eb 90 jmp 3f1 <printint+0x21>
461: eb 0d jmp 470 <printf>
463: 90 nop
464: 90 nop
465: 90 nop
466: 90 nop
467: 90 nop
468: 90 nop
469: 90 nop
46a: 90 nop
46b: 90 nop
46c: 90 nop
46d: 90 nop
46e: 90 nop
46f: 90 nop
00000470 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
470: 55 push %ebp
471: 89 e5 mov %esp,%ebp
473: 57 push %edi
474: 56 push %esi
475: 53 push %ebx
476: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
479: 8b 75 0c mov 0xc(%ebp),%esi
47c: 0f b6 1e movzbl (%esi),%ebx
47f: 84 db test %bl,%bl
481: 0f 84 b3 00 00 00 je 53a <printf+0xca>
ap = (uint*)(void*)&fmt + 1;
487: 8d 45 10 lea 0x10(%ebp),%eax
48a: 83 c6 01 add $0x1,%esi
state = 0;
48d: 31 ff xor %edi,%edi
ap = (uint*)(void*)&fmt + 1;
48f: 89 45 d4 mov %eax,-0x2c(%ebp)
492: eb 2f jmp 4c3 <printf+0x53>
494: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
498: 83 f8 25 cmp $0x25,%eax
49b: 0f 84 a7 00 00 00 je 548 <printf+0xd8>
write(fd, &c, 1);
4a1: 8d 45 e2 lea -0x1e(%ebp),%eax
4a4: 83 ec 04 sub $0x4,%esp
4a7: 88 5d e2 mov %bl,-0x1e(%ebp)
4aa: 6a 01 push $0x1
4ac: 50 push %eax
4ad: ff 75 08 pushl 0x8(%ebp)
4b0: e8 62 fe ff ff call 317 <write>
4b5: 83 c4 10 add $0x10,%esp
4b8: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
4bb: 0f b6 5e ff movzbl -0x1(%esi),%ebx
4bf: 84 db test %bl,%bl
4c1: 74 77 je 53a <printf+0xca>
if(state == 0){
4c3: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
4c5: 0f be cb movsbl %bl,%ecx
4c8: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
4cb: 74 cb je 498 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
4cd: 83 ff 25 cmp $0x25,%edi
4d0: 75 e6 jne 4b8 <printf+0x48>
if(c == 'd'){
4d2: 83 f8 64 cmp $0x64,%eax
4d5: 0f 84 05 01 00 00 je 5e0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
4db: 81 e1 f7 00 00 00 and $0xf7,%ecx
4e1: 83 f9 70 cmp $0x70,%ecx
4e4: 74 72 je 558 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
4e6: 83 f8 73 cmp $0x73,%eax
4e9: 0f 84 99 00 00 00 je 588 <printf+0x118>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
4ef: 83 f8 63 cmp $0x63,%eax
4f2: 0f 84 08 01 00 00 je 600 <printf+0x190>
putc(fd, *ap);
ap++;
} else if(c == '%'){
4f8: 83 f8 25 cmp $0x25,%eax
4fb: 0f 84 ef 00 00 00 je 5f0 <printf+0x180>
write(fd, &c, 1);
501: 8d 45 e7 lea -0x19(%ebp),%eax
504: 83 ec 04 sub $0x4,%esp
507: c6 45 e7 25 movb $0x25,-0x19(%ebp)
50b: 6a 01 push $0x1
50d: 50 push %eax
50e: ff 75 08 pushl 0x8(%ebp)
511: e8 01 fe ff ff call 317 <write>
516: 83 c4 0c add $0xc,%esp
519: 8d 45 e6 lea -0x1a(%ebp),%eax
51c: 88 5d e6 mov %bl,-0x1a(%ebp)
51f: 6a 01 push $0x1
521: 50 push %eax
522: ff 75 08 pushl 0x8(%ebp)
525: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
528: 31 ff xor %edi,%edi
write(fd, &c, 1);
52a: e8 e8 fd ff ff call 317 <write>
for(i = 0; fmt[i]; i++){
52f: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
533: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
536: 84 db test %bl,%bl
538: 75 89 jne 4c3 <printf+0x53>
}
}
}
53a: 8d 65 f4 lea -0xc(%ebp),%esp
53d: 5b pop %ebx
53e: 5e pop %esi
53f: 5f pop %edi
540: 5d pop %ebp
541: c3 ret
542: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
548: bf 25 00 00 00 mov $0x25,%edi
54d: e9 66 ff ff ff jmp 4b8 <printf+0x48>
552: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
558: 83 ec 0c sub $0xc,%esp
55b: b9 10 00 00 00 mov $0x10,%ecx
560: 6a 00 push $0x0
562: 8b 7d d4 mov -0x2c(%ebp),%edi
565: 8b 45 08 mov 0x8(%ebp),%eax
568: 8b 17 mov (%edi),%edx
56a: e8 61 fe ff ff call 3d0 <printint>
ap++;
56f: 89 f8 mov %edi,%eax
571: 83 c4 10 add $0x10,%esp
state = 0;
574: 31 ff xor %edi,%edi
ap++;
576: 83 c0 04 add $0x4,%eax
579: 89 45 d4 mov %eax,-0x2c(%ebp)
57c: e9 37 ff ff ff jmp 4b8 <printf+0x48>
581: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
588: 8b 45 d4 mov -0x2c(%ebp),%eax
58b: 8b 08 mov (%eax),%ecx
ap++;
58d: 83 c0 04 add $0x4,%eax
590: 89 45 d4 mov %eax,-0x2c(%ebp)
if(s == 0)
593: 85 c9 test %ecx,%ecx
595: 0f 84 8e 00 00 00 je 629 <printf+0x1b9>
while(*s != 0){
59b: 0f b6 01 movzbl (%ecx),%eax
state = 0;
59e: 31 ff xor %edi,%edi
s = (char*)*ap;
5a0: 89 cb mov %ecx,%ebx
while(*s != 0){
5a2: 84 c0 test %al,%al
5a4: 0f 84 0e ff ff ff je 4b8 <printf+0x48>
5aa: 89 75 d0 mov %esi,-0x30(%ebp)
5ad: 89 de mov %ebx,%esi
5af: 8b 5d 08 mov 0x8(%ebp),%ebx
5b2: 8d 7d e3 lea -0x1d(%ebp),%edi
5b5: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
5b8: 83 ec 04 sub $0x4,%esp
s++;
5bb: 83 c6 01 add $0x1,%esi
5be: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
5c1: 6a 01 push $0x1
5c3: 57 push %edi
5c4: 53 push %ebx
5c5: e8 4d fd ff ff call 317 <write>
while(*s != 0){
5ca: 0f b6 06 movzbl (%esi),%eax
5cd: 83 c4 10 add $0x10,%esp
5d0: 84 c0 test %al,%al
5d2: 75 e4 jne 5b8 <printf+0x148>
5d4: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
5d7: 31 ff xor %edi,%edi
5d9: e9 da fe ff ff jmp 4b8 <printf+0x48>
5de: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
5e0: 83 ec 0c sub $0xc,%esp
5e3: b9 0a 00 00 00 mov $0xa,%ecx
5e8: 6a 01 push $0x1
5ea: e9 73 ff ff ff jmp 562 <printf+0xf2>
5ef: 90 nop
write(fd, &c, 1);
5f0: 83 ec 04 sub $0x4,%esp
5f3: 88 5d e5 mov %bl,-0x1b(%ebp)
5f6: 8d 45 e5 lea -0x1b(%ebp),%eax
5f9: 6a 01 push $0x1
5fb: e9 21 ff ff ff jmp 521 <printf+0xb1>
putc(fd, *ap);
600: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
603: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
606: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
608: 6a 01 push $0x1
ap++;
60a: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
60d: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
610: 8d 45 e4 lea -0x1c(%ebp),%eax
613: 50 push %eax
614: ff 75 08 pushl 0x8(%ebp)
617: e8 fb fc ff ff call 317 <write>
ap++;
61c: 89 7d d4 mov %edi,-0x2c(%ebp)
61f: 83 c4 10 add $0x10,%esp
state = 0;
622: 31 ff xor %edi,%edi
624: e9 8f fe ff ff jmp 4b8 <printf+0x48>
s = "(null)";
629: bb d1 07 00 00 mov $0x7d1,%ebx
while(*s != 0){
62e: b8 28 00 00 00 mov $0x28,%eax
633: e9 72 ff ff ff jmp 5aa <printf+0x13a>
638: 66 90 xchg %ax,%ax
63a: 66 90 xchg %ax,%ax
63c: 66 90 xchg %ax,%ax
63e: 66 90 xchg %ax,%ax
00000640 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
640: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
641: a1 a8 0a 00 00 mov 0xaa8,%eax
{
646: 89 e5 mov %esp,%ebp
648: 57 push %edi
649: 56 push %esi
64a: 53 push %ebx
64b: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
64e: 8d 4b f8 lea -0x8(%ebx),%ecx
651: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
658: 39 c8 cmp %ecx,%eax
65a: 8b 10 mov (%eax),%edx
65c: 73 32 jae 690 <free+0x50>
65e: 39 d1 cmp %edx,%ecx
660: 72 04 jb 666 <free+0x26>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
662: 39 d0 cmp %edx,%eax
664: 72 32 jb 698 <free+0x58>
break;
if(bp + bp->s.size == p->s.ptr){
666: 8b 73 fc mov -0x4(%ebx),%esi
669: 8d 3c f1 lea (%ecx,%esi,8),%edi
66c: 39 fa cmp %edi,%edx
66e: 74 30 je 6a0 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
670: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
673: 8b 50 04 mov 0x4(%eax),%edx
676: 8d 34 d0 lea (%eax,%edx,8),%esi
679: 39 f1 cmp %esi,%ecx
67b: 74 3a je 6b7 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
67d: 89 08 mov %ecx,(%eax)
freep = p;
67f: a3 a8 0a 00 00 mov %eax,0xaa8
}
684: 5b pop %ebx
685: 5e pop %esi
686: 5f pop %edi
687: 5d pop %ebp
688: c3 ret
689: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
690: 39 d0 cmp %edx,%eax
692: 72 04 jb 698 <free+0x58>
694: 39 d1 cmp %edx,%ecx
696: 72 ce jb 666 <free+0x26>
{
698: 89 d0 mov %edx,%eax
69a: eb bc jmp 658 <free+0x18>
69c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
6a0: 03 72 04 add 0x4(%edx),%esi
6a3: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
6a6: 8b 10 mov (%eax),%edx
6a8: 8b 12 mov (%edx),%edx
6aa: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
6ad: 8b 50 04 mov 0x4(%eax),%edx
6b0: 8d 34 d0 lea (%eax,%edx,8),%esi
6b3: 39 f1 cmp %esi,%ecx
6b5: 75 c6 jne 67d <free+0x3d>
p->s.size += bp->s.size;
6b7: 03 53 fc add -0x4(%ebx),%edx
freep = p;
6ba: a3 a8 0a 00 00 mov %eax,0xaa8
p->s.size += bp->s.size;
6bf: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
6c2: 8b 53 f8 mov -0x8(%ebx),%edx
6c5: 89 10 mov %edx,(%eax)
}
6c7: 5b pop %ebx
6c8: 5e pop %esi
6c9: 5f pop %edi
6ca: 5d pop %ebp
6cb: c3 ret
6cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000006d0 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
6d0: 55 push %ebp
6d1: 89 e5 mov %esp,%ebp
6d3: 57 push %edi
6d4: 56 push %esi
6d5: 53 push %ebx
6d6: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
6d9: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
6dc: 8b 15 a8 0a 00 00 mov 0xaa8,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
6e2: 8d 78 07 lea 0x7(%eax),%edi
6e5: c1 ef 03 shr $0x3,%edi
6e8: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
6eb: 85 d2 test %edx,%edx
6ed: 0f 84 9d 00 00 00 je 790 <malloc+0xc0>
6f3: 8b 02 mov (%edx),%eax
6f5: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
6f8: 39 cf cmp %ecx,%edi
6fa: 76 6c jbe 768 <malloc+0x98>
6fc: 81 ff 00 10 00 00 cmp $0x1000,%edi
702: bb 00 10 00 00 mov $0x1000,%ebx
707: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
70a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
711: eb 0e jmp 721 <malloc+0x51>
713: 90 nop
714: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
718: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
71a: 8b 48 04 mov 0x4(%eax),%ecx
71d: 39 f9 cmp %edi,%ecx
71f: 73 47 jae 768 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
721: 39 05 a8 0a 00 00 cmp %eax,0xaa8
727: 89 c2 mov %eax,%edx
729: 75 ed jne 718 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
72b: 83 ec 0c sub $0xc,%esp
72e: 56 push %esi
72f: e8 4b fc ff ff call 37f <sbrk>
if(p == (char*)-1)
734: 83 c4 10 add $0x10,%esp
737: 83 f8 ff cmp $0xffffffff,%eax
73a: 74 1c je 758 <malloc+0x88>
hp->s.size = nu;
73c: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
73f: 83 ec 0c sub $0xc,%esp
742: 83 c0 08 add $0x8,%eax
745: 50 push %eax
746: e8 f5 fe ff ff call 640 <free>
return freep;
74b: 8b 15 a8 0a 00 00 mov 0xaa8,%edx
if((p = morecore(nunits)) == 0)
751: 83 c4 10 add $0x10,%esp
754: 85 d2 test %edx,%edx
756: 75 c0 jne 718 <malloc+0x48>
return 0;
}
}
758: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
75b: 31 c0 xor %eax,%eax
}
75d: 5b pop %ebx
75e: 5e pop %esi
75f: 5f pop %edi
760: 5d pop %ebp
761: c3 ret
762: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
768: 39 cf cmp %ecx,%edi
76a: 74 54 je 7c0 <malloc+0xf0>
p->s.size -= nunits;
76c: 29 f9 sub %edi,%ecx
76e: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
771: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
774: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
777: 89 15 a8 0a 00 00 mov %edx,0xaa8
}
77d: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
780: 83 c0 08 add $0x8,%eax
}
783: 5b pop %ebx
784: 5e pop %esi
785: 5f pop %edi
786: 5d pop %ebp
787: c3 ret
788: 90 nop
789: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
790: c7 05 a8 0a 00 00 ac movl $0xaac,0xaa8
797: 0a 00 00
79a: c7 05 ac 0a 00 00 ac movl $0xaac,0xaac
7a1: 0a 00 00
base.s.size = 0;
7a4: b8 ac 0a 00 00 mov $0xaac,%eax
7a9: c7 05 b0 0a 00 00 00 movl $0x0,0xab0
7b0: 00 00 00
7b3: e9 44 ff ff ff jmp 6fc <malloc+0x2c>
7b8: 90 nop
7b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
7c0: 8b 08 mov (%eax),%ecx
7c2: 89 0a mov %ecx,(%edx)
7c4: eb b1 jmp 777 <malloc+0xa7>
|
boards/stm32_common/stm32f429disco/framebuffer_ili9341.ads | rocher/Ada_Drivers_Library | 192 | 1447 | <filename>boards/stm32_common/stm32f429disco/framebuffer_ili9341.ads<gh_stars>100-1000
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, 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; use HAL;
with HAL.Framebuffer; use HAL.Framebuffer;
with Ravenscar_Time;
with Framebuffer_LTDC;
private with ILI9341;
private with STM32.GPIO;
private with STM32.Device;
package Framebuffer_ILI9341 is
type Frame_Buffer is limited
new Framebuffer_LTDC.Frame_Buffer with private;
procedure Initialize
(Display : in out Frame_Buffer;
Orientation : HAL.Framebuffer.Display_Orientation := Default;
Mode : HAL.Framebuffer.Wait_Mode := Interrupt);
private
-- Chip select and Data/Command select for the LCD screen
LCD_CSX : STM32.GPIO.GPIO_Point renames STM32.Device.PC2;
LCD_WRX_DCX : STM32.GPIO.GPIO_Point renames STM32.Device.PD13;
LCD_RESET : STM32.GPIO.GPIO_Point renames STM32.Device.PD12;
type Frame_Buffer
is limited new Framebuffer_LTDC.Frame_Buffer with record
Device : ILI9341.ILI9341_Device (STM32.Device.SPI_5'Access,
Chip_Select => LCD_CSX'Access,
WRX => LCD_WRX_DCX'Access,
Reset => LCD_RESET'Access,
Time => Ravenscar_Time.Delays);
end record;
end Framebuffer_ILI9341;
|
oeis/128/A128862.asm | neoneye/loda-programs | 11 | 86725 | ; A128862: Numbers simultaneously triangular and centered triangular.
; Submitted by <NAME>
; 1,10,136,1891,26335,366796,5108806,71156485,991081981,13803991246,192264795460,2677903145191,37298379237211,519499406175760,7235693307223426,100780206894952201,1403687203222107385,19550840638214551186,272308081731781609216
mov $3,1
lpb $0
sub $0,1
add $2,$3
add $2,$3
add $3,$2
lpe
pow $3,2
mov $0,$3
div $0,8
mul $0,9
add $0,1
|
agda/Relation/Binary/Construct/LowerBound.agda | oisdk/combinatorics-paper | 4 | 9626 | <reponame>oisdk/combinatorics-paper<gh_stars>1-10
{-# OPTIONS --cubical --safe #-}
open import Prelude
open import Relation.Binary
module Relation.Binary.Construct.LowerBound {e} {E : Type e} {r} (totalOrder : TotalOrder E r) where
open TotalOrder totalOrder renaming (refl to ≤-refl)
import Data.Unit.UniversePolymorphic as Poly
import Data.Empty.UniversePolymorphic as Poly
data ⌊∙⌋ : Type e where
⌊⊥⌋ : ⌊∙⌋
⌊_⌋ : E → ⌊∙⌋
_≤⌊_⌋ : ⌊∙⌋ → E → Type r
⌊⊥⌋ ≤⌊ y ⌋ = Poly.⊤
⌊ x ⌋ ≤⌊ y ⌋ = x ≤ y
_⌊≤⌋_ : ⌊∙⌋ → ⌊∙⌋ → Type r
x ⌊≤⌋ ⌊ y ⌋ = x ≤⌊ y ⌋
⌊⊥⌋ ⌊≤⌋ ⌊⊥⌋ = Poly.⊤
⌊ x ⌋ ⌊≤⌋ ⌊⊥⌋ = Poly.⊥
lb-ord : TotalOrder ⌊∙⌋ r
PartialOrder._≤_ (TotalOrder.partialOrder lb-ord) = _⌊≤⌋_
PartialOrder.refl (partialOrder lb-ord) {⌊⊥⌋} = Poly.tt
PartialOrder.refl (partialOrder lb-ord) {⌊ x ⌋} = ≤-refl
PartialOrder.antisym (TotalOrder.partialOrder lb-ord) {⌊⊥⌋} {⌊⊥⌋} x≤y y≤x _ = ⌊⊥⌋
PartialOrder.antisym (TotalOrder.partialOrder lb-ord) {⌊ x ⌋} {⌊ x₁ ⌋} x≤y y≤x i = ⌊ antisym x≤y y≤x i ⌋
PartialOrder.trans (TotalOrder.partialOrder lb-ord) {⌊⊥⌋} {⌊⊥⌋} {⌊⊥⌋} x≤y y≤z = Poly.tt
PartialOrder.trans (TotalOrder.partialOrder lb-ord) {⌊⊥⌋} {⌊⊥⌋} {⌊ x ⌋} x≤y y≤z = Poly.tt
PartialOrder.trans (TotalOrder.partialOrder lb-ord) {⌊⊥⌋} {⌊ x ⌋} {⌊ x₁ ⌋} x≤y y≤z = Poly.tt
PartialOrder.trans (TotalOrder.partialOrder lb-ord) {⌊ x ⌋} {⌊ x₁ ⌋} {⌊ x₂ ⌋} x≤y y≤z = trans x≤y y≤z
TotalOrder._≤?_ lb-ord ⌊⊥⌋ ⌊⊥⌋ = inl Poly.tt
TotalOrder._≤?_ lb-ord ⌊ x ⌋ ⌊⊥⌋ = inr Poly.tt
TotalOrder._≤?_ lb-ord ⌊⊥⌋ ⌊ x₁ ⌋ = inl Poly.tt
TotalOrder._≤?_ lb-ord ⌊ x ⌋ ⌊ y ⌋ = x ≤? y
|
projects/batfish/src/main/antlr4/org/batfish/grammar/palo_alto_nested/PaloAltoNestedLexer.g4 | adrianliaw/batfish | 0 | 3435 | lexer grammar PaloAltoNestedLexer;
options {
superClass = 'org.batfish.grammar.BatfishLexer';
}
@members {
boolean enableIPV6_ADDRESS = true;
boolean enableIP_ADDRESS = true;
boolean enableDEC = true;
@Override
public String printStateVariables() {
StringBuilder sb = new StringBuilder();
sb.append("enableIPV6_ADDRESS: " + enableIPV6_ADDRESS + "\n");
sb.append("enableIP_ADDRESS: " + enableIP_ADDRESS + "\n");
sb.append("enableDEC: " + enableDEC + "\n");
return sb.toString();
}
}
CLOSE_BRACE
:
'}'
;
CLOSE_BRACKET
:
']'
;
CLOSE_PAREN
:
')'
;
// Handle Palo Alto-style and RANCID-header-style line comments
LINE_COMMENT
:
(
'#'
| '!'
)
F_NonNewlineChar* F_NewlineChar+ -> channel(HIDDEN)
;
MULTILINE_COMMENT
:
'/*' .*? '*/' -> channel(HIDDEN)
;
OPEN_BRACE
:
'{'
;
OPEN_BRACKET
:
'['
;
OPEN_PAREN
:
'('
;
SEMICOLON
:
';'
;
WORD
:
F_QuotedString
| F_Word
;
WS
:
F_WhitespaceChar+ -> channel(HIDDEN)
;
fragment
F_NewlineChar
:
[\r\n]
;
fragment
F_NonNewlineChar
:
~[\r\n]
;
fragment
F_QuotedString
:
'"' ~'"'* '"'
;
fragment
F_WhitespaceChar
:
[ \t\u000C\r\n]
;
fragment
F_Word
:
F_WordStart (F_WordInteriorChar* F_WordFinalChar)?
;
F_WordFinalChar
:
// Not whitespace, not ; or } or ] as those are nested syntax.
~[ \t\u000C\r\n;}\]]
;
F_WordInteriorChar
:
~[ \t\u000C\r\n]
;
fragment
F_WordStart
:
~[ \t\u000C\r\n[\](){};]
;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.