max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
src/cm_gameplay.asm
spannerisms/lttphack
6
175957
<gh_stars>1-10 GAMEPLAY_SUBMENU: %menu_header("GAMEPLAY", 9) ;=================================================================================================== %toggle_onoff("Skip Triforce", !config_skip_triforce_toggle) %toggle("Disable beams", !disable_beams) ;=================================================================================================== %toggle_func_onoff_here("Lit rooms", !config_lit_rooms_toggle) LDA.w $001B : BEQ ++ LDA.b #$20 : STA.w $009A LDA.b #$40 : STA.w $009B LDA.b #$80 : STA.w $009C ++ RTL ;=================================================================================================== %toggle_onoff("Fast walls", !config_fast_moving_walls) %toggle_onoff("Visible probes", !config_probe_toggle) %toggle_onoff("Show STC pits", !config_somaria_pits) %toggle_bit("Disable BG1", SA1RAM.disabled_layers, 0) %toggle_bit("Disable BG2", SA1RAM.disabled_layers, 1) %toggle_onoff("OoB mode", $037F)
3-mid/opengl/source/lean/support/opengl-dolly.adb
charlie5/lace
20
20325
with ada.Text_IO; package body openGL.Dolly is procedure Speed_is (Self : in out Item; Now : in Real) is begin Self.Speed := Now; end Speed_is; procedure evolve (Self : in out Item) is use linear_Algebra_3d, ada.Text_IO; Command : Character; Avail : Boolean; begin get_Immediate (Command, Avail); if Avail then case Command is when 'q' => Self.quit_Requested := True; -- Linear Motion. -- when 'a' => Self.Camera.Site_is (Self.Camera.Site - right_Direction (Self.Camera.Spin) * Self.Speed); when 's' => Self.Camera.Site_is (Self.Camera.Site + right_Direction (Self.Camera.Spin) * Self.Speed); when 'w' => Self.Camera.Site_is (Self.Camera.Site - forward_Direction (Self.Camera.Spin) * Self.Speed); when 'z' => Self.Camera.Site_is (Self.Camera.Site + forward_Direction (Self.Camera.Spin) * Self.Speed); when 'e' => Self.Camera.Site_is (Self.Camera.Site + up_Direction (Self.Camera.Spin) * Self.Speed); when 'd' => Self.Camera.Site_is (Self.Camera.Site - up_Direction (Self.Camera.Spin) * Self.Speed); -- Orbital motion. -- when 'A' => Self.Camera.Site_is (Self.Camera.Site * y_Rotation_from (to_Radians (-5.0))); Self.Camera.Spin_is (Self.Camera.Spin * y_Rotation_from (to_Radians (-5.0))); when 'S' => Self.Camera.Site_is (Self.Camera.Site * y_Rotation_from (to_Radians ( 5.0))); Self.Camera.Spin_is (Self.Camera.Spin * y_Rotation_from (to_Radians ( 5.0))); when 'E' => Self.Camera.Site_is (Self.Camera.Site * x_Rotation_from (to_Radians (-5.0))); Self.Camera.Spin_is (Self.Camera.Spin * x_Rotation_from (to_Radians (-5.0))); when 'D' => Self.Camera.Site_is (Self.Camera.Site * x_Rotation_from (to_Radians ( 5.0))); Self.Camera.Spin_is (Self.Camera.Spin * x_Rotation_from (to_Radians ( 5.0))); when 'W' => Self.Camera.Site_is (Self.Camera.Site * z_Rotation_from (to_Radians (-5.0))); Self.Camera.Spin_is (Self.Camera.Spin * z_Rotation_from (to_Radians (-5.0))); when 'Z' => Self.Camera.Site_is (Self.Camera.Site * z_Rotation_from (to_Radians ( 5.0))); Self.Camera.Spin_is (Self.Camera.Spin * z_Rotation_from (to_Radians ( 5.0))); when others => null; end case; Self.last_Character := Command; end if; end evolve; function quit_Requested (Self : in Item) return Boolean is begin return Self.quit_Requested; end quit_Requested; procedure get_last_Character (Self : in out Item; the_Character : out Character; Available : out Boolean) is use ada.Characters; begin if Self.last_Character = latin_1.NUL then Available := False; else Available := True; the_Character := Self.last_Character; Self.last_Character := latin_1.NUL; end if; end get_last_Character; end openGL.Dolly;
src/ado-statements.adb
My-Colaborations/ada-ado
0
16845
<reponame>My-Colaborations/ada-ado ----------------------------------------------------------------------- -- ADO Statements -- Database statements -- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2018, 2019 <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 Ada.Calendar.Formatting; with Util.Log; with Util.Log.Loggers; with System.Storage_Elements; with Ada.Unchecked_Deallocation; package body ADO.Statements is use System.Storage_Elements; Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("ADO.Statements"); function Get_Query (Query : Statement) return ADO.SQL.Query_Access is begin return Query.Query; end Get_Query; procedure Add_Parameter (Query : in out Statement; Param : in ADO.Parameters.Parameter) is begin Query.Query.Add_Parameter (Param); end Add_Parameter; procedure Set_Parameters (Query : in out Statement; From : in ADO.Parameters.Abstract_List'Class) is begin Query.Query.Set_Parameters (From); end Set_Parameters; -- ------------------------------ -- Return the number of parameters in the list. -- ------------------------------ function Length (Query : in Statement) return Natural is begin return Query.Query.Length; end Length; -- ------------------------------ -- Return the parameter at the given position -- ------------------------------ function Element (Query : in Statement; Position : in Natural) return ADO.Parameters.Parameter is begin return Query.Query.Element (Position); end Element; -- ------------------------------ -- Execute the <b>Process</b> procedure with the given parameter as argument. -- ------------------------------ procedure Query_Element (Query : in Statement; Position : in Natural; Process : not null access procedure (Element : in ADO.Parameters.Parameter)) is begin Query.Query.Query_Element (Position, Process); end Query_Element; -- ------------------------------ -- Clear the list of parameters. -- ------------------------------ procedure Clear (Query : in out Statement) is begin Query.Query.Clear; end Clear; procedure Add_Param (Params : in out Statement; Value : in ADO.Objects.Object_Key) is begin case Value.Of_Type is when ADO.Objects.KEY_INTEGER => declare V : constant Identifier := Objects.Get_Value (Value); begin Params.Query.Add_Param (V); end; when ADO.Objects.KEY_STRING => declare V : constant Unbounded_String := Objects.Get_Value (Value); begin Params.Query.Add_Param (V); end; end case; end Add_Param; -- ------------------------------ -- Add the parameter by using the primary key of the object. -- Use null if the object is a null reference. -- ------------------------------ procedure Add_Param (Params : in out Statement; Value : in ADO.Objects.Object_Ref'Class) is begin if Value.Is_Null then Params.Query.Add_Null_Param; else Params.Add_Param (Value.Get_Key); end if; end Add_Param; procedure Append (Query : in out Statement; SQL : in String) is begin ADO.SQL.Append (Target => Query.Query.SQL, SQL => SQL); end Append; procedure Append (Query : in out Statement; Value : in Integer) is begin ADO.SQL.Append_Value (Target => Query.Query.SQL, Value => Long_Integer (Value)); end Append; procedure Append (Query : in out Statement; Value : in Long_Integer) is begin ADO.SQL.Append_Value (Target => Query.Query.SQL, Value => Value); end Append; procedure Append (Query : in out Statement; SQL : in Unbounded_String) is begin ADO.SQL.Append_Value (Target => Query.Query.SQL, Value => To_String (SQL)); end Append; procedure Set_Filter (Query : in out Statement; Filter : in String) is begin Query.Query.Set_Filter (Filter); end Set_Filter; -- ------------------------------ -- Get the filter condition or the empty string -- ------------------------------ -- function Get_Filter (Parameters : in Statement) return String is -- begin -- return Parameters.Query.Get_Filter; -- end Get_Filter; procedure Execute (Query : in out Statement; SQL : in Unbounded_String; Params : in ADO.Parameters.Abstract_List'Class) is begin null; end Execute; -- ------------------------------ -- Append the value to the SQL query string. -- ------------------------------ procedure Append_Escape (Query : in out Statement; Value : in String) is begin ADO.SQL.Append_Value (Query.Query.SQL, Value); end Append_Escape; -- ------------------------------ -- Append the value to the SQL query string. -- ------------------------------ procedure Append_Escape (Query : in out Statement; Value : in Unbounded_String) is begin ADO.SQL.Append_Value (Query.Query.SQL, To_String (Value)); end Append_Escape; function "+" (Left : chars_ptr; Right : Size_T) return chars_ptr is begin return To_Chars_Ptr (To_Address (Left) + Storage_Offset (Right)); end "+"; -- ------------------------------ -- Get the query result as an integer -- ------------------------------ function Get_Result_Integer (Query : Query_Statement) return Integer is begin if not Query_Statement'Class (Query).Has_Elements then return 0; end if; if Query_Statement'Class (Query).Is_Null (0) then return 0; end if; return Query_Statement'Class (Query).Get_Integer (0); end Get_Result_Integer; -- ------------------------------ -- Get the query result as a blob -- ------------------------------ function Get_Result_Blob (Query : in Query_Statement) return ADO.Blob_Ref is begin if not Query_Statement'Class (Query).Has_Elements then return Null_Blob; end if; return Query_Statement'Class (Query).Get_Blob (0); end Get_Result_Blob; -- ------------------------------ -- Get an unsigned 64-bit number from a C string terminated by \0 -- ------------------------------ function Get_Uint64 (Str : chars_ptr) return unsigned_long is C : Character; P : chars_ptr := Str; Result : unsigned_long := 0; begin loop C := P.all; if C /= ' ' then exit; end if; P := P + 1; end loop; while C >= '0' and C <= '9' loop Result := Result * 10 + unsigned_long (Character'Pos (C) - Character'Pos ('0')); P := P + 1; C := P.all; end loop; if C /= ASCII.NUL then raise Invalid_Type with "Invalid integer value"; end if; return Result; end Get_Uint64; -- ------------------------------ -- Get a signed 64-bit number from a C string terminated by \0 -- ------------------------------ function Get_Int64 (Str : chars_ptr) return Int64 is C : Character; P : chars_ptr := Str; begin if P = null then return 0; end if; loop C := P.all; if C /= ' ' then exit; end if; P := P + 1; end loop; if C = '+' then P := P + 1; return Int64 (Get_Uint64 (P)); elsif C = '-' then P := P + 1; return -Int64 (Get_Uint64 (P)); else return Int64 (Get_Uint64 (P)); end if; end Get_Int64; -- ------------------------------ -- Get a double number from a C string terminated by \0 -- ------------------------------ function Get_Double (Str : chars_ptr) return Long_Float is C : Character; P : chars_ptr := Str; begin if P = null then return 0.0; end if; loop C := P.all; if C /= ' ' then exit; end if; P := P + 1; end loop; declare S : String (1 .. 100); begin for I in S'Range loop C := P.all; S (I) := C; if C = ASCII.NUL then return Long_Float'Value (S (S'First .. I - 1)); end if; P := P + 1; end loop; raise Invalid_Type with "Invalid floating point value"; end; end Get_Double; -- ------------------------------ -- Get a time from the C string passed in <b>Value</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Time (Value : in chars_ptr) return Ada.Calendar.Time is use Ada.Calendar; Year : Year_Number := Year_Number'First; Month : Month_Number := Month_Number'First; Day : Day_Number := Day_Number'First; Hours : Natural := 0; Mins : Natural := 0; Secs : Natural := 0; Dt : Duration := 0.0; Field : chars_ptr := Value; function Get_Number (P : in chars_ptr; Nb_Digits : in Positive) return Natural; -- ------------------------------ -- Get a number composed of N digits -- ------------------------------ function Get_Number (P : in chars_ptr; Nb_Digits : in Positive) return Natural is Ptr : chars_ptr := P; Result : Natural := 0; C : Character; begin for I in 1 .. Nb_Digits loop C := Ptr.all; if not (C >= '0' and C <= '9') then raise Invalid_Type with "Invalid date format"; end if; Result := Result * 10 + Character'Pos (C) - Character'Pos ('0'); Ptr := Ptr + 1; end loop; return Result; end Get_Number; begin if Field /= null then declare C : Character; N : Natural; begin N := Get_Number (Field, 4); if N /= 0 then Year := Year_Number (N); end if; Field := Field + 4; C := Field.all; if C /= '-' then raise Invalid_Type with "Invalid date format"; end if; Field := Field + 1; N := Get_Number (Field, 2); if N /= 0 then Month := Month_Number (N); end if; Field := Field + 2; C := Field.all; if C /= '-' then raise Invalid_Type with "Invalid date format"; end if; Field := Field + 1; N := Get_Number (Field, 2); if N /= 0 then Day := Day_Number (N); end if; Field := Field + 2; C := Field.all; if C /= ASCII.NUL then if C /= ' ' then raise Invalid_Type with "Invalid date format"; end if; Field := Field + 1; Hours := Get_Number (Field, 2); Field := Field + 2; C := Field.all; if C /= ':' then raise Invalid_Type with "Invalid date format"; end if; Field := Field + 1; Mins := Get_Number (Field, 2); Field := Field + 2; C := Field.all; if C /= ':' then raise Invalid_Type with "Invalid date format"; end if; Field := Field + 1; Secs := Get_Number (Field, 2); Field := Field + 2; C := Field.all; if C /= '.' and C /= ASCII.NUL then raise Invalid_Type with "Invalid date format"; end if; Dt := Duration (Hours * 3600) + Duration (Mins * 60) + Duration (Secs); end if; end; end if; return Ada.Calendar.Formatting.Time_Of (Year, Month, Day, Dt, False, 0); end Get_Time; -- ------------------------------ -- Create a blob initialized with the given data buffer pointed to by <b>Data</b> -- and which contains <b>Size</b> bytes. -- ------------------------------ function Get_Blob (Data : in chars_ptr; Size : in Natural) return Blob_Ref is use Util.Refs; use Ada.Streams; B : constant Blob_Access := new Blob '(Ref_Entity with Len => Stream_Element_Offset (Size), others => <>); P : chars_ptr := Data; begin for I in 1 .. Stream_Element_Offset (Size) loop B.Data (I) := Character'Pos (P.all); P := P + 1; end loop; return Blob_References.Create (B); end Get_Blob; -- ------------------------------ -- Execute the query -- ------------------------------ overriding procedure Execute (Query : in out Query_Statement) is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; Query.Proxy.Execute; end Execute; -- ------------------------------ -- Get the number of rows returned by the query -- ------------------------------ function Get_Row_Count (Query : in Query_Statement) return Natural is begin if Query.Proxy = null then return 0; else return Query.Proxy.Get_Row_Count; end if; end Get_Row_Count; -- ------------------------------ -- Returns True if there is more data (row) to fetch -- ------------------------------ function Has_Elements (Query : in Query_Statement) return Boolean is begin if Query.Proxy = null then return False; else return Query.Proxy.Has_Elements; end if; end Has_Elements; -- ------------------------------ -- Fetch the next row -- ------------------------------ procedure Next (Query : in out Query_Statement) is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; Query.Proxy.Next; end Next; -- ------------------------------ -- Returns true if the column <b>Column</b> is null. -- ------------------------------ function Is_Null (Query : in Query_Statement; Column : in Natural) return Boolean is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; return Query.Proxy.Is_Null (Column); end Is_Null; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Int64</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Int64 (Query : Query_Statement; Column : Natural) return Int64 is begin if Query.Proxy = null then raise Invalid_Statement with "Int64 is not supported by database driver"; end if; return Query.Proxy.Get_Int64 (Column); end Get_Int64; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Integer</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Integer (Query : Query_Statement; Column : Natural) return Integer is begin if Query.Proxy = null then return Integer (Query_Statement'Class (Query).Get_Int64 (Column)); else return Query.Proxy.Get_Integer (Column); end if; end Get_Integer; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Integer</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Natural (Query : in Query_Statement; Column : in Natural) return Natural is begin return Natural (Query.Get_Integer (Column)); end Get_Natural; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Nullable_Integer</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Nullable_Integer (Query : Query_Statement; Column : Natural) return Nullable_Integer is begin if Query.Proxy = null then return Result : Nullable_Integer do Result.Is_Null := Query_Statement'Class (Query).Is_Null (Column); if not Result.Is_Null then Result.Value := Integer (Query_Statement'Class (Query).Get_Int64 (Column)); end if; end return; else return Query.Proxy.Get_Nullable_Integer (Column); end if; end Get_Nullable_Integer; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Float</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Float (Query : Query_Statement; Column : Natural) return Float is begin if Query.Proxy = null then return Float (Query_Statement'Class (Query).Get_Double (Column)); else return Query.Proxy.Get_Float (Column); end if; end Get_Float; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Long_Float</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Double (Query : Query_Statement; Column : Natural) return Long_Float is begin if Query.Proxy = null then raise Invalid_Statement with "Double is not supported by database driver"; else return Query.Proxy.Get_Double (Column); end if; end Get_Double; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Boolean</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Boolean (Query : Query_Statement; Column : Natural) return Boolean is begin if Query.Proxy = null then return Query_Statement'Class (Query).Get_Integer (Column) /= 0; else return Query.Proxy.Get_Boolean (Column); end if; end Get_Boolean; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as a <b>Nullable_Boolean</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Nullable_Boolean (Query : Query_Statement; Column : Natural) return Nullable_Boolean is begin if Query.Proxy = null then if Query_Statement'Class (Query).Is_Null (Column) then return ADO.Null_Boolean; else return (Is_Null => False, Value => Query_Statement'Class (Query).Get_Boolean (Column)); end if; else if Query.Is_Null (Column) then return ADO.Null_Boolean; end if; return (Is_Null => False, Value => Query.Proxy.Get_Boolean (Column)); end if; end Get_Nullable_Boolean; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Identifier</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Identifier (Query : Query_Statement; Column : Natural) return Identifier is begin if Query.Proxy = null then if Query_Statement'Class (Query).Is_Null (Column) then return ADO.NO_IDENTIFIER; else return Identifier (Query_Statement'Class (Query).Get_Int64 (Column)); end if; else if Query.Is_Null (Column) then return ADO.NO_IDENTIFIER; end if; return Query.Proxy.Get_Identifier (Column); end if; end Get_Identifier; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Unbounded_String</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Unbounded_String (Query : Query_Statement; Column : Natural) return Unbounded_String is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; return Query.Proxy.Get_Unbounded_String (Column); end Get_Unbounded_String; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Nullable_String</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Nullable_String (Query : Query_Statement; Column : Natural) return Nullable_String is begin if Query.Proxy = null then return Result : Nullable_String do Result.Is_Null := Query_Statement'Class (Query).Is_Null (Column); if not Result.Is_Null then Result.Value := Query_Statement'Class (Query).Get_Unbounded_String (Column); end if; end return; else return Query.Proxy.Get_Nullable_String (Column); end if; end Get_Nullable_String; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Unbounded_String</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_String (Query : Query_Statement; Column : Natural) return String is begin if Query.Proxy = null then return To_String (Query_Statement'Class (Query).Get_Unbounded_String (Column)); else return Query.Proxy.Get_String (Column); end if; end Get_String; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as a <b>Blob</b> reference. -- ------------------------------ function Get_Blob (Query : in Query_Statement; Column : in Natural) return ADO.Blob_Ref is begin if Query.Proxy = null then return Empty : ADO.Blob_Ref; else return Query.Proxy.Get_Blob (Column); end if; end Get_Blob; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Time</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Time (Query : Query_Statement; Column : Natural) return Ada.Calendar.Time is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; return Query.Proxy.all.Get_Time (Column); end Get_Time; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as a <b>Nullable_Time</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Nullable_Time (Query : in Query_Statement; Column : in Natural) return Nullable_Time is begin if Query.Proxy = null then return Result : Nullable_Time do Result.Is_Null := Query_Statement'Class (Query).Is_Null (Column); if not Result.Is_Null then Result.Value := Query_Statement'Class (Query).Get_Time (Column); end if; end return; end if; return Query.Proxy.all.Get_Nullable_Time (Column); end Get_Nullable_Time; -- ------------------------------ -- Get the column value at position <b>Column</b> and -- return it as an <b>Nullable_Entity_Type</b>. -- Raises <b>Invalid_Type</b> if the value cannot be converted. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Nullable_Entity_Type (Query : Query_Statement; Column : Natural) return Nullable_Entity_Type is begin if Query.Proxy = null then return Result : Nullable_Entity_Type do Result.Is_Null := Query_Statement'Class (Query).Is_Null (Column); if not Result.Is_Null then Result.Value := Entity_Type (Query_Statement'Class (Query).Get_Integer (Column)); end if; end return; end if; return Query.Proxy.all.Get_Nullable_Entity_Type (Column); end Get_Nullable_Entity_Type; -- ------------------------------ -- Get the column type -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Column_Type (Query : Query_Statement; Column : Natural) return ADO.Schemas.Column_Type is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; return Query.Proxy.Get_Column_Type (Column); end Get_Column_Type; -- ------------------------------ -- Get the column name. -- Raises <b>Invalid_Column</b> if the column does not exist. -- ------------------------------ function Get_Column_Name (Query : in Query_Statement; Column : in Natural) return String is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; return Query.Proxy.Get_Column_Name (Column); end Get_Column_Name; -- ------------------------------ -- Get the number of columns in the result. -- ------------------------------ function Get_Column_Count (Query : in Query_Statement) return Natural is begin if Query.Proxy = null then raise Invalid_Statement with "Query statement is not initialized"; end if; return Query.Proxy.Get_Column_Count; end Get_Column_Count; overriding procedure Adjust (Stmt : in out Query_Statement) is begin if Stmt.Proxy /= null then Stmt.Proxy.Ref_Counter := Stmt.Proxy.Ref_Counter + 1; end if; end Adjust; overriding procedure Finalize (Stmt : in out Query_Statement) is procedure Free is new Ada.Unchecked_Deallocation (Object => Query_Statement'Class, Name => Query_Statement_Access); begin if Stmt.Proxy /= null then Stmt.Proxy.Ref_Counter := Stmt.Proxy.Ref_Counter - 1; if Stmt.Proxy.Ref_Counter = 0 then Free (Stmt.Proxy); end if; end if; end Finalize; -- Execute the delete query. overriding procedure Execute (Query : in out Delete_Statement) is Result : Natural; begin Log.Info ("Delete statement"); if Query.Proxy = null then raise Invalid_Statement with "Delete statement not initialized"; end if; Query.Proxy.Execute (Result); end Execute; -- ------------------------------ -- Execute the query -- Returns the number of rows deleted. -- ------------------------------ procedure Execute (Query : in out Delete_Statement; Result : out Natural) is begin Log.Info ("Delete statement"); if Query.Proxy = null then raise Invalid_Statement with "Delete statement not initialized"; end if; Query.Proxy.Execute (Result); end Execute; -- ------------------------------ -- Get the update query object associated with this update statement. -- ------------------------------ function Get_Update_Query (Update : in Update_Statement) return ADO.SQL.Update_Query_Access is begin return Update.Update; end Get_Update_Query; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Boolean) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Nullable_Boolean) is begin if Value.Is_Null then Update.Save_Null_Field (Name); else Update.Update.Save_Field (Name => Name, Value => Value.Value); end if; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Integer) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Nullable_Integer) is begin if Value.Is_Null then Update.Save_Null_Field (Name); else Update.Update.Save_Field (Name => Name, Value => Value.Value); end if; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Long_Long_Integer) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Float) is begin Update.Update.Save_Field (Name => Name, Value => Long_Float (Value)); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Long_Float) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Identifier) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Entity_Type) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Nullable_Entity_Type) is begin if Value.Is_Null then Update.Save_Null_Field (Name); else Update.Update.Save_Field (Name => Name, Value => Value.Value); end if; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Ada.Calendar.Time) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Nullable_Time) is begin if Value.Is_Null then Update.Save_Null_Field (Name); else Update.Save_Field (Name, Value.Value); end if; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in String) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Unbounded_String) is begin Update.Update.Save_Field (Name => Name, Value => Value); end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in Nullable_String) is begin if Value.Is_Null then Update.Save_Null_Field (Name); else Update.Save_Field (Name, Value.Value); end if; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in ADO.Objects.Object_Key) is begin case Value.Of_Type is when ADO.Objects.KEY_INTEGER => declare V : constant Identifier := Objects.Get_Value (Value); begin Update.Update.Save_Field (Name => Name, Value => V); end; when ADO.Objects.KEY_STRING => declare V : constant Unbounded_String := Objects.Get_Value (Value); begin Update.Update.Save_Field (Name => Name, Value => V); end; end case; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field. -- identified by <b>Name</b> and set it to the identifier key held by <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in ADO.Objects.Object_Ref'Class) is begin if Value.Is_Null then Update.Save_Null_Field (Name); else Update.Save_Field (Name, Value.Get_Key); end if; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to the <b>Value</b>. -- ------------------------------ procedure Save_Field (Update : in out Update_Statement; Name : in String; Value : in ADO.Blob_Ref) is begin if Value.Is_Null then Update.Save_Null_Field (Name); else Update.Update.Save_Field (Name, Value); end if; end Save_Field; -- ------------------------------ -- Prepare the update/insert query to save the table field -- identified by <b>Name</b> and set it to NULL. -- ------------------------------ procedure Save_Null_Field (Update : in out Update_Statement; Name : in String) is begin Update.Update.Save_Null_Field (Name); end Save_Null_Field; -- ------------------------------ -- Check if the update/insert query has some fields to update. -- ------------------------------ function Has_Save_Fields (Update : in Update_Statement) return Boolean is begin return Update.Update.Has_Save_Fields; end Has_Save_Fields; -- ------------------------------ -- Execute the query -- ------------------------------ overriding procedure Execute (Query : in out Update_Statement) is begin if Query.Proxy = null then raise Invalid_Statement with "Update statement not initialized"; end if; Query.Proxy.Execute; end Execute; -- ------------------------------ -- Execute the query -- ------------------------------ overriding procedure Execute (Query : in out Insert_Statement) is begin if Query.Proxy = null then raise Invalid_Statement with "Insert statement not initialized"; end if; Query.Proxy.Execute; end Execute; -- ------------------------------ -- Execute the query -- ------------------------------ procedure Execute (Query : in out Update_Statement; Result : out Integer) is begin if Query.Proxy = null then raise Invalid_Statement with "Update statement not initialized"; end if; Query.Proxy.Execute (Result); end Execute; overriding procedure Adjust (Stmt : in out Delete_Statement) is begin if Stmt.Proxy /= null then Stmt.Proxy.Ref_Counter := Stmt.Proxy.Ref_Counter + 1; end if; end Adjust; overriding procedure Finalize (Stmt : in out Delete_Statement) is procedure Free is new Ada.Unchecked_Deallocation (Object => Delete_Statement'Class, Name => Delete_Statement_Access); begin if Stmt.Proxy /= null then Stmt.Proxy.Ref_Counter := Stmt.Proxy.Ref_Counter - 1; if Stmt.Proxy.Ref_Counter = 0 then Free (Stmt.Proxy); end if; end if; end Finalize; overriding procedure Adjust (Stmt : in out Update_Statement) is begin if Stmt.Proxy /= null then Stmt.Proxy.Ref_Counter := Stmt.Proxy.Ref_Counter + 1; end if; end Adjust; overriding procedure Finalize (Stmt : in out Update_Statement) is procedure Free is new Ada.Unchecked_Deallocation (Object => Update_Statement'Class, Name => Update_Statement_Access); begin if Stmt.Proxy /= null then Stmt.Proxy.Ref_Counter := Stmt.Proxy.Ref_Counter - 1; if Stmt.Proxy.Ref_Counter = 0 then Free (Stmt.Proxy); end if; end if; end Finalize; end ADO.Statements;
labs/lab1/lab01A/lab1A/main.asm
stanley-jc/COMP2121
2
88377
; ; lab1A.asm ; ; Created: 08/08/2017 14:09:56 ; .include "m2560def.inc" .cseg rjmp start start: ;load two numbers ldi r16, LOW(7654) ldi r17, HIGH(7654) ldi r18, LOW(5432) ldi r19, HIGH(5432) while: ;compare two numbers ;if equal cp r16, r18 cpc r17, r19 brne if rjmp end if: cp r16, r18 cpc r17, r19 brsh elsepart ;if a>b ;do b-a sub r18, r16 sbc r19, r17 rjmp while elsepart: ;do a-b sub r16, r18 sbc r17, r19 rjmp while end: rjmp end
alloy4fun_models/trashltl/models/7/ys5HNL3zjncqutkRh.als
Kaixi26/org.alloytools.alloy
0
3941
<reponame>Kaixi26/org.alloytools.alloy<filename>alloy4fun_models/trashltl/models/7/ys5HNL3zjncqutkRh.als open main pred idys5HNL3zjncqutkRh_prop8 { eventually link.File in Trash } pred __repair { idys5HNL3zjncqutkRh_prop8 } check __repair { idys5HNL3zjncqutkRh_prop8 <=> prop8o }
programs/oeis/294/A294924.asm
neoneye/loda
22
9262
; A294924: Numbers n such that the whole sequence of the first n terms of A293699 is a palindrome. ; 1,3,5,7,26,63,100,137,174,211,248,285,322,359,396,433,470,507,544,581,618,655,692,729,766,803,840,877,914,951,988,1025,1062,1099,1136,1173,1210,1247,1284,1321,1358,1395,1432,1469,1506,1543,1580,1617,1654,1691,1728,1765,1802,1839,1876,1913,1950,1987,2024,2061,2098,2135 mov $2,$0 add $2,2 mov $3,$0 trn $0,4 mov $1,$0 add $0,4 trn $2,5 add $2,$1 add $0,$2 add $0,1 mov $1,4 add $2,5 lpb $1 sub $1,1 mul $2,2 lpe add $2,5 add $1,$2 add $0,$1 lpb $3 add $0,2 sub $3,1 lpe sub $0,89
old/Operator/Equals.agda
Lolirofle/stuff-in-agda
6
14119
<gh_stars>1-10 module Operator.Equals {ℓ} where import Lvl open import Data.Boolean open import Functional open import Relator.Equals{ℓ} open import Type{ℓ} -- Type class for run-time checking of equality record Equals(T : Type) : Type where infixl 100 _==_ field _==_ : T → T → Bool field ⦃ completeness ⦄ : ∀{a b : T} → (a ≡ b) → (a == b ≡ 𝑇) open Equals ⦃ ... ⦄ using (_==_) public
test/AllTests.agda
flupe/agda2hs
0
5674
module AllTests where import Issue14 import LanguageConstructs import Numbers import Pragmas import Sections import Test import Tuples import Where {-# FOREIGN AGDA2HS import Issue14 import LanguageConstructs import Numbers import Pragmas import Sections import Test import Tuples import Where #-}
oeis/010/A010502.asm
neoneye/loda-programs
11
27330
<gh_stars>10-100 ; A010502: Decimal expansion of square root of 48. ; Submitted by <NAME>(s4) ; 6,9,2,8,2,0,3,2,3,0,2,7,5,5,0,9,1,7,4,1,0,9,7,8,5,3,6,6,0,2,3,4,8,9,4,6,7,7,7,1,2,2,1,0,1,5,2,4,1,5,2,2,5,1,2,2,2,3,2,2,7,9,1,7,8,0,7,7,3,2,0,6,7,6,3,5,2,0,0,1,4,8,3,2,4,5,8,4,7,4,7,0,2,8,9,9,4,3,0,2 add $0,2 seq $0,11549 ; Decimal expansion of sqrt(3) truncated to n places. div $0,25 mod $0,10
programs/oeis/140/A140063.asm
karttu/loda
1
104684
<filename>programs/oeis/140/A140063.asm ; A140063: Binomial transform of [1, 3, 7, 0, 0, 0, ...]. ; 1,4,14,31,55,86,124,169,221,280,346,419,499,586,680,781,889,1004,1126,1255,1391,1534,1684,1841,2005,2176,2354,2539,2731,2930,3136,3349,3569,3796,4030,4271,4519,4774,5036 mul $0,7 bin $0,2 mov $1,$0 div $1,7 add $1,1
agda/BTree/Heap.agda
bgbianchi/sorting
6
42
<gh_stars>1-10 module BTree.Heap {A : Set}(_≤_ : A → A → Set) where open import BTree {A} data Heap : BTree → Set where leaf : Heap leaf single : (x : A) → Heap (node x leaf leaf) left : {l r : BTree}{x y : A} → x ≤ y → Heap (node y l r) → Heap (node x (node y l r) leaf) right : {l r : BTree}{x y : A} → x ≤ y → Heap (node y l r) → Heap (node x leaf (node y l r)) both : {l r l' r' : BTree}{x y y' : A} → x ≤ y → x ≤ y' → Heap (node y l r) → Heap (node y' l' r') → Heap (node x (node y l r) (node y' l' r'))
PJ Grammar/variables.g4
Diolor/PJ
0
1757
<gh_stars>0 parser grammar variables; variableDeclarators : variableDeclarator (',' variableDeclarator)* ; variableDeclarator : variableDeclaratorId (assignRule variableInitializer)? ; variableDeclaratorId : identifierRule (lbraceRule rbraceRule)* ; variableInitializer : arrayInitializer | expression ; arrayInitializer : '{' (variableInitializer (',' variableInitializer)* (',')? )? '}' ; variableModifier : finalRule | annotation ;
src/CF/Transform/Compile/Statements.agda
ajrouvoet/jvm.agda
6
736
{-# OPTIONS --safe --no-qualified-instances #-} module CF.Transform.Compile.Statements where open import Function using (_∘_) open import Data.Unit using (⊤; tt) open import Data.Product open import Data.List hiding (null; [_]) open import Relation.Binary.PropositionalEquality hiding ([_]) open import Relation.Unary open import Relation.Unary.PredicateTransformer using (Pt) open import Relation.Ternary.Core open import Relation.Ternary.Structures open import Relation.Ternary.Structures.Syntax open import Relation.Ternary.Monad open import CF.Syntax.DeBruijn open import CF.Transform.Compile.Expressions open import CF.Types open import CF.Transform.Compile.ToJVM open import JVM.Types open import JVM.Compiler open import JVM.Contexts open import JVM.Model StackTy open import JVM.Syntax.Values open import JVM.Syntax.Instructions mutual {- Compiling statements -} compileₛ : ∀ {ψ : StackTy} {Γ r} → Stmt r Γ → ε[ Compiler ⟦ Γ ⟧ ψ ψ Emp ] compileₛ (asgn x e) = do compileₑ e code (store ⟦ x ⟧) compileₛ (run e) = do compileₑ e code pop compileₛ (block x) = do compiler _ x compileₛ (while e body) = do -- condition lcond⁺ ∙⟨ σ ⟩ lcond⁻ ← freshLabel refl ∙⟨ σ ⟩ lcond⁻ ← attachTo lcond⁺ ⟨ ∙-idʳ ⟩ compileₑ e ⟨ Down _ # σ ⟩& lcond⁻ (↓ lend⁻) ∙⟨ σ ⟩ labels ← (✴-rotateₗ ∘ ✴-assocᵣ) ⟨$⟩ (freshLabel ⟨ Down _ # σ ⟩& lcond⁻) (↓ lcond⁻) ∙⟨ σ ⟩ lend⁺ ← ✴-id⁻ˡ ⟨$⟩ (code (if eq lend⁻) ⟨ _ ✴ _ # σ ⟩& labels) -- body compileₛ body lend⁺ ← ✴-id⁻ˡ ⟨$⟩ (code (goto lcond⁻) ⟨ Up _ # σ ⟩& lend⁺) attach lend⁺ compileₛ (ifthenelse c e₁ e₂) = do -- condition compileₑ c lthen+ ∙⟨ σ ⟩ ↓ lthen- ← freshLabel lthen+ ← ✴-id⁻ˡ ⟨$⟩ (code (if ne lthen-) ⟨ Up _ # ∙-comm σ ⟩& lthen+) -- else compileₛ e₂ ↓ lend- ∙⟨ σ ⟩ labels ← (✴-rotateₗ ∘ ✴-assocᵣ) ⟨$⟩ (freshLabel ⟨ Up _ # ∙-idˡ ⟩& lthen+) -- then lthen+ ∙⟨ σ ⟩ lend+ ← ✴-id⁻ˡ ⟨$⟩ (code (goto lend-) ⟨ _ ✴ _ # σ ⟩& labels) lend+ ← ✴-id⁻ˡ ⟨$⟩ (attach lthen+ ⟨ Up _ # σ ⟩& lend+) compileₛ e₁ -- label the end attach lend+ {- Compiling blocks -} compiler : ∀ (ψ : StackTy) {Γ r} → Block r Γ → ε[ Compiler ⟦ Γ ⟧ ψ ψ Emp ] compiler ψ (nil) = do return refl compiler ψ (s ⍮⍮ b) = do compileₛ s compiler _ b
Task/Hello-world-Line-printer/Ada/hello-world-line-printer.ada
LaudateCorpus1/RosettaCodeData
1
6670
<gh_stars>1-10 with Ada.Text_IO; use Ada.Text_IO; procedure Print_Line is Printer : File_Type; begin begin Open (Printer, Mode => Out_File, Name => "/dev/lp0"); exception when others => Put_Line ("Unable to open printer."); return; end; Set_Output (Printer); Put_Line ("Hello World!"); Close (Printer); end Print_Line;
common/dlists/titleScreenDlist.asm
laoo/TimePilot
24
82841
<reponame>laoo/TimePilot<filename>common/dlists/titleScreenDlist.asm org dataTitleScreenDlist dta b($50),b($c7),a(bufScreenTxt),b($70),b($70) dta b($45),a(bufScreen0+80),b($85),b($70),b($70),b($70),b($70),b($70),b($47),a(bufScreenTxt+20),b($70),b($70),b($87),b($70),b($70),b($70),b($70),b($70),b($47),a(bufScreenTxt+7*20),b($30),b($7) dta b($41),a(dataTitleScreenDlist) org dataTitleScreenDlist2 dta b($50),b($c7),a(bufScreenTxt),b($70),b($70) dta b($45),a(bufScreen0+80),b($85),b($70),b($70),b($c7),a(bufScreenTxt+20),b($70),b($20),b($87),b($70),b($20),b($87),b($70),b($20),b($87),b($70),b($20),b($87),b($70),b($20),b($7) dta b($41),a(dataTitleScreenDlist2) fakeDlist dta b($f0) dta b($41),a(fakeDlist)
Utils.asm
sidebog7/ZXWargame
1
84016
include 'util/Print.asm' include 'util/Random.asm' ; Returns random number in a ; Number will be between 1 and d random_num_btwn_1_d: ld e,1 dec d call random_num ret ; Returns random number in a ; Number will be between e and d random_num: inc d push bc push hl ld b,0 ld a,d sub e ld c,d push bc push de call rnd pop de pop bc ld l,a ld h,0 mod_loop: or a sbc hl,bc jp p,mod_loop add hl,bc ld b,0 ld c,e add hl,bc ld a,l pop hl pop bc ret Multiply: push bc ld a,e ; make accumulator first multiplier. ld e,d ; HL = D * E ld hl,0 ; zeroise total. ld d,h ; zeroise high byte so de=multiplier. ld b,8 ; repeat 8 times. imul1: rra ; rotate rightmost bit into carry. jr nc,imul2 ; wasn't set. add hl,de ; bit was set, so add de. and a ; reset carry. imul2: rl e ; shift de 1 bit left. rl d djnz imul1 ; repeat 8 times. pop bc ret divide_d_e: ; this routine performs the operation D=D/E rem A push bc xor a ld b, 8 divide_loop: sla d rla cp e jr c, $+4 sub e inc d djnz divide_loop pop bc ret divide_de_bc: ; this routine performs the operation BC=DE/A rem A ret press_any_key: ld a,56 ld (ATT),a push bc push de ld de,$1609 call SETDRAWPOS ld hl,text_press_enter call PRINTSTR ld bc,49150 pak_loop: in a,(c) rra jr c,pak_loop ld de,$1609 call SETDRAWPOS ld b,text_press_enter_length pak_clear_loop: push bc ld a,32 call PRINTCHAR pop bc djnz pak_clear_loop pop de pop bc ret get_y_or_n: push bc gyon_loop: ld bc,57342 in a,(c) and 16 jr z,press_y ld bc,32766 in a,(c) and 8 jr z,press_n jr gyon_loop press_y: ld a,1 jr gyon_fin press_n: ld a,2 gyon_fin: pop bc ret ; Returns in hl the map cell ; b = xpos ; c = ypos get_map_cell_in_hl_from_bc: push de ld d,c ld e,30 call Multiply ld d,0 ld e,b add hl,de ld d,h ld e,l ld hl,map add hl,de pop de ret get_map_cell_in_hl: push bc ld c,(ix+troopdata_ypos) ld b,(ix+troopdata_xpos) call get_map_cell_in_hl_from_bc pop bc ret fade: ld b,7 ;maximum of seven colors fade0: ld hl,$5800 ;beginning of attr area halt ;wait for beginning of frame ld de,$262 ;0x262 is minimum for a custom IM2 routine fade_wait: dec de ;until we reach active screen area, ld a,d ;plus generous overlap to account for or e ;different timings of different machines jr nz,fade_wait ;before we start drawing behind the beam fade1: ld a,(hl) ;read attr into A and 7 ;isolate INK ld c,a ;copy into C jr z,fade_1 ;leave it alone, if 0 dec c ;else, decrement INK fade_1: ld a,(hl) ;reload A with attr and $38 ;isolate PAPER jr z,fade_2 ;leave it alone, if 0 sub 8 ;else, decrement PAPER fade_2: or c ;merge with INK ld (hl),a ;write attr inc hl ;next cell ld a,h cp $5b ;past the end of attr area? jr nz,fade1 ;repeat if not djnz fade0 ;next color down ret
Compiler Design/CompilerDesign-master/checkabc.g4
anjali-rgpt/academic-projects-btech
1
1667
<gh_stars>1-10 grammar checkabc; s returns [Boolean value] :aval=a bval=b cval=c {$value=($aval.value==$bval.value && $bval.value==$cval.value);System.out.println("Syntactically correct and expression is "+$value);}; a returns [Integer value] :(A)aval=a {$value=1+$aval.value;} |A {$value=1;}; b returns [Integer value] :(B)bval=b {$value=1+$bval.value;} |B {$value=1;}; c returns [Integer value] :(C)cval=c {$value=1+$cval.value;} |C {$value=1;}; A:'a'; B:'b'; C:'c';
Bill_Cravener/popinfo/popinfo.asm
AlexRogalskiy/Masm
0
25250
; #################################################### ; <NAME> 8/4/2003 ; #################################################### .486 .model flat,stdcall option casemap:none ; case sensitive ; #################################################### include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\comctl32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\comctl32.lib ; #################################################### IDC_EDIT1 equ 201 IDC_SLIDER1 equ 301 IDC_STATIC equ -1 ; -------------------------------------------------------- PopUpHelp PROTO :DWORD,:DWORD,:DWORD,:DWORD ; -------------------------------------------------------- .data hInstance dd ? dlgname db "POPUPINFO",0 HelpPath db ".\Sample.hlp",0 HelpArray dd IDC_EDIT1 ; Edit control ID dd 1001 ; Help file context ID dd IDC_SLIDER1 ; Slider control ID dd 1002 ; Help file context ID dd 0 ; The array must end dd 0 ; in a pair of zero's .data? icex INITCOMMONCONTROLSEX <> ;structure for Controls ; ############################################################### .code start: invoke GetModuleHandle,NULL mov hInstance,eax mov icex.dwSize,sizeof INITCOMMONCONTROLSEX mov icex.dwICC,ICC_DATE_CLASSES invoke InitCommonControlsEx,ADDR icex ; --------------------------------------------- ; Call the dialog box stored in resource file ; --------------------------------------------- invoke DialogBoxParam,hInstance,ADDR dlgname,0,ADDR PopUpHelp,0 invoke ExitProcess,eax ; ############################################################### PopUpHelp proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD LOCAL hItem:DWORD .if uMsg == WM_INITDIALOG invoke SetFocus,hWin .elseif uMsg == WM_COMMAND .elseif uMsg == WM_CLOSE invoke EndDialog,hWin,NULL .elseif uMsg == WM_HELP ;------------------------------------------------------- ; The lParam holds the address of the HELPINFO structure ;------------------------------------------------------- mov eax,lParam mov eax,(HELPINFO PTR [eax]).hItemHandle mov hItem,eax ;----------------------------------- ; Get the handle of the edit control ;----------------------------------- invoke GetDlgItem,hWin,IDC_EDIT1 .if eax == hItem invoke WinHelp,eax,ADDR HelpPath,HELP_WM_HELP,ADDR HelpArray .endif ;------------------------------------- ; Get the handle of the slider control ;------------------------------------- invoke GetDlgItem,hWin,IDC_SLIDER1 .if eax == hItem invoke WinHelp,eax,ADDR HelpPath,HELP_WM_HELP,ADDR HelpArray .endif .endif xor eax,eax ret PopUpHelp endp ; ############################################################### end start
src/clic-user_input.ads
reznikmm/clic
9
25180
<gh_stars>1-10 with AAA.Strings; package CLIC.User_Input is ------------------- -- Interactivity -- ------------------- Not_Interactive : aliased Boolean := False; -- When not Interactive, instead of asking the user something, use default. User_Interrupt : exception; -- Raised when the user hits Ctrl-D and no further input can be obtained as -- stdin is closed. type Answer_Kind is (Yes, No, Always); type Answer_Set is array (Answer_Kind) of Boolean; function Query (Question : String; Valid : Answer_Set; Default : Answer_Kind) return Answer_Kind; -- If interactive, ask the user for one of the valid answer. -- Otherwise return the Default answer. function Query_Multi (Question : String; Choices : AAA.Strings.Vector; Page_Size : Positive := 10) return Positive with Pre => Page_Size >= 2 and then Page_Size < 36; -- Present the Choices in a numbered list 1-9-0-a-z, with paging if -- Choices.Length > Page_Size. Default is always First of Choices. type Answer_With_Input (Length : Natural) is record Input : String (1 .. Length); Answer : Answer_Kind; end record; function Validated_Input (Question : String; Prompt : String; Valid : Answer_Set; Default : access function (User_Input : String) return Answer_Kind; Confirm : String := "Is this information correct?"; Is_Valid : access function (User_Input : String) return Boolean) return Answer_With_Input; -- Interactive prompt for information from the user, with confirmation: -- Put_Line (Question) -- loop -- Put (Prompt); Get_Line (User_Input); -- if Is_Valid (User_Input) then -- exit when Query (Confirm, Valid, Default (User_Input)) /= No; -- end if; -- end loop function Img (Kind : Answer_Kind) return String; type String_Validation_Access is access function (Str : String) return Boolean; function Query_String (Question : String; Default : String; Validation : String_Validation_Access) return String with Pre => Validation = null or else Validation (Default); -- If interactive, ask the user to provide a valid string. -- Otherwise return the Default value. -- -- If Validation is null, any input is accepted. -- -- The Default value has to be a valid input. procedure Continue_Or_Abort; -- If interactive, ask the user to press Enter or Ctrl-C to stop. -- Output a log trace otherwise and continue. end CLIC.User_Input;
regtests/ado-sequences-tests.adb
Letractively/ada-ado
0
5127
<reponame>Letractively/ada-ado ----------------------------------------------------------------------- -- ado-sequences-tests -- Test sequences factories -- Copyright (C) 2011, 2012 <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.Test_Caller; with ADO.Drivers; with ADO.Sessions; with ADO.SQL; with Regtests.Simple.Model; with ADO.Sequences.Hilo; with ADO.Sessions.Factory; package body ADO.Sequences.Tests is use Util.Tests; type Test_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => Regtests.Simple.Model.ALLOCATE_TABLE'Access) with record Version : Integer; Value : ADO.Identifier; Name : Ada.Strings.Unbounded.Unbounded_String; Select_Name : Ada.Strings.Unbounded.Unbounded_String; end record; overriding procedure Destroy (Object : access Test_Impl); overriding procedure Find (Object : in out Test_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Test_Impl; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Test_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Test_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Create (Object : in out Test_Impl; Session : in out ADO.Sessions.Master_Session'Class); package Caller is new Util.Test_Caller (Test, "ADO.Sequences"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test ADO.Sequences.Create", Test_Create_Factory'Access); end Add_Tests; -- Test creation of the sequence factory. -- This test revealed a memory leak if we failed to create a database connection. procedure Test_Create_Factory (T : in out Test) is Seq_Factory : ADO.Sequences.Factory; Obj : Test_Impl; Factory : aliased ADO.Sessions.Factory.Session_Factory; begin Seq_Factory.Set_Default_Generator (ADO.Sequences.Hilo.Create_HiLo_Generator'Access, Factory'Unchecked_Access); begin Seq_Factory.Allocate (Obj); T.Assert (False, "No exception raised."); exception when ADO.Drivers.Connection_Error => null; -- Good! An exception is expected because the session factory is empty. end; end Test_Create_Factory; overriding procedure Destroy (Object : access Test_Impl) is begin null; end Destroy; overriding procedure Find (Object : in out Test_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is pragma Unreferenced (Object, Session, Query); begin Found := False; end Find; overriding procedure Load (Object : in out Test_Impl; Session : in out ADO.Sessions.Session'Class) is begin null; end Load; overriding procedure Save (Object : in out Test_Impl; Session : in out ADO.Sessions.Master_Session'Class) is begin null; end Save; overriding procedure Delete (Object : in out Test_Impl; Session : in out ADO.Sessions.Master_Session'Class) is begin null; end Delete; overriding procedure Create (Object : in out Test_Impl; Session : in out ADO.Sessions.Master_Session'Class) is begin null; end Create; end ADO.Sequences.Tests;
src/fullscreen.asm
rodriados/pacman-x86
1
89665
; Pacman-x86: a Pacman implementation in pure x86 assembly. ; @file The game's fullscreen mode manager. ; @author <NAME> <<EMAIL>> ; @copyright 2021-present <NAME> bits 64 %include "opengl.inc" %include "window.inc" extern window global fullscreen.ToggleCallback:function ; Preserves the game's canvas state before a fullscreen request. ; This is needed because when a fullscreen operation triggers the canvas' reshape ; callback, the window's global state is updated. struc preserveT .shape: resd 2 ; The preserved window's width and height. .position: resd 2 ; The preserved window's position on screen. endstruc section .bss preserve: resb preserveT_size section .data ; Toggles the game's window fullscreen mode. ; When toggled off of the fullscreen mode, the screen must come back and be redrawn ; to its previous size and position. ; @param (none) The goggle state is queried from memory. fullscreen.ToggleCallback: xor byte [window + windowT.fullscreen], 0x01 jz .toggleOff .toggleOn: glutGetState GLUT_WINDOW_X mov dword [preserve + preserveT.position + 0], eax glutGetState GLUT_WINDOW_Y mov dword [preserve + preserveT.position + 4], eax mov ecx, dword [window + windowT.shapeX] mov edx, dword [window + windowT.shapeY] mov dword [preserve + preserveT.shape + 0], ecx mov dword [preserve + preserveT.shape + 4], edx call glutFullScreen ret .toggleOff: mov edi, dword [preserve + preserveT.shape + 0] mov esi, dword [preserve + preserveT.shape + 4] mov dword [window + windowT.shapeX], edi mov dword [window + windowT.shapeY], esi call glutReshapeWindow mov edi, dword [preserve + preserveT.position + 0] mov esi, dword [preserve + preserveT.position + 4] mov dword [window + windowT.positionX], edi mov dword [window + windowT.positionY], esi call glutPositionWindow ret
titlescreen.asm
adamsmasher/bustfree
0
19501
<filename>titlescreen.asm INCLUDE "font.inc" INCLUDE "input.inc" STATE_SCROLLING1 EQU 0 STATE_SCROLLING2 EQU 1 STATE_FADING EQU 2 STATE_WAITING EQU 3 FADE_DELAY EQU 5 FLASH_DELAY EQU 45 BUST_FIRST_TILE_ADDR EQU $8B00 FREE_FIRST_TILE_ADDR EQU $8E20 KATAKANA_FIRST_TILE_ADDR EQU $9200 BUST_FIRST_TILE EQU (BUST_FIRST_TILE_ADDR & $0FF0) >> 4 FREE_FIRST_TILE EQU (FREE_FIRST_TILE_ADDR & $0FF0) >> 4 KATAKANA_FIRST_TILE EQU (KATAKANA_FIRST_TILE_ADDR & $0FF0) >> 4 BUST_POS EQU $9800 FREE_POS EQU $9900 PRESS_START_POS EQU $9A25 KATAKANA_POS EQU $984B INITIAL_SCROLL_X EQU $60 FINAL_SCROLL_X2 EQU $D8 FREE_SCROLL_ADJ_Y EQU 20 PRESS_START_SCROLL_ADJ_Y EQU 24 SCROLL_SPEED EQU 4 FLASH_TIME EQU 24 FREE_LINE EQU 45 PRESS_START_LINE EQU 90 SECTION "TitleScreenRAM", WRAM0 TitleScreenState: DS 1 TitleScreenScrollX1: DS 1 TitleScreenScrollX2: DS 1 TitleScreenPalette: DS 1 PressStartPalette: DS 1 Delay: DS 1 SECTION "TitleScreenData", ROMX PUSHC SETCHARMAP Font PressStartTxt: DB "PRESS START" .end POPC BustLogo: INCBIN "bust.gfx" .end FreeLogo: INCBIN "free.gfx" .end KatakanaLogo: INCBIN "basutofurii.gfx" .end _DrawPressStart: LD HL, PressStartTxt LD DE, PRESS_START_POS LD B, PressStartTxt.end - PressStartTxt .loop LD A, [HLI] LD [DE], A INC E DEC B JR NZ, .loop RET LoadBustLogo: LD HL, BustLogo LD DE, BUST_FIRST_TILE_ADDR LD BC, BustLogo.end - BustLogo .loop LD A, [HLI] LD [DE], A INC DE DEC BC LD A, B OR C JR NZ, .loop RET LoadFreeLogo: LD HL, FreeLogo LD DE, FREE_FIRST_TILE_ADDR LD BC, FreeLogo.end - FreeLogo .loop LD A, [HLI] LD [DE], A INC DE DEC BC LD A, B OR C JR NZ, .loop RET LoadKatakanaLogo: LD HL, KatakanaLogo LD DE, KATAKANA_FIRST_TILE_ADDR LD B, KatakanaLogo.end - KatakanaLogo .loop LD A, [HLI] LD [DE], A INC DE DEC B JR NZ, .loop RET _LoadTitleGfx: CALL LoadFont CALL LoadBustLogo CALL LoadFreeLogo CALL LoadKatakanaLogo RET SECTION "TitleScreen", ROM0 BUST_WIDTH EQU 10 BUST_HEIGHT EQU 5 FREE_WIDTH EQU 12 FREE_HEIGHT EQU 5 KATAKANA_WIDTH EQU 6 KATAKANA_HEIGHT EQU 2 DrawPressStart: LD A, BANK(_DrawPressStart) LD [$2000], A JP _DrawPressStart LoadTitleGfx: LD A, BANK(_LoadTitleGfx) LD [$2000], A JP _LoadTitleGfx DrawBustLogo: LD HL, BUST_POS LD A, BUST_FIRST_TILE LD B, BUST_HEIGHT .row LD C, BUST_WIDTH .loop LD [HLI], A INC A DEC C JR NZ, .loop LD D, A LD A, L ADD 32 - BUST_WIDTH LD L, A LD A, D DEC B JR NZ, .row RET DrawFreeLogo: LD HL, FREE_POS LD A, FREE_FIRST_TILE LD B, FREE_HEIGHT .row LD C, FREE_WIDTH .loop LD [HLI], A INC A DEC C JR NZ, .loop LD D, A LD A, L ADD 32 - FREE_WIDTH LD L, A LD A, D DEC B JR NZ, .row RET DrawKatakanaLogo: LD HL, KATAKANA_POS LD A, KATAKANA_FIRST_TILE LD B, KATAKANA_HEIGHT .row LD C, KATAKANA_WIDTH .loop LD [HLI], A INC A DEC C JR NZ, .loop LD D, A LD A, L ADD 32 - KATAKANA_WIDTH LD L, A LD A, D DEC B JR NZ, .row RET ClearBG: LD A, $7F LD B, 32 LD HL, $9800 .row LD C, 32 .loop LD [HLI], A DEC C JR NZ, .loop DEC B JR NZ, .row RET DrawTitleScreen: CALL ClearBG CALL DrawBustLogo CALL DrawFreeLogo RET InitHandlers: LD HL, VBlankHandler LD A, LOW(VBlank) LD [HLI], A LD [HL], HIGH(VBlank) LD A, %01000000 LDH [$41], A LD HL, $FFFF SET 1, [HL] RET StartTitleScreen:: LD A, STATE_SCROLLING1 LD [TitleScreenState], A LD A, INITIAL_SCROLL_X LD [TitleScreenScrollX1], A LD [TitleScreenScrollX2], A LD A, $E4 LD [TitleScreenPalette], A LD [PressStartPalette], A CALL InitHandlers CALL LoadTitleGfx CALL DrawTitleScreen CALL TurnOnScreen LD HL, GameLoopPtr LD A, LOW(TitleScreen) LD [HLI], A LD [HL], HIGH(TitleScreen) RET StartWaiting: LD B, FLASH_TIME .loop CALL WaitForVBlank DEC B JR NZ, .loop CALL TurnOffScreen CALL DrawPressStart CALL DrawKatakanaLogo LD A, $E4 LD [TitleScreenPalette], A LD [PressStartPalette], A LD A, FLASH_DELAY LD [Delay], A CALL TurnOnScreen LD A, STATE_WAITING LD [TitleScreenState], A RET StartScroll2: LD A, STATE_SCROLLING2 LD [TitleScreenState], A RET StartFading: XOR A LD [TitleScreenScrollX1], A LD A, FINAL_SCROLL_X2 LD [TitleScreenScrollX2], A LD A, STATE_FADING LD [TitleScreenState], A LD A, FADE_DELAY LD [Delay], A RET HandleScrolling1: LD HL, TitleScreenScrollX1 LD A, [HL] SUB SCROLL_SPEED LD [HL], A JP Z, StartScroll2 LD A, [KeysPressed] BIT INPUT_START, A JP NZ, StartFading RET HandleScrolling2: LD HL, TitleScreenScrollX2 LD A, [HL] ADD SCROLL_SPEED LD [HL], A LD A, [HL] CP FINAL_SCROLL_X2 JP Z, StartFading LD A, [KeysPressed] BIT INPUT_START, A RET Z CALL StartFading RET StepFade: LD HL, TitleScreenPalette LD A, [HL] SLA A SLA A LD [HL], A JP Z, StartWaiting RET HandleFading: LD HL, Delay DEC [HL] RET NZ CALL StepFade LD A, FADE_DELAY LD [Delay], A RET FlashText: LD A, FLASH_DELAY LD [Delay], A LD HL, PressStartPalette LD A, [HL] XOR %11000000 LD [HL], A RET HandleWaiting: LD HL, Delay DEC [HL] CALL Z, FlashText LD A, [KeysPressed] BIT INPUT_START, A RET Z CALL TurnOffScreen CALL ClearVRAM CALL StartGame RET TitleScreen: LD A, [TitleScreenState] CP STATE_SCROLLING1 JP Z, HandleScrolling1 CP STATE_SCROLLING2 JP Z, HandleScrolling2 CP STATE_FADING JP Z, HandleFading CP STATE_WAITING JP Z, HandleWaiting RET TurnOnScreen: ; enable display ; BG tiles at $8800 ; map at $9800 ; bg enabled LD A, %10000001 LDH [$40], A RET VBlank: LD A, [TitleScreenPalette] LDH [$47], A LD A, [TitleScreenScrollX1] LDH [$43], A XOR A LDH [$42], A LD HL, StatHandler LD A, LOW(Stat1) LD [HLI], A LD [HL], HIGH(Stat1) LD A, FREE_LINE LDH [$45], A RET Stat1: LD A, [TitleScreenScrollX2] LDH [$43], A LD A, FREE_SCROLL_ADJ_Y LDH [$42], A LD HL, StatHandler LD A, LOW(Stat2) LD [HLI], A LD [HL], HIGH(Stat2) LD A, PRESS_START_LINE LDH [$45], A RET Stat2: LD A, PRESS_START_SCROLL_ADJ_Y LDH [$42], A XOR A LDH [$43], A LD A, [PressStartPalette] LDH [$47], A RET
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1570.asm
ljhsiun2/medusa
9
160865
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r8 push %r9 push %rax push %rbx push %rcx push %rdx lea addresses_D_ht+0x1a86f, %rbx clflush (%rbx) nop nop nop nop sub %r8, %r8 mov (%rbx), %cx nop nop dec %r8 lea addresses_A_ht+0x109a2, %rax nop nop cmp $14361, %rdx movl $0x61626364, (%rax) nop nop nop sub $48272, %rax pop %rdx pop %rcx pop %rbx pop %rax pop %r9 pop %r8 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r15 push %r8 push %r9 push %rax // Store lea addresses_D+0x1649f, %r15 nop nop nop nop nop dec %r14 movw $0x5152, (%r15) nop add %r12, %r12 // Faulty Load lea addresses_PSE+0x1a49f, %r15 nop nop nop nop nop cmp %r9, %r9 mov (%r15), %rax lea oracles, %r8 and $0xff, %rax shlq $12, %rax mov (%r8,%rax,1), %rax pop %rax pop %r9 pop %r8 pop %r15 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
test/Succeed/ProjectionLikeAndModules1.agda
cruhland/agda
1,989
13885
<filename>test/Succeed/ProjectionLikeAndModules1.agda -- {-# OPTIONS -v tc.proj.like:10 #-} {-# OPTIONS -v tc.conv:10 #-} import Common.Level module ProjectionLikeAndModules1 (A : Set) (a : A) where record ⊤ : Set where constructor tt data Wrap (W : Set) : Set where wrap : W → Wrap W data Bool : Set where true false : Bool -- `or' should be projection like in the module parameters if : Bool → {B : Set} → B → B → B if true a b = a if false a b = b postulate u v : ⊤ P : Wrap ⊤ -> Set test : (y : Bool) -> P (if y (wrap u) (wrap tt)) -> P (if y (wrap tt) (wrap v)) test y h = h -- Error: -- u != tt of type Set -- when checking that the expression h has type -- P (if y (wrap tt) (wrap v))
scripts/course/models_20210203/sat_70_80_3_6.als
eskang/alloy-maxsat-benchmark
0
4813
<filename>scripts/course/models_20210203/sat_70_80_3_6.als abstract sig Day {} one sig Mon, Tue, Wed, Thu, Fri extends Day {} abstract sig Time {} one sig AM, PM extends Time {} abstract sig Course { lectures: set Lecture } one sig C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47,C48,C49,C50,C51,C52,C53,C54,C55,C56,C57,C58,C59,C60,C61,C62,C63,C64,C65,C66,C67,C68,C69 extends Course {} fact { lectures = C0 -> MonPM + C0 -> WedPM + C1 -> MonPM + C1 -> WedPM + C2 -> TuePM + C2 -> TuePM + C3 -> MonPM + C3 -> WedPM + C4 -> MonAM + C4 -> WedAM + C4 -> FriPM + C5 -> MonAM + C5 -> WedAM + C5 -> FriPM + C6 -> TueAM + C6 -> ThuAM + C7 -> MonAM + C7 -> WedAM + C8 -> TuePM + C8 -> TuePM + C9 -> MonPM + C9 -> WedPM + C10 -> MonAM + C10 -> WedAM + C11 -> MonAM + C11 -> WedAM + C11 -> FriPM + C12 -> TueAM + C12 -> ThuAM + C13 -> TueAM + C13 -> ThuAM + C14 -> MonPM + C14 -> WedPM + C15 -> MonPM + C15 -> WedPM + C16 -> MonAM + C16 -> WedAM + C17 -> TueAM + C17 -> ThuAM + C18 -> MonAM + C18 -> WedAM + C19 -> MonPM + C19 -> WedPM + C20 -> MonPM + C20 -> WedPM + C21 -> TueAM + C21 -> ThuAM + C22 -> MonAM + C22 -> WedAM + C22 -> FriPM + C23 -> MonAM + C23 -> WedAM + C24 -> TueAM + C24 -> ThuAM + C25 -> TuePM + C25 -> TuePM + C26 -> MonPM + C26 -> WedPM + C27 -> TuePM + C27 -> TuePM + C28 -> TueAM + C28 -> ThuAM + C29 -> MonAM + C29 -> WedAM + C30 -> TueAM + C30 -> ThuAM + C31 -> TuePM + C31 -> TuePM + C32 -> MonPM + C32 -> WedPM + C33 -> MonAM + C33 -> WedAM + C34 -> TueAM + C34 -> ThuAM + C35 -> TueAM + C35 -> ThuAM + C36 -> TueAM + C36 -> ThuAM + C37 -> TueAM + C37 -> ThuAM + C38 -> TuePM + C38 -> TuePM + C39 -> MonAM + C39 -> WedAM + C40 -> TuePM + C40 -> TuePM + C41 -> MonAM + C41 -> WedAM + C41 -> FriPM + C42 -> TueAM + C42 -> ThuAM + C43 -> MonAM + C43 -> WedAM + C43 -> FriPM + C44 -> MonPM + C44 -> WedPM + C45 -> MonAM + C45 -> WedAM + C45 -> FriPM + C46 -> MonAM + C46 -> WedAM + C47 -> TueAM + C47 -> ThuAM + C48 -> TuePM + C48 -> TuePM + C49 -> TuePM + C49 -> TuePM + C50 -> MonPM + C50 -> WedPM + C51 -> TuePM + C51 -> TuePM + C52 -> TuePM + C52 -> TuePM + C53 -> TuePM + C53 -> TuePM + C54 -> TueAM + C54 -> ThuAM + C55 -> MonAM + C55 -> WedAM + C56 -> TueAM + C56 -> ThuAM + C57 -> MonAM + C57 -> WedAM + C57 -> FriPM + C58 -> TuePM + C58 -> TuePM + C59 -> MonPM + C59 -> WedPM + C60 -> TueAM + C60 -> ThuAM + C61 -> MonPM + C61 -> WedPM + C62 -> MonAM + C62 -> WedAM + C63 -> MonAM + C63 -> WedAM + C63 -> FriPM + C64 -> TueAM + C64 -> ThuAM + C65 -> TueAM + C65 -> ThuAM + C66 -> MonPM + C66 -> WedPM + C67 -> TueAM + C67 -> ThuAM + C68 -> MonAM + C68 -> WedAM + C68 -> FriPM + C69 -> MonAM + C69 -> WedAM } abstract sig Lecture { day: one Day, time: one Time } one sig MonAM, MonPM, TueAM, TuePM, WedAM, WedPM, ThuAM, ThuPM, FriAM, FriPM extends Lecture {} fact { day = MonAM -> Mon + MonPM -> Mon + TueAM -> Tue +TuePM -> Tue + WedAM -> Wed + WedPM -> Wed + ThuAM -> Thu + ThuPM -> Thu + FriAM -> Fri + FriPM -> Fri time = MonAM -> AM + MonPM -> PM + TueAM -> AM +TuePM -> PM + WedAM -> AM + WedPM -> PM + ThuAM -> AM + ThuPM -> PM + FriAM -> AM + FriPM -> PM } abstract sig Student { core: set Course, interests: set Course, courses: set Course } one sig S0 extends Student {} { core = C23 interests = C36 + C6 } one sig S1 extends Student {} { core = C2 + C7 interests = C2 } one sig S2 extends Student {} { core = C4 + C54 + C51 interests = C4 } one sig S3 extends Student {} { core = C41 + C27 interests = C27 + C65 + C40 + C41 + C43 + C50 } one sig S4 extends Student {} { core = C44 + C41 + C40 interests = C40 + C62 + C68 + C1 } one sig S5 extends Student {} { core = none interests = C38 } one sig S6 extends Student {} { core = C35 + C51 + C11 interests = C51 + C34 + C19 } one sig S7 extends Student {} { core = C20 interests = C16 + C60 + C22 + C30 + C58 } one sig S8 extends Student {} { core = C68 + C28 interests = C28 + C41 + C45 } one sig S9 extends Student {} { core = none interests = C52 + C11 + C13 + C33 + C22 } one sig S10 extends Student {} { core = C39 interests = C27 + C56 + C62 } one sig S11 extends Student {} { core = C3 + C5 + C65 interests = C65 } one sig S12 extends Student {} { core = C0 + C10 + C12 interests = C10 + C42 + C46 } one sig S13 extends Student {} { core = C46 + C28 + C58 interests = C58 + C25 + C37 + C5 + C51 } one sig S14 extends Student {} { core = C25 + C20 + C46 interests = C20 + C31 + C56 + C5 + C47 + C52 } one sig S15 extends Student {} { core = none interests = C17 + C66 + C25 + C4 + C60 } one sig S16 extends Student {} { core = none interests = C23 + C29 } one sig S17 extends Student {} { core = C26 + C46 interests = C26 } one sig S18 extends Student {} { core = none interests = C4 } one sig S19 extends Student {} { core = C9 interests = C11 + C10 + C67 + C48 + C7 } one sig S20 extends Student {} { core = C49 interests = C23 + C68 + C18 + C37 + C49 + C59 } one sig S21 extends Student {} { core = C59 interests = C65 } one sig S22 extends Student {} { core = C29 interests = C25 + C15 + C45 + C63 + C69 + C11 } one sig S23 extends Student {} { core = C11 interests = C61 } one sig S24 extends Student {} { core = none interests = C10 + C62 } one sig S25 extends Student {} { core = C0 + C21 + C18 interests = C18 + C49 + C44 + C41 + C20 + C13 } one sig S26 extends Student {} { core = C17 + C32 + C18 interests = C17 + C59 + C33 + C50 + C37 } one sig S27 extends Student {} { core = C26 + C8 + C34 interests = C34 } one sig S28 extends Student {} { core = C59 + C12 interests = C59 } one sig S29 extends Student {} { core = C46 interests = C27 + C18 + C27 + C8 + C28 } one sig S30 extends Student {} { core = C54 + C61 + C62 interests = C62 + C56 } one sig S31 extends Student {} { core = none interests = C1 + C42 + C43 + C23 + C14 + C20 } one sig S32 extends Student {} { core = C0 + C2 + C55 interests = C2 + C0 + C35 + C58 + C5 + C22 } one sig S33 extends Student {} { core = C8 + C26 + C5 interests = C5 } one sig S34 extends Student {} { core = C41 + C49 interests = C49 + C32 } one sig S35 extends Student {} { core = none interests = C30 } one sig S36 extends Student {} { core = C33 interests = C2 + C66 + C67 + C4 + C57 } one sig S37 extends Student {} { core = C34 + C1 interests = C34 + C24 + C15 + C38 } one sig S38 extends Student {} { core = C35 interests = C50 + C0 + C59 } one sig S39 extends Student {} { core = C63 + C64 + C40 interests = C63 + C49 + C18 + C16 + C58 } one sig S40 extends Student {} { core = C27 + C47 + C10 interests = C47 + C30 + C57 + C67 + C61 + C40 } one sig S41 extends Student {} { core = C30 + C11 + C61 interests = C11 } one sig S42 extends Student {} { core = C2 + C63 interests = C2 + C68 + C53 } one sig S43 extends Student {} { core = C18 + C27 + C60 interests = C18 + C21 } one sig S44 extends Student {} { core = C33 + C52 + C42 interests = C42 + C28 + C55 + C66 } one sig S45 extends Student {} { core = none interests = C38 + C49 } one sig S46 extends Student {} { core = C1 + C16 interests = C16 + C9 + C41 } one sig S47 extends Student {} { core = C54 + C11 + C8 interests = C54 } one sig S48 extends Student {} { core = C56 + C43 + C3 interests = C43 } one sig S49 extends Student {} { core = C40 + C56 + C7 interests = C40 + C7 + C32 + C63 } one sig S50 extends Student {} { core = C56 + C16 + C32 interests = C16 + C1 } one sig S51 extends Student {} { core = C32 + C5 + C21 interests = C32 + C0 + C2 + C66 + C5 + C38 } one sig S52 extends Student {} { core = none interests = C19 } one sig S53 extends Student {} { core = C1 + C28 interests = C1 + C2 } one sig S54 extends Student {} { core = none interests = C5 } one sig S55 extends Student {} { core = C41 + C61 + C37 interests = C41 + C17 + C39 + C44 + C29 } one sig S56 extends Student {} { core = C25 + C45 interests = C25 + C34 + C45 + C66 } one sig S57 extends Student {} { core = C51 interests = C36 + C25 + C39 + C17 } one sig S58 extends Student {} { core = C33 interests = C50 + C23 + C51 } one sig S59 extends Student {} { core = C65 + C40 interests = C65 + C23 + C52 + C22 } one sig S60 extends Student {} { core = C25 + C69 interests = C25 + C56 + C0 + C22 } one sig S61 extends Student {} { core = C56 interests = C10 } one sig S62 extends Student {} { core = C56 + C0 + C38 interests = C56 + C10 + C15 } one sig S63 extends Student {} { core = none interests = C65 + C57 + C46 + C62 + C4 } one sig S64 extends Student {} { core = none interests = C41 + C68 + C0 + C2 + C28 + C40 } one sig S65 extends Student {} { core = C59 + C27 + C12 interests = C59 + C66 + C48 + C32 } one sig S66 extends Student {} { core = C14 interests = C37 + C16 } one sig S67 extends Student {} { core = none interests = C51 + C37 + C40 + C61 } one sig S68 extends Student {} { core = C65 + C2 + C19 interests = C2 } one sig S69 extends Student {} { core = C30 + C38 interests = C38 + C40 + C5 } one sig S70 extends Student {} { core = C12 interests = C22 + C42 + C60 + C57 + C1 + C31 } one sig S71 extends Student {} { core = C65 interests = C0 } one sig S72 extends Student {} { core = C54 + C39 + C31 interests = C31 + C65 + C18 + C35 + C44 } one sig S73 extends Student {} { core = C31 + C46 interests = C46 + C47 + C51 + C20 + C8 } one sig S74 extends Student {} { core = C1 + C11 interests = C1 + C43 + C28 + C32 + C52 + C18 } one sig S75 extends Student {} { core = none interests = C6 + C67 + C3 } one sig S76 extends Student {} { core = none interests = C61 + C36 } one sig S77 extends Student {} { core = none interests = C45 } one sig S78 extends Student {} { core = none interests = C18 + C63 + C14 + C45 + C66 } one sig S79 extends Student {} { core = C3 interests = C5 + C5 + C42 + C68 + C30 } pred conflict[c1, c2: Course] { some l1, l2: Lecture { l1 in c1.lectures l2 in c2.lectures l1.day = l2.day l1.time = l2.time } } pred validSchedule[courses: Student -> Course] { all stu: Student { #stu.courses > 2 stu.core in stu.courses all disj c1, c2: stu.courses | not conflict[c1, c2] } } run AnySchedule { validSchedule[courses] all stu: Student | some stu.interests & stu.courses }
arch/ARM/Nordic/svd/nrf52/nrf_svd-pwm.ads
rocher/Ada_Drivers_Library
192
25179
-- Copyright (c) 2010 - 2018, Nordic Semiconductor ASA -- -- 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, except as embedded into a Nordic -- Semiconductor ASA integrated circuit in a product or a software update for -- such product, 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 Nordic Semiconductor ASA nor the names of its -- contributors may be used to endorse or promote products derived from this -- software without specific prior written permission. -- -- 4. This software, with or without modification, must only be used with a -- Nordic Semiconductor ASA integrated circuit. -- -- 5. Any software provided in binary form under this license must not be reverse -- engineered, decompiled, modified and/or disassembled. -- -- THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS -- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -- OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- This spec has been automatically generated from nrf52.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package NRF_SVD.PWM is pragma Preelaborate; --------------- -- Registers -- --------------- -- Description collection[0]: Loads the first PWM value on all enabled channels from sequence 0, and starts playing that sequence at the rate defined in SEQ[0]REFRESH and/or DECODER.MODE. Causes PWM generation to start it was not running. -- Description collection[0]: Loads the first PWM value on all enabled -- channels from sequence 0, and starts playing that sequence at the rate -- defined in SEQ[0]REFRESH and/or DECODER.MODE. Causes PWM generation to -- start it was not running. type TASKS_SEQSTART_Registers is array (0 .. 1) of HAL.UInt32; -- Description collection[0]: First PWM period started on sequence 0 -- Description collection[0]: First PWM period started on sequence 0 type EVENTS_SEQSTARTED_Registers is array (0 .. 1) of HAL.UInt32; -- Description collection[0]: Emitted at end of every sequence 0, when last value from RAM has been applied to wave counter -- Description collection[0]: Emitted at end of every sequence 0, when last -- value from RAM has been applied to wave counter type EVENTS_SEQEND_Registers is array (0 .. 1) of HAL.UInt32; -- Shortcut between SEQEND[0] event and STOP task type SHORTS_SEQEND0_STOP_Field is (-- Disable shortcut Disabled, -- Enable shortcut Enabled) with Size => 1; for SHORTS_SEQEND0_STOP_Field use (Disabled => 0, Enabled => 1); -- Shortcut between SEQEND[1] event and STOP task type SHORTS_SEQEND1_STOP_Field is (-- Disable shortcut Disabled, -- Enable shortcut Enabled) with Size => 1; for SHORTS_SEQEND1_STOP_Field use (Disabled => 0, Enabled => 1); -- Shortcut between LOOPSDONE event and SEQSTART[0] task type SHORTS_LOOPSDONE_SEQSTART0_Field is (-- Disable shortcut Disabled, -- Enable shortcut Enabled) with Size => 1; for SHORTS_LOOPSDONE_SEQSTART0_Field use (Disabled => 0, Enabled => 1); -- SHORTS_LOOPSDONE_SEQSTART array type SHORTS_LOOPSDONE_SEQSTART_Field_Array is array (0 .. 1) of SHORTS_LOOPSDONE_SEQSTART0_Field with Component_Size => 1, Size => 2; -- Type definition for SHORTS_LOOPSDONE_SEQSTART type SHORTS_LOOPSDONE_SEQSTART_Field (As_Array : Boolean := False) is record case As_Array is when False => -- LOOPSDONE_SEQSTART as a value Val : HAL.UInt2; when True => -- LOOPSDONE_SEQSTART as an array Arr : SHORTS_LOOPSDONE_SEQSTART_Field_Array; end case; end record with Unchecked_Union, Size => 2; for SHORTS_LOOPSDONE_SEQSTART_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Shortcut between LOOPSDONE event and STOP task type SHORTS_LOOPSDONE_STOP_Field is (-- Disable shortcut Disabled, -- Enable shortcut Enabled) with Size => 1; for SHORTS_LOOPSDONE_STOP_Field use (Disabled => 0, Enabled => 1); -- Shortcut register type SHORTS_Register is record -- Shortcut between SEQEND[0] event and STOP task SEQEND0_STOP : SHORTS_SEQEND0_STOP_Field := NRF_SVD.PWM.Disabled; -- Shortcut between SEQEND[1] event and STOP task SEQEND1_STOP : SHORTS_SEQEND1_STOP_Field := NRF_SVD.PWM.Disabled; -- Shortcut between LOOPSDONE event and SEQSTART[0] task LOOPSDONE_SEQSTART : SHORTS_LOOPSDONE_SEQSTART_Field := (As_Array => False, Val => 16#0#); -- Shortcut between LOOPSDONE event and STOP task LOOPSDONE_STOP : SHORTS_LOOPSDONE_STOP_Field := NRF_SVD.PWM.Disabled; -- unspecified Reserved_5_31 : HAL.UInt27 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SHORTS_Register use record SEQEND0_STOP at 0 range 0 .. 0; SEQEND1_STOP at 0 range 1 .. 1; LOOPSDONE_SEQSTART at 0 range 2 .. 3; LOOPSDONE_STOP at 0 range 4 .. 4; Reserved_5_31 at 0 range 5 .. 31; end record; -- Enable or disable interrupt for STOPPED event type INTEN_STOPPED_Field is (-- Disable Disabled, -- Enable Enabled) with Size => 1; for INTEN_STOPPED_Field use (Disabled => 0, Enabled => 1); -- Enable or disable interrupt for SEQSTARTED[0] event type INTEN_SEQSTARTED0_Field is (-- Disable Disabled, -- Enable Enabled) with Size => 1; for INTEN_SEQSTARTED0_Field use (Disabled => 0, Enabled => 1); -- INTEN_SEQSTARTED array type INTEN_SEQSTARTED_Field_Array is array (0 .. 1) of INTEN_SEQSTARTED0_Field with Component_Size => 1, Size => 2; -- Type definition for INTEN_SEQSTARTED type INTEN_SEQSTARTED_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SEQSTARTED as a value Val : HAL.UInt2; when True => -- SEQSTARTED as an array Arr : INTEN_SEQSTARTED_Field_Array; end case; end record with Unchecked_Union, Size => 2; for INTEN_SEQSTARTED_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Enable or disable interrupt for SEQEND[0] event type INTEN_SEQEND0_Field is (-- Disable Disabled, -- Enable Enabled) with Size => 1; for INTEN_SEQEND0_Field use (Disabled => 0, Enabled => 1); -- INTEN_SEQEND array type INTEN_SEQEND_Field_Array is array (0 .. 1) of INTEN_SEQEND0_Field with Component_Size => 1, Size => 2; -- Type definition for INTEN_SEQEND type INTEN_SEQEND_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SEQEND as a value Val : HAL.UInt2; when True => -- SEQEND as an array Arr : INTEN_SEQEND_Field_Array; end case; end record with Unchecked_Union, Size => 2; for INTEN_SEQEND_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Enable or disable interrupt for PWMPERIODEND event type INTEN_PWMPERIODEND_Field is (-- Disable Disabled, -- Enable Enabled) with Size => 1; for INTEN_PWMPERIODEND_Field use (Disabled => 0, Enabled => 1); -- Enable or disable interrupt for LOOPSDONE event type INTEN_LOOPSDONE_Field is (-- Disable Disabled, -- Enable Enabled) with Size => 1; for INTEN_LOOPSDONE_Field use (Disabled => 0, Enabled => 1); -- Enable or disable interrupt type INTEN_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Enable or disable interrupt for STOPPED event STOPPED : INTEN_STOPPED_Field := NRF_SVD.PWM.Disabled; -- Enable or disable interrupt for SEQSTARTED[0] event SEQSTARTED : INTEN_SEQSTARTED_Field := (As_Array => False, Val => 16#0#); -- Enable or disable interrupt for SEQEND[0] event SEQEND : INTEN_SEQEND_Field := (As_Array => False, Val => 16#0#); -- Enable or disable interrupt for PWMPERIODEND event PWMPERIODEND : INTEN_PWMPERIODEND_Field := NRF_SVD.PWM.Disabled; -- Enable or disable interrupt for LOOPSDONE event LOOPSDONE : INTEN_LOOPSDONE_Field := NRF_SVD.PWM.Disabled; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTEN_Register use record Reserved_0_0 at 0 range 0 .. 0; STOPPED at 0 range 1 .. 1; SEQSTARTED at 0 range 2 .. 3; SEQEND at 0 range 4 .. 5; PWMPERIODEND at 0 range 6 .. 6; LOOPSDONE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; -- Write '1' to Enable interrupt for STOPPED event type INTENSET_STOPPED_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENSET_STOPPED_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Enable interrupt for STOPPED event type INTENSET_STOPPED_Field_1 is (-- Reset value for the field Intenset_Stopped_Field_Reset, -- Enable Set) with Size => 1; for INTENSET_STOPPED_Field_1 use (Intenset_Stopped_Field_Reset => 0, Set => 1); -- Write '1' to Enable interrupt for SEQSTARTED[0] event type INTENSET_SEQSTARTED0_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENSET_SEQSTARTED0_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Enable interrupt for SEQSTARTED[0] event type INTENSET_SEQSTARTED0_Field_1 is (-- Reset value for the field Intenset_Seqstarted0_Field_Reset, -- Enable Set) with Size => 1; for INTENSET_SEQSTARTED0_Field_1 use (Intenset_Seqstarted0_Field_Reset => 0, Set => 1); -- INTENSET_SEQSTARTED array type INTENSET_SEQSTARTED_Field_Array is array (0 .. 1) of INTENSET_SEQSTARTED0_Field_1 with Component_Size => 1, Size => 2; -- Type definition for INTENSET_SEQSTARTED type INTENSET_SEQSTARTED_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SEQSTARTED as a value Val : HAL.UInt2; when True => -- SEQSTARTED as an array Arr : INTENSET_SEQSTARTED_Field_Array; end case; end record with Unchecked_Union, Size => 2; for INTENSET_SEQSTARTED_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Write '1' to Enable interrupt for SEQEND[0] event type INTENSET_SEQEND0_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENSET_SEQEND0_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Enable interrupt for SEQEND[0] event type INTENSET_SEQEND0_Field_1 is (-- Reset value for the field Intenset_Seqend0_Field_Reset, -- Enable Set) with Size => 1; for INTENSET_SEQEND0_Field_1 use (Intenset_Seqend0_Field_Reset => 0, Set => 1); -- INTENSET_SEQEND array type INTENSET_SEQEND_Field_Array is array (0 .. 1) of INTENSET_SEQEND0_Field_1 with Component_Size => 1, Size => 2; -- Type definition for INTENSET_SEQEND type INTENSET_SEQEND_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SEQEND as a value Val : HAL.UInt2; when True => -- SEQEND as an array Arr : INTENSET_SEQEND_Field_Array; end case; end record with Unchecked_Union, Size => 2; for INTENSET_SEQEND_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Write '1' to Enable interrupt for PWMPERIODEND event type INTENSET_PWMPERIODEND_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENSET_PWMPERIODEND_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Enable interrupt for PWMPERIODEND event type INTENSET_PWMPERIODEND_Field_1 is (-- Reset value for the field Intenset_Pwmperiodend_Field_Reset, -- Enable Set) with Size => 1; for INTENSET_PWMPERIODEND_Field_1 use (Intenset_Pwmperiodend_Field_Reset => 0, Set => 1); -- Write '1' to Enable interrupt for LOOPSDONE event type INTENSET_LOOPSDONE_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENSET_LOOPSDONE_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Enable interrupt for LOOPSDONE event type INTENSET_LOOPSDONE_Field_1 is (-- Reset value for the field Intenset_Loopsdone_Field_Reset, -- Enable Set) with Size => 1; for INTENSET_LOOPSDONE_Field_1 use (Intenset_Loopsdone_Field_Reset => 0, Set => 1); -- Enable interrupt type INTENSET_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Write '1' to Enable interrupt for STOPPED event STOPPED : INTENSET_STOPPED_Field_1 := Intenset_Stopped_Field_Reset; -- Write '1' to Enable interrupt for SEQSTARTED[0] event SEQSTARTED : INTENSET_SEQSTARTED_Field := (As_Array => False, Val => 16#0#); -- Write '1' to Enable interrupt for SEQEND[0] event SEQEND : INTENSET_SEQEND_Field := (As_Array => False, Val => 16#0#); -- Write '1' to Enable interrupt for PWMPERIODEND event PWMPERIODEND : INTENSET_PWMPERIODEND_Field_1 := Intenset_Pwmperiodend_Field_Reset; -- Write '1' to Enable interrupt for LOOPSDONE event LOOPSDONE : INTENSET_LOOPSDONE_Field_1 := Intenset_Loopsdone_Field_Reset; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTENSET_Register use record Reserved_0_0 at 0 range 0 .. 0; STOPPED at 0 range 1 .. 1; SEQSTARTED at 0 range 2 .. 3; SEQEND at 0 range 4 .. 5; PWMPERIODEND at 0 range 6 .. 6; LOOPSDONE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; -- Write '1' to Disable interrupt for STOPPED event type INTENCLR_STOPPED_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENCLR_STOPPED_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Disable interrupt for STOPPED event type INTENCLR_STOPPED_Field_1 is (-- Reset value for the field Intenclr_Stopped_Field_Reset, -- Disable Clear) with Size => 1; for INTENCLR_STOPPED_Field_1 use (Intenclr_Stopped_Field_Reset => 0, Clear => 1); -- Write '1' to Disable interrupt for SEQSTARTED[0] event type INTENCLR_SEQSTARTED0_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENCLR_SEQSTARTED0_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Disable interrupt for SEQSTARTED[0] event type INTENCLR_SEQSTARTED0_Field_1 is (-- Reset value for the field Intenclr_Seqstarted0_Field_Reset, -- Disable Clear) with Size => 1; for INTENCLR_SEQSTARTED0_Field_1 use (Intenclr_Seqstarted0_Field_Reset => 0, Clear => 1); -- INTENCLR_SEQSTARTED array type INTENCLR_SEQSTARTED_Field_Array is array (0 .. 1) of INTENCLR_SEQSTARTED0_Field_1 with Component_Size => 1, Size => 2; -- Type definition for INTENCLR_SEQSTARTED type INTENCLR_SEQSTARTED_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SEQSTARTED as a value Val : HAL.UInt2; when True => -- SEQSTARTED as an array Arr : INTENCLR_SEQSTARTED_Field_Array; end case; end record with Unchecked_Union, Size => 2; for INTENCLR_SEQSTARTED_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Write '1' to Disable interrupt for SEQEND[0] event type INTENCLR_SEQEND0_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENCLR_SEQEND0_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Disable interrupt for SEQEND[0] event type INTENCLR_SEQEND0_Field_1 is (-- Reset value for the field Intenclr_Seqend0_Field_Reset, -- Disable Clear) with Size => 1; for INTENCLR_SEQEND0_Field_1 use (Intenclr_Seqend0_Field_Reset => 0, Clear => 1); -- INTENCLR_SEQEND array type INTENCLR_SEQEND_Field_Array is array (0 .. 1) of INTENCLR_SEQEND0_Field_1 with Component_Size => 1, Size => 2; -- Type definition for INTENCLR_SEQEND type INTENCLR_SEQEND_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SEQEND as a value Val : HAL.UInt2; when True => -- SEQEND as an array Arr : INTENCLR_SEQEND_Field_Array; end case; end record with Unchecked_Union, Size => 2; for INTENCLR_SEQEND_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Write '1' to Disable interrupt for PWMPERIODEND event type INTENCLR_PWMPERIODEND_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENCLR_PWMPERIODEND_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Disable interrupt for PWMPERIODEND event type INTENCLR_PWMPERIODEND_Field_1 is (-- Reset value for the field Intenclr_Pwmperiodend_Field_Reset, -- Disable Clear) with Size => 1; for INTENCLR_PWMPERIODEND_Field_1 use (Intenclr_Pwmperiodend_Field_Reset => 0, Clear => 1); -- Write '1' to Disable interrupt for LOOPSDONE event type INTENCLR_LOOPSDONE_Field is (-- Read: Disabled Disabled, -- Read: Enabled Enabled) with Size => 1; for INTENCLR_LOOPSDONE_Field use (Disabled => 0, Enabled => 1); -- Write '1' to Disable interrupt for LOOPSDONE event type INTENCLR_LOOPSDONE_Field_1 is (-- Reset value for the field Intenclr_Loopsdone_Field_Reset, -- Disable Clear) with Size => 1; for INTENCLR_LOOPSDONE_Field_1 use (Intenclr_Loopsdone_Field_Reset => 0, Clear => 1); -- Disable interrupt type INTENCLR_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Write '1' to Disable interrupt for STOPPED event STOPPED : INTENCLR_STOPPED_Field_1 := Intenclr_Stopped_Field_Reset; -- Write '1' to Disable interrupt for SEQSTARTED[0] event SEQSTARTED : INTENCLR_SEQSTARTED_Field := (As_Array => False, Val => 16#0#); -- Write '1' to Disable interrupt for SEQEND[0] event SEQEND : INTENCLR_SEQEND_Field := (As_Array => False, Val => 16#0#); -- Write '1' to Disable interrupt for PWMPERIODEND event PWMPERIODEND : INTENCLR_PWMPERIODEND_Field_1 := Intenclr_Pwmperiodend_Field_Reset; -- Write '1' to Disable interrupt for LOOPSDONE event LOOPSDONE : INTENCLR_LOOPSDONE_Field_1 := Intenclr_Loopsdone_Field_Reset; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTENCLR_Register use record Reserved_0_0 at 0 range 0 .. 0; STOPPED at 0 range 1 .. 1; SEQSTARTED at 0 range 2 .. 3; SEQEND at 0 range 4 .. 5; PWMPERIODEND at 0 range 6 .. 6; LOOPSDONE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; -- Enable or disable PWM module type ENABLE_ENABLE_Field is (-- Disabled Disabled, -- Enable Enabled) with Size => 1; for ENABLE_ENABLE_Field use (Disabled => 0, Enabled => 1); -- PWM module enable register type ENABLE_Register is record -- Enable or disable PWM module ENABLE : ENABLE_ENABLE_Field := NRF_SVD.PWM.Disabled; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for ENABLE_Register use record ENABLE at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Selects up or up and down as wave counter mode type MODE_UPDOWN_Field is (-- Up counter - edge aligned PWM duty-cycle Up, -- Up and down counter - center aligned PWM duty cycle Upanddown) with Size => 1; for MODE_UPDOWN_Field use (Up => 0, Upanddown => 1); -- Selects operating mode of the wave counter type MODE_Register is record -- Selects up or up and down as wave counter mode UPDOWN : MODE_UPDOWN_Field := NRF_SVD.PWM.Up; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MODE_Register use record UPDOWN at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; subtype COUNTERTOP_COUNTERTOP_Field is HAL.UInt15; -- Value up to which the pulse generator counter counts type COUNTERTOP_Register is record -- Value up to which the pulse generator counter counts. This register -- is ignored when DECODER.MODE=WaveForm and only values from RAM will -- be used. COUNTERTOP : COUNTERTOP_COUNTERTOP_Field := 16#3FF#; -- unspecified Reserved_15_31 : HAL.UInt17 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for COUNTERTOP_Register use record COUNTERTOP at 0 range 0 .. 14; Reserved_15_31 at 0 range 15 .. 31; end record; -- Pre-scaler of PWM_CLK type PRESCALER_PRESCALER_Field is (-- Divide by 1 (16MHz) Div_1, -- Divide by 2 ( 8MHz) Div_2, -- Divide by 4 ( 4MHz) Div_4, -- Divide by 8 ( 2MHz) Div_8, -- Divide by 16 ( 1MHz) Div_16, -- Divide by 32 ( 500kHz) Div_32, -- Divide by 64 ( 250kHz) Div_64, -- Divide by 128 ( 125kHz) Div_128) with Size => 3; for PRESCALER_PRESCALER_Field use (Div_1 => 0, Div_2 => 1, Div_4 => 2, Div_8 => 3, Div_16 => 4, Div_32 => 5, Div_64 => 6, Div_128 => 7); -- Configuration for PWM_CLK type PRESCALER_Register is record -- Pre-scaler of PWM_CLK PRESCALER : PRESCALER_PRESCALER_Field := NRF_SVD.PWM.Div_1; -- unspecified Reserved_3_31 : HAL.UInt29 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PRESCALER_Register use record PRESCALER at 0 range 0 .. 2; Reserved_3_31 at 0 range 3 .. 31; end record; -- How a sequence is read from RAM and spread to the compare register type DECODER_LOAD_Field is (-- 1st half word (16-bit) used in all PWM channels 0..3 Common, -- 1st half word (16-bit) used in channel 0..1; 2nd word in channel 2..3 Grouped, -- 1st half word (16-bit) in ch.0; 2nd in ch.1; ...; 4th in ch.3 Individual, -- 1st half word (16-bit) in ch.0; 2nd in ch.1; ...; 4th in COUNTERTOP Waveform) with Size => 2; for DECODER_LOAD_Field use (Common => 0, Grouped => 1, Individual => 2, Waveform => 3); -- Selects source for advancing the active sequence type DECODER_MODE_Field is (-- SEQ[n].REFRESH is used to determine loading internal compare registers Refreshcount, -- NEXTSTEP task causes a new value to be loaded to internal compare registers Nextstep) with Size => 1; for DECODER_MODE_Field use (Refreshcount => 0, Nextstep => 1); -- Configuration of the decoder type DECODER_Register is record -- How a sequence is read from RAM and spread to the compare register LOAD : DECODER_LOAD_Field := NRF_SVD.PWM.Common; -- unspecified Reserved_2_7 : HAL.UInt6 := 16#0#; -- Selects source for advancing the active sequence MODE : DECODER_MODE_Field := NRF_SVD.PWM.Refreshcount; -- unspecified Reserved_9_31 : HAL.UInt23 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DECODER_Register use record LOAD at 0 range 0 .. 1; Reserved_2_7 at 0 range 2 .. 7; MODE at 0 range 8 .. 8; Reserved_9_31 at 0 range 9 .. 31; end record; -- Amount of playback of pattern cycles type LOOP_CNT_Field is (-- Looping disabled (stop at the end of the sequence) Disabled) with Size => 16; for LOOP_CNT_Field use (Disabled => 0); -- Amount of playback of a loop type LOOP_Register is record -- Amount of playback of pattern cycles CNT : LOOP_CNT_Field := NRF_SVD.PWM.Disabled; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for LOOP_Register use record CNT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; --------------------------------- -- PWM_SEQ cluster's Registers -- --------------------------------- -- Amount of values (duty cycles) in this sequence type CNT_CNT_Field is (-- Sequence is disabled, and shall not be started as it is empty Disabled) with Size => 15; for CNT_CNT_Field use (Disabled => 0); -- Description cluster[0]: Amount of values (duty cycles) in this sequence type CNT_SEQ_Register is record -- Amount of values (duty cycles) in this sequence CNT : CNT_CNT_Field := NRF_SVD.PWM.Disabled; -- unspecified Reserved_15_31 : HAL.UInt17 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CNT_SEQ_Register use record CNT at 0 range 0 .. 14; Reserved_15_31 at 0 range 15 .. 31; end record; -- Amount of additional PWM periods between samples loaded into compare -- register (load every REFRESH.CNT+1 PWM periods) type REFRESH_CNT_Field is (-- Update every PWM period Continuous, -- Reset value for the field Refresh_Cnt_Field_Reset) with Size => 24; for REFRESH_CNT_Field use (Continuous => 0, Refresh_Cnt_Field_Reset => 1); -- Description cluster[0]: Amount of additional PWM periods between samples -- loaded into compare register type REFRESH_SEQ_Register is record -- Amount of additional PWM periods between samples loaded into compare -- register (load every REFRESH.CNT+1 PWM periods) CNT : REFRESH_CNT_Field := Refresh_Cnt_Field_Reset; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for REFRESH_SEQ_Register use record CNT at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype ENDDELAY_SEQ_CNT_Field is HAL.UInt24; -- Description cluster[0]: Time added after the sequence type ENDDELAY_SEQ_Register is record -- Time added after the sequence in PWM periods CNT : ENDDELAY_SEQ_CNT_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for ENDDELAY_SEQ_Register use record CNT at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Unspecified type PWM_SEQ_Cluster is record -- Description cluster[0]: Beginning address in Data RAM of this -- sequence PTR : aliased HAL.UInt32; -- Description cluster[0]: Amount of values (duty cycles) in this -- sequence CNT : aliased CNT_SEQ_Register; -- Description cluster[0]: Amount of additional PWM periods between -- samples loaded into compare register REFRESH : aliased REFRESH_SEQ_Register; -- Description cluster[0]: Time added after the sequence ENDDELAY : aliased ENDDELAY_SEQ_Register; end record with Size => 128; for PWM_SEQ_Cluster use record PTR at 16#0# range 0 .. 31; CNT at 16#4# range 0 .. 31; REFRESH at 16#8# range 0 .. 31; ENDDELAY at 16#C# range 0 .. 31; end record; -- Unspecified type PWM_SEQ_Clusters is array (0 .. 1) of PWM_SEQ_Cluster; ---------------------------------- -- PWM_PSEL cluster's Registers -- ---------------------------------- subtype OUT_PSEL_PIN_Field is HAL.UInt5; -- Connection type OUT_CONNECT_Field is (-- Connect Connected, -- Disconnect Disconnected) with Size => 1; for OUT_CONNECT_Field use (Connected => 0, Disconnected => 1); -- Description collection[0]: Output pin select for PWM channel 0 type OUT_PSEL_Register is record -- Pin number PIN : OUT_PSEL_PIN_Field := 16#1F#; -- unspecified Reserved_5_30 : HAL.UInt26 := 16#3FFFFFF#; -- Connection CONNECT : OUT_CONNECT_Field := NRF_SVD.PWM.Disconnected; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for OUT_PSEL_Register use record PIN at 0 range 0 .. 4; Reserved_5_30 at 0 range 5 .. 30; CONNECT at 0 range 31 .. 31; end record; -- Description collection[0]: Output pin select for PWM channel 0 type OUT_PSEL_Registers is array (0 .. 3) of OUT_PSEL_Register; -- Unspecified type PWM_PSEL_Cluster is record -- Description collection[0]: Output pin select for PWM channel 0 OUT_k : aliased OUT_PSEL_Registers; end record with Size => 128; for PWM_PSEL_Cluster use record OUT_k at 0 range 0 .. 127; end record; --------------------------------- -- PWM_SEQ cluster's Registers -- --------------------------------- ---------------------------------- -- PWM_PSEL cluster's Registers -- ---------------------------------- --------------------------------- -- PWM_SEQ cluster's Registers -- --------------------------------- ---------------------------------- -- PWM_PSEL cluster's Registers -- ---------------------------------- ----------------- -- Peripherals -- ----------------- -- Pulse Width Modulation Unit 0 type PWM_Peripheral is record -- Stops PWM pulse generation on all channels at the end of current PWM -- period, and stops sequence playback TASKS_STOP : aliased HAL.UInt32; -- Description collection[0]: Loads the first PWM value on all enabled -- channels from sequence 0, and starts playing that sequence at the -- rate defined in SEQ[0]REFRESH and/or DECODER.MODE. Causes PWM -- generation to start it was not running. TASKS_SEQSTART : aliased TASKS_SEQSTART_Registers; -- Steps by one value in the current sequence on all enabled channels if -- DECODER.MODE=NextStep. Does not cause PWM generation to start it was -- not running. TASKS_NEXTSTEP : aliased HAL.UInt32; -- Response to STOP task, emitted when PWM pulses are no longer -- generated EVENTS_STOPPED : aliased HAL.UInt32; -- Description collection[0]: First PWM period started on sequence 0 EVENTS_SEQSTARTED : aliased EVENTS_SEQSTARTED_Registers; -- Description collection[0]: Emitted at end of every sequence 0, when -- last value from RAM has been applied to wave counter EVENTS_SEQEND : aliased EVENTS_SEQEND_Registers; -- Emitted at the end of each PWM period EVENTS_PWMPERIODEND : aliased HAL.UInt32; -- Concatenated sequences have been played the amount of times defined -- in LOOP.CNT EVENTS_LOOPSDONE : aliased HAL.UInt32; -- Shortcut register SHORTS : aliased SHORTS_Register; -- Enable or disable interrupt INTEN : aliased INTEN_Register; -- Enable interrupt INTENSET : aliased INTENSET_Register; -- Disable interrupt INTENCLR : aliased INTENCLR_Register; -- PWM module enable register ENABLE : aliased ENABLE_Register; -- Selects operating mode of the wave counter MODE : aliased MODE_Register; -- Value up to which the pulse generator counter counts COUNTERTOP : aliased COUNTERTOP_Register; -- Configuration for PWM_CLK PRESCALER : aliased PRESCALER_Register; -- Configuration of the decoder DECODER : aliased DECODER_Register; -- Amount of playback of a loop LOOP_k : aliased LOOP_Register; -- Unspecified SEQ : aliased PWM_SEQ_Clusters; -- Unspecified PSEL : aliased PWM_PSEL_Cluster; end record with Volatile; for PWM_Peripheral use record TASKS_STOP at 16#4# range 0 .. 31; TASKS_SEQSTART at 16#8# range 0 .. 63; TASKS_NEXTSTEP at 16#10# range 0 .. 31; EVENTS_STOPPED at 16#104# range 0 .. 31; EVENTS_SEQSTARTED at 16#108# range 0 .. 63; EVENTS_SEQEND at 16#110# range 0 .. 63; EVENTS_PWMPERIODEND at 16#118# range 0 .. 31; EVENTS_LOOPSDONE at 16#11C# range 0 .. 31; SHORTS at 16#200# range 0 .. 31; INTEN at 16#300# range 0 .. 31; INTENSET at 16#304# range 0 .. 31; INTENCLR at 16#308# range 0 .. 31; ENABLE at 16#500# range 0 .. 31; MODE at 16#504# range 0 .. 31; COUNTERTOP at 16#508# range 0 .. 31; PRESCALER at 16#50C# range 0 .. 31; DECODER at 16#510# range 0 .. 31; LOOP_k at 16#514# range 0 .. 31; SEQ at 16#520# range 0 .. 255; PSEL at 16#560# range 0 .. 127; end record; -- Pulse Width Modulation Unit 0 PWM0_Periph : aliased PWM_Peripheral with Import, Address => PWM0_Base; -- Pulse Width Modulation Unit 1 PWM1_Periph : aliased PWM_Peripheral with Import, Address => PWM1_Base; -- Pulse Width Modulation Unit 2 PWM2_Periph : aliased PWM_Peripheral with Import, Address => PWM2_Base; end NRF_SVD.PWM;
as1.ads
twinbee/dekkerAda
0
29638
--------------------------------------------------------------- -- SPECIFICATIONS FILE --------------------------------------------------------------- -- Author: <NAME> --- -- Class: CSC410 Burgess --- -- Date: 09-01-04 Modified: 9-02-04 --- -- Desc: Assignment 1:DEKKER's ALGORITHM --- -- a simple implementation of --- -- Dekker's algorithm which describes mutual exclusion for --- -- two processes (TASKS) assuming fair hardware. --- -- Dekker's algorithm as described in --- -- "Algorithms for Mutual Exclusion", <NAME> --- -- MIT PRESS Cambridge, 1974 ISBN: 0-262-18119-3 --- ---------------------------------------------------------------- PACKAGE as1 IS --package for assignment #1, dekkers algorithm PROCEDURE dekker; END as1;
programs/oeis/027/A027789.asm
neoneye/loda
22
83470
<gh_stars>10-100 ; A027789: a(n) = 2*(n+1)*binomial(n+3,4). ; 4,30,120,350,840,1764,3360,5940,9900,15730,24024,35490,50960,71400,97920,131784,174420,227430,292600,371910,467544,581900,717600,877500,1064700,1282554,1534680,1824970,2157600,2537040,2968064,3455760,4005540,4623150,5314680,6086574,6945640,7899060,8954400,10119620,11403084,12813570,14360280,16052850,17901360,19916344,22108800,24490200,27072500,29868150,32890104,36151830,39667320,43451100,47518240,51884364,56565660,61578890,66941400,72671130,78786624,85307040,92252160,99642400,107498820,115843134,124697720,134085630,144030600,154557060,165690144,177455700,189880300,202991250,216816600,231385154,246726480,262870920,279849600,297694440,316438164,336114310,356757240,378402150,401085080,424842924,449713440,475735260,502947900,531391770,561108184,592139370,624528480,658319600,693557760,730288944,768560100,808419150,849915000,893097550 add $0,4 mov $1,$0 sub $0,2 bin $1,4 mul $0,$1 mul $0,2
testsuite/tests/virtual_file_system/src/tc_simple_mount.adb
morbos/Ada_Drivers_Library
2
19229
<reponame>morbos/Ada_Drivers_Library<filename>testsuite/tests/virtual_file_system/src/tc_simple_mount.adb<gh_stars>1-10 with Ada.Text_IO; use Ada.Text_IO; with Native.Filesystem; use Native.Filesystem; with Virtual_File_System; use Virtual_File_System; with Helpers; use Helpers; procedure TC_Simple_Mount is Strict_Mode : constant Boolean := False; -- Debug switch to enable strict mode. Currently, non-strict mode avoids -- calls that are more or less expected to fail. VFS : Virtual_File_System.VFS; HFS : Native_FS_Driver_Ref := Create ("one_file"); begin Put_Line ("Dumping the ""one_file"" mounted as /one_file:"); Test (VFS.Mount ("one_file", HFS.all'Access)); Dump (VFS, "/"); -- Unmounting is not implemented yet if Strict_Mode then Test (VFS.Umount ("one_file")); end if; Destroy (HFS); Put_Line ("Done."); end TC_Simple_Mount;
examples/NoSig.agda
JoeyEremondi/lambda-pi-constraint
16
1099
module NoSig where open import Data.Nat myFun : ℕ myFun = (\ x y -> y ) (\ x -> x) 0
csc470/1.asm
seagoj/cs_notes
0
163498
; name: <NAME> ; class: csc 470 ; program: one ; description: Intel Assembly Language implementation of a Simplified Instructional Computer (SIC) one-pass assember. ; c470d1.txt ;SAMPLE START 4 START OF PROGRAM ;DOG WORD 5 # OF DOGS ;CAT WORD 7 # OF CATS ;ANIMAL RESW 1 # OF ANIMALS ;* ;FIRST LDA DOG LOAD DOG ; ADD CAT ADD CAT ; STA ANIMAL STORE IN ANIMAL ; RSUB ;LAST END FIRST END OF PROGRAM ; PSEUDO C++ :infile.open("a:c470d1.txt"); :if error : cout>>"Error: Cannot open file."<<endl; ;else ;{ : // input buffer here (1000 chars) ; // output heading ; cout<<"ADDRESS OBJECT ERROR SYMBOL OPCODE OPERAND COMMENTS"; ; cout<<endl<<endl; ; do ; { ; // input symbol, opcode, operand, and comments from buffer into inbuf (52 chars) ; infile>inbuf; ; // output 30 spaces, symbol, operand and comments (82 chars) ; cout<<outbuf ; } while opcode != "End "; ;} ;infile.close(); INCLUDE Irvine32.inc .data ;variable dictionary buffer BYTE 1000 dup(?) ;buffer bsize =($-buffer) ;buffer size outbuf BYTE 82 dup(' '),0 ;output buffer inbuf =(outbuf+30) ;input buffer symbol =(inbuf+0) ;symbol value of current row opcode =(inbuf+10) ;opcode value of current row operand =(inbuf+20) ;operand value of current row endcode BYTE 'END ' ;endcode value of current row errmsg BYTE "SIC Error: Cannot open file.",0dh,0ah0 ;error message if Createfile fails fname BYTE "c470d1.txt",0 ;file name fhandle DWORD ? ;file handle bcount DWORD ? ;? blank10 BYTE 10 dup(' '),0 ;string of 10 blanks heading BYTE 'ADDRESS OBJECT ERROR SYMBOL OPCODE OPERAND COMMENTS',0dh,0ah,0ah,0 ;heading string ;**MACROS** cmpstring macro string1,string2,num push ecx ;store register values push esi push edi ;set counter to length of strings cld mov ecx,num mov esi,offset string1 ;move strings into esi and edi mov edi,offset string2 repe cmpsb ;compare esi to edi pop edi ;restore original values pop esi pop ecx endm movto macro string2,num push ecx ;store register values push edi cld ;clear direction flag mov ecx,num ;set counter to number of characters per line mov edi,offset string2 ;move line into edi 1 char at a time rep movsb pop edi ;restore register values pop ecx endm ;**CODE** .code main PROC ;Create file for reading INVOKE Createfile, ADDR fname, GENERIC_READ, DO_NOT_SHARE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 mov fhandle,eax ; set file handle .if eax == INVALID_HANDLE_VALUE ;if Createfile fails mov edx,offset errmsg ;output errmsg call writestring .else mov edx,offset heading ;output heading call writestring INVOKE ReadFile,fhandle,ADDR buffer,1000,ADDR bcount,0 ;read from file put into buffer mov esi, offset buffer ;load buffer as string source .repeat ;repeat until opcode == endcode movto inbuf,52 ;extract line from file mov edx,offset outbuf ;output outbuf call writestring cmpstring opcode, endcode, 10 ;check to see if opcode == endcode .until ZERO? .endif INVOKE CloseHandle,fhandle ;close file INVOKE ExitProcess,0 ;close process main endp END main
test/epic/Prelude/String.agda
redfish64/autonomic-agda
0
1952
<filename>test/epic/Prelude/String.agda module Prelude.String where open import Prelude.Bool open import Prelude.Char open import Prelude.List open import Prelude.Nat postulate String : Set nil : String primStringToNat : String → Nat charToString : Char -> String {-# BUILTIN STRING String #-} primitive primStringAppend : String → String → String primStringToList : String → List Char primStringFromList : List Char → String primStringEquality : String → String → Bool {-# COMPILED_EPIC nil () -> String = "" #-} {-# COMPILED_EPIC primStringToNat (s : String) -> BigInt = foreign BigInt "strToBigInt" (s : String) #-} -- {-# COMPILED_EPIC charToString (c : Int) -> String = charToString(c) #-} strEq : (x y : String) -> Bool strEq = primStringEquality infixr 30 _+S+_ _+S+_ : (x y : String) -> String _+S+_ = primStringAppend fromList : List Char -> String fromList = primStringFromList fromString : String -> List Char fromString = primStringToList
test/Common/Sum.agda
cruhland/agda
1,989
11292
<filename>test/Common/Sum.agda<gh_stars>1000+ module Common.Sum where open import Common.Level data _⊎_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where inj₁ : (x : A) → A ⊎ B inj₂ : (y : B) → A ⊎ B [_,_] : ∀ {a b c} {A : Set a} {B : Set b} {C : A ⊎ B → Set c} → ((x : A) → C (inj₁ x)) → ((x : B) → C (inj₂ x)) → ((x : A ⊎ B) → C x) [ f , g ] (inj₁ x) = f x [ f , g ] (inj₂ y) = g y
Palmtree.Math.Core.Implements/vs_build/x64_Debug/TEST_op_Clone.asm
rougemeilland/Palmtree.Math.Core.Implements
0
169143
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1 include listing.inc INCLUDELIB MSVCRTD INCLUDELIB OLDNAMES msvcjmc SEGMENT __7B7A869E_ctype@h DB 01H __457DD326_basetsd@h DB 01H __4384A2D9_corecrt_memcpy_s@h DB 01H __4E51A221_corecrt_wstring@h DB 01H __2140C079_string@h DB 01H __1887E595_winnt@h DB 01H __9FC7C64B_processthreadsapi@h DB 01H __FA470AEC_memoryapi@h DB 01H __F37DAFF1_winerror@h DB 01H __7A450CCC_winbase@h DB 01H __B4B40122_winioctl@h DB 01H __86261D59_stralign@h DB 01H __1C66ECB2_pmc_debug@h DB 01H __ECEB366B_test_op_clone@c DB 01H msvcjmc ENDS PUBLIC TEST_PMC_Clone_X PUBLIC __JustMyCode_Default PUBLIC ??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@ ; `string' PUBLIC ??_C@_1CI@HEENINPI@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ ; `string' PUBLIC ??_C@_1DO@KAMAINPL@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ ; `string' PUBLIC ??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@ ; `string' PUBLIC ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ ; `string' EXTRN TEST_Assert:PROC EXTRN FormatTestLabel:PROC EXTRN FormatTestMesssage:PROC EXTRN _RTC_CheckStackVars:PROC EXTRN _RTC_InitBase:PROC EXTRN _RTC_Shutdown:PROC EXTRN __CheckForDebuggerJustMyCode:PROC EXTRN __GSHandlerCheck:PROC EXTRN __security_check_cookie:PROC EXTRN __security_cookie:QWORD ; COMDAT pdata pdata SEGMENT $pdata$TEST_PMC_Clone_X DD imagerel $LN13 DD imagerel $LN13+713 DD imagerel $unwind$TEST_PMC_Clone_X pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$_EQUALS_MEMORY DD imagerel _EQUALS_MEMORY DD imagerel _EQUALS_MEMORY+198 DD imagerel $unwind$_EQUALS_MEMORY pdata ENDS ; COMDAT rtc$TMZ rtc$TMZ SEGMENT _RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown rtc$TMZ ENDS ; COMDAT rtc$IMZ rtc$IMZ SEGMENT _RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase rtc$IMZ ENDS ; COMDAT ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ CONST SEGMENT ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ DB 0c7H DB '0', 0fcH, '0', 0bfH, '0n0', 085H, 'Q', 0b9H, '[L0', 00H, 'N', 0f4H DB 081H, 'W0j0D0', 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@ CONST SEGMENT ??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@ DB 'P' DB 00H, 'M', 00H, 'C', 00H, '_', 00H, 'T', 00H, 'o', 00H, 'B', 00H DB 'y', 00H, 't', 00H, 'e', 00H, 'A', 00H, 'r', 00H, 'r', 00H, 'a' DB 00H, 'y', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH, '0', 0c9H, '0' DB 'L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH, '0g0o0j0D0(', 00H DB '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1DO@KAMAINPL@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ CONST SEGMENT ??_C@_1DO@KAMAINPL@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ DB 'P' DB 00H, 'M', 00H, 'C', 00H, '_', 00H, 'C', 00H, 'l', 00H, 'o', 00H DB 'n', 00H, 'e', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_0^', 0b3H DB '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH DB '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CI@HEENINPI@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ CONST SEGMENT ??_C@_1CI@HEENINPI@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ DB 'P' DB 00H, 'M', 00H, 'C', 00H, '_', 00H, 'C', 00H, 'l', 00H, 'o', 00H DB 'n', 00H, 'e', 00H, '_', 00H, 'X', 00H, ' ', 00H, '(', 00H, '%' DB 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@ CONST SEGMENT ??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@ DB 'P' DB 00H, 'M', 00H, 'C', 00H, '_', 00H, 'F', 00H, 'r', 00H, 'o', 00H DB 'm', 00H, 'B', 00H, 'y', 00H, 't', 00H, 'e', 00H, 'A', 00H, 'r' DB 00H, 'r', 00H, 'a', 00H, 'y', 00H, 'n0', 0a9H, '_0^', 0b3H, '0' DB 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH DB '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT xdata xdata SEGMENT $unwind$_EQUALS_MEMORY DD 025053901H DD 011d2322H DD 07016001dH DD 05015H xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$TEST_PMC_Clone_X DD 025054a19H DD 011d2322H DD 07016005bH DD 05015H DD imagerel __GSHandlerCheck DD 02c0H xdata ENDS ; COMDAT CONST CONST SEGMENT TEST_PMC_Clone_X$rtcName$0 DB 078H DB 00H ORG $+2 TEST_PMC_Clone_X$rtcName$1 DB 06fH DB 00H ORG $+2 TEST_PMC_Clone_X$rtcName$2 DB 061H DB 063H DB 074H DB 075H DB 061H DB 06cH DB 05fH DB 06fH DB 05fH DB 062H DB 075H DB 066H DB 00H ORG $+3 TEST_PMC_Clone_X$rtcName$3 DB 061H DB 063H DB 074H DB 075H DB 061H DB 06cH DB 05fH DB 06fH DB 05fH DB 062H DB 075H DB 066H DB 05fH DB 073H DB 069H DB 07aH DB 065H DB 00H ORG $+6 TEST_PMC_Clone_X$rtcVarDesc DD 0188H DD 08H DQ FLAT:TEST_PMC_Clone_X$rtcName$3 DD 070H DD 0100H DQ FLAT:TEST_PMC_Clone_X$rtcName$2 DD 048H DD 08H DQ FLAT:TEST_PMC_Clone_X$rtcName$1 DD 028H DD 08H DQ FLAT:TEST_PMC_Clone_X$rtcName$0 ORG $+192 TEST_PMC_Clone_X$rtcFrameData DD 04H DD 00H DQ FLAT:TEST_PMC_Clone_X$rtcVarDesc CONST ENDS ; Function compile flags: /Odt ; COMDAT __JustMyCode_Default _TEXT SEGMENT __JustMyCode_Default PROC ; COMDAT ret 0 __JustMyCode_Default ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_debug.h ; COMDAT _EQUALS_MEMORY _TEXT SEGMENT buffer1$ = 224 count1$ = 232 buffer2$ = 240 count2$ = 248 _EQUALS_MEMORY PROC ; COMDAT ; 155 : { mov QWORD PTR [rsp+32], r9 mov QWORD PTR [rsp+24], r8 mov QWORD PTR [rsp+16], rdx mov QWORD PTR [rsp+8], rcx push rbp push rdi sub rsp, 232 ; 000000e8H lea rbp, QWORD PTR [rsp+32] mov rdi, rsp mov ecx, 58 ; 0000003aH mov eax, -858993460 ; ccccccccH rep stosd mov rcx, QWORD PTR [rsp+264] lea rcx, OFFSET FLAT:__1C66ECB2_pmc_debug@h call __CheckForDebuggerJustMyCode ; 156 : if (count1 != count2) mov rax, QWORD PTR count2$[rbp] cmp QWORD PTR count1$[rbp], rax je SHORT $LN4@EQUALS_MEM ; 157 : return (-1); mov eax, -1 jmp SHORT $LN1@EQUALS_MEM $LN4@EQUALS_MEM: $LN2@EQUALS_MEM: ; 158 : while (count1 > 0) cmp QWORD PTR count1$[rbp], 0 jbe SHORT $LN3@EQUALS_MEM ; 159 : { ; 160 : if (*buffer1 != *buffer2) mov rax, QWORD PTR buffer1$[rbp] movzx eax, BYTE PTR [rax] mov rcx, QWORD PTR buffer2$[rbp] movzx ecx, BYTE PTR [rcx] cmp eax, ecx je SHORT $LN5@EQUALS_MEM ; 161 : return (-1); mov eax, -1 jmp SHORT $LN1@EQUALS_MEM $LN5@EQUALS_MEM: ; 162 : ++buffer1; mov rax, QWORD PTR buffer1$[rbp] inc rax mov QWORD PTR buffer1$[rbp], rax ; 163 : ++buffer2; mov rax, QWORD PTR buffer2$[rbp] inc rax mov QWORD PTR buffer2$[rbp], rax ; 164 : --count1; mov rax, QWORD PTR count1$[rbp] dec rax mov QWORD PTR count1$[rbp], rax ; 165 : } jmp SHORT $LN2@EQUALS_MEM $LN3@EQUALS_MEM: ; 166 : return (0); xor eax, eax $LN1@EQUALS_MEM: ; 167 : } lea rsp, QWORD PTR [rbp+200] pop rdi pop rbp ret 0 _EQUALS_MEMORY ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\test_op_clone.c ; COMDAT TEST_PMC_Clone_X _TEXT SEGMENT x$ = 8 o$ = 40 actual_o_buf$ = 80 actual_o_buf_size$ = 360 result$ = 388 x_result$ = 420 o_result$ = 452 tv157 = 660 tv142 = 660 tv91 = 660 tv74 = 660 tv131 = 664 tv82 = 664 tv64 = 664 __$ArrayPad$ = 672 env$ = 720 ep$ = 728 no$ = 736 x_buf$ = 744 x_buf_size$ = 752 desired_o_buf$ = 760 desired_o_buf_size$ = 768 TEST_PMC_Clone_X PROC ; COMDAT ; 40 : { $LN13: mov QWORD PTR [rsp+32], r9 mov DWORD PTR [rsp+24], r8d mov QWORD PTR [rsp+16], rdx mov QWORD PTR [rsp+8], rcx push rbp push rdi sub rsp, 728 ; 000002d8H lea rbp, QWORD PTR [rsp+32] mov rdi, rsp mov ecx, 182 ; 000000b6H mov eax, -858993460 ; ccccccccH rep stosd mov rcx, QWORD PTR [rsp+760] mov rax, QWORD PTR __security_cookie xor rax, rbp mov QWORD PTR __$ArrayPad$[rbp], rax lea rcx, OFFSET FLAT:__ECEB366B_test_op_clone@c call __CheckForDebuggerJustMyCode ; 41 : HANDLE x; ; 42 : HANDLE o; ; 43 : unsigned char actual_o_buf[256]; ; 44 : size_t actual_o_buf_size; ; 45 : PMC_STATUS_CODE result; ; 46 : PMC_STATUS_CODE x_result; ; 47 : PMC_STATUS_CODE o_result; ; 48 : TEST_Assert(env, FormatTestLabel(L"PMC_Clone_X (%d.%d)", no, 1), (x_result = ep->PMC_FromByteArray(x_buf, x_buf_size, &x)) == PMC_STATUS_OK, FormatTestMesssage(L"PMC_FromByteArrayの復帰コードが期待通りではない(%d)", x_result)); lea r8, QWORD PTR x$[rbp] mov rdx, QWORD PTR x_buf_size$[rbp] mov rcx, QWORD PTR x_buf$[rbp] mov rax, QWORD PTR ep$[rbp] call QWORD PTR [rax+48] mov DWORD PTR x_result$[rbp], eax cmp DWORD PTR x_result$[rbp], 0 jne SHORT $LN5@TEST_PMC_C mov DWORD PTR tv74[rbp], 1 jmp SHORT $LN6@TEST_PMC_C $LN5@TEST_PMC_C: mov DWORD PTR tv74[rbp], 0 $LN6@TEST_PMC_C: mov edx, DWORD PTR x_result$[rbp] lea rcx, OFFSET FLAT:??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@ call FormatTestMesssage mov QWORD PTR tv64[rbp], rax mov r8d, 1 mov edx, DWORD PTR no$[rbp] lea rcx, OFFSET FLAT:??_C@_1CI@HEENINPI@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call FormatTestLabel mov rcx, QWORD PTR tv64[rbp] mov r9, rcx mov r8d, DWORD PTR tv74[rbp] mov rdx, rax mov rcx, QWORD PTR env$[rbp] call TEST_Assert ; 49 : TEST_Assert(env, FormatTestLabel(L"PMC_Clone_X (%d.%d)", no, 2), (o_result = ep->PMC_Clone_X(x, &o)) == PMC_STATUS_OK, FormatTestMesssage(L"PMC_Clone_Xの復帰コードが期待通りではない(%d)", o_result)); lea rdx, QWORD PTR o$[rbp] mov rcx, QWORD PTR x$[rbp] mov rax, QWORD PTR ep$[rbp] call QWORD PTR [rax+64] mov DWORD PTR o_result$[rbp], eax cmp DWORD PTR o_result$[rbp], 0 jne SHORT $LN7@TEST_PMC_C mov DWORD PTR tv91[rbp], 1 jmp SHORT $LN8@TEST_PMC_C $LN7@TEST_PMC_C: mov DWORD PTR tv91[rbp], 0 $LN8@TEST_PMC_C: mov edx, DWORD PTR o_result$[rbp] lea rcx, OFFSET FLAT:??_C@_1DO@KAMAINPL@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ call FormatTestMesssage mov QWORD PTR tv82[rbp], rax mov r8d, 2 mov edx, DWORD PTR no$[rbp] lea rcx, OFFSET FLAT:??_C@_1CI@HEENINPI@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call FormatTestLabel mov rcx, QWORD PTR tv82[rbp] mov r9, rcx mov r8d, DWORD PTR tv91[rbp] mov rdx, rax mov rcx, QWORD PTR env$[rbp] call TEST_Assert ; 50 : TEST_Assert(env, FormatTestLabel(L"PMC_Clone_X (%d.%d)", no, 3), (result = ep->PMC_ToByteArray(o, actual_o_buf, sizeof(actual_o_buf), &actual_o_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"PMC_ToByteArrayの復帰コードが期待通りではない(%d)", result)); lea r9, QWORD PTR actual_o_buf_size$[rbp] mov r8d, 256 ; 00000100H lea rdx, QWORD PTR actual_o_buf$[rbp] mov rcx, QWORD PTR o$[rbp] mov rax, QWORD PTR ep$[rbp] call QWORD PTR [rax+56] mov DWORD PTR result$[rbp], eax cmp DWORD PTR result$[rbp], 0 jne SHORT $LN9@TEST_PMC_C mov DWORD PTR tv142[rbp], 1 jmp SHORT $LN10@TEST_PMC_C $LN9@TEST_PMC_C: mov DWORD PTR tv142[rbp], 0 $LN10@TEST_PMC_C: mov edx, DWORD PTR result$[rbp] lea rcx, OFFSET FLAT:??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@ call FormatTestMesssage mov QWORD PTR tv131[rbp], rax mov r8d, 3 mov edx, DWORD PTR no$[rbp] lea rcx, OFFSET FLAT:??_C@_1CI@HEENINPI@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call FormatTestLabel mov rcx, QWORD PTR tv131[rbp] mov r9, rcx mov r8d, DWORD PTR tv142[rbp] mov rdx, rax mov rcx, QWORD PTR env$[rbp] call TEST_Assert ; 51 : TEST_Assert(env, FormatTestLabel(L"PMC_Clone_X (%d.%d)", no, 4), _EQUALS_MEMORY(actual_o_buf, actual_o_buf_size, desired_o_buf, desired_o_buf_size) == 0, L"データの内容が一致しない"); mov r9, QWORD PTR desired_o_buf_size$[rbp] mov r8, QWORD PTR desired_o_buf$[rbp] mov rdx, QWORD PTR actual_o_buf_size$[rbp] lea rcx, QWORD PTR actual_o_buf$[rbp] call _EQUALS_MEMORY test eax, eax jne SHORT $LN11@TEST_PMC_C mov DWORD PTR tv157[rbp], 1 jmp SHORT $LN12@TEST_PMC_C $LN11@TEST_PMC_C: mov DWORD PTR tv157[rbp], 0 $LN12@TEST_PMC_C: mov r8d, 4 mov edx, DWORD PTR no$[rbp] lea rcx, OFFSET FLAT:??_C@_1CI@HEENINPI@?$AAP?$AAM?$AAC?$AA_?$AAC?$AAl?$AAo?$AAn?$AAe?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call FormatTestLabel lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov r8d, DWORD PTR tv157[rbp] mov rdx, rax mov rcx, QWORD PTR env$[rbp] call TEST_Assert ; 52 : if (o_result == PMC_STATUS_OK) cmp DWORD PTR o_result$[rbp], 0 jne SHORT $LN2@TEST_PMC_C ; 53 : ep->PMC_Dispose(o); mov rcx, QWORD PTR o$[rbp] mov rax, QWORD PTR ep$[rbp] call QWORD PTR [rax+32] $LN2@TEST_PMC_C: ; 54 : if (x_result == PMC_STATUS_OK) cmp DWORD PTR x_result$[rbp], 0 jne SHORT $LN3@TEST_PMC_C ; 55 : ep->PMC_Dispose(x); mov rcx, QWORD PTR x$[rbp] mov rax, QWORD PTR ep$[rbp] call QWORD PTR [rax+32] $LN3@TEST_PMC_C: ; 56 : } lea rcx, QWORD PTR [rbp-32] lea rdx, OFFSET FLAT:TEST_PMC_Clone_X$rtcFrameData call _RTC_CheckStackVars mov rcx, QWORD PTR __$ArrayPad$[rbp] xor rcx, rbp call __security_check_cookie lea rsp, QWORD PTR [rbp+696] pop rdi pop rbp ret 0 TEST_PMC_Clone_X ENDP _TEXT ENDS END
spec.als
Ask-UFCG/projeto-novo-spec
0
32
<reponame>Ask-UFCG/projeto-novo-spec module spec abstract sig Base { autor: one Usuario, likes: Int, dislikes: Int, conteudo: one Conteudo } sig Questao extends Base { respostas: set Resposta, titulo: one Titulo } sig Titulo{} sig Conteudo{} sig Resposta extends Base { comentarios: set Comentario } sig Usuario{} sig Comentario extends Base {} pred likesNaoNegativos[b:Base] { b.likes >= 0 } pred dislikesNaoNegativos[b:Base] { b.dislikes >= 0 } pred umTituloPorQuestao[t:Titulo] { one t.~titulo } pred umConteudoPorEntidade[c:Conteudo] { one c.~conteudo } pred questoesSemRespostasIguais[q1:Questao,q2:Questao] { (q1 != q2) implies (#(q1.respostas & q2.respostas) = 0) } pred respostasSemComentariosIguais[r1:Resposta,r2:Resposta] { (r1 != r2) implies (#(r1.comentarios & r2.comentarios) = 0) } pred comentarioSempreEmUmaResposta[c:Comentario,r:Resposta] { c in r.comentarios } pred respsoraSempreEmUmaQuestao[r:Resposta,q:Questao] { r in q.respostas } fact { all b:Base | dislikesNaoNegativos[b] all b:Base | likesNaoNegativos[b] all t:Titulo | umTituloPorQuestao[t] all c:Conteudo | umConteudoPorEntidade[c] all q1:Questao | all q2:Questao | questoesSemRespostasIguais[q1,q2] all r1:Resposta | all r2:Resposta | respostasSemComentariosIguais[r1,r2] all c:Comentario | one r:Resposta | comentarioSempreEmUmaResposta[c,r] all r:Resposta | one q:Questao | respsoraSempreEmUmaQuestao[r,q] } pred show[]{} run show for 5
programs/oeis/065/A065357.asm
karttu/loda
1
83799
<reponame>karttu/loda<filename>programs/oeis/065/A065357.asm ; A065357: a(n) = (-1)^pi(n) where pi(n) is the number of primes <= n. ; 1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,-1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,1,1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,-1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1 cal $0,230980 ; Number of primes <= n, starting at n=0. gcd $0,2 mov $1,$0 sub $1,2 mul $1,2 add $1,1
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1445.asm
ljhsiun2/medusa
9
28673
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r14 push %r15 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_normal_ht+0xeb9, %rcx nop sub $2761, %rbp vmovups (%rcx), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %r9 nop nop nop xor %r14, %r14 lea addresses_D_ht+0x15029, %r15 nop nop nop nop sub $20064, %r12 mov (%r15), %r13 nop nop and %r15, %r15 lea addresses_WT_ht+0xc639, %r13 clflush (%r13) nop nop inc %rbp movb (%r13), %r12b cmp $10641, %r14 lea addresses_D_ht+0x81af, %r14 nop nop nop nop nop xor $45076, %rbp movl $0x61626364, (%r14) nop sub $14751, %r12 lea addresses_WC_ht+0x95b9, %rcx nop nop nop nop nop xor $26701, %rbp movb (%rcx), %r9b nop nop cmp $40892, %r14 lea addresses_UC_ht+0xdb9, %r15 nop nop nop sub %r13, %r13 mov $0x6162636465666768, %rcx movq %rcx, %xmm0 and $0xffffffffffffffc0, %r15 vmovntdq %ymm0, (%r15) nop nop add %r15, %r15 lea addresses_UC_ht+0x90c9, %r9 nop nop nop nop nop inc %r12 mov $0x6162636465666768, %rbp movq %rbp, %xmm1 movups %xmm1, (%r9) nop nop nop nop sub $12827, %r9 lea addresses_D_ht+0x16839, %rsi lea addresses_WT_ht+0x1b5ff, %rdi clflush (%rdi) nop nop nop nop xor $21767, %r9 mov $79, %rcx rep movsw xor %r12, %r12 lea addresses_WC_ht+0x1c879, %rcx clflush (%rcx) nop nop nop nop nop add %r9, %r9 mov (%rcx), %r12d nop nop nop nop cmp $11476, %r12 lea addresses_A_ht+0x53a9, %rsi lea addresses_D_ht+0x82ff, %rdi nop xor $59513, %r13 mov $23, %rcx rep movsb nop and %rsi, %rsi lea addresses_A_ht+0x45b9, %r9 clflush (%r9) nop nop nop dec %rdi mov $0x6162636465666768, %r13 movq %r13, %xmm1 vmovups %ymm1, (%r9) nop xor %rsi, %rsi lea addresses_WT_ht+0x1b2b9, %rdi nop nop sub %rcx, %rcx movl $0x61626364, (%rdi) inc %r13 lea addresses_UC_ht+0x1eeb9, %rcx nop nop nop nop nop xor $45528, %rsi mov $0x6162636465666768, %r15 movq %r15, %xmm2 vmovups %ymm2, (%rcx) nop dec %r15 lea addresses_UC_ht+0xeeb9, %r13 nop dec %rdi mov (%r13), %r14 nop xor %r14, %r14 lea addresses_WT_ht+0x16b9, %rdi nop nop nop nop nop inc %r15 mov $0x6162636465666768, %rsi movq %rsi, %xmm3 vmovups %ymm3, (%rdi) nop nop nop dec %r12 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r15 push %r8 push %rax push %rdx // Store lea addresses_A+0x104dd, %r14 nop sub $46466, %r11 mov $0x5152535455565758, %r15 movq %r15, %xmm7 movups %xmm7, (%r14) nop cmp %rax, %rax // Store lea addresses_UC+0x63b9, %r12 sub %rdx, %rdx mov $0x5152535455565758, %rax movq %rax, (%r12) nop add $24643, %r12 // Store lea addresses_WC+0x1cb79, %r8 nop nop nop nop nop add %r12, %r12 movb $0x51, (%r8) nop nop xor %r12, %r12 // Load lea addresses_WC+0x97b9, %r11 nop nop add $63361, %r15 mov (%r11), %r14 nop add $64223, %rdx // Store lea addresses_WC+0xea1, %rax clflush (%rax) add %r11, %r11 movw $0x5152, (%rax) nop xor $27260, %rax // Faulty Load lea addresses_RW+0x6b9, %r14 nop add $63430, %r12 movups (%r14), %xmm7 vpextrq $1, %xmm7, %r11 lea oracles, %rax and $0xff, %r11 shlq $12, %r11 mov (%rax,%r11,1), %r11 pop %rdx pop %rax pop %r8 pop %r15 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}} {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}} [Faulty Load] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}} {'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 11}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}} {'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 */
Numbers/Intervals/Definition.agda
Smaug123/agdaproofs
4
2079
{-# OPTIONS --safe --warning=error --without-K #-} open import Numbers.ClassicalReals.RealField open import LogicalFormulae open import Setoids.Subset open import Setoids.Setoids open import Setoids.Orders.Partial.Definition open import Sets.EquivalenceRelations open import Rings.Orders.Partial.Definition open import Rings.Definition open import Fields.Fields open import Groups.Definition open import Numbers.Naturals.Semiring open import Numbers.Naturals.Order open import Functions.Definition module Numbers.Intervals.Definition {a b c : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ _*_ : A → A → A} {_<_ : Rel {_} {c} A} {R : Ring S _+_ _*_} {pOrder : SetoidPartialOrder S _<_} (pRing : PartiallyOrderedRing R pOrder) where record OpenInterval : Set a where field minBound : A maxBound : A isInInterval : A → OpenInterval → Set c isInInterval a record { minBound = min ; maxBound = max } = (min < a) && (a < max)
Test/ZXSP/template_z80.asm
sparks-c16/zasm
43
19068
#!/usr/local/bin/zasm -o original/ ; ================================================================ ; Example file for target 'z80' ; Emulator snapshot format for Sinclair computers ; Copyright (c) <NAME> 1994 - 2015 ; mailto:<EMAIL> ; ================================================================ ; space is filled with 0x00 ; ; The first code segment must contain the z80 header data and must be properly set up. ; Header size may be 30 (v1, deprecated), 55 (v2.01) or 86 to 88 (v3 recommended). ; Ram segments have an additional argument: the pageID. see pageID description. ; Segment size must be 16k except for b&w models. see pageID description. ; All ram pages must be saved. ; Roms may be included if a non-standard rom is used. #target z80 ; --------------------------------------------------- ; .z80 header: saved machine state ; --------------------------------------------------- ; header length: z80v1len equ 30 z80v2len equ 55 z80v3len equ 86 z80maxlen equ z80v3len+3 ; first segment must be the header segment: ; #code HEADER, 0, z80v3len dw 0 ; af dw 0 ; bc dw 0 ; hl dw 0 ; pc_in_z80v1 0x0000 => header z80v2 or higher dw stack_end ; sp db $3f,0 ; i, r db 0 ; data Bit 0 : Bit 7 of the R-register ; Bit 1-3 : Border colour ; Bit 4 : 1 = Basic SamRom switched in ; Bit 5 : 1 = Block of data is compressed ; Bit 6-7 : unused dw 0 ; de dw 0 ; bc' dw 0 ; de' dw 0 ; hl' dw 0 ; af' dw 0 ; iy dw 0 ; ix db 0,0 ; iff1,iff2 db 1 ; im Bit 0-1 : Interrupt mode (0, 1 or 2) ; Bit 2 : 1 = Issue 2 emulation / 60 Hz model ; Bit 3 : 1 = Double interrupt frequency ; Bit 4-5 : 1 = High video synchronisation ; 3 = Low video synchronisation ; 0,2 = Normal ; Bit 6-7 : 0 = Cursor/Protek/AGF joystick ; 1 = Kempston joystick ; 2 = Sinclair 2 left joystick (or user defined, for z80v3) ; 3 = Sinclair 2 right joystick ; Z80 version 2.01: dw z80v3len-z80v1len-2 ; h2len = size of header extension: 23 for z80v2 dw code_start ; pc db 0 ; model 0 = ZX Spectrum 48k ; ; Value Meaning in v2.01 Meaning in v3.0 ldiremu.bit7 im.bit2 ; 0 48k 48k 16k issue2 ; 1 48k + If.1 48k + If.1 16k issue2 ; 2 SamRam SamRam 16k issue2 ; 3 128k 48k + M.G.T. 16k issue2 ; 4 128k + If.1 128k +2 . ; 5 - 128k + If.1 +2 . ; 6 - 128k + M.G.T. +2 . ; 7,8 - +3 +2A . ; 9 - Pentagon 128k . . ; 10 - Scorpion 256k . . ; 11 - Didaktik-Kompakt . . ; 12 - +2 . . ; 13 - +2A . . ; 14 - TC2048 . . ; 15 - TC2068 . . ; *zxsp* 76 - TK85 . . ; *zxsp* 77 - TS1000 . 60 Hz ; *zxsp* 78 - TS1500 . 60 Hz ; *zxsp* 80 - ZX80 . 60 Hz ; *zxsp* 81 - ZX81 . 60 Hz ; *zxsp* 83 - Jupiter ACE . 60 Hz ; *zxsp* 84 - Inves 48k . . ; *zxsp* 85 - +128 Span. . . ; *zxsp* 86 - <NAME> . . ; *zxsp* 87 - +2 Spanish . . ; *zxsp* 88 - +2 French . . ; *zxsp* 89 - +3 Spanish . . ; *zxsp* 90 - +2A Spanish . . ; *zxsp* 91 - tk90x . . ; *zxsp* 92 - tk95 . . ; 128 - TS2068 . . db 0 ; port_7ffd or port_f4 ; If in SamRam mode, bitwise state of 74ls259. ; For example, bit 6=1 after an OUT 31,13 (=2*6+1) ; If in 128 mode, contains last OUT to 7ffd (paging control) ; if timex ts2068: last out to port 244 db 0 ; if1paged or port_ff ; !=0 means: interface1 rom is paged in ; if timex ts2068: last out to port 255 db 7 ; rldiremu Bit 0: 1 if R register emulation on ; Bit 1: 1 if LDIR emulation on ; Bit 2: AY sound in use, even on 48K machines ; *zxsp* Bit 3: SPECTRA interface present, can only add to 48k models ; *zxsp* Bit 5: if zxsp, then present a ZX Spectrum Plus ; Bit 6: (if bit 2 set) Fuller Audio Box emulation ; Bit 7: Modify hardware (see below) db 0 ; port_fffd Last OUT to fffd (soundchip register number) ds 16 ; soundreg[16] Contents of the sound chip registers ; Z80 version 3.0: db 0,0,0 ; t_l,t_m,t_h T state counter ; The hi T state counter counts up modulo 4. Just after the ULA generates its ; 50 Hz interrupt, it is 3, and is increased by one every 5 emulated milliseconds. ; In these 1/200s intervals, the low T state counter counts down from 17471 to 0 (17726 in 128K modes), ; which make a total of 69888 (70908) T states per frame. db 0 ; spectator Flag byte used by Spectator QL Specci emulator. ; *zxsp* ram size (in kB) for b&w models ID 76 to 83. 0 = default ram size (no memory expansion). db 0 ; mgt_paged 0xFF if MGT Rom paged db 0 ; multiface_paged 0xFF if Multiface Rom paged. Should always be 0. db 0,0 ; ram0,ram1 0xFF if 0-8191 / 8192-16383 is ROM ds 10 ; joy[10] 5* ascii word: keys for user defined joystick ds 10 ; stick[10] 5* keyboard mappings corresponding to keys above db 0 ; mgt_type MGT type: 0=Disciple+Epson,1=Disciple+HP,16=Plus D db 0 ; disciple_inhibit_button_status 0=out, 0xFF=in db 0 ; disciple_inhibit_flag 0=rom pageable, 0xFF=not ; warajewo/xzx extension if PC=0 & h2len≥55: ; db 0 ; port_1ffd last out to $1ffd (bank switching on +3) ; zxsp extension if PC=0 & h2len≥57: ; db 0 ; spectra_bits if SPECTRA present: ; *zxsp* Bit 0: new colour modes enabled ; *zxsp* Bit 1: RS232 enabled ; *zxsp* Bit 2: Joystick enabled ; *zxsp* Bit 3: IF1 rom hooks enabled ; *zxsp* Bit 4: rom paged in ; *zxsp* Bit 5: port 239: Comms out bit ; *zxsp* Bit 6: port 239: CTS out bit ; *zxsp* Bit 7: port 247: Data out bit ; db 0 ; spectra_port_7fdf if SPECTRA present: ; *zxsp* last out to port 7FDF (colour mode register) ; --------------------------------------------------- ; saved ram (and rom) pages ; --------------------------------------------------- ; The pages are numbered, depending on the hardware mode, in the following way: ; ; PageID 48 mode 128 mode SamRam mode varying_pagesize ; 0 48K rom rom (basic) 48K rom - ; 1 Interface I, Disciple or Plus D rom, according to setting - ; 2 rom (reset) samram rom (basic) - ; 3 - page 0 samram rom (monitor) 1k ; 4 8000-bfff page 1 Normal 8000-bfff 2k ; 5 c000-ffff page 2 Normal c000-ffff 4k ; 6 - page 3 Shadow 8000-bfff 8k ; 7 - page 4 Shadow c000-ffff 16k ; 8 4000-7fff page 5 4000-7fff 32k ; 9 - page 6 - 64k ; 10 - page 7 - 128k ; 11 Multiface rom Multiface rom - - ;*zxsp* 12 SPECTRA rom SPECTRA rom SPECTRA rom - ;*zxsp* 13 SPECTRA ram[0] SPECTRA ram[0] SPECTRA ram[0] - ;*zxsp* 14 SPECTRA ram[1] SPECTRA ram[1] SPECTRA ram[1] - ; ; In 16k mode, only page 8 is saved. ; In 48k mode, pages 4, 5 and 8 are saved. ; In SamRam mode, pages 4 to 8 must be saved. ; In 128 mode, all pages from 3 to 10 are saved. ; ; The 128 has a memory map like: Rom [switchable]; Ram 5; Ram 2; Ram [switchable, reset=0] ; ; Some models (Russian) have more than 128k of ram. They can have ram page IDs from 3+0 up to 3+31 (up to 512k ram). ; ; b&w models ID 76 to 83 (TK85, TS1000, TS1500, ZX80, ZX81, Jupiter ACE) have a 'varying ram size'. ; their ram is saved in one block of 1k, 2k, 4k, 8k, 16k, 32k, 64k and 128k each as required to sum up to the actual ram size. ; maximum ram size which can be saved this way is 255k: 1+2+4+8+16+32+64+128=255. (actually they have 64k at most.) ; these ram pages may occur in any order. They are concatenated in sequence of occurance when loaded, ; so e.g. for a 48k ram you have the choice to save the 16k or the 32k chunk first, whichever fits your memory layout better. ; page IDs: ; misc. roms visible at 0x0000: ; note: listed for completeness. roms are almost never saved in a snapshot! pageID_48k_rom equ 0 pageID_128k_basic_rom equ 0 pageID_128k_boot_rom equ 2 pageID_if1_rom equ 1 pageID_disciple_rom equ 1 pageID_plusD_rom equ 1 pageID_multiface_rom equ 11 pageID_spectra_rom equ 12 ; *zxsp* pageID_spectra_ram0 equ 13 ; *zxsp* pageID_spectra_ram1 equ 14 ; *zxsp* pageID_samram_basic_rom equ 2 pageID_samram_monitor_rom equ 3 pageID_samram_shadow_ram_0x8000 equ 6 pageID_samram_shadow_ram_0xC000 equ 7 ; 48k model (not pageable) ram: pageID_48k_ram_0x4000 equ 8 pageID_48k_ram_0x8000 equ 4 pageID_48k_ram_0xC000 equ 5 ; 128k models with pageable ram: pageID_128k_ram_page0 equ 3 pageID_128k_ram_page1 equ 4 pageID_128k_ram_page2 equ 5 pageID_128k_ram_page3 equ 6 pageID_128k_ram_page4 equ 7 pageID_128k_ram_page5 equ 8 pageID_128k_ram_page6 equ 9 pageID_128k_ram_page7 equ 10 pageID_128k_ram_0x4000 equ pageID_128k_ram_page5 pageID_128k_ram_0x8000 equ pageID_128k_ram_page2 ; b&w models with varying ram size: pageID_var_ram_1k equ 3 pageID_var_ram_2k equ 4 pageID_var_ram_4k equ 5 pageID_var_ram_8k equ 6 pageID_var_ram_16k equ 7 pageID_var_ram_32k equ 8 pageID_var_ram_64k equ 9 pageID_var_ram_128k equ 10 ; --------------------------------------------------- ; contended ram: video ram & rarely used code ; pageID for 48k Specci (set in header.model above) ; --------------------------------------------------- #code SLOW_RAM, 0x4000, 0x4000, pageID_48k_ram_0x4000 pixels_start: defs 0x1800 attr_start: defs 0x300 code_start: ; define some rarely used machine code here ; e.g. initialization code ; --------------------------------------------------- ; fast ram: frequently used code, ; variables and machine stack ; must be segmented into 16k chunks for .z80 file ; pageIDs for 48k Specci (set in header.model above) ; --------------------------------------------------- #code RAM_0x8000, 0x8000, 0x4000, pageID_48k_ram_0x8000 stack_bot: defs 0x100 stack_end: equ $ ; define some variables here ; define some machine code here #code RAM_0xC000, 0xC000, 0x4000, pageID_48k_ram_0xC000 ; define some variables here ; define some machine code here
alloy4fun_models/trashltl/models/11/MRtrcdY7iTWdwpvTH.als
Kaixi26/org.alloytools.alloy
0
4937
<gh_stars>0 open main pred idMRtrcdY7iTWdwpvTH_prop12 { all f:File | eventually f in Trash implies eventually f in Trash } pred __repair { idMRtrcdY7iTWdwpvTH_prop12 } check __repair { idMRtrcdY7iTWdwpvTH_prop12 <=> prop12o }
SDL.g4
krzysklein/sdl-grammar
0
6279
<reponame>krzysklein/sdl-grammar<gh_stars>0 grammar SDL; file : declaration* EOF ; declaration : modelDeclaration // | enumDeclaration NOT IMPLEMENTED YET | serviceDeclaration ; modelDeclaration : Model Identifier LeftBrace modelMember* RightBrace ; modelMember : type Identifier Semicolon ; serviceDeclaration : Service Identifier LeftBrace serviceMethod* RightBrace ; serviceMethod : typeOrVoid Identifier LeftParen methodParameterList? RightParen Semicolon ; methodParameterList : methodParameter | methodParameterList Comma methodParameter ; methodParameter : type Identifier ; typeOrVoid : type | Void ; type : basicType | arrayType ; arrayType : basicType ( LeftBracket RightBracket )+ ; basicType : internalType | modelType ; modelType : Identifier ; internalType : Bool | Char | Decimal | Double | Float | Int | Long | Short | String ; Bool : 'bool'; Char : 'char'; Decimal : 'decimal'; Double : 'double'; // Enum : 'enum'; NOT IMPLEMENTED YET Float : 'float'; Int : 'int'; Long : 'long'; Model : 'model'; Service : 'service'; Short : 'short'; String : 'string'; Void : 'void'; Question : '?'; Comma : ','; Colon : ':'; Semicolon : ';'; LeftParen : '('; RightParen : ')'; LeftBracket : '['; RightBracket : ']'; LeftBrace : '{'; RightBrace : '}'; LeftAngle : '<'; RightAngle : '>'; Identifier : Nondigit ( Nondigit | Digit )*; fragment Nondigit : [a-zA-Z_]; fragment Digit : [0-9]; Whitespace : [ \t]+ -> skip; Newline : ( '\r''\n'? | '\n' ) -> skip; BlockComment : '/*' .*? '*/' -> skip; LineComment : '//' ~[\r\n]* -> skip;
mc-sema/validator/x86_64/tests/RCR32r1.asm
randolphwong/mcsema
2
101562
BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END ; RCR32r1 mov eax, 0x56789 ;TEST_BEGIN_RECORDING rcr eax, 0x1 ;TEST_END_RECORDING
programs/oeis/318/A318765.asm
neoneye/loda
22
92260
; A318765: a(n) = (n + 2)*(n^2 + n - 1). ; -2,3,20,55,114,203,328,495,710,979,1308,1703,2170,2715,3344,4063,4878,5795,6820,7959,9218,10603,12120,13775,15574,17523,19628,21895,24330,26939,29728,32703,35870,39235,42804,46583,50578,54795,59240,63919,68838,74003,79420,85095,91034,97243,103728,110495,117550,124899,132548,140503,148770,157355,166264,175503,185078,194995,205260,215879,226858,238203,249920,262015,274494,287363,300628,314295,328370,342859,357768,373103,388870,405075,421724,438823,456378,474395,492880,511839,531278,551203,571620,592535,613954,635883,658328,681295,704790,728819,753388,778503,804170,830395,857184,884543,912478,940995,970100,999799 add $0,1 mov $1,$0 pow $0,3 sub $0,$1 sub $0,$1 sub $0,1
tests/natools-s_expressions-atom_buffers-tests.adb
faelys/natools
0
25305
------------------------------------------------------------------------------ -- Copyright (c) 2014, <NAME> -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ with Natools.S_Expressions.Test_Tools; package body Natools.S_Expressions.Atom_Buffers.Tests is ---------------------- -- Whole Test Suite -- ---------------------- procedure All_Tests (Report : in out NT.Reporter'Class) is begin Test_Block_Append (Report); Test_Octet_Append (Report); Test_Preallocate (Report); Test_Query (Report); Test_Query_Null (Report); Test_Reset (Report); Test_Reverse_Append (Report); Test_Invert (Report); Test_Empty_Append (Report); Test_Stream_Interface (Report); end All_Tests; ---------------------- -- Individual Tests -- ---------------------- procedure Test_Block_Append (Report : in out NT.Reporter'Class) is Name : constant String := "Append in blocks"; Data : Atom (0 .. 255); begin for O in Octet loop Data (Count (O)) := O; end loop; declare Buffer : Atom_Buffer; begin Buffer.Append (Data (0 .. 10)); Buffer.Append (Data (11 .. 11)); Buffer.Append (Data (12 .. 101)); Buffer.Append (Data (102 .. 101)); Buffer.Append (Data (102 .. 255)); Test_Tools.Test_Atom (Report, Name, Data, Buffer.Data); end; exception when Error : others => Report.Report_Exception (Name, Error); end Test_Block_Append; procedure Test_Invert (Report : in out NT.Reporter'Class) is Test : NT.Test := Report.Item ("Invert procedure"); Source : Atom (1 .. 10); Inverse : Atom (1 .. 10); begin for I in Source'Range loop Source (I) := 10 + Octet (I); Inverse (11 - I) := Source (I); end loop; declare Buffer : Atom_Buffer; begin Buffer.Invert; Test_Tools.Test_Atom (Test, Null_Atom, Buffer.Data); Buffer.Append (Source (1 .. 1)); Buffer.Invert; Test_Tools.Test_Atom (Test, Source (1 .. 1), Buffer.Data); Buffer.Append (Source (2 .. 7)); Buffer.Invert; Test_Tools.Test_Atom (Test, Inverse (4 .. 10), Buffer.Data); Buffer.Invert; Buffer.Append (Source (8 .. 10)); Buffer.Invert; Test_Tools.Test_Atom (Test, Inverse, Buffer.Data); end; exception when Error : others => Test.Report_Exception (Error); end Test_Invert; procedure Test_Octet_Append (Report : in out NT.Reporter'Class) is Name : constant String := "Append octet by octet"; Data : Atom (0 .. 255); begin for O in Octet loop Data (Count (O)) := O; end loop; declare Buffer : Atom_Buffer; begin for O in Octet loop Buffer.Append (O); end loop; Test_Tools.Test_Atom (Report, Name, Data, Buffer.Data); end; exception when Error : others => Report.Report_Exception (Name, Error); end Test_Octet_Append; procedure Test_Preallocate (Report : in out NT.Reporter'Class) is Name : constant String := "Preallocation of memory"; begin declare Buffer : Atom_Buffer; begin Buffer.Preallocate (256); declare Old_Accessor : Atom_Refs.Accessor := Buffer.Raw_Query; begin for O in Octet loop Buffer.Append (O); end loop; Report.Item (Name, NT.To_Result (Old_Accessor.Data = Buffer.Raw_Query.Data)); end; end; exception when Error : others => Report.Report_Exception (Name, Error); end Test_Preallocate; procedure Test_Query (Report : in out NT.Reporter'Class) is Name : constant String := "Accessors"; Data : Atom (0 .. 255); begin for O in Octet loop Data (Count (O)) := O; end loop; declare Buffer : Atom_Buffer; begin Buffer.Append (Data); if Buffer.Length /= Data'Length then Report.Item (Name, NT.Fail); Report.Info ("Buffer.Length returned" & Count'Image (Buffer.Length) & ", expected" & Count'Image (Data'Length)); return; end if; if Buffer.Data /= Data then Report.Item (Name, NT.Fail); Report.Info ("Data, returning an Atom"); Test_Tools.Dump_Atom (Report, Buffer.Data, "Found"); Test_Tools.Dump_Atom (Report, Data, "Expected"); return; end if; if Buffer.Raw_Query.Data.all /= Data then Report.Item (Name, NT.Fail); Report.Info ("Raw_Query, returning an accessor"); Test_Tools.Dump_Atom (Report, Buffer.Raw_Query.Data.all, "Found"); Test_Tools.Dump_Atom (Report, Data, "Expected"); return; end if; if Buffer.Element (25) /= Data (24) then Report.Item (Name, NT.Fail); Report.Info ("Element, returning an octet"); return; end if; declare O, P : Octet; begin Buffer.Pop (O); Buffer.Pop (P); if O /= Data (Data'Last) or P /= Data (Data'Last - 1) or Buffer.Data /= Data (Data'First .. Data'Last - 2) then Report.Item (Name, NT.Fail); Report.Info ("Pop of an octet: " & Octet'Image (P) & " " & Octet'Image (O)); Test_Tools.Dump_Atom (Report, Buffer.Data, "Remaining"); Test_Tools.Dump_Atom (Report, Data, "Expected"); return; end if; Buffer.Append ((P, O)); if Buffer.Data /= Data then Report.Item (Name, NT.Fail); Report.Info ("Append back after Pop"); Test_Tools.Dump_Atom (Report, Buffer.Data, "Found"); Test_Tools.Dump_Atom (Report, Data, "Expected"); return; end if; end; declare Retrieved : Atom (10 .. 310); Length : Count; begin Buffer.Peek (Retrieved, Length); if Length /= Data'Length or else Retrieved (10 .. Length + 9) /= Data then Report.Item (Name, NT.Fail); Report.Info ("Peek into an existing buffer"); Report.Info ("Length returned" & Count'Image (Length) & ", expected" & Count'Image (Data'Length)); Test_Tools.Dump_Atom (Report, Retrieved (10 .. Length + 9), "Found"); Test_Tools.Dump_Atom (Report, Data, "Expected"); return; end if; end; declare Retrieved : Atom (20 .. 50); Length : Count; begin Buffer.Peek (Retrieved, Length); if Length /= Data'Length or else Retrieved /= Data (0 .. 30) then Report.Item (Name, NT.Fail); Report.Info ("Peek into a buffer too small"); Report.Info ("Length returned" & Count'Image (Length) & ", expected" & Count'Image (Data'Length)); Test_Tools.Dump_Atom (Report, Retrieved, "Found"); Test_Tools.Dump_Atom (Report, Data (0 .. 30), "Expected"); return; end if; end; declare procedure Check (Found : in Atom); Result : Boolean := False; procedure Check (Found : in Atom) is begin Result := Found = Data; end Check; begin Buffer.Query (Check'Access); if not Result then Report.Item (Name, NT.Fail); Report.Info ("Query with callback"); return; end if; end; end; Report.Item (Name, NT.Success); exception when Error : others => Report.Report_Exception (Name, Error); end Test_Query; procedure Test_Query_Null (Report : in out NT.Reporter'Class) is Name : constant String := "Accessor variants against a null buffer"; begin declare Buffer : Atom_Buffer; begin if Buffer.Data /= Null_Atom then Report.Item (Name, NT.Fail); Report.Info ("Data, returning an Atom"); Test_Tools.Dump_Atom (Report, Buffer.Data, "Found"); return; end if; if Buffer.Raw_Query.Data.all /= Null_Atom then Report.Item (Name, NT.Fail); Report.Info ("Raw_Query, returning an accessor"); Test_Tools.Dump_Atom (Report, Buffer.Raw_Query.Data.all, "Found"); return; end if; declare Retrieved : Atom (1 .. 10); Length : Count; begin Buffer.Peek (Retrieved, Length); if Length /= 0 then Report.Item (Name, NT.Fail); Report.Info ("Peek into an existing buffer"); Report.Info ("Length returned" & Count'Image (Length) & ", expected 0"); return; end if; end; declare procedure Check (Found : in Atom); Result : Boolean := False; procedure Check (Found : in Atom) is begin Result := Found = Null_Atom; end Check; begin Buffer.Query (Check'Access); if not Result then Report.Item (Name, NT.Fail); Report.Info ("Query with callback"); return; end if; end; end; Report.Item (Name, NT.Success); exception when Error : others => Report.Report_Exception (Name, Error); end Test_Query_Null; procedure Test_Reset (Report : in out NT.Reporter'Class) is Name : constant String := "Reset procedures"; begin declare Buffer : Atom_Buffer; begin for O in Octet loop Buffer.Append (O); end loop; declare Accessor : Atom_Refs.Accessor := Buffer.Raw_Query; begin Buffer.Soft_Reset; if Buffer.Length /= 0 then Report.Item (Name, NT.Fail); Report.Info ("Soft reset left length" & Count'Image (Buffer.Length)); return; end if; if Buffer.Raw_Query.Data /= Accessor.Data then Report.Item (Name, NT.Fail); Report.Info ("Soft reset changed storage area"); return; end if; if Buffer.Raw_Query.Data.all'Length /= Buffer.Capacity then Report.Item (Name, NT.Fail); Report.Info ("Available length inconsistency, recorded" & Count'Image (Buffer.Capacity) & ", actual" & Count'Image (Buffer.Raw_Query.Data.all'Length)); return; end if; if Buffer.Data'Length /= Buffer.Used then Report.Item (Name, NT.Fail); Report.Info ("Used length inconsistency, recorded" & Count'Image (Buffer.Used) & ", actual" & Count'Image (Buffer.Data'Length)); return; end if; end; for O in Octet'(10) .. Octet'(50) loop Buffer.Append (O); end loop; Buffer.Hard_Reset; if Buffer.Length /= 0 or else Buffer.Capacity /= 0 or else not Buffer.Ref.Is_Empty then Report.Item (Name, NT.Fail); Report.Info ("Hard reset did not completely clean structure"); end if; end; Report.Item (Name, NT.Success); exception when Error : others => Report.Report_Exception (Name, Error); end Test_Reset; procedure Test_Reverse_Append (Report : in out NT.Reporter'Class) is Name : constant String := "procedure Append_Reverse"; Source_1 : Atom (1 .. 10); Source_2 : Atom (1 .. 1); Source_3 : Atom (51 .. 65); Source_4 : Atom (1 .. 0); Source_5 : Atom (101 .. 114); Expected : Atom (1 .. 40); begin for I in Source_1'Range loop Source_1 (I) := 10 + Octet (I); Expected (Expected'First + Source_1'Last - I) := Source_1 (I); end loop; for I in Source_2'Range loop Source_2 (I) := 42; Expected (Expected'First + Source_1'Length + Source_2'Last - I) := Source_2 (I); end loop; for I in Source_3'Range loop Source_3 (I) := Octet (I); Expected (Expected'First + Source_1'Length + Source_2'Length + I - Source_3'First) := Source_3 (I); end loop; for I in Source_5'Range loop Source_5 (I) := Octet (I); Expected (Expected'First + Source_1'Length + Source_2'Length + Source_3'Length + Source_5'Last - I) := Source_5 (I); end loop; declare Buffer : Atom_Buffer; begin Buffer.Append_Reverse (Source_1); Buffer.Append_Reverse (Source_2); Buffer.Append (Source_3); Buffer.Append_Reverse (Source_4); Buffer.Append_Reverse (Source_5); Test_Tools.Test_Atom (Report, Name, Expected, Buffer.Data); end; exception when Error : others => Report.Report_Exception (Name, Error); end Test_Reverse_Append; procedure Test_Empty_Append (Report : in out NT.Reporter'Class) is Test : NT.Test := Report.Item ("Empty append on empty buffer"); begin declare Buffer : Atom_Buffer; begin Buffer.Append (Null_Atom); Test_Tools.Test_Atom (Test, Null_Atom, Buffer.Data); end; exception when Error : others => Test.Report_Exception (Error); end Test_Empty_Append; procedure Test_Stream_Interface (Report : in out NT.Reporter'Class) is Test : NT.Test := Report.Item ("Stream interface"); begin declare Buffer : Atom_Buffer; Part_1 : constant Atom := To_Atom ("0123456789"); Part_2 : constant Atom := To_Atom ("ABCDEF"); Data : Atom (1 .. 10); Last : Offset; begin Buffer.Write (Part_1 & Part_2); Buffer.Read (Data, Last); Test_Tools.Test_Atom (Test, Part_1, Data); Test_Tools.Test_Atom (Test, Part_2, Buffer.Data); Buffer.Read (Data, Last); Test_Tools.Test_Atom (Test, Part_2, Data (Data'First .. Last)); Test_Tools.Test_Atom (Test, Null_Atom, Buffer.Data); end; exception when Error : others => Test.Report_Exception (Error); end Test_Stream_Interface; end Natools.S_Expressions.Atom_Buffers.Tests;
klc3-manual/examples/zjui_ece220_fa18/mp2/examples/mp2_tingkai.asm
liuzikai/klc3
0
8495
; This is mp2 by <NAME> (3170111148) ; it will contain a program that ; translate the event list from x5000 ; into a schedule start at x4000 and print it out ; each event in the event list include 3 fields ; NUL-end ASCII label, day of the week by bit vector, ; and hour slot (0-15 declare 7-22 o'clock) ; the schedule is a 16*5 table, showing every 16 hours in five days ; except PRINT_SLOT and PRINT_CENTERED ; it also have some additional subroutines ; TEST_DAY is used to get which day in the week is occupied and store the condition in certain memory ; (follows not real subroutines because it will end the whole program and use BR) ; SLOT_ERR is used to output the message of invalid slot number ; EVENT_ERR is used to output the message of conflict event ; R0 is used for output and temporary address pointer ; R1 is used as address pointer in event table and output ; R2 is used for getting the data in the address and temporary ; R3 is a counter ; R4 is used for getting days (second field) in getting event, counter for days in output ; R5 is used for getting hours (third field) in getting event, counter for hours in output ; R6 is used for pointer in schedule ; R7 is saved .ORIG x3000 LD R3,SIZE ; initialize R3 to hold the size of the schedule 16*5=80=x50 LD R6,SCHEDULE ; get the begin address x4000 of the schedule into R6 LD R2,ASCNUL ; get x00 into R2 for write SCHELOOP1 STR R2,R6,#0 ; initialize the schedule at x4000 (16*5) ADD R6,R6,#1 ; ADD R3,R3,#-1 ; BRp SCHELOOP1 ; LD R1,EVENT ; begin to get the event in x5000 and store it schedule GETEVENT ADD R0,R1,#0 ; point the the address of the event string GETDAY LDR R2,R1,#0 ; get the second field (day) BRz GOTDAY ; ADD R1,R1,#1 ; BRnzp GETDAY ; GOTDAY LDR R4,R1,#1 ; get the day into R4 LDR R5,R1,#2 ; get the third field (hour) into R5 BRn SLOT_ERR ; test whether the hour is valid ADD R2,R5,#-15 ; BRp SLOT_ERR ; if not, output error and stop JSR TEST_DAY ; LD R6,SCHEDULE ; calculate the address in schedule x4000+hour*5+day LD R3,WU ; counter for multiply MULTIPLY ADD R6,R6,R5 ; ADD R3,R3,#-1 ; BRp MULTIPLY ; LD R3,WU ; count for five days LEA R4,ISMON ; temporary use R4 for address pointer for testing the days ADD R4,R4,#-1 ; (same as the next command) ADD R6,R6,#-1 ; to suit the following loop, decrease the pointer and it will be added back afterwards MANYDAYS ADD R4,R4,#1 ; ADD R3,R3,#-1 ; test which day is arranged BRn GNE ; stop after testing five days ADD R6,R6,#1 ; LDR R2,R4,#0 ; BRz MANYDAYS ; if that day is not arranged, test the next day LDR R2,R6,#0 ; if it is arranged, test whether there is a event already BRnp EVENT_ERR ; if yes, output error end stop STR R0,R6,#0 ; store the address of the event first char BRnzp MANYDAYS ; next day GNE ADD R1,R1,#3 ; get next event LDR R2,R1,#0 ; BRnp GETEVENT ; if it is not x00, means the events didn't finish ; begin to output the schedule LEA R1,ASCNUL ; store the address to be printed in R1 JSR PRINT_CENTERED ; print 6 spaces at the front LD R0,ASCLINE ; OUT LD R3,WU ; print the headline with days LEA R1,MON ; DAYS JSR PRINT_CENTERED ; ADD R1,R1,#4 ; ADD R3,R3,#-1 ; BRz HEADDONE ; LD R0,ASCLINE ; OUT ; BRnzp DAYS ; HEADDONE LD R0,ASCFEED ; OUT ; LD R3,SIZE ; init R3 for counting the size LD R6,SCHEDULE ; address pointer of the schedule AND R5,R5,#0 ; init R5 for counting the hours P_NEXTH ADD R1,R5,#0 ; store the hour in R1 JSR PRINT_SLOT ; print each line leading with hour ADD R5,R5,#1 ; point to the next hour LD R0,ASCLINE ; OUT ; AND R4,R4,#0 ; ADD R4,R4,#5 ; event counter NEXTE LDR R1,R6,#0 ; get the pointer into R1 BRz NO_EVENT ; NO_E_BACK JSR PRINT_CENTERED ; print the event ADD R6,R6,#1 ; next event ADD R3,R3,#-1 ; decrease the counter for the whole table ADD R4,R4,#-1 ; decrease the counter for the events in this hour BRz NEXTH LD R0,ASCLINE ; print vertical line except for the last event OUT ; BRnzp NEXTE ; NEXTH LD R0,ASCFEED ; OUT ; change line at the end of each line ADD R3,R3,#0 ; when five events have printed, next hour if didn't finish BRp P_NEXTH ; SCHEFINISH HALT NO_EVENT LEA R1,ASCNUL ; store the address of nul for printing 6 spaces BRnzp NO_E_BACK ; SLOT_ERR PUTS LEA R0,SLOT_ERRM ; output " has an invalid slot number.\n" PUTS BRnzp SCHEFINISH EVENT_ERR PUTS LEA R0,EVENT_ERRM ; output " conflicts with an earlier event.\n" PUTS BRnzp SCHEFINISH ; R4 is the input as a bit vector for TEST_DAY TEST_DAY ST R0,STOREA ; for testing the day ST R1,STOREB ; address pointer ST R2,STOREC ; counter ST R6,STORED ; for temporary use AND R0,R0,#0 ; init AND R6,R6,#0 ; asc x00 LEA R1,ISMON ; LD R2,WU ; count five days CLEARLOOP STR R6,R1,#0 ; ADD R1,R1,#1 ; ADD R2,R2,#-1 ; BRp CLEARLOOP ; ADD R0,R0,#1 ; Monday bit LD R2,WU ; count five days LEA R1,ISMON ; TESTLOOP AND R6,R4,R0 ; STR R6,R1,#0 ; 0 means not that day, others numbers means yes ADD R0,R0,R0 ; next day bit ADD R1,R1,#1 ; point to the next day condition bit ADD R2,R2,#-1 ; decrease the counter BRp TESTLOOP ; LD R0,STOREA ; LD R1,STOREB ; LD R2,STOREC ; LD R6,STORED ; RET ; PRINT_SLOT goes here ; R1 contains needed time value 0-15, which means 7:00-22:00 and should not be modified ; R2 is used for the calculating the second digit, but the original value will be preserved ; other registers will be preserved for the main program, won't be used PRINT_SLOT ST R2,STOREA ; store the original value of R2 ST R7,STOREB ; store R7 for safety ADD R2,R1,#-2 ; judge whether R1 is bigger than 2 BRp MORETWO ; LD R2,ASCZERO ; give R2 the value of '0' JSR PRINT_ ; output '0' for the first character LD R2,ASCSEVEN ; R1 isn't bigger than 2, then the second digit is '7'+R1 ADD R2,R2,R1 ; JSR PRINT_ ; output R2+R1 as the second character BRnzp FOLL ; to output the following MORETWO ADD R2,R1,#-12 ; bigger than 2, judge whether is bigger than 12 BRp MORETWEL ; LD R2,ASCONE ; output '1' for the first character JSR PRINT_ ; LD R2,ASCSEVEN ; R1 isn't bigger than 12, then the second digit is R1+'7'-10 ADD R2,R2,R1 ; ADD R2,R2,#-10 ; JSR PRINT_ ; output R2+R1-10 as the second character BRnzp FOLL ; to output the following MORETWEL LD R2,ASCTWO ; output the first character '2' JSR PRINT_ ; LD R2,ASCSEVEN ; bigger than 12, the second digit is R1+R2-20 ADD R2,R2,R1 ; ADD R2,R2,#-10 ; ADD R2,R2,#-10 ; JSR PRINT_ ; output the R1+'7'-20 as the second character FOLL LD R2,ASCM ; output ':00 ', which is the same for all condition JSR PRINT_ ; LD R2,ASCZERO ; JSR PRINT_ ; JSR PRINT_ ; LD R2,ASCSPACE ; JSR PRINT_ ; LD R2,STOREA ; give the value of R2 back LD R7,STOREB ; give the value of R7 back RET ; PRINT_CENTERED goes here ; R1 contains the beginning address of the string which end with x00 ; R2 is loading the characters, and the input of PRINT_ ; R3 is used as a counter for leading space, after that it becomes a address pointer ; R4 is used as a counter for trailing space ; R5 is used for getting address ; other registers will be preserved for the main program, won't be used PRINT_CENTERED ST R2,STOREA ; store the original value of R2 ST R3,STOREB ; store the original value of R3 ST R4,STOREC ; store the original value of R4 ST R5,STORED ; store the original value of R5 ST R7,STOREE ; store R7 for safety AND R3,R3,#0 ; initialize R3 to 0 AND R4,R4,#0 ; initialize R4 to 0 AND R5,R5,#0 ; initialize R5 to 0 ADD R5,R1,#0 ; get the address into R5 LDR R2,R5,#0 ; Test whether the first character is x00 BRz ZERO ; COUNT ADD R5,R5,#1 ; get the address being test ADD R3,R3,#1 ; count how many (3-leading space) LDR R2,R5,#0 ; BRz COUNTED ; ADD R5,R5,#1 ; get the next address ADD R4,R4,#1 ; count how many (3-trailing space) LDR R2,R5,#0 ; BRz COUNTED ; BRnzp COUNT ; COUNTED ADD R5,R3,R4 ; temporary store the number of chars NOT R4,R4 ; ADD R4,R4,#1 ; get -R4 ADD R4,R4,#3 ; get the number of trailing spaces NOT R3,R3 ; ADD R3,R3,#1 ; get -R3 ADD R3,R3,#3 ; get the number of leading spaces BRn MSIX ; if the result is negative, it means there are more than 6 chars BRz NOLE ; if the result is zero, it means there are 5/6 chars, no leading spaces BRnzp LEADING ; ZERO ADD R3,R3,#6 ; AND R5,R5,#0 ; LEADING LD R2,ASCSPACE ; begin printing leading space JSR PRINT_ ; ADD R3,R3,#-1 ; BRp LEADING ; ADD R5,R5,#0 ; BRz FINISH ; if no chars to print, finish BRnp NOLE ; to print the chars MSIX AND R5,R5,#0 ; ADD R5,R5,#6 ; need to print exactly 6 chars NOLE ADD R3,R1,#0 ; get the beginning address NEXT LDR R2,R3,#0 ; JSR PRINT_ ; print that char ADD R3,R3,#1 ; point to the next address ADD R5,R5,#-1 ; show how many chars left BRp NEXT ; ADD R4,R4,#0 ; BRnz FINISH ; if no spaces to be printed, finish TRAILING LD R2,ASCSPACE ; JSR PRINT_ ; ADD R4,R4,#-1 ; BRp TRAILING ; FINISH LD R2,STOREA ; give the value of R2 back LD R3,STOREB ; give the value of R3 back LD R4,STOREC ; give the value of R4 back LD R5,STORED ; give the value of R5 back LD R7,STOREE ; give the value of R7 back RET ; what followed is a sub-subrountine used for output, taking R2 as input of what will be printed ; I write this because I want to try using DDR (but not R0) and using subroutines, haha PRINT_ ST R5,STOREF ; PLOOP LDI R5,DSR ; BRzp PLOOP ; STI R2,DDR ; LD R5,STOREF ; RET DSR .FILL xFE04 DDR .FILL xFE06 STOREA .FILL x0000 STOREB .FILL x0000 STOREC .FILL x0000 STORED .FILL x0000 STOREE .FILL x0000 STOREF .FILL x0000 ASCZERO .FILL x0030 ASCONE .FILL x0031 ASCTWO .FILL x0032 ASCSEVEN .FILL x0037 ASCM .FILL x003A ASCSPACE .FILL x0020 ASCNUL .FILL x0000 SCHEDULE .FILL x4000 EVENT .FILL x5000 SIZE .FILL x0050 ASCLINE .FILL x007C ASCFEED .FILL x000A ISMON .FILL x0000 ISTUE .FILL x0000 ISWED .FILL x0000 ISTHU .FILL x0000 ISFRI .FILL x0000 WU .FILL x0005 MON .FILL x004D .FILL x006F .FILL x006E .FILL x0000 TUE .FILL x0054 .FILL x0075 .FILL x0065 .FILL x0000 WED .FILL x0057 .FILL x0065 .FILL x0064 .FILL x0000 THU .FILL x0054 .FILL x0068 .FILL x0075 .FILL x0000 FRI .FILL x0046 .FILL x0072 .FILL x0069 .FILL x0000 SLOT_ERRM .FILL x0020 .FILL x0068 .FILL x0061 .FILL x0073 .FILL x0020 .FILL x0061 .FILL x006E .FILL x0020 .FILL x0069 .FILL x006E .FILL x0076 .FILL x0061 .FILL x006C .FILL x0069 .FILL x0064 .FILL x0020 .FILL x0073 .FILL x006C .FILL x006F .FILL x0074 .FILL x0020 .FILL x006E .FILL x0075 .FILL x006D .FILL x0062 .FILL x0065 .FILL x0072 .FILL x002E .FILL x000A .FILL x0000 EVENT_ERRM .FILL x0020 .FILL x0063 .FILL x006F .FILL x006E .FILL x0066 .FILL x006C .FILL x0069 .FILL x0063 .FILL x0074 .FILL x0073 .FILL x0020 .FILL x0077 .FILL x0069 .FILL x0074 .FILL x0068 .FILL x0020 .FILL x0061 .FILL x006E .FILL x0020 .FILL x0065 .FILL x0061 .FILL x0072 .FILL x006C .FILL x0069 .FILL x0065 .FILL x0072 .FILL x0020 .FILL x0065 .FILL x0076 .FILL x0065 .FILL x006E .FILL x0074 .FILL x002E .FILL x000A .FILL x0000 .END
src/portscan-pilot.adb
jfouquart/synth
0
20413
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt with Ada.Command_Line; with Ada.Strings.Fixed; with PortScan.Ops; with PortScan.Packages; with PortScan.Buildcycle.Ports; with PortScan.Buildcycle.Pkgsrc; with Signals; with Unix; package body PortScan.Pilot is package CLI renames Ada.Command_Line; package ASF renames Ada.Strings.Fixed; package OPS renames PortScan.Ops; package PKG renames PortScan.Packages; package CYC renames PortScan.Buildcycle; package FPC renames PortScan.Buildcycle.Ports; package NPS renames PortScan.Buildcycle.Pkgsrc; package SIG renames Signals; --------------------- -- store_origins -- --------------------- function store_origins return Boolean is function trimmed_catport (S : String) return String; function trimmed_catport (S : String) return String is last : constant Natural := S'Last; begin if S (last) = '/' then return S (S'First .. last - 1); else return S (S'First .. last); end if; end trimmed_catport; begin if CLI.Argument_Count <= 1 then return False; end if; portlist.Clear; load_index_for_store_origins; if CLI.Argument_Count = 2 then -- Check if this is a file declare Arg2 : constant String := trimmed_catport (CLI.Argument (2)); vfresult : Boolean; begin if AD.Exists (Arg2) then vfresult := valid_file (Arg2); clear_store_origin_data; return vfresult; end if; if input_origin_valid (candidate => Arg2) then if Arg2 /= pkgng then plinsert (Arg2, 2); end if; clear_store_origin_data; return True; else suggest_flavor_for_bad_origin (candidate => Arg2); clear_store_origin_data; return False; end if; end; end if; for k in 2 .. CLI.Argument_Count loop declare Argk : constant String := trimmed_catport (CLI.Argument (k)); begin if input_origin_valid (candidate => Argk) then if Argk /= pkgng then plinsert (Argk, k); end if; else suggest_flavor_for_bad_origin (candidate => Argk); clear_store_origin_data; return False; end if; end; end loop; clear_store_origin_data; return True; end store_origins; ------------------------------- -- prerequisites_available -- ------------------------------- function prerequisites_available return Boolean is begin case software_framework is when ports_collection => return build_pkg8_as_necessary; when pkgsrc => return build_pkgsrc_prerequisites; end case; end prerequisites_available; ------------------------------- -- build_pkg8_as_necessary -- ------------------------------- function build_pkg8_as_necessary return Boolean is pkg_good : Boolean; good_scan : Boolean; stop_now : Boolean; selection : PortScan.port_id; result : Boolean := True; begin OPS.initialize_hooks; REP.initialize (testmode => False, num_cores => PortScan.cores_available); REP.launch_slave (id => PortScan.scan_slave, opts => noprocs); good_scan := PortScan.scan_single_port (catport => pkgng, always_build => False, fatal => stop_now); if good_scan then PortScan.set_build_priority; else TIO.Put_Line ("Unexpected pkg(8) scan failure!"); result := False; goto clean_exit; end if; PKG.limited_sanity_check (repository => JT.USS (PM.configuration.dir_repository), dry_run => False, suppress_remote => True); if SIG.graceful_shutdown_requested or else PKG.queue_is_empty then goto clean_exit; end if; CYC.initialize (test_mode => False, jail_env => REP.jail_environment); selection := OPS.top_buildable_port; if SIG.graceful_shutdown_requested or else selection = port_match_failed then goto clean_exit; end if; TIO.Put ("Stand by, building pkg(8) first ... "); pkg_good := FPC.build_package (id => PortScan.scan_slave, sequence_id => selection); OPS.run_hook_after_build (pkg_good, selection); if not pkg_good then TIO.Put_Line ("Failed!!" & bailing); result := False; goto clean_exit; end if; TIO.Put_Line ("done!"); <<clean_exit>> if SIG.graceful_shutdown_requested then TIO.Put_Line (shutreq); result := False; end if; REP.destroy_slave (id => PortScan.scan_slave, opts => noprocs); REP.finalize; reset_ports_tree; return result; end build_pkg8_as_necessary; ---------------------------------- -- build_pkgsrc_prerequisites -- ---------------------------------- function build_pkgsrc_prerequisites return Boolean is function scan_it (the_catport : String) return Boolean; function build_it (desc : String) return Boolean; mk_files : constant String := "pkgtools/bootstrap-mk-files"; cp_bmake : constant String := "devel/bmake"; cp_digest : constant String := "pkgtools/digest"; result : Boolean := True; function scan_it (the_catport : String) return Boolean is good_scan : Boolean; stop_now : Boolean; begin good_scan := PortScan.scan_single_port (catport => the_catport, always_build => False, fatal => stop_now); if good_scan then PortScan.set_build_priority; else TIO.Put_Line ("Unexpected " & the_catport & " scan failure!"); return False; end if; PKG.limited_sanity_check (repository => JT.USS (PM.configuration.dir_repository), dry_run => False, suppress_remote => True); if SIG.graceful_shutdown_requested then return False; end if; return True; end scan_it; function build_it (desc : String) return Boolean is pkg_good : Boolean; selection : PortScan.port_id; begin CYC.initialize (test_mode => False, jail_env => REP.jail_environment); selection := OPS.top_buildable_port; if SIG.graceful_shutdown_requested or else selection = port_match_failed then return False; end if; TIO.Put ("Stand by, building " & desc & " package ... "); pkg_good := NPS.build_package (id => PortScan.scan_slave, sequence_id => selection); OPS.run_hook_after_build (pkg_good, selection); if not pkg_good then TIO.Put_Line ("Failed!!" & bailing); return False; end if; TIO.Put_Line ("done!"); return True; end build_it; begin OPS.initialize_hooks; REP.initialize (testmode => False, num_cores => PortScan.cores_available); REP.launch_slave (id => PortScan.scan_slave, opts => npsboot); if not PLAT.host_pkgsrc_mk_install (id => PortScan.scan_slave) or else not PLAT.host_pkgsrc_bmake_install (id => PortScan.scan_slave) or else not PLAT.host_pkgsrc_pkg8_install (id => PortScan.scan_slave) then TIO.Put_Line ("Failed to install programs from host system."); result := False; goto clean_exit; end if; result := scan_it (mk_files); if not result then goto clean_exit; end if; if not PKG.queue_is_empty then -- the mk files package does not exist or requires rebuilding result := build_it ("mk files"); if not result then goto clean_exit; end if; end if; reset_ports_tree; result := scan_it (cp_bmake); if not result then goto clean_exit; end if; if not PKG.queue_is_empty then -- the bmake package does not exist or requires rebuilding result := build_it ("bmake"); if not result then goto clean_exit; end if; end if; reset_ports_tree; result := scan_it (cp_digest); if not result then goto clean_exit; end if; if not PKG.queue_is_empty then -- the digest package does not exist or requires rebuilding result := build_it ("digest"); if not result then goto clean_exit; end if; end if; reset_ports_tree; result := scan_it (pkgng); if not result then goto clean_exit; end if; if not PKG.queue_is_empty then -- the pkg(8) package does not exist or requires rebuilding result := build_it ("pkg(8)"); end if; <<clean_exit>> if SIG.graceful_shutdown_requested then TIO.Put_Line (shutreq); result := False; end if; REP.destroy_slave (id => PortScan.scan_slave, opts => noprocs); REP.finalize; reset_ports_tree; return result; end build_pkgsrc_prerequisites; ---------------------------------- -- scan_stack_of_single_ports -- ---------------------------------- function scan_stack_of_single_ports (testmode : Boolean; always_build : Boolean := False) return Boolean is procedure scan (plcursor : portkey_crate.Cursor); successful : Boolean := True; just_stop_now : Boolean; procedure scan (plcursor : portkey_crate.Cursor) is origin : constant String := JT.USS (portkey_crate.Key (plcursor)); begin if not successful then return; end if; if origin = pkgng then -- we've already built pkg(8) if we get here, just skip it return; end if; if SIG.graceful_shutdown_requested then successful := False; return; end if; if not PortScan.scan_single_port (origin, always_build, just_stop_now) then if just_stop_now then successful := False; else TIO.Put_Line ("Scan of " & origin & " failed" & PortScan.obvious_problem (JT.USS (PM.configuration.dir_portsdir), origin) & ", it will not be considered."); end if; end if; end scan; begin REP.initialize (testmode, PortScan.cores_available); REP.launch_slave (id => PortScan.scan_slave, opts => noprocs); if SIG.graceful_shutdown_requested then goto clean_exit; end if; if not PLAT.standalone_pkg8_install (PortScan.scan_slave) then TIO.Put_Line ("Failed to install pkg(8) scanner" & bailing); successful := False; goto clean_exit; end if; portlist.Iterate (Process => scan'Access); if successful then PortScan.set_build_priority; if PKG.queue_is_empty then successful := False; TIO.Put_Line ("There are no valid ports to build." & bailing); end if; end if; <<clean_exit>> if SIG.graceful_shutdown_requested then successful := False; TIO.Put_Line (shutreq); end if; REP.destroy_slave (id => PortScan.scan_slave, opts => noprocs); REP.finalize; return successful; end scan_stack_of_single_ports; --------------------------------- -- sanity_check_then_prefail -- --------------------------------- function sanity_check_then_prefail (delete_first : Boolean := False; dry_run : Boolean := False) return Boolean is procedure force_delete (plcursor : portkey_crate.Cursor); ptid : PortScan.port_id; num_skipped : Natural; block_remote : Boolean := True; update_external_repo : constant String := host_pkg8 & " update --quiet --repository "; no_packages : constant String := "No prebuilt packages will be used as a result."; procedure force_delete (plcursor : portkey_crate.Cursor) is origin : JT.Text := portkey_crate.Key (plcursor); pndx : constant port_index := ports_keys.Element (origin); tball : constant String := JT.USS (PM.configuration.dir_repository) & "/" & JT.USS (all_ports (pndx).package_name); begin if AD.Exists (tball) then AD.Delete_File (tball); end if; end force_delete; begin start_time := CAL.Clock; if delete_first and then not dry_run then portlist.Iterate (Process => force_delete'Access); end if; case software_framework is when ports_collection => if not PKG.limited_cached_options_check then -- Error messages emitted by function return False; end if; when pkgsrc => -- There's no analog to cached options on pkgsc. -- We could detect unused settings, but that's it. -- And maybe that should be detected by the framework itself null; end case; if PM.configuration.defer_prebuilt then -- Before any remote operations, find the external repo if PKG.located_external_repository then block_remote := False; -- We're going to use prebuilt packages if available, so let's -- prepare for that case by updating the external repository TIO.Put ("Stand by, updating external repository catalogs ... "); if not Unix.external_command (update_external_repo & PKG.top_external_repository) then TIO.Put_Line ("Failed!"); TIO.Put_Line ("The external repository could not be updated."); TIO.Put_Line (no_packages); block_remote := True; else TIO.Put_Line ("done."); end if; else TIO.Put_Line ("The external repository does not seem to be " & "configured."); TIO.Put_Line (no_packages); end if; end if; OPS.run_start_hook; PKG.limited_sanity_check (repository => JT.USS (PM.configuration.dir_repository), dry_run => dry_run, suppress_remote => block_remote); bld_counter := (OPS.queue_length, 0, 0, 0, 0); if dry_run then return True; end if; if SIG.graceful_shutdown_requested then TIO.Put_Line (shutreq); return False; end if; OPS.delete_existing_web_history_files; start_logging (total); start_logging (ignored); start_logging (skipped); start_logging (success); start_logging (failure); loop ptid := OPS.next_ignored_port; exit when ptid = PortScan.port_match_failed; exit when SIG.graceful_shutdown_requested; bld_counter (ignored) := bld_counter (ignored) + 1; TIO.Put_Line (Flog (total), CYC.elapsed_now & " " & OPS.port_name (ptid) & " has been ignored: " & OPS.ignore_reason (ptid)); TIO.Put_Line (Flog (ignored), CYC.elapsed_now & " " & OPS.port_name (ptid) & ": " & OPS.ignore_reason (ptid)); OPS.cascade_failed_build (id => ptid, numskipped => num_skipped, logs => Flog); OPS.record_history_ignored (elapsed => CYC.elapsed_now, origin => OPS.port_name (ptid), reason => OPS.ignore_reason (ptid), skips => num_skipped); bld_counter (skipped) := bld_counter (skipped) + num_skipped; end loop; stop_logging (ignored); TIO.Put_Line (Flog (total), CYC.elapsed_now & " Sanity check complete. " & "Ports remaining to build:" & OPS.queue_length'Img); TIO.Flush (Flog (total)); if SIG.graceful_shutdown_requested then TIO.Put_Line (shutreq); else if OPS.integrity_intact then return True; end if; end if; -- If here, we either got control-C or failed integrity check if not SIG.graceful_shutdown_requested then TIO.Put_Line ("Queue integrity lost! " & bailing); end if; stop_logging (total); stop_logging (skipped); stop_logging (success); stop_logging (failure); return False; end sanity_check_then_prefail; ------------------------ -- perform_bulk_run -- ------------------------ procedure perform_bulk_run (testmode : Boolean) is num_builders : constant builders := PM.configuration.num_builders; show_tally : Boolean := True; begin if PKG.queue_is_empty then TIO.Put_Line ("After inspection, it has been determined that there " & "are no packages that"); TIO.Put_Line ("require rebuilding; the task is therefore complete."); show_tally := False; else REP.initialize (testmode, PortScan.cores_available); CYC.initialize (testmode, REP.jail_environment); OPS.initialize_web_report (num_builders); OPS.initialize_display (num_builders); OPS.parallel_bulk_run (num_builders, Flog); REP.finalize; end if; stop_time := CAL.Clock; stop_logging (total); stop_logging (success); stop_logging (failure); stop_logging (skipped); if show_tally then TIO.Put_Line (LAT.LF & LAT.LF); TIO.Put_Line ("The task is complete. Final tally:"); TIO.Put_Line ("Initial queue size:" & bld_counter (total)'Img); TIO.Put_Line (" packages built:" & bld_counter (success)'Img); TIO.Put_Line (" ignored:" & bld_counter (ignored)'Img); TIO.Put_Line (" skipped:" & bld_counter (skipped)'Img); TIO.Put_Line (" failed:" & bld_counter (failure)'Img); TIO.Put_Line (""); TIO.Put_Line (CYC.log_duration (start_time, stop_time)); TIO.Put_Line ("The build logs can be found at: " & JT.USS (PM.configuration.dir_logs)); end if; end perform_bulk_run; ------------------------------------------- -- verify_desire_to_rebuild_repository -- ------------------------------------------- function verify_desire_to_rebuild_repository return Boolean is answer : Boolean; YN : Character; screen_present : constant Boolean := Unix.screen_attached; begin if not screen_present then return False; end if; if SIG.graceful_shutdown_requested then -- catch previous shutdown request return False; end if; Unix.cone_of_silence (deploy => False); TIO.Put ("Would you like to rebuild the local repository (Y/N)? "); loop TIO.Get_Immediate (YN); case YN is when 'Y' | 'y' => answer := True; exit; when 'N' | 'n' => answer := False; exit; when others => null; end case; end loop; TIO.Put (YN & LAT.LF); Unix.cone_of_silence (deploy => True); return answer; end verify_desire_to_rebuild_repository; ----------------------------------------- -- verify_desire_to_install_packages -- ----------------------------------------- function verify_desire_to_install_packages return Boolean is answer : Boolean; YN : Character; begin Unix.cone_of_silence (deploy => False); TIO.Put ("Would you like to upgrade your system with the new packages now (Y/N)? "); loop TIO.Get_Immediate (YN); case YN is when 'Y' | 'y' => answer := True; exit; when 'N' | 'n' => answer := False; exit; when others => null; end case; end loop; TIO.Put (YN & LAT.LF); Unix.cone_of_silence (deploy => True); return answer; end verify_desire_to_install_packages; ----------------------------- -- fully_scan_ports_tree -- ----------------------------- function fully_scan_ports_tree return Boolean is goodresult : Boolean; begin PortScan.reset_ports_tree; REP.initialize (testmode => False, num_cores => PortScan.cores_available); REP.launch_slave (id => PortScan.scan_slave, opts => noprocs); case software_framework is when ports_collection => null; when pkgsrc => if not PLAT.standalone_pkg8_install (PortScan.scan_slave) then TIO.Put_Line ("Full Tree Scan: Failed to bootstrap builder"); end if; end case; goodresult := PortScan.scan_entire_ports_tree (JT.USS (PM.configuration.dir_portsdir)); REP.destroy_slave (id => PortScan.scan_slave, opts => noprocs); REP.finalize; if goodresult then PortScan.set_build_priority; return True; else if SIG.graceful_shutdown_requested then TIO.Put_Line (shutreq); else TIO.Put_Line ("Failed to scan ports tree " & bailing); end if; CLI.Set_Exit_Status (1); return False; end if; end fully_scan_ports_tree; --------------------------------- -- rebuild_local_respository -- --------------------------------- function rebuild_local_respository (remove_invalid_packages : Boolean) return Boolean is repo : constant String := JT.USS (PM.configuration.dir_repository); main : constant String := JT.USS (PM.configuration.dir_packages); xz_meta : constant String := main & "/meta.txz"; xz_digest : constant String := main & "/digests.txz"; xz_pkgsite : constant String := main & "/packagesite.txz"; bs_error : constant String := "Rebuild Repository: Failed to bootstrap builder"; build_res : Boolean; begin if SIG.graceful_shutdown_requested then -- In case it was previously requested return False; end if; if remove_invalid_packages then REP.initialize (testmode => False, num_cores => PortScan.cores_available); REP.launch_slave (id => PortScan.scan_slave, opts => noprocs); case software_framework is when ports_collection => null; when pkgsrc => if not PLAT.standalone_pkg8_install (PortScan.scan_slave) then TIO.Put_Line (bs_error); end if; end case; PKG.preclean_repository (repo); REP.destroy_slave (id => PortScan.scan_slave, opts => noprocs); REP.finalize; if SIG.graceful_shutdown_requested then TIO.Put_Line (shutreq); return False; end if; end if; TIO.Put ("Stand by, recursively scanning"); if Natural (portlist.Length) = 1 then TIO.Put (" 1 port"); else TIO.Put (portlist.Length'Img & " ports"); end if; TIO.Put_Line (" serially."); PortScan.reset_ports_tree; if scan_stack_of_single_ports (testmode => False) then PKG.limited_sanity_check (repository => repo, dry_run => False, suppress_remote => True); if SIG.graceful_shutdown_requested then TIO.Put_Line (shutreq); return False; end if; else return False; end if; if AD.Exists (xz_meta) then AD.Delete_File (xz_meta); end if; if AD.Exists (xz_digest) then AD.Delete_File (xz_digest); end if; if AD.Exists (xz_pkgsite) then AD.Delete_File (xz_pkgsite); end if; TIO.Put_Line ("Packages validated, rebuilding local repository."); REP.initialize (testmode => False, num_cores => PortScan.cores_available); REP.launch_slave (id => PortScan.scan_slave, opts => noprocs); case software_framework is when ports_collection => null; when pkgsrc => if not PLAT.standalone_pkg8_install (PortScan.scan_slave) then TIO.Put_Line (bs_error); end if; end case; if valid_signing_command then build_res := REP.build_repository (id => PortScan.scan_slave, sign_command => signing_command); elsif acceptable_RSA_signing_support then build_res := REP.build_repository (PortScan.scan_slave); else build_res := False; end if; REP.destroy_slave (id => PortScan.scan_slave, opts => noprocs); REP.finalize; if build_res then TIO.Put_Line ("Local repository successfully rebuilt"); return True; else TIO.Put_Line ("Failed to rebuild repository" & bailing); return False; end if; end rebuild_local_respository; ------------------ -- valid_file -- ------------------ function valid_file (path : String) return Boolean is handle : TIO.File_Type; good : Boolean; total : Natural := 0; begin TIO.Open (File => handle, Mode => TIO.In_File, Name => path); good := True; while not TIO.End_Of_File (handle) loop declare line : constant String := JT.trim (TIO.Get_Line (handle)); begin if not JT.IsBlank (line) then if input_origin_valid (candidate => line) then plinsert (line, total); total := total + 1; else suggest_flavor_for_bad_origin (candidate => line); good := False; exit; end if; end if; end; end loop; TIO.Close (handle); return (total > 0) and then good; exception when others => return False; end valid_file; ---------------- -- plinsert -- ---------------- procedure plinsert (key : String; dummy : Natural) is key2 : JT.Text := JT.SUS (key); ptid : constant PortScan.port_id := PortScan.port_id (dummy); begin if not portlist.Contains (key2) then portlist.Insert (key2, ptid); duplist.Insert (key2, ptid); end if; end plinsert; --------------------- -- start_logging -- --------------------- procedure start_logging (flavor : count_type) is logpath : constant String := JT.USS (PM.configuration.dir_logs) & "/" & logname (flavor); begin if AD.Exists (logpath) then AD.Delete_File (logpath); end if; TIO.Create (File => Flog (flavor), Mode => TIO.Out_File, Name => logpath); if flavor = total then TIO.Put_Line (Flog (flavor), "-=> Chronology of last build <=-"); TIO.Put_Line (Flog (flavor), "Started: " & timestamp (start_time)); TIO.Put_Line (Flog (flavor), "Ports to build:" & PKG.original_queue_size'Img); TIO.Put_Line (Flog (flavor), ""); TIO.Put_Line (Flog (flavor), "Purging any ignored/broken ports " & "first ..."); TIO.Flush (Flog (flavor)); end if; exception when others => raise pilot_log with "Failed to create or delete " & logpath & bailing; end start_logging; -------------------- -- stop_logging -- -------------------- procedure stop_logging (flavor : count_type) is begin if flavor = total then TIO.Put_Line (Flog (flavor), "Finished: " & timestamp (stop_time)); TIO.Put_Line (Flog (flavor), CYC.log_duration (start => start_time, stop => stop_time)); TIO.Put_Line (Flog (flavor), LAT.LF & "---------------------------" & LAT.LF & "-- Final Statistics" & LAT.LF & "---------------------------" & LAT.LF & " Initial queue size:" & bld_counter (total)'Img & LAT.LF & " packages built:" & bld_counter (success)'Img & LAT.LF & " ignored:" & bld_counter (ignored)'Img & LAT.LF & " skipped:" & bld_counter (skipped)'Img & LAT.LF & " failed:" & bld_counter (failure)'Img); end if; TIO.Close (Flog (flavor)); end stop_logging; ----------------------- -- purge_distfiles -- ----------------------- procedure purge_distfiles is type disktype is mod 2**64; procedure scan (plcursor : portkey_crate.Cursor); procedure kill (plcursor : portkey_crate.Cursor); procedure walk (name : String); function display_kmg (number : disktype) return String; abort_purge : Boolean := False; bytes_purged : disktype := 0; distfiles : portkey_crate.Map; rmfiles : portkey_crate.Map; procedure scan (plcursor : portkey_crate.Cursor) is origin : JT.Text := portkey_crate.Key (plcursor); tracker : constant port_id := portkey_crate.Element (plcursor); pndx : constant port_index := ports_keys.Element (origin); distinfo : constant String := JT.USS (PM.configuration.dir_portsdir) & "/" & JT.USS (origin) & "/distinfo"; handle : TIO.File_Type; bookend : Natural; begin TIO.Open (File => handle, Mode => TIO.In_File, Name => distinfo); while not TIO.End_Of_File (handle) loop declare Line : String := TIO.Get_Line (handle); begin if Line (1 .. 4) = "SIZE" then bookend := ASF.Index (Line, ")"); declare S : JT.Text := JT.SUS (Line (7 .. bookend - 1)); begin if not distfiles.Contains (S) then distfiles.Insert (S, tracker); end if; exception when failed : others => TIO.Put_Line ("purge_distfiles::scan: " & JT.USS (S)); TIO.Put_Line (EX.Exception_Information (failed)); end; end if; end; end loop; TIO.Close (handle); exception when others => if TIO.Is_Open (handle) then TIO.Close (handle); end if; end scan; procedure walk (name : String) is procedure walkdir (item : AD.Directory_Entry_Type); procedure print (item : AD.Directory_Entry_Type); uniqid : port_id := 0; leftindent : Natural := JT.SU.Length (PM.configuration.dir_distfiles) + 2; procedure walkdir (item : AD.Directory_Entry_Type) is begin if AD.Simple_Name (item) /= "." and then AD.Simple_Name (item) /= ".." then walk (AD.Full_Name (item)); end if; exception when AD.Name_Error => abort_purge := True; TIO.Put_Line ("walkdir: " & name & " directory does not exist"); end walkdir; procedure print (item : AD.Directory_Entry_Type) is FN : constant String := AD.Full_Name (item); tball : JT.Text := JT.SUS (FN (leftindent .. FN'Last)); begin if not distfiles.Contains (tball) then if not rmfiles.Contains (tball) then uniqid := uniqid + 1; rmfiles.Insert (Key => tball, New_Item => uniqid); bytes_purged := bytes_purged + disktype (AD.Size (FN)); end if; end if; end print; begin AD.Search (name, "*", (AD.Ordinary_File => True, others => False), print'Access); AD.Search (name, "", (AD.Directory => True, others => False), walkdir'Access); exception when AD.Name_Error => abort_purge := True; TIO.Put_Line ("The " & name & " directory does not exist"); when AD.Use_Error => abort_purge := True; TIO.Put_Line ("Searching " & name & " directory is not supported"); when failed : others => abort_purge := True; TIO.Put_Line ("purge_distfiles: Unknown error - directory search"); TIO.Put_Line (EX.Exception_Information (failed)); end walk; function display_kmg (number : disktype) return String is type kmgtype is delta 0.01 digits 6; kilo : constant disktype := 1024; mega : constant disktype := kilo * kilo; giga : constant disktype := kilo * mega; XXX : kmgtype; begin if number > giga then XXX := kmgtype (number / giga); return XXX'Img & " gigabytes"; elsif number > mega then XXX := kmgtype (number / mega); return XXX'Img & " megabytes"; else XXX := kmgtype (number / kilo); return XXX'Img & " kilobytes"; end if; end display_kmg; procedure kill (plcursor : portkey_crate.Cursor) is tarball : String := JT.USS (portkey_crate.Key (plcursor)); path : JT.Text := PM.configuration.dir_distfiles; begin JT.SU.Append (path, "/" & tarball); TIO.Put_Line ("Deleting " & tarball); AD.Delete_File (JT.USS (path)); end kill; begin read_flavor_index; TIO.Put ("Scanning the distinfo file of every port in the tree ... "); ports_keys.Iterate (Process => scan'Access); TIO.Put_Line ("done"); walk (name => JT.USS (PM.configuration.dir_distfiles)); if abort_purge then TIO.Put_Line ("Distfile purge operation aborted."); else rmfiles.Iterate (kill'Access); TIO.Put_Line ("Recovered" & display_kmg (bytes_purged)); end if; end purge_distfiles; ------------------------------------------ -- write_pkg_repos_configuration_file -- ------------------------------------------ function write_pkg_repos_configuration_file return Boolean is repdir : constant String := get_repos_dir; target : constant String := repdir & "/00_synth.conf"; pkgdir : constant String := JT.USS (PM.configuration.dir_packages); pubkey : constant String := PM.synth_confdir & "/" & JT.USS (PM.configuration.profile) & "-public.key"; keydir : constant String := PM.synth_confdir & "/keys"; tstdir : constant String := keydir & "/trusted"; autgen : constant String := "# Automatically generated." & LAT.LF; fpfile : constant String := tstdir & "/fingerprint." & JT.USS (PM.configuration.profile); handle : TIO.File_Type; vscmd : Boolean := False; begin if AD.Exists (target) then AD.Delete_File (target); elsif not AD.Exists (repdir) then AD.Create_Path (repdir); end if; TIO.Create (File => handle, Mode => TIO.Out_File, Name => target); TIO.Put_Line (handle, autgen); TIO.Put_Line (handle, "Synth: {"); TIO.Put_Line (handle, " url : file://" & pkgdir & ","); TIO.Put_Line (handle, " priority : 0,"); TIO.Put_Line (handle, " enabled : yes,"); if valid_signing_command then vscmd := True; TIO.Put_Line (handle, " signature_type : FINGERPRINTS,"); TIO.Put_Line (handle, " fingerprints : " & keydir); elsif set_synth_conf_with_RSA then TIO.Put_Line (handle, " signature_type : PUBKEY,"); TIO.Put_Line (handle, " pubkey : " & pubkey); end if; TIO.Put_Line (handle, "}"); TIO.Close (handle); if vscmd then if AD.Exists (fpfile) then AD.Delete_File (fpfile); elsif not AD.Exists (tstdir) then AD.Create_Path (tstdir); end if; TIO.Create (File => handle, Mode => TIO.Out_File, Name => fpfile); TIO.Put_Line (handle, autgen); TIO.Put_Line (handle, "function : sha256"); TIO.Put_Line (handle, "fingerprint : " & profile_fingerprint); TIO.Close (handle); end if; return True; exception when others => TIO.Put_Line ("Error: failed to create " & target); if TIO.Is_Open (handle) then TIO.Close (handle); end if; return False; end write_pkg_repos_configuration_file; --------------------------------- -- upgrade_system_everything -- --------------------------------- procedure upgrade_system_everything (skip_installation : Boolean := False; dry_run : Boolean := False) is command : constant String := host_pkg8 & " upgrade --yes --repository Synth"; query : constant String := host_pkg8 & " query -a %o:%n"; sorry : constant String := "Unfortunately, the system upgrade failed."; begin if not prescanned then read_flavor_index; end if; portlist.Clear; TIO.Put_Line ("Querying system about current package installations."); begin declare comres : constant String := JT.USS (CYC.generic_system_command (query)); markers : JT.Line_Markers; uniqid : Natural := 0; begin JT.initialize_markers (comres, markers); loop exit when not JT.next_line_present (comres, markers); declare line : constant String := JT.extract_line (comres, markers); origin : constant String := JT.part_1 (line, ":"); pkgbase : constant String := JT.part_2 (line, ":"); flvquery : constant String := host_pkg8 & " query %At:%Av " & pkgbase; errprefix : constant String := "Installed package ignored, "; origintxt : JT.Text := JT.SUS (origin); target_id : port_id := port_match_failed; maxprobe : port_index := port_index (so_serial.Length) - 1; found_it : Boolean := False; flvresult : JT.Text; begin -- This approach isn't the greatest, but we're missing information. -- At this port, all_ports array is not populated, so we can't compare the -- package names to determine flavors. So what we do is search so_serial -- for the origin. If it exists, the port has no flavors and we take the -- target id. Otherwise, we have to query the system for the installed -- flavor. It it fail on pre-flavor installations, though. Once all packages -- are completely replaced, this approach should work fine. if so_porthash.Contains (origintxt) then if so_serial.Contains (origintxt) then target_id := so_porthash.Element (origintxt); found_it := True; else flvresult := CYC.generic_system_command (flvquery); declare contents : constant String := JT.USS (flvresult); markers : JT.Line_Markers; begin JT.initialize_markers (contents, markers); if JT.next_line_with_content_present (contents, "flavor:", markers) then declare line : constant String := JT.extract_line (contents, markers); flvorigin : JT.Text; begin flvorigin := JT.SUS (origin & "@" & JT.part_2 (line, ":")); if so_serial.Contains (flvorigin) then target_id := so_serial.Find_Index (flvorigin); found_it := True; end if; end; end if; end; end if; if found_it then uniqid := uniqid + 1; plinsert (get_catport (all_ports (target_id)), uniqid); else TIO.Put_Line (errprefix & origin & " package unmatched"); end if; else TIO.Put_Line (errprefix & "missing from ports: " & origin); end if; end; end loop; end; exception when others => TIO.Put_Line (sorry & " (system query)"); return; end; TIO.Put_Line ("Stand by, comparing installed packages against the ports tree."); if prerequisites_available and then scan_stack_of_single_ports (testmode => False) and then sanity_check_then_prefail (delete_first => False, dry_run => dry_run) then if dry_run then display_results_of_dry_run; return; else perform_bulk_run (testmode => False); end if; else if not SIG.graceful_shutdown_requested then TIO.Put_Line (sorry); end if; return; end if; if SIG.graceful_shutdown_requested then return; end if; if rebuild_local_respository (remove_invalid_packages => True) then if not skip_installation then if not Unix.external_command (command) then TIO.Put_Line (sorry); end if; end if; end if; end upgrade_system_everything; ------------------------------ -- upgrade_system_exactly -- ------------------------------ procedure upgrade_system_exactly is procedure build_train (plcursor : portkey_crate.Cursor); base_command : constant String := host_pkg8 & " install --yes --repository Synth"; caboose : JT.Text; procedure build_train (plcursor : portkey_crate.Cursor) is full_origin : JT.Text renames portkey_crate.Key (plcursor); pix : constant port_index := ports_keys.Element (full_origin); pkgfile : constant String := JT.USS (all_ports (pix).package_name); begin JT.SU.Append (caboose, " " & JT.head (pkgfile, ".")); end build_train; begin duplist.Iterate (Process => build_train'Access); declare command : constant String := base_command & JT.USS (caboose); begin if not Unix.external_command (command) then TIO.Put_Line ("Unfortunately, the system upgraded failed."); end if; end; end upgrade_system_exactly; ------------------------------- -- insufficient_privileges -- ------------------------------- function insufficient_privileges return Boolean is command : constant String := "/usr/bin/id -u"; result : JT.Text := CYC.generic_system_command (command); topline : JT.Text; begin JT.nextline (lineblock => result, firstline => topline); declare resint : constant Integer := Integer'Value (JT.USS (topline)); begin return (resint /= 0); end; end insufficient_privileges; --------------- -- head_n1 -- --------------- function head_n1 (filename : String) return String is handle : TIO.File_Type; begin TIO.Open (File => handle, Mode => TIO.In_File, Name => filename); if TIO.End_Of_File (handle) then TIO.Close (handle); return ""; end if; declare line : constant String := TIO.Get_Line (handle); begin TIO.Close (handle); return line; end; end head_n1; ----------------------- -- already_running -- ----------------------- function already_running return Boolean is pid : Integer; comres : JT.Text; begin if AD.Exists (pidfile) then declare textpid : constant String := head_n1 (pidfile); command : constant String := "/bin/ps -p " & textpid; begin -- test if valid by converting it (exception if fails) pid := Integer'Value (textpid); -- exception raised by line below if pid not found. comres := CYC.generic_system_command (command); if JT.contains (comres, "synth") then return True; else -- pidfile is obsolete, remove it. AD.Delete_File (pidfile); return False; end if; exception when others => -- pidfile contains garbage, remove it AD.Delete_File (pidfile); return False; end; end if; return False; end already_running; ----------------------- -- destroy_pidfile -- ----------------------- procedure destroy_pidfile is begin if AD.Exists (pidfile) then AD.Delete_File (pidfile); end if; exception when others => null; end destroy_pidfile; ---------------------- -- create_pidfile -- ---------------------- procedure create_pidfile is pidtext : constant String := JT.int2str (Get_PID); handle : TIO.File_Type; begin TIO.Create (File => handle, Mode => TIO.Out_File, Name => pidfile); TIO.Put_Line (handle, pidtext); TIO.Close (handle); end create_pidfile; ------------------------------ -- set_replicant_platform -- ------------------------------ procedure set_replicant_platform is begin REP.set_platform; end set_replicant_platform; ------------------------------------ -- previous_run_mounts_detected -- ------------------------------------ function previous_run_mounts_detected return Boolean is begin return REP.synth_mounts_exist; end previous_run_mounts_detected; ------------------------------------- -- previous_realfs_work_detected -- ------------------------------------- function previous_realfs_work_detected return Boolean is begin return REP.disk_workareas_exist; end previous_realfs_work_detected; --------------------------------------- -- old_mounts_successfully_removed -- --------------------------------------- function old_mounts_successfully_removed return Boolean is begin if REP.clear_existing_mounts then TIO.Put_Line ("Dismounting successful!"); return True; end if; TIO.Put_Line ("The attempt failed. " & "Check for stuck or ongoing processes and kill them."); TIO.Put_Line ("After that, try running Synth again or just manually " & "unmount everything"); TIO.Put_Line ("still attached to " & JT.USS (PM.configuration.dir_buildbase)); return False; end old_mounts_successfully_removed; -------------------------------------------- -- old_realfs_work_successfully_removed -- -------------------------------------------- function old_realfs_work_successfully_removed return Boolean is begin if REP.clear_existing_workareas then TIO.Put_Line ("Directory removal successful!"); return True; end if; TIO.Put_Line ("The attempt to remove the work directories located at "); TIO.Put_Line (JT.USS (PM.configuration.dir_buildbase) & "failed."); TIO.Put_Line ("Please remove them manually before continuing"); return False; end old_realfs_work_successfully_removed; ------------------------- -- synthexec_missing -- ------------------------- function synthexec_missing return Boolean is synthexec : constant String := host_localbase & "/libexec/synthexec"; begin if AD.Exists (synthexec) then return False; end if; TIO.Put_Line (synthexec & " missing!" & bailing); return True; end synthexec_missing; ---------------------------------- -- display_results_of_dry_run -- ---------------------------------- procedure display_results_of_dry_run is procedure print (cursor : ranking_crate.Cursor); listlog : TIO.File_Type; filename : constant String := "/var/synth/synth_status_results.txt"; max_lots : constant scanners := get_max_lots; elap_raw : constant String := CYC.log_duration (start => scan_start, stop => scan_stop); elapsed : constant String := elap_raw (elap_raw'First + 10 .. elap_raw'Last); goodlog : Boolean; procedure print (cursor : ranking_crate.Cursor) is id : port_id := ranking_crate.Element (cursor).ap_index; kind : verdiff; diff : constant String := version_difference (id, kind); origin : constant String := get_catport (all_ports (id)); begin case kind is when newbuild => TIO.Put_Line (" N => " & origin); when rebuild => TIO.Put_Line (" R => " & origin); when change => TIO.Put_Line (" U => " & origin & diff); end case; if goodlog then TIO.Put_Line (listlog, origin & diff); end if; end print; begin begin -- Try to defend malicious symlink: https://en.wikipedia.org/wiki/Symlink_race if AD.Exists (filename) then AD.Delete_File (filename); end if; TIO.Create (File => listlog, Mode => TIO.Out_File, Name => filename); goodlog := True; exception when others => goodlog := False; end; TIO.Put_Line ("These are the ports that would be built ([N]ew, " & "[R]ebuild, [U]pgrade):"); rank_queue.Iterate (print'Access); TIO.Put_Line ("Total packages that would be built:" & rank_queue.Length'Img); if goodlog then TIO.Put_Line (listlog, LAT.LF & "------------------------------" & LAT.LF & "-- Statistics" & LAT.LF & "------------------------------" & LAT.LF & " Ports scanned :" & last_port'Img & LAT.LF & " Elapsed time : " & elapsed & LAT.LF & " Parallelism :" & max_lots'Img & " scanners" & LAT.LF & " ncpu :" & number_cores'Img); TIO.Close (listlog); TIO.Put_Line ("The complete build list can also be found at:" & LAT.LF & filename); end if; end display_results_of_dry_run; --------------------- -- get_repos_dir -- --------------------- function get_repos_dir return String is command : String := host_pkg8 & " config repos_dir"; content : JT.Text; topline : JT.Text; crlen1 : Natural; crlen2 : Natural; begin content := CYC.generic_system_command (command); crlen1 := JT.SU.Length (content); loop JT.nextline (lineblock => content, firstline => topline); crlen2 := JT.SU.Length (content); exit when crlen1 = crlen2; crlen1 := crlen2; if not JT.equivalent (topline, "/etc/pkg/") then return JT.USS (topline); end if; end loop; -- fallback, use default return host_localbase & "/etc/pkg/repos"; end get_repos_dir; ------------------------------------ -- interact_with_single_builder -- ------------------------------------ function interact_with_single_builder return Boolean is EA_defined : constant Boolean := Unix.env_variable_defined (brkname); begin if Natural (portlist.Length) /= 1 then return False; end if; if not EA_defined then return False; end if; return CYC.valid_test_phase (Unix.env_variable_value (brkname)); end interact_with_single_builder; ---------------------------------------------- -- bulk_run_then_interact_with_final_port -- ---------------------------------------------- procedure bulk_run_then_interact_with_final_port is uscatport : JT.Text := portkey_crate.Key (Position => portlist.First); brkphase : constant String := Unix.env_variable_value (brkname); buildres : Boolean; ptid : port_id; begin if ports_keys.Contains (Key => uscatport) then ptid := ports_keys.Element (Key => uscatport); end if; OPS.unlist_port (ptid); perform_bulk_run (testmode => True); if SIG.graceful_shutdown_requested then return; end if; if bld_counter (ignored) > 0 or else bld_counter (skipped) > 0 or else bld_counter (failure) > 0 then TIO.Put_Line ("It appears a prerequisite failed, so the interactive" & " build of"); TIO.Put_Line (JT.USS (uscatport) & " has been cancelled."); return; end if; TIO.Put_Line ("Starting interactive build of " & JT.USS (uscatport)); TIO.Put_Line ("Stand by, building up to the point requested ..."); REP.initialize (testmode => True, num_cores => PortScan.cores_available); CYC.initialize (test_mode => True, jail_env => REP.jail_environment); REP.launch_slave (id => PortScan.scan_slave, opts => noprocs); Unix.cone_of_silence (deploy => False); case software_framework is when ports_collection => buildres := FPC.build_package (id => PortScan.scan_slave, sequence_id => ptid, interactive => True, interphase => brkphase); when pkgsrc => if PLAT.standalone_pkg8_install (PortScan.scan_slave) then buildres := NPS.build_package (id => PortScan.scan_slave, sequence_id => ptid, interactive => True, interphase => brkphase); end if; end case; REP.destroy_slave (id => PortScan.scan_slave, opts => noprocs); REP.finalize; end bulk_run_then_interact_with_final_port; -------------------------- -- synth_launch_clash -- -------------------------- function synth_launch_clash return Boolean is function get_usrlocal return String; function get_usrlocal return String is begin if JT.equivalent (PM.configuration.dir_system, "/") then return host_localbase; end if; return JT.USS (PM.configuration.dir_system) & host_localbase; end get_usrlocal; cwd : constant String := AD.Current_Directory; usrlocal : constant String := get_usrlocal; portsdir : constant String := JT.USS (PM.configuration.dir_portsdir); ullen : constant Natural := usrlocal'Length; pdlen : constant Natural := portsdir'Length; begin if cwd = usrlocal or else cwd = portsdir then return True; end if; if cwd'Length > ullen and then cwd (1 .. ullen + 1) = usrlocal & "/" then return True; end if; if cwd'Length > pdlen and then cwd (1 .. pdlen + 1) = portsdir & "/" then return True; end if; return False; exception when others => return True; end synth_launch_clash; -------------------------- -- version_difference -- -------------------------- function version_difference (id : port_id; kind : out verdiff) return String is dir_pkg : constant String := JT.USS (PM.configuration.dir_repository); current : constant String := JT.USS (all_ports (id).package_name); version : constant String := JT.USS (all_ports (id).port_version); begin if AD.Exists (dir_pkg & "/" & current) then kind := rebuild; return " (rebuild " & version & ")"; end if; declare pkgbase : constant String := JT.head (current, "-"); pattern : constant String := pkgbase & "-*.txz"; upgrade : JT.Text; pkg_search : AD.Search_Type; dirent : AD.Directory_Entry_Type; begin AD.Start_Search (Search => pkg_search, Directory => dir_pkg, Filter => (AD.Ordinary_File => True, others => False), Pattern => pattern); while AD.More_Entries (Search => pkg_search) loop AD.Get_Next_Entry (Search => pkg_search, Directory_Entry => dirent); declare sname : String := AD.Simple_Name (dirent); testbase : String := PKG.query_pkgbase (dir_pkg & "/" & sname); testver : String := JT.tail (JT.head (sname, "."), "-"); begin if testbase = pkgbase then upgrade := JT.SUS (" (" & testver & " => " & version & ")"); end if; end; end loop; if not JT.IsBlank (upgrade) then kind := change; return JT.USS (upgrade); end if; end; kind := newbuild; return " (new " & version & ")"; end version_difference; ------------------------ -- file_permissions -- ------------------------ function file_permissions (full_path : String) return String is command : constant String := "/usr/bin/stat -f %Lp " & full_path; content : JT.Text; topline : JT.Text; status : Integer; begin content := Unix.piped_command (command, status); if status /= 0 then return "000"; end if; JT.nextline (lineblock => content, firstline => topline); return JT.USS (topline); end file_permissions; -------------------------------------- -- acceptable_RSA_signing_support -- -------------------------------------- function acceptable_RSA_signing_support return Boolean is file_prefix : constant String := PM.synth_confdir & "/" & JT.USS (PM.configuration.profile) & "-"; key_private : constant String := file_prefix & "private.key"; key_public : constant String := file_prefix & "public.key"; found_private : constant Boolean := AD.Exists (key_private); found_public : constant Boolean := AD.Exists (key_public); sorry : constant String := "The generated repository will not " & "be signed due to the misconfiguration."; repo_key : constant String := JT.USS (PM.configuration.dir_buildbase) & ss_base & "/etc/repo.key"; begin if not found_private and then not found_public then return True; end if; if found_public and then not found_private then TIO.Put_Line ("A public RSA key file has been found without a " & "corresponding private key file."); TIO.Put_Line (sorry); return True; end if; if found_private and then not found_public then TIO.Put_Line ("A private RSA key file has been found without a " & "corresponding public key file."); TIO.Put_Line (sorry); return True; end if; declare mode : constant String := file_permissions (key_private); begin if mode /= "400" then TIO.Put_Line ("The private RSA key file has insecure file " & "permissions (" & mode & ")"); TIO.Put_Line ("Please change the mode of " & key_private & " to 400 before continuing."); return False; end if; end; declare begin AD.Copy_File (Source_Name => key_private, Target_Name => repo_key); return True; exception when failed : others => TIO.Put_Line ("Failed to copy private RSA key to builder."); TIO.Put_Line (EX.Exception_Information (failed)); return False; end; end acceptable_RSA_signing_support; ---------------------------------- -- acceptable_signing_command -- ---------------------------------- function valid_signing_command return Boolean is file_prefix : constant String := PM.synth_confdir & "/" & JT.USS (PM.configuration.profile) & "-"; fingerprint : constant String := file_prefix & "fingerprint"; ext_command : constant String := file_prefix & "signing_command"; found_finger : constant Boolean := AD.Exists (fingerprint); found_command : constant Boolean := AD.Exists (ext_command); sorry : constant String := "The generated repository will not " & "be externally signed due to the misconfiguration."; begin if found_finger and then found_command then if JT.IsBlank (one_line_file_contents (fingerprint)) or else JT.IsBlank (one_line_file_contents (ext_command)) then TIO.Put_Line ("At least one of the profile signing command " & "files is blank"); TIO.Put_Line (sorry); return False; end if; return True; end if; if found_finger then TIO.Put_Line ("The profile fingerprint was found but not the " & "signing command"); TIO.Put_Line (sorry); elsif found_command then TIO.Put_Line ("The profile signing command was found but not " & "the fingerprint"); TIO.Put_Line (sorry); end if; return False; end valid_signing_command; ----------------------- -- signing_command -- ----------------------- function signing_command return String is filename : constant String := PM.synth_confdir & "/" & JT.USS (PM.configuration.profile) & "-signing_command"; begin return one_line_file_contents (filename); end signing_command; --------------------------- -- profile_fingerprint -- --------------------------- function profile_fingerprint return String is filename : constant String := PM.synth_confdir & "/" & JT.USS (PM.configuration.profile) & "-fingerprint"; begin return one_line_file_contents (filename); end profile_fingerprint; ------------------------------- -- set_synth_conf_with_RSA -- ------------------------------- function set_synth_conf_with_RSA return Boolean is file_prefix : constant String := PM.synth_confdir & "/" & JT.USS (PM.configuration.profile) & "-"; key_private : constant String := file_prefix & "private.key"; key_public : constant String := file_prefix & "public.key"; found_private : constant Boolean := AD.Exists (key_private); found_public : constant Boolean := AD.Exists (key_public); begin return found_public and then found_private and then file_permissions (key_private) = "400"; end set_synth_conf_with_RSA; ------------------------------ -- one_line_file_contents -- ------------------------------ function one_line_file_contents (filename : String) return String is target_file : TIO.File_Type; contents : JT.Text := JT.blank; begin TIO.Open (File => target_file, Mode => TIO.In_File, Name => filename); if not TIO.End_Of_File (target_file) then contents := JT.SUS (TIO.Get_Line (target_file)); end if; TIO.Close (target_file); return JT.USS (contents); end one_line_file_contents; ------------------------- -- valid_system_root -- ------------------------- function valid_system_root return Boolean is begin if REP.boot_modules_directory_missing then TIO.Put_Line ("The /boot directory is optional, but when it exists, " & "the /boot/modules directory must also exist."); TIO.Put ("Please create the "); if not JT.equivalent (PM.configuration.dir_system, "/") then TIO.Put (JT.USS (PM.configuration.dir_system)); end if; TIO.Put_Line ("/boot/modules directory and retry."); return False; end if; return True; end valid_system_root; ------------------------------------------ -- host_pkg8_conservative_upgrade_set -- ------------------------------------------ function host_pkg8_conservative_upgrade_set return Boolean is command : constant String := host_pkg8 & " config CONSERVATIVE_UPGRADE"; content : JT.Text; topline : JT.Text; begin content := CYC.generic_system_command (command); JT.nextline (lineblock => content, firstline => topline); return JT.equivalent (topline, "yes"); end host_pkg8_conservative_upgrade_set; ----------------------------------- -- TERM_defined_in_environment -- ----------------------------------- function TERM_defined_in_environment return Boolean is defined : constant Boolean := Unix.env_variable_defined ("TERM"); begin if not defined then TIO.Put_Line ("Please define TERM in environment first and retry."); end if; return defined; end TERM_defined_in_environment; ------------------------- -- ensure_port_index -- ------------------------- function ensure_port_index return Boolean is index_file : constant String := "/var/cache/synth/" & JT.USS (PM.configuration.profile) & "-index"; needs_gen : Boolean := True; tree_newer : Boolean; valid_check : Boolean; answer : Character; portsdir : constant String := JT.USS (PM.configuration.dir_portsdir); command : constant String := "/usr/bin/touch " & index_file; stars : String (1 .. 67) := (others => '*'); msg1 : String := " The ports tree has at least one file newer than the flavor index."; msg2 : String := " However, port directories perfectly match. Should the index be"; msg3 : String := " regenerated? (Y/N) "; begin if AD.Exists (index_file) then tree_newer := index_out_of_date (index_file, valid_check); if not valid_check then return False; end if; if tree_newer then if Unix.env_variable_defined ("TERM") then if tree_directories_match (index_file, portsdir) then TIO.Put_Line (stars); TIO.Put_Line (msg1); TIO.Put_Line (msg2); TIO.Put (msg3); loop Ada.Text_IO.Get_Immediate (answer); case answer is when 'Y' | 'y' => TIO.Put_Line ("yes"); exit; when 'N' | 'n' => TIO.Put_Line ("no"); if Unix.external_command (command) then needs_gen := False; end if; exit; when others => null; end case; end loop; TIO.Put_Line (stars); end if; end if; else needs_gen := False; end if; end if; if needs_gen then return generate_ports_index (index_file, portsdir); else return True; end if; end ensure_port_index; ------------------------- -- index_out_of_date -- ------------------------- function index_out_of_date (index_file : String; valid : out Boolean) return Boolean is index_file_modtime : CAL.Time; result : Boolean; begin valid := False; begin index_file_modtime := AD.Modification_Time (index_file); exception when AD.Use_Error => TIO.Put_Line ("File system doesn't support modification times, must eject!"); return False; when others => TIO.Put_Line ("index_out_of_date: problem getting index file modification time"); return False; end; result := PortScan.tree_newer_than_reference (portsdir => JT.USS (PM.configuration.dir_portsdir), reference => index_file_modtime, valid => valid); if valid then return result; else TIO.Put_Line ("Failed to determine if index is out of date, must eject!"); return False; end if; end index_out_of_date; ------------------------------ -- tree_directories_match -- ------------------------------ function tree_directories_match (index_file, portsdir : String) return Boolean is procedure flavor_line (cursor : string_crate.Cursor); last_entry : JT.Text; broken : Boolean := False; procedure flavor_line (cursor : string_crate.Cursor) is line : constant String := JT.USS (string_crate.Element (Position => cursor)); catport : JT.Text := JT.SUS (JT.part_1 (line, "@")); begin if not broken then if not JT.equivalent (last_entry, catport) then last_entry := catport; if ports_keys.Contains (catport) then ports_keys.Delete (catport); else broken := True; end if; end if; end if; end flavor_line; begin load_index_for_store_origins; prescan_ports_tree (portsdir); so_serial.Iterate (flavor_line'Access); if not broken then -- Every port on the flavor index is present in the ports tree -- We still need to check that there are not ports in the tree not listed in index if not ports_keys.Is_Empty then broken := True; end if; end if; reset_ports_tree; clear_store_origin_data; return not broken; end tree_directories_match; end PortScan.Pilot;
test/asm_exe/group2.asm
nigelperks/BasicAssembler
0
172558
<filename>test/asm_exe/group2.asm IDEAL ; Two segments in group. ASSUME segment. ASSUME CS:SEG1, DS:SEG0, ES:SEG0 SEGMENT SEG0 DB 1024 DUP (00h) DB 1024 DUP (01h) DB 1024 DUP (02h) DB 1024 DUP (03h) DB 1024 DUP (04h) DB 1024 DUP (05h) DB 1024 DUP (06h) DB 1024 DUP (07h) DB 1024 DUP (08h) DB 1024 DUP (09h) DB 1024 DUP (0Ah) DB 1024 DUP (0Bh) DB 1024 DUP (0Ch) DB 1024 DUP (0Dh) DB 1024 DUP (0Eh) DB 1024 DUP (0Fh) ENDS SEG0 SEGMENT SEG1 start: mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 mov ax, [1234h] ; a1 34 12 mov dx, 5678h ; ba 78 56 int 20h ; cd 20 ENDS SEG1 GROUP GROUP1 SEG0, SEG1 END start
library/fmGUI_Menus/fmGUI_ClearContents.applescript
NYHTC/applescript-fm-helper
1
4559
-- fmGUI_ClearContents() -- <NAME>, NYHTC -- Clear contents/selected objects (* HISTORY: 1.0.1 - 2017-11-06 ( eshagdar ): updated handler to wait for the menu item. 1.0 - 2016-10-28 ( eshagdar ): first created REQUIRES: fmGUI_AppFrontMost fmGUI_ClickMenuItem *) on run fmGUI_ClearContents() end run -------------------- -- START OF CODE -------------------- on fmGUI_ClearContents() -- version 1.0.1, <NAME> try fmGUI_AppFrontMost() tell application "System Events" tell application process "FileMaker Pro Advanced" set ClearMenuItem to first menu item of menu 1 of menu bar item "Edit" of menu bar 1 whose name is "Clear" end tell end tell return fmGUI_ClickMenuItem({menuItemRef:ClearMenuItem}) on error errMsg number errNum error "Couldn't fmGUI_ClearContents - " & errMsg number errNum end try end fmGUI_ClearContents -------------------- -- END OF CODE -------------------- on fmGUI_AppFrontMost() tell application "htcLib" to fmGUI_AppFrontMost() end fmGUI_AppFrontMost on fmGUI_ClickMenuItem(prefs) set prefs to {menuItemRef:my coerceToString(menuItemRef of prefs)} & prefs tell application "htcLib" to fmGUI_ClickMenuItem(prefs) end fmGUI_ClickMenuItem on coerceToString(incomingObject) -- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ). tell application "Finder" to set coercePath to (container of (container of (path to me)) as text) & "text parsing:coerceToString.applescript" set codeCoerce to read file coercePath as text tell application "htcLib" to set codeCoerce to "script codeCoerce " & return & getTextBetween({sourceText:codeCoerce, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeCoerce" set codeCoerce to run script codeCoerce tell codeCoerce to coerceToString(incomingObject) end coerceToString
regtests/are-generator-ada2012-tests.adb
stcarrez/resource-embedder
7
4390
<filename>regtests/are-generator-ada2012-tests.adb ----------------------------------------------------------------------- -- are-generator-ada2012-tests -- Tests for Ada generator -- Copyright (C) 2021 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Directories; with Util.Test_Caller; package body Are.Generator.Ada2012.Tests is Expect_Dir : constant String := "regtests/expect/ada/"; function Tool return String; package Caller is new Util.Test_Caller (Test, "Are.Generator.Ada"); function Tool return String is begin return "bin/are" & Are.Testsuite.EXE; end Tool; procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Are.To_Ada_Name", Test_Ada_Names'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada1", Test_Generate_Ada1'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada2", Test_Generate_Ada2'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada3", Test_Generate_Ada3'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada4", Test_Generate_Ada4'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada5", Test_Generate_Ada5'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada6", Test_Generate_Ada6'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada7", Test_Generate_Ada7'Access); Caller.Add_Test (Suite, "Test Are.Generate_Ada8", Test_Generate_Ada8'Access); Caller.Add_Test (Suite, "Test Are.Generate_Merge", Test_Generate_Merge'Access); Caller.Add_Test (Suite, "Test Are.Generate_Concat", Test_Generate_Concat'Access); Caller.Add_Test (Suite, "Test Are.Generate_Bundle", Test_Generate_Bundle'Access); Caller.Add_Test (Suite, "Test Are.Generate_Lines", Test_Generate_Lines'Access); end Add_Tests; procedure Test_Generate_Ada1 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-1/web"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --name-access --content-only --resource=Resources1 --fileset '**/*' " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources1.ads")), "Resource file 'resources1.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources1.adb")), "Resource file 'resources1.adb' not generated"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-1/test1.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test1" & Are.Testsuite.EXE), "Binary file 'bin/test1' not created"); T.Execute ("bin/test1" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS: body { background: #eee; }" & "p { color: #2a2a2a; }", Result, "Invalid generation"); end Test_Generate_Ada1; procedure Test_Generate_Ada2 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-2"; Rule : constant String := "regtests/files/test-ada-2/package.xml"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --name-access --content-only --rule=" & Rule & " " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources2.ads")), "Resource file 'resources2.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources2.adb")), "Resource file 'resources2.adb' not generated"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-2/test2.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test2" & Are.Testsuite.EXE), "Binary file 'bin/test2' not created"); T.Execute ("bin/test2" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS", Result, "Invalid generation"); end Test_Generate_Ada2; procedure Test_Generate_Ada3 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-3"; Rule : constant String := "regtests/files/test-ada-3/package.xml"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --no-type-declaration --content-only --name-access --rule=" & Rule & " " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resource-web.ads")), "Resource file 'resource-web.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resource-web.adb")), "Resource file 'resource-web.adb' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resource-config.ads")), "Resource file 'resource-config.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resource-config.adb")), "Resource file 'resource-config.adb' not generated"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-3/test3.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test3" & Are.Testsuite.EXE), "Binary file 'bin/test3' not created"); T.Execute ("bin/test3" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS: <config></config>", Result, "Invalid generation"); end Test_Generate_Ada3; procedure Test_Generate_Ada4 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-4"; Rule : constant String := "regtests/files/test-ada-4/package.xml"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --name-access --content-only --rule=" & Rule & " " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resource4.ads")), "Resource file 'resource4.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resource4.adb")), "Resource file 'resource4.adb' not generated"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-4/test4.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test4" & Are.Testsuite.EXE), "Binary file 'bin/test4' not created"); T.Execute ("bin/test4" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS: <config>test4</config>", Result, "Invalid generation"); end Test_Generate_Ada4; procedure Test_Generate_Ada5 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-5/web"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --name-access --content-only --var-prefix Id_" & " --resource=Resources5 --fileset '**/*' " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources5.ads")), "Resource file 'resources5.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources5.adb")), "Resource file 'resources5.adb' not generated"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-5/test5.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test5" & Are.Testsuite.EXE), "Binary file 'bin/test5' not created"); T.Execute ("bin/test5" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS: body { background: #eee; }p" & " { color: #2a2a2a; }", Result, "Invalid generation"); end Test_Generate_Ada5; procedure Test_Generate_Ada6 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-6/web"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --content-only --var-prefix Id_ --resource=Resources6 --fileset '**/*' " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources6.ads")), "Resource file 'resources6.ads' not generated"); T.Assert (not Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources6.adb")), "Resource file 'resources6.adb' was generated (expecting no body)"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-6/test6.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test6" & Are.Testsuite.EXE), "Binary file 'bin/test6' not created"); T.Execute ("bin/test6" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS: body { background: #eee; }p " & "{ color: #2a2a2a; }", Result, "Invalid generation"); end Test_Generate_Ada6; procedure Test_Generate_Ada7 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-7"; Rule : constant String := "regtests/files/test-ada-7/package.xml"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --ignore-case --name-access --content-only --rule=" & Rule & " " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources7.ads")), "Resource file 'resources7.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources7.adb")), "Resource file 'resources7.adb' not generated"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-7/test7.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test7" & Are.Testsuite.EXE), "Binary file 'bin/test7' not created"); T.Execute ("bin/test7" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS: <config>test7</config>", Result, "Invalid generation"); end Test_Generate_Ada7; procedure Test_Generate_Ada8 (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "regtests/files/test-ada-8"; Rule : constant String := "regtests/files/test-ada-8/package.xml"; Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the resources.ad[bs] files T.Execute (Tool & " -o " & Dir & " --ignore-case --name-access --content-only --rule=" & Rule & " " & Web, Result); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources8.ads")), "Resource file 'resources8.ads' not generated"); T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources8.adb")), "Resource file 'resources78.adb' not generated"); -- Build the test program. T.Execute ("gprbuild -Pregtests/files/test-ada-8/test8.gpr", Result); T.Assert (Ada.Directories.Exists ("bin/test8" & Are.Testsuite.EXE), "Binary file 'bin/test8' not created"); T.Execute ("bin/test8" & Are.Testsuite.EXE, Result); Util.Tests.Assert_Matches (T, "PASS: " & ASCII.HT & "<config>.*", Result, "Invalid generation"); Util.Tests.Assert_Matches (T, ".*éèà@.*", Result, "Invalid generation"); end Test_Generate_Ada8; procedure Test_Generate_Merge (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "examples/c-web"; Rule : constant String := "examples/c-web/package.xml"; Web_Ads : constant String := Ada.Directories.Compose (Dir, "web.ads"); Web_Adb : constant String := Ada.Directories.Compose (Dir, "web.adb"); Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the web.ad[bs] files T.Execute (Tool & " -o " & Dir & " --content-only --name-access --rule=" & Rule & " " & Web, Result); T.Assert (Ada.Directories.Exists (Web_Ads), "Resource file 'web.ads' not generated"); T.Assert (Ada.Directories.Exists (Web_Adb), "Resource file 'web.adb' not generated"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "web.ads"), Test => Web_Ads, Message => "Invalid Ada spec generation"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "web.adb"), Test => Web_Adb, Message => "Invalid Ada body generation"); end Test_Generate_Merge; procedure Test_Generate_Concat (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Rule : constant String := "regtests/files/package-concat.xml"; Concat_Ads : constant String := Ada.Directories.Compose (Dir, "concat.ads"); Concat_Adb : constant String := Ada.Directories.Compose (Dir, "concat.adb"); Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the concat.ad[bs] files T.Execute (Tool & " -o " & Dir & " --content-only --name-access --rule=" & Rule & " " & " regtests/files/test-ada-2 regtests/files/test-ada-3" & " regtests/files/test-ada-4 regtests/files/test-c-1", Result); T.Assert (Ada.Directories.Exists (Concat_Ads), "Resource file 'concat.ads' not generated"); T.Assert (Ada.Directories.Exists (Concat_Adb), "Resource file 'concat.adb' not generated"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "concat.ads"), Test => Concat_Ads, Message => "Invalid Ada spec generation"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "concat.adb"), Test => Concat_Adb, Message => "Invalid Ada body generation"); end Test_Generate_Concat; procedure Test_Generate_Bundle (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Web : constant String := "examples/ada-bundles"; Rule : constant String := "examples/ada-bundles/package.xml"; Bundle_Ads : constant String := Ada.Directories.Compose (Dir, "bundle.ads"); Bundle_Adb : constant String := Ada.Directories.Compose (Dir, "bundle.adb"); Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the bundle.ad[bs] files T.Execute (Tool & " -o " & Dir & " --content-only --name-access --rule=" & Rule & " " & Web, Result); T.Assert (Ada.Directories.Exists (Bundle_Ads), "Resource file 'bundle.ads' not generated"); T.Assert (Ada.Directories.Exists (Bundle_Adb), "Resource file 'bundle.adb' not generated"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "bundle.ads"), Test => Bundle_Ads, Message => "Invalid Ada spec generation"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "bundle.adb"), Test => Bundle_Adb, Message => "Invalid Ada body generation"); end Test_Generate_Bundle; procedure Test_Generate_Lines (T : in out Test) is Dir : constant String := Util.Tests.Get_Test_Path (""); Rule : constant String := "regtests/files/package-lines.xml"; Files : constant String := "regtests/files"; Lines_Ads : constant String := Ada.Directories.Compose (Dir, "lines.ads"); Result : Ada.Strings.Unbounded.Unbounded_String; begin -- Generate the lines.ads files T.Execute (Tool & " -o " & Dir & " --content-only --var-prefix Id_ --rule=" & Rule & " " & Files & "/lines-empty", Result); T.Assert (Ada.Directories.Exists (Lines_Ads), "Resource file 'lines.ads' not generated"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "lines-empty.ads"), Test => Lines_Ads, Message => "Invalid Ada spec generation"); Ada.Directories.Delete_File (Lines_Ads); T.Execute (Tool & " -o " & Dir & " --content-only --var-prefix Id_ --rule=" & Rule & " " & Files & "/lines-single", Result); T.Assert (Ada.Directories.Exists (Lines_Ads), "Resource file 'lines.ads' not generated"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "lines-single.ads"), Test => Lines_Ads, Message => "Invalid Ada spec generation"); Ada.Directories.Delete_File (Lines_Ads); T.Execute (Tool & " -o " & Dir & " --content-only --var-prefix Id_ --rule=" & Rule & " " & Files & "/lines-multiple", Result); T.Assert (Ada.Directories.Exists (Lines_Ads), "Resource file 'lines.ads' not generated"); Util.Tests.Assert_Equal_Files (T => T, Expect => Util.Tests.Get_Path (Expect_Dir & "lines-multiple.ads"), Test => Lines_Ads, Message => "Invalid Ada spec generation"); end Test_Generate_Lines; procedure Test_Ada_Names (T : in out Test) is begin Util.Tests.Assert_Equals (T, "Id_file_c", To_Ada_Name ("Id_", "file.c"), "Bad conversion"); Util.Tests.Assert_Equals (T, "Id_file_name_h", To_Ada_Name ("Id_", "file-name.h"), "Bad conversion"); Util.Tests.Assert_Equals (T, "Plop_File_Dat", To_Ada_Name ("Plop_", "File.Dat"), "Bad conversion"); Util.Tests.Assert_Equals (T, "Id_File23_Dat", To_Ada_Name ("Id_", "File 23 .Dat"), "Bad conversion"); end Test_Ada_Names; end Are.Generator.Ada2012.Tests;
libsrc/gfx/portable/drawto.asm
Frodevan/z88dk
640
243633
<filename>libsrc/gfx/portable/drawto.asm SECTION code_graphics PUBLIC drawto PUBLIC _drawto EXTERN commondrawto EXTERN plot ;void drawto(int x2, int y2) __smallc ;Note ints are actually uint8_t drawto: _drawto: ld hl,plot jp commondrawto
source/amf/ocl/amf-internals-factories-ocl_module_factory-construct_union.adb
svn2github/matreshka
24
6210
<filename>source/amf/ocl/amf-internals-factories-ocl_module_factory-construct_union.adb ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2013, <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. ------------------------------------------------------------------------------ with AMF.Internals.Links; with AMF.Internals.Tables.OCL_Element_Table; with AMF.Internals.Tables.OCL_Types; with AMF.Internals.Tables.UML_Metamodel; separate (AMF.Internals.Factories.OCL_Module_Factory) procedure Construct_Union (Element : AMF.Internals.AMF_Element; Property : AMF.Internals.CMOF_Element; Link : AMF.Internals.AMF_Link) is Element_Kind : constant AMF.Internals.Tables.OCL_Types.Element_Kinds := AMF.Internals.Tables.OCL_Element_Table.Table (Element).Kind; Opposite : constant AMF.Internals.AMF_Element := AMF.Internals.Links.Opposite_Element (Link, Element); begin case Element_Kind is when AMF.Internals.Tables.OCL_Types.E_OCL_State_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Property_Call_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Collection_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Attribute_Property_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Attribute_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Operation_Operation_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Tuple_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Bag_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Attribute_Property_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Attribute_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Operation_Operation_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Tuple_Literal_Part => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Variable_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Boolean_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Void_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Tuple_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Attribute_Property_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Attribute_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Operation_Operation_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Set_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Attribute_Property_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Attribute_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Operation_Operation_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Null_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Type_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Sequence_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Attribute_Property_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Attribute_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Operation_Operation_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Expression_In_Ocl => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Ordered_Set_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Attribute_Property_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Attribute_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Data_Type_Owned_Operation_Operation_Datatype then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Invalid_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Template_Parameter_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Any_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Message_Type => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Attribute_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Classifier_Feature_Featuring_Classifier, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Collaboration_Use_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Element_Import_Element_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Feature_Feature_Featuring_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Imported_Member_A_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Inherited_Member_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Member_Named_Element_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Member_Member_Namespace, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Owned_Rule_Constraint_Context then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Template_Signature_Redefinable_Template_Signature_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Templateable_Element_Owned_Template_Signature_Template, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Owned_Template_Signature_Template_Signature_Template then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Owned_Use_Case_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Namespace_Owned_Member_Namespace, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Parameterable_Element_Owning_Template_Parameter_Template_Parameter_Owned_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Namespace_Package_Import_Package_Import_Importing_Namespace then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Redefined_Classifier_A_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Redefinable_Element_Redefined_Element_Redefinable_Element, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Substitution_Substitution_Substituting_Classifier then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Templateable_Element_Template_Binding_Template_Binding_Bound_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Classifier_Template_Parameter_Classifier_Template_Parameter_Parametered_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Template_Parameter_Parametered_Element_Template_Parameter, Opposite, Element, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Iterator_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Unlimited_Natural_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_String_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Integer_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Enum_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Invalid_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Operation_Call_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_If_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Association_Class_Call_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Real_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Iterate_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Message_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Let_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Collection_Literal_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Unspecified_Value_Exp => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Variable => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Collection_Item => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when AMF.Internals.Tables.OCL_Types.E_OCL_Collection_Range => if Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Named_Element_Name_Expression_A_Named_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Opposite, Element, Link); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then AMF.Internals.Links.Create_Link (AMF.Internals.Tables.UML_Metamodel.MA_UML_Element_Owned_Element_Owner, Element, Opposite, Link); end if; when others => null; end case; end Construct_Union;
oeis/228/A228310.asm
neoneye/loda-programs
11
104526
<gh_stars>10-100 ; A228310: The hyper-Wiener index of the hypercube graph Q(n) (n>=2). ; Submitted by <NAME> ; 10,72,448,2560,13824,71680,360448,1769472,8519680,40370176,188743680,872415232,3992977408,18119393280,81604378624,365072220160,1623497637888,7181185318912,31610959298560,138538465099776,604731395276800,2630031813640192 add $0,2 mov $2,4 pow $2,$0 mul $2,$0 add $0,3 mul $0,$2 div $0,32 mul $0,2
src/exit.asm
yoshuawuyts/spec-x86
2
18413
<filename>src/exit.asm ; Program: exit ; ; Executes the exit system call ; ; No input ; ; Output: only the exit status segment .text global _start _start: mov eax,1 mov ebx,5 int 0x80
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_562.asm
ljhsiun2/medusa
9
96125
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r8 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x1b652, %r8 nop nop nop cmp %rbp, %rbp movups (%r8), %xmm7 vpextrq $1, %xmm7, %rbx nop cmp $23457, %rbp lea addresses_WC_ht+0xfb2a, %rsi and %r11, %r11 movups (%rsi), %xmm6 vpextrq $0, %xmm6, %r10 nop nop nop nop nop sub %r10, %r10 lea addresses_WC_ht+0x14e6a, %rbp nop nop nop nop nop sub %r8, %r8 mov $0x6162636465666768, %rbx movq %rbx, (%rbp) xor %r10, %r10 lea addresses_UC_ht+0xdb2a, %rsi sub %r9, %r9 movb (%rsi), %r8b nop nop nop sub %rbx, %rbx lea addresses_normal_ht+0x1b12a, %r10 nop nop inc %r11 vmovups (%r10), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $0, %xmm6, %rbp dec %r9 lea addresses_D_ht+0x177dc, %rsi nop nop nop nop nop cmp %r8, %r8 mov (%rsi), %ebx xor %r11, %r11 lea addresses_D_ht+0x8c84, %rbp nop nop cmp $15670, %rbx mov $0x6162636465666768, %r8 movq %r8, %xmm1 vmovups %ymm1, (%rbp) cmp $5268, %r8 lea addresses_D_ht+0x1d72a, %rsi lea addresses_normal_ht+0x12780, %rdi nop nop nop nop nop add %r10, %r10 mov $11, %rcx rep movsl add $57364, %r10 lea addresses_normal_ht+0xa72a, %rdi nop nop nop nop add %r10, %r10 movups (%rdi), %xmm0 vpextrq $0, %xmm0, %rbx dec %r10 lea addresses_UC_ht+0xa7aa, %rsi lea addresses_WC_ht+0xe72a, %rdi nop nop nop nop and $18866, %r10 mov $113, %rcx rep movsl nop nop nop mfence lea addresses_UC_ht+0x19f6a, %rdi sub $31920, %rbp movb (%rdi), %cl mfence lea addresses_normal_ht+0x248a, %rbp nop nop nop xor %r9, %r9 mov (%rbp), %r11w nop nop nop nop inc %r8 lea addresses_normal_ht+0x29ca, %r10 nop nop nop nop nop sub %r8, %r8 vmovups (%r10), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %rcx nop nop add %rbx, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r8 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %r8 push %rdx push %rsi // Store lea addresses_PSE+0x1ff2a, %rdx nop nop nop nop and %r8, %r8 movl $0x51525354, (%rdx) nop nop nop nop nop dec %r15 // Faulty Load lea addresses_PSE+0x1ff2a, %r12 nop nop nop nop and $24543, %rdx movb (%r12), %r8b lea oracles, %rsi and $0xff, %r8 shlq $12, %r8 mov (%rsi,%r8,1), %r8 pop %rsi pop %rdx pop %r8 pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_PSE', 'congruent': 0}} {'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_PSE', 'congruent': 0}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_PSE', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 3}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 10}} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 6}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 10}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_normal_ht', 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 1}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 1}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 11}} {'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 3}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_normal_ht', 'congruent': 5}} {'54': 21829} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
bb-runtimes/src/s-bbbosu__nrf51.adb
JCGobbi/Nucleo-STM32G474RE
0
189
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B B . B O A R D _ S U P P O R T -- -- -- -- B o d y -- -- -- -- Copyright (C) 1999-2002 Universidad Politecnica de Madrid -- -- Copyright (C) 2003-2005 The European Space Agency -- -- Copyright (C) 2003-2018, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- -- The port of GNARL to bare board targets was initially developed by the -- -- Real-Time Systems Group at the Technical University of Madrid. -- -- -- ------------------------------------------------------------------------------ with System.Machine_Code; with System.BB.CPU_Primitives; with System.BB.Board_Parameters; with Interfaces.NRF51; use Interfaces.NRF51; with Interfaces.NRF51.RTC; use Interfaces.NRF51.RTC; with Interfaces.NRF51.CLOCK; use Interfaces.NRF51.CLOCK; package body System.BB.Board_Support is use CPU_Primitives, BB.Interrupts, Machine_Code, Time; package BBOPA renames System.BB.Board_Parameters; Interrupt_Request_Vector : constant Vector_Id := 16; -- See vector definitions in ARMv7-M version of System.BB.CPU_Primitives. -- Defined by ARMv7-M specifications. Alarm_Time : Time.Timer_Interval; pragma Volatile (Alarm_Time); pragma Export (C, Alarm_Time, "__gnat_alarm_time"); Alarm_Interrupt_ID : constant Interrupt_ID := 11; ------------------- -- RTC0 Handling -- ------------------- Tick_Period : constant Time.Timer_Interval := BBOPA.Clock_Frequency / (32_768 / (BBOPA.RTC_Prescaler + 1)); Next_Tick_Time : Timer_Interval with Volatile; -- Time when systick will expire. This gives the high digits of the time ---------------------------------------------- -- New Vectored Interrupt Controller (NVIC) -- ---------------------------------------------- NVIC_Base : constant := 16#E000_E000#; -- Nested Vectored Interrupt Controller (NVIC) base. NVIC_ISER0 : constant Address := NVIC_Base + 16#100#; -- Writing a bit mask to this register enables the corresponding interrupts type PRI is mod 2**8; -- Type for ARMv7-M interrupt priorities. Note that 0 is the highest -- priority, which is reserved for the kernel and has no corresponding -- Interrupt_Priority value, and 255 is the lowest. We assume the PRIGROUP -- setting is such that the 4 most significant bits determine the priority -- group used for preemption. However, if less bits are implemented, this -- should still work. function To_PRI (P : Integer) return PRI is (if P not in Interrupt_Priority then 0 else PRI (Interrupt_Priority'Last - P + 1) * 16); -- Return the BASEPRI mask for the given Ada priority. Note that the zero -- value here means no mask, so no interrupts are masked. function To_Priority (P : PRI) return Interrupt_Priority is (if P = 0 then Interrupt_Priority'Last else (Interrupt_Priority'Last - Any_Priority'Base (P / 16) + 1)); -- Given an ARM interrupt priority (PRI value), determine the Ada priority -- While the value 0 is reserved for the kernel and has no Ada priority -- that represents it, Interrupt_Priority'Last is closest. IP : array (0 .. Interrupt_ID'Last) of PRI with Volatile, Address => 16#E000_E400#; -- Local utility functions procedure Enable_Interrupt_Request (Interrupt : Interrupt_ID; Prio : Interrupt_Priority); -- Enable interrupt requests for the given interrupt procedure Interrupt_Handler; -- Low-level interrupt handlers ---------------------- -- Initialize_Board -- ---------------------- procedure Initialize_Board is begin -- Mask interrupts Disable_Interrupts; -- Timer -- -- Configure the low frequency clock required for RTC0 CLOCK_Periph.LFCLKSRC.SRC := Rc; -- Use internal RC oscillator -- Start the low frequency clock CLOCK_Periph.TASKS_LFCLKSTART := 1; -- Wait until the low frequency clock is started while CLOCK_Periph.EVENTS_LFCLKSTARTED = 0 loop null; end loop; -- We run the counter at 32.768KHz RTC0_Periph.PRESCALER.PRESCALER := BBOPA.RTC_Prescaler; RTC0_Periph.INTENSET.TICK := Set; RTC0_Periph.EVTENSET.TICK := Set; Next_Tick_Time := Tick_Period; Time.Set_Alarm (Timer_Interval'Last); Time.Clear_Alarm_Interrupt; -- We do not start the timer until the handler is ready to receive the -- interrupt, i.e. in Install_Alarm_Handler. -- Interrupts -- Install_Trap_Handler (Interrupt_Handler'Address, Interrupt_Request_Vector); end Initialize_Board; package body Time is Upper_Alarm_Handler : BB.Interrupts.Interrupt_Handler := null; procedure Pre_Alarm_Handler (Id : Interrupt_ID); ----------------------- -- Pre_Alarm_Handler -- ----------------------- procedure Pre_Alarm_Handler (Id : Interrupt_ID) is begin Next_Tick_Time := Next_Tick_Time + Tick_Period; pragma Assert (Upper_Alarm_Handler /= null); Upper_Alarm_Handler (Id); end Pre_Alarm_Handler; ------------------------ -- Max_Timer_Interval -- ------------------------ function Max_Timer_Interval return Timer_Interval is (2**32 - 1); ---------------- -- Read_Clock -- ---------------- function Read_Clock return BB.Time.Time is PRIMASK : Word; Res : Timer_Interval; begin -- As several registers and variables need to be read or modified, do -- it atomically. Asm ("mrs %0, PRIMASK", Outputs => Word'Asm_Output ("=&r", PRIMASK), Volatile => True); Asm ("msr PRIMASK, %0", Inputs => Word'Asm_Input ("r", 1), Volatile => True); Res := Next_Tick_Time; -- Restore interrupt mask Asm ("msr PRIMASK, %0", Inputs => Word'Asm_Input ("r", PRIMASK), Volatile => True); return BB.Time.Time (Res); end Read_Clock; --------------------------- -- Clear_Alarm_Interrupt -- --------------------------- procedure Clear_Alarm_Interrupt is begin RTC0_Periph.EVENTS_TICK := 0; end Clear_Alarm_Interrupt; --------------- -- Set_Alarm -- --------------- procedure Set_Alarm (Ticks : Timer_Interval) is Now : constant Timer_Interval := Timer_Interval (Read_Clock); begin -- As we will have periodic interrupts for alarms regardless, the -- only thing to do is force an interrupt if the alarm has already -- expired. Alarm_Time := Now + Timer_Interval'Min (Timer_Interval'Last / 2, Ticks); -- FIXME: We can't do that with RTC0 -- if Ticks = 0 then -- ICSR := ICSR_Pend_ST_Set; -- end if; end Set_Alarm; --------------------------- -- Install_Alarm_Handler -- --------------------------- procedure Install_Alarm_Handler (Handler : BB.Interrupts.Interrupt_Handler) is begin pragma Assert (Upper_Alarm_Handler = null); Upper_Alarm_Handler := Handler; BB.Interrupts.Attach_Handler (Pre_Alarm_Handler'Access, Alarm_Interrupt_ID, Interrupt_Priority'Last); -- Clear pending timer interrupt if any Time.Clear_Alarm_Interrupt; -- Now that the interrupt handler is attached, we can start the timer RTC0_Periph.TASKS_START := 1; end Install_Alarm_Handler; end Time; package body Multiprocessors is separate; ----------------------- -- Interrupt_Handler -- ----------------------- procedure Interrupt_Handler is Id : Interrupt_ID; Res : Word; PRIMASK : Word; begin Asm ("mrs %0, PRIMASK", Outputs => Word'Asm_Output ("=&r", PRIMASK), Volatile => True); Asm ("msr PRIMASK, %0", Inputs => Word'Asm_Input ("r", 1), Volatile => True); -- The exception number is read from the IPSR Asm ("mrs %0, ipsr", Word'Asm_Output ("=r", Res), Volatile => True); Res := Res and 16#FF#; -- Convert it to IRQ number by substracting 16 (number of cpu -- exceptions). Id := Interrupt_ID'Base (Res) - 16; Interrupt_Wrapper (Id); -- Restore interrupt mask Asm ("msr PRIMASK, %0", Inputs => Word'Asm_Input ("r", PRIMASK), Volatile => True); end Interrupt_Handler; ------------------------------ -- Enable_Interrupt_Request -- ------------------------------ procedure Enable_Interrupt_Request (Interrupt : Interrupt_ID; Prio : Interrupt_Priority) is begin if Interrupt = Alarm_Interrupt_ID then -- Consistency check with Priority_Of_Interrupt pragma Assert (Prio = Interrupt_Priority'Last); Time.Clear_Alarm_Interrupt; end if; declare pragma Assert (Interrupt >= 0); IRQ : constant Natural := Interrupt; Regofs : constant Natural := IRQ / 32; Regbit : constant Word := 2** (IRQ mod 32); NVIC_ISER : array (0 .. 15) of Word with Volatile, Address => NVIC_ISER0; -- Many NVIC registers use 16 words of 32 bits each to serve as a -- bitmap for all interrupt channels. Regofs indicates register -- offset (0 .. 15), and Regbit indicates the mask required for -- addressing the bit. begin NVIC_ISER (Regofs) := Regbit; end; end Enable_Interrupt_Request; package body Interrupts is ------------------------------- -- Install_Interrupt_Handler -- ------------------------------- procedure Install_Interrupt_Handler (Interrupt : Interrupt_ID; Prio : Interrupt_Priority) is begin if Interrupt /= Alarm_Interrupt_ID then IP (Interrupt) := To_PRI (Prio); end if; Enable_Interrupt_Request (Interrupt, Prio); end Install_Interrupt_Handler; --------------------------- -- Priority_Of_Interrupt -- --------------------------- function Priority_Of_Interrupt (Interrupt : Interrupt_ID) return Any_Priority is (if Interrupt = Alarm_Interrupt_ID then Interrupt_Priority'Last else To_Priority (IP (Interrupt))); ---------------- -- Power_Down -- ---------------- procedure Power_Down is begin Asm ("wfi", Volatile => True); end Power_Down; -------------------------- -- Set_Current_Priority -- -------------------------- procedure Set_Current_Priority (Priority : Integer) is begin -- Writing a 0 to BASEPRI disables interrupt masking, while values -- 15 .. 1 correspond to interrupt priorities 255 .. 241 in that -- order. Asm ("msr BASEPRI, %0", Inputs => PRI'Asm_Input ("r", To_PRI (Priority)), Volatile => True); end Set_Current_Priority; end Interrupts; end System.BB.Board_Support;
libsrc/stdio/mz2500/fgetc_cons.asm
jpoikela/z88dk
640
29476
<gh_stars>100-1000 ; ; Sharp MZ2500 Routines ; ; fgetc_cons() Wait for keypress ; <NAME> - 2018 ; ; ; $Id: fgetc_cons.asm $ ; SECTION code_clib PUBLIC fgetc_cons PUBLIC _fgetc_cons .fgetc_cons ._fgetc_cons ld a,1 rst 18h defb 0dh ; _INKEY cp 13 ; was it ENTER ? jr nz,noenter IF STANDARDESCAPECHARS ld a,10 ELSE ; ld a,13 ENDIF .noenter ld l,a ld h,0 ret
TExprParser.g4
aliyun/texpr
14
4881
<reponame>aliyun/texpr parser grammar TExprParser; options { tokenVocab=TExprLexer; } parse : expression EOF ; expression : LPAREN expression RPAREN #parenExpression | NOT expression #notExpression | expression IN container #inExpression | expression NOT IN container #notInExpression | expression MATCH regex #matchExpression | expression IS kind #isTypeExpression | expression IS NOT kind #isNotTypeExpression | expression comparator expression #comparatorExpression | expression binary expression #binaryExpression | variable #variableExpression | calc #calcExpression ; variable : VARIABLE | literal | array ; comparator : GT | GE | LT | LE | EQ | NE ; binary : AND | OR ; boolean : TRUE | FALSE ; literal : Varchar | Integer | Float | Boolean ; container : array | variable | Varchar ; array : LBRACKET integers? RBRACKET | LBRACKET strings? RBRACKET | LBRACKET floats? RBRACKET | LBRACKET booleans? RBRACKET ; calc : bit ; bit : bit BAND shift | bit BEOR shift | bit BIOR shift | shift ; shift : shift LSHIFT plus | shift RSHIFT plus | plus ; plus : plus PLUS multiplying | plus MINUS multiplying | multiplying ; multiplying : multiplying MUL atom | multiplying DIV atom | multiplying MOD atom | atom ; atom : variable | scientific | LPAREN bit RPAREN | function ; scientific : number E number | number ; function : funcname LPAREN parameters RPAREN ; funcname : IDENTIFIER ; parameters : expression (',' expression)* ; number : MINUS? DIGIT + (POINT DIGIT +)? ; regex : REGEX ; kind : IDENTIFIER ; strings : Varchar (COMMA Varchar)* COMMA? ; integers : Integer (COMMA Integer)* COMMA? ; floats : Float (COMMA Float)* COMMA? ; booleans : Boolean (COMMA Boolean)* COMMA? ;
external/source/shellcode/bsd/ia32/stager_sock_reverse_ipv6.asm
OsmanDere/metasploit-framework
26,932
176564
;; ; ; Name: stager_sock_reverse_ipv6 ; Qualities: Can Have Nulls ; Version: $Revision: 1626 $ ; License: ; ; This file is part of the Metasploit Exploit Framework ; and is subject to the same licenses and copyrights as ; the rest of this package. ; ; Description: ; ; Implementation of a BSD reverse TCP stager over IPv6 ; ; File descriptor in edi. ; ; Meta-Information: ; ; meta-shortname=BSD Reverse TCP Stager ; meta-description=Connect back to the framework and run a second stage ; meta-authors=skape <mmiller [at] hick.org>, vlad902 <vlad902 [at] gmail.com>, hdm <hdm [at] metasploit.com> ; meta-os=bsd ; meta-arch=ia32 ; meta-category=stager ; meta-connection-type=reverse ; meta-name=reverse_tcp_ipv6 ; meta-basemod=Msf::PayloadComponent::ReverseConnection ; meta-offset-lhost=43 ; meta-offset-lport=36 ; meta-offset-scope=59 ;; BITS 32 GLOBAL main main: socket: xor eax, eax push eax ; Protocol: (IP=0) inc eax push eax ; Type: (SOCK_STREAM=1) push byte 28 ; Domain: (PF_INET6=28) push byte 97 pop eax ; socket() push eax ; padding int 0x80 jmp short bounce_to_connect connect: pop ecx push byte 28 push ecx push eax %ifdef FD_REG_EBX xchg eax, ebx %else xchg eax, edi %endif push byte 98 pop eax push eax ; padding int 0x80 jmp short skip_bounce bounce_to_connect: call connect ipv6_address: db 28 ; uint8_t sin6_len; /* length of this struct */ db 28 ; sa_family_t sin6_family; /* AF_INET6 */ dw 0xbfbf ; in_port_t sin6_port; /* Transport layer port # */ dd 0 ; uint32_t sin6_flowinfo; /* IP6 flow information */ dd 0 ; struct in6_addr sin6_addr; /* IP6 address */ dd 0 dd 0 dd 0x01000000 ; default to ::1 dd 0 ; uint32_t sin6_scope_id; /* scope zone index */ skip_bounce: %ifndef USE_SINGLE_STAGE read: push byte 0x10 pop edx shl edx, 8 sub esp, edx mov ecx, esp ; Points to 4096 stack buffer push edx ; Length push ecx ; Buffer %ifdef FD_REG_EBX push ebx ; Socket %else push edi ; Socket %endif push ecx ; Buffer to Return mov al, 0x3 int 0x80 ; read(socket, &buff, 4096) ret ; Return %endif
Lession01/Assign.g4
brucexia1/PrjComplier
0
962
<reponame>brucexia1/PrjComplier<filename>Lession01/Assign.g4<gh_stars>0 grammar Assign; assign : ID '=' expr ';' ; ID : [a-z]+ ; expr : NUMBER ; NUMBER : [1-9][0-9]*|[0]|([0-9]+[.][0-9]+) ;
engine/learn_move.asm
longlostsoul/EvoYellow
16
24582
<filename>engine/learn_move.asm LearnMove: call SaveScreenTilesToBuffer1 ld a, [wWhichPokemon] ld hl, wPartyMonNicks call GetPartyMonName ld hl, wcd6d ld de, wLearnMoveMonName ld bc, NAME_LENGTH call CopyData DontAbandonLearning: ld hl, wPartyMon1Moves ld bc, wPartyMon2Moves - wPartyMon1Moves ld a, [wWhichPokemon] call AddNTimes ld d, h ld e, l ld b, NUM_MOVES .findEmptyMoveSlotLoop ld a, [hl] and a jr z, .next inc hl dec b jr nz, .findEmptyMoveSlotLoop push de call TryingToLearn pop de jp c, AbandonLearning push hl push de ld [wd11e], a call GetMoveName ld hl, OneTwoAndText call PrintText pop de pop hl .next ld a, [wMoveNum] ld [hl], a ld bc, wPartyMon1PP - wPartyMon1Moves add hl, bc push hl push de dec a ld hl, Moves ld bc, MoveEnd - Moves call AddNTimes ld de, wBuffer ld a, BANK(Moves) call FarCopyData ld a, [wBuffer + 5] ; a = move's max PP pop de pop hl ld [hl], a ld a, [wIsInBattle] and a jp z, PrintLearnedMove ld a, [wWhichPokemon] ld b, a ld a, [wPlayerMonNumber] cp b jp nz, PrintLearnedMove ld h, d ld l, e ld de, wBattleMonMoves ld bc, NUM_MOVES call CopyData ld bc, wPartyMon1PP - wPartyMon1OTID add hl, bc ld de, wBattleMonPP ld bc, NUM_MOVES call CopyData jp PrintLearnedMove AbandonLearning: ld hl, AbandonLearningText call PrintText coord hl, 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu ld a, [wCurrentMenuItem] and a jp nz, DontAbandonLearning ld hl, DidNotLearnText call PrintText ld b, 0 ret PrintLearnedMove: ld hl, LearnedMove1Text call PrintText ld b, 1 ret TryingToLearn: push hl ld hl, TryingToLearnText call PrintText coord hl, 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu pop hl ld a, [wCurrentMenuItem] rra ret c ld bc, -NUM_MOVES add hl, bc push hl ld de, wMoves ld bc, NUM_MOVES call CopyData callab FormatMovesString pop hl .loop push hl ld hl, WhichMoveToForgetText call PrintText coord hl, 4, 7 lb bc, 4, 14 call TextBoxBorder coord hl, 6, 8 ld de, wMovesString ld a, [hFlags_0xFFFA] set 2, a ld [hFlags_0xFFFA], a call PlaceString ld a, [hFlags_0xFFFA] res 2, a ld [hFlags_0xFFFA], a ld hl, wTopMenuItemY ld a, 8 ld [hli], a ; wTopMenuItemY ld a, 5 ld [hli], a ; wTopMenuItemX xor a ld [hli], a ; wCurrentMenuItem inc hl ld a, [wNumMovesMinusOne] ld [hli], a ; wMaxMenuItem ld a, A_BUTTON | B_BUTTON ld [hli], a ; wMenuWatchedKeys ld [hl], 0 ; wLastMenuItem ld hl, hFlags_0xFFFA set 1, [hl] call HandleMenuInput ld hl, hFlags_0xFFFA res 1, [hl] push af call LoadScreenTilesFromBuffer1 pop af pop hl bit 1, a ; pressed b jr nz, .cancel push hl ld a, [wCurrentMenuItem] ld c, a ld b, 0 add hl, bc ld a, [hl] push af push bc call IsMoveHM pop bc pop de ld a, d ;jr c, .hm pop hl add hl, bc and a ret ;.hm ; ld hl, HMCantDeleteText ; call PrintText ; pop hl ; jr .loop .cancel scf ret LearnedMove1Text: TX_FAR _LearnedMove1Text db $b,6,"@" WhichMoveToForgetText: TX_FAR _WhichMoveToForgetText db "@" AbandonLearningText: TX_FAR _AbandonLearningText db "@" DidNotLearnText: TX_FAR _DidNotLearnText db "@" TryingToLearnText: TX_FAR _TryingToLearnText db "@" OneTwoAndText: ; bugfix: In Red/Blue, the SFX_SWAP sound was played in the wrong bank, which played an incorrect sound ; Yellow has fixed this by swapping to the correct bank TX_FAR _OneTwoAndText db $a TX_ASM push af push bc push de push hl ld a, $1 ld [wMuteAudioAndPauseMusic], a call DelayFrame ld a, [wAudioROMBank] push af ld a, BANK(SFX_Swap_1) ld [wAudioROMBank], a ld [wAudioSavedROMBank], a call WaitForSoundToFinish ld a, SFX_SWAP call PlaySound call WaitForSoundToFinish pop af ld [wAudioROMBank], a ld [wAudioSavedROMBank], a xor a ld [wMuteAudioAndPauseMusic], a pop hl pop de pop bc pop af ld hl, PoofText ret PoofText: TX_FAR _PoofText db $a ForgotAndText: TX_FAR _ForgotAndText db "@" HMCantDeleteText: TX_FAR _HMCantDeleteText db "@"
programs/oeis/116/A116386.asm
karttu/loda
1
167389
; A116386: Number of calendar weeks in the year n (starting at n=0 for the year 2000). ; 54,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,54,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,54,53,53,53,53,53,53,53,53,53,53,53,53 mod $0,28 mov $1,2 trn $1,$0 div $1,2 add $1,53
src/Tactic/Nat/Reflect.agda
lclem/agda-prelude
0
4308
module Tactic.Nat.Reflect where open import Prelude hiding (abs) open import Control.Monad.State open import Control.Monad.Transformer import Agda.Builtin.Nat as Builtin open import Builtin.Reflection open import Tactic.Reflection open import Tactic.Reflection.Quote open import Tactic.Reflection.Meta open import Tactic.Deriving.Quotable open import Tactic.Reflection.Equality open import Tactic.Nat.Exp R = StateT (Nat × List (Term × Nat)) TC fail : ∀ {A} → R A fail = lift (typeErrorS "reflection error") liftMaybe : ∀ {A} → Maybe A → R A liftMaybe = maybe fail pure runR : ∀ {A} → R A → TC (Maybe (A × List Term)) runR r = maybeA (second (reverse ∘ map fst ∘ snd) <$> runStateT r (0 , [])) pattern `Nat = def (quote Nat) [] infixr 1 _`->_ infix 4 _`≡_ pattern _`≡_ x y = def (quote _≡_) (_ ∷ hArg `Nat ∷ vArg x ∷ vArg y ∷ []) pattern _`->_ a b = pi (vArg a) (abs _ b) pattern _`+_ x y = def₂ (quote Builtin._+_) x y pattern _`*_ x y = def₂ (quote Builtin._*_) x y pattern `0 = con₀ (quote Nat.zero) pattern `suc n = con₁ (quote Nat.suc) n fresh : Term → R (Exp Var) fresh t = get >>= uncurry′ λ i Γ → var i <$ put (suc i , (t , i) ∷ Γ) ⟨suc⟩ : ∀ {X} → Exp X → Exp X ⟨suc⟩ (lit n) = lit (suc n) ⟨suc⟩ (lit n ⟨+⟩ e) = lit (suc n) ⟨+⟩ e ⟨suc⟩ e = lit 1 ⟨+⟩ e private forceInstance : Name → Term → R ⊤ forceInstance i v = lift $ unify v (def₀ i) forceSemiring = forceInstance (quote SemiringNat) forceNumber = forceInstance (quote NumberNat) termToExpR : Term → R (Exp Var) termToExpR (a `+ b) = ⦇ termToExpR a ⟨+⟩ termToExpR b ⦈ termToExpR (a `* b) = ⦇ termToExpR a ⟨*⟩ termToExpR b ⦈ termToExpR (def (quote Semiring._+_) (_ ∷ _ ∷ vArg i@(meta x _) ∷ vArg a ∷ vArg b ∷ [])) = do forceSemiring i ⦇ termToExpR a ⟨+⟩ termToExpR b ⦈ termToExpR (def (quote Semiring._*_) (_ ∷ _ ∷ vArg i@(meta x _) ∷ vArg a ∷ vArg b ∷ [])) = do lift $ unify i (def₀ (quote SemiringNat)) ⦇ termToExpR a ⟨*⟩ termToExpR b ⦈ termToExpR (def (quote Semiring.zro) (_ ∷ _ ∷ vArg i@(meta x _) ∷ [])) = do forceSemiring i pure (lit 0) termToExpR (def (quote Semiring.one) (_ ∷ _ ∷ vArg i@(meta x _) ∷ [])) = do forceSemiring i pure (lit 1) termToExpR (def (quote Number.fromNat) (_ ∷ _ ∷ vArg i@(meta x _) ∷ vArg a ∷ _ ∷ [])) = do forceNumber i termToExpR a termToExpR `0 = pure (lit 0) termToExpR (`suc a) = ⟨suc⟩ <$> termToExpR a termToExpR (lit (nat n)) = pure (lit n) termToExpR (meta x _) = lift (blockOnMeta x) termToExpR unknown = fail termToExpR t = do lift (ensureNoMetas t) just i ← gets (flip lookup t ∘ snd) where nothing → fresh t pure (var i) private lower : Nat → Term → R Term lower 0 = pure lower i = liftMaybe ∘ strengthen i termToEqR : Term → R (Exp Var × Exp Var) termToEqR (lhs `≡ rhs) = ⦇ termToExpR lhs , termToExpR rhs ⦈ termToEqR (def (quote _≡_) (_ ∷ hArg (meta x _) ∷ _)) = lift (blockOnMeta x) termToEqR (meta x _) = lift (blockOnMeta x) termToEqR _ = fail termToHypsR′ : Nat → Term → R (List (Exp Var × Exp Var)) termToHypsR′ i (hyp `-> a) = _∷_ <$> (termToEqR =<< lower i hyp) <*> termToHypsR′ (suc i) a termToHypsR′ _ (meta x _) = lift (blockOnMeta x) termToHypsR′ i a = [_] <$> (termToEqR =<< lower i a) termToHypsR : Term → R (List (Exp Var × Exp Var)) termToHypsR = termToHypsR′ 0 termToHyps : Term → TC (Maybe (List (Exp Var × Exp Var) × List Term)) termToHyps t = runR (termToHypsR t) termToEq : Term → TC (Maybe ((Exp Var × Exp Var) × List Term)) termToEq t = runR (termToEqR t) buildEnv : List Nat → Env Var buildEnv [] i = 0 buildEnv (x ∷ xs) zero = x buildEnv (x ∷ xs) (suc i) = buildEnv xs i defaultArg : Term → Arg Term defaultArg = arg (arg-info visible relevant) data ProofError {a} : Set a → Set (lsuc a) where bad-goal : ∀ g → ProofError g qProofError : Term → Term qProofError v = con (quote bad-goal) (defaultArg v ∷ []) implicitArg instanceArg : ∀ {A} → A → Arg A implicitArg = arg (arg-info hidden relevant) instanceArg = arg (arg-info instance′ relevant) unquoteDecl QuotableExp = deriveQuotable QuotableExp (quote Exp) stripImplicitArg : Arg Term → List (Arg Term) stripImplicitArgs : List (Arg Term) → List (Arg Term) stripImplicitAbsTerm : Abs Term → Abs Term stripImplicitArgTerm : Arg Term → Arg Term stripImplicit : Term → Term stripImplicit (var x args) = var x (stripImplicitArgs args) stripImplicit (con c args) = con c (stripImplicitArgs args) stripImplicit (def f args) = def f (stripImplicitArgs args) stripImplicit (meta x args) = meta x (stripImplicitArgs args) stripImplicit (lam v t) = lam v (stripImplicitAbsTerm t) stripImplicit (pi t₁ t₂) = pi (stripImplicitArgTerm t₁) (stripImplicitAbsTerm t₂) stripImplicit (agda-sort x) = agda-sort x stripImplicit (lit l) = lit l stripImplicit (pat-lam cs args) = pat-lam cs (stripImplicitArgs args) stripImplicit unknown = unknown stripImplicitAbsTerm (abs x v) = abs x (stripImplicit v) stripImplicitArgs [] = [] stripImplicitArgs (a ∷ as) = stripImplicitArg a ++ stripImplicitArgs as stripImplicitArgTerm (arg i x) = arg i (stripImplicit x) stripImplicitArg (arg (arg-info visible r) x) = arg (arg-info visible r) (stripImplicit x) ∷ [] stripImplicitArg (arg (arg-info hidden r) x) = [] stripImplicitArg (arg (arg-info instance′ r) x) = [] quotedEnv : List Term → Term quotedEnv ts = def (quote buildEnv) $ defaultArg (quoteList $ map stripImplicit ts) ∷ [] QED : ∀ {a} {A : Set a} {x : Maybe A} → Set QED {x = x} = IsJust x get-proof : ∀ {a} {A : Set a} (prf : Maybe A) → QED {x = prf} → A get-proof (just eq) _ = eq get-proof nothing () {-# STATIC get-proof #-} getProof : Name → Term → Term → Term getProof err t proof = def (quote get-proof) $ vArg proof ∷ vArg (def err $ vArg (stripImplicit t) ∷ []) ∷ [] failedProof : Name → Term → Term failedProof err t = def (quote get-proof) $ vArg (con (quote nothing) []) ∷ vArg (def err $ vArg (stripImplicit t) ∷ []) ∷ [] cantProve : Set → ⊤ cantProve _ = _ invalidGoal : Set → ⊤ invalidGoal _ = _
oeis/082/A082115.asm
neoneye/loda-programs
11
5497
; A082115: Fibonacci sequence (mod 3). ; Submitted by <NAME>(w2) ; 0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2,0,2,2,1,0,1,1,2 mod $0,24 seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. mod $0,3
programs/oeis/085/A085603.asm
neoneye/loda
22
245556
; A085603: (2n)^(2n) + 1. ; 2,5,257,46657,16777217,10000000001,8916100448257,11112006825558017,18446744073709551617,39346408075296537575425,104857600000000000000000001 mul $0,2 pow $0,$0 add $0,1
oeis/101/A101563.asm
neoneye/loda-programs
11
244957
; A101563: a(n)=(-1)^n*coefficient of x^n in sum{k>=1,x^(k-1)/(1+10x^k)}. ; Submitted by <NAME> ; 1,9,101,1009,10001,99909,1000001,10001009,100000101,999990009,10000000001,100000100909,1000000000001,9999999000009,100000000010101,1000000010001009,10000000000000001,99999999900099909 add $0,1 mov $2,$0 lpb $0 div $1,-1 mul $1,10 mov $3,$2 dif $3,$0 sub $0,1 cmp $3,$2 cmp $3,0 add $1,$3 lpe add $1,1 gcd $0,$1
antlr/ExprParser.g4
blockwell-ai/solpp
77
6063
<reponame>blockwell-ai/solpp parser grammar ExprParser; options { tokenVocab=ExprLexer; } expressionRoot: expr=expression EOF ; expression : num=expression units=UNIT_KW #unitsOperation | value=literal #literalOperation | name=IDENTIFIER #identifierOperation | obj=expression DOT key=IDENTIFIER #propertyOperation | list=expression LBRACKET inner=expression RBRACKET #indexOperation | LBRACKET items=listItems RBRACKET #listOperation | LPAREN inner=expression RPAREN #groupOperation | DEFINED_KW LPAREN name=IDENTIFIER RPAREN #definedOperation | PEEK_KW LPAREN name=IDENTIFIER RPAREN #peekOperation | callee=expression LPAREN args=callArguments? RPAREN #callOperation | op=BITWISE_INVERT_OP right=expression #bitwiseInvertOperation | <assoc=right> left=expression op=POW_OP right=expression #powerOperation | op=SUB_OP right=expression #negateOperation | left=expression op=BITWISE_OP right=expression #bitwiseOperation | left=expression op=(MUL_OP | DIV_OP | MOD_OP) right=expression #arithmeticOperation | left=expression op=(ADD_OP | SUB_OP) right=expression #arithmeticOperation | left=expression op=LOGICAL_OP right=expression #logicalOperation | op=NOT_OP right=expression #logicalNotOperation | condition=expression TERNARY_OP first=expression TERNARY_SEPARATOR second=expression #ternaryOperation | lambda=lambdaExpression #lambdaOperation ; literal : str=stringLiteral | fstr=fstringLiteral | num=numberLiteral | bool=booleanLiteral ; stringLiteral: value=STRING_LITERAL ; booleanLiteral: value=BOOLEAN_LITERAL ; fstringLiteral: value=FSTRING_LITERAL ; numberLiteral : value=OCTAL_LITERAL #octalLiteral | value=HEX_LITERAL #hexLiteral | value=BINARY_LITERAL #binaryLiteral | value=DECIMAL_LITERAL #decimalLiteral ; callArguments : arg=expression (COMMA rest=callArguments)? ; listItems : item=expression (COMMA rest=listItems)? ; lambdaExpression : LPAREN args=idList RPAREN LAMBDA_ARROW body=expression | arg=IDENTIFIER? LAMBDA_ARROW body=expression ; idList : arg=IDENTIFIER (COMMA rest=idList)? ;
asm/screen.asm
ddjohn/mordana
0
5373
<gh_stars>0 clearScreen: mov ax, 2 int 0x10 ret setRedBackground: mov ah, 0x0B mov bx, 0x0034 int 0x10 ret enterVideoMode: mov ax, 0x0013 int 0x10 ret
src/util-serialize-mappers-vector_mapper.adb
Letractively/ada-util
0
1925
<reponame>Letractively/ada-util ----------------------------------------------------------------------- -- Util.Serialize.Mappers.Vector_Mapper -- Mapper for vector types -- Copyright (C) 2010, 2011, 2014 <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.Log.Loggers; package body Util.Serialize.Mappers.Vector_Mapper is use Vectors; use Util.Log; -- The logger Log : constant Loggers.Logger := Loggers.Create ("Util.Serialize.Mappers.Vector_Mapper", Util.Log.WARN_LEVEL); Key : Util.Serialize.Contexts.Data_Key; -- ----------------------- -- Data context -- ----------------------- -- Data context to get access to the target element. -- ----------------------- -- Get the vector object. -- ----------------------- function Get_Vector (Data : in Vector_Data) return Vector_Type_Access is begin return Data.Vector; end Get_Vector; -- ----------------------- -- Set the vector object. -- ----------------------- procedure Set_Vector (Data : in out Vector_Data; Vector : in Vector_Type_Access) is begin Data.Vector := Vector; end Set_Vector; -- ----------------------- -- Record mapper -- ----------------------- -- ----------------------- -- Set the <b>Data</b> vector in the context. -- ----------------------- procedure Set_Context (Ctx : in out Util.Serialize.Contexts.Context'Class; Data : in Vector_Type_Access) is Data_Context : constant Vector_Data_Access := new Vector_Data; begin Data_Context.Vector := Data; Data_Context.Position := Index_Type'First; Ctx.Set_Data (Key => Key, Content => Data_Context.all'Unchecked_Access); end Set_Context; -- ----------------------- -- Execute the mapping operation on the object associated with the current context. -- The object is extracted from the context and the <b>Execute</b> operation is called. -- ----------------------- procedure Execute (Handler : in Mapper; Map : in Mapping'Class; Ctx : in out Util.Serialize.Contexts.Context'Class; Value : in Util.Beans.Objects.Object) is pragma Unreferenced (Handler); procedure Process (Element : in out Element_Type); procedure Process (Element : in out Element_Type) is begin Element_Mapper.Set_Member (Map, Element, Value); end Process; D : constant Contexts.Data_Access := Ctx.Get_Data (Key); begin Log.Debug ("Updating vector element"); if not (D.all in Vector_Data'Class) then raise Util.Serialize.Contexts.No_Data; end if; declare DE : constant Vector_Data_Access := Vector_Data'Class (D.all)'Access; begin if DE.Vector = null then raise Util.Serialize.Contexts.No_Data; end if; -- Update the element through the generic procedure Update_Element (DE.Vector.all, DE.Position - 1, Process'Access); end; end Execute; procedure Set_Mapping (Into : in out Mapper; Inner : in Element_Mapper.Mapper_Access) is begin Into.Mapper := Inner.all'Unchecked_Access; Into.Map.Bind (Inner); end Set_Mapping; -- ----------------------- -- Find the mapper associated with the given name. -- Returns null if there is no mapper. -- ----------------------- function Find_Mapper (Controller : in Mapper; Name : in String) return Util.Serialize.Mappers.Mapper_Access is begin return Controller.Mapper.Find_Mapper (Name); end Find_Mapper; overriding procedure Initialize (Controller : in out Mapper) is begin Controller.Mapper := Controller.Map'Unchecked_Access; end Initialize; procedure Start_Object (Handler : in Mapper; Context : in out Util.Serialize.Contexts.Context'Class; Name : in String) is pragma Unreferenced (Handler); procedure Set_Context (Item : in out Element_Type); D : constant Contexts.Data_Access := Context.Get_Data (Key); procedure Set_Context (Item : in out Element_Type) is begin Element_Mapper.Set_Context (Ctx => Context, Element => Item'Unrestricted_Access); end Set_Context; begin Log.Debug ("Creating vector element {0}", Name); if not (D.all in Vector_Data'Class) then raise Util.Serialize.Contexts.No_Data; end if; declare DE : constant Vector_Data_Access := Vector_Data'Class (D.all)'Access; begin if DE.Vector = null then raise Util.Serialize.Contexts.No_Data; end if; Insert_Space (DE.Vector.all, DE.Position); DE.Vector.Update_Element (Index => DE.Position, Process => Set_Context'Access); DE.Position := DE.Position + 1; end; end Start_Object; procedure Finish_Object (Handler : in Mapper; Context : in out Util.Serialize.Contexts.Context'Class; Name : in String) is begin null; end Finish_Object; -- ----------------------- -- Write the element on the stream using the mapper description. -- ----------------------- procedure Write (Handler : in Mapper; Stream : in out Util.Serialize.IO.Output_Stream'Class; Element : in Vectors.Vector) is Pos : Vectors.Cursor := Element.First; begin Stream.Start_Array (Element.Length); while Vectors.Has_Element (Pos) loop Element_Mapper.Write (Handler.Mapper.all, Handler.Map.Get_Getter, Stream, Vectors.Element (Pos)); Vectors.Next (Pos); end loop; Stream.End_Array; end Write; begin -- Allocate the unique data key. Util.Serialize.Contexts.Allocate (Key); end Util.Serialize.Mappers.Vector_Mapper;
src/palettes.asm
ISSOtm/gb-open-world
8
18658
<reponame>ISSOtm/gb-open-world<gh_stars>1-10 INCLUDE "defines.asm" SECTION "Palette buffer fading", ROM0 ; Applies fade to both palette buffers ; FadePaletteBuffers:: ld hl, wFadeSteps dec [hl] inc hl assert wFadeSteps + 1 == wFadeDelta ld a, [hli] ld e, a assert wFadeDelta + 1 == wFadeAmount add a, [hl] jr z, .clamp ; 0 is an illegal value ld d, a rra ; Get carry into bit 7 xor e ; Expect bit 7 of offset to match carry add a, a ld a, d jr nc, .noOverflow .clamp ; If we got an overflow, clamp depending on bit 7 of offset ; If the offset is positive, clamp at $FF; otherwise, at 1 sla e ; Bit 7 (sign) into carry sbc a, a ; 0 or $FF and 2 ; 0 or 2 dec a ; $FF or 1 .noOverflow ld [hli], a assert wFadeAmount + 1 == wBGPaletteMask add a, a ; Test sign bit ld c, LOW(rBCPS) jr nc, .fadeToBlack ld d, a ; ld a, [hConsoleType] ; and a ; jr nz, FadeDMGToWhite .fadeBufferToWhite ld a, $80 ldh [c], a inc c ld a, [hli] ; Read palette mask scf adc a, a .fadePaletteToWhite ldh [hPaletteMask], a jr nc, .noWhiteFade ld b, 4 ld a, c cp LOW(rOCPD) jr nz, .fadeColorToWhite dec b ; Do two dummy writes to advance index ; The index is increased even if the writes fail ldh [c], a ldh [c], a .fadeColorToWhite ld a, [hli] ; Read green add a, d jr nc, .notFullGreen sbc a, a ; ld a, $FF .notFullGreen rlca rlca ld e, a wait_vram ld a, [hli] ; Read red add a, d jr nc, .notFullRed sbc a, a ; ld a, $FF .notFullRed rra rra rra xor e and $1F xor e ldh [c], a wait_vram ld a, [hli] ; Read blue add a, d jr nc, .notFullBlue sbc a, a ; ld a, $FF .notFullBlue rra xor e and $FC ; $7C works just as well, but $FC gets bit 7 always cleared xor e ldh [c], a dec b jr nz, .fadeColorToWhite .fadedPaletteWhite ldh a, [hPaletteMask] add a, a jr nz, .fadePaletteToWhite inc c ld a, c cp LOW(rOCPS) jr z, .fadeBufferToWhite ret .noWhiteFade dec c ldh a, [c] add a, 4 * 2 ldh [c], a inc c ld a, l add a, 4 * 3 ld l, a adc a, h sub l ld h, a jr .fadedPaletteWhite .fadeToBlack cpl inc a ld d, a ; ldh a, [hConsoleType] ; and a ; jr nz, .fadeDMGToBlack .fadeBufferToBlack ld a, $80 ldh [c], a inc c ld a, [hli] ; Read palette mask scf adc a, a .fadePaletteToBlack ldh [hPaletteMask], a jr nc, .noBlackFade ld b, 4 ; OBJ palettes only have 3 colors ld a, c cp LOW(rOCPD) jr nz, .fadeColorToBlack dec b ; Do two dummy writes to advance index ; The index is increased even if the writes fail ldh [c], a ldh [c], a .fadeColorToBlack ld a, [hli] ; Read green sub d jr nc, .stillSomeGreen xor a .stillSomeGreen rlca rlca ld e, a wait_vram ld a, [hli] ; Read red sub d jr nc, .stillSomeRed xor a .stillSomeRed rra rra rra xor e and $1F xor e ldh [c], a wait_vram ld a, [hli] ; Read blue sub d jr nc, .stillSomeBlue xor a .stillSomeBlue rra xor e and $FC ; $7C works just as well, but $FC gets bit 7 always cleared xor e ldh [c], a dec b jr nz, .fadeColorToBlack .fadedPaletteBlack ldh a, [hPaletteMask] add a, a jr nz, .fadePaletteToBlack inc c ld a, c cp LOW(rOCPS) jr z, .fadeBufferToBlack ret .noBlackFade dec c ldh a, [c] add a, 4 * 2 ldh [c], a inc c ld a, l add a, 4 * 3 ld l, a adc a, h sub l ld h, a jr .fadedPaletteBlack SECTION UNION "Scratch buffer", HRAM hPaletteMask: db SECTION "Fade state memory", WRAM0,ALIGN[9] ; Ensure that palette bufs don't cross pages wFadeSteps:: db ; Number of fade steps to take wFadeDelta:: db ; Value to add to wFadeAmount on each step ; 00 = bugged equivalent of 80, do not use ; 01-7F = 01 is fully black, 7F is barely faded ; 80 = not faded ; 81-FF = FF is fully white, 81 is barely faded wFadeAmount:: db wBGPaletteMask:: db ; Mask of which palettes to fade (01234567) wBGPaletteBuffer:: ; 24-bit GRB, in this order ds 8 * 4 * 3 ; 8 palettes, 4 colors, 3 bytes .end:: wOBJPaletteMask:: db wOBJPaletteBuffer:: ; Same as above ds 8 * 3 * 3 ; Same, but only 3 colors .end::
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_rtp_gstbasertpaudiopayload_h.ads
persan/A-gst
1
30786
<reponame>persan/A-gst pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; with glib.Values; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstbasertppayload_h; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h; with glib; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstadapter_h; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstbasertpaudiopayload_h is -- unsupported macro: GST_TYPE_BASE_RTP_AUDIO_PAYLOAD (gst_base_rtp_audio_payload_get_type()) -- arg-macro: function GST_BASE_RTP_AUDIO_PAYLOAD (obj) -- return G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_BASE_RTP_AUDIO_PAYLOAD,GstBaseRTPAudioPayload); -- arg-macro: function GST_BASE_RTP_AUDIO_PAYLOAD_CLASS (klass) -- return G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_BASE_RTP_AUDIO_PAYLOAD,GstBaseRTPAudioPayloadClass); -- arg-macro: function GST_IS_BASE_RTP_AUDIO_PAYLOAD (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_AUDIO_PAYLOAD); -- arg-macro: function GST_IS_BASE_RTP_AUDIO_PAYLOAD_CLASS (klass) -- return G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_AUDIO_PAYLOAD); -- arg-macro: function GST_BASE_RTP_AUDIO_PAYLOAD_CAST (obj) -- return (GstBaseRTPAudioPayload *) (obj); -- GStreamer -- * Copyright (C) <2006> <NAME> <<EMAIL>> -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, 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 -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- type GstBaseRTPAudioPayload; type u_GstBaseRTPAudioPayload_u_gst_reserved_array is array (0 .. 3) of System.Address; --subtype GstBaseRTPAudioPayload is u_GstBaseRTPAudioPayload; -- gst/rtp/gstbasertpaudiopayload.h:29 type GstBaseRTPAudioPayloadClass; type u_GstBaseRTPAudioPayloadClass_u_gst_reserved_array is array (0 .. 3) of System.Address; --subtype GstBaseRTPAudioPayloadClass is u_GstBaseRTPAudioPayloadClass; -- gst/rtp/gstbasertpaudiopayload.h:30 -- skipped empty struct u_GstBaseRTPAudioPayloadPrivate -- skipped empty struct GstBaseRTPAudioPayloadPrivate type GstBaseRTPAudioPayload is record payload : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstbasertppayload_h.GstBaseRTPPayload; -- gst/rtp/gstbasertpaudiopayload.h:51 priv : System.Address; -- gst/rtp/gstbasertpaudiopayload.h:53 base_ts : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime; -- gst/rtp/gstbasertpaudiopayload.h:55 frame_size : aliased GLIB.gint; -- gst/rtp/gstbasertpaudiopayload.h:56 frame_duration : aliased GLIB.gint; -- gst/rtp/gstbasertpaudiopayload.h:57 sample_size : aliased GLIB.gint; -- gst/rtp/gstbasertpaudiopayload.h:59 u_gst_reserved : u_GstBaseRTPAudioPayload_u_gst_reserved_array; -- gst/rtp/gstbasertpaudiopayload.h:61 end record; pragma Convention (C_Pass_By_Copy, GstBaseRTPAudioPayload); -- gst/rtp/gstbasertpaudiopayload.h:49 --* -- * GstBaseRTPAudioPayloadClass: -- * @parent_class: the parent class -- * -- * Base class for audio RTP payloader. -- type GstBaseRTPAudioPayloadClass is record parent_class : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstbasertppayload_h.GstBaseRTPPayloadClass; -- gst/rtp/gstbasertpaudiopayload.h:72 u_gst_reserved : u_GstBaseRTPAudioPayloadClass_u_gst_reserved_array; -- gst/rtp/gstbasertpaudiopayload.h:75 end record; pragma Convention (C_Pass_By_Copy, GstBaseRTPAudioPayloadClass); -- gst/rtp/gstbasertpaudiopayload.h:70 --< private > function gst_base_rtp_audio_payload_get_type return GLIB.GType; -- gst/rtp/gstbasertpaudiopayload.h:78 pragma Import (C, gst_base_rtp_audio_payload_get_type, "gst_base_rtp_audio_payload_get_type"); -- configure frame based procedure gst_base_rtp_audio_payload_set_frame_based (basertpaudiopayload : access GstBaseRTPAudioPayload); -- gst/rtp/gstbasertpaudiopayload.h:81 pragma Import (C, gst_base_rtp_audio_payload_set_frame_based, "gst_base_rtp_audio_payload_set_frame_based"); procedure gst_base_rtp_audio_payload_set_frame_options (basertpaudiopayload : access GstBaseRTPAudioPayload; frame_duration : GLIB.gint; frame_size : GLIB.gint); -- gst/rtp/gstbasertpaudiopayload.h:83 pragma Import (C, gst_base_rtp_audio_payload_set_frame_options, "gst_base_rtp_audio_payload_set_frame_options"); -- configure sample based procedure gst_base_rtp_audio_payload_set_sample_based (basertpaudiopayload : access GstBaseRTPAudioPayload); -- gst/rtp/gstbasertpaudiopayload.h:87 pragma Import (C, gst_base_rtp_audio_payload_set_sample_based, "gst_base_rtp_audio_payload_set_sample_based"); procedure gst_base_rtp_audio_payload_set_sample_options (basertpaudiopayload : access GstBaseRTPAudioPayload; sample_size : GLIB.gint); -- gst/rtp/gstbasertpaudiopayload.h:88 pragma Import (C, gst_base_rtp_audio_payload_set_sample_options, "gst_base_rtp_audio_payload_set_sample_options"); procedure gst_base_rtp_audio_payload_set_samplebits_options (basertpaudiopayload : access GstBaseRTPAudioPayload; sample_size : GLIB.gint); -- gst/rtp/gstbasertpaudiopayload.h:90 pragma Import (C, gst_base_rtp_audio_payload_set_samplebits_options, "gst_base_rtp_audio_payload_set_samplebits_options"); -- get the internal adapter function gst_base_rtp_audio_payload_get_adapter (basertpaudiopayload : access GstBaseRTPAudioPayload) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstadapter_h.GstAdapter; -- gst/rtp/gstbasertpaudiopayload.h:94 pragma Import (C, gst_base_rtp_audio_payload_get_adapter, "gst_base_rtp_audio_payload_get_adapter"); -- push and flushing data function gst_base_rtp_audio_payload_push (baseaudiopayload : access GstBaseRTPAudioPayload; data : access GLIB.guint8; payload_len : GLIB.guint; timestamp : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/rtp/gstbasertpaudiopayload.h:97 pragma Import (C, gst_base_rtp_audio_payload_push, "gst_base_rtp_audio_payload_push"); function gst_base_rtp_audio_payload_flush (baseaudiopayload : access GstBaseRTPAudioPayload; payload_len : GLIB.guint; timestamp : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/rtp/gstbasertpaudiopayload.h:100 pragma Import (C, gst_base_rtp_audio_payload_flush, "gst_base_rtp_audio_payload_flush"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstbasertpaudiopayload_h;
programs/oeis/107/A107306.asm
neoneye/loda
22
21773
<reponame>neoneye/loda<gh_stars>10-100 ; A107306: Numbers k such that (17*k - 19) is prime. ; 6,10,24,28,30,36,40,48,58,64,66,70,78,84,90,94,96,106,118,124,136,150,156,166,168,174,180,184,196,198,204,208,226,238,244,250,274,276,288,300,318,328,330,334,336,348,358,360,366,370,376,388,394,400,406,408,414,420,436,444,454,468,474,484,486,490,498,514,516,520,526,534,538,540,556,558,574,594,600,616,618,624,628,630,640,688,694,696,714,724,726,730,738,748,754,766,768,780,784,790 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,14 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,20 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe div $1,2 sub $1,22 mul $1,2 sub $1,58 div $1,17 add $1,6 mov $0,$1
alloy4fun_models/trashltl/models/14/xDaD2DRf59tjNuSRY.als
Kaixi26/org.alloytools.alloy
0
1475
open main pred idxDaD2DRf59tjNuSRY_prop15 { always (no File & Trash => eventually some File & Trash) } pred __repair { idxDaD2DRf59tjNuSRY_prop15 } check __repair { idxDaD2DRf59tjNuSRY_prop15 <=> prop15o }
thirdparty/adasdl/thin/adasdl/AdaSDL/binding/sdl-byteorder.adb
Lucretia/old_nehe_ada95
0
21474
-- ----------------------------------------------------------------- -- -- AdaSDL -- -- Binding to Simple Direct Media Layer -- -- Copyright (C) 2001 A.M.F.Vargas -- -- <NAME> -- -- Ponta Delgada - Azores - Portugal -- -- http://www.adapower.net/~avargas -- -- E-mail: <EMAIL> -- -- ----------------------------------------------------------------- -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public -- -- License as published by the Free Software Foundation; either -- -- version 2 of the License, 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 -- -- 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 library; if not, write to the -- -- Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- -- Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- this unit, or you link this unit with other files to produce an -- -- executable, this unit does not by itself cause the resulting -- -- executable to be covered by the GNU General Public License. This -- -- exception does not however invalidate any other reasons why the -- -- executable file might be covered by the GNU Public License. -- -- ----------------------------------------------------------------- -- -- **************************************************************** -- -- This is an Ada binding to SDL ( Simple DirectMedia Layer from -- -- Sam Lantinga - www.libsld.org ) -- -- **************************************************************** -- -- In order to help the Ada programmer, the comments in this file -- -- are, in great extent, a direct copy of the original text in the -- -- SDL header files. -- -- **************************************************************** -- package body SDL.Byteorder is -------------------- -- Get_Byte_Order -- -------------------- function Get_Byte_Order return C.int is begin if Standard'Default_Bit_Order = 1 then return 1234; else return 4321; end if; end Get_Byte_Order; end SDL.Byteorder;
Task/Averages-Root-mean-square/Ada/averages-root-mean-square.ada
LaudateCorpus1/RosettaCodeData
1
8891
with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions; procedure calcrms is type float_arr is array(1..10) of Float; function rms(nums : float_arr) return Float is sum : Float := 0.0; begin for p in nums'Range loop sum := sum + nums(p)**2; end loop; return sqrt(sum/Float(nums'Length)); end rms; list : float_arr; begin list := (1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0); put( rms(list) , Exp=>0); end calcrms;
dino/lcs/base/67C0.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
12770
<reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data copyright zengfr site:http://github.com/zengfr/romhack 00042A move.l D1, (A0)+ 00042C dbra D0, $42a 0049A8 clr.w ($67c0,A5) 0049AC lea ($69b0,A5), A0 [base+67C0] 0049E2 addq.w #1, ($67c0,A5) [base+67C2] 0049E6 rts [base+67C0] 014002 move.w ($67c0,A5), D7 014006 beq $1406a [base+67C0] 01404A move.w ($67c0,A5), D7 01404E lea ($69b0,A5), A6 [base+67C0] 014072 clr.w ($67c0,A5) [base+67C2] 014076 move.l #$100, (A4)+ [base+67C0] 014EC0 move.w ($67c0,A5), D7 014EC4 beq $14f96 [base+67C0] 0AAACA move.l (A0), D2 0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAACE move.w D0, ($2,A0) 0AAAD2 cmp.l (A0), D0 0AAAD4 bne $aaafc 0AAAD8 move.l D2, (A0)+ 0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAE6 move.l (A0), D2 0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAF4 move.l D2, (A0)+ 0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] copyright zengfr site:http://github.com/zengfr/romhack
MEMZ/NyanMBR/Source/Stage2/Setup/setupSpeaker.asm
johnmelodyme/viruses
4
243312
; Setup the PC speaker timer mov al, 10110110b out 0x43, al ; Set the default frequency mov ax, 1193 ; ~1000 Hz out 0x42, al mov al, ah out 0x42, al ; Enable the PC speaker in al, 61h or al, 00000011b out 61h, al
programs/oeis/293/A293414.asm
karttu/loda
1
80404
; A293414: The integer k that minimizes |k/n^2 - e|. ; 0,3,11,24,43,68,98,133,174,220,272,329,391,459,533,612,696,786,881,981,1087,1199,1316,1438,1566,1699,1838,1982,2131,2286,2446,2612,2784,2960,3142,3330,3523,3721,3925,4135,4349,4569,4795,5026,5263,5505,5752,6005,6263,6527,6796,7070,7350,7636,7927,8223,8525,8832,9144,9462,9786,10115,10449,10789,11134,11485,11841,12202,12569,12942,13320,13703,14092,14486,14885,15290,15701,16117,16538,16965,17397,17835,18278,18726,19180,19640,20104,20575,21050,21532,22018,22510,23008,23510,24019,24532,25052,25576,26106,26642,27183,27729,28281,28838,29401,29969,30543,31122,31706,32296,32891,33492,34098,34710,35327,35949,36577,37211,37849,38494,39143,39798,40459,41125,41796,42473,43155,43843,44536,45235,45939,46648,47363,48084,48809,49541,50277,51019,51767,52520,53278,54042,54811,55586,56366,57152,57943,58739,59541,60349,61161,61980,62803,63632,64467,65307,66152,67003,67859,68721,69588,70461,71339,72222,73111,74005,74905,75810,76721,77637,78558,79485,80418,81355,82299,83247,84201,85161,86126,87096,88072,89054,90040,91033,92030,93033,94042,95056,96075,97100,98130,99166,100207,101253,102305,103363,104426,105494,106568,107647,108731,109821,110917,112018,113124,114236,115353,116476,117604,118737,119876,121021,122170,123326,124486,125653,126824,128001,129184,130372,131565,132764,133968,135177,136393,137613,138839,140070,141307,142549,143797,145050,146309,147573,148842,150117,151397,152683,153974,155271,156573,157881,159193,160512,161836,163165,164500,165840,167185,168536 pow $0,2 cal $0,22852 ; Integer nearest n * e, where e is the natural log base. mov $1,$0
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1882.asm
ljhsiun2/medusa
9
20547
<filename>Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1882.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r14 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1090f, %rsi nop sub %r12, %r12 vmovups (%rsi), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %rdx nop cmp %r14, %r14 lea addresses_A_ht+0x200f, %rsi lea addresses_UC_ht+0x8e1b, %rdi add %r8, %r8 mov $109, %rcx rep movsb nop nop nop nop add %rcx, %rcx lea addresses_A_ht+0x1a70f, %rsi nop nop sub %r12, %r12 mov (%rsi), %rcx nop nop nop nop sub $9048, %rcx lea addresses_A_ht+0x16ec8, %rdi nop nop nop nop nop inc %r14 movb $0x61, (%rdi) nop nop nop nop sub %r8, %r8 lea addresses_A_ht+0xba9f, %rsi lea addresses_WT_ht+0x1e89d, %rdi nop nop nop inc %rbx mov $16, %rcx rep movsq nop nop nop sub $33263, %rsi lea addresses_normal_ht+0x1e50f, %r12 nop cmp %rdi, %rdi mov (%r12), %cx nop cmp %r12, %r12 lea addresses_UC_ht+0x2c2f, %rcx nop nop cmp %r14, %r14 mov (%rcx), %edx nop nop sub %rcx, %rcx lea addresses_normal_ht+0x11e0f, %rbx nop nop add %rdi, %rdi mov $0x6162636465666768, %r12 movq %r12, (%rbx) nop nop nop nop nop xor %r8, %r8 lea addresses_WC_ht+0x4f0f, %r8 nop xor $29357, %rbx mov $0x6162636465666768, %rsi movq %rsi, (%r8) nop nop nop nop cmp $41465, %r14 lea addresses_normal_ht+0xa2cf, %r8 dec %r14 movl $0x61626364, (%r8) nop nop nop cmp %r12, %r12 lea addresses_D_ht+0x9b4f, %rsi nop nop nop and $53189, %r14 and $0xffffffffffffffc0, %rsi vmovntdqa (%rsi), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $0, %xmm7, %rdi nop nop nop sub $48564, %r12 lea addresses_A_ht+0x51a2, %rdx nop nop xor $48906, %r8 mov (%rdx), %cx nop nop and $44849, %r14 lea addresses_WT_ht+0x640f, %rdi nop add $46271, %r8 movb $0x61, (%rdi) xor %r14, %r14 lea addresses_WC_ht+0xc90f, %r12 nop nop nop nop xor $4094, %rbx movb $0x61, (%r12) nop nop nop nop xor $20026, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r15 push %r8 push %rdi push %rdx // Faulty Load lea addresses_normal+0x1150f, %rdx nop nop cmp %r15, %r15 mov (%rdx), %di lea oracles, %r15 and $0xff, %rdi shlq $12, %rdi mov (%r15,%rdi,1), %rdi pop %rdx pop %rdi pop %r8 pop %r15 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 0}} {'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 6}} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}} {'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 */
source/RASCAL-OS.ads
bracke/Ext2Dir
1
3965
-------------------------------------------------------------------------------- -- -- -- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers. -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU Lesser General Public -- -- License as published by the Free Software Foundation; either -- -- version 2.1 of the License, 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 -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- Lesser General Public License for more details. -- -- -- -- You should have received a copy of the GNU Lesser General Public -- -- License along with this library; if not, write to the Free Software -- -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- -------------------------------------------------------------------------------- -- @brief OS events and types. Abstract task definition. -- $Author$ -- $Date$ -- $Revision$ with Kernel; use Kernel; with System; use System; with System.Unsigned_Types; use System.Unsigned_Types; with Ada.Unchecked_Conversion; package RASCAL.OS is type OS_Coordinate is record X : Integer; Y : Integer; end record; pragma Convention (C, OS_Coordinate); type OS_BBox is record xmin : Integer; ymin : Integer; xmax : Integer; ymax : Integer; end record; pragma Convention (C, OS_BBox); type Event_Type is (Wimp,Message,Toolbox); type Event_Listener (K : Event_Type) is abstract tagged record Kind : Event_Type := K; end record; type Event_Pointer is access all Event_Listener'Class; procedure Handle (The : in Event_Listener) is abstract; type Byte is mod 2**8; type Wimp_Handle_Type is new Integer; type Icon_Handle_Type is new Integer; type Reason_Event_Code_Type is new System.Unsigned_Types.Unsigned; Reason_Event_NullReason : constant Reason_Event_Code_Type := 0; Reason_Event_RedrawWindow : constant Reason_Event_Code_Type := 1; Reason_Event_OpenWindow : constant Reason_Event_Code_Type := 2; Reason_Event_CloseWindow : constant Reason_Event_Code_Type := 3; Reason_Event_PointerLeavingWindow : constant Reason_Event_Code_Type := 4; Reason_Event_PointerEnteringWindow : constant Reason_Event_Code_Type := 5; Reason_Event_MouseClick : constant Reason_Event_Code_Type := 6; Reason_Event_UserDrag : constant Reason_Event_Code_Type := 7; Reason_Event_KeyPressed : constant Reason_Event_Code_Type := 8; Reason_Event_MenuSelection : constant Reason_Event_Code_Type := 9; Reason_Event_ScrollRequest : constant Reason_Event_Code_Type := 10; Reason_Event_LoseCaret : constant Reason_Event_Code_Type := 11; Reason_Event_GainCaret : constant Reason_Event_Code_Type := 12; Reason_Event_PollWordNonZero : constant Reason_Event_Code_Type := 13; Reason_Event_UserMessage : constant Reason_Event_Code_Type := 17; Reason_Event_UserMessageRecorded : constant Reason_Event_Code_Type := 18; Reason_Event_UserMessageAcknowledge : constant Reason_Event_Code_Type := 19; Reason_Event_ToolboxEvent : constant Reason_Event_Code_Type := 16#200#; type Wimp_EventListener (E : Reason_Event_Code_Type; W : Wimp_Handle_Type; I : Icon_Handle_Type) is abstract new Event_Listener(Wimp) with record Event_Code : Reason_Event_Code_Type := E; Window : Wimp_Handle_Type := W; Icon : Icon_Handle_Type := I; end record; type Message_Event_Code_Type is new System.Unsigned_Types.Unsigned; Message_Event_Quit : constant Message_Event_Code_Type := 0; Message_Event_DataSave : constant Message_Event_Code_Type := 1; Message_Event_DataSaveAck : constant Message_Event_Code_Type := 2; Message_Event_DataLoad : constant Message_Event_Code_Type := 3; Message_Event_DataLoadAck : constant Message_Event_Code_Type := 4; Message_Event_DataOpen : constant Message_Event_Code_Type := 5; Message_Event_RAMFetch : constant Message_Event_Code_Type := 6; Message_Event_RAMTransmit : constant Message_Event_Code_Type := 7; Message_Event_PreQuit : constant Message_Event_Code_Type := 8; Message_Event_PaletteChange : constant Message_Event_Code_Type := 9; Message_Event_SaveDesktop : constant Message_Event_Code_Type := 10; Message_Event_DeviceClaim : constant Message_Event_Code_Type := 11; Message_Event_DeviceInUse : constant Message_Event_Code_Type := 12; Message_Event_DataSaved : constant Message_Event_Code_Type := 13; Message_Event_Shutdown : constant Message_Event_Code_Type := 14; Message_Event_FilerOpenDir : constant Message_Event_Code_Type := 16#400#; Message_Event_FilerCloseDir : constant Message_Event_Code_Type := 16#401#; Message_Event_FilerOpenDirAt : constant Message_Event_Code_Type := 16#402#; Message_Event_FilerSelectionDirectory: constant Message_Event_Code_Type := 16#403#; Message_Event_FilerAddSelection : constant Message_Event_Code_Type := 16#404#; Message_Event_FilerAction : constant Message_Event_Code_Type := 16#405#; Message_Event_FilerControlAction : constant Message_Event_Code_Type := 16#406#; Message_Event_FilerSelection : constant Message_Event_Code_Type := 16#407#; Message_Event_AlarmSet : constant Message_Event_Code_Type := 16#500#; Message_Event_AlarmGoneOff : constant Message_Event_Code_Type := 16#501#; Message_Event_HelpEnable : constant Message_Event_Code_Type := 16#504#; Message_Event_Notify : constant Message_Event_Code_Type := 16#40040#; Message_Event_MenuWarning : constant Message_Event_Code_Type := 16#400c0#; Message_Event_ModeChange : constant Message_Event_Code_Type := 16#400c1#; Message_Event_TaskInitialise : constant Message_Event_Code_Type := 16#400c2#; Message_Event_TaskCloseDown : constant Message_Event_Code_Type := 16#400c3#; Message_Event_SlotSize : constant Message_Event_Code_Type := 16#400c4#; Message_Event_SetSlot : constant Message_Event_Code_Type := 16#400c5#; Message_Event_TaskNameRq : constant Message_Event_Code_Type := 16#400c6#; Message_Event_TaskNameIs : constant Message_Event_Code_Type := 16#400c7#; Message_Event_TaskStarted : constant Message_Event_Code_Type := 16#400c8#; Message_Event_MenusDeleted : constant Message_Event_Code_Type := 16#400c9#; Message_Event_Iconize : constant Message_Event_Code_Type := 16#40c10#; Message_Event_IconizeAt : constant Message_Event_Code_Type := 16#400D0#; Message_Event_WindowInfo : constant Message_Event_Code_Type := 16#40c11#; Message_Event_WindowClosed : constant Message_Event_Code_Type := 16#40c12#; Message_Event_FontChanged : constant Message_Event_Code_Type := 16#400CF#; Message_Event_PrintFile : constant Message_Event_Code_Type := 16#80140#; Message_Event_WillPrint : constant Message_Event_Code_Type := 16#80141#; Message_Event_PrintSave : constant Message_Event_Code_Type := 16#80142#; Message_Event_PrintInit : constant Message_Event_Code_Type := 16#80143#; Message_Event_PrintError : constant Message_Event_Code_Type := 16#80144#; Message_Event_PrintTypeOdd : constant Message_Event_Code_Type := 16#80145#; Message_Event_PrintTypeKnown : constant Message_Event_Code_Type := 16#80146#; Message_Event_SetPrinter : constant Message_Event_Code_Type := 16#80147#; Message_Event_PSPrinterQuery : constant Message_Event_Code_Type := 16#8014c#; Message_Event_PSPrinterAck : constant Message_Event_Code_Type := 16#8014d#; Message_Event_PSPrinterModified : constant Message_Event_Code_Type := 16#8014e#; Message_Event_PSPrinterDefaults : constant Message_Event_Code_Type := 16#8014f#; Message_Event_PSPrinterDefaulted : constant Message_Event_Code_Type := 16#80150#; Message_Event_PSPrinterNotPS : constant Message_Event_Code_Type := 16#80151#; Message_Event_ResetPrinter : constant Message_Event_Code_Type := 16#80152#; Message_Event_PSIsFontPrintRunning : constant Message_Event_Code_Type := 16#80153#; Message_Event_HelpRequest : constant Message_Event_Code_Type := 16#502#; Message_Event_HelpReply : constant Message_Event_Code_Type := 16#503#; Message_Event_Help_Word : constant Message_Event_Code_Type := 16#43B00#; Message_Event_TW_Input : constant Message_Event_Code_Type := 16#808C0#; Message_Event_TW_Output : constant Message_Event_Code_Type := 16#808C1#; Message_Event_TW_Ego : constant Message_Event_Code_Type := 16#808C2#; Message_Event_TW_Morio : constant Message_Event_Code_Type := 16#808C3#; Message_Event_TW_Morite : constant Message_Event_Code_Type := 16#808C4#; Message_Event_TW_NewTask : constant Message_Event_Code_Type := 16#808C5#; Message_Event_TW_Suspend : constant Message_Event_Code_Type := 16#808C6#; Message_Event_TW_Resume : constant Message_Event_Code_Type := 16#808C7#; Message_Event_PlugInQuit : constant Message_Event_Code_Type := 16#50D80#; Message_Event_PlugInQuitContinue : constant Message_Event_Code_Type := 16#50D81#; Message_Event_PlugInQuitAbort : constant Message_Event_Code_Type := 16#50D82#; Message_Event_OpenConfigWindow : constant Message_Event_Code_Type := 16#50D83#; Message_Event_Bugz_Query : constant Message_Event_Code_Type := 16#53B80#; Message_Event_Bugz_BugzFile : constant Message_Event_Code_Type := 16#53B81#; Message_Event_OLE_FileChanged : constant Message_Event_Code_Type := 16#80E1E#; Message_Event_OLEOpenSession : constant Message_Event_Code_Type := 16#80E21#; Message_Event_OLEOpenSessionAck : constant Message_Event_Code_Type := 16#80E22#; Message_Event_OLECloseSession : constant Message_Event_Code_Type := 16#80E23#; Message_Event_ConfiX : constant Message_Event_Code_Type := 16#40D50#; Message_Event_StrongEDModeFileChanged : constant Message_Event_Code_Type := 16#43b06#; Message_Event_StrongEDInsertText : constant Message_Event_Code_Type := 16#43b04#; Message_Event_InetSuite_Open_URL : constant Message_Event_Code_Type := 16#4AF80#; type Message_EventListener (E : Message_Event_Code_Type) is abstract new Event_Listener(Message) with record Event_Code : Message_Event_Code_Type := E; end record; type Message_Event_Header is record Size : System.Unsigned_Types.Unsigned; Sender : Integer; MyRef : System.Unsigned_Types.Unsigned; YourRef : System.Unsigned_Types.Unsigned; Event_Code : Message_Event_Code_Type; end record; pragma Convention (C, Message_Event_Header); type ToolBox_Event_Code_Type is new System.Unsigned_Types.Unsigned; Toolbox_Event_Error : constant ToolBox_Event_Code_Type := 16#44EC0#; Toolbox_Event_ObjectAutoCreated : constant ToolBox_Event_Code_Type := 16#44EC1#; Toolbox_Event_ObjectDeleted : constant ToolBox_Event_Code_Type := 16#44EC2#; Toolbox_Event_Menu_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#828C0#; Toolbox_Event_Menu_HasBeenHidden : constant ToolBox_Event_Code_Type := 16#828C1#; Toolbox_Event_Menu_SubMenu : constant ToolBox_Event_Code_Type := 16#828C2#; Toolbox_Event_Menu_Selection : constant ToolBox_Event_Code_Type := 16#828C3#; Toolbox_Event_ColourDbox_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#829C0#; Toolbox_Event_ColourDbox_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#829C1#; Toolbox_Event_ColourDbox_ColourSelected : constant ToolBox_Event_Code_Type := 16#829C2#; Toolbox_Event_ColourDbox_ColourChanged : constant ToolBox_Event_Code_Type := 16#829C3#; Toolbox_Event_ColourMenu_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82980#; Toolbox_Event_ColourMenu_HasBeenHidden : constant ToolBox_Event_Code_Type := 16#82981#; Toolbox_Event_ColourMenu_Selection : constant ToolBox_Event_Code_Type := 16#82982#; Toolbox_Event_DCS_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82A80#; Toolbox_Event_DCS_Discard : constant ToolBox_Event_Code_Type := 16#82A81#; Toolbox_Event_DCS_Save : constant ToolBox_Event_Code_Type := 16#82A82#; Toolbox_Event_DCS_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82A83#; Toolbox_Event_DCS_Cancel : constant ToolBox_Event_Code_Type := 16#82A84#; Toolbox_Event_FileInfo_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82AC0#; Toolbox_Event_FileInfo_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82AC1#; Toolbox_Event_FontDbox_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82A00#; Toolbox_Event_FontDbox_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82A01#; Toolbox_Event_FontDbox_ApplyFont : constant ToolBox_Event_Code_Type := 16#82A02#; Toolbox_Event_FontMenu_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82A40#; Toolbox_Event_FontMenu_HasBeenHidden : constant ToolBox_Event_Code_Type := 16#82A41#; Toolbox_Event_FontMenu_Selection : constant ToolBox_Event_Code_Type := 16#82A42#; Toolbox_Event_Iconbar_Clicked : constant ToolBox_Event_Code_Type := 16#82900#; Toolbox_Event_Iconbar_SelectAboutToBeShown : constant ToolBox_Event_Code_Type := 16#82901#; Toolbox_Event_Iconbar_AdjustAboutToBeShown : constant ToolBox_Event_Code_Type := 16#82902#; Toolbox_Event_PrintDbox_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82B00#; Toolbox_Event_PrintDbox_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82B01#; Toolbox_Event_PrintDbox_SetupAboutToBeShown : constant ToolBox_Event_Code_Type := 16#82B02#; Toolbox_Event_PrintDbox_Save : constant ToolBox_Event_Code_Type := 16#82B03#; Toolbox_Event_PrintDbox_SetUp : constant ToolBox_Event_Code_Type := 16#82B04#; Toolbox_Event_PrintDbox_Print : constant ToolBox_Event_Code_Type := 16#82B05#; Toolbox_Event_ProgInfo_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82B40#; Toolbox_Event_ProgInfo_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82B41#; Toolbox_Event_ProgInfo_LaunchWebPage : constant ToolBox_Event_Code_Type := 16#82B42#; Toolbox_Event_Quit_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82A90#; Toolbox_Event_Quit_Quit : constant ToolBox_Event_Code_Type := 16#82A91#; Toolbox_Event_Quit_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82A92#; Toolbox_Event_Quit_Cancel : constant ToolBox_Event_Code_Type := 16#82A93#; Toolbox_Event_SaveAs_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82BC0#; Toolbox_Event_SaveAs_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82BC1#; Toolbox_Event_SaveAs_SaveToFile : constant ToolBox_Event_Code_Type := 16#82BC2#; Toolbox_Event_SaveAs_FillBuffer : constant ToolBox_Event_Code_Type := 16#82BC3#; Toolbox_Event_SaveAs_SaveCompleted : constant ToolBox_Event_Code_Type := 16#82BC4#; Toolbox_Event_Scale_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82C00#; Toolbox_Event_Scale_DialogueCompleted : constant ToolBox_Event_Code_Type := 16#82C01#; Toolbox_Event_Scale_ApplyFactor : constant ToolBox_Event_Code_Type := 16#82C02#; Toolbox_Event_Window_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#82880#; Toolbox_Event_Window_GadgetLostFocus : constant ToolBox_Event_Code_Type := 16#82891#; Toolbox_Event_ActionButton_Selected : constant ToolBox_Event_Code_Type := 16#82881#; Toolbox_Event_OptionButton_StateChanged : constant ToolBox_Event_Code_Type := 16#82882#; Toolbox_Event_RadioButton_StateChanged : constant ToolBox_Event_Code_Type := 16#82883#; Toolbox_Event_DisplayField_ValueChanged : constant ToolBox_Event_Code_Type := 16#82884#; Toolbox_Event_WritableField_ValueChanged : constant ToolBox_Event_Code_Type := 16#82885#; Toolbox_Event_Slider_ValueChanged : constant ToolBox_Event_Code_Type := 16#82886#; Toolbox_Event_Draggable_DragStarted : constant ToolBox_Event_Code_Type := 16#82887#; Toolbox_Event_Draggable_DragEnded : constant ToolBox_Event_Code_Type := 16#82888#; Toolbox_Event_PopUp_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#8288B#; Toolbox_Event_Adjuster_Clicked : constant ToolBox_Event_Code_Type := 16#8288C#; Toolbox_Event_NumberRange_ValueChanged : constant ToolBox_Event_Code_Type := 16#8288D#; Toolbox_Event_StringSet_ValueChanged : constant ToolBox_Event_Code_Type := 16#8288E#; Toolbox_Event_StringSet_AboutToBeShown : constant ToolBox_Event_Code_Type := 16#8288F#; Toolbox_Event_Window_HasBeenHidden : constant ToolBox_Event_Code_Type := 16#82890#; ToolBox_Event_Quit : constant ToolBox_Event_Code_Type := 16#82A91#; Toolbox_Event_ScrollList_Selection : constant ToolBox_Event_Code_Type := 16#140181#; Toolbox_Event_TextArea_DataLoaded : constant ToolBox_Event_Code_Type := 16#140180#; Toolbox_Event_Scrollbar_PositionChanged : constant ToolBox_Event_Code_Type := 16#140183#; Toolbox_Event_ToolAction_ButtonClicked : constant ToolBox_Event_Code_Type := 16#140140#; TreeView_SWIBase : constant ToolBox_Event_Code_Type := 16#140280#; TreeView_EventBase : constant ToolBox_Event_Code_Type := TreeView_SWIBase; Toolbox_Event_TreeViewNodeSelected : constant ToolBox_Event_Code_Type := TreeView_EventBase + 0; Toolbox_Event_TreeViewNodeExpanded : constant ToolBox_Event_Code_Type := TreeView_EventBase + 1; Toolbox_Event_TreeViewNodeRenamed : constant ToolBox_Event_Code_Type := TreeView_EventBase + 2; Toolbox_Event_TreeViewNodeDataRequired : constant ToolBox_Event_Code_Type := TreeView_EventBase + 3; Toolbox_Event_TreeViewNodeDragged : constant ToolBox_Event_Code_Type := TreeView_EventBase + 4; type Object_ID is new Integer; type Component_ID is new Integer; subtype Error_Code_Type is Integer; Error_Escape : constant Error_Code_Type := 16#11#; Error_Bad_mode : constant Error_Code_Type := 16#19#; Error_Is_adir : constant Error_Code_Type := 16#A8#; Error_Types_dont_match : constant Error_Code_Type := 16#AF#; Error_Bad_rename : constant Error_Code_Type := 16#B0#; Error_Bad_copy : constant Error_Code_Type := 16#B1#; Error_Outside_file : constant Error_Code_Type := 16#B7#; Error_Access_violation : constant Error_Code_Type := 16#BD#; Error_Too_many_open_files : constant Error_Code_Type := 16#C0#; Error_Not_open_for_update : constant Error_Code_Type := 16#C1#; Error_File_open : constant Error_Code_Type := 16#C2#; Error_Object_locked : constant Error_Code_Type := 16#C3#; Error_Already_exists : constant Error_Code_Type := 16#C4#; Error_Bad_file_name : constant Error_Code_Type := 16#CC#; Error_File_not_found : constant Error_Code_Type := 16#D6#; Error_Syntax : constant Error_Code_Type := 16#DC#; Error_Channel : constant Error_Code_Type := 16#DE#; Error_End_of_file : constant Error_Code_Type := 16#DF#; Error_Buffer_Overflow : constant Error_Code_Type := 16#E4#; Error_Bad_filing_system_name : constant Error_Code_Type := 16#F8#; Error_Bad_key : constant Error_Code_Type := 16#FB#; Error_Bad_address : constant Error_Code_Type := 16#FC#; Error_Bad_string : constant Error_Code_Type := 16#FD#; Error_Bad_command : constant Error_Code_Type := 16#FE#; Error_Bad_mac_val : constant Error_Code_Type := 16#120#; Error_Bad_var_nam : constant Error_Code_Type := 16#121#; Error_Bad_var_type : constant Error_Code_Type := 16#122#; Error_Var_no_room : constant Error_Code_Type := 16#123#; Error_Var_cant_find : constant Error_Code_Type := 16#124#; Error_Var_too_long : constant Error_Code_Type := 16#125#; Error_Redirect_fail : constant Error_Code_Type := 16#140#; Error_Stack_full : constant Error_Code_Type := 16#141#; Error_Bad_hex : constant Error_Code_Type := 16#160#; Error_Bad_expr : constant Error_Code_Type := 16#161#; Error_Bad_bra : constant Error_Code_Type := 16#162#; Error_Stk_oflo : constant Error_Code_Type := 16#163#; Error_Miss_opn : constant Error_Code_Type := 16#164#; Error_Miss_opr : constant Error_Code_Type := 16#165#; Error_Bad_bits : constant Error_Code_Type := 16#166#; Error_Str_oflo : constant Error_Code_Type := 16#167#; Error_Bad_itm : constant Error_Code_Type := 16#168#; Error_Div_zero : constant Error_Code_Type := 16#169#; Error_Bad_base : constant Error_Code_Type := 16#16A#; Error_Bad_numb : constant Error_Code_Type := 16#16B#; Error_Numb_too_big : constant Error_Code_Type := 16#16C#; Error_Bad_claim_num : constant Error_Code_Type := 16#1A1#; Error_Bad_release : constant Error_Code_Type := 16#1A2#; Error_Bad_dev_no : constant Error_Code_Type := 16#1A3#; Error_Bad_dev_vec_rel : constant Error_Code_Type := 16#1A4#; Error_Bad_env_number : constant Error_Code_Type := 16#1B0#; Error_Cant_cancel_quit : constant Error_Code_Type := 16#1B1#; Error_Ch_dynam_cao : constant Error_Code_Type := 16#1C0#; Error_Ch_dynam_not_all_moved : constant Error_Code_Type := 16#1C1#; Error_Apl_wspace_in_use : constant Error_Code_Type := 16#1C2#; Error_Ram_fs_unchangeable : constant Error_Code_Type := 16#1C3#; Error_Oscli_long_line : constant Error_Code_Type := 16#1E0#; Error_Oscli_too_hard : constant Error_Code_Type := 16#1E1#; Error_Rc_exc : constant Error_Code_Type := 16#1E2#; Error_Sys_heap_full : constant Error_Code_Type := 16#1E3#; Error_Buff_overflow : constant Error_Code_Type := 16#1E4#; Error_Bad_time : constant Error_Code_Type := 16#1E5#; Error_No_such_swi : constant Error_Code_Type := 16#1E6#; Error_Unimplemented : constant Error_Code_Type := 16#1E7#; Error_Out_of_range : constant Error_Code_Type := 16#1E8#; Error_No_oscli_specials : constant Error_Code_Type := 16#1E9#; Error_Bad_parameters : constant Error_Code_Type := 16#1EA#; Error_Arg_repeated : constant Error_Code_Type := 16#1EB#; Error_Bad_read_sys_info : constant Error_Code_Type := 16#1EC#; Error_Cdat_stack_overflow : constant Error_Code_Type := 16#2C0#; Error_Cdat_buffer_overflow : constant Error_Code_Type := 16#2C1#; Error_Cdat_bad_field : constant Error_Code_Type := 16#2C2#; Error_Cant_start_application : constant Error_Code_Type := 16#600#; Error_ADFS_Driver_In_Use : constant Error_Code_Type := 16#108A0#; Error_CD_Base : constant Error_Code_Type := 16#803400#; Error_CD_Bad_Alignment : constant Error_Code_Type := 16#803401#; Error_CD_Drive_Not_Supported : constant Error_Code_Type := 16#803402#; Error_CD_Bad_Mode : constant Error_Code_Type := 16#803403#; Error_CD_Invalid_Parameter : constant Error_Code_Type := 16#803404#; Error_CD_Not_Audio_Track : constant Error_Code_Type := 16#803405#; Error_CD_No_Caddy : constant Error_Code_Type := 16#803406#; Error_CD_No_Drive : constant Error_Code_Type := 16#803407#; Error_CD_Invalid_Format : constant Error_Code_Type := 16#803408#; Error_CD_Bad_Minutes : constant Error_Code_Type := 16#803409#; Error_CD_Bad_Seconds : constant Error_Code_Type := 16#80340A#; Error_CD_Bad_Blocks : constant Error_Code_Type := 16#80340B#; Error_CD_Physical_Block_Bad : constant Error_Code_Type := 16#80340C#; Error_CD_Drawer_Locked : constant Error_Code_Type := 16#80340D#; Error_CD_Wrong_Data_Mode : constant Error_Code_Type := 16#80340E#; Error_CD_Channel_Not_Supported : constant Error_Code_Type := 16#80340F#; Error_CD_Bad_Device_ID : constant Error_Code_Type := 16#803410#; Error_CD_Bad_Card_Number : constant Error_Code_Type := 16#803411#; Error_CD_Bad_Lun_Number : constant Error_Code_Type := 16#803412#; Error_CD_No_Such_Track : constant Error_Code_Type := 16#803413#; Error_CD_Faulty_Disc : constant Error_Code_Type := 16#803414#; Error_CD_No_Such_Block : constant Error_Code_Type := 16#803415#; Error_CD_Not_Supported : constant Error_Code_Type := 16#803416#; Error_CD_Driver_Not_Present : constant Error_Code_Type := 16#803417#; Error_CD_SWI_Not_Supported : constant Error_Code_Type := 16#803418#; Error_CD_Too_Many_Drivers : constant Error_Code_Type := 16#803419#; Error_CD_Not_Registered : constant Error_Code_Type := 16#80341A#; Error_Colour_DBox_Tasks_Active : constant Error_Code_Type := 16#80AE00#; Error_Colour_DBox_Alloc_Failed : constant Error_Code_Type := 16#80AE01#; Error_Colour_DBox_Short_Buffer : constant Error_Code_Type := 16#80AE02#; Error_Colour_DBox_No_Such_Task : constant Error_Code_Type := 16#80AE11#; Error_Colour_DBox_No_Such_Method : constant Error_Code_Type := 16#80AE12#; Error_Colour_DBox_No_Such_Misc_op_Method : constant Error_Code_Type := 16#80AE13#; Error_Colour_Picker_Uninit : constant Error_Code_Type := 16#20D00#; Error_Colour_Picker_Bad_Model : constant Error_Code_Type := 16#20D01#; Error_Colour_Picker_Bad_Handle : constant Error_Code_Type := 16#20D02#; Error_Colour_Picker_Bad_Flags : constant Error_Code_Type := 16#20D03#; Error_Colour_Picker_In_Use : constant Error_Code_Type := 16#20D04#; Error_Colour_Picker_Model_In_Use : constant Error_Code_Type := 16#20D05#; Error_Colour_Picker_Bad_Reason : constant Error_Code_Type := 16#20D06#; Error_Colour_Trans_Bad_Calib : constant Error_Code_Type := 16#A00#; Error_Colour_Trans_Conv_Over : constant Error_Code_Type := 16#A01#; Error_Colour_Trans_Bad_HSV : constant Error_Code_Type := 16#A02#; Error_Colour_Trans_Switched : constant Error_Code_Type := 16#A03#; Error_Colour_Trans_Bad_Misc_Op : constant Error_Code_Type := 16#A04#; Error_Colour_Trans_Bad_Flags : constant Error_Code_Type := 16#A05#; Error_Colour_Trans_Buff_Over : constant Error_Code_Type := 16#A06#; Error_Colour_Trans_Bad_Depth : constant Error_Code_Type := 16#A07#; Error_Compress_JPEG_Bad_BPP : constant Error_Code_Type := 16#8183C0#; Error_Compress_JPEG_Bad_Line_Count : constant Error_Code_Type := 16#8183C1#; Error_Compress_JPEG_Bad_Buffer : constant Error_Code_Type := 16#8183C2#; Error_Compress_JPEG_Bad_Size : constant Error_Code_Type := 16#8183C3#; Error_Compress_JPEG_Arith_Not_Impl : constant Error_Code_Type := 16#81A881#; Error_Compress_JPEG_Bad_Align_Type : constant Error_Code_Type := 16#81A882#; Error_Compress_JPEG_Bad_Alloc_Chunk : constant Error_Code_Type := 16#81A883#; Error_Compress_JPEG_Bad_Buffer_Mode : constant Error_Code_Type := 16#81A884#; Error_Compress_JPEG_Bad_Component_ID : constant Error_Code_Type := 16#81A885#; Error_Compress_JPEG_Bad_DCT_Size : constant Error_Code_Type := 16#81A886#; Error_Compress_JPEG_Bad_In_Colour_Space : constant Error_Code_Type := 16#81A887#; Error_Compress_JPEG_Bad_KColour_Space : constant Error_Code_Type := 16#81A888#; Error_Compress_JPEG_Bad_Length : constant Error_Code_Type := 16#81A889#; Error_Compress_JPEG_Bad_MCU_Size : constant Error_Code_Type := 16#81A88A#; Error_Compress_JPEG_Bad_Pool_ID : constant Error_Code_Type := 16#81A88B#; Error_Compress_JPEG_Bad_Precision : constant Error_Code_Type := 16#81A88C#; Error_Compress_JPEG_Bad_Sampling : constant Error_Code_Type := 16#81A88D#; Error_Compress_JPEG_Bad_State : constant Error_Code_Type := 16#81A88E#; Error_Compress_JPEG_Bad_Virtual_Access : constant Error_Code_Type := 16#81A88F#; Error_Compress_JPEG_Buffer_Size : constant Error_Code_Type := 16#81A890#; Error_Compress_JPEG_Cant_Suspend : constant Error_Code_Type := 16#81A891#; Error_Compress_JPEGCCIR601_Not_Impl : constant Error_Code_Type := 16#81A892#; Error_Compress_JPEG_Component_Count : constant Error_Code_Type := 16#81A893#; Error_Compress_JPEG_Conversion_Not_Impl : constant Error_Code_Type := 16#81A894#; Error_Compress_JPEGDAC_Index : constant Error_Code_Type := 16#81A895#; Error_Compress_JPEGDAC_Value : constant Error_Code_Type := 16#81A896#; Error_Compress_JPEGDHT_Index : constant Error_Code_Type := 16#81A897#; Error_Compress_JPEGDQT_Index : constant Error_Code_Type := 16#81A898#; Error_Compress_JPEG_Empty_Image : constant Error_Code_Type := 16#81A899#; Error_Compress_JPEGEOI_Expected : constant Error_Code_Type := 16#81A89A#; Error_Compress_JPEG_File_Read : constant Error_Code_Type := 16#81A89B#; Error_Compress_JPEG_File_Write : constant Error_Code_Type := 16#81A89C#; Error_Compress_JPEG_Fract_Sample_Not_Impl : constant Error_Code_Type := 16#81A89D#; Error_Compress_JPEG_Huff_Clen_Overflow : constant Error_Code_Type := 16#81A89E#; Error_Compress_JPEG_Huff_Missing_Code : constant Error_Code_Type := 16#81A89F#; Error_Compress_JPEG_Image_Too_Big : constant Error_Code_Type := 16#81A8A0#; Error_Compress_JPEG_Input_Empty : constant Error_Code_Type := 16#81A8A1#; Error_Compress_JPEG_Input_EOF : constant Error_Code_Type := 16#81A8A2#; Error_Compress_JPEG_Not_Impl : constant Error_Code_Type := 16#81A8A3#; Error_Compress_JPEG_Not_Compiled : constant Error_Code_Type := 16#81A8A4#; Error_Compress_JPEG_No_Backing_Store : constant Error_Code_Type := 16#81A8A5#; Error_Compress_JPEG_No_Huff_Table : constant Error_Code_Type := 16#81A8A6#; Error_Compress_JPEG_No_Image : constant Error_Code_Type := 16#81A8A7#; Error_Compress_JPEG_No_Quant_Table : constant Error_Code_Type := 16#81A8A8#; Error_Compress_JPEG_No_Soi : constant Error_Code_Type := 16#81A8A9#; Error_Compress_JPEG_Out_Of_Memory : constant Error_Code_Type := 16#81A8AA#; Error_Compress_JPEG_Quant_Components : constant Error_Code_Type := 16#81A8AB#; Error_Compress_JPEG_Quant_Few_Colours : constant Error_Code_Type := 16#81A8AC#; Error_Compress_JPEG_Quant_Many_Colours : constant Error_Code_Type := 16#81A8AD#; Error_Compress_JPEGSOF_Duplicate : constant Error_Code_Type := 16#81A8AE#; Error_Compress_JPEGSOF_No_Sos : constant Error_Code_Type := 16#81A8AF#; Error_Compress_JPEGSOF_Unsupported : constant Error_Code_Type := 16#81A8B0#; Error_Compress_JPEGSOI_Duplicate : constant Error_Code_Type := 16#81A8B1#; Error_Compress_JPEGSOS_No_Sof : constant Error_Code_Type := 16#81A8B2#; Error_Compress_JPEG_Too_Little_Data : constant Error_Code_Type := 16#81A8B3#; Error_Compress_JPEG_Unknown_Marker : constant Error_Code_Type := 16#81A8B4#; Error_Compress_JPEG_Virtual_Bug : constant Error_Code_Type := 16#81A8B5#; Error_Compress_JPEG_Width_Overflow : constant Error_Code_Type := 16#81A8B6#; Error_Compress_JPEG_Bad_DCT_Coef : constant Error_Code_Type := 16#81A8B7#; Error_Compress_JPEG_Bad_Huff_Table : constant Error_Code_Type := 16#81A8B8#; Error_Compress_JPEG_Bad_Progression : constant Error_Code_Type := 16#81A8B9#; Error_Compress_JPEG_Bad_Prog_Script : constant Error_Code_Type := 16#81A8BA#; Error_Compress_JPEG_Bad_Scan_Script : constant Error_Code_Type := 16#81A8BB#; Error_Compress_JPEG_Mismatched_Quant_Table : constant Error_Code_Type := 16#81A8BC#; Error_Compress_JPEG_Missing_Data : constant Error_Code_Type := 16#81A8BD#; Error_Compress_JPEG_Mode_Change : constant Error_Code_Type := 16#81A8BE#; Error_Compress_JPEGW_Buffer_Size : constant Error_Code_Type := 16#81A8BF#; Error_DDE_Utils_Unknown_SWI : constant Error_Code_Type := 16#20600#; Error_DDE_Utils_No_CLI_Buffer : constant Error_Code_Type := 16#20601#; Error_DDE_Utils_Not_Desktop : constant Error_Code_Type := 16#20602#; Error_DDE_Utils_No_Task : constant Error_Code_Type := 16#20603#; Error_DDE_Utils_Already_Registered : constant Error_Code_Type := 16#20604#; Error_DDE_Utils_Not_Registered : constant Error_Code_Type := 16#20605#; Error_Debug_Break_Not_Found : constant Error_Code_Type := 16#800#; Error_Debug_invalid_Value : constant Error_Code_Type := 16#801#; Error_Debug_Resetting : constant Error_Code_Type := 16#802#; Error_Debug_No_Room : constant Error_Code_Type := 16#803#; Error_Debug_No_Breakpoints : constant Error_Code_Type := 16#804#; Error_Debug_Bad_Breakpoint : constant Error_Code_Type := 16#805#; Error_Debug_Undefined : constant Error_Code_Type := 16#806#; Error_Debug_Non_Aligned : constant Error_Code_Type := 16#807#; Error_Debug_No_Workspace : constant Error_Code_Type := 16#808#; Error_Draw_No_Draw_In_IRQ_Mode : constant Error_Code_Type :=16#980#; Error_Draw_Bad_Draw_Reason_Code : constant Error_Code_Type :=16#981#; Error_Draw_Reserved_Draw_Bits : constant Error_Code_Type :=16#982#; Error_Draw_Invalid_Draw_Address : constant Error_Code_Type :=16#983#; Error_Draw_Bad_Path_Element : constant Error_Code_Type :=16#984#; Error_Draw_Bad_Path_Sequence : constant Error_Code_Type :=16#985#; Error_Draw_May_Expand_Path : constant Error_Code_Type :=16#986#; Error_Draw_Path_Full : constant Error_Code_Type :=16#987#; Error_Draw_Path_Not_Flat : constant Error_Code_Type :=16#988#; Error_Draw_Bad_Caps_Or_Joins : constant Error_Code_Type :=16#989#; Error_Draw_Transform_Overflow : constant Error_Code_Type :=16#98A#; Error_Draw_Draw_Needs_Graphics_Mode : constant Error_Code_Type :=16#98B#; Error_Draw_Unimplemented_Draw : constant Error_Code_Type :=16#9FF#; Error_Draw_File_Not_Draw : constant Error_Code_Type := 16#20C00#; Error_Draw_File_Version : constant Error_Code_Type := 16#20C01#; Error_Draw_File_Font_Tab : constant Error_Code_Type := 16#20C02#; Error_Draw_File_Bad_Font_No : constant Error_Code_Type := 16#20C03#; Error_Draw_File_Bad_Mode : constant Error_Code_Type := 16#20C04#; Error_Draw_File_Bad_File : constant Error_Code_Type := 16#20C05#; Error_Draw_File_Bad_Group : constant Error_Code_Type := 16#20C06#; Error_Draw_File_Bad_Tag : constant Error_Code_Type := 16#20C07#; Error_Draw_File_Syntax : constant Error_Code_Type := 16#20C08#; Error_Draw_File_Font_No : constant Error_Code_Type := 16#20C09#; Error_Draw_File_Area_Ver : constant Error_Code_Type := 16#20C0A#; Error_Draw_File_No_Area_Ver : constant Error_Code_Type := 16#20C0B#; Error_Econet_Tx_Ready : constant Error_Code_Type := 16#300#; Error_Econet_Transmitting : constant Error_Code_Type := 16#301#; Error_Econet_Rx_Ready : constant Error_Code_Type := 16#302#; Error_Econet_Receiving : constant Error_Code_Type := 16#303#; Error_Econet_Received : constant Error_Code_Type := 16#304#; Error_Econet_Transmitted : constant Error_Code_Type := 16#305#; Error_Econet_Bad_Station : constant Error_Code_Type := 16#306#; Error_Econet_Bad_Network : constant Error_Code_Type := 16#307#; Error_Econet_Unable_To_Default : constant Error_Code_Type := 16#308#; Error_Econet_Bad_Port : constant Error_Code_Type := 16#309#; Error_Econet_Bad_Control : constant Error_Code_Type := 16#30A#; Error_Econet_Bad_Buffer : constant Error_Code_Type := 16#30B#; Error_Econet_Bad_Size : constant Error_Code_Type := 16#30C#; Error_Econet_Bad_Mask : constant Error_Code_Type := 16#30D#; Error_Econet_Bad_Count : constant Error_Code_Type := 16#30E#; Error_Econet_Bad_Delay : constant Error_Code_Type := 16#30F#; Error_Econet_Bad_Status : constant Error_Code_Type := 16#310#; Error_Econet_No_Hardware : constant Error_Code_Type := 16#311#; Error_Econet_No_Econet : constant Error_Code_Type := 16#312#; Error_Econet_No_More_Domains : constant Error_Code_Type := 16#313#; Error_Econet_Bad_Domain : constant Error_Code_Type := 16#314#; Error_Econet_Un_Registered_Domain : constant Error_Code_Type := 16#315#; Error_Econet_Port_Not_Allocated : constant Error_Code_Type := 16#316#; Error_Econet_Port_Allocated : constant Error_Code_Type := 16#317#; Error_Econet_No_More_Ports : constant Error_Code_Type := 16#318#; Error_Filer_No_Recursion : constant Error_Code_Type := 16#B80#; Error_Filer_No_Template : constant Error_Code_Type := 16#B81#; Error_Filer_Failed_Save : constant Error_Code_Type := 16#B82#; Error_Filer_Bad_Path : constant Error_Code_Type := 16#B83#; Error_File_Switch_No_Claim : constant Error_Code_Type := 16#400#; Error_Bad_FS_Control_Reason : constant Error_Code_Type := 16#401#; Error_Bad_OS_File_Reason : constant Error_Code_Type := 16#402#; Error_Bad_OS_Args_Reason : constant Error_Code_Type := 16#403#; Error_Bad_OSGBPB_Reason : constant Error_Code_Type := 16#404#; Error_Bad_Mode_For_OS_Find : constant Error_Code_Type := 16#405#; Error_No_Room_For_Transient : constant Error_Code_Type := 16#406#; Error_Exec_Addr_Not_In_Code : constant Error_Code_Type := 16#407#; Error_Exec_Addr_TOO_Low : constant Error_Code_Type := 16#408#; Error_Unknown_Action_Type : constant Error_Code_Type := 16#409#; Error_Too_Many_Levels : constant Error_Code_Type := 16#40A#; Error_No_Selected_Filing_System : constant Error_Code_Type := 16#40B#; Error_Cant_Remove_FS_By_Number : constant Error_Code_Type := 16#40C#; Error_Unaligned_FS_Entry : constant Error_Code_Type := 16#40D#; Error_Unsupported_FS_Entry : constant Error_Code_Type := 16#40E#; Error_Fs_Not_Special : constant Error_Code_Type := 16#40F#; Error_Core_Not_Readable : constant Error_Code_Type := 16#410#; Error_Core_Not_Writeable : constant Error_Code_Type := 16#411#; Error_Bad_Buffer_Size_For_Stream : constant Error_Code_Type := 16#412#; Error_Not_Open_For_Reading : constant Error_Code_Type := 16#413#; Error_Not_Enough_Stack_For_FS_Entry : constant Error_Code_Type := 16#414#; Error_Nothing_To_Copy : constant Error_Code_Type := 16#415#; Error_Nothing_To_Delete : constant Error_Code_Type := 16#416#; Error_File_Switch_Cant_Be_Killed_Whilst_Threaded: constant Error_Code_Type := 16#417#; Error_Invalid_Error_Block : constant Error_Code_Type := 16#418#; Error_FS_File_Too_Big : constant Error_Code_Type := 16#419#; Error_Cant_RM_Faster_File_Switch : constant Error_Code_Type := 16#41A#; Error_Inconsistent_Handle_Set : constant Error_Code_Type := 16#41B#; Error_Is_AFile : constant Error_Code_Type := 16#41C#; Error_Bad_File_Type : constant Error_Code_Type := 16#41D#; Error_Library_Somewhere_Else : constant Error_Code_Type := 16#41E#; Error_Path_Is_Self_Contradictory : constant Error_Code_Type := 16#41F#; Error_Wasnt_Dollar_After_Disc : constant Error_Code_Type := 16#420#; Error_Not_Enough_Memory_For_Wildcard_Resolution : constant Error_Code_Type := 16#421#; Error_Not_Enough_Stack_For_Wildcard_Resolution : constant Error_Code_Type := 16#422#; Error_Dir_Wanted_File_Found : constant Error_Code_Type := 16#423#; Error_Not_Found : constant Error_Code_Type := 16#424#; Error_Multipart_Path_Used : constant Error_Code_Type := 16#425#; Error_Recursive_Path : constant Error_Code_Type := 16#426#; Error_Multi_FS_Does_Not_Support_GBPB11 : constant Error_Code_Type := 16#427#; Error_File_Switch_Data_Lost : constant Error_Code_Type := 16#428#; Error_Too_Many_Error_Lookups : constant Error_Code_Type := 16#429#; Error_Message_File_Busy : constant Error_Code_Type := 16#42A#; Error_Partition_Busy : constant Error_Code_Type := 16#42B#; Error_Font_No_Room : constant Error_Code_Type := 16#200#; Error_Font_Cache_Full : constant Error_Code_Type := 16#201#; Error_Font_No_Cache : constant Error_Code_Type := 16#202#; Error_Font_Too_Long : constant Error_Code_Type := 16#203#; Error_Font64K : constant Error_Code_Type := 16#204#; Error_Font_Pal_Too_Big : constant Error_Code_Type := 16#205#; Error_Font_Bad_Tran_Bits : constant Error_Code_Type := 16#206#; Error_Font_Not_Enough_Bits : constant Error_Code_Type := 16#207#; Error_Font_No_Font : constant Error_Code_Type := 16#208#; Error_Font_No_Pixels : constant Error_Code_Type := 16#209#; Error_Font_Bad_Font_Number : constant Error_Code_Type := 16#20A#; Error_Font_Not_Found : constant Error_Code_Type := 16#20B#; Error_Font_Bad_Font_File : constant Error_Code_Type := 16#20C#; Error_Font_No_Handles : constant Error_Code_Type := 16#20D#; Error_Font_Bad_Counter : constant Error_Code_Type := 16#20E#; Error_Font_Bad_CTRL_Char : constant Error_Code_Type := 16#20F#; Error_FontS_In_Use : constant Error_Code_Type := 16#210#; Error_Font_Bad_Segment : constant Error_Code_Type := 16#211#; Error_Font_Bad_Prefix : constant Error_Code_Type := 16#212#; Error_Font_Reserved : constant Error_Code_Type := 16#213#; Error_Font_Bad_Char_Code : constant Error_Code_Type := 16#214#; Error_Font_No_Bitmaps : constant Error_Code_Type := 16#215#; Error_Font_No_Bitmaps2 : constant Error_Code_Type := 16#216#; Error_Font_Bad_Font_Cache_File : constant Error_Code_Type := 16#217#; Error_Font_Field_Not_Found : constant Error_Code_Type := 16#218#; Error_Font_Bad_Matrix : constant Error_Code_Type := 16#219#; Error_Font_Overflow : constant Error_Code_Type := 16#21A#; Error_Font_Divby0 : constant Error_Code_Type := 16#21B#; Error_Font_Bad_Read_Metrics : constant Error_Code_Type := 16#21C#; Error_Font_Bad_RGB : constant Error_Code_Type := 16#21D#; Error_Font_Encoding_Not_Found : constant Error_Code_Type := 16#21E#; Error_Font_Must_Have_Slash : constant Error_Code_Type := 16#21F#; Error_Font_Bad_Encoding_Size : constant Error_Code_Type := 16#220#; Error_Font_Too_Many_Ids : constant Error_Code_Type := 16#221#; Error_Font_Too_Few_Ids : constant Error_Code_Type := 16#222#; Error_Font_No_Base_Encoding : constant Error_Code_Type := 16#223#; Error_Font_Identifier_Not_Found : constant Error_Code_Type := 16#224#; Error_Font_Too_Many_Chunks : constant Error_Code_Type := 16#225#; Error_Font_Bad_Font_File2 : constant Error_Code_Type := 16#226#; Error_FS_Lock_Unknown_SWI : constant Error_Code_Type := 16#806500#; Error_FS_Lock_Locked : constant Error_Code_Type := 16#806501#; Error_FS_Lock_Unknown_FS : constant Error_Code_Type := 16#806502#; Error_FS_Lock_FS_Not_Lockable : constant Error_Code_Type := 16#806503#; Error_FS_Lock_No_Locked_FS : constant Error_Code_Type := 16#806504#; Error_FS_Lock_Protected_Disc : constant Error_Code_Type := 16#806505#; Error_FS_Lock_Killed : constant Error_Code_Type := 16#806506#; Error_Message_Trans_Syntax : constant Error_Code_Type := 16#AC0#; Error_Message_Trans_File_Open : constant Error_Code_Type := 16#AC1#; Error_Message_Trans_Token_Not_Found : constant Error_Code_Type := 16#AC2#; Error_Message_Trans_Recurse : constant Error_Code_Type := 16#AC3#; Error_Net_FS_Bad_Command_Code : constant Error_Code_Type := 16#10501#; Error_Net_FS_Unexpected_Command_Code : constant Error_Code_Type := 16#10502#; Error_Net_FS_Unknown_Function_Code : constant Error_Code_Type := 16#10503#; Error_Net_FS_Unknown_Station_Name : constant Error_Code_Type := 16#10504#; Error_Net_FS_Unknown_Station_Number : constant Error_Code_Type := 16#10505#; Error_Net_FS_Station_Not_Found : constant Error_Code_Type := 16#10506#; Error_Net_FS_File_Server_Name_Too_Long : constant Error_Code_Type := 16#10507#; Error_Net_FS_Bad_File_Server_Date : constant Error_Code_Type := 16#10508#; Error_Net_FS_Net_FS_Internal_Error : constant Error_Code_Type := 16#10509#; Error_Net_FS_File_Server_Not_Capable : constant Error_Code_Type := 16#1050A#; Error_Net_FS_Broadcast_Server_Dead : constant Error_Code_Type := 16#1050B#; Error_Net_FS_File_Server_Only24_Bit : constant Error_Code_Type := 16#1050C#; Error_Net_Utils_Wrong_Version : constant Error_Code_Type := 16#1053A#; Error_Net_Utils_Net_FS_No_Go : constant Error_Code_Type := 16#1053B#; Error_Net_Utils_Is_Threaded : constant Error_Code_Type := 16#1053C#; Error_Net_FS_Set_Free_Syntax : constant Error_Code_Type := 16#10540#; Error_Net_FS_FS_Cli_Syntax : constant Error_Code_Type := 16#10541#; Error_Net_Print_Name_Too_Long : constant Error_Code_Type := 16#10C00#; Error_Net_Print_Single_Stream : constant Error_Code_Type := 16#10C01#; Error_Net_Print_All_Printers_Busy : constant Error_Code_Type := 16#10C02#; Error_Net_Print_Off_Line : constant Error_Code_Type := 16#10C09#; Error_Net_Print_Not_Found : constant Error_Code_Type := 16#10C0A#; Error_Net_Print_Internal_Error : constant Error_Code_Type := 16#10C0B#; Error_Heap_Bad_Reason : constant Error_Code_Type := 16#180#; Error_Heap_Init : constant Error_Code_Type := 16#181#; Error_Heap_Bad_Desc : constant Error_Code_Type := 16#182#; Error_Heap_Bad_Link : constant Error_Code_Type := 16#183#; Error_Heap_Alloc : constant Error_Code_Type := 16#184#; Error_Heap_Not_ABlock : constant Error_Code_Type := 16#185#; Error_Heap_Bad_Extend : constant Error_Code_Type := 16#186#; Error_Heap_Excessive_Shrink : constant Error_Code_Type := 16#187#; Error_Heap_Heap_Locked : constant Error_Code_Type := 16#188#; Exception_Heap_Bad_Reason : Exception; Exception_Heap_Init : Exception; Exception_Heap_Bad_Desc : Exception; Exception_Heap_Bad_Link : Exception; Exception_Heap_Alloc : Exception; Exception_Heap_Not_ABlock : Exception; Exception_Heap_Bad_Extend : Exception; Exception_Heap_Excessive_Shrink : Exception; Exception_Heap_Heap_Locked : Exception; Exception_Net_Print_Name_Too_Long : Exception; Exception_Net_Print_Single_Stream : Exception; Exception_Net_Print_All_Printers_Busy : Exception; Exception_Net_Print_Off_Line : Exception; Exception_Net_Print_Not_Found : Exception; Exception_Net_Print_Internal_Error : Exception; Exception_Net_FS_Bad_Command_Code : Exception; Exception_Net_FS_Unexpected_Command_Code : Exception; Exception_Net_FS_Unknown_Function_Code : Exception; Exception_Net_FS_Unknown_Station_Name : Exception; Exception_Net_FS_Unknown_Station_Number : Exception; Exception_Net_FS_Station_Not_Found : Exception; Exception_Net_FS_File_Server_Name_Too_Long : Exception; Exception_Net_FS_Bad_File_Server_Date : Exception; Exception_Net_FS_Net_FS_Internal_Error : Exception; Exception_Net_FS_File_Server_Not_Capable : Exception; Exception_Net_FS_Broadcast_Server_Dead : Exception; Exception_Net_FS_File_Server_Only24_Bit : Exception; Exception_Net_Utils_Wrong_Version : Exception; Exception_Net_Utils_Net_FS_No_Go : Exception; Exception_Net_Utils_Is_Threaded : Exception; Exception_Net_FS_Set_Free_Syntax : Exception; Exception_Net_FS_FS_Cli_Syntax : Exception; Exception_Message_Trans_Syntax : Exception; Exception_Message_Trans_File_Open : Exception; Exception_Message_Trans_Token_Not_Found : Exception; Exception_Message_Trans_Recurse : Exception; Exception_FS_Lock_Unknown_SWI : Exception; Exception_FS_Lock_Locked : Exception; Exception_FS_Lock_Unknown_FS : Exception; Exception_FS_Lock_FS_Not_Lockable : Exception; Exception_FS_Lock_No_Locked_FS : Exception; Exception_FS_Lock_Protected_Disc : Exception; Exception_FS_Lock_Killed : Exception; Exception_Font_No_Room : Exception; Exception_Font_Cache_Full : Exception; Exception_Font_No_Cache : Exception; Exception_Font_Too_Long : Exception; Exception_Font64K : Exception; Exception_Font_Pal_Too_Big : Exception; Exception_Font_Bad_Tran_Bits : Exception; Exception_Font_Not_Enough_Bits : Exception; Exception_Font_No_Font : Exception; Exception_Font_No_Pixels : Exception; Exception_Font_Bad_Font_Number : Exception; Exception_Font_Not_Found : Exception; Exception_Font_Bad_Font_File : Exception; Exception_Font_No_Handles : Exception; Exception_Font_Bad_Counter : Exception; Exception_Font_Bad_CTRL_Char : Exception; Exception_FontS_In_Use : Exception; Exception_Font_Bad_Segment : Exception; Exception_Font_Bad_Prefix : Exception; Exception_Font_Reserved : Exception; Exception_Font_Bad_Char_Code : Exception; Exception_Font_No_Bitmaps : Exception; Exception_Font_No_Bitmaps2 : Exception; Exception_Font_Bad_Font_Cache_File : Exception; Exception_Font_Field_Not_Found : Exception; Exception_Font_Bad_Matrix : Exception; Exception_Font_Overflow : Exception; Exception_Font_Divby0 : Exception; Exception_Font_Bad_Read_Metrics : Exception; Exception_Font_Bad_RGB : Exception; Exception_Font_Encoding_Not_Found : Exception; Exception_Font_Must_Have_Slash : Exception; Exception_Font_Bad_Encoding_Size : Exception; Exception_Font_Too_Many_Ids : Exception; Exception_Font_Too_Few_Ids : Exception; Exception_Font_No_Base_Encoding : Exception; Exception_Font_Identifier_Not_Found : Exception; Exception_Font_Too_Many_Chunks : Exception; Exception_Font_Bad_Font_File2 : Exception; Exception_File_Switch_No_Claim : Exception; Exception_Bad_FS_Control_Reason : Exception; Exception_Bad_OS_File_Reason : Exception; Exception_Bad_OS_Args_Reason : Exception; Exception_Bad_OSGBPB_Reason : Exception; Exception_Bad_Mode_For_OS_Find : Exception; Exception_No_Room_For_Transient : Exception; Exception_Exec_Addr_Not_In_Code : Exception; Exception_Exec_Addr_TOO_Low : Exception; Exception_Unknown_Action_Type : Exception; Exception_Too_Many_Levels : Exception; Exception_No_Selected_Filing_System : Exception; Exception_Cant_Remove_FS_By_Number : Exception; Exception_Unaligned_FS_Entry : Exception; Exception_Unsupported_FS_Entry : Exception; Exception_Fs_Not_Special : Exception; Exception_Core_Not_Readable : Exception; Exception_Core_Not_Writeable : Exception; Exception_Bad_Buffer_Size_For_Stream : Exception; Exception_Not_Open_For_Reading : Exception; Exception_Not_Enough_Stack_For_FS_Entry : Exception; Exception_Nothing_To_Copy : Exception; Exception_Nothing_To_Delete : Exception; Exception_File_Switch_Cant_Be_Killed_Whilst_Threaded : Exception; Exception_Invalid_Error_Block : Exception; Exception_FS_File_Too_Big : Exception; Exception_Cant_RM_Faster_File_Switch : Exception; Exception_Inconsistent_Handle_Set : Exception; Exception_Is_AFile : Exception; Exception_Bad_File_Type : Exception; Exception_Library_Somewhere_Else : Exception; Exception_Path_Is_Self_Contradictory : Exception; Exception_Wasnt_Dollar_After_Disc : Exception; Exception_Not_Enough_Memory_For_Wildcard_Resolution : Exception; Exception_Not_Enough_Stack_For_Wildcard_Resolution : Exception; Exception_Dir_Wanted_File_Found : Exception; Exception_Not_Found : Exception; Exception_Multipart_Path_Used : Exception; Exception_Recursive_Path : Exception; Exception_Multi_FS_Does_Not_Support_GBPB11 : Exception; Exception_File_Switch_Data_Lost : Exception; Exception_Too_Many_Error_Lookups : Exception; Exception_Message_File_Busy : Exception; Exception_Partition_Busy : Exception; Exception_Filer_No_Recursion : Exception; Exception_Filer_No_Template : Exception; Exception_Filer_Failed_Save : Exception; Exception_Filer_Bad_Path : Exception; Exception_Econet_Tx_Ready : Exception; Exception_Econet_Transmitting : Exception; Exception_Econet_Rx_Ready : Exception; Exception_Econet_Receiving : Exception; Exception_Econet_Received : Exception; Exception_Econet_Transmitted : Exception; Exception_Econet_Bad_Station : Exception; Exception_Econet_Bad_Network : Exception; Exception_Econet_Unable_To_Default : Exception; Exception_Econet_Bad_Port : Exception; Exception_Econet_Bad_Control : Exception; Exception_Econet_Bad_Buffer : Exception; Exception_Econet_Bad_Size : Exception; Exception_Econet_Bad_Mask : Exception; Exception_Econet_Bad_Count : Exception; Exception_Econet_Bad_Delay : Exception; Exception_Econet_Bad_Status : Exception; Exception_Econet_No_Hardware : Exception; Exception_Econet_No_Econet : Exception; Exception_Econet_No_More_Domains : Exception; Exception_Econet_Bad_Domain : Exception; Exception_Econet_Un_Registered_Domain : Exception; Exception_Econet_Port_Not_Allocated : Exception; Exception_Econet_Port_Allocated : Exception; Exception_Econet_No_More_Ports : Exception; Exception_Draw_File_Not_Draw : Exception; Exception_Draw_File_Version : Exception; Exception_Draw_File_Font_Tab : Exception; Exception_Draw_File_Bad_Font_No : Exception; Exception_Draw_File_Bad_Mode : Exception; Exception_Draw_File_Bad_File : Exception; Exception_Draw_File_Bad_Group : Exception; Exception_Draw_File_Bad_Tag : Exception; Exception_Draw_File_Syntax : Exception; Exception_Draw_File_Font_No : Exception; Exception_Draw_File_Area_Ver : Exception; Exception_Draw_File_No_Area_Ver : Exception; Exception_Draw_No_Draw_In_IRQ_Mode : Exception; Exception_Draw_Bad_Draw_Reason_Code : Exception; Exception_Draw_Reserved_Draw_Bits : Exception; Exception_Draw_Invalid_Draw_Address : Exception; Exception_Draw_Bad_Path_Element : Exception; Exception_Draw_Bad_Path_Sequence : Exception; Exception_Draw_May_Expand_Path : Exception; Exception_Draw_Path_Full : Exception; Exception_Draw_Path_Not_Flat : Exception; Exception_Draw_Bad_Caps_Or_Joins : Exception; Exception_Draw_Transform_Overflow : Exception; Exception_Draw_Draw_Needs_Graphics_Mode : Exception; Exception_Draw_Unimplemented_Draw : Exception; Exception_Debug_Break_Not_Found : Exception; Exception_Debug_invalid_Value : Exception; Exception_Debug_Resetting : Exception; Exception_Debug_No_Room : Exception; Exception_Debug_No_Breakpoints : Exception; Exception_Debug_Bad_Breakpoint : Exception; Exception_Debug_Undefined : Exception; Exception_Debug_Non_Aligned : Exception; Exception_Debug_No_Workspace : Exception; Exception_DDE_Utils_Unknown_SWI : Exception; Exception_DDE_Utils_No_CLI_Buffer : Exception; Exception_DDE_Utils_Not_Desktop : Exception; Exception_DDE_Utils_No_Task : Exception; Exception_DDE_Utils_Already_Registered : Exception; Exception_DDE_Utils_Not_Registered : Exception; Exception_Compress_JPEG_Bad_BPP : Exception; Exception_Compress_JPEG_Bad_Line_Count : Exception; Exception_Compress_JPEG_Bad_Buffer : Exception; Exception_Compress_JPEG_Bad_Size : Exception; Exception_Compress_JPEG_Arith_Not_Impl : Exception; Exception_Compress_JPEG_Bad_Align_Type : Exception; Exception_Compress_JPEG_Bad_Alloc_Chunk : Exception; Exception_Compress_JPEG_Bad_Buffer_Mode : Exception; Exception_Compress_JPEG_Bad_Component_ID : Exception; Exception_Compress_JPEG_Bad_DCT_Size : Exception; Exception_Compress_JPEG_Bad_In_Colour_Space : Exception; Exception_Compress_JPEG_Bad_KColour_Space : Exception; Exception_Compress_JPEG_Bad_Length : Exception; Exception_Compress_JPEG_Bad_MCU_Size : Exception; Exception_Compress_JPEG_Bad_Pool_ID : Exception; Exception_Compress_JPEG_Bad_Precision : Exception; Exception_Compress_JPEG_Bad_Sampling : Exception; Exception_Compress_JPEG_Bad_State : Exception; Exception_Compress_JPEG_Bad_Virtual_Access : Exception; Exception_Compress_JPEG_Buffer_Size : Exception; Exception_Compress_JPEG_Cant_Suspend : Exception; Exception_Compress_JPEGCCIR601_Not_Impl : Exception; Exception_Compress_JPEG_Component_Count : Exception; Exception_Compress_JPEG_Conversion_Not_Impl : Exception; Exception_Compress_JPEGDAC_Index : Exception; Exception_Compress_JPEGDAC_Value : Exception; Exception_Compress_JPEGDHT_Index : Exception; Exception_Compress_JPEGDQT_Index : Exception; Exception_Compress_JPEG_Empty_Image : Exception; Exception_Compress_JPEGEOI_Expected : Exception; Exception_Compress_JPEG_File_Read : Exception; Exception_Compress_JPEG_File_Write : Exception; Exception_Compress_JPEG_Fract_Sample_Not_Impl : Exception; Exception_Compress_JPEG_Huff_Clen_Overflow : Exception; Exception_Compress_JPEG_Huff_Missing_Code : Exception; Exception_Compress_JPEG_Image_Too_Big : Exception; Exception_Compress_JPEG_Input_Empty : Exception; Exception_Compress_JPEG_Input_EOF : Exception; Exception_Compress_JPEG_Not_Impl : Exception; Exception_Compress_JPEG_Not_Compiled : Exception; Exception_Compress_JPEG_No_Backing_Store : Exception; Exception_Compress_JPEG_No_Huff_Table : Exception; Exception_Compress_JPEG_No_Image : Exception; Exception_Compress_JPEG_No_Quant_Table : Exception; Exception_Compress_JPEG_No_Soi : Exception; Exception_Compress_JPEG_Out_Of_Memory : Exception; Exception_Compress_JPEG_Quant_Components : Exception; Exception_Compress_JPEG_Quant_Few_Colours : Exception; Exception_Compress_JPEG_Quant_Many_Colours : Exception; Exception_Compress_JPEGSOF_Duplicate : Exception; Exception_Compress_JPEGSOF_No_Sos : Exception; Exception_Compress_JPEGSOF_Unsupported : Exception; Exception_Compress_JPEGSOI_Duplicate : Exception; Exception_Compress_JPEGSOS_No_Sof : Exception; Exception_Compress_JPEG_Too_Little_Data : Exception; Exception_Compress_JPEG_Unknown_Marker : Exception; Exception_Compress_JPEG_Virtual_Bug : Exception; Exception_Compress_JPEG_Width_Overflow : Exception; Exception_Compress_JPEG_Bad_DCT_Coef : Exception; Exception_Compress_JPEG_Bad_Huff_Table : Exception; Exception_Compress_JPEG_Bad_Progression : Exception; Exception_Compress_JPEG_Bad_Prog_Script : Exception; Exception_Compress_JPEG_Bad_Scan_Script : Exception; Exception_Compress_JPEG_Mismatched_Quant_Table : Exception; Exception_Compress_JPEG_Missing_Data : Exception; Exception_Compress_JPEG_Mode_Change : Exception; Exception_Compress_JPEGW_Buffer_Size : Exception; Exception_Colour_Trans_Bad_Calib : Exception; Exception_Colour_Trans_Conv_Over : Exception; Exception_Colour_Trans_Bad_HSV : Exception; Exception_Colour_Trans_Switched : Exception; Exception_Colour_Trans_Bad_Misc_Op : Exception; Exception_Colour_Trans_Bad_Flags : Exception; Exception_Colour_Trans_Buff_Over : Exception; Exception_Colour_Trans_Bad_Depth : Exception; Exception_Colour_Picker_Uninit : Exception; Exception_Colour_Picker_Bad_Model : Exception; Exception_Colour_Picker_Bad_Handle : Exception; Exception_Colour_Picker_Bad_Flags : Exception; Exception_Colour_Picker_In_Use : Exception; Exception_Colour_Picker_Model_In_Use : Exception; Exception_Colour_Picker_Bad_Reason : Exception; Exception_Colour_DBox_Tasks_Active : Exception; Exception_Colour_DBox_Alloc_Failed : Exception; Exception_Colour_DBox_Short_Buffer : Exception; Exception_Colour_DBox_No_Such_Task : Exception; Exception_Colour_DBox_No_Such_Method : Exception; Exception_Colour_DBox_No_Such_Misc_op_Method : Exception; Exception_CD_Base : Exception; Exception_CD_Bad_Alignment : Exception; Exception_CD_Drive_Not_Supported : Exception; Exception_CD_Bad_Mode : Exception; Exception_CD_Invalid_Parameter : Exception; Exception_CD_Not_Audio_Track : Exception; Exception_CD_No_Caddy : Exception; Exception_CD_No_Drive : Exception; Exception_CD_Invalid_Format : Exception; Exception_CD_Bad_Minutes : Exception; Exception_CD_Bad_Seconds : Exception; Exception_CD_Bad_Blocks : Exception; Exception_CD_Physical_Block_Bad : Exception; Exception_CD_Drawer_Locked : Exception; Exception_CD_Wrong_Data_Mode : Exception; Exception_CD_Channel_Not_Supported : Exception; Exception_CD_Bad_Device_ID : Exception; Exception_CD_Bad_Card_Number : Exception; Exception_CD_Bad_Lun_Number : Exception; Exception_CD_No_Such_Track : Exception; Exception_CD_Faulty_Disc : Exception; Exception_CD_No_Such_Block : Exception; Exception_CD_Not_Supported : Exception; Exception_CD_Driver_Not_Present : Exception; Exception_CD_SWI_Not_Supported : Exception; Exception_CD_Too_Many_Drivers : Exception; Exception_CD_Not_Registered : Exception; Exception_ADFS_Driver_In_Use : Exception; Exception_Escape : Exception; Exception_Bad_mode : Exception; Exception_Is_adir : Exception; Exception_Types_dont_match : Exception; Exception_Bad_rename : Exception; Exception_Bad_copy : Exception; Exception_Outside_file : Exception; Exception_Access_violation : Exception; Exception_Too_many_open_files : Exception; Exception_Not_open_for_update : Exception; Exception_File_open : Exception; Exception_Object_locked : Exception; Exception_Already_exists : Exception; Exception_Bad_file_name : Exception; Exception_File_not_found : Exception; Exception_Syntax : Exception; Exception_Channel : Exception; Exception_End_of_file : Exception; Exception_Buffer_Overflow : Exception; Exception_Bad_filing_system_name : Exception; Exception_Bad_key : Exception; Exception_Bad_address : Exception; Exception_Bad_string : Exception; Exception_Bad_command : Exception; Exception_Bad_mac_val : Exception; Exception_Bad_var_nam : Exception; Exception_Bad_var_type : Exception; Exception_Var_no_room : Exception; Exception_Var_cant_find : Exception; Exception_Var_too_long : Exception; Exception_Redirect_fail : Exception; Exception_Stack_full : Exception; Exception_Bad_hex : Exception; Exception_Bad_expr : Exception; Exception_Bad_bra : Exception; Exception_Stk_oflo : Exception; Exception_Miss_opn : Exception; Exception_Miss_opr : Exception; Exception_Bad_bits : Exception; Exception_Str_oflo : Exception; Exception_Bad_itm : Exception; Exception_Div_zero : Exception; Exception_Bad_base : Exception; Exception_Bad_numb : Exception; Exception_Numb_too_big : Exception; Exception_Bad_claim_num : Exception; Exception_Bad_release : Exception; Exception_Bad_dev_no : Exception; Exception_Bad_dev_vec_rel : Exception; Exception_Bad_env_number : Exception; Exception_Cant_cancel_quit : Exception; Exception_Ch_dynam_cao : Exception; Exception_Ch_dynam_not_all_moved : Exception; Exception_Apl_wspace_in_use : Exception; Exception_Ram_fs_unchangeable : Exception; Exception_Oscli_long_line : Exception; Exception_Oscli_too_hard : Exception; Exception_Rc_exc : Exception; Exception_Sys_heap_full : Exception; Exception_Buff_overflow : Exception; Exception_Bad_time : Exception; Exception_No_such_swi : Exception; Exception_Unimplemented : Exception; Exception_Out_of_range : Exception; Exception_No_oscli_specials : Exception; Exception_Bad_parameters : Exception; Exception_Arg_repeated : Exception; Exception_Bad_read_sys_info : Exception; Exception_Cdat_stack_overflow : Exception; Exception_Cdat_buffer_overflow : Exception; Exception_Cdat_bad_field : Exception; Exception_Cant_start_application : Exception; Exception_Unknown_Error : Exception; -- Toolbox errors Error_Window_Alloc_Failed : constant Error_Code_Type := 16#80a901#; Error_Window_Short_Buffer : constant Error_Code_Type := 16#80a902#; Error_Window_Bad_Version : constant Error_Code_Type := 16#80a903#; Error_Window_Invalid_Flags : constant Error_Code_Type := 16#80a904#; Error_Window_Tasks_Active : constant Error_Code_Type := 16#80a905#; Error_Window_No_Such_Task : constant Error_Code_Type := 16#80a911#; Error_Window_No_Such_Method : constant Error_Code_Type := 16#80a912#; Error_Window_No_Such_Misc_Op_Method : constant Error_Code_Type := 16#80a913#; Error_Window_Invalid_Component_Id : constant Error_Code_Type := 16#80a914#; Error_Window_Duplicate_Component_Id : constant Error_Code_Type := 16#80a915#; Error_Window_Invalid_Gadget_Type : constant Error_Code_Type := 16#80a920#; Error_Tool_Action_Out_of_Memory : constant Error_Code_Type := 16#80E920#; Error_Tool_Action_Cant_Create_Icon : constant Error_Code_Type := 16#80E921#; Error_Tool_Action_Cant_Create_Object : constant Error_Code_Type := 16#80E922#; Error_Prog_Info_Tasks_Active : constant Error_Code_Type := 16#80B400#; Error_Prog_Info_Alloc_Failed : constant Error_Code_Type := 16#80B401#; Error_Prog_Info_Short_Buffer : constant Error_Code_Type := 16#80B402#; Error_Prog_Info_No_Such_Task : constant Error_Code_Type := 16#80B411#; Error_Prog_Info_No_Such_Method : constant Error_Code_Type := 16#80B412#; Error_Prog_Info_No_Such_Misc_Op_Method : constant Error_Code_Type := 16#80B413#; Error_Print_DBox_Tasks_Active : constant Error_Code_Type := 16#80B300#; Error_Print_DBox_Alloc_Failed : constant Error_Code_Type := 16#80B301#; Error_Print_DBox_Short_Buffer : constant Error_Code_Type := 16#80B302#; Error_Print_DBox_No_Such_Task : constant Error_Code_Type := 16#80B311#; Error_Print_DBox_No_Such_Method : constant Error_Code_Type := 16#80B312#; Error_Print_DBox_No_Such_Misc_Op_Method : constant Error_Code_Type := 16#80B313#; Error_Menu_Tasks_Active : constant Error_Code_Type := 16#80AA00#; Error_Menu_Alloc_Failed : constant Error_Code_Type := 16#80AA01#; Error_Menu_Short_Buffer : constant Error_Code_Type := 16#80AA02#; Error_Menu_No_Such_Task : constant Error_Code_Type := 16#80AA11#; Error_Menu_No_Such_Method : constant Error_Code_Type := 16#80AA12#; Error_Menu_No_Such_Misc_op_method : constant Error_Code_Type := 16#80AA13#; Error_Menu_No_Such_Component : constant Error_Code_Type := 16#80AA14#; Error_Menu_Sprite_Not_Text : constant Error_Code_Type := 16#80AA21#; Error_Menu_Text_Not_Sprite : constant Error_Code_Type := 16#80AA22#; Error_Menu_No_Top_Menu : constant Error_Code_Type := 16#80AA31#; Error_Menu_Unknown_Sub_Menu : constant Error_Code_Type := 16#80AA32#; Error_Menu_No_Sprite_Name : constant Error_Code_Type := 16#80AA33#; Error_Iconbar_Alloc_Failed : constant Error_Code_Type := 16#80AB01#; Error_Iconbar_Short_Buffer : constant Error_Code_Type := 16#80AB02#; Error_Iconbar_Bad_Object_Version : constant Error_Code_Type := 16#80AB03#; Error_Iconbar_Bad_Flags : constant Error_Code_Type := 16#80AB04#; Error_Iconbar_No_Such_Task : constant Error_Code_Type := 16#80AB11#; Error_Iconbar_No_Such_Method : constant Error_Code_Type := 16#80AB12#; Error_Iconbar_No_Such_Misc_Op_Method : constant Error_Code_Type := 16#80AB13#; Error_Iconbar_Wrong_Show_Type : constant Error_Code_Type := 16#80AB14#; Error_Iconbar_No_Text : constant Error_Code_Type := 16#80AB20#; Error_Iconbar_Tasks_Active : constant Error_Code_Type := 16#80AB21#; Error_FontOrColour_Menu_Tasks_Active : constant Error_Code_Type := 16#80B000#; Error_FontOrColour_Menu_Alloc_Failed : constant Error_Code_Type := 16#80B001#; Error_FontOrColour_Menu_Short_Buffer : constant Error_Code_Type := 16#80B002#; Error_FontOrColour_Menu_No_Such_Task : constant Error_Code_Type := 16#80B011#; Error_FontOrColour_Menu_No_Such_Method : constant Error_Code_Type := 16#80B012#; Error_FontOrColour_Menu_No_Such_Misc_Op_Method : constant Error_Code_Type := 16#80B013#; Error_Font_DBox_Tasks_Active : constant Error_Code_Type := 16#80AF00#; Error_Font_DBox_Alloc_Failed : constant Error_Code_Type := 16#80AF01#; Error_Font_DBox_Short_Buffer : constant Error_Code_Type := 16#80AF02#; Error_Font_DBox_No_Such_Task : constant Error_Code_Type := 16#80AF11#; Error_Font_DBox_No_Such_Method : constant Error_Code_Type := 16#80AF12#; Error_Font_DBox_No_Such_Misc_Op_Method : constant Error_Code_Type := 16#80AF13#; Error_Font_DBox_No_Such_Font : constant Error_Code_Type := 16#80AF14#; Error_Font_DBox_No_Fonts : constant Error_Code_Type := 16#80AF21#; Error_Font_DBox_Out_Of_Message_Space : constant Error_Code_Type := 16#80AF31#; Error_File_Info_Tasks_Active : constant Error_Code_Type := 16#80B200#; Error_File_Info_Alloc_Failed : constant Error_Code_Type := 16#80B201#; Error_File_Info_Short_Buffer : constant Error_Code_Type := 16#80B202#; Error_File_Info_No_Such_Task : constant Error_Code_Type := 16#80B211#; Error_File_Info_No_Such_Method : constant Error_Code_Type := 16#80B212#; Error_File_Info_No_Such_Misc_Op_Method : constant Error_Code_Type := 16#80B213#; Error_DCS_Alloc_Failed : constant Error_Code_Type := 16#80B101#; Error_DCS_Tasks_Active : constant Error_Code_Type := 16#80B102#; Error_Toolbox_No_Mem : constant Error_Code_Type := 16#80CB00#; Error_Toolbox_Bad_SWI : constant Error_Code_Type := 16#80CB01#; Error_Toolbox_Invalid_object_Id : constant Error_Code_Type := 16#80CB02#; Error_Toolbox_Not_Atoolbox_Task : constant Error_Code_Type := 16#80CB03#; Error_Toolbox_No_Dir_Name : constant Error_Code_Type := 16#80CB04#; Error_Toolbox_No_Msgs_Fd : constant Error_Code_Type := 16#80CB05#; Error_Toolbox_No_Id_Block : constant Error_Code_Type := 16#80CB06#; Error_Toolbox_Bad_Res_File : constant Error_Code_Type := 16#80CB07#; Error_Toolbox_Tasks_Active : constant Error_Code_Type := 16#80CB08#; Error_Toolbox_Template_Not_Found : constant Error_Code_Type := 16#80CB09#; Error_Toolbox_No_Such_Pre_Filter : constant Error_Code_Type := 16#80CB0A#; Error_Toolbox_Not_Ares_File : constant Error_Code_Type := 16#80CB0B#; Error_Toolbox_Bad_Res_File_Version : constant Error_Code_Type := 16#80CB0C#; Error_Toolbox_Bad_Flags : constant Error_Code_Type := 16#80CB0D#; Exception_Toolbox_No_Mem : Exception; Exception_Toolbox_Bad_SWI : Exception; Exception_Toolbox_Invalid_object_Id : Exception; Exception_Toolbox_Not_Atoolbox_Task : Exception; Exception_Toolbox_No_Dir_Name : Exception; Exception_Toolbox_No_Msgs_Fd : Exception; Exception_Toolbox_No_Id_Block : Exception; Exception_Toolbox_Bad_Res_File : Exception; Exception_Toolbox_Tasks_Active : Exception; Exception_Toolbox_Template_Not_Found : Exception; Exception_Toolbox_No_Such_Pre_Filter : Exception; Exception_Toolbox_Not_Ares_File : Exception; Exception_Toolbox_Bad_Res_File_Version : Exception; Exception_Toolbox_Bad_Flags : Exception; Exception_DCS_Alloc_Failed : Exception; Exception_DCS_Tasks_Active : Exception; Exception_File_Info_Tasks_Active : Exception; Exception_File_Info_Alloc_Failed : Exception; Exception_File_Info_Short_Buffer : Exception; Exception_File_Info_No_Such_Task : Exception; Exception_File_Info_No_Such_Method : Exception; Exception_File_Info_No_Such_Misc_Op_Method : Exception; Exception_Font_DBox_Tasks_Active : Exception; Exception_Font_DBox_Alloc_Failed : Exception; Exception_Font_DBox_Short_Buffer : Exception; Exception_Font_DBox_No_Such_Task : Exception; Exception_Font_DBox_No_Such_Method : Exception; Exception_Font_DBox_No_Such_Misc_Op_Method : Exception; Exception_Font_DBox_No_Such_Font : Exception; Exception_Font_DBox_No_Fonts : Exception; Exception_Font_DBox_Out_Of_Message_Space : Exception; Exception_FontOrColour_Menu_Tasks_Active : Exception; Exception_FontOrColour_Menu_Alloc_Failed : Exception; Exception_FontOrColour_Menu_Short_Buffer : Exception; Exception_FontOrColour_Menu_No_Such_Task : Exception; Exception_FontOrColour_Menu_No_Such_Method : Exception; Exception_FontOrColour_Menu_No_Such_Misc_Op_Method : Exception; Exception_Iconbar_Alloc_Failed : Exception; Exception_Iconbar_Short_Buffer : Exception; Exception_Iconbar_Bad_Object_Version : Exception; Exception_Iconbar_Bad_Flags : Exception; Exception_Iconbar_No_Such_Task : Exception; Exception_Iconbar_No_Such_Method : Exception; Exception_Iconbar_No_Such_Misc_Op_Method : Exception; Exception_Iconbar_Wrong_Show_Type : Exception; Exception_Iconbar_No_Text : Exception; Exception_Iconbar_Tasks_Active : Exception; Exception_Menu_Tasks_Active : Exception; Exception_Menu_Alloc_Failed : Exception; Exception_Menu_Short_Buffer : Exception; Exception_Menu_No_Such_Task : Exception; Exception_Menu_No_Such_Method : Exception; Exception_Menu_No_Such_Misc_op_method : Exception; Exception_Menu_No_Such_Component : Exception; Exception_Menu_Sprite_Not_Text : Exception; Exception_Menu_Text_Not_Sprite : Exception; Exception_Menu_No_Top_Menu : Exception; Exception_Menu_Unknown_Sub_Menu : Exception; Exception_Menu_No_Sprite_Name : Exception; Exception_Print_DBox_Tasks_Active : Exception; Exception_Print_DBox_Alloc_Failed : Exception; Exception_Print_DBox_Short_Buffer : Exception; Exception_Print_DBox_No_Such_Task : Exception; Exception_Print_DBox_No_Such_Method : Exception; Exception_Print_DBox_No_Such_Misc_Op_Method : Exception; Exception_Prog_Info_Tasks_Active : Exception; Exception_Prog_Info_Alloc_Failed : Exception; Exception_Prog_Info_Short_Buffer : Exception; Exception_Prog_Info_No_Such_Task : Exception; Exception_Prog_Info_No_Such_Method : Exception; Exception_Prog_Info_No_Such_Misc_Op_Method : Exception; Exception_Tool_Action_Out_of_Memory : Exception; Exception_Tool_Action_Cant_Create_Icon : Exception; Exception_Tool_Action_Cant_Create_Object : Exception; Exception_Window_Alloc_Failed : Exception; Exception_Window_Short_Buffer : Exception; Exception_Window_Bad_Version : Exception; Exception_Window_Invalid_Flags : Exception; Exception_Window_Tasks_Active : Exception; Exception_Window_No_Such_Task : Exception; Exception_Window_No_Such_Method : Exception; Exception_Window_No_Such_Misc_Op_Method : Exception; Exception_Window_Invalid_Component_Id : Exception; Exception_Window_Duplicate_Component_Id : Exception; Exception_Window_Invalid_Gadget_Type : Exception; procedure Raise_Error (Error : OSError_Access); -- -- Block filled in by the toolbox on WimpPoll -- type ToolBox_Id_Block_Type is record Ancestor_Id : Object_ID; Ancestor_Component: Component_ID; Parent_Id : Object_ID; Parent_Component : Component_ID; Self_Id : Object_ID; Self_Component : Component_ID; end record; pragma Convention (C, ToolBox_Id_Block_Type); type ToolBox_Id_Block_Pointer is access ToolBox_Id_Block_Type; type Toolbox_EventListener (E : ToolBox_Event_Code_Type; O : Object_ID; C : Component_ID) is abstract new Event_Listener(Toolbox) with record Event_Code : ToolBox_Event_Code_Type := E; Object : Object_ID := O; Component : Component_ID := C; ID_Block : ToolBox_Id_Block_Pointer; end record; type Toolbox_UserEventListener (E : ToolBox_Event_Code_Type; O : Object_ID; C : Component_ID) is abstract new Toolbox_EventListener (E,O,C) with record Event : Event_Pointer; end record; type Toolbox_Event_Header is record Size : System.Unsigned_Types.Unsigned; Reference_Number : Integer; Event_Code : System.Unsigned_Types.Unsigned; Flags : System.Unsigned_Types.Unsigned; end record; pragma Convention (C, Toolbox_Event_Header); Wimp_Block_Size : constant integer := 63; type Wimp_Block_Type is array (0 .. Wimp_Block_Size) of integer; type Wimp_Block_Pointer is access Wimp_Block_Type; Number_Of_Messages : integer := 0; Max_Number_Of_Messages : constant integer := 63; type Messages_List_Type is array (0 .. Max_Number_Of_Messages) of integer; type Messages_List_Pointer is access Messages_List_Type; type System_Sprite_Pointer is new Address; type Messages_Control_Block_Type is array (1 .. 6) of System.Unsigned_Types.Unsigned; type Messages_Handle_Type is access Messages_Control_Block_Type; type Wimp_Colour is new integer range 0..15; type Toolbox_Colour is new integer range -1..16; type OS_Colour is new System.Unsigned_Types.Unsigned; end RASCAL.OS;
mat/src/frames/mat-frames.adb
stcarrez/mat
7
27278
----------------------------------------------------------------------- -- mat-frames - Representation of stack frames -- Copyright (C) 2014, 2015, 2021 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Unchecked_Deallocation; package body MAT.Frames is use type MAT.Types.Target_Addr; procedure Free is new Ada.Unchecked_Deallocation (Frame, Frame_Type); procedure Add_Frame (F : in Frame_Type; Pc : in Frame_Table; Result : out Frame_Type); -- ------------------------------ -- Return the parent frame. -- ------------------------------ function Parent (Frame : in Frame_Type) return Frame_Type is begin if Frame = null then return null; else return Frame.Parent; end if; end Parent; -- ------------------------------ -- Returns the backtrace of the current frame (up to the root). -- When <tt>Max_Level</tt> is positive, limit the number of PC frames to the value. -- ------------------------------ function Backtrace (Frame : in Frame_Type; Max_Level : in Natural := 0) return Frame_Table is Length : Natural; begin if Max_Level > 0 and Max_Level < Frame.Depth then Length := Max_Level; else Length := Frame.Depth; end if; declare Current : Frame_Type := Frame; Pos : Natural := Length; Pc : Frame_Table (1 .. Length); begin while Current /= null and Pos /= 0 loop Pc (Pos) := Current.Pc; Pos := Pos - 1; Current := Current.Parent; end loop; return Pc; end; end Backtrace; -- ------------------------------ -- Returns the number of children in the frame. -- When recursive is true, compute in the sub-tree. -- ------------------------------ function Count_Children (Frame : in Frame_Type; Recursive : in Boolean := False) return Natural is Count : Natural := 0; Child : Frame_Type; begin if Frame /= null then Child := Frame.Children; while Child /= null loop Count := Count + 1; if Recursive then declare N : Natural := Count_Children (Child, True); begin if N > 0 then N := N - 1; end if; Count := Count + N; end; end if; Child := Child.Next; end loop; end if; return Count; end Count_Children; -- ------------------------------ -- Returns all the direct calls made by the current frame. -- ------------------------------ function Calls (Frame : in Frame_Type) return Frame_Table is Nb_Calls : constant Natural := Count_Children (Frame); Pc : Frame_Table (1 .. Nb_Calls); begin if Frame /= null then declare Child : Frame_Type := Frame.Children; Pos : Natural := 1; begin while Child /= null loop Pc (Pos) := Child.Pc; Pos := Pos + 1; Child := Child.Next; end loop; end; end if; return Pc; end Calls; -- ------------------------------ -- Returns the current stack depth (# of calls from the root -- to reach the frame). -- ------------------------------ function Current_Depth (Frame : in Frame_Type) return Natural is begin if Frame = null then return 0; else return Frame.Depth; end if; end Current_Depth; -- ------------------------------ -- Create a root for stack frame representation. -- ------------------------------ function Create_Root return Frame_Type is begin return new Frame '(Parent => null, Depth => 0, Pc => 0, others => <>); end Create_Root; -- ------------------------------ -- Destroy the frame tree recursively. -- ------------------------------ procedure Destroy (Frame : in out Frame_Type) is F : Frame_Type; begin if Frame = null then return; end if; -- Destroy its children recursively. while Frame.Children /= null loop F := Frame.Children; Frame.Children := F.Next; Destroy (F); end loop; Free (Frame); end Destroy; procedure Add_Frame (F : in Frame_Type; Pc : in Frame_Table; Result : out Frame_Type) is Child : Frame_Type := F.Children; Parent : Frame_Type := F; Pos : Positive := Pc'First; Current_Depth : Natural := F.Depth; begin while Pos <= Pc'Last loop Current_Depth := Current_Depth + 1; Child := new Frame '(Parent => Parent, Next => Child, Children => null, Used => 1, Depth => Current_Depth, Pc => Pc (Pos)); Pos := Pos + 1; Parent.Children := Child; Parent := Child; Child := null; end loop; Result := Parent; end Add_Frame; -- ------------------------------ -- Insert in the frame tree the new stack frame represented by <tt>Pc</tt>. -- If the frame is already known, the frame reference counter is incremented. -- The frame represented by <tt>Pc</tt> is returned in <tt>Result</tt>. -- ------------------------------ procedure Insert (Frame : in Frame_Type; Pc : in Frame_Table; Result : out Frame_Type) is Parent : Frame_Type := Frame; Current : Frame_Type := Frame.Children; Pos : Positive := Pc'First; Addr : MAT.Types.Target_Addr; begin if Pc'Length = 0 then Result := Frame; Frame.Used := Frame.Used + 1; return; end if; if Current = null then Frame.Used := Frame.Used + 1; Add_Frame (Frame, Pc, Result); return; end if; Addr := Pc (Pos); loop if Addr = Current.Pc then Parent.Used := Parent.Used + 1; Pos := Pos + 1; if Pos > Pc'Last then Current.Used := Current.Used + 1; Result := Current; return; end if; if Current.Children = null then Current.Used := Current.Used + 1; Add_Frame (Current, Pc (Pos .. Pc'Last), Result); return; end if; Parent := Current; Current := Current.Children; Addr := Pc (Pos); elsif Current.Next = null then Parent.Used := Parent.Used + 1; Add_Frame (Parent, Pc (Pos .. Pc'Last), Result); return; else Current := Current.Next; end if; end loop; end Insert; -- ------------------------------ -- Find the child frame which has the given PC address. -- Returns that frame pointer or raises the Not_Found exception. -- ------------------------------ function Find (Frame : in Frame_Type; Pc : in MAT.Types.Target_Addr) return Frame_Type is Child : Frame_Type := Frame.Children; begin while Child /= null loop if Child.Pc = Pc then return Child; end if; Child := Child.Next; end loop; raise Not_Found; end Find; -- ------------------------------ -- Find the child frame which has the given PC address. -- Returns that frame pointer or raises the Not_Found exception. -- ------------------------------ -- function Find (Frame : in Frame_Type; -- Pc : in Frame_Table) return Frame_Type is -- Child : Frame_Type := Frame; -- Pos : Positive := Pc'First; -- begin -- while Pos <= Pc'Last loop -- Child := Find (Child, Pc (Pos)); -- Pos := Pos + 1; -- -- All the PC of the child frame must match. -- while Pos <= Pc'Last and Lpos <= Child.Local_Depth loop -- if Child.Calls (Lpos) /= Pc (Pos) then -- raise Not_Found; -- end if; -- Lpos := Lpos + 1; -- Pos := Pos + 1; -- end loop; -- end loop; -- return Child; -- end Find; -- ------------------------------ -- Find the child frame which has the given PC address. -- Returns that frame pointer or raises the Not_Found exception. -- -- ------------------------------ -- procedure Find (Frame : in Frame_Type; -- Pc : in Frame_Table; -- Result : out Frame_Type; -- Last_Pc : out Natural) is -- Current : Frame_Type := Frame; -- Pos : Positive := Pc'First; -- Lpos : Positive; -- begin -- Main_Search : -- while Pos <= Pc'Last loop -- declare -- Addr : constant MAT.Types.Target_Addr := Pc (Pos); -- Child : Frame_Type := Current.Children; -- begin -- -- Find the child which has the corresponding PC. -- loop -- exit Main_Search when Child = null; -- exit when Child.Pc = Addr; -- Child := Child.Next; -- end loop; -- -- Current := Child; -- Pos := Pos + 1; -- Lpos := 2; -- -- All the PC of the child frame must match. -- while Pos <= Pc'Last and Lpos <= Current.Local_Depth loop -- exit Main_Search when Current.Calls (Lpos) /= Pc (Pos); -- Lpos := Lpos + 1; -- Pos := Pos + 1; -- end loop; -- end; -- end loop Main_Search; -- Result := Current; -- if Pos > Pc'Last then -- Last_Pc := 0; -- else -- Last_Pc := Pos; -- end if; -- end Find; -- ------------------------------ -- Check whether the frame contains a call to the function described by the address range. -- ------------------------------ function In_Function (Frame : in Frame_Type; From : in MAT.Types.Target_Addr; To : in MAT.Types.Target_Addr) return Boolean is Current : Frame_Type := Frame; begin while Current /= null loop if Current.Pc >= From and Current.Pc <= To then return True; end if; Current := Current.Parent; end loop; return False; end In_Function; -- ------------------------------ -- Check whether the inner most frame contains a call to the function described by -- the address range. This function looks only at the inner most frame and not the -- whole stack frame. -- ------------------------------ function By_Function (Frame : in Frame_Type; From : in MAT.Types.Target_Addr; To : in MAT.Types.Target_Addr) return Boolean is begin return Frame /= null and then Frame.Pc >= From and then Frame.Pc <= To; end By_Function; end MAT.Frames;
code_sender/chrome/chrome-jupyter.applescript
fredcallaway/SendCode
177
4416
<gh_stars>100-1000 on run argv tell application "Google Chrome" set URL of front window's active tab to "javascript:{" & " var mycell = IPython.notebook.get_selected_cell(); mycell.set_text(\"" & item 1 of argv & "\"); mycell.execute(); var nextcell = IPython.notebook.insert_cell_below(); IPython.notebook.select_next(); IPython.notebook.scroll_to_cell(IPython.notebook.find_cell_index(nextcell)); " & "}" end tell end run
src/nso-json.ads
SSOCsoft/Log_Reporter
0
28211
Pragma Ada_2012; With Interfaces, Ada.Streams, Ada.Wide_Wide_Characters.Unicode, Ada.Containers.Indefinite_Holders, Ada.Containers.Indefinite_Ordered_Maps, Ada.Containers.Indefinite_Vectors; Package NSO.JSON with Elaborate_Body is Type Value_Kind is ( VK_Object, VK_Array, VK_String, VK_Number, VK_True, VK_False, VK_Null ); Type Instance(<>) is tagged; Function "**"(Left : Instance'Class; Right : String ) return String; Function "**"(Left : Instance'Class; Right : Natural) return Instance'Class; procedure JSON_Class_Output( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : in Instance'Class); function JSON_Class_Input( Stream : not null access Ada.Streams.Root_Stream_Type'Class) return Instance'Class; For Instance'Class'Input use JSON_Class_Input; For Instance'Class'Output use JSON_Class_Output; Type Instance(Value_Type: Value_Kind) is abstract tagged null record; -- with -- Class'Input => JSON_Class_Input, Class'Output => JSON_Class_Output; Function To_String( Object : Instance'Class ) return String; Function "-" ( Object : Instance ) return String is Abstract; Function Kind( Object : Instance'Class ) return Value_Kind; Function Kind( Object : Instance ) return Value_Kind is abstract; Package Value_Array is new Ada.Containers.Indefinite_Vectors (Natural, Instance'Class); Package Name_Value_Pairs is new Ada.Containers.Indefinite_Ordered_Maps( -- "<" => , -- "=" => , Key_Type => String, Element_Type => Instance'Class ); ------------ -- NULL -- ------------ Type Null_Object is new Instance( Value_Type => VK_Null ) with private; ------------- -- FALSE -- ------------- Type False_Object is new Instance( Value_Type => VK_False ) with private; Function Value( Object : False_Object ) return Boolean; ------------ -- TRUE -- ------------ Type True_Object is new Instance( Value_Type => VK_True ) with private; Function Value( Object : True_Object ) return Boolean; -------------- -- STRING -- -------------- Type String_Object is new Instance( Value_Type => VK_String ) with private; -- Function Value( ) -------------- -- NUMBER -- -------------- Subtype Number is Interfaces.IEEE_Float_64 range Interfaces.IEEE_Float_64'Range; Type Number_Object is new Instance( Value_Type => VK_Number ) with private; Function Value( Object : Number_Object ) return Number; ------------- -- ARRAY -- ------------- Type Array_Object is new Instance( Value_Type => VK_Array ) with private with Constant_Indexing => Array_Constant; Procedure Append ( Object : in out Array_Object; Value : Instance'Class ); Procedure Prepend( Object : in out Array_Object; Value : Instance'Class ); Function Array_Constant(Object : in Array_Object; Key : in Natural ) return Instance'Class; -------------- -- OBJECT -- -------------- Type Object_Object is new Instance( Value_Type => VK_Object ) with private with Constant_Indexing => Constant_Reference; Function Value(Object : in Object_Object; Name : String ) return Instance'Class; Procedure Value(Object : in out Object_Object; Name : String; Value : Boolean ); Procedure Value(Object : in out Object_Object; Name : String; Value : Integer ); Procedure Value(Object : in out Object_Object; Name : String; Value : Float ); Procedure Value(Object : in out Object_Object; Name : String; Value : String ); Procedure Value(Object : in out Object_Object; Name : String; Value : Number ); Procedure Value(Object : in out Object_Object; Name : String; Value : Instance'Class ); Function Exists(Object : in out Object_Object; Name : String) return Boolean; Function Constant_Reference(Object : in Object_Object; Key : in String ) return String; -- Adds the Right object to the Left, merging the two. Procedure Include(Left : in out Object_Object; Right : in Object_Object ); -- Associates a JSON Instance with the given name. Procedure Include(Object : in out Object_Object; Name : String; Value : Instance'Class ); ---------- -- Make -- ---------- Function Make return Instance'Class; Function Make ( Item : String ) return Instance'Class; Function Make ( Item : Number ) return Instance'Class; Function Make ( Item : Boolean ) return Instance'Class; -- Make_Array is *NOT* overloaded because the defaults would make calls -- anbiguous, considering the NULL object's parameterless constructor. Function Make_Array( Length : Natural:= 0; Default : Number := 0.0 ) return Instance'Class; -- Because there are no sensible method for populating a dictionary via -- parameter-calls, making an Object likewise cannot overload with make. Function Make_Object return Instance'Class; -- Apply is intended to help in the processing of a JSON-classed object. Generic with Procedure On_Null is null; with Procedure On_Boolean( Value : in Boolean ) is null; with Procedure On_String ( Value : in String ) is null; with Procedure On_Number ( Value : in Number ) is null; with procedure On_Array ( Index : Natural; Value : in Instance'Class ) is null; with procedure On_Object ( Key : String; Value : in Instance'Class ) is null; Procedure Apply( Object : in Instance'Class ); Bad_Index, Parse_Error : Exception; Private package String_Holder is new Ada.Containers.Indefinite_Holders( Element_Type => String ); ---------------------------------- -- STRING CONVERSION OPERATOR -- ---------------------------------- Overriding Function "-"(Object : Null_Object) return String; Overriding Function "-"(Object : True_Object) return String; Overriding Function "-"(Object : False_Object) return String; Overriding Function "-"(Object : String_Object) return String; Overriding Function "-"(Object : Number_Object) return String; Overriding Function "-"(Object : Array_Object) return String; Overriding Function "-"(Object : Object_Object) return String; Function To_String(Object : Instance'Class) return String is ( -Object ); ----------------------- -- OBJECT INDEXING -- ----------------------- -- Function Constant_Reference(Object : in Object_Object; -- Key : in String -- ) return String; -- Constant_Reference ------------------ -- FULL VIEWS -- ------------------ Type Null_Object is new Instance( Value_Type => VK_Null ) with null Record; Type False_Object is new Instance( Value_Type => VK_False ) with null record; Type True_Object is new Instance( Value_Type => VK_True ) with null record; Type String_Object is new Instance( Value_Type => VK_String ) with record Element : String_Holder.Holder; end record; Type Number_Object is new Instance( Value_Type => VK_Number ) with record Element : Number; end record; Type Array_Object is new Instance( Value_Type => VK_Array ) with record Element : Value_Array.Vector; end record; Type Object_Object is new Instance( Value_Type => VK_Object ) with Record Element : Name_Value_Pairs.Map; end record; -- with Constant_Indexing => Element.Constant_Reference; -- Variable_Indexing => Element.Reference; --------------- -- K I N D -- --------------- Function Kind( Object : Instance'Class ) return Value_Kind is (Object.Value_Type); Overriding Function Kind(Object : Null_Object) return Value_Kind; Overriding Function Kind(Object : False_Object) return Value_Kind; Overriding Function Kind(Object : True_Object) return Value_Kind; Overriding Function Kind(Object : String_Object) return Value_Kind; Overriding Function Kind(Object : Number_Object) return Value_Kind; Overriding Function Kind(Object : Array_Object) return Value_Kind; Overriding Function Kind(Object : Object_Object) return Value_Kind; -------------------------------- -- Additional support types -- -------------------------------- Type Nullable_Character is Access All Character; Subtype Reference_Character is Not Null Nullable_Character; End NSO.JSON;
programs/oeis/017/A017775.asm
neoneye/loda
22
23339
; A017775: Binomial coefficients C(59,n). ; 1,59,1711,32509,455126,5006386,45057474,341149446,2217471399,12565671261,62828356305,279871768995,1119487075980,4047376351620,13298522298180,39895566894540,109712808959985,277508869722315,647520696018735,1397281501935165,2794563003870330,5189902721473470,8964377427999630,14420954992868970,21631432489303455,30284005485024837,39602161018878633,48402641245296107,55317304280338408,59132290782430712,59132290782430712,55317304280338408,48402641245296107,39602161018878633,30284005485024837,21631432489303455,14420954992868970,8964377427999630,5189902721473470,2794563003870330,1397281501935165,647520696018735,277508869722315,109712808959985,39895566894540,13298522298180,4047376351620,1119487075980,279871768995,62828356305,12565671261,2217471399,341149446,45057474,5006386,455126,32509,1711,59,1 mov $1,59 bin $1,$0 mov $0,$1
_build/dispatcher/jmp_ippsDLPGet_121a7a38.asm
zyktrcn/ippcp
1
163255
<filename>_build/dispatcher/jmp_ippsDLPGet_121a7a38.asm extern m7_ippsDLPGet:function extern n8_ippsDLPGet:function extern y8_ippsDLPGet:function extern e9_ippsDLPGet:function extern l9_ippsDLPGet:function extern n0_ippsDLPGet:function extern k0_ippsDLPGet:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsDLPGet .Larraddr_ippsDLPGet: dq m7_ippsDLPGet dq n8_ippsDLPGet dq y8_ippsDLPGet dq e9_ippsDLPGet dq l9_ippsDLPGet dq n0_ippsDLPGet dq k0_ippsDLPGet segment .text global ippsDLPGet:function (ippsDLPGet.LEndippsDLPGet - ippsDLPGet) .Lin_ippsDLPGet: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsDLPGet: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsDLPGet] mov r11, qword [r11+rax*8] jmp r11 .LEndippsDLPGet:
oeis/171/A171478.asm
neoneye/loda-programs
11
169216
<filename>oeis/171/A171478.asm ; A171478: a(n) = 6*a(n-1) - 8*a(n-2) + 2 for n > 1; a(0) = 1, a(1) = 8. ; Submitted by <NAME>(s3) ; 1,8,42,190,806,3318,13462,54230,217686,872278,3492182,13974870,55911766,223671638,894735702,3579041110,14316361046,57265837398,229064136022,916258116950,3665035613526,14660148745558,58640607565142,234562455426390,938249872037206,3752999588812118,15011998556575062,60047994628953430,240191979321120086,960767918895093078,3843071678801597782,15372286721648842070,61489146899480270166,245956587623690884438,983826350546303145302,3935305402288291796310,15741221609359325615446,62964886437849619322198 add $0,1 mov $2,1 lpb $0 sub $0,1 mul $1,2 add $1,$2 mul $2,4 add $2,2 lpe mov $0,$1
programs/oeis/123/A123128.asm
neoneye/loda
22
15113
<filename>programs/oeis/123/A123128.asm ; A123128: Add n to the n-th difference between consecutive primes. ; 2,4,5,8,7,10,9,12,15,12,17,16,15,18,21,22,19,24,23,22,27,26,29,32,29,28,31,30,33,44,35,38,35,44,37,42,43,42,45,46,43,52,45,48,47,58,59,52,51,54,57,54,63,60,61,62,59,64,63,62,71,76,67,66,69,80,73,78,71,74,77,80,79,80,79,82,85,82,87,90,83,92,85,90,89,92,95,92,91,94,103,100,97,102,99,102,109,100,117,106 mov $1,$0 seq $1,46933 ; Number of composites between successive primes. add $0,$1 add $0,2
programs/oeis/117/A117717.asm
jmorken/loda
1
89474
<gh_stars>1-10 ; A117717: Maximal number of regions obtained by a straight line drawing of the complete bipartite graph K_{n,n}. ; 0,2,13,45,116,250,477,833,1360,2106,3125,4477,6228,8450,11221,14625,18752,23698,29565,36461,44500,53802,64493,76705,90576,106250,123877,143613,165620,190066,217125,246977,279808,315810,355181,398125,444852,495578,550525,609921,674000,743002,817173,896765,982036,1073250,1170677,1274593,1385280,1503026,1628125,1760877,1901588,2050570,2208141,2374625,2550352,2735658,2930885,3136381,3352500,3579602,3818053,4068225,4330496,4605250,4892877,5193773,5508340,5836986,6180125,6538177,6911568,7300730,7706101,8128125,8567252,9023938,9498645,9991841,10504000,11035602,11587133,12159085,12751956,13366250,14002477,14661153,15342800,16047946,16777125,17530877,18309748,19114290,19945061,20802625,21687552,22600418,23541805,24512301,25512500,26543002,27604413,28697345,29822416,30980250,32171477,33396733,34656660,35951906,37283125,38650977,40056128,41499250,42981021,44502125,46063252,47665098,49308365,50993761,52722000,54493802,56309893,58171005,60077876,62031250,64031877,66080513,68177920,70324866,72522125,74770477,77070708,79423610,81829981,84290625,86806352,89377978,92006325,94692221,97436500,100240002,103103573,106028065,109014336,112063250,115175677,118352493,121594580,124902826,128278125,131721377,135233488,138815370,142467941,146192125,149988852,153859058,157803685,161823681,165920000,170093602,174345453,178676525,183087796,187580250,192154877,196812673,201554640,206381786,211295125,216295677,221384468,226562530,231830901,237190625,242642752,248188338,253828445,259564141,265396500,271326602,277355533,283484385,289714256,296046250,302481477,309021053,315666100,322417746,329277125,336245377,343323648,350513090,357814861,365230125,372760052,380405818,388168605,396049601,404050000,412171002,420413813,428779645,437269716,445885250,454627477,463497633,472496960,481626706,490888125,500282477,509811028,519475050,529275821,539214625,549292752,559511498,569872165,580376061,591024500,601818802,612760293,623850305,635090176,646481250,658024877,669722413,681575220,693584666,705752125,718078977,730566608,743216410,756029781,769008125,782152852,795465378,808947125,822599521,836424000,850422002,864594973,878944365,893471636,908178250,923065677,938135393,953388880,968827626 lpb $0 add $3,$0 add $3,$0 sub $0,1 add $2,$3 add $1,$2 sub $2,$0 lpe
programs/oeis/036/A036799.asm
neoneye/loda
22
88180
<gh_stars>10-100 ; A036799: a(n) = 2 + 2^(n+1)*(n-1). ; 0,2,10,34,98,258,642,1538,3586,8194,18434,40962,90114,196610,425986,917506,1966082,4194306,8912898,18874370,39845890,83886082,176160770,369098754,771751938,1610612738,3355443202,6979321858,14495514626,30064771074,62277025794,128849018882,266287972354,549755813890,1133871366146,2336462209026,4810363371522,9895604649986,20340965113858,41781441855490,85761906966530,175921860444162,360639813910530,738871813865474,1512927999819778,3096224743817218,6333186975989762,12947848928690178,26458647810801666,54043195528445954,110338190870577154,225179981368524802,459367161991790594,936748722493063170,1909526242005090306,3891110078048108546,7926335344172072962,16140901064495857666,32858262881295138818,66869447267197124610,136044737543607943170,276701161105643274242,562625694248141324290,1143698132569992200194,2324289753287403503618,4722366482869645213698,9592306918328966840322,19479761741837286506498,39549819294033278664706,80280230208783968632834,162921643659002759872514,330565653800875164958722,670576040567489620344834,1360041547066457821544450,2757862025995872804798466,5591281915717659933016066,11333679558887148512870402,22969590572677954319417346,46543644055163223226187778,94296213929941075627081730,191010279499111409603575810,386856262276681335905976322,783383931110279705209602050,1586110675334393477214502914,3210906976896455088019603458,6499185206248246443220402178,13153112917407165420803194882,26615710844635675910331170818,53850391708914041958111903746,108938723457113464191122931714,220353326992797688932044111874,445658414142736898963684720642,901220348599756840126562435074,1822247737828079764651510857730,3684109556913291698099793690626,7447447276340847733793131331586,15053350877710224142773350563842,30423614405477505635920876929026,61481054111069125972590105460738,124229758822366481346676914126850 mov $1,$0 sub $0,1 mov $2,2 pow $2,$1 mul $0,$2 add $0,1 mul $0,2
programs/oeis/049/A049806.asm
jmorken/loda
1
95080
<filename>programs/oeis/049/A049806.asm ; A049806: Number of Farey fractions of order n that are <=1/2; cf. A049805. ; 1,2,3,4,6,7,10,12,15,17,22,24,30,33,37,41,49,52,61,65,71,76,87,91,101,107,116,122,136,140,155,163,173,181,193,199,217,226,238,246,266,272,293,303,315,326,349,357,378,388,404,416,442 mov $3,$0 add $3,1 mov $4,$0 lpb $3 mov $0,$4 sub $3,1 sub $0,$3 cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n. sub $0,1 mov $2,$0 div $2,2 add $2,1 add $1,$2 lpe
target/cos_117/disasm/iop_overlay1/STATION.asm
jrrk2/cray-sim
49
13023
<filename>target/cos_117/disasm/iop_overlay1/STATION.asm 0x0000 (0x000000) 0x2118- f:00020 d: 280 | A = OR[280] 0x0001 (0x000002) 0x8602- f:00103 d: 2 | P = P + 2 (0x0003), A # 0 0x0002 (0x000004) 0x7009- f:00070 d: 9 | P = P + 9 (0x000B) 0x0003 (0x000006) 0x2118- f:00020 d: 280 | A = OR[280] 0x0004 (0x000008) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0005 (0x00000A) 0x1630- f:00013 d: 48 | A = A - 48 (0x0030) 0x0006 (0x00000C) 0x2900- f:00024 d: 256 | OR[256] = A 0x0007 (0x00000E) 0x2100- f:00020 d: 256 | A = OR[256] 0x0008 (0x000010) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004) 0x0009 (0x000012) 0x821C- f:00101 d: 28 | P = P + 28 (0x0025), C = 1 0x000A (0x000014) 0x700C- f:00070 d: 12 | P = P + 12 (0x0016) 0x000B (0x000016) 0x1027- f:00010 d: 39 | A = 39 (0x0027) 0x000C (0x000018) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020) 0x000D (0x00001A) 0x1A00-0xFFFF f:00015 d: 0 | A = A & 65535 (0xFFFF) 0x000F (0x00001E) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x0010 (0x000020) 0x2908- f:00024 d: 264 | OR[264] = A 0x0011 (0x000022) 0x2100- f:00020 d: 256 | A = OR[256] 0x0012 (0x000024) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x0013 (0x000026) 0x8603- f:00103 d: 3 | P = P + 3 (0x0016), A # 0 0x0014 (0x000028) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0015 (0x00002A) 0x2900- f:00024 d: 256 | OR[256] = A 0x0016 (0x00002C) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x0017 (0x00002E) 0x2919- f:00024 d: 281 | OR[281] = A 0x0018 (0x000030) 0x1800-0x0166 f:00014 d: 0 | A = 358 (0x0166) 0x001A (0x000034) 0x291A- f:00024 d: 282 | OR[282] = A 0x001B (0x000036) 0x1800-0x0000 f:00014 d: 0 | A = 0 (0x0000) 0x001D (0x00003A) 0x291B- f:00024 d: 283 | OR[283] = A 0x001E (0x00003C) 0x2100- f:00020 d: 256 | A = OR[256] 0x001F (0x00003E) 0x291C- f:00024 d: 284 | OR[284] = A 0x0020 (0x000040) 0x1119- f:00010 d: 281 | A = 281 (0x0119) 0x0021 (0x000042) 0x5800- f:00054 d: 0 | B = A 0x0022 (0x000044) 0x1800-0x0318 f:00014 d: 0 | A = 792 (0x0318) 0x0024 (0x000048) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0025 (0x00004A) 0x102A- f:00010 d: 42 | A = 42 (0x002A) 0x0026 (0x00004C) 0x2919- f:00024 d: 281 | OR[281] = A 0x0027 (0x00004E) 0x1119- f:00010 d: 281 | A = 281 (0x0119) 0x0028 (0x000050) 0x5800- f:00054 d: 0 | B = A 0x0029 (0x000052) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x002A (0x000054) 0x7C09- f:00076 d: 9 | R = OR[9] 0x002B (0x000056) 0x0000- f:00000 d: 0 | PASS 0x002C (0x000058) 0x0000- f:00000 d: 0 | PASS 0x002D (0x00005A) 0x0000- f:00000 d: 0 | PASS 0x002E (0x00005C) 0x0000- f:00000 d: 0 | PASS 0x002F (0x00005E) 0x0000- f:00000 d: 0 | PASS
src/Prelude/Ord.agda
lclem/agda-prelude
0
3179
module Prelude.Ord where open import Agda.Primitive open import Prelude.Equality open import Prelude.Decidable open import Prelude.Bool open import Prelude.Function open import Prelude.Empty data Comparison {a} {A : Set a} (_<_ : A → A → Set a) (x y : A) : Set a where less : (lt : x < y) → Comparison _<_ x y equal : (eq : x ≡ y) → Comparison _<_ x y greater : (gt : y < x) → Comparison _<_ x y isLess : ∀ {a} {A : Set a} {R : A → A → Set a} {x y} → Comparison R x y → Bool isLess (less _) = true isLess (equal _) = false isLess (greater _) = false {-# INLINE isLess #-} isGreater : ∀ {a} {A : Set a} {R : A → A → Set a} {x y} → Comparison R x y → Bool isGreater (less _) = false isGreater (equal _) = false isGreater (greater _) = true {-# INLINE isGreater #-} data LessEq {a} {A : Set a} (_<_ : A → A → Set a) (x y : A) : Set a where instance less : x < y → LessEq _<_ x y equal : x ≡ y → LessEq _<_ x y record Ord {a} (A : Set a) : Set (lsuc a) where infix 4 _<_ _≤_ field _<_ : A → A → Set a _≤_ : A → A → Set a compare : ∀ x y → Comparison _<_ x y eq-to-leq : ∀ {x y} → x ≡ y → x ≤ y lt-to-leq : ∀ {x y} → x < y → x ≤ y leq-to-lteq : ∀ {x y} → x ≤ y → LessEq _<_ x y open Ord {{...}} public {-# DISPLAY Ord._<_ _ a b = a < b #-} {-# DISPLAY Ord._≤_ _ a b = a ≤ b #-} {-# DISPLAY Ord.compare _ a b = compare a b #-} {-# DISPLAY Ord.eq-to-leq _ eq = eq-to-leq eq #-} {-# DISPLAY Ord.lt-to-leq _ eq = lt-to-leq eq #-} {-# DISPLAY Ord.leq-to-lteq _ eq = leq-to-lteq eq #-} module _ {a} {A : Set a} {{_ : Ord A}} where _>_ : A → A → Set a a > b = b < a _≥_ : A → A → Set a a ≥ b = b ≤ a infix 4 _>_ _≥_ _<?_ _≤?_ _>?_ _≥?_ _<?_ : A → A → Bool x <? y = isLess (compare x y) _>?_ : A → A → Bool _>?_ = flip _<?_ _≤?_ : A → A → Bool x ≤? y = not (y <? x) _≥?_ : A → A → Bool x ≥? y = not (x <? y) min : A → A → A min x y = if x <? y then x else y max : A → A → A max x y = if x >? y then x else y {-# INLINE _>?_ #-} {-# INLINE _<?_ #-} {-# INLINE _≤?_ #-} {-# INLINE _≥?_ #-} {-# INLINE min #-} {-# INLINE max #-} --- Instances --- -- Default implementation of _≤_ -- defaultOrd : ∀ {a} {A : Set a} {_<_ : A → A → Set a} → (∀ x y → Comparison _<_ x y) → Ord A Ord._<_ (defaultOrd compare) = _ Ord._≤_ (defaultOrd {_<_ = _<_} compare) = LessEq _<_ Ord.compare (defaultOrd compare) = compare Ord.eq-to-leq (defaultOrd compare) = equal Ord.lt-to-leq (defaultOrd compare) = less Ord.leq-to-lteq (defaultOrd compare) = id -- Generic instance by injection -- module _ {a b} {A : Set a} {B : Set b} {S : A → A → Set a} {T : B → B → Set b} where mapComparison : {f : A → B} → (∀ {x y} → S x y → T (f x) (f y)) → ∀ {x y} → Comparison S x y → Comparison T (f x) (f y) mapComparison f (less lt) = less (f lt) mapComparison f (equal refl) = equal refl mapComparison f (greater gt) = greater (f gt) injectComparison : {f : B → A} → (∀ {x y} → f x ≡ f y → x ≡ y) → (∀ {x y} → S (f x) (f y) → T x y) → ∀ {x y} → Comparison S (f x) (f y) → Comparison T x y injectComparison _ g (less p) = less (g p) injectComparison inj g (equal p) = equal (inj p) injectComparison _ g (greater p) = greater (g p) flipComparison : ∀ {a} {A : Set a} {S : A → A → Set a} {x y} → Comparison S x y → Comparison (flip S) x y flipComparison (less lt) = greater lt flipComparison (equal eq) = equal eq flipComparison (greater gt) = less gt OrdBy : ∀ {a} {A B : Set a} {{OrdA : Ord A}} {f : B → A} → (∀ {x y} → f x ≡ f y → x ≡ y) → Ord B OrdBy {f = f} inj = defaultOrd λ x y → injectComparison inj id (compare (f x) (f y)) {-# INLINE OrdBy #-} {-# INLINE defaultOrd #-} {-# INLINE injectComparison #-} -- Bool -- data LessBool : Bool → Bool → Set where false<true : LessBool false true private compareBool : ∀ x y → Comparison LessBool x y compareBool false false = equal refl compareBool false true = less false<true compareBool true false = greater false<true compareBool true true = equal refl instance OrdBool : Ord Bool OrdBool = defaultOrd compareBool --- Ord with proofs --- record Ord/Laws {a} (A : Set a) : Set (lsuc a) where field overlap {{super}} : Ord A less-antirefl : {x : A} → x < x → ⊥ less-trans : {x y z : A} → x < y → y < z → x < z open Ord/Laws {{...}} public hiding (super) module _ {a} {A : Set a} {{OrdA : Ord/Laws A}} where less-antisym : {x y : A} → x < y → y < x → ⊥ less-antisym lt lt₁ = less-antirefl {A = A} (less-trans {A = A} lt lt₁) leq-antisym : {x y : A} → x ≤ y → y ≤ x → x ≡ y leq-antisym x≤y y≤x with leq-to-lteq {A = A} x≤y | leq-to-lteq {A = A} y≤x ... | _ | equal refl = refl ... | less x<y | less y<x = ⊥-elim (less-antisym x<y y<x) ... | equal refl | less _ = refl leq-trans : {x y z : A} → x ≤ y → y ≤ z → x ≤ z leq-trans x≤y y≤z with leq-to-lteq {A = A} x≤y | leq-to-lteq {A = A} y≤z ... | equal refl | _ = y≤z ... | _ | equal refl = x≤y ... | less x<y | less y<z = lt-to-leq {A = A} (less-trans {A = A} x<y y<z) leq-less-antisym : {x y : A} → x ≤ y → y < x → ⊥ leq-less-antisym {x = x} {y} x≤y y<x = case leq-antisym x≤y (lt-to-leq {A = A} y<x) of λ where refl → less-antirefl {A = A} y<x OrdLawsBy : ∀ {a} {A B : Set a} {{OrdA : Ord/Laws A}} {f : B → A} → (∀ {x y} → f x ≡ f y → x ≡ y) → Ord/Laws B Ord/Laws.super (OrdLawsBy inj) = OrdBy inj less-antirefl {{OrdLawsBy {A = A} _}} = less-antirefl {A = A} less-trans {{OrdLawsBy {A = A} _}} = less-trans {A = A} instance OrdLawsBool : Ord/Laws Bool Ord/Laws.super OrdLawsBool = it less-antirefl {{OrdLawsBool}} () less-trans {{OrdLawsBool}} false<true ()
test/Succeed/Issue5611.agda
KDr2/agda
0
14839
<gh_stars>0 {-# OPTIONS --without-K --safe #-} data D : Set where c : D → D variable x y : D data P : D → D → Set where c : P (c x) (c y) record Q (y : D) : Set where G : .(Q y) → P x y → Set₁ G _ c = Set
alloy4fun_models/trashltl/models/10/ZWo3CMoJv6e6GEyK3.als
Kaixi26/org.alloytools.alloy
0
1216
open main pred idZWo3CMoJv6e6GEyK3_prop11 { always (after ((File - Protected) in Protected)) } pred __repair { idZWo3CMoJv6e6GEyK3_prop11 } check __repair { idZWo3CMoJv6e6GEyK3_prop11 <=> prop11o }
P6/data_P6_2/cal_R_test17.asm
alxzzhou/BUAA_CO_2020
1
15388
<filename>P6/data_P6_2/cal_R_test17.asm lui $1,21127 ori $1,$1,14712 lui $2,44086 ori $2,$2,40596 lui $3,61576 ori $3,$3,39849 lui $4,55309 ori $4,$4,56269 lui $5,14203 ori $5,$5,43259 lui $6,7505 ori $6,$6,18920 mthi $1 mtlo $2 sec0: nop nop nop subu $2,$6,$2 sec1: nop nop nor $6,$2,$5 subu $2,$6,$2 sec2: nop nop slti $6,$4,-4530 subu $1,$6,$2 sec3: nop nop mfhi $6 subu $4,$6,$2 sec4: nop nop lh $6,4($0) subu $5,$6,$2 sec5: nop or $2,$3,$3 nop subu $3,$6,$2 sec6: nop or $2,$4,$5 or $6,$3,$1 subu $2,$6,$2 sec7: nop nor $2,$3,$3 ori $6,$1,23525 subu $0,$6,$2 sec8: nop slt $2,$3,$2 mflo $6 subu $3,$6,$2 sec9: nop or $2,$0,$4 lhu $6,0($0) subu $3,$6,$2 sec10: nop lui $2,12693 nop subu $5,$6,$2 sec11: nop slti $2,$6,2972 xor $6,$2,$1 subu $6,$6,$2 sec12: nop sltiu $2,$3,6497 andi $6,$2,12791 subu $2,$6,$2 sec13: nop andi $2,$6,10566 mfhi $6 subu $3,$6,$2 sec14: nop sltiu $2,$0,13390 lbu $6,8($0) subu $4,$6,$2 sec15: nop mfhi $2 nop subu $0,$6,$2 sec16: nop mfhi $2 sltu $6,$4,$5 subu $4,$6,$2 sec17: nop mfhi $2 xori $6,$2,38681 subu $4,$6,$2 sec18: nop mflo $2 mfhi $6 subu $2,$6,$2 sec19: nop mfhi $2 lw $6,4($0) subu $4,$6,$2 sec20: nop lhu $2,14($0) nop subu $3,$6,$2 sec21: nop lhu $2,4($0) sltu $6,$3,$0 subu $5,$6,$2 sec22: nop lh $2,8($0) sltiu $6,$4,19507 subu $2,$6,$2 sec23: nop lw $2,16($0) mfhi $6 subu $2,$6,$2 sec24: nop lbu $2,13($0) lw $6,0($0) subu $4,$6,$2 sec25: sltu $6,$5,$4 nop nop subu $5,$6,$2 sec26: addu $6,$2,$3 nop addu $6,$2,$2 subu $3,$6,$2 sec27: nor $6,$2,$3 nop addiu $6,$4,-1640 subu $1,$6,$2 sec28: xor $6,$2,$4 nop mfhi $6 subu $6,$6,$2 sec29: sltu $6,$4,$3 nop lhu $6,8($0) subu $2,$6,$2 sec30: slt $6,$2,$1 sltu $2,$4,$2 nop subu $6,$6,$2 sec31: and $6,$0,$4 slt $2,$2,$2 nor $6,$4,$2 subu $0,$6,$2 sec32: xor $6,$2,$4 addu $2,$4,$2 addiu $6,$3,28983 subu $5,$6,$2 sec33: or $6,$3,$3 and $2,$3,$5 mflo $6 subu $1,$6,$2 sec34: sltu $6,$3,$3 subu $2,$3,$3 lb $6,15($0) subu $5,$6,$2 sec35: slt $6,$0,$0 ori $2,$6,61432 nop subu $3,$6,$2 sec36: xor $6,$2,$4 lui $2,41944 slt $6,$6,$4 subu $1,$6,$2 sec37: or $6,$3,$4 andi $2,$4,28782 ori $6,$1,42322 subu $1,$6,$2 sec38: xor $6,$0,$2 ori $2,$3,22053 mflo $6 subu $1,$6,$2 sec39: sltu $6,$5,$6 sltiu $2,$0,-28528 lhu $6,16($0) subu $3,$6,$2 sec40: xor $6,$4,$3 mflo $2 nop subu $5,$6,$2 sec41: xor $6,$2,$3 mfhi $2 addu $6,$0,$2 subu $4,$6,$2 sec42: addu $6,$2,$5 mflo $2 lui $6,56085 subu $1,$6,$2 sec43: xor $6,$4,$6 mflo $2 mflo $6 subu $1,$6,$2 sec44: slt $6,$6,$4 mflo $2 lhu $6,6($0) subu $2,$6,$2 sec45: xor $6,$1,$3 lbu $2,16($0) nop subu $2,$6,$2 sec46: or $6,$6,$4 lw $2,16($0) xor $6,$5,$2 subu $0,$6,$2 sec47: subu $6,$0,$4 lh $2,12($0) ori $6,$0,31910 subu $4,$6,$2 sec48: or $6,$0,$5 lh $2,10($0) mflo $6 subu $3,$6,$2 sec49: and $6,$3,$5 lbu $2,6($0) lhu $6,12($0) subu $3,$6,$2 sec50: andi $6,$2,33969 nop nop subu $3,$6,$2 sec51: ori $6,$6,48338 nop subu $6,$1,$6 subu $2,$6,$2 sec52: lui $6,17953 nop sltiu $6,$5,-19741 subu $5,$6,$2 sec53: ori $6,$1,48604 nop mflo $6 subu $5,$6,$2 sec54: ori $6,$3,58750 nop lbu $6,14($0) subu $3,$6,$2 sec55: ori $6,$4,7043 subu $2,$1,$2 nop subu $6,$6,$2 sec56: andi $6,$2,43740 or $2,$5,$4 slt $6,$2,$4 subu $4,$6,$2 sec57: sltiu $6,$5,-31130 subu $2,$3,$1 ori $6,$4,27352 subu $1,$6,$2 sec58: slti $6,$1,-30856 or $2,$3,$5 mfhi $6 subu $4,$6,$2 sec59: slti $6,$4,-25882 xor $2,$5,$4 lb $6,4($0) subu $5,$6,$2 sec60: andi $6,$4,4901 lui $2,58361 nop subu $3,$6,$2 sec61: slti $6,$1,29556 slti $2,$2,3587 subu $6,$2,$1 subu $5,$6,$2 sec62: andi $6,$3,57201 addiu $2,$2,27533 ori $6,$0,39380 subu $4,$6,$2 sec63: lui $6,38207 lui $2,10318 mflo $6 subu $3,$6,$2 sec64: andi $6,$5,2052 ori $2,$6,51978 lw $6,4($0) subu $4,$6,$2 sec65: ori $6,$1,38100 mflo $2 nop subu $3,$6,$2 sec66: slti $6,$3,27304 mflo $2 addu $6,$5,$1 subu $5,$6,$2 sec67: addiu $6,$5,-31862 mflo $2 slti $6,$5,-29636 subu $4,$6,$2 sec68: lui $6,52869 mflo $2 mflo $6 subu $4,$6,$2 sec69: andi $6,$2,3092 mfhi $2 lh $6,8($0) subu $3,$6,$2 sec70: sltiu $6,$2,-18971 lw $2,0($0) nop subu $2,$6,$2 sec71: xori $6,$2,51179 lbu $2,9($0) and $6,$5,$4 subu $2,$6,$2 sec72: slti $6,$4,22776 lh $2,0($0) addiu $6,$3,-26484 subu $3,$6,$2 sec73: ori $6,$4,33941 lbu $2,12($0) mfhi $6 subu $3,$6,$2 sec74: xori $6,$2,19395 lbu $2,16($0) lw $6,16($0) subu $2,$6,$2 sec75: mflo $6 nop nop subu $6,$6,$2 sec76: mflo $6 nop addu $6,$3,$1 subu $4,$6,$2 sec77: mflo $6 nop lui $6,45702 subu $3,$6,$2 sec78: mfhi $6 nop mfhi $6 subu $4,$6,$2 sec79: mflo $6 nop lbu $6,15($0) subu $2,$6,$2 sec80: mflo $6 xor $2,$0,$2 nop subu $0,$6,$2 sec81: mflo $6 sltu $2,$0,$5 or $6,$3,$2 subu $4,$6,$2 sec82: mflo $6 subu $2,$2,$2 addiu $6,$3,22041 subu $3,$6,$2 sec83: mfhi $6 subu $2,$0,$0 mfhi $6 subu $3,$6,$2 sec84: mfhi $6 sltu $2,$5,$2 lbu $6,2($0) subu $4,$6,$2 sec85: mfhi $6 andi $2,$4,45414 nop subu $2,$6,$2 sec86: mflo $6 sltiu $2,$2,-30621 slt $6,$3,$2 subu $4,$6,$2 sec87: mfhi $6 xori $2,$4,10789 addiu $6,$3,-20462 subu $3,$6,$2 sec88: mflo $6 addiu $2,$3,27139 mflo $6 subu $2,$6,$2 sec89: mflo $6 lui $2,62182 lhu $6,4($0) subu $5,$6,$2 sec90: mfhi $6 mfhi $2 nop subu $1,$6,$2 sec91: mfhi $6 mflo $2 slt $6,$3,$1 subu $5,$6,$2 sec92: mflo $6 mflo $2 xori $6,$4,8460 subu $3,$6,$2 sec93: mflo $6 mflo $2 mfhi $6 subu $1,$6,$2 sec94: mfhi $6 mflo $2 lhu $6,12($0) subu $3,$6,$2 sec95: mfhi $6 lw $2,12($0) nop subu $4,$6,$2 sec96: mfhi $6 lb $2,2($0) subu $6,$3,$5 subu $2,$6,$2 sec97: mfhi $6 lb $2,14($0) xori $6,$5,34230 subu $5,$6,$2 sec98: mflo $6 lb $2,10($0) mfhi $6 subu $3,$6,$2 sec99: mfhi $6 lh $2,16($0) lb $6,15($0) subu $5,$6,$2 sec100: lb $6,11($0) nop nop subu $5,$6,$2 sec101: lhu $6,10($0) nop addu $6,$5,$3 subu $3,$6,$2 sec102: lw $6,16($0) nop addiu $6,$3,-22920 subu $2,$6,$2 sec103: lhu $6,0($0) nop mflo $6 subu $6,$6,$2 sec104: lb $6,5($0) nop lb $6,2($0) subu $1,$6,$2 sec105: lh $6,0($0) xor $2,$2,$4 nop subu $1,$6,$2 sec106: lb $6,9($0) xor $2,$3,$5 nor $6,$5,$3 subu $6,$6,$2 sec107: lhu $6,14($0) subu $2,$4,$1 sltiu $6,$0,-19049 subu $1,$6,$2 sec108: lh $6,10($0) addu $2,$1,$2 mfhi $6 subu $3,$6,$2 sec109: lb $6,13($0) sltu $2,$5,$4 lw $6,8($0) subu $2,$6,$2 sec110: lb $6,15($0) addiu $2,$0,32502 nop subu $1,$6,$2 sec111: lw $6,0($0) slti $2,$3,-18913 nor $6,$5,$1 subu $0,$6,$2 sec112: lb $6,14($0) andi $2,$1,40237 addiu $6,$4,23813 subu $6,$6,$2 sec113: lw $6,12($0) lui $2,45938 mflo $6 subu $0,$6,$2 sec114: lbu $6,14($0) xori $2,$4,26687 lbu $6,0($0) subu $1,$6,$2 sec115: lw $6,4($0) mflo $2 nop subu $4,$6,$2 sec116: lw $6,0($0) mflo $2 xor $6,$3,$1 subu $6,$6,$2 sec117: lhu $6,6($0) mfhi $2 lui $6,39764 subu $3,$6,$2 sec118: lhu $6,4($0) mfhi $2 mfhi $6 subu $3,$6,$2 sec119: lbu $6,3($0) mfhi $2 lhu $6,12($0) subu $3,$6,$2 sec120: lhu $6,12($0) lw $2,8($0) nop subu $4,$6,$2 sec121: lh $6,12($0) lb $2,16($0) sltu $6,$1,$4 subu $4,$6,$2 sec122: lw $6,12($0) lh $2,16($0) lui $6,2342 subu $3,$6,$2 sec123: lw $6,0($0) lw $2,4($0) mflo $6 subu $4,$6,$2 sec124: lhu $6,8($0) lb $2,12($0) lhu $6,8($0) subu $4,$6,$2
prototyping/Examples/Syntax.agda
FreakingBarbarians/luau
1
13791
module Examples.Syntax where open import Agda.Builtin.Equality using (_≡_; refl) open import FFI.Data.String using (_++_) open import Luau.Syntax using (var; _$_; return; nil; function_⟨_⟩_end; done; _∙_) open import Luau.Syntax.ToString using (exprToString; blockToString) f = var "f" x = var "x" ex1 : exprToString(f $ x) ≡ "f(x)" ex1 = refl ex2 : blockToString(return nil ∙ done) ≡ "return nil" ex2 = refl ex3 : blockToString(function "f" ⟨ "x" ⟩ return x ∙ done end ∙ return f ∙ done) ≡ "local function f(x)\n" ++ " return x\n" ++ "end\n" ++ "return f" ex3 = refl
src/test/ref/unused-irq.asm
jbrandwood/kickc
2
87446
// Unused interrupts pointing to each other but never used from main loop - should be optimized away // Commodore 64 PRG executable file .file [name="unused-irq.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) .label SCREEN = $400 .label HARDWARE_IRQ = $fffe .segment Code // Unused Interrupt Routine irq2: { // *HARDWARE_IRQ = &irq1 lda #<irq1 sta HARDWARE_IRQ lda #>irq1 sta HARDWARE_IRQ+1 // } jmp $ea81 } // Unused Interrupt Routine irq1: { // *HARDWARE_IRQ = &irq2 lda #<irq2 sta HARDWARE_IRQ lda #>irq2 sta HARDWARE_IRQ+1 // } jmp $ea81 } main: { // *SCREEN = 'x' lda #'x' sta SCREEN // } rts }
programs/oeis/098/A098809.asm
neoneye/loda
22
22073
; A098809: a(n) = 2^(n+23) - 23. ; 8388585,16777193,33554409,67108841,134217705,268435433,536870889,1073741801,2147483625,4294967273,8589934569,17179869161,34359738345,68719476713,137438953449,274877906921,549755813865,1099511627753,2199023255529,4398046511081,8796093022185,17592186044393,35184372088809 mov $1,2 pow $1,$0 sub $1,1 mul $1,8388608 add $1,8388585 mov $0,$1
programs/oeis/117/A117197.asm
neoneye/loda
22
14455
<reponame>neoneye/loda ; A117197: a(n) = (n^3 - 1)^3. ; 0,343,17576,250047,1906624,9938375,40001688,133432831,385828352,997002999,2352637000,5150827583,10590025536,20638466407,38409197624,68669157375,118515478528,198257271191,322546580712,511808023999 add $0,1 pow $0,3 sub $0,1 pow $0,3
vendor/stdlib/src/Category/Functor.agda
isabella232/Lemmachine
56
8622
<reponame>isabella232/Lemmachine<filename>vendor/stdlib/src/Category/Functor.agda ------------------------------------------------------------------------ -- Functors ------------------------------------------------------------------------ -- Note that currently the functor laws are not included here. module Category.Functor where open import Data.Function record RawFunctor (f : Set → Set) : Set₁ where infixl 4 _<$>_ _<$_ field _<$>_ : ∀ {a b} → (a → b) → f a → f b _<$_ : ∀ {a b} → a → f b → f a x <$ y = const x <$> y
src/vectors.asm
ISSOtm/gb-open-world
8
97354
INCLUDE "defines.asm" SECTION "Vectors", ROM0[0] NULL:: ; This traps jumps to $0000, which is a common "default" pointer ; $FFFF is another one, but reads rIE as the instruction byte ; Thus, we put two `nop`s that may serve as operands, before soft-crashing ; The operand will always be 0, so even jumps will work fine. Nice! nop nop rst Crash ds $08 - @ ; 5 free bytes ; Waits for the next VBlank beginning ; Requires the VBlank handler to be able to trigger, otherwise will loop infinitely ; This means IME should be set, the VBlank interrupt should be selected in IE, ; and the LCD should be turned on. ; WARNING: Be careful if calling this with IME reset (`di`), if this was compiled ; with the `-h` flag, then a hardware bug is very likely to cause this routine to ; go horribly wrong. ; Note: the VBlank handler recognizes being called from this function (through `hVBlankFlag`), ; and does not try to save registers if so. To be safe, consider all registers to be destroyed. ; @destroy Possibly every register. The VBlank handler stops preserving anything when executed from this function WaitVBlank:: ld a, 1 ldh [hVBlankFlag], a .wait halt jr .wait ds $10 - 1 - @ ; 0 free bytes MemsetLoop: ld a, d ; You probably don't want to use this for writing to VRAM while the LCD is on. See LCDMemset. Memset:: ld [hli], a ld d, a dec bc ld a, b or c jr nz, MemsetLoop ret ds $18 - @ ; 0 free bytes MemcpySmall:: ld a, [de] ld [hli], a inc de dec c jr nz, MemcpySmall ret ds $20 - @ ; 1 free byte MemsetSmall:: ld [hli], a dec c jr nz, MemsetSmall ret ds $28 - 3 - @ ; 0 free bytes ; Dereferences `hl` and jumps there ; All other registers are passed to the called code intact, except Z is reset ; Soft-crashes if the jump target is in RAM ; @param hl Pointer to an address to jump to JumpToPtr:: ld a, [hli] ld h, [hl] ld l, a ; Jump to some address ; All registers are passed to the called code intact, except Z is reset ; (`jp CallHL` is equivalent to `jp hl`, but with the extra error checking on top) ; Soft-crashes if attempting to jump to RAM ; @param hl The address of the code to jump to CallHL:: bit 7, h error nz jp hl ds $30 - @ ; 3 free bytes ; Jumps to some address ; All registers are passed to the target code intact, except Z is reset ; (`jp CallDE` would be equivalent to `jp de` if that instruction existed) ; Soft-crashes if attempting to jump to RAM ; @param de The address of the code to jump to CallDE:: bit 7, d push de ret z ; No jumping to RAM, boy! rst Crash ds $38 - @ ; 3 free bytes ; Perform a soft-crash. Prints debug info on-screen Crash:: di ; Doing this as soon as possible to avoid interrupts messing up jp HandleCrash ds $40 - @ ; VBlank handler push af ldh a, [hLCDC] ldh [rLCDC], a jp VBlankHandler ds $48 - @ ; STAT handler reti ds $50 - @ ; Timer handler reti ds $58 - @ ; Serial handler reti ds $60 - @ ; Joypad handler (useless) reti SECTION "VBlank handler", ROM0 VBlankHandler: ldh a, [hSCY] ldh [rSCY], a ldh a, [hSCX] ldh [rSCX], a ldh a, [hBGP] ldh [rBGP], a ldh a, [hOBP0] ldh [rOBP0], a ldh a, [hOBP1] ldh [rOBP1], a ldh a, [rVBK] ldh [hVBK], a ldh a, [hVRAMTransferDestHigh] and a jr z, .noVRAMTransfer ldh [rHDMA3], a ldh a, [hVRAMTransferSrcHigh] ldh [rHDMA1], a ldh a, [hVRAMTransferSrcLow] ldh [rHDMA2], a ldh a, [hVRAMTransferDestLow] ldh [rHDMA4], a ldh a, [hVRAMTransferSrcBank] ld [rROMB0], a ldh a, [hVRAMTransferDestBank] ldh [rVBK], a ldh a, [hVRAMTransferLen] ldh [rHDMA5], a ; Restore ROM and VRAM banks ldh a, [hCurROMBank] ld [rROMB0], a ; ACK the transfer xor a ldh [hVRAMTransferDestHigh], a .noVRAMTransfer ; Load requested chunk gfx push bc ld c, LOW(hChunkGfxPtrs) .loadChunkGfx ldh a, [c] ; Load bank inc c ; Skip bank and a jr z, .noChunkGfx ld [rROMB0], a ; Check if we'll have enough time to perform the GDMA ; It's possible to load 14.25 tiles per scanline (456 dots/scanline / 32 dots/tile), ; so we'll be conservative (including to account for setup / teardown) and assume 13. ldh a, [rLY] and a jr z, .tooLateForChunkGfx ; If scanline 0 started, we're too late to load anything ; A = $9A - A cpl add a, $9A + 1 ; Multiply by 13... (since input is at most 10, this won't overflow) ld b, a swap a ; * 16 sub b ; * 15 sub b ; * 14 sub b ; * 13 ld b, a ; B = max amount of tiles we can load ldh a, [c] ; Load size inc c ; Skip size cp b ; If requested >= max (to account for HDMA5 being 1 smaller than real), give up jr nc, .cantLoadChunkGfx ld b, a ; Save for writing to HDMA5 ldh a, [c] ; Read LOW(src ptr) ldh [rHDMA2], a inc c ; Skip LOW(src ptr) ldh a, [c] ; Read HIGH(src ptr) ldh [rHDMA1], a assert LOW(hChunkGfxPtrs.topLeft) & $04 == 0 assert LOW(hChunkGfxPtrs.topRight) & $04 == 0 assert LOW(hChunkGfxPtrs.bottomLeft) & $04 == 4 assert LOW(hChunkGfxPtrs.bottomRight) & $04 == 4 ld a, c and $14 ; We load at $9[04]00, not $8[04]00; rely on bit 4 being always set! assert LOW(hChunkGfxPtrs) & $10 == $10 ldh [rHDMA3], a assert LOW(hChunkGfxPtrs.topLeft) & $08 == 0 assert LOW(hChunkGfxPtrs.topRight) & $08 == 8 assert LOW(hChunkGfxPtrs.bottomLeft) & $08 == 0 assert LOW(hChunkGfxPtrs.bottomRight) & $08 == 8 ld a, c ; Get bit 3 into bit 1 rra rra rra ldh [rVBK], a xor a ldh [rHDMA4], a ld a, b ldh [rHDMA5], a ldh a, [hCurROMBank] ld [rROMB0], a dec c ; Skip HIGH(src ptr) dec c ; Skip LOW(src ptr) dec c ; Skip size xor a ldh [c], a ; Reset bank, to mark gfx as loaded inc c ; Skip bank .noChunkGfx inc c ; Skip size .cantLoadChunkGfx inc c ; Skip LOW(src ptr) inc c ; Skip HIGH(src ptr) assert LOW(hChunkGfxPtrs) & $1F == $10 bit 4, c jr nz, .loadChunkGfx .tooLateForChunkGfx pop bc ldh a, [hVBK] ldh [rVBK], a ; OAM DMA can occur late in the handler, because it will still work even ; outside of VBlank. Sprites just will not appear on the scanline(s) ; during which it's running. ldh a, [hOAMHigh] and a jr z, .noOAMTransfer call hOAMDMA xor a ldh [hOAMHigh], a .noOAMTransfer ; Put all operations that cannot be interrupted above this line ; For example, OAM DMA (can't jump to ROM in the middle of it), ; VRAM accesses (can't screw up timing), etc ei ldh a, [hVBlankFlag] and a jr z, .lagFrame xor a ldh [hVBlankFlag], a ld c, LOW(rP1) ld a, $20 ; Select D-pad ldh [c], a REPT 6 ldh a, [c] ENDR or $F0 ; Set 4 upper bits (give them consistency) ld b, a ; Filter impossible D-pad combinations and $0C ; Filter only Down and Up ld a, b jr nz, .notUpAndDown or $0C ; If both are pressed, "unpress" them ld b, a .notUpAndDown and $03 ; Filter only Left and Right jr nz, .notLeftAndRight ; If both are pressed, "unpress" them inc b inc b inc b .notLeftAndRight swap b ; Put D-pad buttons in upper nibble ld a, $10 ; Select buttons ldh [c], a REPT 6 ldh a, [c] ENDR ; On SsAB held, soft-reset and $0F jr z, .perhapsReset .dontReset or $F0 ; Set 4 upper bits xor b ; Mix with D-pad bits, and invert all bits (such that pressed=1) thanks to "or $F0" ld b, a ; Release joypad ld a, $30 ldh [c], a ldh a, [hHeldKeys] cpl and b ldh [hPressedKeys], a ld a, b ldh [hHeldKeys], a pop af ; Pop off return address as well to exit infinite loop .lagFrame pop af ret .perhapsReset ldh a, [hCanSoftReset] and a jr z, .dontReset jp Reset ; This alignment guarantees both that it's possible to go between pointers by simple `inc l`, ; and that the "current chunk" is easily determined by looking at two bits in the pointer ; An alignment of 4 would be sufficient, but 5 guarantees that bit 4 is clear for the entire buffer... until its end. SECTION "Chunk gfx loading ptrs", HRAM,ALIGN[5,$10] hChunkGfxPtrs:: ; Format: ; - ROM bank (if non-zero, will be considered for loading) ; - LE pointer ; - Size (in HDMA5 format) .topLeft:: ds 4 .bottomLeft:: ds 4 .topRight:: ds 4 .bottomRight:: ds 4 .end SECTION "VBlank HRAM", HRAM ; DO NOT TOUCH THIS ; When this flag is set, the VBlank handler will assume the caller is `WaitVBlank`, ; and attempt to exit it. You don't want that to happen outside of that function. hVBlankFlag:: db ; High byte of the address of the OAM buffer to use. ; When this is non-zero, the VBlank handler will write that value to rDMA, and ; reset it. hOAMHigh:: db ; Shadow registers for a bunch of hardware regs. ; Writing to these causes them to take effect more or less immediately, so these ; are copied to the hardware regs by the VBlank handler, taking effect between frames. ; They also come in handy for "resetting" them if modifying them mid-frame for raster FX. hLCDC:: db hSCY:: db hSCX:: db hBGP:: db hOBP0:: db hOBP1:: db ; Keys that are currently being held, and that became held just this frame, respectively. ; Each bit represents a button, with that bit set == button pressed ; Button order: Down, Up, Left, Right, Start, select, B, A ; U+D and L+R are filtered out by software, so they will never happen hHeldKeys:: db hPressedKeys:: db ; If this is 0, pressing SsAB at the same time will not reset the game hCanSoftReset:: db ; The transfer will be started by the VBlank handler when [hVRAMTransferDestHigh] != $00 ; The VBlank handler will write $00 back hVRAMTransferSrcBank:: db hVRAMTransferSrcLow:: db hVRAMTransferSrcHigh:: db hVRAMTransferDestBank:: db hVRAMTransferDestLow:: db hVRAMTransferDestHigh:: db hVRAMTransferLen:: db hVBK: db ; [rVBK] gets saved to here when doing a VRAM transfer