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
|
---|---|---|---|---|
samples/serialize.adb | RREE/ada-util | 60 | 17084 | <reponame>RREE/ada-util
-----------------------------------------------------------------------
-- serialize -- JSON serialization
-- Copyright (C) 2017 <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.Text_IO;
with Util.Serialize.IO.JSON;
with Util.Streams.Texts;
procedure Serialize is
Output : aliased Util.Streams.Texts.Print_Stream;
Stream : Util.Serialize.IO.JSON.Output_Stream;
begin
Output.Initialize (Size => 10000);
Stream.Initialize (Output => Output'Unchecked_Access);
Stream.Start_Document;
Stream.Start_Entity ("person");
Stream.Write_Entity ("name", "<NAME>");
Stream.Write_Entity ("gender", "male");
Stream.Write_Entity ("age", 17);
Stream.End_Entity ("person");
Stream.End_Document;
Ada.Text_IO.Put_Line (Util.Streams.Texts.To_String (Output));
end Serialize;
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/sync1.ads | best08618/asylo | 7 | 18933 | <reponame>best08618/asylo
package sync1 is
type Chopstick_Type is synchronized interface;
type Chopstick is synchronized new Chopstick_Type with private;
private
protected type Chopstick is new Chopstick_Type with
entry Pick_Up;
procedure Put_Down;
private
Busy : Boolean := False;
end Chopstick;
end sync1;
|
core/lib/types/Suspension/Trunc.agda | AntoineAllioux/HoTT-Agda | 294 | 4785 | <gh_stars>100-1000
{-# OPTIONS --without-K --rewriting #-}
module lib.types.Suspension.Trunc where
open import lib.Basics
open import lib.NType2
open import lib.types.Paths
open import lib.types.Pointed
open import lib.types.Truncation
open import lib.types.Suspension.Core
module _ {i} (A : Type i) (m : ℕ₋₂) where
module SuspTruncSwap =
SuspRec
{C = Trunc (S m) (Susp A)}
[ north ]
[ south ]
(Trunc-rec
{B = [ north ] == [ south ]}
{{has-level-apply (Trunc-level {n = S m}) [ north ] [ south ]}}
(λ x → ap [_] (merid x)))
Susp-Trunc-swap : Susp (Trunc m A) → Trunc (S m) (Susp A)
Susp-Trunc-swap = SuspTruncSwap.f
Susp-Trunc-swap-Susp-fmap-trunc : ∀ (s : Susp A) →
Susp-Trunc-swap (Susp-fmap [_] s) == [ s ]
Susp-Trunc-swap-Susp-fmap-trunc =
Susp-elim
idp
idp $
λ a → ↓-='-in' $ ! $
ap (Susp-Trunc-swap ∘ Susp-fmap [_]) (merid a)
=⟨ ap-∘ Susp-Trunc-swap (Susp-fmap [_]) (merid a) ⟩
ap Susp-Trunc-swap (ap (Susp-fmap [_]) (merid a))
=⟨ ap (ap Susp-Trunc-swap) (SuspFmap.merid-β [_] a) ⟩
ap Susp-Trunc-swap (merid [ a ])
=⟨ SuspTruncSwap.merid-β [ a ] ⟩
ap [_] (merid a) =∎
abstract
Susp-Trunc-swap-natural : ∀ {i} {j} {A : Type i} {B : Type j} (f : A → B) (m : ℕ₋₂)
→ Susp-Trunc-swap B m ∘ Susp-fmap (Trunc-fmap f) ∼
Trunc-fmap (Susp-fmap f) ∘ Susp-Trunc-swap A m
Susp-Trunc-swap-natural {A = A} {B} f m =
Susp-elim
idp
idp $
Trunc-elim {{λ t → ↓-level (=-preserves-level Trunc-level)}} $ λ s →
↓-='-in' $
ap (Trunc-fmap (Susp-fmap f) ∘ Susp-Trunc-swap A m) (merid [ s ])
=⟨ ap-∘ (Trunc-fmap (Susp-fmap f)) (Susp-Trunc-swap A m) (merid [ s ]) ⟩
ap (Trunc-fmap (Susp-fmap f)) (ap (Susp-Trunc-swap A m) (merid [ s ]))
=⟨ ap (ap (Trunc-fmap (Susp-fmap f))) (SuspTruncSwap.merid-β A m [ s ]) ⟩
ap (Trunc-fmap (Susp-fmap f)) (ap [_] (merid s))
=⟨ ∘-ap (Trunc-fmap (Susp-fmap f)) [_] (merid s) ⟩
ap ([_] ∘ Susp-fmap f) (merid s)
=⟨ ap-∘ [_] (Susp-fmap f) (merid s) ⟩
ap [_] (ap (Susp-fmap f) (merid s))
=⟨ ap (ap [_]) (SuspFmap.merid-β f s) ⟩
ap [_] (merid (f s))
=⟨ ! (SuspTruncSwap.merid-β B m [ f s ]) ⟩
ap (Susp-Trunc-swap B m) (merid [ f s ])
=⟨ ap (ap (Susp-Trunc-swap B m)) (! (SuspFmap.merid-β (Trunc-fmap f) [ s ])) ⟩
ap (Susp-Trunc-swap B m) (ap (Susp-fmap (Trunc-fmap f)) (merid [ s ]))
=⟨ ∘-ap (Susp-Trunc-swap B m) (Susp-fmap (Trunc-fmap f)) (merid [ s ]) ⟩
ap (Susp-Trunc-swap B m ∘ Susp-fmap (Trunc-fmap f)) (merid [ s ]) =∎
⊙Susp-Trunc-swap : ∀ {i} (A : Type i) (m : ℕ₋₂)
→ ⊙Susp (Trunc m A) ⊙→ ⊙Trunc (S m) (⊙Susp A)
⊙Susp-Trunc-swap A m = Susp-Trunc-swap A m , idp
abstract
⊙Susp-Trunc-swap-natural : ∀ {i} {j} {A : Type i} {B : Type j} (f : A → B) (m : ℕ₋₂)
→ ⊙Susp-Trunc-swap B m ⊙∘ ⊙Susp-fmap (Trunc-fmap f) ==
⊙Trunc-fmap (⊙Susp-fmap f) ⊙∘ ⊙Susp-Trunc-swap A m
⊙Susp-Trunc-swap-natural f m = ⊙λ=' (Susp-Trunc-swap-natural f m) idp
|
PasswordChecker/program.asm | techwiz24/EECS2110 | 0 | 84985 | <filename>PasswordChecker/program.asm
; <NAME>
; EECS 2110 - Computer Architecture and Organization
; Spring 2016 at the University of Toledo
;
; Description: Given one or more input strings, determine whether or not it
; conforms to the following password policy:
; * Minimum of 8 characters
; * Maximum of 20 characters
; * At least one lowercase letter ('a'-'z')
; * At least one uppercase letter ('A'-'Z')
; * At least one number ('0'-'9')
; * At least one special character (any printable non alphanumeric character)
;
; ==============================================================================
; | Include libraries and macros |
; ==============================================================================
include ..\lib\pcmac.inc
include .\utils.inc ; For _AssertOne and _CheckChar
; ==============================================================================
; | Constants used in this file |
; ==============================================================================
TAB EQU 09 ; Horizontal Tab
CR EQU 13 ; Carriage Return
LF EQU 10 ; Line Feed
EOS EQU '$' ; DOS End of string terminator
MIN_LENGTH EQU 8 ; The minimum length of a password
MAX_LENGTH EQU 20 ; The maximum length of a password
ASCII_TO_LOWER_MASK EQU 00100000b ; The bitmask to convert a character to lower
NUMERIC_LOWER EQU '0' ; The lower bound for the numeric characters
NUMERIC_UPPER EQU '9' ; The upper bound for the numeric characters
LOWERCASE_LOWER EQU 'a' ; The lower bound for lower-case characters
LOWERCASE_UPPER EQU 'z' ; The upper bound for lower-case characters
UPPERCASE_LOWER EQU 'A' ; The lower bound for upper-case characters
UPPERCASE_UPPER EQU 'Z' ; The upper bound for upper-case characters
; Special characters accepted are broken into 5 ranges
; This excludes non-printable characters
SPECIAL_1_LOWER EQU ' '
SPECIAL_1_UPPER EQU '/'
SPECIAL_2_LOWER EQU ':'
SPECIAL_2_UPPER EQU '@'
SPECIAL_3_LOWER EQU '['
SPECIAL_3_UPPER EQU '`'
SPECIAL_4_LOWER EQU '{'
SPECIAL_4_UPPER EQU '~'
SPECIAL_EXTRA EQU 80h ; Anything from the extended set
RET_OK EQU 00h ; Return code for OK
; =========================== Start of Setup ============================
.model small ; Small Memory MODEL
.586 ; Pentium Instruction Set
.stack 100h ; Stack area - 256 bytes
; =========================== End of Setup ===========================
; =========================== Start of Data Segment ===========================
.data
; --------------------------- Input Prompt Strings ---------------------------
passwordPrompt DB 'Enter a Password to Check> ', EOS
continuePrompt DB 'Continue? [y/n] ', EOS
continueInvalidPrompt DB 'Project specification dictates you enter either one of (Y,y,N,n), so I will ask again. ', EOS
; ------------------------------------------------------------------------------
; --------------------------- Variables ---------------------------
lowerCount DW 0000h ; The number of lower-case characters
upperCount DW 0000h ; The number of upper-case characters
numberCount DW 0000h ; The number of numerical characters
specialCount DW 0000h ; The number of special characters
totalCount DW 0000h ; The total number of characters so far
validationErrors DW 0000h ; The number of validation errors
; ------------------------------------------------------------------------------
; --------------------------- Output Message ---------------------------
policy_1 DB 'Policy: 8-20 characters, and at least one of:', CR, LF, EOS
policy_2 DB TAB, '* Lower Case (a-z)', CR, LF, EOS
policy_3 DB TAB, '* Upper Case (A-Z)', CR, LF, EOS
policy_4 DB TAB, '* Numbers (0-9)', CR, LF, EOS
policy_5 DB TAB, '* Special Characters', CR, LF, EOS
pw_placeholder DB '*', EOS
pw_ok DB 'Nice password! Everything checks out', CR, LF, EOS
missing_number DB 'At least one number is required', CR, LF, EOS
missing_lower DB 'At least one lower case character is required', CR, LF, EOS
missing_upper DB 'At least one upper case character is required', CR, LF, EOS
missing_special DB 'At least one special character is required', CR, LF, EOS
too_short DB 'Password must be at least 8 characters', CR, LF, EOS
too_long DB 'Corporate dictates your password must be no longer than 20 characters...', CR, LF, EOS
blank DB CR, LF, EOS
; ------------------------------------------------------------------------------
; =========================== End of Data Segment ===========================
.code
start:
main PROC
_LdSeg ds, @data ; Load the data segment
_PutStr policy_1 ; Print the policy
_PutStr policy_2
_PutStr policy_3
_PutStr policy_4
_PutStr policy_5
_PutStr blank
PROMPT:
_PutStr passwordPrompt ; Ask for a password
PW_GET_CHAR:
_GetCh noEcho ; Get a character from stdin
cmp al, CR ; Check if the enter key was pressed
je CHECKPW ; If it was, check the password entered
cmp al, LF
je CHECKPW
; Start checking for character sets
; _CheckChar MACRO lower, upper, counter, nextLower, nextUpper, ok
_CheckChar NUMERIC_LOWER, NUMERIC_UPPER, numberCount, CMP_SPECIAL, CMP_UPPER, CHAR_OK
CMP_UPPER:
_CheckChar UPPERCASE_LOWER, UPPERCASE_UPPER, upperCount, CMP_SPECIAL, CMP_LOWER, CHAR_OK
CMP_LOWER:
_CheckChar LOWERCASE_LOWER, LOWERCASE_UPPER, lowerCount, CMP_SPECIAL, CMP_SPECIAL, CHAR_OK
CMP_SPECIAL:
_CheckChar SPECIAL_1_LOWER, SPECIAL_1_UPPER, specialCount, CMP_SPECIAL_2, CMP_SPECIAL_2, CHAR_OK
CMP_SPECIAL_2:
_CheckChar SPECIAL_2_LOWER, SPECIAL_2_UPPER, specialCount, CMP_SPECIAL_3, CMP_SPECIAL_3, CHAR_OK
CMP_SPECIAL_3:
_CheckChar SPECIAL_3_LOWER, SPECIAL_3_UPPER, specialCount, CMP_SPECIAL_4, CMP_SPECIAL_4, CHAR_OK
CMP_SPECIAL_4:
_CheckChar SPECIAL_4_LOWER, SPECIAL_4_UPPER, specialCount, CMP_SPECIAL_EXT, CMP_SPECIAL_EXT, CHAR_OK
CMP_SPECIAL_EXT:
cmp al, SPECIAL_EXTRA
jnae PW_GET_CHAR
inc specialCount
CHAR_OK:
inc totalCount ; Increment the total character count
_PutStr pw_placeholder ; Print '*' for feedback
jmp PW_GET_CHAR ; Go get the next character
CHECKPW:
_PutStr blank ; We just got an 'enter' key, add a blank line
; Ensure that at least one of each policy group has been seen
; _AssertOne MACRO counter, nextOk, msg, validationCounter
_AssertOne numberCount, CHECKPW_LOWER, missing_number, validationErrors
CHECKPW_LOWER:
_AssertOne lowerCount, CHECKPW_UPPER, missing_lower, validationErrors
CHECKPW_UPPER:
_AssertOne upperCount, CHECKPW_SPECIAL, missing_upper, validationErrors
CHECKPW_SPECIAL:
_AssertOne specialCount, CHECKPW_MIN, missing_special, validationErrors
; Also check the minimum and maximum length requirements
CHECKPW_MIN:
cmp totalCount, MIN_LENGTH
jge CHECKPW_MAX
_PutStr too_short
inc validationErrors
CHECKPW_MAX:
cmp totalCount, MAX_LENGTH
jle STATUS
_PutStr too_long
inc validationErrors
STATUS:
_PutStr blank
cmp validationErrors, 0
jne CONTINUE_PROMPT
_PutStr pw_ok
CONTINUE_PROMPT:
_PutStr continuePrompt ; Prompt the user to continue or exit
_GetCh
_PutStr blank
; Reset all counters
mov totalCount, 0000h
mov numberCount, 0000h
mov lowerCount, 0000h
mov upperCount, 0000h
mov specialCount, 0000h
mov validationErrors, 0000h
or al, ASCII_TO_LOWER_MASK ; Convert the read character to lower case
cmp al, 'y'
je PROMPT ; The user entered 'y', prompt for another PW
cmp al, 'n'
je EXIT ; The user entered 'n', exit
_PutStr continueInvalidPrompt ; /snark
jmp CONTINUE_PROMPT ; ask again...
EXIT:
_Exit RET_OK
main ENDP
END main
|
programs/oeis/032/A032184.asm | neoneye/loda | 22 | 21249 | <filename>programs/oeis/032/A032184.asm
; A032184: "CIJ" (necklace, indistinct, labeled) transform of 1, 3, 5, 7,...
; 1,4,16,96,768,7680,92160,1290240,20643840,371589120,7431782400,163499212800,3923981107200,102023508787200,2856658246041600,85699747381248000,2742391916199936000,93241325150797824000,3356687705428721664000,127554132806291423232000
mul $0,2
mov $3,127546
lpb $0
mul $3,$0
sub $0,2
mov $4,$3
lpe
add $2,15
lpb $2
add $1,$3
sub $2,10
lpe
add $1,$4
div $1,127546
mov $0,$1
|
oeis/003/A003436.asm | neoneye/loda-programs | 11 | 23199 | ; A003436: Number of inequivalent labeled Hamiltonian circuits on n-octahedron. Interlacing chords joining 2n points on circle.
; Submitted by <NAME>(w4)
; 1,0,1,4,31,293,3326,44189,673471,11588884,222304897,4704612119,108897613826,2737023412199,74236203425281,2161288643251828,67228358271588991,2225173863019549229,78087247031912850686,2896042595237791161749,113184512236563589997407,4649413893260078385217444,200270303795858794738504321,9026344234366864858972503599,424848521076290183773277773826,20845066637198571276074360028623,1064391406820581991037436971388801,56476147921204819804586253895847524,3109423868179803610933682295237992671
mov $2,$0
seq $0,231622 ; (2*n+1)*a(n+1) = (4*n^2+1)*a(n) + (2*n+1)*a(n-1) with n>1, a(0)=2, a(1)=-1.
lpb $2
mul $0,2
mov $2,1
lpe
div $0,2
|
alloy4fun_models/trashltl/models/4/JxRBojqfhLK3jqA7v.als | Kaixi26/org.alloytools.alloy | 0 | 5056 | <gh_stars>0
open main
pred idJxRBojqfhLK3jqA7v_prop5 {
some f : File | eventually f not in File'
}
pred __repair { idJxRBojqfhLK3jqA7v_prop5 }
check __repair { idJxRBojqfhLK3jqA7v_prop5 <=> prop5o } |
app/shell-commands-spawn_server.adb | charlie5/aShell | 11 | 26847 | with
Ada.Containers.Indefinite_Vectors,
Ada.Containers.Hashed_Maps,
Ada.Exceptions;
procedure Shell.Commands.Spawn_Server
is
package Server_Action_Vectors is new Ada.Containers.Indefinite_Vectors (Positive, Server_Action);
protected New_Actions
is
procedure Add (Action : in Server_Action);
procedure Get (Action : out Server_Action);
private
Actions : Server_Action_Vectors.Vector;
end New_Actions;
protected
body New_Actions
is
procedure Add (Action : in Server_Action)
is
begin
Actions.Append (Action);
end Add;
procedure Get (Action : out Server_Action)
is
begin
if not Actions.Is_Empty
then
Action := Actions.Last_Element;
Actions.Delete_Last;
else
Action := (Nil, Null_Id);
end if;
end Get;
end New_Actions;
task New_Action_Fetcher
is
entry Start;
end New_Action_Fetcher;
task body New_Action_Fetcher
is
Input_Stream : aliased Pipe_Stream := Stream (Shell.Standard_Input);
begin
accept Start;
loop
declare
Action : constant Server_Action := Server_Action'Input (Input_Stream'Access);
begin
New_Actions.Add (Action);
exit when Action.Kind = Stop;
end;
end loop;
exception
when E : others =>
Log ("Unhandled error in New_Action_Fetcher.");
Log (Ada.Exceptions.Exception_Information (E));
end New_Action_Fetcher;
begin
Open_Log ("aShell_spawn_Server.log");
declare
package Id_Maps_of_Command is new Ada.Containers.Hashed_Maps (Key_Type => Command_Id,
Element_Type => Command,
Hash => Hash,
Equivalent_Keys => "=");
Command_Map : Id_Maps_of_Command.Map;
Output_Stream : aliased Pipe_Stream := Stream (Shell.Standard_Output);
Stopping : Boolean := False;
begin
Log ("Starting Spawn Manager");
New_Action_Fetcher.Start;
loop
Log ("");
Log ("looping");
begin
declare
Action : Server_Action;
begin
New_Actions.Get (Action);
case Action.Kind
is
when Nil =>
Log ("Nil action.");
delay 0.02;
when New_Command =>
Log ("New_Command action.");
declare
The_Command : Command := Forge.To_Command (+Action.Command_Line);
begin
The_Command.Owns_Output_Pipe := True;
The_Command.Output_Pipe := To_Pipe (Blocking => False);
The_Command. Error_Pipe := To_Pipe (Blocking => False);
The_Command.Start (Input => Action.Command_Input.Element);
Log ("New Command:" & Action.Id'Image & " '" & Image (The_Command) & "'");
Command_Map.Insert (Action.Id, The_Command);
end;
when Stop =>
Log ("Stop action.");
Stopping := True;
end case;
end;
declare
use Id_Maps_of_Command;
package Command_Id_Vectors is new Ada.Containers.Vectors (Positive, Command_Id);
Done_Comands : Command_Id_Vectors.Vector;
Cursor : Id_Maps_of_Command.Cursor := Command_Map.First;
begin
-- Send ongoing command results to the client.
--
while Has_Element (Cursor)
loop
declare
use Data_Holders;
Id : constant Command_Id := Key (Cursor);
The_Command : Command := Element (Cursor);
procedure Send_New_Results
is
Output : constant Data := Output_Of (The_Command.Output_Pipe);
Errors : constant Data := Output_Of (The_Command.Error_Pipe);
begin
if not ( Output'Length = 0
and Errors'Length = 0)
then
Client_Action'Output (Output_Stream'Access,
(New_Outputs,
Id,
To_Holder (Output),
To_Holder (Errors)));
end if;
end Send_New_Results;
begin
Send_New_Results; -- Send ongoing results.
if The_Command.Has_Terminated
then
Log ("Command: " & Id'Image & " has terminated.");
Send_New_Results; -- Send any final results.
declare
Act : constant Client_Action := (Command_Done,
Id,
Normal_Exit => The_Command.Normal_Exit);
begin
Client_Action'Output (Output_Stream'Access, Act);
end;
Done_Comands.Append (Id);
end if;
end;
Next (Cursor);
end loop;
-- Rid completed commands.
--
for Each of Done_Comands
loop
Command_Map.Delete (Each);
end loop;
end;
exit when Stopping
and Command_Map.Is_Empty;
if Command_Map.Is_Empty
then
delay 0.1;
end if;
end;
end loop;
declare
Act : constant Client_Action := (Server_Done, Null_Id);
begin
Client_Action'Output (Output_Stream'Access, Act);
end;
Log ("Spawn Server: Done");
end;
Close_Log;
exception
when E : others =>
Log ("Unhandled error in aShell_Spawn_Server.");
Log (Ada.Exceptions.Exception_Information (E));
Close_Log;
end Shell.Commands.Spawn_Server;
|
libsrc/stdio/conio/screensize.asm | jpoikela/z88dk | 0 | 3025 | <reponame>jpoikela/z88dk
; CALLER linkage for function pointers
SECTION code_clib
PUBLIC screensize
PUBLIC _screensize
EXTERN screensize_callee
EXTERN ASMDISP_SCREENSIZE_CALLEE
.screensize
._screensize
pop af
pop de
pop bc
push bc
push de
push af
jp screensize_callee + ASMDISP_SCREENSIZE_CALLEE
|
release/src/router/gmp/source/mpn/ia64/gcd_1.asm | zhoutao0712/rtn11pb1 | 12 | 102094 | <reponame>zhoutao0712/rtn11pb1
dnl Itanium-2 mpn_gcd_1 -- mpn by 1 gcd.
dnl Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 3 of the License, or (at
dnl your option) any later version.
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/bitpair (1x1 gcd)
C itanium2: 6.3
C itanium: 14 (approx)
C mpn_gcd_1 (mp_srcptr xp, mp_size_t xsize, mp_limb_t y);
C
C The entry sequence is designed to expect xsize>1 and hence a modexact
C call. This ought to be more common than a 1x1 operation. Our critical
C path is thus stripping factors of 2 from y, calling modexact, then
C stripping factors of 2 from the x remainder returned.
C
C The common factors of 2 between x and y must be determined using the
C original x, not the remainder from the modexact. This is done with
C x_orig which is xp[0]. There's plenty of time to do this while the rest
C of the modexact etc is happening.
C
C It's possible xp[0] is zero. In this case the trailing zeros calculation
C popc((x-1)&~x) gives 63, and that's clearly no less than what y will
C have, making min(x_twos,y_twos) == y_twos.
C
C The main loop consists of transforming x,y to abs(x-y),min(x,y), and then
C stripping factors of 2 from abs(x-y). Those factors of two are
C determined from just y-x, without the abs(), since there's the same
C number of trailing zeros on n or -n in twos complement. That makes the
C dependent chain
C
C cycles
C 1 sub x-y and x-y-1
C 3 andcm (x-y-1)&~(x-y)
C 2 popcnt trailing zeros
C 3 shr.u strip abs(x-y)
C ---
C 9
C
C The selection of x-y versus y-x for abs(x-y), and the selection of the
C minimum of x and y, is done in parallel with the above.
C
C The algorithm takes about 0.68 iterations per bit (two N bit operands) on
C average, hence the final 6.3 cycles/bitpair.
C
C The loop is not as fast as one might hope, since there's extra latency
C from andcm going across to the `multimedia' popcnt, and vice versa from
C multimedia shr.u back to the integer sub.
C
C The loop branch is .sptk.clr since we usually expect a good number of
C iterations, and the iterations are data dependent so it's unlikely past
C results will predict anything much about the future.
C
C Not done:
C
C An alternate algorithm which didn't strip all twos, but instead applied
C tbit and predicated extr on x, and then y, was attempted. The loop was 6
C cycles, but the algorithm is an average 1.25 iterations per bitpair for a
C total 7.25 c/bp, which is slower than the current approach.
C
C Alternatives:
C
C Perhaps we could do something tricky by extracting a few high bits and a
C few low bits from the operands, and looking up a table which would give a
C set of predicates to control some shifts or subtracts or whatever. That
C could knock off multiple bits per iteration.
C
C The right shifts are a bit of a bottleneck (shr at 2 or 3 cycles, or extr
C only going down I0), perhaps it'd be possible to shift left instead,
C using add. That would mean keeping track of the lowest not-yet-zeroed
C bit, using some sort of mask.
C
C Itanium-1:
C
C This code is not designed for itanium-1 and in fact doesn't run well on
C that chip. The loop seems to be about 21 cycles, probably because we end
C up with a 10 cycle replay for not forcibly scheduling the shr.u latency.
C Lack of branch hints might introduce a couple of bubbles too.
C
ASM_START()
.explicit C What does this mean?
C HP's assembler requires these declarations for importing mpn_modexact_1c_odd
.global mpn_modexact_1c_odd
.type mpn_modexact_1c_odd,@function
PROLOGUE(mpn_gcd_1)
C r32 xp
C r33 xsize
C r34 y
define(x, r8)
define(xp_orig, r32)
define(xsize, r33)
define(y, r34) define(inputs, 3)
define(save_rp, r35)
define(save_pfs, r36)
define(x_orig, r37)
define(x_orig_one, r38)
define(y_twos, r39) define(locals, 5)
define(out_xp, r40)
define(out_xsize, r41)
define(out_divisor, r42)
define(out_carry, r43) define(outputs, 4)
.prologue
{ .mmi;
ifdef(`HAVE_ABI_32',
` addp4 r9 = 0, xp_orig define(xp,r9)', C M0
` define(xp,xp_orig)')
.save ar.pfs, save_pfs
alloc save_pfs = ar.pfs, inputs, locals, outputs, 0 C M2
.save rp, save_rp
mov save_rp = b0 C I0
}{ .body
add r10 = -1, y C M3 y-1
} ;;
{ .mmi; ld8 x = [xp] C M0 x = xp[0] if no modexact
ld8 x_orig = [xp] C M1 orig x for common twos
cmp.ne p6,p0 = 1, xsize C I0
}{ .mmi; andcm y_twos = r10, y C M2 (y-1)&~y
mov out_xp = xp_orig C M3
mov out_xsize = xsize C I1
} ;;
mov out_carry = 0
C
popcnt y_twos = y_twos C I0 y twos
;;
C
{ .mmi; add x_orig_one = -1, x_orig C M0 orig x-1
shr.u out_divisor = y, y_twos C I0 y without twos
}{ shr.u y = y, y_twos C I1 y without twos
(p6) br.call.sptk.many b0 = mpn_modexact_1c_odd C if xsize>1
} ;;
C modexact can leave x==0
{ .mmi; cmp.eq p6,p0 = 0, x C M0 if {xp,xsize} % y == 0
andcm x_orig = x_orig_one, x_orig C M1 orig (x-1)&~x
add r9 = -1, x C I0 x-1
} ;;
{ .mmi; andcm r9 = r9, x C M0 (x-1)&~x
mov b0 = save_rp C I0
} ;;
C
popcnt x_orig = x_orig C I0 orig x twos
popcnt r9 = r9 C I0 x twos
;;
C
{ cmp.lt p7,p0 = x_orig, y_twos C M0 orig x_twos < y_twos
shr.u x = x, r9 C I0 x odd
} ;;
{ (p7) mov y_twos = x_orig C M0 common twos
add r10 = -1, y C I0 y-1
(p6) br.dpnt.few .Ldone_y C B0 x%y==0 then result y
} ;;
C
C No noticable difference in speed for the loop aligned to
C 32 or just 16.
.Ltop:
C r8 x
C r10 y-1
C r34 y
C r38 common twos, for use at end
{ .mmi; cmp.gtu p8,p9 = x, y C M0 x>y
cmp.ne p10,p0 = x, y C M1 x==y
sub r9 = y, x C I0 d = y - x
}{ .mmi; sub r10 = r10, x C M2 d-1 = y - x - 1
} ;;
{ .mmi; .pred.rel "mutex", p8, p9
(p8) sub x = x, y C M0 x>y use x=x-y, y unchanged
(p9) mov y = x C M1 y>=x use y=x
(p9) mov x = r9 C I0 y>=x use x=y-x
}{ .mmi; andcm r9 = r10, r9 C M2 (d-1)&~d
;;
add r10 = -1, y C M0 new y-1
popcnt r9 = r9 C I0 twos on x-y
} ;;
{ shr.u x = x, r9 C I0 new x without twos
(p10) br.sptk.few.clr .Ltop
} ;;
C result is y
.Ldone_y:
shl r8 = y, y_twos C I common factors of 2
;;
mov ar.pfs = save_pfs C I0
br.ret.sptk.many b0
EPILOGUE()
|
src/delays.asm | maciejmalecki/trex64 | 11 | 14419 | /*
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#import "_zero_page.asm"
#import "_segments.asm"
#importonce
.filenamespace c64lib
/*
* Busy waits until delay counter gets down to 0.
*
* In: delay - amount of delay cycles to wait;
* if handleDelay is called in raster IRQ then 1 delay cycle = 1/50 sec (PAL) or 1/60 sec (NTSC).
* Mod: A
*/
.pseudocommand wait delay {
lda delay
sta z_delayCounter
!:
lda z_delayCounter
bne !-
}
/*
* Decrements delay counter if not zero already. To be called periodically i.e. within scope of (raster) IRQ handler.
*
* Mod: A
*/
.macro handleDelay() {
txa
ldx z_delayCounter
beq !+
dex
stx z_delayCounter
!:
tax
}
.segment Code
dly_wait10: {
wait #10
rts
}
dly_handleDelay: {
handleDelay()
rts
}
|
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/mul10.asm | Frodevan/z88dk | 0 | 88535 |
SECTION code_fp_math16
PUBLIC f16_mul10
EXTERN asm_f16_mul10
defc f16_mul10 = asm_f16_mul10
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _f16_mul10
EXTERN cm16_sdcc_mul10
defc _f16_mul10 = cm16_sdcc_mul10
ENDIF
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_10867_1214.asm | ljhsiun2/medusa | 9 | 244150 | <filename>Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_10867_1214.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0xf081, %rsi
lea addresses_WT_ht+0x8501, %rdi
nop
nop
nop
sub $1550, %r14
mov $73, %rcx
rep movsq
nop
nop
dec %r14
lea addresses_WC_ht+0x13401, %rsi
lea addresses_UC_ht+0x2e81, %rdi
clflush (%rdi)
sub %r11, %r11
mov $80, %rcx
rep movsb
and $4664, %rcx
lea addresses_D_ht+0x1e791, %rbp
nop
dec %r15
mov (%rbp), %r14
nop
nop
nop
sub $43576, %rbp
lea addresses_WC_ht+0x180b3, %rbp
nop
nop
nop
nop
xor $37378, %rcx
and $0xffffffffffffffc0, %rbp
movntdqa (%rbp), %xmm3
vpextrq $1, %xmm3, %r11
nop
nop
nop
nop
nop
and $7145, %rcx
lea addresses_A_ht+0x1649, %rbp
nop
nop
nop
cmp $39554, %rcx
movups (%rbp), %xmm2
vpextrq $0, %xmm2, %r14
nop
nop
nop
nop
xor $48690, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %rax
push %rbp
push %rbx
push %rsi
// Store
lea addresses_WT+0xa531, %rbx
nop
nop
inc %r12
mov $0x5152535455565758, %rbp
movq %rbp, %xmm7
vmovups %ymm7, (%rbx)
nop
nop
nop
nop
nop
cmp %rbx, %rbx
// Store
lea addresses_PSE+0x19c01, %r14
nop
nop
xor $8107, %r11
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
vmovups %ymm1, (%r14)
nop
dec %r12
// Faulty Load
lea addresses_UC+0xcc01, %rbp
nop
nop
nop
nop
inc %rax
mov (%rbp), %r11
lea oracles, %rsi
and $0xff, %r11
shlq $12, %r11
mov (%rsi,%r11,1), %r11
pop %rsi
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 11}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 10}, 'dst': {'same': True, 'type': 'addresses_UC_ht', 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'58': 10867}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
smsq/home/mem2.asm | olifink/smsqe | 0 | 177042 | ; HOME thing mem allocation/deallocation V1.02 (c) <NAME>, <NAME> 2005
; This is the code that does the actual mem allocation for a job.
; It reserves enough mem & then copies the file & dirnames into it
; 2005-10-23 1.00 initial release version
; 2005-11-09 1.01 error returned if empty filename passed
; 2006-01-17 1.02 now inherits current directory of calling job (mk)
; 2017-02-22 1.03 set job ID on opening dirs
section util
include dev8_keys_chn
include dev8_keys_chp
include dev8_keys_iod
include dev8_keys_jcb
include dev8_keys_err
include dev8_keys_qlv
include dev8_keys_sys
include dev8_keys_thg
include dev8_keys_qdos_sms
include dev8_keys_qdos_ioa
include dev8_keys_qdos_io
include DEV8_keys_hdr
include dev8_smsq_home_data
xdef h_setmem
xdef h_fr_mem
xref getcur
xref h_link
xref h_unlnk
*--------------------------------------------------------------------
* set memory - make an entry for a new job
*
* Registers:
* Entry Exit
* D0 0 or errors
* D1 ID of Job to set homedir for same
* D2/D3 smashed
* A0 pointer to entry for this job
* A1 pointer to parameters smashed
* A2 pointer to th link. header smashed
* A3 smashed
* A4 smashed
*
* this code is called in USER mode
*
* error returns
* IJOB - job in D1 doesn't exist
* IPAR - no filename passed (empty string!)
* any error from mem alloc routine
* any error from open file
*--------------------------------------------------------------------
hpareg reg d1-d3/a1-a3
noname
moveq #err.ipar,d0
rts
h_setmem
clr.l d2
move.l set_nam(a1),a3 ; point to filename
move.w (a3),d2 ; length of filename
beq.s noname
add.w d2,d2 ; twice, (for homedir)
moveq #hd_maxlen+3,d0 ; space for current dir + len counter
bclr #0,d0 ; round down
add.w d0,d2
add.l #hdr.len,d2 ; + space for file header (includes space for my header)
movem.l hpareg,-(sp)
exg d2,d1 ; this much space for this job
moveq #sms.achp,d0 ; allocate
trap #1
movem.l (sp)+,hpareg
tst.l d0 ; alloc OK?
bne tha_exit ; ...oops
lea hmt_free+iod_iolk-iod_clos(a2),a3 ; point to "driver"
move.l a3,chp_drlk-chp.len(a0) ; fill it in in usage block, this will call the job remove routine to call the free routine
bsr h_link ; link into my list
; now set the directories etc...
; a0 points to mem
; first get the dir name : to obtain this, we gradually shorten the total file-
; name until we get to the first '_' (from the end). Then we open a file with
; that name & see whether it is a dir. If yes, we found the directory.
; All this is to get around the dev bug.
dirregs reg d1/d4/d7/a1/a2
d1_stk equ 0
lea hl_data(a0),a0 ; point to usable space now
move.l a0,a3 ; and keep
movem.l dirregs,-(sp)
move.l set_nam(a1),a2 ; point to filename
clr.l d7
move.w (a2),d7 ; full length of file name
move.l d7,d4 ; keep
; strip until next underline
namelp2 lea 1(a2),a1 ; point to end of name
namelp subq.w #1,d4 ; make new end of name
beq.s huh ; errrrr?
cmp.b #'_',(a1,d4.w) ; is it an underscore?
bne.s namelp ; no, so loop until we find one
; here we found a potential directory
fndnm move.w d4,(a2) ; set new name length (!)
move.l a2,a0 ; point to "name"
moveq #ioa.open,d0 ; open ...
moveq #ioa.kshr,d3 ; ...as old file ...
move.l d1_stk(a7),d1 ; ...for this job ... ***1.03
trap #2 ; ...now
tst.l d0 ; open ok?
bne.s namelp2 ; no, so try next
move.l a3,a1 ; where we read file header to
moveq #hdr.len,d2 ; we have that much space
moveq #-1,d3
moveq #iof.rhdr,d0
trap #3 ; read file header of this file
move.l d0,d2
moveq #ioa.clos,d0
trap #2 ; close file again
tst.l d2 ; could we read file?
bne.s namelp2 ; no, we couldn't, go round again
cmp.b #-1,hdr_type(a3) ; is file a directory?
bne.s namelp2 ; no
move.w d4,d3 ; new file length
move.w d7,(a2) ; reset old file length
moveq #0,d0 ; no error
bra.s rd_end
huh moveq #err.itnf,d2
rd_end movem.l (sp)+,dirregs
move.l d2,d0
bne.s tha_exit ; ooops on header read
move.l a3,a0
; a0 = pointer to usable space (currently contains file header)
; a1 = pointer to parameters
; a2 = thing linkage
; a3 = a0
; a4 =
; now first copy the filename
move.l d4,-(sp)
move.l set_nam(a1),a4 ; point to filename
move.w (a4)+,d0 ; length of filename
move.l a4,a1 ; keep
move.w d0,(a3)+ ; lrngth of filename
addq.w #1,d0
bclr #0,d0 ; make even
subq.w #1,d0
cpylp1 move.b (a4)+,(a3)+ ; copy filename
dbf d0,cpylp1
; now copy the dirname
move.w d3,d4 ; length of dirname
addq.w #1,d3
bclr #0,d3 ; make even
subq.w #1,d3 ; make counter to copy dir name
move.l a1,a4 ; point to filename
move.w d4,(a3)+ ; length of dirname
move.w d3,d0 ; how often we copy a byte from name
cpylp2 move.b (a1)+,(a3)+ ; copy dirname
dbf d0,cpylp2
; and insert a copy of current directory of the calling job
sub.w #12,sp ; simulate thing call
move.l sp,a1
moveq #-1,d0 ; calling job
move.l d0,(a1) ; job ID
move.w #hd_maxlen+2,6(a1) ; space in our buffer
move.l a3,8(a1) ; and the buffer itself
bsr getcur
add.w #12,sp
tst.l d0 ; all right?
bne.s cpy3 ; no, copy home directory as default
tst.w (a3) ; got any name?
bne.s tha_ok ; yes, it's all right
cpy3 move.w d4,(a3)+ ; no, copy home directory instead
cpylp3 move.b (a4)+,(a3)+
dbf d3,cpylp3
tha_ok
move.l (sp)+,d4
moveq #0,d0 ; no error
tha_exit
rts ; leave
;--------------------------------------------------------------------
* Free the memory occupied by this job from my list.
* Note that this is called when the job remove routine is called
* (and only then).
* There is no facility to remove the job entry from my list
* other than here.
* This is called from SUPERVISOR mode, with A0 pointing
* to the (common heap link) header of the reserved space
;---------------------------------------------------------------------
h_fr_mem
move.l chp_drlk(a0),a2 ; point to "driver"...
lea iod_clos-iod_iolk-hmt_free(a2),a2 ; ...and thus my linkage block
bsr h_unlnk ; unlink from my linked list
move.w mem.rchp,a2 ; and return to common heap
jmp (a2)
end
|
SVD2ada/svd/stm32_svd-bdma.ads | JCGobbi/Nucleo-STM32H743ZI | 0 | 22041 | pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32H743x.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package STM32_SVD.BDMA is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- DMA interrupt status register
type ISR_Register is record
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF1 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF1 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF1 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF1 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF2 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF2 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF2 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF2 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF3 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF3 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF3 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF3 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF4 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF4 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF4 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF4 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF5 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF5 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF5 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF5 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF6 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF6 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF6 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF6 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF7 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF7 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF7 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF7 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
GIF8 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1..8) This bit is
-- set by hardware. It is cleared by software writing 1 to the
-- corresponding bit in the DMA_IFCR register.
TCIF8 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1..8) This bit is set by
-- hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
HTIF8 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1..8) This bit is set
-- by hardware. It is cleared by software writing 1 to the corresponding
-- bit in the DMA_IFCR register.
TEIF8 : Boolean;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
GIF1 at 0 range 0 .. 0;
TCIF1 at 0 range 1 .. 1;
HTIF1 at 0 range 2 .. 2;
TEIF1 at 0 range 3 .. 3;
GIF2 at 0 range 4 .. 4;
TCIF2 at 0 range 5 .. 5;
HTIF2 at 0 range 6 .. 6;
TEIF2 at 0 range 7 .. 7;
GIF3 at 0 range 8 .. 8;
TCIF3 at 0 range 9 .. 9;
HTIF3 at 0 range 10 .. 10;
TEIF3 at 0 range 11 .. 11;
GIF4 at 0 range 12 .. 12;
TCIF4 at 0 range 13 .. 13;
HTIF4 at 0 range 14 .. 14;
TEIF4 at 0 range 15 .. 15;
GIF5 at 0 range 16 .. 16;
TCIF5 at 0 range 17 .. 17;
HTIF5 at 0 range 18 .. 18;
TEIF5 at 0 range 19 .. 19;
GIF6 at 0 range 20 .. 20;
TCIF6 at 0 range 21 .. 21;
HTIF6 at 0 range 22 .. 22;
TEIF6 at 0 range 23 .. 23;
GIF7 at 0 range 24 .. 24;
TCIF7 at 0 range 25 .. 25;
HTIF7 at 0 range 26 .. 26;
TEIF7 at 0 range 27 .. 27;
GIF8 at 0 range 28 .. 28;
TCIF8 at 0 range 29 .. 29;
HTIF8 at 0 range 30 .. 30;
TEIF8 at 0 range 31 .. 31;
end record;
-- DMA interrupt flag clear register
type IFCR_Register is record
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF1 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF1 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF1 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF1 : Boolean := False;
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF2 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF2 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF2 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF2 : Boolean := False;
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF3 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF3 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF3 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF3 : Boolean := False;
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF4 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF4 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF4 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF4 : Boolean := False;
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF5 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF5 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF5 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF5 : Boolean := False;
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF6 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF6 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF6 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF6 : Boolean := False;
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF7 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF7 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF7 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF7 : Boolean := False;
-- Write-only. Channel x global interrupt clear This bit is set and
-- cleared by software.
CGIF8 : Boolean := False;
-- Write-only. Channel x transfer complete clear This bit is set and
-- cleared by software.
CTCIF8 : Boolean := False;
-- Write-only. Channel x half transfer clear This bit is set and cleared
-- by software.
CHTIF8 : Boolean := False;
-- Write-only. Channel x transfer error clear This bit is set and
-- cleared by software.
CTEIF8 : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IFCR_Register use record
CGIF1 at 0 range 0 .. 0;
CTCIF1 at 0 range 1 .. 1;
CHTIF1 at 0 range 2 .. 2;
CTEIF1 at 0 range 3 .. 3;
CGIF2 at 0 range 4 .. 4;
CTCIF2 at 0 range 5 .. 5;
CHTIF2 at 0 range 6 .. 6;
CTEIF2 at 0 range 7 .. 7;
CGIF3 at 0 range 8 .. 8;
CTCIF3 at 0 range 9 .. 9;
CHTIF3 at 0 range 10 .. 10;
CTEIF3 at 0 range 11 .. 11;
CGIF4 at 0 range 12 .. 12;
CTCIF4 at 0 range 13 .. 13;
CHTIF4 at 0 range 14 .. 14;
CTEIF4 at 0 range 15 .. 15;
CGIF5 at 0 range 16 .. 16;
CTCIF5 at 0 range 17 .. 17;
CHTIF5 at 0 range 18 .. 18;
CTEIF5 at 0 range 19 .. 19;
CGIF6 at 0 range 20 .. 20;
CTCIF6 at 0 range 21 .. 21;
CHTIF6 at 0 range 22 .. 22;
CTEIF6 at 0 range 23 .. 23;
CGIF7 at 0 range 24 .. 24;
CTCIF7 at 0 range 25 .. 25;
CHTIF7 at 0 range 26 .. 26;
CTEIF7 at 0 range 27 .. 27;
CGIF8 at 0 range 28 .. 28;
CTCIF8 at 0 range 29 .. 29;
CHTIF8 at 0 range 30 .. 30;
CTEIF8 at 0 range 31 .. 31;
end record;
subtype CCR_PSIZE_Field is HAL.UInt2;
subtype CCR_MSIZE_Field is HAL.UInt2;
subtype CCR_PL_Field is HAL.UInt2;
-- DMA channel x configuration register
type CCR_Register is record
-- Channel enable This bit is set and cleared by software.
EN : Boolean := False;
-- Transfer complete interrupt enable This bit is set and cleared by
-- software.
TCIE : Boolean := False;
-- Half transfer interrupt enable This bit is set and cleared by
-- software.
HTIE : Boolean := False;
-- Transfer error interrupt enable This bit is set and cleared by
-- software.
TEIE : Boolean := False;
-- Data transfer direction This bit is set and cleared by software.
DIR : Boolean := False;
-- Circular mode This bit is set and cleared by software.
CIRC : Boolean := False;
-- Peripheral increment mode This bit is set and cleared by software.
PINC : Boolean := False;
-- Memory increment mode This bit is set and cleared by software.
MINC : Boolean := False;
-- Peripheral size These bits are set and cleared by software.
PSIZE : CCR_PSIZE_Field := 16#0#;
-- Memory size These bits are set and cleared by software.
MSIZE : CCR_MSIZE_Field := 16#0#;
-- Channel priority level These bits are set and cleared by software.
PL : CCR_PL_Field := 16#0#;
-- Memory to memory mode This bit is set and cleared by software.
MEM2MEM : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CCR_Register use record
EN at 0 range 0 .. 0;
TCIE at 0 range 1 .. 1;
HTIE at 0 range 2 .. 2;
TEIE at 0 range 3 .. 3;
DIR at 0 range 4 .. 4;
CIRC at 0 range 5 .. 5;
PINC at 0 range 6 .. 6;
MINC at 0 range 7 .. 7;
PSIZE at 0 range 8 .. 9;
MSIZE at 0 range 10 .. 11;
PL at 0 range 12 .. 13;
MEM2MEM at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
subtype CNDTR_NDT_Field is HAL.UInt16;
-- DMA channel x number of data register
type CNDTR_Register is record
-- Number of data to transfer Number of data to be transferred (0 up to
-- 65535). This register can only be written when the channel is
-- disabled. Once the channel is enabled, this register is read-only,
-- indicating the remaining bytes to be transmitted. This register
-- decrements after each DMA transfer. Once the transfer is completed,
-- this register can either stay at zero or be reloaded automatically by
-- the value previously programmed if the channel is configured in
-- auto-reload mode. If this register is zero, no transaction can be
-- served whether the channel is enabled or not.
NDT : CNDTR_NDT_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CNDTR_Register use record
NDT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- BDMA
type BDMA_Peripheral is record
-- DMA interrupt status register
ISR : aliased ISR_Register;
-- DMA interrupt flag clear register
IFCR : aliased IFCR_Register;
-- DMA channel x configuration register
CCR1 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR1 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR1 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR1 : aliased HAL.UInt32;
-- DMA channel x configuration register
CCR2 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR2 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR2 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR2 : aliased HAL.UInt32;
-- DMA channel x configuration register
CCR3 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR3 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR3 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR3 : aliased HAL.UInt32;
-- DMA channel x configuration register
CCR4 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR4 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR4 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR4 : aliased HAL.UInt32;
-- DMA channel x configuration register
CCR5 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR5 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR5 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR5 : aliased HAL.UInt32;
-- DMA channel x configuration register
CCR6 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR6 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR6 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR6 : aliased HAL.UInt32;
-- DMA channel x configuration register
CCR7 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR7 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR7 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR7 : aliased HAL.UInt32;
-- DMA channel x configuration register
CCR8 : aliased CCR_Register;
-- DMA channel x number of data register
CNDTR8 : aliased CNDTR_Register;
-- This register must not be written when the channel is enabled.
CPAR8 : aliased HAL.UInt32;
-- This register must not be written when the channel is enabled.
CMAR8 : aliased HAL.UInt32;
end record
with Volatile;
for BDMA_Peripheral use record
ISR at 16#0# range 0 .. 31;
IFCR at 16#4# range 0 .. 31;
CCR1 at 16#8# range 0 .. 31;
CNDTR1 at 16#C# range 0 .. 31;
CPAR1 at 16#10# range 0 .. 31;
CMAR1 at 16#14# range 0 .. 31;
CCR2 at 16#1C# range 0 .. 31;
CNDTR2 at 16#20# range 0 .. 31;
CPAR2 at 16#24# range 0 .. 31;
CMAR2 at 16#28# range 0 .. 31;
CCR3 at 16#30# range 0 .. 31;
CNDTR3 at 16#34# range 0 .. 31;
CPAR3 at 16#38# range 0 .. 31;
CMAR3 at 16#3C# range 0 .. 31;
CCR4 at 16#44# range 0 .. 31;
CNDTR4 at 16#48# range 0 .. 31;
CPAR4 at 16#4C# range 0 .. 31;
CMAR4 at 16#50# range 0 .. 31;
CCR5 at 16#58# range 0 .. 31;
CNDTR5 at 16#5C# range 0 .. 31;
CPAR5 at 16#60# range 0 .. 31;
CMAR5 at 16#64# range 0 .. 31;
CCR6 at 16#6C# range 0 .. 31;
CNDTR6 at 16#70# range 0 .. 31;
CPAR6 at 16#74# range 0 .. 31;
CMAR6 at 16#78# range 0 .. 31;
CCR7 at 16#80# range 0 .. 31;
CNDTR7 at 16#84# range 0 .. 31;
CPAR7 at 16#88# range 0 .. 31;
CMAR7 at 16#8C# range 0 .. 31;
CCR8 at 16#94# range 0 .. 31;
CNDTR8 at 16#98# range 0 .. 31;
CPAR8 at 16#9C# range 0 .. 31;
CMAR8 at 16#A0# range 0 .. 31;
end record;
-- BDMA
BDMA_Periph : aliased BDMA_Peripheral
with Import, Address => BDMA_Base;
end STM32_SVD.BDMA;
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_20032_2478.asm | ljhsiun2/medusa | 9 | 178109 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x6fea, %rax
nop
nop
nop
nop
xor $36877, %r14
movups (%rax), %xmm5
vpextrq $0, %xmm5, %r15
nop
sub $39972, %r9
lea addresses_normal_ht+0x1026a, %rcx
and $29492, %rbp
movw $0x6162, (%rcx)
nop
sub %rbp, %rbp
lea addresses_D_ht+0x1f53, %rsi
lea addresses_WT_ht+0x966a, %rdi
nop
nop
nop
nop
nop
dec %rbp
mov $27, %rcx
rep movsq
nop
nop
nop
and $50775, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r8
push %r9
push %rbp
push %rdi
// Load
lea addresses_US+0x1736a, %r12
add $50599, %r14
vmovups (%r12), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbp
nop
nop
nop
nop
nop
sub $21502, %r13
// Store
lea addresses_A+0xfa9a, %r12
sub $25881, %r8
mov $0x5152535455565758, %r9
movq %r9, (%r12)
nop
nop
inc %r8
// Store
mov $0x6e7ad400000000e2, %rdi
nop
nop
nop
sub %r9, %r9
mov $0x5152535455565758, %r8
movq %r8, (%rdi)
nop
nop
nop
sub %r8, %r8
// Store
lea addresses_A+0x6dca, %r8
nop
nop
xor $62983, %r14
mov $0x5152535455565758, %rdi
movq %rdi, (%r8)
nop
nop
and $24918, %r9
// Load
mov $0x7bc29100000007ea, %r14
clflush (%r14)
nop
nop
nop
add %r13, %r13
movups (%r14), %xmm2
vpextrq $1, %xmm2, %rbp
nop
nop
nop
xor %r14, %r14
// Store
lea addresses_UC+0x21ea, %r12
nop
nop
xor $35223, %r13
mov $0x5152535455565758, %rbp
movq %rbp, %xmm3
vmovups %ymm3, (%r12)
nop
nop
xor $32668, %r12
// Store
lea addresses_A+0x151, %r12
xor %r13, %r13
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
movups %xmm1, (%r12)
nop
nop
sub $28155, %r8
// Store
lea addresses_WT+0xcd6a, %r12
nop
xor $14506, %r14
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
vmovups %ymm1, (%r12)
nop
nop
nop
nop
and %rbp, %rbp
// Faulty Load
lea addresses_normal+0xf26a, %r8
clflush (%r8)
nop
nop
nop
nop
nop
add $39036, %r13
movups (%r8), %xmm4
vpextrq $1, %xmm4, %r12
lea oracles, %r13
and $0xff, %r12
shlq $12, %r12
mov (%r13,%r12,1), %r12
pop %rdi
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_US', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 8, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_NC', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 9, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': True}, 'OP': 'REPM'}
{'34': 20032}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
Applications/Sublime-Text/version.applescript | looking-for-a-job/applescript-examples | 1 | 2975 | #!/usr/bin/osascript
tell application "Sublime Text 2"
version
end tell
|
generated-src/win-x86_64/crypto/test/trampoline-x86_64.asm | jylama99/aws-lc | 0 | 172538 | <reponame>jylama99/aws-lc
; This file is generated from a similarly-named Perl script in the BoringSSL
; source tree. Do not edit by hand.
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
%ifdef BORINGSSL_PREFIX
%include "boringssl_prefix_symbols_nasm.inc"
%endif
section .text code align=64
global abi_test_trampoline
ALIGN 16
abi_test_trampoline:
$L$abi_test_trampoline_seh_begin:
sub rsp,344
$L$abi_test_trampoline_seh_prolog_alloc:
mov QWORD[112+rsp],rbx
$L$abi_test_trampoline_seh_prolog_rbx:
mov QWORD[120+rsp],rbp
$L$abi_test_trampoline_seh_prolog_rbp:
mov QWORD[128+rsp],rdi
$L$abi_test_trampoline_seh_prolog_rdi:
mov QWORD[136+rsp],rsi
$L$abi_test_trampoline_seh_prolog_rsi:
mov QWORD[144+rsp],r12
$L$abi_test_trampoline_seh_prolog_r12:
mov QWORD[152+rsp],r13
$L$abi_test_trampoline_seh_prolog_r13:
mov QWORD[160+rsp],r14
$L$abi_test_trampoline_seh_prolog_r14:
mov QWORD[168+rsp],r15
$L$abi_test_trampoline_seh_prolog_r15:
movdqa XMMWORD[176+rsp],xmm6
$L$abi_test_trampoline_seh_prolog_xmm6:
movdqa XMMWORD[192+rsp],xmm7
$L$abi_test_trampoline_seh_prolog_xmm7:
movdqa XMMWORD[208+rsp],xmm8
$L$abi_test_trampoline_seh_prolog_xmm8:
movdqa XMMWORD[224+rsp],xmm9
$L$abi_test_trampoline_seh_prolog_xmm9:
movdqa XMMWORD[240+rsp],xmm10
$L$abi_test_trampoline_seh_prolog_xmm10:
movdqa XMMWORD[256+rsp],xmm11
$L$abi_test_trampoline_seh_prolog_xmm11:
movdqa XMMWORD[272+rsp],xmm12
$L$abi_test_trampoline_seh_prolog_xmm12:
movdqa XMMWORD[288+rsp],xmm13
$L$abi_test_trampoline_seh_prolog_xmm13:
movdqa XMMWORD[304+rsp],xmm14
$L$abi_test_trampoline_seh_prolog_xmm14:
movdqa XMMWORD[320+rsp],xmm15
$L$abi_test_trampoline_seh_prolog_xmm15:
$L$abi_test_trampoline_seh_prolog_end:
mov rbx,QWORD[rdx]
mov rbp,QWORD[8+rdx]
mov rdi,QWORD[16+rdx]
mov rsi,QWORD[24+rdx]
mov r12,QWORD[32+rdx]
mov r13,QWORD[40+rdx]
mov r14,QWORD[48+rdx]
mov r15,QWORD[56+rdx]
movdqa xmm6,XMMWORD[64+rdx]
movdqa xmm7,XMMWORD[80+rdx]
movdqa xmm8,XMMWORD[96+rdx]
movdqa xmm9,XMMWORD[112+rdx]
movdqa xmm10,XMMWORD[128+rdx]
movdqa xmm11,XMMWORD[144+rdx]
movdqa xmm12,XMMWORD[160+rdx]
movdqa xmm13,XMMWORD[176+rdx]
movdqa xmm14,XMMWORD[192+rdx]
movdqa xmm15,XMMWORD[208+rdx]
mov QWORD[88+rsp],rcx
mov QWORD[96+rsp],rdx
mov r10,r8
mov r11,r9
dec r11
js NEAR $L$args_done
mov rcx,QWORD[r10]
add r10,8
dec r11
js NEAR $L$args_done
mov rdx,QWORD[r10]
add r10,8
dec r11
js NEAR $L$args_done
mov r8,QWORD[r10]
add r10,8
dec r11
js NEAR $L$args_done
mov r9,QWORD[r10]
add r10,8
lea rax,[32+rsp]
$L$args_loop:
dec r11
js NEAR $L$args_done
mov QWORD[104+rsp],r11
mov r11,QWORD[r10]
mov QWORD[rax],r11
mov r11,QWORD[104+rsp]
add r10,8
add rax,8
jmp NEAR $L$args_loop
$L$args_done:
mov rax,QWORD[88+rsp]
mov r10,QWORD[384+rsp]
test r10,r10
jz NEAR $L$no_unwind
pushfq
or QWORD[rsp],0x100
popfq
nop
global abi_test_unwind_start
abi_test_unwind_start:
call rax
global abi_test_unwind_return
abi_test_unwind_return:
pushfq
and QWORD[rsp],-0x101
popfq
global abi_test_unwind_stop
abi_test_unwind_stop:
jmp NEAR $L$call_done
$L$no_unwind:
call rax
$L$call_done:
mov rdx,QWORD[96+rsp]
mov QWORD[rdx],rbx
mov QWORD[8+rdx],rbp
mov QWORD[16+rdx],rdi
mov QWORD[24+rdx],rsi
mov QWORD[32+rdx],r12
mov QWORD[40+rdx],r13
mov QWORD[48+rdx],r14
mov QWORD[56+rdx],r15
movdqa XMMWORD[64+rdx],xmm6
movdqa XMMWORD[80+rdx],xmm7
movdqa XMMWORD[96+rdx],xmm8
movdqa XMMWORD[112+rdx],xmm9
movdqa XMMWORD[128+rdx],xmm10
movdqa XMMWORD[144+rdx],xmm11
movdqa XMMWORD[160+rdx],xmm12
movdqa XMMWORD[176+rdx],xmm13
movdqa XMMWORD[192+rdx],xmm14
movdqa XMMWORD[208+rdx],xmm15
mov rbx,QWORD[112+rsp]
mov rbp,QWORD[120+rsp]
mov rdi,QWORD[128+rsp]
mov rsi,QWORD[136+rsp]
mov r12,QWORD[144+rsp]
mov r13,QWORD[152+rsp]
mov r14,QWORD[160+rsp]
mov r15,QWORD[168+rsp]
movdqa xmm6,XMMWORD[176+rsp]
movdqa xmm7,XMMWORD[192+rsp]
movdqa xmm8,XMMWORD[208+rsp]
movdqa xmm9,XMMWORD[224+rsp]
movdqa xmm10,XMMWORD[240+rsp]
movdqa xmm11,XMMWORD[256+rsp]
movdqa xmm12,XMMWORD[272+rsp]
movdqa xmm13,XMMWORD[288+rsp]
movdqa xmm14,XMMWORD[304+rsp]
movdqa xmm15,XMMWORD[320+rsp]
add rsp,344
DB 0F3h,0C3h ;repret
$L$abi_test_trampoline_seh_end:
global abi_test_clobber_rax
ALIGN 16
abi_test_clobber_rax:
xor rax,rax
DB 0F3h,0C3h ;repret
global abi_test_clobber_rbx
ALIGN 16
abi_test_clobber_rbx:
xor rbx,rbx
DB 0F3h,0C3h ;repret
global abi_test_clobber_rcx
ALIGN 16
abi_test_clobber_rcx:
xor rcx,rcx
DB 0F3h,0C3h ;repret
global abi_test_clobber_rdx
ALIGN 16
abi_test_clobber_rdx:
xor rdx,rdx
DB 0F3h,0C3h ;repret
global abi_test_clobber_rdi
ALIGN 16
abi_test_clobber_rdi:
xor rdi,rdi
DB 0F3h,0C3h ;repret
global abi_test_clobber_rsi
ALIGN 16
abi_test_clobber_rsi:
xor rsi,rsi
DB 0F3h,0C3h ;repret
global abi_test_clobber_rbp
ALIGN 16
abi_test_clobber_rbp:
xor rbp,rbp
DB 0F3h,0C3h ;repret
global abi_test_clobber_r8
ALIGN 16
abi_test_clobber_r8:
xor r8,r8
DB 0F3h,0C3h ;repret
global abi_test_clobber_r9
ALIGN 16
abi_test_clobber_r9:
xor r9,r9
DB 0F3h,0C3h ;repret
global abi_test_clobber_r10
ALIGN 16
abi_test_clobber_r10:
xor r10,r10
DB 0F3h,0C3h ;repret
global abi_test_clobber_r11
ALIGN 16
abi_test_clobber_r11:
xor r11,r11
DB 0F3h,0C3h ;repret
global abi_test_clobber_r12
ALIGN 16
abi_test_clobber_r12:
xor r12,r12
DB 0F3h,0C3h ;repret
global abi_test_clobber_r13
ALIGN 16
abi_test_clobber_r13:
xor r13,r13
DB 0F3h,0C3h ;repret
global abi_test_clobber_r14
ALIGN 16
abi_test_clobber_r14:
xor r14,r14
DB 0F3h,0C3h ;repret
global abi_test_clobber_r15
ALIGN 16
abi_test_clobber_r15:
xor r15,r15
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm0
ALIGN 16
abi_test_clobber_xmm0:
pxor xmm0,xmm0
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm1
ALIGN 16
abi_test_clobber_xmm1:
pxor xmm1,xmm1
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm2
ALIGN 16
abi_test_clobber_xmm2:
pxor xmm2,xmm2
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm3
ALIGN 16
abi_test_clobber_xmm3:
pxor xmm3,xmm3
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm4
ALIGN 16
abi_test_clobber_xmm4:
pxor xmm4,xmm4
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm5
ALIGN 16
abi_test_clobber_xmm5:
pxor xmm5,xmm5
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm6
ALIGN 16
abi_test_clobber_xmm6:
pxor xmm6,xmm6
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm7
ALIGN 16
abi_test_clobber_xmm7:
pxor xmm7,xmm7
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm8
ALIGN 16
abi_test_clobber_xmm8:
pxor xmm8,xmm8
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm9
ALIGN 16
abi_test_clobber_xmm9:
pxor xmm9,xmm9
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm10
ALIGN 16
abi_test_clobber_xmm10:
pxor xmm10,xmm10
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm11
ALIGN 16
abi_test_clobber_xmm11:
pxor xmm11,xmm11
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm12
ALIGN 16
abi_test_clobber_xmm12:
pxor xmm12,xmm12
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm13
ALIGN 16
abi_test_clobber_xmm13:
pxor xmm13,xmm13
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm14
ALIGN 16
abi_test_clobber_xmm14:
pxor xmm14,xmm14
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm15
ALIGN 16
abi_test_clobber_xmm15:
pxor xmm15,xmm15
DB 0F3h,0C3h ;repret
global abi_test_bad_unwind_wrong_register
ALIGN 16
abi_test_bad_unwind_wrong_register:
$L$abi_test_bad_unwind_wrong_register_seh_begin:
push r12
$L$abi_test_bad_unwind_wrong_register_seh_push_r13:
nop
pop r12
DB 0F3h,0C3h ;repret
$L$abi_test_bad_unwind_wrong_register_seh_end:
global abi_test_bad_unwind_temporary
ALIGN 16
abi_test_bad_unwind_temporary:
$L$abi_test_bad_unwind_temporary_seh_begin:
push r12
$L$abi_test_bad_unwind_temporary_seh_push_r12:
mov rax,r12
inc rax
mov QWORD[rsp],rax
mov QWORD[rsp],r12
pop r12
DB 0F3h,0C3h ;repret
$L$abi_test_bad_unwind_temporary_seh_end:
global abi_test_get_and_clear_direction_flag
abi_test_get_and_clear_direction_flag:
pushfq
pop rax
and rax,0x400
shr rax,10
cld
DB 0F3h,0C3h ;repret
global abi_test_set_direction_flag
abi_test_set_direction_flag:
std
DB 0F3h,0C3h ;repret
global abi_test_bad_unwind_epilog
ALIGN 16
abi_test_bad_unwind_epilog:
$L$abi_test_bad_unwind_epilog_seh_begin:
push r12
$L$abi_test_bad_unwind_epilog_seh_push_r12:
nop
pop r12
nop
DB 0F3h,0C3h ;repret
$L$abi_test_bad_unwind_epilog_seh_end:
section .pdata rdata align=4
ALIGN 4
DD $L$abi_test_trampoline_seh_begin wrt ..imagebase
DD $L$abi_test_trampoline_seh_end wrt ..imagebase
DD $L$abi_test_trampoline_seh_info wrt ..imagebase
DD $L$abi_test_bad_unwind_wrong_register_seh_begin wrt ..imagebase
DD $L$abi_test_bad_unwind_wrong_register_seh_end wrt ..imagebase
DD $L$abi_test_bad_unwind_wrong_register_seh_info wrt ..imagebase
DD $L$abi_test_bad_unwind_temporary_seh_begin wrt ..imagebase
DD $L$abi_test_bad_unwind_temporary_seh_end wrt ..imagebase
DD $L$abi_test_bad_unwind_temporary_seh_info wrt ..imagebase
DD $L$abi_test_bad_unwind_epilog_seh_begin wrt ..imagebase
DD $L$abi_test_bad_unwind_epilog_seh_end wrt ..imagebase
DD $L$abi_test_bad_unwind_epilog_seh_info wrt ..imagebase
section .xdata rdata align=8
ALIGN 8
$L$abi_test_trampoline_seh_info:
DB 1
DB $L$abi_test_trampoline_seh_prolog_end-$L$abi_test_trampoline_seh_begin
DB 38
DB 0
DB $L$abi_test_trampoline_seh_prolog_xmm15-$L$abi_test_trampoline_seh_begin
DB 248
DW 20
DB $L$abi_test_trampoline_seh_prolog_xmm14-$L$abi_test_trampoline_seh_begin
DB 232
DW 19
DB $L$abi_test_trampoline_seh_prolog_xmm13-$L$abi_test_trampoline_seh_begin
DB 216
DW 18
DB $L$abi_test_trampoline_seh_prolog_xmm12-$L$abi_test_trampoline_seh_begin
DB 200
DW 17
DB $L$abi_test_trampoline_seh_prolog_xmm11-$L$abi_test_trampoline_seh_begin
DB 184
DW 16
DB $L$abi_test_trampoline_seh_prolog_xmm10-$L$abi_test_trampoline_seh_begin
DB 168
DW 15
DB $L$abi_test_trampoline_seh_prolog_xmm9-$L$abi_test_trampoline_seh_begin
DB 152
DW 14
DB $L$abi_test_trampoline_seh_prolog_xmm8-$L$abi_test_trampoline_seh_begin
DB 136
DW 13
DB $L$abi_test_trampoline_seh_prolog_xmm7-$L$abi_test_trampoline_seh_begin
DB 120
DW 12
DB $L$abi_test_trampoline_seh_prolog_xmm6-$L$abi_test_trampoline_seh_begin
DB 104
DW 11
DB $L$abi_test_trampoline_seh_prolog_r15-$L$abi_test_trampoline_seh_begin
DB 244
DW 21
DB $L$abi_test_trampoline_seh_prolog_r14-$L$abi_test_trampoline_seh_begin
DB 228
DW 20
DB $L$abi_test_trampoline_seh_prolog_r13-$L$abi_test_trampoline_seh_begin
DB 212
DW 19
DB $L$abi_test_trampoline_seh_prolog_r12-$L$abi_test_trampoline_seh_begin
DB 196
DW 18
DB $L$abi_test_trampoline_seh_prolog_rsi-$L$abi_test_trampoline_seh_begin
DB 100
DW 17
DB $L$abi_test_trampoline_seh_prolog_rdi-$L$abi_test_trampoline_seh_begin
DB 116
DW 16
DB $L$abi_test_trampoline_seh_prolog_rbp-$L$abi_test_trampoline_seh_begin
DB 84
DW 15
DB $L$abi_test_trampoline_seh_prolog_rbx-$L$abi_test_trampoline_seh_begin
DB 52
DW 14
DB $L$abi_test_trampoline_seh_prolog_alloc-$L$abi_test_trampoline_seh_begin
DB 1
DW 43
ALIGN 8
$L$abi_test_bad_unwind_wrong_register_seh_info:
DB 1
DB $L$abi_test_bad_unwind_wrong_register_seh_push_r13-$L$abi_test_bad_unwind_wrong_register_seh_begin
DB 1
DB 0
DB $L$abi_test_bad_unwind_wrong_register_seh_push_r13-$L$abi_test_bad_unwind_wrong_register_seh_begin
DB 208
ALIGN 8
$L$abi_test_bad_unwind_temporary_seh_info:
DB 1
DB $L$abi_test_bad_unwind_temporary_seh_push_r12-$L$abi_test_bad_unwind_temporary_seh_begin
DB 1
DB 0
DB $L$abi_test_bad_unwind_temporary_seh_push_r12-$L$abi_test_bad_unwind_temporary_seh_begin
DB 192
ALIGN 8
$L$abi_test_bad_unwind_epilog_seh_info:
DB 1
DB $L$abi_test_bad_unwind_epilog_seh_push_r12-$L$abi_test_bad_unwind_epilog_seh_begin
DB 1
DB 0
DB $L$abi_test_bad_unwind_epilog_seh_push_r12-$L$abi_test_bad_unwind_epilog_seh_begin
DB 192
|
source/league/matreshka-internals-strings.adb | svn2github/matreshka | 24 | 26690 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2009-2017, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Ada_2012;
with Ada.Unchecked_Deallocation;
with Matreshka.Atomics.Generic_Test_And_Set;
with Matreshka.Internals.Strings.Configuration;
package body Matreshka.Internals.Strings is
use Matreshka.Internals.Strings.Configuration;
use Matreshka.Internals.Utf16;
use Matreshka.Internals.Unicode;
Growth_Factor : constant := 32;
-- The growth factor controls how much extra space is allocated when
-- we have to increase the size of an allocated unbounded string. By
-- allocating extra space, we avoid the need to reallocate on every
-- append, particularly important when a string is built up by repeated
-- append operations of small pieces. This is expressed as a factor so
-- 32 means add 1/32 of the length of the string as growth space.
Min_Mul_Alloc : constant
:= Standard'Maximum_Alignment * Standard'Storage_Unit / Code_Unit_16'Size;
-- Allocation will be done by a multiple of Min_Mul_Alloc. This causes
-- no memory loss as most (all?) malloc implementations are obliged to
-- align the returned memory on the maximum alignment as malloc does not
-- know the target alignment.
procedure Free is
new Ada.Unchecked_Deallocation (Index_Map, Index_Map_Access);
procedure Free is
new Ada.Unchecked_Deallocation
(Shared_Sort_Key, Shared_Sort_Key_Access);
procedure Free is
new Ada.Unchecked_Deallocation (Shared_String, Shared_String_Access);
function Test_And_Set is
new Matreshka.Atomics.Generic_Test_And_Set (Index_Map, Index_Map_Access);
function Aligned_Size (Size : Utf16_String_Index) return Utf16_String_Index;
pragma Inline (Aligned_Size);
-- Returns recommended size of the shared string which is greater or
-- equal to specified. Calculation take in sense alignment of the allocated
-- memory segments to use memory effectively by Append/Insert/etc
-- operations.
------------------
-- Aligned_Size --
------------------
function Aligned_Size
(Size : Utf16_String_Index) return Utf16_String_Index
is
Static_Size : constant Utf16_String_Index
:= (Shared_Empty'Size - Code_Unit_16'Size * (Shared_Empty.Capacity + 1))
/ Code_Unit_16'Size;
-- Total size of all static components in Code_Unit_16 units.
pragma Assert
((Shared_Empty'Size - Code_Unit_16'Size * (Shared_Empty.Capacity + 1))
mod Code_Unit_16'Size = 0);
-- Reminder must be zero to compute value correctly.
begin
return
(((Static_Size + Size + Size / Growth_Factor)
/ Min_Mul_Alloc + 1) * Min_Mul_Alloc - Static_Size);
end Aligned_Size;
--------------
-- Allocate --
--------------
function Allocate
(Size : Matreshka.Internals.Utf16.Utf16_String_Index)
return not null Shared_String_Access
is
pragma Assert (Size /= 0);
begin
return new Shared_String (Aligned_Size (Size) - 1);
end Allocate;
-------------------
-- Can_Be_Reused --
-------------------
function Can_Be_Reused
(Self : not null Shared_String_Access;
Size : Matreshka.Internals.Utf16.Utf16_String_Index) return Boolean is
begin
return
Self /= Shared_Empty'Access
and Self.Capacity > Size
and Matreshka.Atomics.Counters.Is_One (Self.Counter);
end Can_Be_Reused;
-----------------------
-- Compute_Index_Map --
-----------------------
procedure Compute_Index_Map (Self : in out Shared_String) is
pragma Assert (Self.Length /= 0);
Map : Index_Map_Access := Self.Index_Map;
Current : Utf16_String_Index := 0;
begin
-- Calculate index map if it is unavailable for now.
if Map = null then
Map := new Index_Map (Utf16_String_Index (Self.Length) - 1);
for J in Map.Map'Range loop
Map.Map (J) := Current;
if Self.Value (Current) in High_Surrogate_Utf16_Code_Unit then
Current := Current + 2;
else
Current := Current + 1;
end if;
end loop;
if not Test_And_Set (Self.Index_Map, null, Map) then
-- Operation can fail if mapping has been calculated by
-- another thread. In this case computed result is
-- dropped, memory freed and already calculated mapping
-- is reused.
Free (Map);
end if;
end if;
end Compute_Index_Map;
-----------------
-- Dereference --
-----------------
procedure Dereference (Self : in out Shared_Sort_Key_Access) is
pragma Assert (Self /= null);
pragma Suppress (Access_Check);
begin
if Self /= Shared_Empty_Key'Access
and then Matreshka.Atomics.Counters.Decrement (Self.Counter)
then
Free (Self);
end if;
Self := null;
end Dereference;
-----------------
-- Dereference --
-----------------
procedure Dereference (Self : in out Shared_String_Access) is
pragma Assert (Self /= null);
pragma Suppress (Access_Check);
begin
if Self /= Shared_Empty'Access
and then Matreshka.Atomics.Counters.Decrement (Self.Counter)
then
Free (Self.Index_Map);
Free (Self);
end if;
Self := null;
end Dereference;
----------
-- Hash --
----------
function Hash
(Self : not null Shared_String_Access) return League.Hash_Type
is
use type League.Hash_Type;
M : constant League.Hash_Type := 16#5BD1E995#;
H : League.Hash_Type := League.Hash_Type (Self.Length);
K : league.Hash_Type;
C : Code_Unit_32;
Index : Utf16_String_Index := 0;
begin
while Index < Self.Unused loop
Unchecked_Next (Self.Value, Index, C);
K := League.Hash_Type (C) * M;
K := K xor (K / 16#1000000#);
K := K * M;
H := H * M;
H := H xor K;
end loop;
H := H xor (H / 16#2000#);
H := H * M;
H := H xor (H / 16#8000#);
return H;
end Hash;
------------
-- Mutate --
------------
procedure Mutate
(Self : in out not null Shared_String_Access;
Size : Matreshka.Internals.Utf16.Utf16_String_Index)
is
pragma Assert (Size /= 0);
-- Limitation of current implementation.
begin
if not Can_Be_Reused (Self, Size) then
-- Shared string cann't be reused for some reason, new string is
-- allocated and existing data is copied.
declare
Old : Shared_String_Access := Self;
begin
Self := Allocate (Size);
Self.Value (0 .. Old.Unused) := Old.Value (0 .. Old.Unused);
Self.Unused := Old.Unused;
Self.Length := Old.Length;
String_Handler.Fill_Null_Terminator (Self);
Dereference (Old);
end;
else
-- Shared string can be reused, but index map must be deallocated to
-- prepare shared string for modification.
Free (Self.Index_Map);
end if;
end Mutate;
---------------
-- Reference --
---------------
procedure Reference (Self : not null Shared_Sort_Key_Access) is
begin
if Self /= Shared_Empty_Key'Access then
Matreshka.Atomics.Counters.Increment (Self.Counter);
end if;
end Reference;
---------------
-- Reference --
---------------
procedure Reference (Self : not null Shared_String_Access) is
begin
if Self /= Shared_Empty'Access then
Matreshka.Atomics.Counters.Increment (Self.Counter);
end if;
end Reference;
end Matreshka.Internals.Strings;
|
OutlawsLib/antlr/InfParser.g4 | Zbyl/OutlawsX | 2 | 5330 | <filename>OutlawsLib/antlr/InfParser.g4
parser grammar InfParser;
options { tokenVocab = InfLexer; }
inf_file : INF inf_version=float_
LEVELNAME_COLON levelName=STR
ITEMS numItems=INT
item*
EOF
;
item : ITEM_COLON itemType=(LEVEL | SECTOR | LINE)
NAME_COLON itemName=ID
(NUM_COLON wallName=WALLID)?
SEQ class_* SEQEND
;
class_ : CLASS_COLON classType=(ELEVATOR | TRIGGER) className=ID
classElement*
;
classElement : sound_
| center_
| speed_
| angle_
| slave_
| stop_
| master_
| eventMask_
| event_
| entityMask_
| start_
| key_
| flags_
| objectMask_
| object_
| objectExclude_
| client_
| triggerMessage
| elevatorMessage
;
sound_ : SOUND_COLON soundEvent=INT soundName=ID ;
center_ : CENTER_COLON centerX=float_ centerZ=float_ ;
speed_ : SPEED_COLON speed=float_ ;
angle_ : ANGLE_COLON angle=float_ ;
slave_ : SLAVE_COLON slaveName=ID ;
stop_ : STOP_COLON stopValue=float_ (stopTime=INT | stopKind=(HOLD | TERMINATE | COMPLETE) )?
| STOP_COLON AT stopValue=float_ (stopTime=INT | stopKind=(HOLD | TERMINATE | COMPLETE) )?
| STOP_COLON sectorName=ID stopValue=float_ (hold=HOLD | stopTime=INT)?
;
master_ : MASTER_COLON masterSwitch=(ON | OFF) ;
eventMask_ : EVENT_MASK_COLON eventMask=(INT | STAR) ;
event_ : EVENT_COLON event=INT ;
entityMask_ : ENTITY_MASK_COLON entityMask=(INT | STAR) ;
start_ : START_COLON start=INT ;
key_ : KEY_COLON key=(RED | BLUE | YELLOW) ;
flags_ : FLAGS_COLON flags=INT ;
objectMask_ : OBJECT_MASK_COLON objectMask=INT ;
object_ : OBJECT_COLON obj0=INT obj1=INT AUTO? ;
objectExclude_ : OBJECT_EXCLUDE_COLON obj0=INT AUTO? ;
client_ : CLIENT_COLON client=clientId ;
triggerMessage : MESSAGE_COLON message ;
elevatorMessage : MESSAGE_COLON stopIdx=INT client=clientId message ;
clientId : ID
| ID OPEN_PAREN wallName=WALLID CLOSE_PAREN
| SYSTEM
;
message : m_trigger
| goto_stop
| next_stop
| prev_stop
| master_on
| master_off
| clear_bits
| set_bits
| complete
| done
| wakeup
| lights
| user_msg
;
m_trigger : messageName=(M_TRIGGER | M_TRIGGER_SMALL) (eventValue=INT)? ;
goto_stop : messageName=(GOTO_STOP | GOTO_STOP_SMALL) stopIdx=INT ;
next_stop : messageName=(NEXT_STOP | NEXT_STOP_SMALL) (eventValue=INT)? ;
prev_stop : messageName=(PREV_STOP | PREV_STOP_SMALL) (eventValue=INT)? ;
master_on : messageName=(MASTER_ON | MASTER_ON_SMALL) (eventValue=INT)? ;
master_off : messageName=(MASTER_OFF | MASTER_OFF_SMALL) (eventValue=INT)? ;
clear_bits : messageName=(CLEAR_BITS | CLEAR_BITS_SMALL) flagNumber=INT bitNumber=INT ;
set_bits : messageName=(SET_BITS | SET_BITS_SMALL) flagNumber=INT bitNumber=INT ;
complete : messageName=(COMPLETE | COMPLETE_SMALL) goalNumber=INT ;
done : messageName=(DONE | DONE_SMALL) ;
wakeup : messageName=(WAKEUP | WAKEUP_SMALL) ;
lights : messageName=(LIGHTS | LIGHTS_SMALL) ;
user_msg : messageName=(USER_MSG | USER_MSG_SMALL) msgNumber=INT ;
float_ : INT | FLOAT ;
|
oeis/206/A206154.asm | neoneye/loda-programs | 11 | 85248 | <filename>oeis/206/A206154.asm
; A206154: a(n) = Sum_{k=0..n} binomial(n,k)^(k+2).
; Submitted by <NAME>
; 1,2,10,110,2386,125752,14921404,3697835668,2223231412546,3088517564289836,9040739066816429380,63462297965044771663708,1064766030857977088480630740,37863276208844960432962611293828,3144384748384240804260912067907833280
lpb $0
sub $0,1
add $2,1
mov $3,$0
add $3,$2
bin $3,$2
add $2,2
pow $3,$2
add $1,$3
sub $2,2
lpe
add $1,1
mov $0,$1
|
This segment calculates the gcd of 3 and 5 and puts it in AX/mycode1.asm | Farhad-00009/Micro-Lab | 0 | 172819 | MOV AX,5
MOV BX,3
TOP:
XOR DX,DX
DIV BX
MOV AX,DX
MOV BX,DX
CMP DX,0
JNZ TOP
HLT |
programs/oeis/329/A329320.asm | neoneye/loda | 22 | 89313 | ; A329320: a(n) = Sum_{k=0..floor(log_2(n))} 1 - A035263(1 + floor(n/2^k)).
; 0,1,1,1,1,2,1,2,1,2,2,2,1,2,2,2,1,2,2,2,2,3,2,3,1,2,2,2,2,3,2,3,1,2,2,2,2,3,2,3,2,3,3,3,2,3,3,3,1,2,2,2,2,3,2,3,2,3,3,3,2,3,3,3,1,2,2,2,2,3,2,3,2,3,3,3,2,3,3,3,2,3,3,3,3,4,3,4,2,3,3,3,3,4,3,4,1,2,2,2
lpb $0
lpb $0
dif $0,2
lpe
div $0,4
add $1,1
lpe
mov $0,$1
|
src/title_screen.ads | Fabien-Chouteau/motherlode | 2 | 23326 | <filename>src/title_screen.ads
-- Motherlode
-- Copyright (c) 2020 <NAME>
package Title_Screen is
procedure Run;
end Title_Screen;
|
Get current page number & version number.applescript | AlexanderGalen/applescripts | 3 | 3625 | <filename>Get current page number & version number.applescript
tell application "QuarkXPress"
set x to selection as text
tell document 1
set CurrentPage to page number of current page
end tell
end tell
set VersionNumber to x + 1
tell application "Keyboard Maestro Engine"
make variable with properties {name:"Version Number", value:VersionNumber}
make variable with properties {name:"Current Page", value:CurrentPage}
end tell |
connect.ada | mmuhammadmms/CookWeeb | 0 | 26035 | <reponame>mmuhammadmms/CookWeeb
<html>
<head>
<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
</head>
<body>
<?php
$serverName = "localhost";
$userName = "root";
$userPassword = "";
$dbName = "cookweeb";
$conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
if (mysqli_connect_errno())
{
echo "Database Connect Failed : " . mysqli_connect_error();
}
else
{
echo "Database Connected.";
}
?>
</body>
</html> |
src/port_specification-buildsheet.adb | jrmarino/ravenadm | 18 | 27443 | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with Definitions; use Definitions;
with Ada.Characters.Latin_1;
with Ada.Directories;
with Ada.Text_IO;
with Ada.Exceptions;
with Package_Manifests;
with File_Operations;
with Utilities;
package body Port_Specification.Buildsheet is
package TIO renames Ada.Text_IO;
package DIR renames Ada.Directories;
package LAT renames Ada.Characters.Latin_1;
package MAN renames Package_Manifests;
package FOP renames File_Operations;
package UTL renames Utilities;
package EX renames Ada.Exceptions;
--------------------------------------------------------------------------------------------
-- generator
--------------------------------------------------------------------------------------------
procedure generator
(specs : Portspecs;
ravensrcdir : String;
output_file : String)
is
package crate is new CON.Vectors (Index_Type => Positive,
Element_Type => HT.Text,
"=" => HT.SU."=");
package local_sorter is new crate.Generic_Sorting ("<" => HT.SU."<");
procedure send (data : String; use_put : Boolean := False);
procedure send (varname : String; value, default : Integer);
procedure send (varname, value : String);
procedure send (varname : String; value : HT.Text);
procedure send (varname : String; crate : string_crate.Vector; flavor : Positive);
procedure send (varname : String; crate : def_crate.Map);
procedure send (varname : String; crate : list_crate.Map; flavor : Positive);
procedure send (varname : String; value : Boolean; show_when : Boolean);
procedure send_options;
procedure send_targets;
procedure send_descriptions;
procedure send_scripts;
procedure send_manifests;
procedure send_download_groups;
procedure print_item (position : string_crate.Cursor);
procedure print_item40 (position : string_crate.Cursor);
procedure print_straight (position : string_crate.Cursor);
procedure print_adjacent (position : string_crate.Cursor);
procedure print_adjacent_nowrap (position : string_crate.Cursor);
procedure dump_vardesc (position : string_crate.Cursor);
procedure dump_vardesc2 (position : string_crate.Cursor);
procedure dump_manifest (position : string_crate.Cursor);
procedure dump_manifest2 (position : string_crate.Cursor);
procedure dump_sdesc (position : def_crate.Cursor);
procedure dump_subpkgs (position : list_crate.Cursor);
procedure dump_optgroup (position : list_crate.Cursor);
procedure dump_distfiles (position : string_crate.Cursor);
procedure dump_targets (position : list_crate.Cursor);
procedure dump_helper (option_name : String; crate : string_crate.Vector; helper : String);
procedure expand_option_record (position : option_crate.Cursor);
procedure blank_line;
procedure send_file (filename : String);
procedure send_plist (filename : String);
procedure send_directory (dirname : String; pattern : String := "");
procedure send_catchall;
write_to_file : constant Boolean := (output_file /= "");
makefile_handle : TIO.File_Type;
varname_prefix : HT.Text;
save_variant : HT.Text;
current_len : Natural;
currently_blank : Boolean := True;
desc_prefix : constant String := "descriptions/desc.";
plist_prefix : constant String := "manifests/plist.";
distinfo : constant String := "distinfo";
temp_storage : string_crate.Vector;
procedure send (data : String; use_put : Boolean := False) is
begin
if write_to_file then
if use_put then
TIO.Put (makefile_handle, data);
else
TIO.Put_Line (makefile_handle, data);
end if;
else
if use_put then
TIO.Put (data);
else
TIO.Put_Line (data);
end if;
end if;
if data /= "" then
currently_blank := False;
end if;
end send;
procedure send (varname, value : String) is
begin
if value /= "" then
send (align24 (varname & LAT.Equals_Sign) & value);
end if;
end send;
procedure send (varname : String; value : HT.Text) is
begin
if not HT.IsBlank (value) then
send (align24 (varname & LAT.Equals_Sign) & HT.USS (value));
end if;
end send;
procedure send (varname : String; value, default : Integer) is
begin
if value /= default then
send (align24 (varname & LAT.Equals_Sign) & HT.int2str (value));
end if;
end send;
procedure send (varname : String; crate : string_crate.Vector; flavor : Positive) is
begin
if crate.Is_Empty then
return;
end if;
case flavor is
when 1 =>
send (align24 (varname & "="), True);
crate.Iterate (Process => print_item'Access);
when 2 =>
current_len := 0;
send (align24 (varname & "="), True);
crate.Iterate (Process => print_adjacent'Access);
send ("");
when 3 =>
varname_prefix := HT.SUS (varname);
crate.Iterate (Process => dump_distfiles'Access);
when 4 =>
current_len := 0;
send (align24 (varname & "="), True);
crate.Iterate (Process => print_adjacent_nowrap'Access);
send ("");
when others =>
null;
end case;
end send;
procedure send (varname : String; crate : def_crate.Map) is
begin
varname_prefix := HT.SUS (varname);
crate.Iterate (Process => dump_sdesc'Access);
end send;
procedure send (varname : String; crate : list_crate.Map; flavor : Positive) is
begin
varname_prefix := HT.SUS (varname);
case flavor is
when 4 =>
crate.Iterate (Process => dump_subpkgs'Access);
when 5 =>
crate.Iterate (Process => dump_optgroup'Access);
when others =>
null;
end case;
end send;
procedure send (varname : String; value : Boolean; show_when : Boolean) is
begin
if value = show_when then
send (align24 (varname & LAT.Equals_Sign) & "yes");
end if;
end send;
procedure print_item (position : string_crate.Cursor)
is
index : Natural := string_crate.To_Index (position);
item : String := HT.USS (string_crate.Element (position));
begin
if index = 1 then
send (item);
else
send (LAT.HT & LAT.HT & LAT.HT & item);
end if;
end print_item;
procedure print_item40 (position : string_crate.Cursor)
is
index : Natural := string_crate.To_Index (position);
item : String := HT.USS (string_crate.Element (position));
begin
if index = 1 then
send (item);
else
send (LAT.HT & LAT.HT & LAT.HT & LAT.HT & LAT.HT & item);
end if;
end print_item40;
procedure print_adjacent (position : string_crate.Cursor)
is
index : Natural := string_crate.To_Index (position);
item : String := HT.USS (string_crate.Element (position));
len : Natural := item'Length;
begin
-- Try to hit 75 chars
-- 76 - 24 = 52
if current_len + len + 1 > 52 then
current_len := 0;
send ("");
send (LAT.HT & LAT.HT & LAT.HT, True);
end if;
if current_len > 0 then
send (" ", True);
current_len := current_len + 1;
end if;
send (item, True);
current_len := current_len + len;
end print_adjacent;
procedure print_adjacent_nowrap (position : string_crate.Cursor)
is
index : Natural := string_crate.To_Index (position);
item : String := HT.USS (string_crate.Element (position));
len : Natural := item'Length;
begin
if current_len > 0 then
send (" ", True);
current_len := current_len + 1;
end if;
send (item, True);
current_len := current_len + len;
end print_adjacent_nowrap;
procedure print_straight (position : string_crate.Cursor)
is
item : String := HT.USS (string_crate.Element (position));
begin
send (item);
end print_straight;
procedure dump_sdesc (position : def_crate.Cursor)
is
varname : String := HT.USS (varname_prefix) & LAT.Left_Square_Bracket &
HT.USS (def_crate.Key (position)) & LAT.Right_Square_Bracket & LAT.Equals_Sign;
begin
send (align24 (varname) & HT.USS (def_crate.Element (position)));
end dump_sdesc;
procedure dump_subpkgs (position : list_crate.Cursor)
is
rec : group_list renames list_crate.Element (position);
varname : String := HT.USS (varname_prefix) & LAT.Left_Square_Bracket &
HT.USS (rec.group) & LAT.Right_Square_Bracket & LAT.Equals_Sign;
begin
if not rec.list.Is_Empty then
send (align24 (varname), True);
rec.list.Iterate (Process => print_item'Access);
end if;
end dump_subpkgs;
procedure dump_optgroup (position : list_crate.Cursor)
is
rec : group_list renames list_crate.Element (position);
varname : String := HT.USS (varname_prefix) & LAT.Left_Square_Bracket &
HT.USS (rec.group) & LAT.Right_Square_Bracket & LAT.Equals_Sign;
begin
if not rec.list.Is_Empty then
current_len := 0;
send (align24 (varname), True);
rec.list.Iterate (Process => print_adjacent'Access);
send ("");
end if;
end dump_optgroup;
procedure dump_distfiles (position : string_crate.Cursor)
is
index : Natural := string_crate.To_Index (position);
NDX : String := HT.USS (varname_prefix) & LAT.Left_Square_Bracket &
HT.int2str (index) & LAT.Right_Square_Bracket & LAT.Equals_Sign;
begin
send (align24 (NDX) & HT.USS (string_crate.Element (position)));
end dump_distfiles;
procedure blank_line is
begin
if not currently_blank then
send ("");
end if;
currently_blank := True;
end blank_line;
procedure send_targets is
begin
specs.make_targets.Iterate (Process => dump_targets'Access);
end send_targets;
procedure dump_targets (position : list_crate.Cursor)
is
rec : group_list renames list_crate.Element (position);
target : String := HT.USS (rec.group) & LAT.Colon;
begin
blank_line;
send (target);
rec.list.Iterate (Process => print_straight'Access);
end dump_targets;
procedure dump_helper (option_name : String; crate : string_crate.Vector; helper : String)
is
begin
if not crate.Is_Empty then
send (align40 (LAT.Left_Square_Bracket & option_name & "]." &
helper & LAT.Equals_Sign), True);
crate.Iterate (Process => print_item40'Access);
end if;
end dump_helper;
procedure expand_option_record (position : option_crate.Cursor)
is
rec : Option_Helper renames option_crate.Element (position);
name : String := HT.USS (rec.option_name);
begin
blank_line;
if not HT.IsBlank (rec.option_description) then
send (align40 (LAT.Left_Square_Bracket & name & "].DESCRIPTION=") &
HT.USS (rec.option_description));
end if;
if not HT.IsBlank (rec.BROKEN_ON) then
send (align40 (LAT.Left_Square_Bracket & name & "].BROKEN_ON=") &
HT.USS (rec.BROKEN_ON));
end if;
dump_helper (name, rec.BUILDRUN_DEPENDS_OFF, "BUILDRUN_DEPENDS_OFF");
dump_helper (name, rec.BUILDRUN_DEPENDS_ON, "BUILDRUN_DEPENDS_ON");
dump_helper (name, rec.BUILD_DEPENDS_OFF, "BUILD_DEPENDS_OFF");
dump_helper (name, rec.BUILD_DEPENDS_ON, "BUILD_DEPENDS_ON");
dump_helper (name, rec.BUILD_TARGET_OFF, "BUILD_TARGET_OFF");
dump_helper (name, rec.BUILD_TARGET_ON, "BUILD_TARGET_ON");
dump_helper (name, rec.CFLAGS_OFF, "CFLAGS_OFF");
dump_helper (name, rec.CFLAGS_ON, "CFLAGS_ON");
dump_helper (name, rec.CMAKE_ARGS_OFF, "CMAKE_ARGS_OFF");
dump_helper (name, rec.CMAKE_ARGS_ON, "CMAKE_ARGS_ON");
dump_helper (name, rec.CMAKE_BOOL_T_BOTH, "CMAKE_BOOL_T_BOTH");
dump_helper (name, rec.CMAKE_BOOL_F_BOTH, "CMAKE_BOOL_F_BOTH");
dump_helper (name, rec.CONFIGURE_ARGS_OFF, "CONFIGURE_ARGS_OFF");
dump_helper (name, rec.CONFIGURE_ARGS_ON, "CONFIGURE_ARGS_ON");
dump_helper (name, rec.CONFIGURE_ENABLE_BOTH, "CONFIGURE_ENABLE_BOTH");
dump_helper (name, rec.CONFIGURE_ENV_OFF, "CONFIGURE_ENV_OFF");
dump_helper (name, rec.CONFIGURE_ENV_ON, "CONFIGURE_ENV_ON");
dump_helper (name, rec.CONFIGURE_WITH_BOTH, "CONFIGURE_WITH_BOTH");
dump_helper (name, rec.CPPFLAGS_OFF, "CPPFLAGS_OFF");
dump_helper (name, rec.CPPFLAGS_ON, "CPPFLAGS_ON");
dump_helper (name, rec.CXXFLAGS_OFF, "CXXFLAGS_OFF");
dump_helper (name, rec.CXXFLAGS_ON, "CXXFLAGS_ON");
dump_helper (name, rec.DF_INDEX_OFF, "DF_INDEX_OFF");
dump_helper (name, rec.DF_INDEX_ON, "DF_INDEX_ON");
dump_helper (name, rec.EXTRACT_ONLY_OFF, "EXTRACT_ONLY_OFF");
dump_helper (name, rec.EXTRACT_ONLY_ON, "EXTRACT_ONLY_ON");
dump_helper (name, rec.EXTRA_PATCHES_OFF, "EXTRA_PATCHES_OFF");
dump_helper (name, rec.EXTRA_PATCHES_ON, "EXTRA_PATCHES_ON");
dump_helper (name, rec.GNOME_COMPONENTS_OFF, "GNOME_COMPONENTS_OFF");
dump_helper (name, rec.GNOME_COMPONENTS_ON, "GNOME_COMPONENTS_ON");
dump_helper (name, rec.IMPLIES_ON, "IMPLIES_ON");
dump_helper (name, rec.INFO_OFF, "INFO_OFF");
dump_helper (name, rec.INFO_ON, "INFO_ON");
dump_helper (name, rec.INSTALL_TARGET_OFF, "INSTALL_TARGET_OFF");
dump_helper (name, rec.INSTALL_TARGET_ON, "INSTALL_TARGET_ON");
dump_helper (name, rec.KEYWORDS_OFF, "KEYWORDS_OFF");
dump_helper (name, rec.KEYWORDS_ON, "KEYWORDS_ON");
dump_helper (name, rec.LDFLAGS_OFF, "LDFLAGS_OFF");
dump_helper (name, rec.LDFLAGS_ON, "LDFLAGS_ON");
dump_helper (name, rec.MAKEFILE_OFF, "MAKEFILE_OFF");
dump_helper (name, rec.MAKEFILE_ON, "MAKEFILE_ON");
dump_helper (name, rec.MAKE_ARGS_OFF, "MAKE_ARGS_OFF");
dump_helper (name, rec.MAKE_ARGS_ON, "MAKE_ARGS_ON");
dump_helper (name, rec.MAKE_ENV_OFF, "MAKE_ENV_OFF");
dump_helper (name, rec.MAKE_ENV_ON, "MAKE_ENV_ON");
dump_helper (name, rec.ONLY_FOR_OPSYS_ON, "ONLY_FOR_OPSYS_ON");
dump_helper (name, rec.PATCHFILES_OFF, "PATCHFILES_OFF");
dump_helper (name, rec.PATCHFILES_ON, "PATCHFILES_ON");
dump_helper (name, rec.PLIST_SUB_OFF, "PLIST_SUB_OFF");
dump_helper (name, rec.PLIST_SUB_ON, "PLIST_SUB_ON");
dump_helper (name, rec.PHP_EXTENSIONS_OFF, "PHP_EXTENSIONS_OFF");
dump_helper (name, rec.PHP_EXTENSIONS_ON, "PHP_EXTENSIONS_ON");
dump_helper (name, rec.PREVENTS_ON, "PREVENTS_ON");
dump_helper (name, rec.QMAKE_ARGS_OFF, "QMAKE_ARGS_OFF");
dump_helper (name, rec.QMAKE_ARGS_ON, "QMAKE_ARGS_ON");
dump_helper (name, rec.RUN_DEPENDS_OFF, "RUN_DEPENDS_OFF");
dump_helper (name, rec.RUN_DEPENDS_ON, "RUN_DEPENDS_ON");
dump_helper (name, rec.SUB_FILES_OFF, "SUB_FILES_OFF");
dump_helper (name, rec.SUB_FILES_ON, "SUB_FILES_ON");
dump_helper (name, rec.SUB_LIST_OFF, "SUB_LIST_OFF");
dump_helper (name, rec.SUB_LIST_ON, "SUB_LIST_ON");
dump_helper (name, rec.TEST_TARGET_OFF, "TEST_TARGET_OFF");
dump_helper (name, rec.TEST_TARGET_ON, "TEST_TARGET_ON");
dump_helper (name, rec.USES_OFF, "USES_OFF");
dump_helper (name, rec.USES_ON, "USES_ON");
dump_helper (name, rec.XORG_COMPONENTS_OFF, "XORG_COMPONENTS_OFF");
dump_helper (name, rec.XORG_COMPONENTS_ON, "XORG_COMPONENTS_ON");
end expand_option_record;
procedure send_options is
begin
specs.ops_helpers.Iterate (Process => expand_option_record'Access);
end send_options;
procedure send_file (filename : String)
is
abspath : constant String := ravensrcdir & "/" & filename;
begin
if DIR.Exists (abspath) then
declare
contents : constant String := FOP.get_file_contents (abspath);
begin
blank_line;
send ("[FILE:" & HT.int2str (contents'Length) & LAT.Colon & filename &
LAT.Right_Square_Bracket);
send (contents);
end;
end if;
end send_file;
procedure send_plist (filename : String)
is
abspath : constant String := ravensrcdir & "/" & filename;
begin
if DIR.Exists (abspath) then
declare
contents : constant String := MAN.compress_manifest (MAN.Filename (abspath));
begin
blank_line;
send ("[FILE:" & HT.int2str (contents'Length) & LAT.Colon & filename &
LAT.Right_Square_Bracket);
send (contents);
end;
end if;
end send_plist;
procedure dump_vardesc2 (position : string_crate.Cursor)
is
item : HT.Text renames string_crate.Element (position);
subpkg : String := HT.USS (item);
begin
send_file (desc_prefix & subpkg & LAT.Full_Stop & HT.USS (varname_prefix));
if DIR.Exists (ravensrcdir & "/" & desc_prefix & subpkg) and then
not temp_storage.Contains (item)
then
temp_storage.Append (item);
send_file (desc_prefix & subpkg);
end if;
end dump_vardesc2;
procedure dump_vardesc (position : string_crate.Cursor) is
begin
varname_prefix := string_crate.Element (position);
specs.subpackages.Element (varname_prefix).list.Iterate (dump_vardesc2'Access);
end dump_vardesc;
procedure send_descriptions is
begin
specs.variants.Iterate (Process => dump_vardesc'Access);
temp_storage.Clear;
end send_descriptions;
procedure send_scripts
is
function get_phasestr (index : Positive) return String;
function get_prefix (index : Positive) return String;
function get_phasestr (index : Positive) return String is
begin
case index is
when 1 => return "fetch";
when 2 => return "extract";
when 3 => return "patch";
when 4 => return "configure";
when 5 => return "build";
when 6 => return "install";
when others => return "";
end case;
end get_phasestr;
function get_prefix (index : Positive) return String is
begin
case index is
when 1 => return "pre-";
when 2 => return "post-";
when others => return "";
end case;
end get_prefix;
begin
for phase in Positive range 1 .. 6 loop
for prefix in Positive range 1 .. 2 loop
declare
target : String := get_prefix (prefix) & get_phasestr (phase) & "-script";
begin
send_file ("scripts/" & target);
end;
end loop;
end loop;
end send_scripts;
procedure send_directory (dirname : String; pattern : String := "")
is
procedure dump_file (cursor : string_crate.Cursor);
Search : DIR.Search_Type;
Dir_Ent : DIR.Directory_Entry_Type;
bucket : string_crate.Vector;
abspath : constant String := ravensrcdir & "/" & dirname;
filter : constant DIR.Filter_Type := (DIR.Directory => False,
DIR.Ordinary_File => True,
DIR.Special_File => False);
procedure dump_file (cursor : string_crate.Cursor)
is
filename : String := HT.USS (string_crate.Element (cursor));
begin
send_file (dirname & "/" & filename);
end dump_file;
begin
if not DIR.Exists (abspath) then
return;
end if;
DIR.Start_Search (Search => Search,
Directory => abspath,
Pattern => pattern,
Filter => filter);
while DIR.More_Entries (Search => Search) loop
DIR.Get_Next_Entry (Search => Search, Directory_Entry => Dir_Ent);
bucket.Append (HT.SUS (DIR.Simple_Name (Dir_Ent)));
end loop;
DIR.End_Search (Search);
sorter.Sort (Container => bucket);
bucket.Iterate (Process => dump_file'Access);
end send_directory;
procedure dump_manifest2 (position : string_crate.Cursor)
is
item : HT.Text renames string_crate.Element (position);
subpkg : String := HT.USS (item);
fullkey : HT.Text;
shortlist : String := plist_prefix & subpkg;
fullplist : String := shortlist & "." & HT.USS (save_variant);
begin
if DIR.Exists (ravensrcdir & "/" & fullplist) then
fullkey := HT.SUS (subpkg & "." & HT.USS (save_variant));
if not temp_storage.Contains (fullkey) then
temp_storage.Append (fullkey);
send_plist (fullplist);
end if;
else
if DIR.Exists (ravensrcdir & "/" & shortlist) and then
not temp_storage.Contains (item)
then
temp_storage.Append (item);
send_plist (shortlist);
end if;
end if;
end dump_manifest2;
procedure dump_manifest (position : string_crate.Cursor)
is
variant : HT.Text renames string_crate.Element (position);
begin
save_variant := variant;
specs.subpackages.Element (variant).list.Iterate (dump_manifest2'Access);
end dump_manifest;
procedure send_manifests
is
-- Manifests are subpackage-based
-- Not having a subpackage manifest is ok.
-- Subpackages typically missing: docs, examples, complete (Metaport)
begin
specs.variants.Iterate (Process => dump_manifest'Access);
temp_storage.Clear;
end send_manifests;
procedure send_download_groups
is
-- The first group must be either "main" or "none"
procedure gather (position : list_crate.Cursor);
procedure dump_groups (position : crate.Cursor);
procedure dump_sites (position : crate.Cursor);
num_groups : constant Natural := Natural (specs.dl_sites.Length);
first_one : constant String := HT.USS (list_crate.Element (specs.dl_sites.First).group);
groups : crate.Vector;
gcounter : Natural := 0;
procedure dump_groups (position : crate.Cursor)
is
index : HT.Text renames crate.Element (position);
rec : group_list renames specs.dl_sites.Element (index);
site : constant String := HT.USS (rec.group);
begin
gcounter := gcounter + 1;
if gcounter = 1 then
send (site, True);
else
send (" " & site, True);
end if;
end dump_groups;
procedure dump_sites (position : crate.Cursor)
is
index : HT.Text renames crate.Element (position);
rec : group_list renames specs.dl_sites.Element (index);
vname : String := "SITES[" & HT.USS (rec.group) & "]=";
begin
if not rec.list.Is_Empty then
send (align24 (vname), True);
rec.list.Iterate (Process => print_item'Access);
end if;
end dump_sites;
procedure gather (position : list_crate.Cursor)
is
name : HT.Text renames list_crate.Key (position);
begin
if not HT.equivalent (name, dlgroup_main) then
groups.Append (name);
end if;
end gather;
begin
send (align24 ("DOWNLOAD_GROUPS="), True);
if num_groups = 1 and then
first_one = dlgroup_none
then
send (dlgroup_none, False);
-- no SITES entry in this case
else
specs.dl_sites.Iterate (gather'Access);
local_sorter.Sort (Container => groups);
if specs.dl_sites.Contains (HT.SUS (dlgroup_main)) then
groups.Prepend (HT.SUS (dlgroup_main));
end if;
groups.Iterate (Process => dump_groups'Access);
send ("");
-- list SITES entries in same order
groups.Iterate (Process => dump_sites'Access);
end if;
end send_download_groups;
procedure send_catchall
is
procedure scan (position : list_crate.Cursor);
procedure putout (position : string_crate.Cursor);
temp_storage : string_crate.Vector;
procedure scan (position : list_crate.Cursor)
is
rec : group_list renames list_crate.Element (position);
begin
temp_storage.Append (rec.group);
end scan;
procedure putout (position : string_crate.Cursor)
is
text_value : HT.Text renames string_crate.Element (position);
begin
send (align24 (HT.USS (text_value) & "="), True);
specs.catch_all.Element (text_value).list.Iterate (print_item'Access);
end putout;
begin
specs.catch_all.Iterate (scan'Access);
sorter.Sort (temp_storage);
temp_storage.Iterate (putout'Access);
end send_catchall;
begin
if write_to_file then
TIO.Create (File => makefile_handle,
Mode => TIO.Out_File,
Name => output_file);
end if;
send ("# Buildsheet autogenerated by ravenadm tool -- Do not edit." & LAT.LF);
send ("NAMEBASE", specs.namebase);
send ("VERSION", specs.version);
send ("REVISION", specs.revision, 0);
send ("EPOCH", specs.epoch, 0);
send ("KEYWORDS", specs.keywords, 2);
send ("VARIANTS", specs.variants, 4);
send ("SDESC", specs.taglines);
send ("HOMEPAGE", specs.homepage);
send ("CONTACT", specs.contacts, 1);
blank_line;
send_download_groups;
send ("DISTFILE", specs.distfiles, 3);
send ("DIST_SUBDIR", specs.dist_subdir);
send ("DF_INDEX", specs.df_index, 2);
send ("SPKGS", specs.subpackages, 4);
blank_line;
send ("OPTIONS_AVAILABLE", specs.ops_avail, 2);
send ("OPTIONS_STANDARD", specs.ops_standard, 2);
send ("OPTGROUP_RADIO", specs.opt_radio, 2);
send ("OPTGROUP_RESTRICTED", specs.opt_restrict, 2);
send ("OPTGROUP_UNLIMITED", specs.opt_unlimited, 2);
send ("OPTDESCR", specs.optgroup_desc, 4);
send ("OPTGROUP", specs.optgroups, 5);
send ("VOPTS", specs.variantopts, 5);
send ("OPT_ON", specs.options_on, 5);
blank_line;
send ("BROKEN", specs.broken, 4);
send ("BROKEN_SSL", specs.broken_ssl, 2);
send ("BROKEN_MYSQL", specs.broken_mysql, 2);
send ("BROKEN_PGSQL", specs.broken_pgsql, 2);
send ("NOT_FOR_OPSYS", specs.exc_opsys, 2);
send ("ONLY_FOR_OPSYS", specs.inc_opsys, 2);
send ("NOT_FOR_ARCH", specs.exc_arch, 2);
send ("DEPRECATED", specs.deprecated);
send ("EXPIRATION_DATE", specs.expire_date);
blank_line;
send ("BUILD_DEPENDS", specs.build_deps, 1);
send ("BUILDRUN_DEPENDS", specs.buildrun_deps, 1);
send ("RUN_DEPENDS", specs.run_deps, 1);
send ("B_DEPS", specs.opsys_b_deps, 5);
send ("BR_DEPS", specs.opsys_br_deps, 5);
send ("R_DEPS", specs.opsys_r_deps, 5);
send ("EXRUN", specs.extra_rundeps, 4);
blank_line;
send ("USERS", specs.users, 2);
send ("GROUPS", specs.groups, 2);
send ("USERGROUP_SPKG", specs.usergroup_pkg);
blank_line;
send ("USES", specs.uses, 2);
send ("C_USES", specs.opsys_c_uses, 5);
send ("GNOME_COMPONENTS", specs.gnome_comps, 2);
send ("SDL_COMPONENTS", specs.sdl_comps, 2);
send ("XORG_COMPONENTS", specs.xorg_comps, 2);
send ("PHP_EXTENSIONS", specs.php_extensions, 2);
blank_line;
send ("DISTNAME", specs.distname);
send ("EXTRACT_DIRTY", specs.extract_dirty, 2);
send ("EXTRACT_ONLY", specs.extract_only, 2);
send ("EXTRACT_WITH_UNZIP", specs.extract_zip, 2);
send ("EXTRACT_WITH_7Z", specs.extract_7z, 2);
send ("EXTRACT_WITH_LHA", specs.extract_lha, 2);
send ("EXTRACT_DEB_PACKAGE", specs.extract_deb, 2);
send ("EXTRACT_HEAD", specs.extract_head, 4);
send ("EXTRACT_TAIL", specs.extract_tail, 4);
blank_line;
send ("LICENSE", specs.licenses, 2);
send ("LICENSE_TERMS", specs.lic_terms, 1);
send ("LICENSE_NAME", specs.lic_names, 1);
send ("LICENSE_FILE", specs.lic_files, 1);
send ("LICENSE_AWK", specs.lic_awk, 1);
send ("LICENSE_SOURCE", specs.lic_source, 1);
send ("LICENSE_SCHEME", specs.lic_scheme);
blank_line;
send ("PREFIX", specs.prefix);
send ("INFO", specs.info, 1);
send_catchall;
send ("GENERATED", specs.generated, True);
send ("SKIP_CCACHE", specs.skip_ccache, True);
blank_line;
send ("PATCH_WRKSRC", specs.patch_wrksrc);
send ("PATCHFILES", specs.patchfiles, 2);
send ("EXTRA_PATCHES", specs.extra_patches, 1);
send ("PATCH_STRIP", specs.patch_strip, 2);
send ("PATCHFILES_STRIP", specs.pfiles_strip, 2);
blank_line;
send ("INVALID_RPATH", specs.fatal_rpath, False);
send ("MUST_CONFIGURE", specs.config_must);
send ("GNU_CONFIGURE_PREFIX", specs.config_prefix);
send ("CONFIGURE_OUTSOURCE", specs.config_outsrc, True);
send ("CONFIGURE_WRKSRC", specs.config_wrksrc);
send ("CONFIGURE_SCRIPT", specs.config_script);
send ("CONFIGURE_TARGET", specs.config_target);
send ("CONFIGURE_ARGS", specs.config_args, 1);
send ("CONFIGURE_ENV", specs.config_env, 1);
blank_line;
send ("SKIP_BUILD", specs.skip_build, True);
send ("BUILD_WRKSRC", specs.build_wrksrc);
send ("BUILD_TARGET", specs.build_target, 2);
send ("MAKEFILE", specs.makefile);
send ("MAKE_ARGS", specs.make_args, 1);
send ("MAKE_ENV", specs.make_env, 1);
send ("DESTDIRNAME", specs.destdirname);
send ("DESTDIR_VIA_ENV", specs.destdir_env, True);
send ("MAKE_JOBS_NUMBER_LIMIT", specs.job_limit, 0);
send ("SINGLE_JOB", specs.single_job, True);
blank_line;
send ("SKIP_INSTALL", specs.skip_install, True);
send ("INSTALL_WRKSRC", specs.install_wrksrc);
send ("INSTALL_TARGET", specs.install_tgt, 2);
send ("INSTALL_REQ_TOOLCHAIN", specs.shift_install, True);
send ("MANDIRS", specs.mandirs, 1);
send ("SOVERSION", specs.soversion);
send ("PLIST_SUB", specs.plist_sub, 1);
send ("RC_SUBR", specs.subr_scripts, 1);
send ("SUB_FILES", specs.sub_files, 1);
send ("SUB_LIST", specs.sub_list, 1);
blank_line;
send ("REPOLOGY_SUCKS", specs.repology_sucks, True);
send ("BLOCK_WATCHDOG", specs.kill_watchdog, True);
send ("SET_DEBUGGING_ON", specs.debugging_on, True);
send ("CFLAGS", specs.cflags, 1);
send ("CXXFLAGS", specs.cxxflags, 1);
send ("CPPFLAGS", specs.cppflags, 1);
send ("LDFLAGS", specs.ldflags, 1);
send ("OPTIMIZER_LEVEL", specs.optimizer_lvl, 2);
send ("CMAKE_ARGS", specs.cmake_args, 1);
send ("QMAKE_ARGS", specs.qmake_args, 1);
send ("TEST_TARGET", specs.test_tgt, 2);
send ("TEST_ARGS", specs.test_args, 1);
send ("TEST_ENV", specs.test_env, 1);
send ("VAR_OPSYS", specs.var_opsys, 4);
send ("VAR_ARCH", specs.var_arch, 4);
send ("CARGO_SKIP_CONFIGURE", specs.cgo_skip_conf, True);
send ("CARGO_SKIP_BUILD", specs.cgo_skip_build, True);
send ("CARGO_SKIP_INSTALL", specs.cgo_skip_inst, True);
send ("CARGO_CONFIG_ARGS", specs.cgo_conf_args, 2);
send ("CARGO_BUILD_ARGS", specs.cgo_build_args, 2);
send ("CARGO_INSTALL_ARGS", specs.cgo_inst_args, 2);
send ("CARGO_FEATURES", specs.cgo_features, 2);
send_options;
send_targets;
send_descriptions;
send_file (distinfo);
send_manifests;
send_scripts;
send_directory ("patches", "patch-*");
send_directory ("files", "");
for opsys in supported_opsys'Range loop
send_directory (UTL.lower_opsys (opsys), "");
end loop;
if write_to_file then
TIO.Close (makefile_handle);
end if;
exception
when issue : others =>
if TIO.Is_Open (makefile_handle) then
TIO.Close (makefile_handle);
end if;
TIO.Put_Line ("PROBLEM: Buildsheet generation aborted");
TIO.Put_Line (EX.Exception_Information (issue));
end generator;
--------------------------------------------------------------------------------------------
-- align24
--------------------------------------------------------------------------------------------
function align24 (payload : String) return String
is
len : Natural := payload'Length;
begin
if len < 8 then
return payload & LAT.HT & LAT.HT & LAT.HT;
elsif len < 16 then
return payload & LAT.HT & LAT.HT;
elsif len < 24 then
return payload & LAT.HT;
else
return payload;
end if;
end align24;
--------------------------------------------------------------------------------------------
-- align40
--------------------------------------------------------------------------------------------
function align40 (payload : String) return String
is
len : Natural := payload'Length;
begin
if len < 8 then
return payload & LAT.HT & LAT.HT & LAT.HT & LAT.HT & LAT.HT;
elsif len < 16 then
return payload & LAT.HT & LAT.HT & LAT.HT & LAT.HT;
elsif len < 24 then
return payload & LAT.HT & LAT.HT & LAT.HT;
elsif len < 32 then
return payload & LAT.HT & LAT.HT;
elsif len < 40 then
return payload & LAT.HT;
else
return payload;
end if;
end align40;
--------------------------------------------------------------------------------------------
-- print_specification_template
--------------------------------------------------------------------------------------------
procedure print_specification_template (dump_to_file : Boolean)
is
tab : constant Character := LAT.HT;
CR : constant Character := LAT.LF;
part1 : constant String :=
"# DEF[PORTVERSION]=" & tab & "1.00" & CR &
"# ----------------------------------------------------------------------------";
part2 : constant String := CR &
"NAMEBASE=" & tab & tab & "..." & CR &
"VERSION=" & tab & tab & "${PORTVERSION}" & CR &
"KEYWORDS=" & tab & tab & "..." & CR &
"VARIANTS=" & tab & tab & "standard" & CR &
"SDESC[standard]=" & tab & "..." & CR &
"HOMEPAGE=" & tab & tab & "none" & CR &
"CONTACT=" & tab & tab & "Jay_Leno[<EMAIL>]" & CR & CR &
"DOWNLOAD_GROUPS=" & tab & "main" & CR &
"SITES[main]=" & tab & tab & "http://www.example.com/" & CR &
"DISTFILE[1]=" & tab & tab & "x-${PORTVERSION}.tar.gz:main" & CR & CR &
"SPKGS[standard]=" & tab & "single" & CR & CR &
"OPTIONS_AVAILABLE=" & tab & "none" & CR &
"OPTIONS_STANDARD=" & tab & "none" & CR & CR &
"FPC_EQUIVALENT=" & tab & tab & "...";
template : TIO.File_Type;
filename : constant String := "specification";
begin
if dump_to_file then
if DIR.Exists (filename) then
TIO.Put_Line ("The " & filename &
" file already exists. I wouldn't want to overwrite it!");
return;
end if;
TIO.Create (File => template,
Mode => TIO.Out_File,
Name => filename);
TIO.Put_Line (template, part1);
TIO.Put_Line (template, part2);
TIO.Close (template);
DIR.Create_Directory ("manifests");
DIR.Create_Directory ("descriptions");
else
TIO.Put_Line (part1);
TIO.Put_Line (part2);
end if;
exception
when others =>
if TIO.Is_Open (template) then
TIO.Close (template);
end if;
end print_specification_template;
end Port_Specification.Buildsheet;
|
source/nodes/program-nodes-raise_expressions.ads | reznikmm/gela | 0 | 16060 | <reponame>reznikmm/gela<gh_stars>0
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Raise_Expressions;
with Program.Element_Visitors;
package Program.Nodes.Raise_Expressions is
pragma Preelaborate;
type Raise_Expression is
new Program.Nodes.Node
and Program.Elements.Raise_Expressions.Raise_Expression
and Program.Elements.Raise_Expressions.Raise_Expression_Text
with private;
function Create
(Raise_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access)
return Raise_Expression;
type Implicit_Raise_Expression is
new Program.Nodes.Node
and Program.Elements.Raise_Expressions.Raise_Expression
with private;
function Create
(Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Raise_Expression
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Raise_Expression is
abstract new Program.Nodes.Node
and Program.Elements.Raise_Expressions.Raise_Expression
with record
Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access;
end record;
procedure Initialize (Self : in out Base_Raise_Expression'Class);
overriding procedure Visit
(Self : not null access Base_Raise_Expression;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Exception_Name
(Self : Base_Raise_Expression)
return not null Program.Elements.Expressions.Expression_Access;
overriding function Associated_Message
(Self : Base_Raise_Expression)
return Program.Elements.Expressions.Expression_Access;
overriding function Is_Raise_Expression
(Self : Base_Raise_Expression)
return Boolean;
overriding function Is_Expression
(Self : Base_Raise_Expression)
return Boolean;
type Raise_Expression is
new Base_Raise_Expression
and Program.Elements.Raise_Expressions.Raise_Expression_Text
with record
Raise_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
end record;
overriding function To_Raise_Expression_Text
(Self : in out Raise_Expression)
return Program.Elements.Raise_Expressions.Raise_Expression_Text_Access;
overriding function Raise_Token
(Self : Raise_Expression)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function With_Token
(Self : Raise_Expression)
return Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Raise_Expression is
new Base_Raise_Expression
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Raise_Expression_Text
(Self : in out Implicit_Raise_Expression)
return Program.Elements.Raise_Expressions.Raise_Expression_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Raise_Expression)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Raise_Expression)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Raise_Expression)
return Boolean;
end Program.Nodes.Raise_Expressions;
|
source/server/ada_lsp-contexts.adb | reznikmm/ada_lsp | 11 | 1089 | <filename>source/server/ada_lsp-contexts.adb
-- Copyright (c) 2017 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Incr.Version_Trees;
with Ada_LSP.Completion_Tokens;
package body Ada_LSP.Contexts is
type Version_Tree_Access is access all Incr.Version_Trees.Version_Tree;
----------------------------
-- Add_Completion_Handler --
----------------------------
not overriding procedure Add_Completion_Handler
(Self : in out Context;
Value : not null Ada_LSP.Completions.Handler_Access) is
begin
Self.Completions.Append (Value);
end Add_Completion_Handler;
----------------------
-- Fill_Completions --
----------------------
not overriding procedure Fill_Completions
(Self : Context;
Context : Ada_LSP.Completions.Context'Class;
Result : in out LSP.Messages.CompletionList) is
begin
for J of Self.Completions loop
J.Fill_Completion_List (Context, Result);
end loop;
end Fill_Completions;
------------------
-- Get_Document --
------------------
not overriding function Get_Document
(Self : Context;
URI : LSP.Messages.DocumentUri)
return Ada_LSP.Documents.Document_Access is
begin
return Self.Documents (URI);
end Get_Document;
------------------------------
-- Get_Parser_Data_Provider --
------------------------------
not overriding function Get_Parser_Data_Provider
(Self : Context) return Ada_LSP.Ada_Parser_Data.Provider_Access is
begin
return Self.Provider'Unchecked_Access;
end Get_Parser_Data_Provider;
----------------
-- Initialize --
----------------
not overriding procedure Initialize
(Self : in out Context;
Root : League.Strings.Universal_String)
is
function Starts_With (Left, Right : Wide_Wide_String) return Boolean;
-----------------
-- Starts_With --
-----------------
function Starts_With (Left, Right : Wide_Wide_String) return Boolean is
begin
return Left'Length >= Right'Length and then
Left (Left'First .. Left'First + Right'Length - 1) = Right;
end Starts_With;
begin
for J in Self.Provider.Is_Defining_Name'Range loop
Self.Provider.Is_Defining_Name (J) :=
Starts_With (Self.Provider.Kind_Image (J), "defining");
end loop;
Self.Root := Root;
Self.Incr_Lexer.Set_Batch_Lexer (Self.Batch_Lexer'Unchecked_Access);
Self.Add_Completion_Handler
(new Ada_LSP.Completion_Tokens.Completion_Handler
(Self'Unchecked_Access));
end Initialize;
----------------------
-- Is_Defining_Name --
----------------------
overriding function Is_Defining_Name
(Self : Provider;
Kind : Incr.Nodes.Node_Kind) return Boolean is
begin
return Kind in Self.Is_Defining_Name'Range
and then Self.Is_Defining_Name (Kind);
end Is_Defining_Name;
-------------------
-- Load_Document --
-------------------
not overriding procedure Load_Document
(Self : in out Context;
Item : LSP.Messages.TextDocumentItem)
is
History : constant Version_Tree_Access :=
new Incr.Version_Trees.Version_Tree;
Object : constant Ada_LSP.Documents.Document_Access :=
new Ada_LSP.Documents.Document (History);
begin
Object.Initialize (Item);
Object.Update
(Self.Incr_Parser,
Self.Incr_Lexer'Unchecked_Access,
Self.Provider'Unchecked_Access);
Self.Documents.Insert (Item.uri, Object);
end Load_Document;
---------------------
-- Update_Document --
---------------------
not overriding procedure Update_Document
(Self : in out Context;
Item : not null Ada_LSP.Documents.Document_Access) is
begin
Item.Update
(Self.Incr_Parser,
Self.Incr_Lexer'Unchecked_Access,
Self.Provider'Unchecked_Access);
end Update_Document;
end Ada_LSP.Contexts;
|
syzygy/agent/asan/memory_interceptors_x64_impl.asm | xswz8015/syzygy | 343 | 102478 | ; Copyright 2016 Google Inc. All Rights Reserved.
;
; 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.
.CODE
; Allow section and label names to begin with a leading period.
OPTION DOTNAME
; Declare the redirect function.
EXTERN asan_redirect_clang_stub_entry:PROC
; On entry the stack has:
; - return address to original caller.
; - return address to redirection stub.
;
; The address to check is in RCX.
ALIGN 16
asan_redirect_tail_clang PROC
; Prologue, save context.
pushfq
push rax
push rcx
push rdx
; Normalize the string operation direction.
cld
; Compute the address of the calling function and push it.
mov rdx, QWORD PTR[rsp + 4 * 8]
sub rdx, 5 ; Length of call instruction.
; Push the original caller's address.
mov rcx, QWORD PTR[rsp + 5 * 8]
; Reserve the shadow space required by the x64 calling convention.
sub rsp, 32
call asan_redirect_clang_stub_entry
add rsp, 32
; Overwrite the return address with the address of the stub to return to.
mov QWORD PTR[rsp + 4 * 8], rax
; Restore context.
pop rdx
pop rcx
pop rax
popfq
; return to the stashed stub.
ret
asan_redirect_tail_clang ENDP
END
|
Chapter03/data-manipulation/load-effective-address.nasm | firebitsbr/Penetration-Testing-with-Shellcode | 30 | 4735 | global _start
section .text
_start:
lea rax, [mem1]
lea rbx, [rax]
mov rax, 60
mov rdi, 0
syscall
section .data
mem1: dw 0x1234
|
src/edc.adb | hgrodriguez/embedded-dashboard-console | 0 | 4371 | <filename>src/edc.adb
--===========================================================================
--
-- This application provides an embedded dashboard controller offering:
-- - UART Interface
-- - LED Area
-- - 5x7 Matrix Display with two displays as one logical unit
--
--===========================================================================
--
-- Copyright 2021 (C) <NAME>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with RP.Device;
with ItsyBitsy;
with Initializer;
with Transport.Serial;
with Evaluate.LEDs;
with Evaluate.Matrices;
with Execute;
with Execute.LEDs;
with Execute.Matrices;
procedure Edc is
--------------------------------------------------------------------------
-- Processes a request for the LED area
-- * gets the serial command request
-- * checks the input for correctness
-- * if OK, then executes the command given
--------------------------------------------------------------------------
procedure Process_LED (Instruction : Evaluate.LEDs.LED_Instruction);
procedure Process_LED (Instruction : Evaluate.LEDs.LED_Instruction) is
Error : Execute.LED_Errors;
Action : Execute.LED_Actions;
begin
Error := Evaluate.LEDs.Check_Input (Instruction);
case Error is
when Execute.OK =>
ItsyBitsy.LED.Clear;
Action := Evaluate.LEDs.Evaluate (Instruction);
Execute.LEDs.Execute (Action);
when others =>
ItsyBitsy.LED.Set;
end case;
end Process_LED;
--------------------------------------------------------------------------
-- Processes a request for the Matrix area
-- * gets the serial command request
-- * checks the input for correctness
-- * if OK, then executes the command given
--------------------------------------------------------------------------
procedure Process_Matrix (Instruction
: Evaluate.Matrices.Matrix_Instruction);
procedure Process_Matrix (Instruction
: Evaluate.Matrices.Matrix_Instruction) is
Error : Execute.Matrix_Errors;
Action : Execute.Matrix_Command;
use Execute;
begin
Error := Evaluate.Matrices.Check_Input (Instruction);
case Error is
when Execute.M_OK =>
ItsyBitsy.LED.Clear;
Action := Evaluate.Matrices.Evaluate (Instruction => Instruction);
Execute.Matrices.Execute (Action);
when others =>
ItsyBitsy.LED.Set;
end case;
end Process_Matrix;
procedure Show_Patterns_After_Reset;
procedure Show_Patterns_After_Reset is
Word_Pattern_0000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_0,
Command => Execute.Word_0,
Value => "00000000"
);
Word_Pattern_000F : constant Execute.Matrix_Command
:= (Block => Execute.Block_0,
Command => Execute.Word_0,
Value => "000F0000"
);
Word_Pattern_00F0 : constant Execute.Matrix_Command
:= (Block => Execute.Block_0,
Command => Execute.Word_0,
Value => "00F00000"
);
Word_Pattern_0F00 : constant Execute.Matrix_Command
:= (Block => Execute.Block_0,
Command => Execute.Word_0,
Value => "0F000000"
);
Word_Pattern_F000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_0,
Command => Execute.Word_0,
Value => "F0000000"
);
Word_Pattern_FFFF : constant Execute.Matrix_Command
:= (Block => Execute.Block_0,
Command => Execute.Word_0,
Value => "FFFF0000"
);
Double_Word_Pattern_00000000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "00000000"
);
Double_Word_Pattern_0000000F : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "0000000F"
);
Double_Word_Pattern_000000F0 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "000000F0"
);
Double_Word_Pattern_00000F00 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "00000F00"
);
Double_Word_Pattern_0000F000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "0000F000"
);
Double_Word_Pattern_000F0000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "000F0000"
);
Double_Word_Pattern_00F00000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "00F00000"
);
Double_Word_Pattern_0F000000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "0F000000"
);
Double_Word_Pattern_F0000000 : constant Execute.Matrix_Command
:= (Block => Execute.Block_1,
Command => Execute.Double_Word_0,
Value => "F0000000"
);
TIME_BETWEEN_PATTERN : constant Integer := 100;
begin
-----------------------------------------------------------------------
-- Pattern with LEDs ON
Execute.LEDs.Execute (Cmd => Execute.Red_On);
Execute.LEDs.Execute (Cmd => Execute.Amber_On);
Execute.LEDs.Execute (Cmd => Execute.Green_On);
Execute.LEDs.Execute (Cmd => Execute.White_On);
Execute.LEDs.Execute (Cmd => Execute.Blue_On);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
-----------------------------------------------------------------------
-- Pattern with Matrix Word
Execute.Matrices.Execute (Cmd => Word_Pattern_0000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Word_Pattern_000F);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Word_Pattern_00F0);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Word_Pattern_0F00);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Word_Pattern_F000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
-----------------------------------------------------------------------
-- Pattern with Matrix Double Word
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00000000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_0000000F);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_000000F0);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00000F00);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_0000F000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_000F0000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00F00000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_0F000000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_F0000000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
-----------------------------------------------------------------------
-- Pattern with Matrix Word
Execute.Matrices.Execute (Cmd => Word_Pattern_0000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
-----------------------------------------------------------------------
-- Pattern with Matrix Double Word
Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00000000);
RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN);
-----------------------------------------------------------------------
-- Pattern with LEDs OFF
Execute.LEDs.Execute (Cmd => Execute.Red_Off);
Execute.LEDs.Execute (Cmd => Execute.Amber_Off);
Execute.LEDs.Execute (Cmd => Execute.Green_Off);
Execute.LEDs.Execute (Cmd => Execute.White_Off);
Execute.LEDs.Execute (Cmd => Execute.Blue_Off);
end Show_Patterns_After_Reset;
Area_Selector : Transport.Area_Selector;
LED_Instruction : Evaluate.LEDs.LED_Instruction;
Matrix_Instruction : Evaluate.Matrices.Matrix_Instruction;
begin
Initializer.Initialize_All;
Show_Patterns_After_Reset;
loop
-- Check for Serial Channel input
Area_Selector := Transport.Serial.Get_Area_Selector;
case Area_Selector is
when Transport.Led =>
-- something arrived on serial, handle it
LED_Instruction := Transport.Serial.Get_LED_Instruction;
Process_LED (LED_Instruction);
when Transport.Matrix =>
-- something arrived on serial, handle it
Matrix_Instruction := Transport.Serial.Get_Matrix_Instruction;
Process_Matrix (Matrix_Instruction);
when Transport.None =>
null;
end case;
end loop;
end Edc;
--===========================================================================
--
-- MAJOR TITLE HERE
--
--===========================================================================
--------------------------------------------------------------------------
-- Minor Title Here
--------------------------------------------------------------------------
---------------------
-- Subsection Header
---------------------
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc2002a.ada | best08618/asylo | 7 | 18262 | -- CC2002A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT THE ELABORATION OF A GENERIC BODY HAS NO EFFECT OTHER
-- THAN TO ESTABLISH THE TEMPLATE BODY TO BE USED FOR THE
-- CORRESPONDING INSTANTIATIONS.
-- ASL 09/02/81
-- EG 10/30/85 ELIMINATE THE USE OF NUMERIC_ERROR IN TEST.
-- PWN 01/31/95 REMOVED INCONSISTENCIES WITH ADA 9X.
WITH REPORT; USE REPORT;
PROCEDURE CC2002A IS
GLOBAL : INTEGER := 0;
Q : INTEGER RANGE 1..1 := 1;
BEGIN
TEST ("CC2002A","NO SIDE EFFECTS OF ELABORATION OF GENERIC BODY");
BEGIN
DECLARE
GENERIC
PACKAGE P IS
END P;
GENERIC PROCEDURE PROC;
PROCEDURE PROC IS
C : CONSTANT INTEGER RANGE 1 .. 1 := 2;
BEGIN
RAISE PROGRAM_ERROR;
END PROC;
PACKAGE BODY P IS
C : CONSTANT BOOLEAN :=
BOOLEAN'SUCC(IDENT_BOOL(TRUE));
BEGIN
GLOBAL := 1;
Q := Q + 1;
END P;
BEGIN
NULL;
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED DURING ELABORATION OF " &
"GENERIC BODY");
END;
IF GLOBAL /= 0 THEN
FAILED ("VALUE OF GLOBAL VARIABLE CHANGED BY ELABORATION " &
"OF GENERIC BODY");
END IF;
RESULT;
END CC2002A;
|
Des_Ada/src/concrete_handler/p_stephandler-feistelhandler.ads | VMika/Des_Ada | 0 | 8675 | <reponame>VMika/Des_Ada
WITH P_StepHandler;
USE P_StepHandler;
with P_StructuralTypes;
use P_StructuralTypes;
package P_StepHandler.FeistelHandler is
type T_BinaryIntegerArray is array (0..15) of T_BinaryUnit (1..4);
type T_SBox is array (0..3, 0..15) of Integer;
type T_SBoxArray is array (1..8) of T_SBox;
type FeistelHandler is new T_StepHandler with private;
type Ptr_FeistelHandler is access all FeistelHandler;
--- CONSTRUCTOR ---
function Make (Handler : in out FeistelHandler) return FeistelHandler;
--- PROCEDURE ---
procedure Handle (Self : in out FeistelHandler);
function Process_Block (Self : in FeistelHandler;
Block : in out T_BinaryBlock)
return T_BinaryBlock;
procedure Feistel_Round (Self : in FeistelHandler;
Block : in out T_BinaryBlock;
Round : in Integer);
function Feistel_Function (Self : in FeistelHandler;
HalfBlock : T_BinaryHalfBlock;
SubKey : T_BinarySubKey)
return T_BinaryHalfBlock;
function Expansion (HalfBlock : T_BinaryHalfBlock)
return T_BinaryExpandedBlock;
function SBox_Substitution (Self : in FeistelHandler;
ExpandedBlock : T_BinaryExpandedBlock)
return T_BinaryHalfBlock;
function SBox_Output (Self : in FeistelHandler;
Input : T_BinaryUnit;
SBoxNumber : Integer) return T_BinaryUnit;
function Permutation (HalfBlock : T_BinaryHalfBlock)
return T_BinaryHalfBlock;
procedure FinalInversion (Block : in out T_BinaryBlock);
---- GETTER ----
function Get_SBoxArray (Self : in out FeistelHandler) return T_SBoxArray;
function Get_SBoxOutputArray (Self : in out FeistelHandler)
return T_BinaryIntegerArray;
---- SETTER ----
procedure Set_SubKeyArrayAccess (Self : in out FeistelHandler;
Ptr : in BinarySubKeyArray_Access);
procedure Set_Mode (Self : in out FeistelHandler;
Mode : Character);
PRIVATE
type FeistelHandler is new P_StepHandler.T_StepHandler with record
Ptr_SubKeyArray : BinarySubKeyArray_Access;
SBoxOutputArray : T_BinaryIntegerArray;
SBoxArray : T_SBoxArray;
Mode : Character;
end record;
end P_StepHandler.FeistelHandler;
|
sk/sfx/7E.asm | Cancer52/flamedriver | 9 | 25672 | Sound_7E_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_7E_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cPSG3, Sound_7E_PSG3, $00, $03
; PSG3 Data
Sound_7E_PSG3:
smpsPSGform $E7
smpsModSet $01, $01, $01, $01
dc.b nMaxPSG2, $09
smpsPSGAlterVol $04
dc.b nG6, $06
smpsStop
; Song seems to not use any FM voices
Sound_7E_Voices:
|
oeis/316/A316317.asm | neoneye/loda-programs | 11 | 168714 | <gh_stars>10-100
; A316317: Coordination sequence for trivalent node in chamfered version of square grid.
; Submitted by <NAME>
; 1,3,6,11,14,15,20,25,26,29,34,37,40,43,46,51,54,55,60,65,66,69,74,77,80,83,86,91,94,95,100,105,106,109,114,117,120,123,126,131,134,135,140,145,146,149,154,157,160,163,166,171,174,175,180,185,186,189,194,197,200,203,206,211,214,215,220,225,226,229,234,237,240,243,246,251,254,255,260,265,266,269,274,277,280,283,286,291,294,295,300,305,306,309,314,317,320,323,326,331
mov $3,$0
mov $5,$0
seq $0,316316 ; Coordination sequence for tetravalent node in chamfered version of square grid.
sub $0,1
mov $4,$0
div $4,4
add $4,1
mov $1,$4
mov $2,$3
trn $2,$4
mul $2,3
add $1,$2
mul $5,2
add $1,$5
mov $0,$1
|
test/asset/agda-stdlib-1.0/Data/List/Relation/Lex/Core.agda | omega12345/agda-mode | 0 | 9341 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED. Please use
-- Data.List.Relation.Binary.Lex.Core directly.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Lex.Core where
open import Data.List.Relation.Binary.Lex.Core public
|
bb-runtimes/examples/leon4-video/dvidrv.adb | JCGobbi/Nucleo-STM32G474RE | 0 | 12587 | <reponame>JCGobbi/Nucleo-STM32G474RE
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2016-2017, 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 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Ada_2012;
with System;
with Interfaces.Leon3.Irqmp;
with Interfaces; use Interfaces;
with Ada.Text_IO; use Ada.Text_IO;
with I2cm; use I2cm;
with Svga; use Svga;
package body Dvidrv is
I2cm_Video_Base : constant := 16#c000_0900#;
I2cm_Video_Interrupt : constant := 18;
I2cm_Clock_Prescale : I2cm_Clock_Prescale_Register
with Address => System'To_Address (I2cm_Video_Base + 16#00#),
Volatile, Import;
I2cm_Control : I2cm_Control_Register
with Address => System'To_Address (I2cm_Video_Base + 16#04#),
Volatile, Import;
I2cm_Data : I2cm_Data_Register
with Address => System'To_Address (I2cm_Video_Base + 16#08#),
Volatile, Import;
-- Write only
I2cm_Command : I2cm_Command_Register
with Address => System'To_Address (I2cm_Video_Base + 16#0c#),
Volatile, Import;
-- Read only
I2cm_Status : I2cm_Status_Register
with Address => System'To_Address (I2cm_Video_Base + 16#0c#),
Volatile, Import;
I2cm_Ien : constant Boolean := True;
SVGA_Regs : SVGA_Controller_Registers
with Address => System'To_Address (16#c080_0000#),
Volatile, Import;
type Svga_Screen_Type is array (0 .. 639, 0 .. 799) of Unsigned_16;
SVGA_Buffer : Svga_Screen_Type
with Address => System'To_Address (16#4d00_0000#),
Volatile, Import;
protected I2c_Prot is
pragma Interrupt_Priority (System.Interrupt_Priority'First);
procedure Handler;
pragma Attach_Handler (Handler, I2cm_Video_Interrupt);
entry Wait_Tfr;
private
It_Pending : Boolean := False;
end I2c_Prot;
protected body I2c_Prot is
procedure Handler is
begin
It_Pending := True;
I2cm_Command := (Sta => False, Sto => False,
Wr => False, Rd => False,
Ack => False, Iack => True, Res_0 => 0, Res_1 => 0);
end Handler;
entry Wait_Tfr when It_Pending is
begin
It_Pending := False;
end Wait_Tfr;
end I2c_Prot;
procedure I2c_Start (Addr : Unsigned_8; Ok : out Boolean) is
begin
-- Address
I2cm_Data := (Res => 0, Data => Addr);
I2cm_Command := (Sta => True, Sto => False,
Wr => True, Rd => False,
Ack => False, Iack => False, Res_0 => 0, Res_1 => 0);
if I2cm_Ien then
I2c_Prot.Wait_Tfr;
else
while I2cm_Status.Tip loop
null;
end loop;
end if;
if I2cm_Status.Rxack then
Put_Line ("no ack");
Ok := False;
else
Ok := True;
end if;
end I2c_Start;
procedure I2c_Write (Data : Unsigned_8; Stop : Boolean) is
begin
I2cm_Data := (Res => 0, Data => Data);
I2cm_Command := (Sta => False, Sto => Stop,
Wr => True, Rd => False,
Ack => False, Iack => False, Res_0 => 0, Res_1 => 0);
if I2cm_Ien then
I2c_Prot.Wait_Tfr;
else
while I2cm_Status.Tip loop
null;
end loop;
end if;
end I2c_Write;
procedure I2c_Read (Data : out Unsigned_8; Stop : Boolean) is
begin
I2cm_Command := (Sta => False, Sto => Stop,
Wr => False, Rd => True,
Ack => False, Iack => False, Res_0 => 0, Res_1 => 0);
if I2cm_Ien then
I2c_Prot.Wait_Tfr;
else
while I2cm_Status.Tip loop
null;
end loop;
end if;
Data := I2cm_Data.Data;
end I2c_Read;
procedure Write (Addr : Unsigned_8; Reg : Unsigned_8; Val : Unsigned_8)
is
Ok : Boolean;
begin
I2c_Start (Addr, Ok);
if not Ok then
return;
end if;
I2c_Write (Reg, False);
I2c_Write (Val, True);
end Write;
procedure Read (Addr : Unsigned_8; Reg : Unsigned_8; Val : out Unsigned_8)
is
Ok : Boolean;
begin
I2c_Start (Addr, Ok);
if not Ok then
Val := 0;
return;
end if;
I2c_Write (Reg, False);
I2c_Start (Addr or 1, Ok);
if not Ok then
Val := 0;
return;
end if;
I2c_Read (Val, True);
end Read;
subtype String2 is String (1 .. 2);
Hex_Digits : constant array (0 .. 15) of Character := "0123456789abcdef";
function Hex1 (V : Unsigned_8) return String2 is
Res : String2;
begin
for I in Res'Range loop
Res (I) := Hex_Digits (Natural (Shift_Right (V, 4 * (2 - I)) and 15));
end loop;
return Res;
end Hex1;
procedure Init_I2C is
begin
I2cm_Control := (Res_0 => 0, En => False, Ien => False, Res_1 => 0);
-- Prescale = AMBA_clock_Freq / (5 * SCL_Freq) - 1
I2cm_Clock_Prescale.Prescale :=
Unsigned_16 (100_000_000 / (5 * 100_000) - 1);
-- Enable
I2cm_Control := (Res_0 => 0, En => True, Ien => I2cm_Ien, Res_1 => 0);
if I2cm_Ien then
declare
use Interfaces.Leon3.Irqmp;
begin
Interrupt_Mask (1) :=
Interrupt_Mask (1) or 2**I2cm_Video_Interrupt;
end;
end if;
end Init_I2C;
procedure Init_Encoder is
type U8_Array is array (Natural range <>) of Unsigned_8;
Regs : constant U8_Array :=
(16#1c#, 16#1d#, 16#1e#, 16#1f#,
16#20#, 16#21#, 16#23#, 16#31#,
16#33#, 16#34#, 16#35#, 16#36#,
16#37#, 16#48#, 16#49#, 16#4a#,
16#4b#, 16#56#);
Val : Unsigned_8;
begin
for I in Regs'Range loop
Read (16#ec#, Regs (I), Val);
Put (Hex1 (Regs (I)));
Put (": ");
Put (Hex1 (Val));
New_Line;
end loop;
Read (16#ec#, 16#4a#, Val);
Put ("VID: ");
Put (Unsigned_8'Image (Val));
Read (16#ec#, 16#4b#, Val);
Put (", DID: ");
Put_Line (Unsigned_8'Image (Val));
if True then
-- AS is 0, so i2c address is 2#1110_110x#
Write (16#ec#, 16#1c#, 16#04#);
Write (16#ec#, 16#1d#, 16#45#);
Write (16#ec#, 16#1e#, 16#c0#);
Write (16#ec#, 16#1f#, 16#8a#); -- 16 bit
Write (16#ec#, 16#21#, 16#09#); -- DVI
Write (16#ec#, 16#33#, 16#08#);
Write (16#ec#, 16#34#, 16#16#);
Write (16#ec#, 16#36#, 16#60#);
Write (16#ec#, 16#48#, 16#18#); -- Color Bars
Write (16#ec#, 16#49#, 16#c0#);
Write (16#ec#, 16#56#, 16#00#);
end if;
end Init_Encoder;
procedure Init_Svga is
begin
Svga_Regs.Status.Rst := True;
Svga_Regs.Status := (Vpol => False,
Hpol => False,
Clksel => 2,
Bdsel => Depth_16,
Vr => False,
Rst => False,
En => False,
Res_1 => False,
Res_2 => 0);
Svga_Regs.Video_Length := (Vres => 16#257#, Hres => 16#31f#);
Svga_Regs.Front_Porch := (Vporch => 1, Hporch => 40);
Svga_Regs.Sync_Length := (Vplen => 4, Hplen => 128);
Svga_Regs.Line_Length := (Vllen => 16#273#, Hllen => 16#41f#);
Svga_Regs.Framebuffer := Svga_Buffer'Address;
Svga_Regs.Clock_0 := 16#9c40#;
Svga_Regs.Clock_1 := 16#9c40#;
Svga_Regs.Clock_2 := 16#61a8#;
Svga_Regs.Clock_3 := 16#3c19#;
Svga_Regs.Status.En := True;
end Init_Svga;
procedure Init is
begin
Init_I2C;
Init_Encoder;
Init_Svga;
for I in Svga_Buffer'Range (2) loop
Svga_Buffer (10, I) := 2#11111_000000_00000#;
Svga_Buffer (50, I) := 2#00000_111111_00000#;
Svga_Buffer (90, I) := 2#00000_000000_11111#;
end loop;
end Init;
end Dvidrv;
|
1-base/lace/source/environ/lace-environ-paths.ads | charlie5/lace | 20 | 28816 | <filename>1-base/lace/source/environ/lace-environ-paths.ads
with
ada.Calendar;
private
with
ada.Strings.unbounded,
ada.Containers.indefinite_Vectors;
package lace.Environ.Paths
--
-- A singleton which models an operating system environment.
--
is
function expand_GLOB (GLOB : in String) return String;
---------
--- Paths
--
type Path is abstract tagged private;
function to_String (Self : in Path'Class) return String;
function "+" (Self : in Path'Class) return String renames to_String;
procedure change_Mode (Self : in Path; To : in String);
procedure change_Owner (Self : in Path; To : in String);
procedure link (Self : in Path; To : in Path);
function Exists (Self : in Path) return Boolean;
function modify_Time (Self : in Path) return ada.Calendar.Time;
function Name (Self : in Path) return String;
function Simple (Self : in Path) return String;
function is_Folder (Self : in Path) return Boolean;
function is_File (Self : in Path) return Boolean;
function is_Special (Self : in Path) return Boolean;
function is_Absolute (Self : in Path) return Boolean;
function is_Relative (Self : in Path) return Boolean;
-----------
--- Folders
--
type Folder is new Path with private;
no_Folder : constant Folder;
function to_Folder (Name : in String) return Folder;
function "+" (Name : in String) return Folder renames to_Folder;
function "+" (Left : in Folder;
Right : in Folder) return Folder;
function current_Folder return Folder;
procedure go_to_Folder (Self : in Folder;
Lock : in Boolean := False); -- When true, blocks further folder changes until 'unlock_Folder' is called.
procedure unlock_Folder;
procedure rid_Folder (Self : in Folder);
procedure copy_Folder (Self : in Folder; To : in Folder);
procedure move_Folder (Self : in Folder; To : in Folder);
procedure rename_Folder (Self : in Folder; To : in Folder);
procedure ensure_Folder (Self : in Folder); -- Ensure that the folder exists.
function is_Empty (Self : in Folder) return Boolean;
function contents_Count (Self : in Folder; -- Does not include the "." and ".." folders.
Recurse : in Boolean := False) return Natural;
function Parent (Self : in Path'Class) return Folder; -- Returns 'no_Folder' if 'Self' has no parent.
function Relative (Self : in Folder; To : in Folder'Class) return Folder;
-------------------
--- Folder Contexts
--
type folder_Context is limited private;
procedure push_Folder (Context : in out folder_Context;
goto_Folder : in Folder'Class);
--
-- Store the current folder and move to the 'goto_Folder'.
procedure pop_Folder (Context : in out folder_Context);
--
-- Return to the previously pushed folder.
procedure pop_All (Context : in out folder_Context);
--
-- Return to the initial current folder.
---------
--- Files
--
type File is new Path with private;
type File_Extension is new String;
function to_File (Name : in String) return File;
function "+" (Name : in String) return File renames to_File;
function "+" (Left : in Folder'Class;
Right : in File 'Class) return File;
function "+" (Left : in File'Class;
Right : in File_Extension) return File;
function Extension (Self : in File) return File_Extension;
procedure save (Self : in File;
Text : in String;
Binary : in Boolean := False);
procedure save (Self : in File;
Data : in environ.Data);
function load (Self : in File) return String;
function load (Self : in File) return Data;
procedure copy_File (Self : in File; To : in File);
procedure copy_Files (Named : in String; To : in Folder);
--
-- 'Named' can contain an asterix GLOB such as "*" or "*.txt".
procedure move_File (Self : in File; To : in File);
procedure move_Files (Named : in String; To : in Folder);
--
-- 'Named' can contain an asterix GLOB such as "*" or "*.txt".
procedure rid_File (Self : in File);
procedure rid_Files (Named : in String);
--
-- 'Named' can contain an asterix GLOB such as "*" or "*.txt".
procedure append (Self : in File; Text : in String);
procedure append_File (Self : in File; To : in File);
procedure touch (Self : in File);
function Relative (Self : in File; To : in Folder'Class) return File;
function rid_Extension (Self : in File) return File;
--- Compression
--
type compress_Format is (Tar, Tar_Bz2, Tar_Gz, Tar_Xz, Bz2, Gz, Xz);
subtype folder_compress_Format is compress_Format range Tar .. Tar_Xz;
type compress_Level is range 1 .. 9; -- Higher levels result in higher compression.
procedure compress (the_Path : in Path'Class;
the_Format : in compress_Format := Tar_Xz;
the_Level : in compress_Level := 6);
procedure decompress (Name : in File);
function format_Suffix (Format : in compress_Format) return String;
private
use ada.Strings.unbounded;
type Path is abstract tagged
record
Name : unbounded_String;
end record;
type Folder is new Path with null record;
type File is new Path with null record;
no_Folder : constant Folder := (Name => null_unbounded_String);
--- Folder Contexts
--
use ada.Containers;
package Folder_Vectors is new indefinite_Vectors (Positive, Folder);
subtype Folder_Vector is Folder_Vectors.Vector;
type folder_Context is limited
record
folder_Stack : Folder_Vector;
end record;
end lace.Environ.Paths;
|
bench/stlc_small.agda | int-index/smalltt | 377 | 2091 | {-# OPTIONS --type-in-type #-}
Ty% : Set; Ty%
= (Ty : Set)
(ι : Ty)
(arr : Ty → Ty → Ty)
→ Ty
ι% : Ty%; ι% = λ _ ι% _ → ι%
arr% : Ty% → Ty% → Ty%; arr% = λ A B Ty% ι% arr% → arr% (A Ty% ι% arr%) (B Ty% ι% arr%)
Con% : Set;Con%
= (Con% : Set)
(nil : Con%)
(snoc : Con% → Ty% → Con%)
→ Con%
nil% : Con%;nil%
= λ Con% nil% snoc → nil%
snoc% : Con% → Ty% → Con%;snoc%
= λ Γ A Con% nil% snoc% → snoc% (Γ Con% nil% snoc%) A
Var% : Con% → Ty% → Set;Var%
= λ Γ A →
(Var% : Con% → Ty% → Set)
(vz : (Γ : _)(A : _) → Var% (snoc% Γ A) A)
(vs : (Γ : _)(B A : _) → Var% Γ A → Var% (snoc% Γ B) A)
→ Var% Γ A
vz% : ∀{Γ A} → Var% (snoc% Γ A) A;vz%
= λ Var% vz% vs → vz% _ _
vs% : ∀{Γ B A} → Var% Γ A → Var% (snoc% Γ B) A;vs%
= λ x Var% vz% vs% → vs% _ _ _ (x Var% vz% vs%)
Tm% : Con% → Ty% → Set;Tm%
= λ Γ A →
(Tm% : Con% → Ty% → Set)
(var : (Γ : _) (A : _) → Var% Γ A → Tm% Γ A)
(lam : (Γ : _) (A B : _) → Tm% (snoc% Γ A) B → Tm% Γ (arr% A B))
(app : (Γ : _) (A B : _) → Tm% Γ (arr% A B) → Tm% Γ A → Tm% Γ B)
→ Tm% Γ A
var% : ∀{Γ A} → Var% Γ A → Tm% Γ A;var%
= λ x Tm% var% lam app → var% _ _ x
lam% : ∀{Γ A B} → Tm% (snoc% Γ A) B → Tm% Γ (arr% A B);lam%
= λ t Tm% var% lam% app → lam% _ _ _ (t Tm% var% lam% app)
app% : ∀{Γ A B} → Tm% Γ (arr% A B) → Tm% Γ A → Tm% Γ B;app%
= λ t u Tm% var% lam% app% →
app% _ _ _ (t Tm% var% lam% app%) (u Tm% var% lam% app%)
v0% : ∀{Γ A} → Tm% (snoc% Γ A) A;v0%
= var% vz%
v1% : ∀{Γ A B} → Tm% (snoc% (snoc% Γ A) B) A;v1%
= var% (vs% vz%)
v2% : ∀{Γ A B C} → Tm% (snoc% (snoc% (snoc% Γ A) B) C) A;v2%
= var% (vs% (vs% vz%))
v3% : ∀{Γ A B C D} → Tm% (snoc% (snoc% (snoc% (snoc% Γ A) B) C) D) A;v3%
= var% (vs% (vs% (vs% vz%)))
v4% : ∀{Γ A B C D E} → Tm% (snoc% (snoc% (snoc% (snoc% (snoc% Γ A) B) C) D) E) A;v4%
= var% (vs% (vs% (vs% (vs% vz%))))
test% : ∀{Γ A} → Tm% Γ (arr% (arr% A A) (arr% A A));test%
= lam% (lam% (app% v1% (app% v1% (app% v1% (app% v1% (app% v1% (app% v1% v0%)))))))
|
Engine/Constants.asm | dougmasten/thomson-to8-game-engine | 1 | 21608 | <filename>Engine/Constants.asm
* ---------------------------------------------------------------------------
* Constants
*
* Naming convention
* -----------------
* - lower case
* - underscore-separated names
*
* ---------------------------------------------------------------------------
* ===========================================================================
* TO8 Registers
* ===========================================================================
; Disk routine registers (ROM)
dk_drive equ $6049
dk_track equ $604A
dk_track_lsb equ $604B
dk_sector equ $604C
dk_write_location equ $604F
* ===========================================================================
* Globals
* ===========================================================================
glb_system_stack equ $9FFA
glb_screen_location_1 equ $9FFA ; start address for rendering of current sprite Part1
glb_screen_location_2 equ $9FFC ; start address for rendering of current sprite Part2 (Must follow Part1)
glb_register_s equ $9FFE ; reverved space to store S from ROM routines
* ===========================================================================
* Display Constants
* ===========================================================================
screen_width equ 160 ; in pixel
screen_top equ 28 ; in pixel
screen_bottom equ 28+199 ; in pixel
screen_left equ 48 ; in pixel
screen_right equ 48+159 ; in pixel
nb_priority_levels equ 8 ; number of priority levels (need code change if modified)
* ===========================================================================
* Images Constants
* ===========================================================================
image_x_size equ 4
image_y_size equ 5
image_center_offset equ 6
image_subset_x1_offset equ 4
image_subset_y1_offset equ 5
page_draw_routine equ 0
draw_routine equ 1
page_erase_routine equ 3
erase_routine equ 4
erase_nb_cell equ 6
* ===========================================================================
* Sound Constants
* ===========================================================================
sound_page equ 0
sound_start_addr equ 1
sound_end_addr equ 3
sound_meta_size equ 5
* ===========================================================================
* Object Constants
* ===========================================================================
object_size equ 114 ; the size of an object - DEPENDENCY ClearObj routine
next_object equ object_size
id equ 0 ; reference to object model id (ObjID_) (0: free slot)
subtype equ 1 ; reference to object subtype (Sub_)
render_flags equ 2
* --- render_flags bitfield variables ---
render_xmirror_mask equ $01 ; (bit 0) DEPENDENCY should be bit 0 - tell display engine to mirror sprite on horizontal axis
render_ymirror_mask equ $02 ; (bit 1) DEPENDENCY should be bit 1 - tell display engine to mirror sprite on vertical axis
render_overlay_mask equ $04 ; (bit 2) DEPENDENCY should be bit 2 - compilated sprite with no background save
render_motionless_mask equ $08 ; (bit 3) tell display engine to compute sub image and position check only once until the flag is removed
render_playfieldcoord_mask equ $10 ; (bit 4) tell display engine to use playfield (1) or screen (0) coordinates
render_hide_mask equ $20 ; (bit 5) tell display engine to hide sprite (keep priority and mapping_frame)
render_todelete_mask equ $40 ; (bit 6) tell display engine to delete sprite and clear OST for this object
render_xloop_mask equ $80 ; (bit 7) (screen coordinate) tell display engine to hide sprite when x is out of screen (0) or to display (1)
priority equ 3 ; display priority (0: nothing to display, 1:front, ..., 8:back)
anim equ 4 ; and 5 ; reference to current animation (Ani_)
prev_anim equ 6 ; and 7 ; reference to previous animation (Ani_)
anim_frame equ 8 ; index of current frame in animation
anim_frame_duration equ 9 ; number of frames for each image in animation, range: 00-7F (0-127), 0 means display only during one frame
anim_link equ 10 ; allow animation swap without reseting anim_frame and duration
image_set equ 11 ; and 12 ; reference to current image (Img_) (0000 if no image)
x_pos equ 13 ; and 14 ; x playfield coordinate
x_sub equ 15 ; x subpixel (1/256 of a pixel), must follow x_pos in data structure
y_pos equ 16 ; and 17 ; y playfield coordinate
y_sub equ 18 ; y subpixel (1/256 of a pixel), must follow y_pos in data structure
xy_pixel equ 19 ; x and y screen coordinate
x_pixel equ 19 ; x screen coordinate
y_pixel equ 20 ; y screen coordinate, must follow x_pixel
x_vel equ 21 ; and 22 ; horizontal velocity
y_vel equ 23 ; and 24 ; vertical velocity
routine equ 25 ; index of current object routine
routine_secondary equ 26 ; index of current secondary routine
routine_tertiary equ 27 ; index of current tertiary routine
routine_quaternary equ 28 ; index of current quaternary routine
ext_variables equ 88 ; to 113 ; reserved space for additionnal variables (25 bytes)
* ---------------------------------------------------------------------------
* reserved variables (engine)
rsv_render_flags equ 29
* --- rsv_render_flags bitfield variables ---
rsv_render_checkrefresh_mask equ $01 ; (bit 0) if erasesprite and display sprite flag are processed for this frame
rsv_render_erasesprite_mask equ $02 ; (bit 1) if a sprite need to be cleared on screen
rsv_render_displaysprite_mask equ $04 ; (bit 2) if a sprite need to be rendered on screen
rsv_render_outofrange_mask equ $08 ; (bit 3) if a sprite is out of range for full rendering in screen
rsv_render_onscreen_mask equ $80 ; (bit 7) DEPENDENCY should be bit 7 - has been rendered on last screen buffer (may be 0 or 1)
rsv_prev_anim equ 30 ; and 31 ; reference to previous animation (Ani_) w * UTILE ?
rsv_image_center_offset equ 32 ; 0 or 1 offset that indicate if image center is even or odd (DRS_XYToAddress)
rsv_image_subset equ 33 ; and 34 ; reference to current image regarding mirror flags w
rsv_mapping_frame equ 35 ; and 36 ; reference to current image regarding mirror flags, overlay flag and x precision w
rsv_erase_nb_cell equ 37 ; b
rsv_page_draw_routine equ 38 ; b
rsv_draw_routine equ 39 ; and 40 ; w
rsv_page_erase_routine equ 41 ; b
rsv_erase_routine equ 42 ; and 43 ; w
rsv_xy1_pixel equ 44 ;
rsv_x1_pixel equ 44 ; x+x_offset-(x_size/2) screen coordinate
rsv_y1_pixel equ 45 ; y+y_offset-(y_size/2) screen coordinate, must follow rsv_x1_pixel
rsv_xy2_pixel equ 46 ;
rsv_x2_pixel equ 46 ; x+x_offset+(x_size/2) screen coordinate
rsv_y2_pixel equ 47 ; y+y_offset+(y_size/2) screen coordinate, must follow rsv_x2_pixel
* ---------------------------------------------------------------------------
* reserved variables (engine) - buffer specific
rsv_buffer_0 equ 48 ; Start index of buffer 0 variables
rsv_priority_0 equ 48 ; internal value that hold priority in video buffer 0
rsv_priority_prev_obj_0 equ 49 ; and 50 ; previous object (OST address) in display priority list for video buffer 0 (0000 if none) w
rsv_priority_next_obj_0 equ 51 ; and 52 ; next object (OST address) in display priority list for video buffer 0 (0000 if none) w
rsv_prev_mapping_frame_0 equ 53 ; and 54 ; reference to previous image in video buffer 0 w
rsv_prev_erase_nb_cell_0 equ 55 : b
rsv_prev_page_erase_routine_0 equ 56 ; b
rsv_prev_erase_routine_0 equ 57 ; and 58 ; w
rsv_bgdata_0 equ 59 ; and 60 ; address of background data in screen 0 w
rsv_prev_xy_pixel_0 equ 61 ;
rsv_prev_x_pixel_0 equ 61 ; previous x screen coordinate b
rsv_prev_y_pixel_0 equ 62 ; previous y screen coordinate b, must follow x_pixel
rsv_prev_xy1_pixel_0 equ 63 ;
rsv_prev_x1_pixel_0 equ 63 ; previous x+x_offset-(x_size/2) screen coordinate b
rsv_prev_y1_pixel_0 equ 64 ; previous y+y_offset-(y_size/2) screen coordinate b, must follow x1_pixel
rsv_prev_xy2_pixel_0 equ 65 ;
rsv_prev_x2_pixel_0 equ 65 ; previous x+x_offset+(x_size/2) screen coordinate b
rsv_prev_y2_pixel_0 equ 66 ; previous y+y_offset+(y_size/2) screen coordinate b, must follow x2_pixel
rsv_prev_render_flags_0 equ 67 ;
* --- rsv_prev_render_flags_0 bitfield variables ---
rsv_prev_render_overlay_mask equ $01 ; (bit 0) if a sprite has been rendered with compilated sprite and no background save on screen buffer 0/1
rsv_prev_render_onscreen_mask equ $80 ; (bit 7) DEPENDENCY should be bit 7 - has been rendered on screen buffer 0/1
rsv_buffer_1 equ 68 ; Start index of buffer 1 variables
rsv_priority_1 equ 68 ; internal value that hold priority in video buffer 1
rsv_priority_prev_obj_1 equ 69 ; and 70 ; previous object (OST address) in display priority list for video buffer 1 (0000 if none) w
rsv_priority_next_obj_1 equ 71 ; and 72 ; next object (OST address) in display priority list for video buffer 1 (0000 if none) w
rsv_prev_mapping_frame_1 equ 73 ; and 74 ; reference to previous image in video buffer 1 w
rsv_prev_erase_nb_cell_1 equ 75 ; b
rsv_prev_page_erase_routine_1 equ 76 ; b
rsv_prev_erase_routine_1 equ 77 ; and 78 ; w
rsv_bgdata_1 equ 79 ; and 80 ; address of background data in screen 1 w
rsv_prev_xy_pixel_1 equ 81 ;
rsv_prev_x_pixel_1 equ 81 ; previous x screen coordinate b
rsv_prev_y_pixel_1 equ 82 ; previous y screen coordinate b, must follow x_pixel
rsv_prev_xy1_pixel_1 equ 83 ;
rsv_prev_x1_pixel_1 equ 83 ; previous x+x_size screen coordinate b
rsv_prev_y1_pixel_1 equ 84 ; previous y+y_size screen coordinate b, must follow x_pixel
rsv_prev_xy2_pixel_1 equ 85 ;
rsv_prev_x2_pixel_1 equ 85 ; previous x+x_size screen coordinate b
rsv_prev_y2_pixel_1 equ 86 ; previous y+y_size screen coordinate b, must follow x_pixel
rsv_prev_render_flags_1 equ 87 ;
buf_priority equ 0 ; offset for each rsv_buffer variables
buf_priority_prev_obj equ 1 ;
buf_priority_next_obj equ 3 ;
buf_prev_mapping_frame equ 5 ;
buf_erase_nb_cell equ 7 ;
buf_page_erase_routine equ 8 ;
buf_erase_routine equ 9 ;
buf_bgdata equ 11 ;
buf_prev_xy_pixel equ 13 ;
buf_prev_x_pixel equ 13 ;
buf_prev_y_pixel equ 14 ;
buf_prev_xy1_pixel equ 15 ;
buf_prev_x1_pixel equ 15 ;
buf_prev_y1_pixel equ 16 ;
buf_prev_xy2_pixel equ 17 ;
buf_prev_x2_pixel equ 17 ;
buf_prev_y2_pixel equ 18 ;
buf_prev_render_flags equ 19 ;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cz/cz1102a.ada | best08618/asylo | 7 | 9162 | <gh_stars>1-10
-- CZ1102A.ADA
--
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
--
-- CHECK THAT THE DYNAMIC VALUE ROUTINES OF THE REPORT PACKAGE WORK
-- CORRECTLY.
-- JRK 8/7/81
-- JRK 10/27/82
-- RLB 03/20/00 - Added checks for Integer'First and Integer'Last.
WITH REPORT;
USE REPORT;
PROCEDURE CZ1102A IS
BEGIN
TEST ("CZ1102A", "CHECK THAT THE DYNAMIC VALUE ROUTINES OF " &
"THE REPORT PACKAGE WORK CORRECTLY");
IF NOT EQUAL (0, 0) OR
EQUAL (0, 1) OR
NOT EQUAL (1, 1) OR
NOT EQUAL (3, 3) OR
NOT EQUAL (4, 4) OR
NOT EQUAL (-1, -1) OR
NOT EQUAL (INTEGER'FIRST, INTEGER'FIRST) OR
NOT EQUAL (INTEGER'LAST, INTEGER'LAST) OR
EQUAL (-1, 0) THEN
FAILED ("'EQUAL' NOT WORKING");
END IF;
IF IDENT_INT (5) /= 5 THEN
FAILED ("'IDENT_INT' NOT WORKING");
END IF;
IF IDENT_CHAR ('E') /= 'E' THEN
FAILED ("'IDENT_CHAR' NOT WORKING");
END IF;
IF IDENT_BOOL (TRUE) /= TRUE THEN
FAILED ("'IDENT_BOOL' NOT WORKING");
END IF;
IF IDENT_STR ("") /= "" OR
IDENT_STR ("K") /= "K" OR
IDENT_STR ("PQRS") /= "PQRS" THEN
FAILED ("'IDENT_STR' NOT WORKING");
END IF;
RESULT;
END CZ1102A;
|
programs/oeis/138/A138750.asm | karttu/loda | 0 | 171463 | <reponame>karttu/loda
; A138750: a(n) = ceiling(n/2) if n == 2 (mod 3), a(n) = 2n otherwise.
; 0,2,1,6,8,3,12,14,4,18,20,6,24,26,7,30,32,9,36,38,10,42,44,12,48,50,13,54,56,15,60,62,16,66,68,18,72,74,19,78,80,21,84,86,22,90,92,24,96,98,25,102,104,27,108,110,28,114,116,30,120,122,31,126,128,33,132,134,34
add $0,1
mov $2,$0
mov $8,$0
add $0,2
add $0,$8
mov $4,$8
gcd $4,3
mov $7,$8
lpb $2,1
add $0,2
bin $1,$9
mov $2,$0
mov $5,$1
mov $6,$4
add $8,1
sub $2,$8
mov $9,$2
lpb $4,1
sub $9,$5
mov $0,$9
add $0,6
div $0,2
add $3,$2
trn $4,$7
lpe
lpb $6,1
mov $3,2
mov $6,1
lpe
mov $2,$3
lpe
mov $1,$0
sub $1,4
|
base/Kernel/Native/arm/lies.asm | sphinxlogic/Singularity-RDK-2.0 | 0 | 82554 | <gh_stars>0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Microsoft Research Singularity
;;;
;;; Copyright (c) Microsoft Corporation. All rights reserved.
;;;
;;; This file contains ARM-specific assembly code.
;;;
|defining ?g_SetCurrentThreadContext@Class_Microsoft_Singularity_Processor@@SAXPAUStruct_Microsoft_Singularity_X86_ThreadContext@@@Z| EQU 1
|defining ?g_Initialize@Class_System_VTable@@SAXXZ| EQU 1
|defining ?g_Halt@Struct_Microsoft_Singularity_Hal_Cpu@@SAXXZ| EQU 1
|defining ?c_exceptionHandler@@3P6AXHPAUStruct_Microsoft_Singularity_ThreadContext@@@ZA| EQU 1
|defining ?c_interruptHandler@@3P6AXHPAUStruct_Microsoft_Singularity_ThreadContext@@@ZA| EQU 1
|defining ?g_DisablePaging@Class_Microsoft_Singularity_Processor@@SAXXZ| EQU 1
|defining ?g_EnterRing3@Class_Microsoft_Singularity_Processor@@SAXXZ| EQU 1
|defining ?g_GetFrameEbp@Class_Microsoft_Singularity_Processor@@SAPAUuintPtr@@PAU2@@Z| EQU 1
|defining ?g_GetStackPointer@Class_Microsoft_Singularity_Processor@@SAPAUuintPtr@@XZ| EQU 1
|defining ?g_GetFrameEip@Class_Microsoft_Singularity_Processor@@SAPAUuintPtr@@PAU2@@Z| EQU 1
|defining ?g_GetFramePointer@Class_Microsoft_Singularity_Processor@@SAPAUuintPtr@@XZ| EQU 1
|defining ?g_ReadMsr@Class_Microsoft_Singularity_Processor@@SA_KI@Z| EQU 1
|defining ?c_LinkStackFunctionsBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?c_LinkStackFunctionsLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?c_LinkStackBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?c_LinkStackLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?c_UnlinkStackBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?c_UnlinkStackLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?c_LinkStackStubsBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?c_LinkStackStubsLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA| EQU 1
|defining ?g_GetCr3@Class_Microsoft_Singularity_Processor@@SAIXZ| EQU 1
|defining ?g_InitFpu@Class_Microsoft_Singularity_Processor@@SAXXZ| EQU 1
|defining ?g_ClearFpuStatus@Class_Microsoft_Singularity_Processor@@SAXXZ| EQU 1
|defining ?g_ReadFpuStatus@Class_Microsoft_Singularity_Processor@@SAIXZ| EQU 1
|defining ?g_LimitedDispatchException@Class_Microsoft_Singularity_Processor@@SAXHPAUStruct_Microsoft_Singularity_X86_ThreadContext@@@Z| EQU 1
|defining ?g_MpCallEntryPoint@Class_Microsoft_Singularity_Processor@@SAXPAUuintPtr@@@Z| EQU 1
|defining ?g_PrivateChangeAddressSpace@Class_Microsoft_Singularity_Processor@@SAXI@Z| EQU 1
|defining ?g_PrivateEnablePaging@Class_Microsoft_Singularity_Processor@@SAXI@Z| EQU 1
|defining ?g_PrivateInvalidateTLBEntry@Class_Microsoft_Singularity_Processor@@SAXPAUuintPtr@@@Z| EQU 1
|defining ?g_WriteMsr@Class_Microsoft_Singularity_Processor@@SAXI_K@Z| EQU 1
;|defining ?g_CollectBodyTransition@Class_System_GC@@SAXPAUClass_System_Threading_Thread@@H@Z| EQU 1
;|defining ?g_setStopContext@Class_System_Threading_Thread@@SAXPAU1@PAUClass_System_Exception@@@Z| EQU 1
|defining __throwDispatcherExplicitAddrAfter| EQU 1
;|defining staticDataPointerBitMap| EQU 1
|defining ?g_HalGetMpBootInfo@Struct_Microsoft_Singularity_MpBootInfo@@SAPAU1@XZ| EQU 1
|defining ?g_LinkSharedStack@Struct_Microsoft_Singularity_V1_Services_StackService@@SAXXZ| EQU 1
|defining ?g_UnlinkSharedStack@Struct_Microsoft_Singularity_V1_Services_StackService@@SAXXZ| EQU 1
|defining ?g_LinkStack0@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack4@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack8@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack12@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack16@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack20@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack24@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack28@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack32@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack36@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack40@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack44@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack48@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack52@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack56@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack60@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack64@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack68@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack72@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack76@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack80@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack84@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack88@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack92@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack96@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack100@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack104@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack108@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack112@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack116@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack120@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack124@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_LinkStack128@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack0@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack4@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack8@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack12@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack16@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack20@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack24@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack28@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack32@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack36@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack40@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack44@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack48@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack52@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack56@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack60@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack64@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack68@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack72@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack76@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack80@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack84@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack88@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack92@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack96@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack100@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack104@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack108@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack112@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack116@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack120@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack124@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
|defining ?g_UnlinkStack128@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ| EQU 1
include hal.inc
MACRO
BREAKPOINT
;; bkpt 0xffff
swi 0xffff03
MEND
TEXTAREA
;;;
;;; "public: static void __cdecl Class_Microsoft_Singularity_Processor::g_SetCurrentThreadContext(struct Struct_Microsoft_Singularity_X86_ThreadContext *)"
;;;
LEAF_ENTRY ?g_SetCurrentThreadContext@Class_Microsoft_Singularity_Processor@@SAXPAUStruct_Microsoft_Singularity_X86_ThreadContext@@@Z
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static void __cdecl Class_System_VTable::g_Initialize(void)"
;;;
LEAF_ENTRY ?g_Initialize@Class_System_VTable@@SAXXZ
;;; BREAKPOINT ; we ignore this for now.
bx lr
LEAF_END
;;;
;;; "public: static void __cdecl Struct_Microsoft_Singularity_Hal_Cpu::g_Halt(void)"
;;;
LEAF_ENTRY ?g_Halt@Struct_Microsoft_Singularity_Hal_Cpu@@SAXXZ
DCD 0xe320f003 ;; WFI Note: ARMv7 Specific.
bx lr
LEAF_END
;;;
;;; "void(__cdecl* c_exceptionHandler)(int,struct Struct_Microsoft_Singularity_ThreadContext *)"
;;;
LEAF_ENTRY ?c_exceptionHandler@@3P6AXHPAUStruct_Microsoft_Singularity_ThreadContext@@@ZA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "void(__cdecl* c_interruptHandler)(int,struct Struct_Microsoft_Singularity_ThreadContext *)"
;;;
LEAF_ENTRY ?c_interruptHandler@@3P6AXHPAUStruct_Microsoft_Singularity_ThreadContext@@@ZA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackBegin"
;;;
LEAF_ENTRY ?c_LinkStackFunctionsBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackLimit"
;;;
LEAF_ENTRY ?c_LinkStackFunctionsLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackBegin"
;;;
LEAF_ENTRY ?c_LinkStackBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackLimit"
;;;
LEAF_ENTRY ?c_LinkStackLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackBegin"
;;;
LEAF_ENTRY ?c_UnlinkStackBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackLimit"
;;;
LEAF_ENTRY ?c_UnlinkStackLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackBegin"
;;;
LEAF_ENTRY ?c_LinkStackStubsBegin@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static unsigned char Class_Microsoft_Singularity_Memory_Stacks::c_LinkStackLimit"
;;;
LEAF_ENTRY ?c_LinkStackStubsLimit@Class_Microsoft_Singularity_Memory_Stacks@@2EA
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static void __cdecl Class_Microsoft_Singularity_Processor::g_LimitedDispatchException(int,struct Struct_Microsoft_Singularity_X86_ThreadContext *)"
;;;
LEAF_ENTRY ?g_LimitedDispatchException@Class_Microsoft_Singularity_Processor@@SAXHPAUStruct_Microsoft_Singularity_X86_ThreadContext@@@Z
BREAKPOINT
bx lr
LEAF_END
;;;
;;; "public: static void __cdecl Class_System_GC::g_CollectBodyTransition(struct Class_System_Threading_Thread *,int)"
;;;
; LEAF_ENTRY ?g_CollectBodyTransition@Class_System_GC@@SAXPAUClass_System_Threading_Thread@@H@Z
; BREAKPOINT
; bx lr
; LEAF_END
;;;
;;; "public: static void __cdecl Class_System_Threading_Thread::g_setStopContext(struct Class_System_Threading_Thread *,struct Class_System_Exception *)"
;;;
; LEAF_ENTRY ?g_setStopContext@Class_System_Threading_Thread@@SAXPAU1@PAUClass_System_Exception@@@Z
; BREAKPOINT
; bx lr
; LEAF_END
;;;
;;; "__throwDispatcherExplicitAddrAfter"
;;;
LEAF_ENTRY __throwDispatcherExplicitAddrAfter
BREAKPOINT
bx lr
LEAF_END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ??????????????
;;;
;;;
;;; "staticDataPointerBitMap"
;;;
; LEAF_ENTRY staticDataPointerBitMap
; BREAKPOINT
; bx lr
; LEAF_END
;;;
;;; "Win32RaceRegionStart"/"Win32RaceRegionStart"
;;;
EXPORT |Win32RaceRegionStart|
|Win32RaceRegionStart| DCD 0
EXPORT |Win32RaceRegionEnd|
|Win32RaceRegionEnd| DCD 0
LEAF_ENTRY ?g_HalGetMpBootInfo@Struct_Microsoft_Singularity_MpBootInfo@@SAPAU1@XZ
BREAKPOINT
bx lr
LEAF_END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Linked Stacks.
;;;
LEAF_ENTRY ?g_LinkSharedStack@Struct_Microsoft_Singularity_V1_Services_StackService@@SAXXZ
bkpt 0xffff
bx lr
LEAF_END
LEAF_ENTRY ?g_UnlinkSharedStack@Struct_Microsoft_Singularity_V1_Services_StackService@@SAXXZ
bkpt 0xffff
bx lr
LEAF_END
LEAF_ENTRY ?g_LinkStack0@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack4@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack8@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack12@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack16@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack20@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack24@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack28@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack32@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack36@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack40@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack44@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack48@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack52@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack56@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack60@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack64@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack68@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack72@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack76@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack80@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack84@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack88@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack92@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack96@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack100@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack104@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack108@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack112@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack116@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack120@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack124@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_LinkStack128@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack0@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack4@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack8@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack12@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack16@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack20@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack24@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack28@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack32@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack36@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack40@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack44@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack48@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack52@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack56@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack60@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack64@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack68@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack72@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack76@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack80@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack84@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack88@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack92@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack96@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack100@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack104@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack108@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack112@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack116@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack120@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack124@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
LEAF_ENTRY ?g_UnlinkStack128@Class_Microsoft_Singularity_Memory_Stacks@@SAXXZ
bkpt 0xffff
LEAF_END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; "activationDescriptorTable"
;;;
; EXPORT |activationDescriptorTable|
;|activationDescriptorTable| DCD 0
;;;
;;; "callSetSiteNumberToIndex"
;;;
; EXPORT |callSetSiteNumberToIndex|
;|callSetSiteNumberToIndex| DCD 0
;;;
;;; "callSiteSetCount"
;;;
; EXPORT |callSiteSetCount|
;|callSiteSetCount| DCD 0
;;;
;;; "returnAddressToCallSiteSetNumbers"
;;;
; EXPORT |returnAddressToCallSiteSetNumbers|
;|returnAddressToCallSiteSetNumbers| DCD 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
END
|
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/sfxdos..asm | prismotizm/gigaleak | 0 | 95971 | <gh_stars>0
Name: sfxdos..asm
Type: file
Size: 11129
Last-Modified: '1992-02-13T07:48:35Z'
SHA-1: C360110AFEC4E69D6A7D9240D62F463F441D9F7E
Description: null
|
arbitrary/e_jacobi_eigen.adb | jscparker/math_packages | 30 | 18686 | <reponame>jscparker/math_packages
-----------------------------------------------------------------------
-- package body e_Jacobi_Eigen, extended precision Jacobi eigen-decomposition
-- Copyright (C) 2008-2018 <NAME>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------------------------
package body e_Jacobi_Eigen is
Reciprocal_Epsilon : constant Real := One / e_Real_Model_Epsilon;
---------------------------------
-- Get_Jacobi_Rotation_Factors --
---------------------------------
-- all underflows are OK here.
-- no overflows are OK here.
-- so we test for Q / P overflows by calculating P / Q
procedure Get_Jacobi_Rotation_Factors
(P, Q : in Real;
s : out Real;
tau : out Real;
Delta_D : out Real)
is
t, Gamma : Real;
-- function "/" (x, y : Real) return Real renames Divide;
-- faster than stnd "/", but scarcely matters.
begin
s := Zero;
tau := Zero;
Delta_D := Zero;
if Abs (Q) > e_Real_Safe_Min and then
Abs (P) > e_Real_Safe_Min and then
Abs (Q) < e_Real_Safe_Max and then
Abs (P) < e_Real_Safe_Max then
-- Following Gamma is usually the more accurate.
Gamma := P / (Abs (Q) + Sqrt (P*P + Q*Q));
if Q < Zero then Gamma := -Gamma; end if;
-- usual case overwhelmingly. If you scale matrix to unit Norm,
-- then no overflows because Matrix norm is preserved, preventing
-- large P, Q if they are not large to begin with. (So the above
-- tests for < e_Real_Safe_Max would be unnecessary.)
-- (Requires scaling of matrix prior to decomposition to be
-- absolutely sure.)
-- Should be able to do the following w/o any tests of p,q if don't care
-- about quality of answer in P < e_Safe_Small, Q < e_Safe_Small limit.
--
--Gamma := P / (Abs(Q) + Sqrt (P*P + Q*Q) + e_Safe_Small);
--if Q < Zero then Gamma := -Gamma; end if;
elsif Abs (Q) > Abs (P) then
-- Abs (P) > 0 was a tested before arrival, which implies Abs (Q) > 0.
t := P / Q;
Gamma := t / (One + Sqrt (One + t*t));
-- Underflow OK; overflow not allowed.
elsif Abs (P) >= Abs (Q) then
t := Q / P;
Gamma := One / (Abs (t) + Sqrt (One + t*t));
-- Underflow OK; overflow not allowed.
if t < Zero then Gamma := -Gamma; end if;
else
return; -- must have hit some inf's. Use stnd rotation init'd above.
end if;
declare
c : Real;
begin
c := Reciprocal_Sqrt (One + Gamma*Gamma); -- Cosine (ok)
--c := Sqrt (One / (One + Gamma*Gamma)); -- Cosine
s := c * Gamma; -- Sine
tau := s / (One + c); -- -cos_minus_1_over_sin
Delta_D := P * Gamma;
end;
end Get_Jacobi_Rotation_Factors;
---------------------
-- Eigen_Decompose --
---------------------
procedure Eigen_Decompose
(A : in out Matrix;
Q_tr : out Matrix;
Eigenvals : out Col_Vector;
No_of_Sweeps_Performed : out Natural;
Total_No_of_Rotations : out Natural;
Start_Col : in Index := Index'First;
Final_Col : in Index := Index'Last;
Eigenvectors_Desired : in Boolean := False)
is
D : Col_Vector renames Eigenvals;
Z, B : Col_Vector;
Max_Allowed_No_of_Sweeps : constant Positive := 256; -- badly scaled need lots
No_of_Preliminary_Sweeps : constant Positive := 14;
--Reciprocal_Epsilon : constant Real := One / e_Real_Model_Epsilon;
-- Good stnd setting for the effective eps is: Real'Epsilon * Two**(-2).
-- Usually, Real'Epsilon := 2.0**(-50) for 15 digit Reals.
Matrix_Size : constant Real_8 := Real_8(Final_Col) - Real_8(Start_Col) + 1.0;
No_of_Off_Diag_Elements : constant Real_8 := 0.5*Matrix_Size*(Matrix_Size-1.0);
Mean_Off_Diagonal_Element_Size : Real;
s, g, h, tau : Real; -- Rutishauser variable names.
Q, Delta_D : Real;
Sum, Pivot, Threshold : Real;
begin
-- Initialize all out parameters. D renames Eigenvals.
-- Q_tr starts as Identity; is rotated into set of Eigenvectors of A.
Q_tr := (others => (others => Zero));
for j in Index loop
Q_tr(j,j) := One;
end loop;
Z := (others => Zero);
B := (others => Zero);
D := (others => Zero);
for j in Start_Col .. Final_Col loop -- assume A not all init
D(j) := A(j,j);
B(j) := A(j,j);
end loop;
No_of_Sweeps_Performed := 0;
Total_No_of_Rotations := 0;
if Matrix_Size <= 1.0 then return; end if; -- right answer for Size=1.
Sweep: for Sweep_id in 1 .. Max_Allowed_No_of_Sweeps loop
Sum := Zero;
for N in Start_Col .. Final_Col-1 loop --sum off-diagonal elements
for I in N+1 .. Final_Col loop
Sum := Sum + Abs (A(N,I));
end loop;
end loop;
Mean_Off_Diagonal_Element_Size := Sum / (+No_of_Off_Diag_Elements);
exit Sweep when Mean_Off_Diagonal_Element_Size < Min_Allowed_Real;
if Sweep_id > No_of_Preliminary_Sweeps then
Threshold := Zero;
else
Threshold := One * Mean_Off_Diagonal_Element_Size;
end if;
for N in Start_Col .. Final_Col-1 loop
for I in N+1 .. Final_Col loop
Pivot := A(N,I);
-- Have to zero out sufficiently small A(I,N) to get convergence,
-- ie, to get Off_Diag_Sum -> 0.0.
-- After 4 sweeps all A(I,N) are small so that
-- A(I,N) / Epsilon will never overflow. The test is
-- A(I,N) / Epsilon <= Abs D(I) and A(I,N) / Epsilon <= Abs D(N).
if
(Sweep_id > No_of_Preliminary_Sweeps) and then
(Reciprocal_Epsilon * Abs (Pivot) <= Abs D(N)) and then
(Reciprocal_Epsilon * Abs (Pivot) <= Abs D(I))
then
A(N,I) := Zero;
elsif Abs (Pivot) > Threshold then
Q := Half * (D(I) - D(N));
Get_Jacobi_Rotation_Factors (Pivot, Q, s, tau, Delta_D);
-- Pivot=A(N,I)
D(N) := D(N) - Delta_D; -- Locally D is only used for threshold test.
D(I) := D(I) + Delta_D;
Z(N) := Z(N) - Delta_D; -- Z is reinitialized to 0 each sweep, so Z
Z(I) := Z(I) + Delta_D; -- sums the small d's 1st. Helps a tad.
A(N,I) := Zero;
for j in Start_Col .. N-1 loop
g := A(j,N);
h := A(j,I);
A(j,N) := g-s*(h+g*tau);
A(j,I) := h+s*(g-h*tau);
end loop;
for j in N+1 .. I-1 loop
g := A(N,j);
h := A(j,I);
A(N,j) := g-s*(h+g*tau);
A(j,I) := h+s*(g-h*tau);
end loop;
for j in I+1 .. Final_Col loop
g := A(N,j);
h := A(I,j);
A(N,j) := g-s*(h+g*tau);
A(I,j) := h+s*(g-h*tau);
end loop;
if Eigenvectors_Desired then
for j in Start_Col .. Final_Col loop
g := Q_tr(N,j);
h := Q_tr(I,j);
Q_tr(N,j) := g-s*(h+g*tau);
Q_tr(I,j) := h+s*(g-h*tau);
end loop;
end if;
Total_No_of_Rotations := Total_No_of_Rotations + 1;
end if; -- if (Sweep_id > No_of_Preliminary_Sweeps)
end loop; --I loop (Col)
end loop; --N loop (Row)
for j in Start_Col .. Final_Col loop -- assume A not all initialized
B(j) := B(j) + Z(j);
D(j) := B(j);
Z(j) := Zero;
end loop;
end loop Sweep; --Sweep_id loop
end Eigen_Decompose;
---------------
-- Sort_Eigs --
---------------
procedure Sort_Eigs
(Eigenvals : in out Col_Vector;
Q_tr : in out Matrix; -- rows are the eigvectors
Start_Col : in Index := Index'First;
Final_Col : in Index := Index'Last;
Sort_Eigvecs_Also : in Boolean := False)
is
Max_Eig, tmp : Real;
Max_id : Index;
begin
if Start_Col < Final_Col then
for i in Start_Col .. Final_Col-1 loop
Max_Eig := Eigenvals(i); Max_id := i;
for j in i+1 .. Final_Col loop
if Eigenvals(j) > Max_Eig then
Max_Eig := Eigenvals(j); Max_id := j;
end if;
end loop;
tmp := Eigenvals(i);
Eigenvals(i) := Max_Eig;
Eigenvals(Max_id) := tmp;
-- swap rows of Q_tr:
if Sort_Eigvecs_Also then
for k in Start_Col .. Final_Col loop
tmp := Q_tr(i,k);
Q_tr(i,k) := Q_tr(Max_id,k);
Q_tr(Max_id,k) := tmp;
end loop;
end if;
end loop;
end if;
end Sort_Eigs;
end e_Jacobi_Eigen;
|
programs/oeis/014/A014306.asm | jmorken/loda | 1 | 14022 | ; A014306: a(n) = 0 if n of form m(m+1)(m+2)/6, otherwise 1.
; 0,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
lpb $0
add $4,1
add $2,$4
trn $2,3
trn $0,$2
add $1,1
mov $3,$0
trn $0,1
trn $1,$3
add $2,3
lpe
|
programs/oeis/273/A273669.asm | neoneye/loda | 22 | 27002 | <reponame>neoneye/loda<gh_stars>10-100
; A273669: Decimal representation ends with either 2 or 9.
; 2,9,12,19,22,29,32,39,42,49,52,59,62,69,72,79,82,89,92,99,102,109,112,119,122,129,132,139,142,149,152,159,162,169,172,179,182,189,192,199,202,209,212,219,222,229,232,239,242,249,252,259,262,269,272,279,282,289,292,299,302,309,312,319,322,329,332,339,342,349,352,359,362,369,372,379,382,389,392,399,402,409,412,419,422,429,432,439,442,449,452,459,462,469,472,479,482,489,492,499
mov $1,$0
mul $0,5
gcd $1,2
sub $0,$1
sub $0,$1
add $0,6
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/sort1.ads | best08618/asylo | 7 | 4507 | function sort1 (S : String) return String;
pragma Pure (sort1);
|
programs/oeis/307/A307681.asm | neoneye/loda | 22 | 89207 | ; A307681: Difference between the number of diagonals and the number of sides for a convex n-gon.
; -3,-2,0,3,7,12,18,25,33,42,52,63,75,88,102,117,133,150,168,187,207,228,250,273,297,322,348,375,403,432,462,493,525,558,592,627,663,700,738,777,817,858,900,943,987,1032,1078,1125,1173,1222,1272,1323,1375,1428,1482,1537,1593,1650,1708,1767,1827,1888,1950,2013,2077,2142,2208,2275
sub $1,$0
bin $1,2
sub $1,3
mov $0,$1
|
examples/GUIgeneric/GUIFeaturesPart4.agda | stephanadls/state-dependent-gui | 2 | 6054 | <reponame>stephanadls/state-dependent-gui<gh_stars>1-10
module GUIgeneric.GUIFeaturesPart4 where
open import GUIgeneric.Prelude renaming (addButton to addButton')
open import GUIgeneric.GUIDefinitions renaming (add to add'; add' to add)
open import GUIgeneric.GUI
open import GUIgeneric.GUIExampleLib
open import StateSizedIO.GUI.WxGraphicsLibLevel3 renaming (addButton to addButton')
open import GUIgeneric.GUIFeatures
open import GUIgeneric.GUIFeaturesPart2 hiding ( main )
open import GUIgeneric.GUIFeaturesPart3 hiding ( main )
open import GUIgeneric.GUIExample hiding (main )
open import Data.Product
open import Data.Fin
addStateFMachine : {BaseState : Set}
(vm : FMachine BaseState)
(Snew : Set)
(newSM : (s : Snew) →
SMachineState (BaseState ⊎ vm .AddStateF ⊎ Snew) (inj₂ (inj₂ s)))
→ FMachine BaseState
addStateFMachine {BaseState} vm Snew newSM .Features = vm .Features
addStateFMachine {BaseState} vm Snew newSM .AddStateF = vm .AddStateF ⊎ Snew
addStateFMachine {BaseState} vm Snew newSM .GUIF f (inj₁ s) =
mapFMachineHandle (inj₁ s) (vm .GUIF f (inj₁ s))
addStateFMachine {BaseState} vm Snew newSM .GUIF f (inj₂ (inj₁ s)) =
mapFMachineHandle (inj₂ s) (vm .GUIF f (inj₂ s))
addStateFMachine {BaseState} vm Snew newSM .GUIF f (inj₂ (inj₂ s)) .fSM = newSM s .fSM
addStateFMachine {BaseState} vm Snew newSM .GUIF f (inj₂ (inj₂ s)) .propSM = newSM s .propSM
addStateFMachine {BaseState} vm Snew newSM .GUIF f (inj₂ (inj₂ s)) .handlSM = newSM s .handlSM
addOneStateFMachine : {BaseState : Set}
(vm : FMachine BaseState)
(newSM : SMachineState (BaseState ⊎ vm .AddStateF ⊎ ⊤) (inj₂ (inj₂ _)))
→ FMachine BaseState
addOneStateFMachine vm newSM = addStateFMachine vm ⊤ λ _ → newSM
addDummyFeatures : {BaseState : Set}
(vm : FMachine BaseState)
(FeatureNew : Set)
→ FMachine BaseState
addDummyFeatures vm FeatureNew .Features = vm .Features × FeatureNew
addDummyFeatures vm FeatureNew .AddStateF = vm .AddStateF
addDummyFeatures vm FeatureNew .GUIF (f , _) s = vm .GUIF f s
{- handler for the new state to be added to the cancel machine -}
cancelNewStateSM : (vm : FMachine StateV) →
SMachineState (StateV ⊎ vm .AddStateF ⊎ ⊤) (inj₂ (inj₂ tt))
cancelNewStateSM vm = simpleSMState "Intermediate" (inj₁ s0)
{- add the state to the old feature machine -}
cancelStateAdded : FMachine StateV → FMachine StateV
cancelStateAdded vm = addOneStateFMachine vm (cancelNewStateSM vm)
{- add a dummy feature "FeatureCancel" to the feature machine -}
cancelFeatureAdded : FMachine StateV → FMachine StateV
cancelFeatureAdded vm = addDummyFeatures
(cancelStateAdded vm)
FeatureCancel
{- redefine in the feature machine one button -}
Cancel' : FMachine StateV → FMachine StateV
Cancel' vm .Features = cancelFeatureAdded vm .Features
Cancel' vm .AddStateF = cancelFeatureAdded vm .AddStateF
Cancel' vm .GUIF (f , yesCancel) (inj₁ s1) =
addBtn2StateMachine (cancelFeatureAdded vm .GUIF (f , yesCancel) (inj₁ s1))
"Cancel" (inj₂ (inj₂ _))
Cancel' vm .GUIF f s = cancelFeatureAdded vm .GUIF f s
main : NativeIO Unit
main = compileFeatureVM (Cancel' baseF) (_ , yesCancel) (inj₁ s0) --
|
tests/generic-unit/src/mission.adb | TUM-EI-RCS/StratoX | 12 | 20100 | <filename>tests/generic-unit/src/mission.adb<gh_stars>10-100
with System.Dim.Float_IO;
with Units; use Units;
with Config;
package body Mission with SPARK_Mode is
package SystemDimUnits is new System.Dim.Float_IO (Unit_Type);
use SystemDimUnits;
mstate : Mission_State_Type := ASCENDING;
procedure monitor_Ascend;
-- with Pre => True; -- adding this is a workaround
procedure monitor_Ascend is
height : Altitude_Type := 0.0 * Meter;
begin
if height >= Config.CFG_TARGET_ALTITUDE_THRESHOLD then -- error: both operands for operation ">=" must have same dimensions
null;
end if;
if height > 100.0 * Meter then -- this works
null;
end if;
Put(height, 1, 2, 0);
end monitor_Ascend;
procedure run_Mission is
begin
case (mstate) is
when UNKNOWN => null;
when ASCENDING =>
monitor_Ascend;
when others => null;
end case;
end run_Mission;
end Mission;
|
data/pokemon/base_stats/sneasel.asm | Karkino/KarkCrystal16 | 0 | 28750 | <filename>data/pokemon/base_stats/sneasel.asm<gh_stars>0
db 0 ; species ID placeholder
db 55, 95, 55, 115, 35, 75
; hp atk def spd sat sdf
db DARK, ICE ; type
db 60 ; catch rate
db 132 ; base exp
db NO_ITEM, QUICK_CLAW ; items
db GENDER_F50 ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/sneasel/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_MEDIUM_SLOW ; growth rate
dn EGG_GROUND, EGG_GROUND ; egg groups
; tm/hm learnset
tmhm DYNAMICPUNCH, HEADBUTT, CURSE, TOXIC, ROCK_SMASH, PSYCH_UP, DARK_PULSE, SNORE, BLIZZARD, ICY_WIND, PROTECT, RAIN_DANCE, POISON_FANG, IRON_HEAD, RETURN, DIG, SHADOW_BALL, DOUBLE_TEAM, ICE_PUNCH, SWAGGER, SLEEP_TALK, SWIFT, HI_JUMP_KICK, PURSUIT, REST, ATTRACT, THIEF, CUT, SURF, STRENGTH, ICE_BEAM
; end
|
main.asm | meowgle/FSystem | 0 | 173184 | ; [FSystem v0.0.1]
; Copyright 2021-2022 <NAME>
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
bits 16 ; We're dealing with 16 bit code
org 0x7c00 ; Inform the assembler of the starting location for this code
start:
mov cx, 0fh
mov dx, 4240h
mov ah, 86h
int 15h
call background ; set background
; shell
mov al, 70
call print
mov al, 83
call print
mov al, 42
call print
mov cx, 0fh
mov dx, 4240h
mov ah, 86h
int 15h
cld
call wait_for_option
wait_for_option:
; wait for the p key
mov ah,0
int 0x16
cmp al, 112
je progm
jl wait_for_option
jg wait_for_option
progm:
;this is all text stuff nothing really special
mov al, 80
call print
mov al, 82
call print
mov al, 71
call print
mov al, 13
call print
mov al, 10
call print
mov al, 32
call print
mov al, 76
call print
mov al, 79
call print
mov al, 65
call print
mov al, 68
call print
mov al, 46
call print
call print
call print
;clear flags before reading the program medium
cld
xor ax, ax ; make sure ds is set to 0
mov ds, ax
cld
mov dl, 81h ; set to read our disk
call read_disk
read_disk:
; start putting in values:
mov ah, 2h ; int13h function 2
mov al, 63 ; we want to read 63 sectors
mov ch, 0 ; from cylinder number 0
mov cl, 1 ; the sector number 2 - second sector (starts from 1, not 0)
mov dh, 0 ; head number 0
xor bx, bx
mov es, bx ; es should be 0
mov bx, 7e00h ; 512bytes from origin address 7c00h
int 13h ; read disk
call run_prog ; ready to execute our program!
run_prog:
;newline
mov al, 13
call print
mov al, 10
call print
cld ; clear flags before we jump
jmp 7e00h
cld ; clear flags and reset
call start
background:
mov ah, 06h ; scroll up function
xor al, al ; clear entire screen
xor cx, cx ; upper left corner ch=row, cl=column
mov dx, 184fh ; lower right corner dh=row, dl=column
mov bh, 7fh ; white on grey
int 10h
print:
; printing stuff
mov ah, 0x0e
mov bh, 0x00
mov bl, 0x09
int 0x10
ret
; Mark the device as bootable
times 510-($-$$) db 0 ; Add any additional zeroes to make 510 bytes in total
dw 0xAA55 ; Write the final 2 bytes as the magic number 0x55aa, remembering x86 little endian
|
unit_tests/sdl_suites.adb | Fabien-Chouteau/sdlada | 1 | 16196 | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, <NAME>
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL_Suites
--
-- Tests to check the Ada 2012 bindings for correctness.
--------------------------------------------------------------------------------------------------------------------
with AUnit; use AUnit;
with Pixel_Format_Test_Cases; use Pixel_Format_Test_Cases;
with Colour_Test_Cases; use Colour_Test_Cases;
package body SDL_Suites is
use Test_Suites;
Pixel_Tests : aliased Pixel_Format_Test_Cases.Pixel_Format_Test_Case;
Colour_Tests : aliased Colour_Test_Cases.Colour_Test_Case;
function Suite return Access_Test_Suite is
Result : Access_Test_Suite := AUnit.Test_Suites.New_Suite;
begin
Result.Add_Test (Pixel_Tests'Access);
Result.Add_Test (Colour_Tests'Access);
return Result;
end Suite;
end SDL_Suites;
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1457.asm | ljhsiun2/medusa | 9 | 176962 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xd370, %rdx
nop
nop
nop
nop
nop
add $44042, %r12
movb $0x61, (%rdx)
xor %rdx, %rdx
lea addresses_WT_ht+0x11d18, %rsi
lea addresses_D_ht+0x15770, %rdi
nop
nop
nop
nop
nop
xor %r9, %r9
mov $51, %rcx
rep movsw
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0x1ab50, %rdi
nop
nop
nop
nop
cmp %r12, %r12
mov (%rdi), %dx
nop
nop
nop
inc %r12
lea addresses_D_ht+0x15770, %rcx
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov $0x6162636465666768, %r9
movq %r9, (%rcx)
nop
nop
nop
sub %rcx, %rcx
lea addresses_D_ht+0x14e30, %rdi
nop
nop
nop
and $47533, %r11
mov (%rdi), %si
nop
nop
nop
and %rsi, %rsi
lea addresses_normal_ht+0x156fc, %r12
nop
sub $461, %rdi
movups (%r12), %xmm0
vpextrq $1, %xmm0, %rsi
nop
sub %rsi, %rsi
lea addresses_D_ht+0x6b70, %rdi
nop
and %r9, %r9
mov (%rdi), %r11w
nop
xor %rcx, %rcx
lea addresses_A_ht+0x10b70, %rdx
nop
nop
nop
nop
sub $6991, %r12
mov $0x6162636465666768, %r9
movq %r9, %xmm2
vmovups %ymm2, (%rdx)
and $24316, %r12
lea addresses_A_ht+0x4770, %rsi
xor $7889, %r11
mov $0x6162636465666768, %r12
movq %r12, %xmm5
vmovups %ymm5, (%rsi)
nop
nop
nop
xor %r11, %r11
lea addresses_normal_ht+0x2770, %rsi
nop
nop
nop
nop
nop
mfence
movw $0x6162, (%rsi)
nop
nop
nop
sub %rcx, %rcx
lea addresses_WT_ht+0x16d70, %rsi
lea addresses_UC_ht+0x18070, %rdi
clflush (%rsi)
nop
nop
nop
nop
sub $32068, %r14
mov $115, %rcx
rep movsl
nop
nop
nop
nop
nop
add $31629, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r8
push %rax
push %rbp
// Store
lea addresses_PSE+0x1c5f0, %r8
nop
nop
nop
nop
and $63339, %r12
mov $0x5152535455565758, %r14
movq %r14, %xmm7
vmovups %ymm7, (%r8)
and $27635, %r12
// Faulty Load
lea addresses_D+0xfb70, %r8
nop
nop
nop
nop
nop
cmp $6828, %r11
mov (%r8), %r14w
lea oracles, %rax
and $0xff, %r14
shlq $12, %r14
mov (%rax,%r14,1), %r14
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 32}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}}
{'src': {'NT': True, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': True, 'same': True, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 10, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
sources/driver/load_library.ads | reznikmm/jupyter | 4 | 2070 | -- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with League.Strings;
procedure Load_Library
(Name : League.Strings.Universal_String;
Error : out League.Strings.Universal_String);
|
LibraBFT/Hash.agda | cwjnkins/bft-consensus-agda | 0 | 2727 | {- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import LibraBFT.Prelude
open import LibraBFT.Lemmas
open import LibraBFT.Base.Encode
open import LibraBFT.Base.ByteString
-- This module defines Hash functions, and related properties
module LibraBFT.Hash where
-------------------------------------------------
-- Hash function postulates
--
-- We are now assuming that our 'auth' function is collision
-- resistant. We might be able to carry the full proof in agda,
-- but that can take place on another module.
Hash : Set
Hash = Σ ByteString (λ bs → length bs ≡ 4)
hashLen-pi : ∀ {bs : ByteString} {n : ℕ } → (p1 p2 : length bs ≡ n) → p1 ≡ p2
hashLen-pi {[]} {.0} refl refl = refl
hashLen-pi {h ∷ t} {.(suc (length t))} refl refl = refl
sameBS⇒sameHash : ∀ {h1 h2 : Hash}
→ proj₁ h1 ≡ proj₁ h2
→ h1 ≡ h2
sameBS⇒sameHash { h1a , h1b } { h2a , h2b } refl rewrite hashLen-pi {h2a} h1b h2b = refl
_≟Hash_ : (h₁ h₂ : Hash) → Dec (h₁ ≡ h₂)
(l , pl) ≟Hash (m , pm) with List-≡-dec (Vec-≡-dec _≟Bool_) l m
...| yes refl = yes (cong (_,_ l) (≡-pi pl pm))
...| no abs = no (abs ∘ ,-injectiveˡ)
encodeH : Hash → ByteString
encodeH (bs , _) = bs
encodeH-inj : ∀ i j → encodeH i ≡ encodeH j → i ≡ j
encodeH-inj (i , pi) (j , pj) refl = cong (_,_ i) (≡-pi pi pj)
encodeH-len : ∀{h} → length (encodeH h) ≡ 4
encodeH-len { bs , p } = p
encodeH-len-lemma : ∀ i j → length (encodeH i) ≡ length (encodeH j)
encodeH-len-lemma i j = trans (encodeH-len {i}) (sym (encodeH-len {j}))
-- Which means that we can make a helper function that combines
-- the necessary injections into one big injection
++b-2-inj : (h₁ h₂ : Hash){l₁ l₂ : Hash}
→ encodeH h₁ ++ encodeH l₁ ≡ encodeH h₂ ++ encodeH l₂
→ h₁ ≡ h₂ × l₁ ≡ l₂
++b-2-inj h₁ h₂ {l₁} {l₂} hip
with ++-inj {m = encodeH h₁} {n = encodeH h₂} (encodeH-len-lemma h₁ h₂) hip
...| hh , ll = encodeH-inj h₁ h₂ hh , encodeH-inj l₁ l₂ ll
Collision : {A B : Set}(f : A → B)(a₁ a₂ : A) → Set
Collision f a₁ a₂ = a₁ ≢ a₂ × f a₁ ≡ f a₂
instance
enc-Hash : Encoder Hash
enc-Hash = record
{ encode = encodeH
; encode-inj = encodeH-inj _ _
}
module WithCryptoHash
-- A Hash function maps a bytestring into a hash.
(hash : BitString → Hash)
(hash-cr : ∀{x y} → hash x ≡ hash y → Collision hash x y ⊎ x ≡ y) where
-- We define the concatenation of hashes like one would expect
hash-concat : List Hash → Hash
hash-concat l = hash (bs-concat (List-map encodeH l))
-- And voila, it is either injective ot we broke the hash function!
hash-concat-inj : ∀{l₁ l₂} → hash-concat l₁ ≡ hash-concat l₂ → NonInjective-≡ hash ⊎ l₁ ≡ l₂
hash-concat-inj {l₁} {l₂} hyp with hash-cr hyp
...| inj₁ col = inj₁ ((_ , _) , col)
...| inj₂ same with bs-concat-inj (List-map encodeH l₁) (List-map encodeH l₂) same
...| res = inj₂ (map-inj encodeH (encodeH-inj _ _) res)
where
map-inj : ∀{a b}{A : Set a}{B : Set b}(f : A → B)
→ (f-injective : ∀{a₁ a₂} → f a₁ ≡ f a₂ → a₁ ≡ a₂)
→ ∀{xs ys} → List-map f xs ≡ List-map f ys → xs ≡ ys
map-inj f finj {[]} {[]} hyp = refl
map-inj f finj {x ∷ xs} {y ∷ ys} hyp
= cong₂ _∷_ (finj (proj₁ (∷-injective hyp)))
(map-inj f finj (proj₂ (∷-injective hyp)))
|
Cubical/Algebra/Algebra/Base.agda | howsiyu/cubical | 0 | 3613 | <filename>Cubical/Algebra/Algebra/Base.agda
{-# OPTIONS --safe #-}
module Cubical.Algebra.Algebra.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Equiv.HalfAdjoint
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Function
open import Cubical.Foundations.SIP
open import Cubical.Data.Sigma
open import Cubical.Displayed.Base
open import Cubical.Displayed.Auto
open import Cubical.Displayed.Record
open import Cubical.Displayed.Universe
open import Cubical.Reflection.RecordEquiv
open import Cubical.Algebra.Module
open import Cubical.Algebra.Ring
open import Cubical.Algebra.AbGroup
open import Cubical.Algebra.Group
open import Cubical.Algebra.Monoid
open Iso
private
variable
ℓ ℓ' ℓ'' ℓ''' : Level
record IsAlgebra (R : Ring ℓ) {A : Type ℓ'}
(0a 1a : A) (_+_ _·_ : A → A → A) (-_ : A → A)
(_⋆_ : ⟨ R ⟩ → A → A) : Type (ℓ-max ℓ ℓ') where
constructor isalgebra
open RingStr (snd R) using (1r) renaming (_+_ to _+r_; _·_ to _·r_)
field
isLeftModule : IsLeftModule R 0a _+_ -_ _⋆_
·-isMonoid : IsMonoid 1a _·_
dist : (x y z : A) → (x · (y + z) ≡ (x · y) + (x · z))
× ((x + y) · z ≡ (x · z) + (y · z))
⋆-lassoc : (r : ⟨ R ⟩) (x y : A) → (r ⋆ x) · y ≡ r ⋆ (x · y)
⋆-rassoc : (r : ⟨ R ⟩) (x y : A) → r ⋆ (x · y) ≡ x · (r ⋆ y)
open IsLeftModule isLeftModule public
isRing : IsRing _ _ _ _ _
isRing = isring (IsLeftModule.+-isAbGroup isLeftModule) ·-isMonoid dist
open IsRing isRing public hiding (_-_; +Assoc; +Lid; +Linv; +Rid; +Rinv; +Comm)
unquoteDecl IsAlgebraIsoΣ = declareRecordIsoΣ IsAlgebraIsoΣ (quote IsAlgebra)
record AlgebraStr (R : Ring ℓ) (A : Type ℓ') : Type (ℓ-max ℓ ℓ') where
constructor algebrastr
field
0a : A
1a : A
_+_ : A → A → A
_·_ : A → A → A
-_ : A → A
_⋆_ : ⟨ R ⟩ → A → A
isAlgebra : IsAlgebra R 0a 1a _+_ _·_ -_ _⋆_
open IsAlgebra isAlgebra public
Algebra : (R : Ring ℓ) → ∀ ℓ' → Type (ℓ-max ℓ (ℓ-suc ℓ'))
Algebra R ℓ' = Σ[ A ∈ Type ℓ' ] AlgebraStr R A
module commonExtractors {R : Ring ℓ} where
Algebra→Module : (A : Algebra R ℓ') → LeftModule R ℓ'
Algebra→Module (_ , algebrastr A _ _ _ _ _ (isalgebra isLeftModule _ _ _ _)) =
_ , leftmodulestr A _ _ _ isLeftModule
Algebra→Ring : (A : Algebra R ℓ') → Ring ℓ'
Algebra→Ring (_ , str) = _ , ringstr _ _ _ _ _ (IsAlgebra.isRing (AlgebraStr.isAlgebra str))
Algebra→AbGroup : (A : Algebra R ℓ') → AbGroup ℓ'
Algebra→AbGroup A = LeftModule→AbGroup (Algebra→Module A)
Algebra→Group : (A : Algebra R ℓ') → Group ℓ'
Algebra→Group A = Ring→Group (Algebra→Ring A)
Algebra→AddMonoid : (A : Algebra R ℓ') → Monoid ℓ'
Algebra→AddMonoid A = Group→Monoid (Algebra→Group A)
Algebra→MultMonoid : (A : Algebra R ℓ') → Monoid ℓ'
Algebra→MultMonoid A = Ring→MultMonoid (Algebra→Ring A)
isSetAlgebra : (A : Algebra R ℓ') → isSet ⟨ A ⟩
isSetAlgebra A = isSetAbGroup (Algebra→AbGroup A)
open RingStr (snd R) using (1r; ·Ldist+) renaming (_+_ to _+r_; _·_ to _·s_)
makeIsAlgebra : {A : Type ℓ'} {0a 1a : A}
{_+_ _·_ : A → A → A} { -_ : A → A} {_⋆_ : ⟨ R ⟩ → A → A}
(isSet-A : isSet A)
(+-assoc : (x y z : A) → x + (y + z) ≡ (x + y) + z)
(+-rid : (x : A) → x + 0a ≡ x)
(+-rinv : (x : A) → x + (- x) ≡ 0a)
(+-comm : (x y : A) → x + y ≡ y + x)
(·-assoc : (x y z : A) → x · (y · z) ≡ (x · y) · z)
(·-rid : (x : A) → x · 1a ≡ x)
(·-lid : (x : A) → 1a · x ≡ x)
(·-rdist-+ : (x y z : A) → x · (y + z) ≡ (x · y) + (x · z))
(·-ldist-+ : (x y z : A) → (x + y) · z ≡ (x · z) + (y · z))
(⋆-assoc : (r s : ⟨ R ⟩) (x : A) → (r ·s s) ⋆ x ≡ r ⋆ (s ⋆ x))
(⋆-ldist : (r s : ⟨ R ⟩) (x : A) → (r +r s) ⋆ x ≡ (r ⋆ x) + (s ⋆ x))
(⋆-rdist : (r : ⟨ R ⟩) (x y : A) → r ⋆ (x + y) ≡ (r ⋆ x) + (r ⋆ y))
(⋆-lid : (x : A) → 1r ⋆ x ≡ x)
(⋆-lassoc : (r : ⟨ R ⟩) (x y : A) → (r ⋆ x) · y ≡ r ⋆ (x · y))
(⋆-rassoc : (r : ⟨ R ⟩) (x y : A) → r ⋆ (x · y) ≡ x · (r ⋆ y))
→ IsAlgebra R 0a 1a _+_ _·_ -_ _⋆_
makeIsAlgebra isSet-A
+-assoc +-rid +-rinv +-comm
·-assoc ·-rid ·-lid ·-rdist-+ ·-ldist-+
⋆-assoc ⋆-ldist ⋆-rdist ⋆-lid ⋆-lassoc ⋆-rassoc =
isalgebra
(makeIsLeftModule isSet-A
+-assoc +-rid +-rinv +-comm
⋆-assoc ⋆-ldist ⋆-rdist ⋆-lid)
(makeIsMonoid isSet-A ·-assoc ·-rid ·-lid)
(λ x y z → ·-rdist-+ x y z , ·-ldist-+ x y z)
⋆-lassoc ⋆-rassoc
open commonExtractors public
record IsAlgebraHom {R : Ring ℓ} {A : Type ℓ'} {B : Type ℓ''}
(M : AlgebraStr R A) (f : A → B) (N : AlgebraStr R B)
: Type (ℓ-max ℓ (ℓ-max ℓ' ℓ''))
where
-- Shorter qualified names
private
module M = AlgebraStr M
module N = AlgebraStr N
field
pres0 : f M.0a ≡ N.0a
pres1 : f M.1a ≡ N.1a
pres+ : (x y : A) → f (x M.+ y) ≡ f x N.+ f y
pres· : (x y : A) → f (x M.· y) ≡ f x N.· f y
pres- : (x : A) → f (M.- x) ≡ N.- (f x)
pres⋆ : (r : ⟨ R ⟩) (y : A) → f (r M.⋆ y) ≡ r N.⋆ f y
unquoteDecl IsAlgebraHomIsoΣ = declareRecordIsoΣ IsAlgebraHomIsoΣ (quote IsAlgebraHom)
open IsAlgebraHom
AlgebraHom : {R : Ring ℓ} (M : Algebra R ℓ') (N : Algebra R ℓ'') → Type (ℓ-max ℓ (ℓ-max ℓ' ℓ''))
AlgebraHom M N = Σ[ f ∈ (⟨ M ⟩ → ⟨ N ⟩) ] IsAlgebraHom (M .snd) f (N .snd)
IsAlgebraEquiv : {R : Ring ℓ} {A : Type ℓ'} {B : Type ℓ''}
(M : AlgebraStr R A) (e : A ≃ B) (N : AlgebraStr R B)
→ Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'')
IsAlgebraEquiv M e N = IsAlgebraHom M (e .fst) N
AlgebraEquiv : {R : Ring ℓ} (M : Algebra R ℓ') (N : Algebra R ℓ'') → Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'')
AlgebraEquiv M N = Σ[ e ∈ ⟨ M ⟩ ≃ ⟨ N ⟩ ] IsAlgebraEquiv (M .snd) e (N .snd)
_$a_ : {R : Ring ℓ} {A : Algebra R ℓ'} {B : Algebra R ℓ''} → AlgebraHom A B → ⟨ A ⟩ → ⟨ B ⟩
f $a x = fst f x
AlgebraEquiv→AlgebraHom : {R : Ring ℓ} {A : Algebra R ℓ'} {B : Algebra R ℓ''}
→ AlgebraEquiv A B → AlgebraHom A B
AlgebraEquiv→AlgebraHom (e , eIsHom) = e .fst , eIsHom
isPropIsAlgebra : (R : Ring ℓ) {A : Type ℓ'}
(0a 1a : A)
(_+_ _·_ : A → A → A)
(-_ : A → A)
(_⋆_ : ⟨ R ⟩ → A → A)
→ isProp (IsAlgebra R 0a 1a _+_ _·_ -_ _⋆_)
isPropIsAlgebra R _ _ _ _ _ _ = let open IsLeftModule in
isOfHLevelRetractFromIso 1 IsAlgebraIsoΣ
(isPropΣ
(isPropIsLeftModule _ _ _ _ _)
(λ mo → isProp×3 (isPropIsMonoid _ _)
(isPropΠ3 λ _ _ _ → isProp× (mo .is-set _ _) (mo .is-set _ _))
(isPropΠ3 λ _ _ _ → mo .is-set _ _)
(isPropΠ3 λ _ _ _ → mo .is-set _ _) ))
isPropIsAlgebraHom : (R : Ring ℓ) {A : Type ℓ'} {B : Type ℓ''}
(AS : AlgebraStr R A) (f : A → B) (BS : AlgebraStr R B)
→ isProp (IsAlgebraHom AS f BS)
isPropIsAlgebraHom R AS f BS = isOfHLevelRetractFromIso 1 IsAlgebraHomIsoΣ
(isProp×5 (isSetAlgebra (_ , BS) _ _)
(isSetAlgebra (_ , BS) _ _)
(isPropΠ2 λ _ _ → isSetAlgebra (_ , BS) _ _)
(isPropΠ2 λ _ _ → isSetAlgebra (_ , BS) _ _)
(isPropΠ λ _ → isSetAlgebra (_ , BS) _ _)
(isPropΠ2 λ _ _ → isSetAlgebra (_ , BS) _ _))
isSetAlgebraHom : {R : Ring ℓ} (M : Algebra R ℓ') (N : Algebra R ℓ'')
→ isSet (AlgebraHom M N)
isSetAlgebraHom _ N = isSetΣ (isSetΠ (λ _ → isSetAlgebra N))
λ _ → isProp→isSet (isPropIsAlgebraHom _ _ _ _)
isSetAlgebraEquiv : {R : Ring ℓ} (M N : Algebra R ℓ')
→ isSet (AlgebraEquiv M N)
isSetAlgebraEquiv M N = isSetΣ (isOfHLevel≃ 2 (isSetAlgebra M) (isSetAlgebra N))
λ _ → isProp→isSet (isPropIsAlgebraHom _ _ _ _)
AlgebraHom≡ : {R : Ring ℓ} {A B : Algebra R ℓ'} {φ ψ : AlgebraHom A B} → fst φ ≡ fst ψ → φ ≡ ψ
AlgebraHom≡ = Σ≡Prop λ f → isPropIsAlgebraHom _ _ f _
𝒮ᴰ-Algebra : (R : Ring ℓ) → DUARel (𝒮-Univ ℓ') (AlgebraStr R) (ℓ-max ℓ ℓ')
𝒮ᴰ-Algebra R =
𝒮ᴰ-Record (𝒮-Univ _) (IsAlgebraEquiv {R = R})
(fields:
data[ 0a ∣ nul ∣ pres0 ]
data[ 1a ∣ nul ∣ pres1 ]
data[ _+_ ∣ bin ∣ pres+ ]
data[ _·_ ∣ bin ∣ pres· ]
data[ -_ ∣ autoDUARel _ _ ∣ pres- ]
data[ _⋆_ ∣ autoDUARel _ _ ∣ pres⋆ ]
prop[ isAlgebra ∣ (λ _ _ → isPropIsAlgebra _ _ _ _ _ _ _) ])
where
open AlgebraStr
-- faster with some sharing
nul = autoDUARel (𝒮-Univ _) (λ A → A)
bin = autoDUARel (𝒮-Univ _) (λ A → A → A → A)
AlgebraPath : {R : Ring ℓ} (A B : Algebra R ℓ') → (AlgebraEquiv A B) ≃ (A ≡ B)
AlgebraPath {R = R} = ∫ (𝒮ᴰ-Algebra R) .UARel.ua
uaAlgebra : {R : Ring ℓ} {A B : Algebra R ℓ'} → AlgebraEquiv A B → A ≡ B
uaAlgebra {A = A} {B = B} = equivFun (AlgebraPath A B)
isGroupoidAlgebra : {R : Ring ℓ} → isGroupoid (Algebra R ℓ')
isGroupoidAlgebra _ _ = isOfHLevelRespectEquiv 2 (AlgebraPath _ _) (isSetAlgebraEquiv _ _)
-- Smart constructor for ring homomorphisms
-- that infers the other equations from pres1, pres+, and pres·
module _ {R : Ring ℓ} {A : Algebra R ℓ'} {B : Algebra R ℓ''} {f : ⟨ A ⟩ → ⟨ B ⟩} where
private
module A = AlgebraStr (A .snd)
module B = AlgebraStr (B .snd)
module _
(p1 : f A.1a ≡ B.1a)
(p+ : (x y : ⟨ A ⟩) → f (x A.+ y) ≡ f x B.+ f y)
(p· : (x y : ⟨ A ⟩) → f (x A.· y) ≡ f x B.· f y)
(p⋆ : (r : ⟨ R ⟩) (x : ⟨ A ⟩) → f (r A.⋆ x) ≡ r B.⋆ f x)
where
open IsAlgebraHom
private
isGHom : IsGroupHom (Algebra→Group A .snd) f (Algebra→Group B .snd)
isGHom = makeIsGroupHom p+
makeIsAlgebraHom : IsAlgebraHom (A .snd) f (B .snd)
makeIsAlgebraHom .pres0 = isGHom .IsGroupHom.pres1
makeIsAlgebraHom .pres1 = p1
makeIsAlgebraHom .pres+ = p+
makeIsAlgebraHom .pres· = p·
makeIsAlgebraHom .pres- = isGHom .IsGroupHom.presinv
makeIsAlgebraHom .pres⋆ = p⋆
|
BigNum/bnmodarith.asm | FloydZ/Crypto-Hash | 11 | 167109 | <gh_stars>10-100
.686
option casemap:none
include bnlib.inc
include bignum.inc
.code
bnBinGCD proc uses ebx edi esi bnX:DWORD, bnY:DWORD, bnResult:DWORD
bnCreateX esi,edi
xor ebx,ebx; k=0
invoke bnMov,esi,bnX;u=x
invoke bnMov,edi,bnY;v=y
.if !BN_IS_ODD(esi) && !BN_IS_ODD(edi)
.repeat
invoke bnShr1,esi
invoke bnShr1,edi
inc ebx
.until (BN_IS_ODD(esi)) || (BN_IS_ODD(edi))
.endif
.while !BN_IS_ZERO(esi)
.if !BN_IS_ODD(esi)
invoke bnShr1,esi
.elseif !BN_IS_ODD(edi)
invoke bnShr1,edi
.else
invoke bnCmp,esi,edi
test eax,eax
.if sign?
invoke bnSub,edi,esi
invoke bnShr1,edi
.else
invoke bnSub,esi,edi
invoke bnShr1,esi
.endif
.endif
.endw
invoke bnShl,edi,ebx
invoke bnMov,bnResult,edi
bnDestroyX
ret
bnBinGCD endp
;
; result=gcd(x,y)
; greatest common divisor (x,y)
; Modern Euclidean Algorithm
;
bnGCD proc uses ebx edi esi bnX:DWORD, bnY:DWORD, bnResult:DWORD
bnCreateX edi,ebx,esi
invoke bnMov,edi,bnX
invoke bnMov,esi,bnY
.while !BN_IS_ZERO(esi)
invoke bnMod,edi,esi,ebx; ebx = edi % esi
invoke bnMov,edi,esi ; edi = esi
invoke bnMov,esi,ebx ; esi = ebx
.endw
invoke bnMov,bnResult,edi
bnDestroyX
ret
bnGCD endp
;
; least common multiple
;
bnLCM proc uses edi esi bnX:DWORD, bnY:DWORD, bnR:DWORD
bnCreateX edi,esi
invoke bnGCD,bnX,bnY,edi
invoke bnMul,bnX,bnY,esi
invoke bnDiv,esi,edi,bnR,0
bnDestroyX
ret
bnLCM endp
;
; EQUALS POWMOD
; bnResult = bnX^bnExp mod bnModulus
;
bnModExp proc uses ebx edi esi bnX:DWORD, bnExp:DWORD, bnModulus:DWORD, bnResult:DWORD
mov eax,bnModulus
.if ! BN_IS_ZERO(eax)
.if BN_IS_ODD(eax)
invoke bnMontyModExp,bnX,bnExp,bnModulus,bnResult; 18* faster
ret
.endif
invoke bnCreatei,1
mov esi,bnExp
mov edi,eax
.if ! BN_IS_ZERO(esi)
invoke bnBits,esi
lea ebx,[eax-1]
jmp @F
.repeat
invoke bnSquare,edi
invoke bnMod,edi,bnModulus,edi
@@:
bt [esi].BN.dwArray[0],ebx
.if CARRY?
invoke bnMul,edi,bnX,edi
invoke bnMod,edi,bnModulus,edi
.endif
dec ebx
.until SIGN?
.endif
xor eax,eax
invoke bnMov,bnResult,edi
invoke bnDestroy,edi
.endif
ret
bnModExp endp
bnModInv proc uses ebx edi esi bnX:DWORD, bnN:DWORD, bnR:DWORD
LOCAL t0,t1
; invoke bnGCD,bnX,bnN,bnR
; mov eax,bnR
; .if BN_IS_ONE(eax);
invoke bnCreatei,1
mov t1,eax
bnCreateX ebx,edi,esi,t0
invoke bnMov,ebx,bnX
invoke bnMov,esi,bnN
.while 1
.if ABS_BN_IS_ONE(ebx)
invoke bnMov,bnR,t1
.break
.endif
invoke bnDiv,esi,ebx,edi,esi
invoke bnMul,edi,t1,bnR
invoke bnAdd,t0,bnR
.if ABS_BN_IS_ONE(esi)
invoke bnMov,bnR,bnN
invoke bnSub,bnR,t0 ; never <0
.break
.endif
invoke bnDiv,ebx,esi,edi,ebx
invoke bnMul,edi,t0,bnR
invoke bnAdd,t1,bnR
.endw
bnDestroyX
invoke bnDestroy,t1
ret
; .endif
; invoke bnClear,bnR
; ret
bnModInv endp
|
canonical-indeterminate-forms.agda | hazelgrove/hazelnut-agda | 0 | 6240 | open import Nat
open import Prelude
open import contexts
open import dynamics-core
open import type-assignment-unicity
module canonical-indeterminate-forms where
-- this type gives somewhat nicer syntax for the output of the canonical
-- forms lemma for indeterminates at num type
data cif-num : (Δ : hctx) (d : ihexp) → Set where
CIFNPlus1 : ∀{Δ d} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ]
((d == d1 ·+ d2) ×
(Δ , ∅ ⊢ d1 :: num) ×
(Δ , ∅ ⊢ d2 :: num) ×
(d1 indet) ×
(d2 final)
)
→ cif-num Δ d
CIFNPlus2 : ∀{Δ d} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ]
((d == d1 ·+ d2) ×
(Δ , ∅ ⊢ d1 :: num) ×
(Δ , ∅ ⊢ d2 :: num) ×
(d1 final) ×
(d2 indet)
)
→ cif-num Δ d
CIFNAp : ∀{Δ d} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ] Σ[ τ2 ∈ htyp ]
((d == d1 ∘ d2) ×
(Δ , ∅ ⊢ d1 :: τ2 ==> num) ×
(Δ , ∅ ⊢ d2 :: τ2) ×
(d1 indet) ×
(d2 final) ×
((τ3 τ4 τ3' τ4' : htyp) (d1' : ihexp) → d1 ≠ (d1' ⟨ τ3 ==> τ4 ⇒ τ3' ==> τ4' ⟩))
)
→ cif-num Δ d
CIFNCase : ∀{Δ d} →
Σ[ d1 ∈ ihexp ] Σ[ x ∈ Nat ] Σ[ d2 ∈ ihexp ] Σ[ y ∈ Nat ] Σ[ d3 ∈ ihexp ]
Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ]
((d == case d1 x d2 y d3) ×
(Δ , ∅ ⊢ d1 :: τ1 ⊕ τ2) ×
(Δ , ■ (x , τ1) ⊢ d2 :: num) ×
(Δ , ■ (y , τ2) ⊢ d3 :: num) ×
(d1 indet) ×
((τ : htyp) (d' : ihexp) → d1 ≠ inl τ d') ×
((τ : htyp) (d' : ihexp) → d1 ≠ inr τ d') ×
((τ3 τ4 τ3' τ4' : htyp) (d' : ihexp) →
d1 ≠ (d' ⟨(τ3 ⊕ τ4) ⇒ (τ3' ⊕ τ4')⟩))
)
→ cif-num Δ d
CIFNFst : ∀{Δ d} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == fst d') ×
(Δ , ∅ ⊢ d' :: num ⊠ τ') ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-num Δ d
CIFNSnd : ∀{Δ d} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == snd d') ×
(Δ , ∅ ⊢ d' :: τ' ⊠ num) ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-num Δ d
CIFNEHole : ∀{Δ d} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ Γ ∈ tctx ]
((d == ⦇-⦈⟨ u , σ ⟩) ×
((u :: num [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-num Δ d
CIFNNEHole : ∀{Δ d} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ Γ ∈ tctx ] Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == ⦇⌜ d' ⌟⦈⟨ u , σ ⟩) ×
(Δ , ∅ ⊢ d' :: τ') ×
(d' final) ×
((u :: num [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-num Δ d
CIFNCast : ∀{Δ d} →
Σ[ d' ∈ ihexp ]
((d == d' ⟨ ⦇-⦈ ⇒ num ⟩) ×
(Δ , ∅ ⊢ d' :: ⦇-⦈) ×
(d' indet) ×
((d'' : ihexp) (τ' : htyp) → d' ≠ (d'' ⟨ τ' ⇒ ⦇-⦈ ⟩))
)
→ cif-num Δ d
CIFNFailedCast : ∀{Δ d} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == d' ⟨ τ' ⇒⦇-⦈⇏ num ⟩) ×
(Δ , ∅ ⊢ d' :: τ') ×
(τ' ground) ×
(τ' ≠ num)
)
→ cif-num Δ d
canonical-indeterminate-forms-num : ∀{Δ d} →
Δ , ∅ ⊢ d :: num →
d indet →
cif-num Δ d
canonical-indeterminate-forms-num TANum ()
canonical-indeterminate-forms-num (TAPlus wt wt₁) (IPlus1 x x₁) = CIFNPlus1 (_ , _ , refl , wt , wt₁ , x , x₁)
canonical-indeterminate-forms-num (TAPlus wt wt₁) (IPlus2 x x₁) = CIFNPlus2 (_ , _ , refl , wt , wt₁ , x , x₁)
canonical-indeterminate-forms-num (TAVar x₁) ()
canonical-indeterminate-forms-num (TAAp wt wt₁) (IAp x ind x₁) = CIFNAp (_ , _ , _ , refl , wt , wt₁ , ind , x₁ , x)
canonical-indeterminate-forms-num {Δ = Δ} (TACase {τ1 = τ1} {τ2 = τ2} {x = x} {d1 = d1} {y = y} {d2 = d2} wt _ wt₁ _ wt₂) (ICase ninl ninr ncast ind) = CIFNCase (_ , _ , _ , _ , _ , _ , _ , refl , wt , tr (λ Γ' → Δ , Γ' ⊢ d1 :: num) (extend-empty x τ1) wt₁ , tr (λ Γ' → Δ , Γ' ⊢ d2 :: num) (extend-empty y τ2) wt₂ , ind , ninl , ninr , ncast)
canonical-indeterminate-forms-num (TAFst wt) (IFst x x₁ ind) = CIFNFst (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-num (TASnd wt) (ISnd x x₁ ind) = CIFNSnd (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-num (TAEHole x x₁) IEHole = CIFNEHole (_ , _ , _ , refl , x , x₁)
canonical-indeterminate-forms-num (TANEHole x wt x₁) (INEHole x₂) = CIFNNEHole (_ , _ , _ , _ , _ , refl , wt , x₂ , x , x₁)
canonical-indeterminate-forms-num (TACast wt x) (ICastHoleGround x₁ ind x₂) = CIFNCast (_ , refl , wt , ind , x₁)
canonical-indeterminate-forms-num (TAFailedCast x x₁ x₂ x₃) (IFailedCast x₄ x₅ x₆ x₇) = CIFNFailedCast (_ , _ , refl , x , x₅ , x₇)
-- this type gives somewhat nicer syntax for the output of the canonical
-- forms lemma for indeterminates at arrow type
data cif-arr : (Δ : hctx) (d : ihexp) (τ1 τ2 : htyp) → Set where
CIFAEHole : ∀{d Δ τ1 τ2} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ Γ ∈ tctx ]
((d == ⦇-⦈⟨ u , σ ⟩) ×
((u :: (τ1 ==> τ2) [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-arr Δ d τ1 τ2
CIFANEHole : ∀{d Δ τ1 τ2} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ] Σ[ Γ ∈ tctx ]
((d == ⦇⌜ d' ⌟⦈⟨ u , σ ⟩) ×
(Δ , ∅ ⊢ d' :: τ') ×
(d' final) ×
((u :: (τ1 ==> τ2) [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-arr Δ d τ1 τ2
CIFAAp : ∀{d Δ τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ] Σ[ τ2' ∈ htyp ] Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ]
((d == d1 ∘ d2) ×
(Δ , ∅ ⊢ d1 :: τ2' ==> (τ1 ==> τ2)) ×
(Δ , ∅ ⊢ d2 :: τ2') ×
(d1 indet) ×
(d2 final) ×
((τ3 τ4 τ3' τ4' : htyp) (d1' : ihexp) → d1 ≠ (d1' ⟨ τ3 ==> τ4 ⇒ τ3' ==> τ4' ⟩))
)
→ cif-arr Δ d τ1 τ2
CIFACase : ∀{Δ d τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ x ∈ Nat ] Σ[ d2 ∈ ihexp ] Σ[ y ∈ Nat ] Σ[ d3 ∈ ihexp ]
Σ[ τ3 ∈ htyp ] Σ[ τ4 ∈ htyp ]
((d == case d1 x d2 y d3) ×
(Δ , ∅ ⊢ d1 :: τ3 ⊕ τ4) ×
(Δ , ■ (x , τ3) ⊢ d2 :: τ1 ==> τ2) ×
(Δ , ■ (y , τ4) ⊢ d3 :: τ1 ==> τ2) ×
(d1 indet) ×
((τ : htyp) (d' : ihexp) → d1 ≠ inl τ d') ×
((τ : htyp) (d' : ihexp) → d1 ≠ inr τ d') ×
((τ5 τ6 τ5' τ6' : htyp) (d' : ihexp) →
d1 ≠ (d' ⟨(τ5 ⊕ τ6) ⇒ (τ5' ⊕ τ6')⟩))
)
→ cif-arr Δ d τ1 τ2
CIFAFst : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == fst d') ×
(Δ , ∅ ⊢ d' :: (τ1 ==> τ2) ⊠ τ') ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-arr Δ d τ1 τ2
CIFASnd : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == snd d') ×
(Δ , ∅ ⊢ d' :: τ' ⊠ (τ1 ==> τ2)) ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-arr Δ d τ1 τ2
CIFACast : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ] Σ[ τ1' ∈ htyp ] Σ[ τ2' ∈ htyp ]
((d == d' ⟨ (τ1' ==> τ2') ⇒ (τ1 ==> τ2) ⟩) ×
(Δ , ∅ ⊢ d' :: τ1' ==> τ2') ×
(d' indet) ×
((τ1' ==> τ2') ≠ (τ1 ==> τ2))
)
→ cif-arr Δ d τ1 τ2
CIFACastHole : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ]
((d == (d' ⟨ ⦇-⦈ ⇒ ⦇-⦈ ==> ⦇-⦈ ⟩)) ×
(τ1 == ⦇-⦈) ×
(τ2 == ⦇-⦈) ×
(Δ , ∅ ⊢ d' :: ⦇-⦈) ×
(d' indet) ×
((d'' : ihexp) (τ' : htyp) → d' ≠ (d'' ⟨ τ' ⇒ ⦇-⦈ ⟩))
)
→ cif-arr Δ d τ1 τ2
CIFAFailedCast : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == (d' ⟨ τ' ⇒⦇-⦈⇏ ⦇-⦈ ==> ⦇-⦈ ⟩) ) ×
(τ1 == ⦇-⦈) ×
(τ2 == ⦇-⦈) ×
(Δ , ∅ ⊢ d' :: τ') ×
(τ' ground) ×
(τ' ≠ (⦇-⦈ ==> ⦇-⦈))
)
→ cif-arr Δ d τ1 τ2
canonical-indeterminate-forms-arr : ∀{Δ d τ1 τ2 } →
Δ , ∅ ⊢ d :: (τ1 ==> τ2) →
d indet →
cif-arr Δ d τ1 τ2
canonical-indeterminate-forms-arr (TAVar x₁) ()
canonical-indeterminate-forms-arr (TALam _ wt) ()
canonical-indeterminate-forms-arr (TAAp wt wt₁) (IAp x ind x₁) = CIFAAp (_ , _ , _ , _ , _ , refl , wt , wt₁ , ind , x₁ , x)
canonical-indeterminate-forms-arr {Δ = Δ} (TACase {τ1 = τ1} {τ2 = τ2} {τ = τ3 ==> τ4} {x = x} {d1 = d1} {y = y} {d2 = d2} wt _ wt₁ _ wt₂) (ICase ninl ninr ncast ind) = CIFACase (_ , _ , _ , _ , _ , _ , _ , refl , wt , tr (λ Γ' → Δ , Γ' ⊢ d1 :: τ3 ==> τ4) (extend-empty x τ1) wt₁ , tr (λ Γ' → Δ , Γ' ⊢ d2 :: τ3 ==> τ4) (extend-empty y τ2) wt₂ , ind , ninl , ninr , ncast)
canonical-indeterminate-forms-arr (TAFst wt) (IFst x x₁ ind) = CIFAFst (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-arr (TASnd wt) (ISnd x x₁ ind) = CIFASnd (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-arr (TAEHole x x₁) IEHole = CIFAEHole (_ , _ , _ , refl , x , x₁)
canonical-indeterminate-forms-arr (TANEHole x wt x₁) (INEHole x₂) = CIFANEHole (_ , _ , _ , _ , _ , refl , wt , x₂ , x , x₁)
canonical-indeterminate-forms-arr (TACast wt x) (ICastArr x₁ ind) = CIFACast (_ , _ , _ , _ , _ , refl , wt , ind , x₁)
canonical-indeterminate-forms-arr (TACast wt TCHole2) (ICastHoleGround x₁ ind GArrHole) = CIFACastHole (_ , refl , refl , refl , wt , ind , x₁)
canonical-indeterminate-forms-arr (TAFailedCast x x₁ GArrHole x₃) (IFailedCast x₄ x₅ GArrHole x₇) = CIFAFailedCast (_ , _ , refl , refl , refl , x , x₅ , x₇)
-- this type gives somewhat nicer syntax for the output of the canonical
-- forms lemma for indeterminates at sum type
data cif-sum : (Δ : hctx) (d : ihexp) (τ1 τ2 : htyp) → Set where
CIFSEHole : ∀{d Δ τ1 τ2} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ Γ ∈ tctx ]
((d == ⦇-⦈⟨ u , σ ⟩) ×
((u :: (τ1 ⊕ τ2) [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-sum Δ d τ1 τ2
CIFSNEHole : ∀{d Δ τ1 τ2} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ] Σ[ Γ ∈ tctx ]
((d == ⦇⌜ d' ⌟⦈⟨ u , σ ⟩) ×
(Δ , ∅ ⊢ d' :: τ') ×
(d' final) ×
((u :: (τ1 ⊕ τ2) [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-sum Δ d τ1 τ2
CIFSAp : ∀{d Δ τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ] Σ[ τ2' ∈ htyp ] Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ]
((d == d1 ∘ d2) ×
(Δ , ∅ ⊢ d1 :: τ2' ==> (τ1 ⊕ τ2)) ×
(Δ , ∅ ⊢ d2 :: τ2') ×
(d1 indet) ×
(d2 final) ×
((τ3 τ4 τ3' τ4' : htyp) (d1' : ihexp) → d1 ≠ (d1' ⟨ τ3 ==> τ4 ⇒ τ3' ==> τ4' ⟩))
)
→ cif-sum Δ d τ1 τ2
CIFSInl : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ]
((d == inl τ2 d') ×
(Δ , ∅ ⊢ d' :: τ1) ×
(d' indet)
)
→ cif-sum Δ d τ1 τ2
CIFSInr : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ]
((d == inr τ1 d') ×
(Δ , ∅ ⊢ d' :: τ2) ×
(d' indet)
)
→ cif-sum Δ d τ1 τ2
CIFSCase : ∀{Δ d τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ x ∈ Nat ] Σ[ d2 ∈ ihexp ] Σ[ y ∈ Nat ] Σ[ d3 ∈ ihexp ]
Σ[ τ3 ∈ htyp ] Σ[ τ4 ∈ htyp ]
((d == case d1 x d2 y d3) ×
(Δ , ∅ ⊢ d1 :: τ3 ⊕ τ4) ×
(Δ , ■ (x , τ3) ⊢ d2 :: τ1 ⊕ τ2) ×
(Δ , ■ (y , τ4) ⊢ d3 :: τ1 ⊕ τ2) ×
(d1 indet) ×
((τ : htyp) (d' : ihexp) → d1 ≠ inl τ d') ×
((τ : htyp) (d' : ihexp) → d1 ≠ inr τ d') ×
((τ5 τ6 τ5' τ6' : htyp) (d' : ihexp) →
d1 ≠ (d' ⟨(τ5 ⊕ τ6) ⇒ (τ5' ⊕ τ6')⟩))
)
→ cif-sum Δ d τ1 τ2
CIFSFst : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == fst d') ×
(Δ , ∅ ⊢ d' :: (τ1 ⊕ τ2) ⊠ τ') ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-sum Δ d τ1 τ2
CIFSSnd : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == snd d') ×
(Δ , ∅ ⊢ d' :: τ' ⊠ (τ1 ⊕ τ2)) ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-sum Δ d τ1 τ2
CIFSCast : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ] Σ[ τ1' ∈ htyp ] Σ[ τ2' ∈ htyp ]
((d == d' ⟨ (τ1' ⊕ τ2') ⇒ (τ1 ⊕ τ2) ⟩) ×
(Δ , ∅ ⊢ d' :: τ1' ⊕ τ2') ×
(d' indet) ×
((τ1' ⊕ τ2') ≠ (τ1 ⊕ τ2))
)
→ cif-sum Δ d τ1 τ2
CIFSCastHole : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ]
((d == (d' ⟨ ⦇-⦈ ⇒ ⦇-⦈ ⊕ ⦇-⦈ ⟩)) ×
(τ1 == ⦇-⦈) ×
(τ2 == ⦇-⦈) ×
(Δ , ∅ ⊢ d' :: ⦇-⦈) ×
(d' indet) ×
((d'' : ihexp) (τ' : htyp) → d' ≠ (d'' ⟨ τ' ⇒ ⦇-⦈ ⟩))
)
→ cif-sum Δ d τ1 τ2
CIFSFailedCast : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == (d' ⟨ τ' ⇒⦇-⦈⇏ ⦇-⦈ ⊕ ⦇-⦈ ⟩) ) ×
(τ1 == ⦇-⦈) ×
(τ2 == ⦇-⦈) ×
(Δ , ∅ ⊢ d' :: τ') ×
(τ' ground) ×
(τ' ≠ (⦇-⦈ ⊕ ⦇-⦈))
)
→ cif-sum Δ d τ1 τ2
canonical-indeterminate-forms-sum : ∀{Δ d τ1 τ2 } →
Δ , ∅ ⊢ d :: (τ1 ⊕ τ2) →
d indet →
cif-sum Δ d τ1 τ2
canonical-indeterminate-forms-sum (TAAp wt wt₁) (IAp x ind x₁) = CIFSAp (_ , _ , _ , _ , _ , refl , wt , wt₁ , ind , x₁ , x)
canonical-indeterminate-forms-sum (TAInl wt) (IInl ind) = CIFSInl (_ , refl , wt , ind)
canonical-indeterminate-forms-sum (TAInr wt) (IInr ind) = CIFSInr (_ , refl , wt , ind)
canonical-indeterminate-forms-sum {Δ = Δ} (TACase {τ1 = τ1} {τ2 = τ2} {τ = τ3 ⊕ τ4} {x = x} {d1 = d1} {y = y} {d2 = d2} wt _ wt₁ _ wt₂) (ICase ninl ninr ncast ind) = CIFSCase (_ , _ , _ , _ , _ , _ , _ , refl , wt , tr (λ Γ' → Δ , Γ' ⊢ d1 :: (τ3 ⊕ τ4)) (extend-empty x τ1) wt₁ , tr (λ Γ' → Δ , Γ' ⊢ d2 :: (τ3 ⊕ τ4)) (extend-empty y τ2) wt₂ , ind , ninl , ninr , ncast)
canonical-indeterminate-forms-sum (TAFst wt) (IFst x x₁ ind) = CIFSFst (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-sum (TASnd wt) (ISnd x x₁ ind) = CIFSSnd (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-sum (TAEHole x x₁) IEHole = CIFSEHole (_ , _ , _ , refl , x , x₁)
canonical-indeterminate-forms-sum (TANEHole x wt x₁) (INEHole x₂) = CIFSNEHole (_ , _ , _ , _ , _ , refl , wt , x₂ , x , x₁)
canonical-indeterminate-forms-sum (TACast wt x) (ICastSum x₁ ind) = CIFSCast (_ , _ , _ , _ , _ , refl , wt , ind , x₁)
canonical-indeterminate-forms-sum (TACast wt x) (ICastHoleGround x₁ ind GSumHole) = CIFSCastHole (_ , refl , refl , refl , wt , ind , x₁)
canonical-indeterminate-forms-sum (TAFailedCast wt x x₁ x₂) (IFailedCast x₃ x₄ GSumHole x₆) = CIFSFailedCast (_ , _ , refl , refl , refl , wt , x₄ , x₆)
canonical-indeterminate-forms-sum (TAVar x) ()
-- this type gives somewhat nicer syntax for the output of the canonical
-- forms lemma for indeterminates at product type
data cif-prod : (Δ : hctx) (d : ihexp) (τ1 τ2 : htyp) → Set where
CIFPEHole : ∀{d Δ τ1 τ2} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ Γ ∈ tctx ]
((d == ⦇-⦈⟨ u , σ ⟩) ×
((u :: (τ1 ⊠ τ2) [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-prod Δ d τ1 τ2
CIFPNEHole : ∀{d Δ τ1 τ2} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ] Σ[ Γ ∈ tctx ]
((d == ⦇⌜ d' ⌟⦈⟨ u , σ ⟩) ×
(Δ , ∅ ⊢ d' :: τ') ×
(d' final) ×
((u :: (τ1 ⊠ τ2) [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-prod Δ d τ1 τ2
CIFPAp : ∀{d Δ τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ] Σ[ τ2' ∈ htyp ] Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ]
((d == d1 ∘ d2) ×
(Δ , ∅ ⊢ d1 :: τ2' ==> (τ1 ⊠ τ2)) ×
(Δ , ∅ ⊢ d2 :: τ2') ×
(d1 indet) ×
(d2 final) ×
((τ3 τ4 τ3' τ4' : htyp) (d1' : ihexp) → d1 ≠ (d1' ⟨ τ3 ==> τ4 ⇒ τ3' ==> τ4' ⟩))
)
→ cif-prod Δ d τ1 τ2
CIFPCase : ∀{Δ d τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ x ∈ Nat ] Σ[ d2 ∈ ihexp ] Σ[ y ∈ Nat ] Σ[ d3 ∈ ihexp ]
Σ[ τ3 ∈ htyp ] Σ[ τ4 ∈ htyp ]
((d == case d1 x d2 y d3) ×
(Δ , ∅ ⊢ d1 :: τ3 ⊕ τ4) ×
(Δ , ■ (x , τ3) ⊢ d2 :: τ1 ⊠ τ2) ×
(Δ , ■ (y , τ4) ⊢ d3 :: τ1 ⊠ τ2) ×
(d1 indet) ×
((τ : htyp) (d' : ihexp) → d1 ≠ inl τ d') ×
((τ : htyp) (d' : ihexp) → d1 ≠ inr τ d') ×
((τ5 τ6 τ5' τ6' : htyp) (d' : ihexp) →
d1 ≠ (d' ⟨(τ5 ⊕ τ6) ⇒ (τ5' ⊕ τ6')⟩))
)
→ cif-prod Δ d τ1 τ2
CIFPPair1 : ∀{Δ d τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ]
((d == ⟨ d1 , d2 ⟩) ×
(Δ , ∅ ⊢ d1 :: τ1) ×
(Δ , ∅ ⊢ d2 :: τ2) ×
d1 indet ×
d2 final
)
→ cif-prod Δ d τ1 τ2
CIFPPair2 : ∀{Δ d τ1 τ2} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ]
((d == ⟨ d1 , d2 ⟩) ×
(Δ , ∅ ⊢ d1 :: τ1) ×
(Δ , ∅ ⊢ d2 :: τ2) ×
d1 final ×
d2 indet
)
→ cif-prod Δ d τ1 τ2
CIFPFst : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == fst d') ×
(Δ , ∅ ⊢ d' :: (τ1 ⊠ τ2) ⊠ τ') ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-prod Δ d τ1 τ2
CIFPSnd : ∀{Δ d τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == snd d') ×
(Δ , ∅ ⊢ d' :: τ' ⊠ (τ1 ⊠ τ2)) ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-prod Δ d τ1 τ2
CIFPCast : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ] Σ[ τ1' ∈ htyp ] Σ[ τ2' ∈ htyp ]
((d == d' ⟨ (τ1' ⊠ τ2') ⇒ (τ1 ⊠ τ2) ⟩) ×
(Δ , ∅ ⊢ d' :: τ1' ⊠ τ2') ×
(d' indet) ×
((τ1' ⊠ τ2') ≠ (τ1 ⊠ τ2))
)
→ cif-prod Δ d τ1 τ2
CIFPCastHole : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ]
((d == (d' ⟨ ⦇-⦈ ⇒ ⦇-⦈ ⊠ ⦇-⦈ ⟩)) ×
(τ1 == ⦇-⦈) ×
(τ2 == ⦇-⦈) ×
(Δ , ∅ ⊢ d' :: ⦇-⦈) ×
(d' indet) ×
((d'' : ihexp) (τ' : htyp) → d' ≠ (d'' ⟨ τ' ⇒ ⦇-⦈ ⟩))
)
→ cif-prod Δ d τ1 τ2
CIFPFailedCast : ∀{d Δ τ1 τ2} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == (d' ⟨ τ' ⇒⦇-⦈⇏ ⦇-⦈ ⊠ ⦇-⦈ ⟩) ) ×
(τ1 == ⦇-⦈) ×
(τ2 == ⦇-⦈) ×
(Δ , ∅ ⊢ d' :: τ') ×
(τ' ground) ×
(τ' ≠ (⦇-⦈ ⊠ ⦇-⦈))
)
→ cif-prod Δ d τ1 τ2
canonical-indeterminate-forms-prod : ∀{Δ d τ1 τ2} →
Δ , ∅ ⊢ d :: (τ1 ⊠ τ2) →
d indet →
cif-prod Δ d τ1 τ2
canonical-indeterminate-forms-prod (TAVar x) ()
canonical-indeterminate-forms-prod (TAAp wt wt₁) (IAp x ind x₁) = CIFPAp (_ , _ , _ , _ , _ , refl , wt , wt₁ , ind , x₁ , x)
canonical-indeterminate-forms-prod {Δ = Δ} (TACase {τ1 = τ1} {τ2 = τ2} {τ = τ3 ⊠ τ4} {x = x} {d1 = d1} {y = y} {d2 = d2} wt _ wt₁ _ wt₂) (ICase ninl ninr ncast ind) = CIFPCase (_ , _ , _ , _ , _ , _ , _ , refl , wt , tr (λ Γ' → Δ , Γ' ⊢ d1 :: (τ3 ⊠ τ4)) (extend-empty x τ1) wt₁ , tr (λ Γ' → Δ , Γ' ⊢ d2 :: (τ3 ⊠ τ4)) (extend-empty y τ2) wt₂ , ind , ninl , ninr , ncast)
canonical-indeterminate-forms-prod (TAPair wt wt₁) (IPair1 ind x) = CIFPPair1 (_ , _ , refl , wt , wt₁ , ind , x)
canonical-indeterminate-forms-prod (TAPair wt wt₁) (IPair2 x ind) = CIFPPair2 (_ , _ , refl , wt , wt₁ , x , ind)
canonical-indeterminate-forms-prod (TAFst wt) (IFst x x₁ ind) = CIFPFst (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-prod (TASnd wt) (ISnd x x₁ ind) = CIFPSnd (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-prod (TAEHole x x₁) IEHole = CIFPEHole (_ , _ , _ , refl , x , x₁)
canonical-indeterminate-forms-prod (TANEHole x wt x₁) (INEHole x₂) = CIFPNEHole (_ , _ , _ , _ , _ , refl , wt , x₂ , x , x₁)
canonical-indeterminate-forms-prod (TACast wt x) (ICastProd x₁ ind) = CIFPCast (_ , _ , _ , _ , _ , refl , wt , ind , x₁)
canonical-indeterminate-forms-prod (TACast wt x) (ICastHoleGround x₁ ind GProdHole) = CIFPCastHole (_ , refl , refl , refl , wt , ind , x₁)
canonical-indeterminate-forms-prod (TAFailedCast wt x GProdHole x₂) (IFailedCast x₃ x₄ GProdHole x₆) = CIFPFailedCast (_ , _ , refl , refl , refl , wt , x₄ , x₆)
-- this type gives somewhat nicer syntax for the output of the canonical
-- forms lemma for indeterminates at hole type
data cif-hole : (Δ : hctx) (d : ihexp) → Set where
CIFHEHole : ∀{Δ d} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ Γ ∈ tctx ]
((d == ⦇-⦈⟨ u , σ ⟩) ×
((u :: ⦇-⦈ [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-hole Δ d
CIFHNEHole : ∀{Δ d} →
Σ[ u ∈ Nat ] Σ[ σ ∈ env ] Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ] Σ[ Γ ∈ tctx ]
((d == ⦇⌜ d' ⌟⦈⟨ u , σ ⟩) ×
(Δ , ∅ ⊢ d' :: τ') ×
(d' final) ×
((u :: ⦇-⦈ [ Γ ]) ∈ Δ) ×
(Δ , ∅ ⊢ σ :s: Γ)
)
→ cif-hole Δ d
CIFHAp : ∀{Δ d} →
Σ[ d1 ∈ ihexp ] Σ[ d2 ∈ ihexp ] Σ[ τ2 ∈ htyp ]
((d == d1 ∘ d2) ×
(Δ , ∅ ⊢ d1 :: (τ2 ==> ⦇-⦈)) ×
(Δ , ∅ ⊢ d2 :: τ2) ×
(d1 indet) ×
(d2 final) ×
((τ3 τ4 τ3' τ4' : htyp) (d1' : ihexp) → d1 ≠ (d1' ⟨ τ3 ==> τ4 ⇒ τ3' ==> τ4' ⟩))
)
→ cif-hole Δ d
CIFHCase : ∀{Δ d} →
Σ[ d1 ∈ ihexp ] Σ[ x ∈ Nat ] Σ[ d2 ∈ ihexp ] Σ[ y ∈ Nat ] Σ[ d3 ∈ ihexp ]
Σ[ τ1 ∈ htyp ] Σ[ τ2 ∈ htyp ]
((d == case d1 x d2 y d3) ×
(Δ , ∅ ⊢ d1 :: τ1 ⊕ τ2) ×
(Δ , ■ (x , τ1) ⊢ d2 :: ⦇-⦈) ×
(Δ , ■ (y , τ2) ⊢ d3 :: ⦇-⦈) ×
(d1 indet) ×
((τ : htyp) (d' : ihexp) → d1 ≠ inl τ d') ×
((τ : htyp) (d' : ihexp) → d1 ≠ inr τ d') ×
((τ3 τ4 τ3' τ4' : htyp) (d' : ihexp) →
d1 ≠ (d' ⟨(τ3 ⊕ τ4) ⇒ (τ3' ⊕ τ4')⟩))
)
→ cif-hole Δ d
CIFHFst : ∀{Δ d} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == fst d') ×
(Δ , ∅ ⊢ d' :: ⦇-⦈ ⊠ τ') ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-hole Δ d
CIFHSnd : ∀{Δ d} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == snd d') ×
(Δ , ∅ ⊢ d' :: τ' ⊠ ⦇-⦈) ×
(d' indet) ×
((d1 d2 : ihexp) → d' ≠ ⟨ d1 , d2 ⟩) ×
((τ3 τ4 τ3' τ4' : htyp) (d'' : ihexp) →
d' ≠ (d'' ⟨(τ3 ⊠ τ4) ⇒ (τ3' ⊠ τ4')⟩))
)
→ cif-hole Δ d
CIFHCast : ∀{Δ d} →
Σ[ d' ∈ ihexp ] Σ[ τ' ∈ htyp ]
((d == d' ⟨ τ' ⇒ ⦇-⦈ ⟩) ×
(Δ , ∅ ⊢ d' :: τ') ×
(τ' ground) ×
(d' indet)
)
→ cif-hole Δ d
canonical-indeterminate-forms-hole : ∀{Δ d} →
Δ , ∅ ⊢ d :: ⦇-⦈ →
d indet →
cif-hole Δ d
canonical-indeterminate-forms-hole (TAVar x₁) ()
canonical-indeterminate-forms-hole (TAAp wt wt₁) (IAp x ind x₁) = CIFHAp (_ , _ , _ , refl , wt , wt₁ , ind , x₁ , x)
canonical-indeterminate-forms-hole {Δ = Δ} (TACase {τ1 = τ1} {τ2 = τ2} {x = x} {d1 = d1} {y = y} {d2 = d2} wt _ wt₁ _ wt₂) (ICase ninl ninr ncast ind) = CIFHCase (_ , _ , _ , _ , _ , _ , _ , refl , wt , tr (λ Γ' → Δ , Γ' ⊢ d1 :: ⦇-⦈) (extend-empty x τ1) wt₁ , tr (λ Γ' → Δ , Γ' ⊢ d2 :: ⦇-⦈) (extend-empty y τ2) wt₂ , ind , ninl , ninr , ncast)
canonical-indeterminate-forms-hole (TAFst wt) (IFst x x₁ ind) = CIFHFst (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-hole (TASnd wt) (ISnd x x₁ ind) = CIFHSnd (_ , _ , refl , wt , ind , x , x₁)
canonical-indeterminate-forms-hole (TAEHole x x₁) IEHole = CIFHEHole (_ , _ , _ , refl , x , x₁)
canonical-indeterminate-forms-hole (TANEHole x wt x₁) (INEHole x₂) = CIFHNEHole (_ , _ , _ , _ , _ , refl , wt , x₂ , x , x₁)
canonical-indeterminate-forms-hole (TACast wt x) (ICastGroundHole x₁ ind) = CIFHCast (_ , _ , refl , wt , x₁ , ind)
canonical-indeterminate-forms-hole (TACast wt x) (ICastHoleGround x₁ ind ())
canonical-indeterminate-forms-hole (TAFailedCast x x₁ () x₃) (IFailedCast x₄ x₅ x₆ x₇)
canonical-indeterminate-forms-coverage : ∀{Δ d τ} →
Δ , ∅ ⊢ d :: τ →
d indet →
τ ≠ num →
((τ1 : htyp) (τ2 : htyp) → τ ≠ (τ1 ==> τ2)) →
((τ1 : htyp) (τ2 : htyp) → τ ≠ (τ1 ⊕ τ2)) →
((τ1 : htyp) (τ2 : htyp) → τ ≠ (τ1 ⊠ τ2)) →
τ ≠ ⦇-⦈ →
⊥
canonical-indeterminate-forms-coverage {τ = num} wt ind nn na ns np nh = nn refl
canonical-indeterminate-forms-coverage {τ = ⦇-⦈} wt ind nn na ns np nh = nh refl
canonical-indeterminate-forms-coverage {τ = τ ==> τ₁} wt ind nn na ns np nh = na τ τ₁ refl
canonical-indeterminate-forms-coverage {τ = τ ⊕ τ₁} wt ind nn na ns np nh = ns τ τ₁ refl
canonical-indeterminate-forms-coverage {τ = τ ⊠ τ₁} wt ind nn na ns np nh = np τ τ₁ refl
|
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_ix/sp1_IterateUpdateArr_callee.asm | jpoikela/z88dk | 640 | 91935 | <reponame>jpoikela/z88dk<gh_stars>100-1000
; void sp1_IterateUpdateArr(struct sp1_update **ua, void *hook)
SECTION code_clib
SECTION code_temp_sp1
PUBLIC _sp1_IterateUpdateArr_callee, l0_sp1_IterateUpdateArr_callee
EXTERN asm_sp1_IterateUpdateArr
_sp1_IterateUpdateArr_callee:
pop af
pop hl
pop bc
push af
l0_sp1_IterateUpdateArr_callee:
push bc
ex (sp),ix
call asm_sp1_IterateUpdateArr
pop ix
ret
|
src/fot/FOTC/Data/Colist.agda | asr/fotc | 11 | 14196 | <reponame>asr/fotc
------------------------------------------------------------------------------
-- Colists
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOTC.Data.Colist where
open import FOTC.Base
open import FOTC.Data.Colist.Type public
|
assembly/hello.asm | arthursiq5/programacao-progressiva | 0 | 163098 | <reponame>arthursiq5/programacao-progressiva<filename>assembly/hello.asm
section .data
msg db 'Como programar em Assembly - Curso Assembly Progressivo', 0AH
len equ $-msg
section .text
global _start
_start: mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 80h
mov ebx, 0
mov eax, 1
int 80h
|
dino/lcs/base/787.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 167152 | copyright zengfr site:http://github.com/zengfr/romhack
0209EE move.b ($c,A4), ($4b,A6) [base+742]
0209F4 move.b ($d,A4), ($70,A6) [base+787]
020B68 tst.b ($4b,A6)
020B6C beq $20bf2 [base+787]
022560 move.b ($c,A4), ($4b,A6)
022566 move.b ($d,A4), ($70,A6)
0226DC tst.b ($4b,A6)
0226E0 beq $22766
copyright zengfr site:http://github.com/zengfr/romhack
|
test/interaction/ParseHoleWhere.agda | cruhland/agda | 1,989 | 10224 | <reponame>cruhland/agda
-- Andreas, 2016-03-28, Issue 1920
-- Improve error message when user puts where clause in hole.
infix 3 _∎
postulate
A : Set
begin : A
_∎ : A → A
works : A
works = begin
∎
where b = begin
test : A
test = {!begin
∎
where b = begin
!}
|
src/factorial.asm | earaujoassis/machos-assembly | 1 | 18592 | <filename>src/factorial.asm<gh_stars>1-10
global _main
default rel
section .text
factorial_entry:
cmp rdi, 1 ; Check if n <= 1 and store ate `rdi`
jnbe factorial_recursive ; If not, perform a recursive call
mov rax, 1 ; Return 1, stored at `rax`
ret
factorial_recursive:
push rdi ; Push `n` on stack
dec rdi ; `n-1`
call factorial_entry ; `f(n-1)`, stored in `rax`
pop rdi ; Pop `n` from stack
imul rax, rdi ; `n * f(n-1)`, stored in `rax`
ret
_main:
mov rdi, 100 ; Factorial of 10
call factorial_entry ; Make the call
mov [value], rax
mov rax, 0x02000004 ; SYS_write setup (SYS_write at 4 bits offset from 0x02000000)
mov rdi, 1 ; SYS_write use STDOUT
mov rsi, value ; SYS_write argument
mov rdx, 3 ; SYS_write argument size (bytes)
syscall ; perform SYS_write
mov rax, 0x02000001 ; SYS_exit setup (SYS_write at 1 bit offset from 0x02000000)
xor rdi, rdi ; SYS_exit argument (return zero)
syscall ; perform SYS_exit
section .data
value:
db 0x00, 0x0A
|
programs/oeis/085/A085006.asm | jmorken/loda | 1 | 80696 | ; A085006: Let S(0)={1,1,2} S(n)={S(n-1), S(n-1)-{x},{3-x}} where x is the last element of S(n-1), then sequence is S(infinity).
; 1,1,2,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2
mul $0,2
add $0,3
lpb $0
div $0,3
gcd $0,1073741824
lpe
mov $1,$0
|
extra/extra/Module.agda | manikdv/plfa.github.io | 1,003 | 17542 | <reponame>manikdv/plfa.github.io<gh_stars>1000+
module Module where
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
_+_ : ℕ → ℕ → ℕ
zero + n = zero
suc m + n = suc (m + n)
import Data.Nat using (ℕ; zero; suc; _+_)
|
ada_gui-gnoga-gui-element-common.adb | jrcarter/Ada_GUI | 19 | 22138 | <reponame>jrcarter/Ada_GUI
-- Ada_GUI implementation based on Gnoga. Adapted 2021
-- --
-- GNOGA - The GNU Omnificent GUI for Ada --
-- --
-- G N O G A . G U I . E L E M E N T . C O M M O N --
-- --
-- B o d y --
-- --
-- --
-- Copyright (C) 2014 <NAME> --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- 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/>. --
-- --
-- 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. --
-- --
-- For more information please go to http://www.gnoga.com --
------------------------------------------------------------------------------
package body Ada_GUI.Gnoga.Gui.Element.Common is
-------------------------------------------------------------------------
-- A_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(A : in out A_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Link : in String := "";
Content : in String := "";
Target : in String := "_self";
ID : in String := "")
is
begin
A.Create_From_HTML (Parent, Escape_Quotes ("<a target='" & Target &
"' href='" & Escape_Inner_Quotes (Link) & "'>" &
Content & "</a>"), ID);
end Create;
----------
-- Link --
----------
procedure Link (A : in out A_Type; Value : String) is
begin
A.Property ("href", Value);
end Link;
function Link (A : A_Type) return String is
begin
return A.Property ("href");
end Link;
------------
-- Target --
------------
procedure Target (A : in out A_Type; Value : String) is
begin
A.Attribute ("target", Value);
end Target;
function Target (A : A_Type) return String is
begin
return A.Attribute ("target");
end Target;
-------------------------------------------------------------------------
-- Button_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(Button : in out Button_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Content : in String := "";
ID : in String := "")
is
begin
Button.Create_From_HTML
(Parent, Escape_Quotes ("<button type='button'>" & Content &
"</button>"), ID);
end Create;
--------------
-- Disabled --
--------------
procedure Disabled (Button : in out Button_Type;
Value : in Boolean := True)
is
begin
Button.Property ("disabled", Value);
end Disabled;
function Disabled (Button : Button_Type) return Boolean is
begin
return Button.Property ("disabled");
end Disabled;
-------------------------------------------------------------------------
-- DIV_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(DIV : in out DIV_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Content : in String := "";
ID : in String := "")
is
begin
DIV.Create_From_HTML (Parent, "<div>" & Escape_Quotes (Content) &
"</div>", ID);
end Create;
-------------------------------------------------------------------------
-- P_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(P : in out P_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Content : in String := "";
ID : in String := "")
is
begin
P.Create_From_HTML (Parent, "<p>" & Escape_Quotes (Content) &
"</p>", ID);
end Create;
-------------------------------------------------------------------------
-- IMG_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(IMG : in out IMG_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
URL_Source : in String := "";
Alternative_Text : in String := "";
ID : in String := "")
is
begin
IMG.Create_From_HTML (Parent,
Escape_Quotes ("<img src='" & Escape_Inner_Quotes (URL_Source) &
"' Alt='" & Escape_Inner_Quotes (Alternative_Text) &
"'>"), ID);
end Create;
-----------------
-- URL_Source --
-----------------
procedure URL_Source (IMG : in out IMG_Type; Value : in String) is
begin
IMG.Attribute ("src", Value);
end URL_Source;
-------------------------------------------------------------------------
-- HR_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(HR : in out HR_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
ID : in String := "")
is
begin
HR.Create_From_HTML (Parent, "<hr />", ID);
end Create;
-------------------------------------------------------------------------
-- BR_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(BR : in out BR_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
ID : in String := "")
is
begin
BR.Create_From_HTML (Parent, "<br />", ID);
end Create;
-------------------------------------------------------------------------
-- Meter_Type - Creation Methods
-------------------------------------------------------------------------
procedure Create (Meter : in out Meter_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Value : in Integer := 0;
High : in Integer := 100;
Low : in Integer := 0;
Maximum : in Integer := 100;
Minimum : in Integer := 0;
Optimum : in Integer := 50;
ID : in String := "")
is
pragma Unreferenced (ID);
begin
Meter.Create_From_HTML (Parent,
"<meter high=" & High'Img &
" low=" & Low'Img &
" max=" & Maximum'Img &
" min=" & Minimum'Img &
" optimum=" & Optimum'Img &
" value=" & Value'Img &
" />");
end Create;
procedure Value (Meter : in out Meter_Type; Value : in Integer) is
begin
Meter.Property ("value", Value);
end Value;
function Value (Meter : Meter_Type) return Integer is
begin
return Meter.Property ("value");
end Value;
procedure High (Meter : in out Meter_Type; Value : in Integer) is
begin
Meter.Property ("high", Value);
end High;
function High (Meter : Meter_Type) return Integer is
begin
return Meter.Property ("high");
end High;
procedure Low (Meter : in out Meter_Type; Value : in Integer) is
begin
Meter.Property ("low", Value);
end Low;
function Low (Meter : Meter_Type) return Integer is
begin
return Meter.Property ("low");
end Low;
procedure Maximum (Meter : in out Meter_Type; Value : in Integer) is
begin
Meter.Property ("max", Value);
end Maximum;
function Maximum (Meter : Meter_Type) return Integer is
begin
return Meter.Property ("max");
end Maximum;
procedure Minimum (Meter : in out Meter_Type; Value : in Integer) is
begin
Meter.Property ("min", Value);
end Minimum;
function Minimum (Meter : Meter_Type) return Integer is
begin
return Meter.Property ("min");
end Minimum;
procedure Optimum (Meter : in out Meter_Type; Value : in Integer) is
begin
Meter.Property ("optimum", Value);
end Optimum;
function Optimum (Meter : Meter_Type) return Integer is
begin
return Meter.Property ("optimum");
end Optimum;
-------------------------------------------------------------------------
-- Progress_Bar_Type - Creation Methods
-------------------------------------------------------------------------
procedure Create (Progress_Bar : in out Progress_Bar_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Value : in Integer := 0;
Maximum : in Integer := 100;
ID : in String := "")
is
pragma Unreferenced (ID);
begin
Progress_Bar.Create_From_HTML (Parent,
"<progress" &
" max=" & Maximum'Img &
" value=" & Value'Img &
" />");
end Create;
procedure Value (Progress_Bar : in out Progress_Bar_Type;
Value : in Integer)
is
begin
Progress_Bar.Property ("value", Value);
end Value;
function Value (Progress_Bar : Progress_Bar_Type) return Integer is
begin
return Progress_Bar.Property ("value");
end Value;
procedure Maximum (Progress_Bar : in out Progress_Bar_Type;
Value : in Integer)
is
begin
Progress_Bar.Property ("max", Value);
end Maximum;
function Maximum (Progress_Bar : Progress_Bar_Type) return Integer is
begin
return Progress_Bar.Property ("max");
end Maximum;
-------------------------------------------------------------------------
-- Span_Types
-------------------------------------------------------------------------
------------
-- Create --
------------
procedure Create
(Span : in out Span_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Content : in String := "";
ID : in String := "")
is
begin
Span.Create_From_HTML (Parent, "<span>" & Escape_Quotes (Content) &
"</span>", ID);
end Create;
end Ada_GUI.Gnoga.Gui.Element.Common;
|
3-mid/impact/source/3d/impact-d3.adb | charlie5/lace | 20 | 11990 | package body Impact.d3
is
-- C-ish types
--
function to_C (From : in math.Vector_3) return c_Vector_3
is
begin
return (From (1),
From (2),
From (3));
end to_C;
function to_Math (From : in c_Vector_3) return math.Vector_3
is
begin
return (From (0),
From (1),
From (2));
end to_Math;
end Impact.d3;
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1106.asm | ljhsiun2/medusa | 9 | 23963 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x16227, %r13
nop
nop
nop
nop
nop
and %rbx, %rbx
mov (%r13), %r8d
nop
nop
nop
nop
nop
and %r15, %r15
lea addresses_UC_ht+0xd57b, %r12
clflush (%r12)
nop
nop
nop
nop
inc %r15
mov $0x6162636465666768, %rbx
movq %rbx, %xmm2
movups %xmm2, (%r12)
xor $35201, %r8
lea addresses_UC_ht+0x14c1d, %rsi
lea addresses_A_ht+0x1527, %rdi
nop
nop
nop
nop
nop
dec %r15
mov $59, %rcx
rep movsl
nop
nop
nop
nop
dec %r8
lea addresses_normal_ht+0xe927, %rcx
clflush (%rcx)
nop
nop
nop
nop
sub $49375, %rbx
movl $0x61626364, (%rcx)
nop
nop
nop
add $20260, %r12
lea addresses_A_ht+0x3077, %rcx
mfence
mov $0x6162636465666768, %rbx
movq %rbx, %xmm7
and $0xffffffffffffffc0, %rcx
vmovaps %ymm7, (%rcx)
nop
cmp $47918, %rsi
lea addresses_D_ht+0xa027, %rsi
lea addresses_A_ht+0x1077, %rdi
nop
nop
nop
nop
sub %r8, %r8
mov $44, %rcx
rep movsb
sub %rcx, %rcx
lea addresses_WT_ht+0xffe7, %rdi
nop
nop
nop
nop
nop
cmp %rcx, %rcx
movups (%rdi), %xmm1
vpextrq $1, %xmm1, %r8
dec %r13
lea addresses_UC_ht+0x2e27, %rsi
lea addresses_A_ht+0x1ac27, %rdi
nop
nop
nop
nop
add $63401, %r15
mov $46, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_UC_ht+0x7627, %rbx
nop
nop
nop
nop
dec %rcx
mov $0x6162636465666768, %r8
movq %r8, %xmm6
vmovups %ymm6, (%rbx)
add %rcx, %rcx
lea addresses_D_ht+0x6097, %rcx
nop
sub %r15, %r15
mov $0x6162636465666768, %r13
movq %r13, (%rcx)
nop
nop
and $46703, %r8
lea addresses_WC_ht+0x15727, %rsi
clflush (%rsi)
nop
nop
nop
nop
and %rdi, %rdi
mov (%rsi), %ecx
add $36953, %rsi
lea addresses_WC_ht+0x54d7, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
and %r13, %r13
mov $0x6162636465666768, %r12
movq %r12, %xmm7
movups %xmm7, (%rcx)
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_UC_ht+0x8c27, %rbx
nop
add $50322, %r15
mov $0x6162636465666768, %r13
movq %r13, %xmm2
vmovups %ymm2, (%rbx)
nop
nop
nop
xor %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r9
push %rax
push %rdi
// Faulty Load
lea addresses_A+0x1bc27, %rdi
clflush (%rdi)
nop
nop
nop
add %rax, %rax
mov (%rdi), %r9
lea oracles, %rdi
and $0xff, %r9
shlq $12, %r9
mov (%rdi,%r9,1), %r9
pop %rdi
pop %rax
pop %r9
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': True, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC_ht', 'same': True, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
test/Succeed/Reflection.agda | hborum/agda | 0 | 1333 | {-# OPTIONS --universe-polymorphism #-}
module Reflection where
open import Common.Prelude hiding (Unit; module Unit) renaming (Nat to ℕ; module Nat to ℕ)
open import Common.Reflection
open import Common.Equality
open import Agda.Builtin.TrustMe
data Id {A : Set}(x : A) : (B : Set) → B → Set where
course : Id x A x
open import Common.Level
set₀ : Type
set₀ = sort (lit 0)
unCheck : Term → Term
unCheck (def x (_ ∷ _ ∷ arg _ t ∷ [])) = t
unCheck t = unknown
infix 1 _is_of_
data Check {a}{A : Set a}(x : A) : Set where
_is_of_ : (t t′ : Term) →
Id (primTrustMe {x = unCheck t} {t′})
(t′ ≡ t′) refl → Check x
`Check : QName
`Check = quote Check
test₁ : Check ({A : Set} → A → A)
test₁ = quoteGoal t in
t is pi (hArg set₀) (abs "A" (pi (vArg (var 0 [])) (abs "_" (var 1 []))))
of course
test₂ : (X : Set) → Check (λ (x : X) → x)
test₂ X = quoteGoal t in
t is lam visible (abs "x" (var 0 [])) of course
infixr 5 _`∷_
pattern _`∷_ x xs = con (quote _∷_) (hArg unknown ∷ hArg unknown ∷ vArg x ∷ vArg xs ∷ [])
pattern `[] = con (quote []) (hArg unknown ∷ hArg unknown ∷ [])
pattern `true = con (quote true) []
pattern `false = con (quote false) []
test₃ : Check (true ∷ false ∷ [])
test₃ = quoteGoal t in
t is (`true `∷ `false `∷ `[]) of course
`List : Term → Term
`List A = def (quote List) (hArg (def (quote lzero) []) ∷ vArg A ∷ [])
`ℕ = def (quote ℕ) []
`Term : Term
`Term = def (quote Term) []
`Type : Term
`Type = def (quote Type) []
`Sort : Term
`Sort = def (quote Sort) []
test₄ : Check (List ℕ)
test₄ = quoteGoal t in
t is `List `ℕ of course
postulate
a : ℕ
test₁₄ : Check 1
test₁₄ = quoteGoal t in t is lit (nat 1) of course
record R : Set₁ where
field
A : Set
macro
RA : Term → TC _
RA goal = bindTC (getDefinition (quote R)) λ where
(recordDef _ (vArg A ∷ [])) → unify goal (def A [])
_ → typeError (strErr "Impossible" ∷ [])
test₁₅ : RA ≡ R.A
test₁₅ = refl
|
programs/oeis/023/A023577.asm | neoneye/loda | 22 | 92974 | <reponame>neoneye/loda
; A023577: Greatest exponent in prime-power factorization of prime(n)+3.
; 1,1,3,1,1,4,2,1,1,5,1,3,2,1,2,3,1,6,1,1,2,1,1,2,2,3,1,1,4,2,1,1,2,1,3,1,5,1,1,4,1,3,1,2,3,1,1,1,1,3,2,2,2,1,2,1,4,1,3,2,1,3,1,1,2,6,1,2,2,5,2,1,1,3,1,1,3,4,2,2,1,3,1,2,1,1,2,2,4,1,1,1,2,1,1,1,9,2,1,5
seq $0,40 ; The prime numbers.
add $0,2
seq $0,51903 ; Maximal exponent in prime factorization of n.
|
gcc-gcc-7_3_0-release/gcc/ada/makeutl.adb | best08618/asylo | 7 | 8365 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- M A K E U T L --
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with ALI; use ALI;
with Atree; use Atree;
with Debug;
with Err_Vars; use Err_Vars;
with Errutil;
with Fname;
with Osint; use Osint;
with Output; use Output;
with Opt; use Opt;
with Prj.Com;
with Prj.Err;
with Prj.Ext;
with Prj.Util; use Prj.Util;
with Sinput.P;
with Tempdir;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Unchecked_Deallocation;
with GNAT.Case_Util; use GNAT.Case_Util;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.HTable;
with GNAT.Regexp; use GNAT.Regexp;
package body Makeutl is
type Linker_Options_Data is record
Project : Project_Id;
Options : String_List_Id;
end record;
Linker_Option_Initial_Count : constant := 20;
Linker_Options_Buffer : String_List_Access :=
new String_List (1 .. Linker_Option_Initial_Count);
Last_Linker_Option : Natural := 0;
package Linker_Opts is new Table.Table (
Table_Component_Type => Linker_Options_Data,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Make.Linker_Opts");
procedure Add_Linker_Option (Option : String);
---------
-- Add --
---------
procedure Add
(Option : String_Access;
To : in out String_List_Access;
Last : in out Natural)
is
begin
if Last = To'Last then
declare
New_Options : constant String_List_Access :=
new String_List (1 .. To'Last * 2);
begin
New_Options (To'Range) := To.all;
-- Set all elements of the original options to null to avoid
-- deallocation of copies.
To.all := (others => null);
Free (To);
To := New_Options;
end;
end if;
Last := Last + 1;
To (Last) := Option;
end Add;
procedure Add
(Option : String;
To : in out String_List_Access;
Last : in out Natural)
is
begin
Add (Option => new String'(Option), To => To, Last => Last);
end Add;
-----------------------
-- Add_Linker_Option --
-----------------------
procedure Add_Linker_Option (Option : String) is
begin
if Option'Length > 0 then
if Last_Linker_Option = Linker_Options_Buffer'Last then
declare
New_Buffer : constant String_List_Access :=
new String_List
(1 .. Linker_Options_Buffer'Last +
Linker_Option_Initial_Count);
begin
New_Buffer (Linker_Options_Buffer'Range) :=
Linker_Options_Buffer.all;
Linker_Options_Buffer.all := (others => null);
Free (Linker_Options_Buffer);
Linker_Options_Buffer := New_Buffer;
end;
end if;
Last_Linker_Option := Last_Linker_Option + 1;
Linker_Options_Buffer (Last_Linker_Option) := new String'(Option);
end if;
end Add_Linker_Option;
-------------------
-- Absolute_Path --
-------------------
function Absolute_Path
(Path : Path_Name_Type;
Project : Project_Id) return String
is
begin
Get_Name_String (Path);
declare
Path_Name : constant String := Name_Buffer (1 .. Name_Len);
begin
if Is_Absolute_Path (Path_Name) then
return Path_Name;
else
declare
Parent_Directory : constant String :=
Get_Name_String
(Project.Directory.Display_Name);
begin
return Parent_Directory & Path_Name;
end;
end if;
end;
end Absolute_Path;
----------------------------
-- Aggregate_Libraries_In --
----------------------------
function Aggregate_Libraries_In (Tree : Project_Tree_Ref) return Boolean is
List : Project_List;
begin
List := Tree.Projects;
while List /= null loop
if List.Project.Qualifier = Aggregate_Library then
return True;
end if;
List := List.Next;
end loop;
return False;
end Aggregate_Libraries_In;
-------------------------
-- Base_Name_Index_For --
-------------------------
function Base_Name_Index_For
(Main : String;
Main_Index : Int;
Index_Separator : Character) return File_Name_Type
is
Result : File_Name_Type;
begin
Name_Len := 0;
Add_Str_To_Name_Buffer (Base_Name (Main));
-- Remove the extension, if any, that is the last part of the base name
-- starting with a dot and following some characters.
for J in reverse 2 .. Name_Len loop
if Name_Buffer (J) = '.' then
Name_Len := J - 1;
exit;
end if;
end loop;
-- Add the index info, if index is different from 0
if Main_Index > 0 then
Add_Char_To_Name_Buffer (Index_Separator);
declare
Img : constant String := Main_Index'Img;
begin
Add_Str_To_Name_Buffer (Img (2 .. Img'Last));
end;
end if;
Result := Name_Find;
return Result;
end Base_Name_Index_For;
------------------------------
-- Check_Source_Info_In_ALI --
------------------------------
function Check_Source_Info_In_ALI
(The_ALI : ALI_Id;
Tree : Project_Tree_Ref) return Name_Id
is
Result : Name_Id := No_Name;
Unit_Name : Name_Id;
begin
-- Loop through units
for U in ALIs.Table (The_ALI).First_Unit ..
ALIs.Table (The_ALI).Last_Unit
loop
-- Check if the file name is one of the source of the unit
Get_Name_String (Units.Table (U).Uname);
Name_Len := Name_Len - 2;
Unit_Name := Name_Find;
if File_Not_A_Source_Of (Tree, Unit_Name, Units.Table (U).Sfile) then
return No_Name;
end if;
if Result = No_Name then
Result := Unit_Name;
end if;
-- Loop to do same check for each of the withed units
for W in Units.Table (U).First_With .. Units.Table (U).Last_With loop
declare
WR : ALI.With_Record renames Withs.Table (W);
begin
if WR.Sfile /= No_File then
Get_Name_String (WR.Uname);
Name_Len := Name_Len - 2;
Unit_Name := Name_Find;
if File_Not_A_Source_Of (Tree, Unit_Name, WR.Sfile) then
return No_Name;
end if;
end if;
end;
end loop;
end loop;
-- Loop to check subunits and replaced sources
for D in ALIs.Table (The_ALI).First_Sdep ..
ALIs.Table (The_ALI).Last_Sdep
loop
declare
SD : Sdep_Record renames Sdep.Table (D);
begin
Unit_Name := SD.Subunit_Name;
if Unit_Name = No_Name then
-- Check if this source file has been replaced by a source with
-- a different file name.
if Tree /= null and then Tree.Replaced_Source_Number > 0 then
declare
Replacement : constant File_Name_Type :=
Replaced_Source_HTable.Get
(Tree.Replaced_Sources, SD.Sfile);
begin
if Replacement /= No_File then
if Verbose_Mode then
Write_Line
("source file"
& Get_Name_String (SD.Sfile)
& " has been replaced by "
& Get_Name_String (Replacement));
end if;
return No_Name;
end if;
end;
end if;
-- Check that a dependent source for a unit that is from a
-- project is indeed a source of this unit.
Unit_Name := SD.Unit_Name;
if Unit_Name /= No_Name
and then not Fname.Is_Internal_File_Name (SD.Sfile)
and then File_Not_A_Source_Of (Tree, Unit_Name, SD.Sfile)
then
return No_Name;
end if;
else
-- For separates, the file is no longer associated with the
-- unit ("proc-sep.adb" is not associated with unit "proc.sep")
-- so we need to check whether the source file still exists in
-- the source tree: it will if it matches the naming scheme
-- (and then will be for the same unit).
if Find_Source
(In_Tree => Tree,
Project => No_Project,
Base_Name => SD.Sfile) = No_Source
then
-- If this is not a runtime file or if, when gnatmake switch
-- -a is used, we are not able to find this subunit in the
-- source directories, then recompilation is needed.
if not Fname.Is_Internal_File_Name (SD.Sfile)
or else
(Check_Readonly_Files
and then Full_Source_Name (SD.Sfile) = No_File)
then
if Verbose_Mode then
Write_Line
("While parsing ALI file, file "
& Get_Name_String (SD.Sfile)
& " is indicated as containing subunit "
& Get_Name_String (Unit_Name)
& " but this does not match what was found while"
& " parsing the project. Will recompile");
end if;
return No_Name;
end if;
end if;
end if;
end;
end loop;
return Result;
end Check_Source_Info_In_ALI;
--------------------------------
-- Create_Binder_Mapping_File --
--------------------------------
function Create_Binder_Mapping_File
(Project_Tree : Project_Tree_Ref) return Path_Name_Type
is
Mapping_Path : Path_Name_Type := No_Path;
Mapping_FD : File_Descriptor := Invalid_FD;
-- A File Descriptor for an eventual mapping file
ALI_Unit : Unit_Name_Type := No_Unit_Name;
-- The unit name of an ALI file
ALI_Name : File_Name_Type := No_File;
-- The file name of the ALI file
ALI_Project : Project_Id := No_Project;
-- The project of the ALI file
Bytes : Integer;
OK : Boolean := False;
Unit : Unit_Index;
Status : Boolean;
-- For call to Close
Iter : Source_Iterator := For_Each_Source
(In_Tree => Project_Tree,
Language => Name_Ada,
Encapsulated_Libs => False,
Locally_Removed => False);
Source : Prj.Source_Id;
begin
Tempdir.Create_Temp_File (Mapping_FD, Mapping_Path);
Record_Temp_File (Project_Tree.Shared, Mapping_Path);
if Mapping_FD /= Invalid_FD then
OK := True;
loop
Source := Element (Iter);
exit when Source = No_Source;
Unit := Source.Unit;
if Source.Replaced_By /= No_Source
or else Unit = No_Unit_Index
or else Unit.Name = No_Name
then
ALI_Name := No_File;
-- If this is a body, put it in the mapping
elsif Source.Kind = Impl
and then Unit.File_Names (Impl) /= No_Source
and then Unit.File_Names (Impl).Project /= No_Project
then
Get_Name_String (Unit.Name);
Add_Str_To_Name_Buffer ("%b");
ALI_Unit := Name_Find;
ALI_Name :=
Lib_File_Name (Unit.File_Names (Impl).Display_File);
ALI_Project := Unit.File_Names (Impl).Project;
-- Otherwise, if this is a spec and there is no body, put it in
-- the mapping.
elsif Source.Kind = Spec
and then Unit.File_Names (Impl) = No_Source
and then Unit.File_Names (Spec) /= No_Source
and then Unit.File_Names (Spec).Project /= No_Project
then
Get_Name_String (Unit.Name);
Add_Str_To_Name_Buffer ("%s");
ALI_Unit := Name_Find;
ALI_Name :=
Lib_File_Name (Unit.File_Names (Spec).Display_File);
ALI_Project := Unit.File_Names (Spec).Project;
else
ALI_Name := No_File;
end if;
-- If we have something to put in the mapping then do it now. If
-- the project is extended, look for the ALI file in the project,
-- then in the extending projects in order, and use the last one
-- found.
if ALI_Name /= No_File then
-- Look in the project and the projects that are extending it
-- to find the real ALI file.
declare
ALI : constant String := Get_Name_String (ALI_Name);
ALI_Path : Name_Id := No_Name;
begin
loop
-- For library projects, use the library ALI directory,
-- for other projects, use the object directory.
if ALI_Project.Library then
Get_Name_String
(ALI_Project.Library_ALI_Dir.Display_Name);
else
Get_Name_String
(ALI_Project.Object_Directory.Display_Name);
end if;
Add_Str_To_Name_Buffer (ALI);
if Is_Regular_File (Name_Buffer (1 .. Name_Len)) then
ALI_Path := Name_Find;
end if;
ALI_Project := ALI_Project.Extended_By;
exit when ALI_Project = No_Project;
end loop;
if ALI_Path /= No_Name then
-- First line is the unit name
Get_Name_String (ALI_Unit);
Add_Char_To_Name_Buffer (ASCII.LF);
Bytes :=
Write
(Mapping_FD,
Name_Buffer (1)'Address,
Name_Len);
OK := Bytes = Name_Len;
exit when not OK;
-- Second line is the ALI file name
Get_Name_String (ALI_Name);
Add_Char_To_Name_Buffer (ASCII.LF);
Bytes :=
Write
(Mapping_FD,
Name_Buffer (1)'Address,
Name_Len);
OK := (Bytes = Name_Len);
exit when not OK;
-- Third line is the ALI path name
Get_Name_String (ALI_Path);
Add_Char_To_Name_Buffer (ASCII.LF);
Bytes :=
Write
(Mapping_FD,
Name_Buffer (1)'Address,
Name_Len);
OK := (Bytes = Name_Len);
-- If OK is False, it means we were unable to write a
-- line. No point in continuing with the other units.
exit when not OK;
end if;
end;
end if;
Next (Iter);
end loop;
Close (Mapping_FD, Status);
OK := OK and Status;
end if;
-- If the creation of the mapping file was successful, we add the switch
-- to the arguments of gnatbind.
if OK then
return Mapping_Path;
else
return No_Path;
end if;
end Create_Binder_Mapping_File;
-----------------
-- Create_Name --
-----------------
function Create_Name (Name : String) return File_Name_Type is
begin
Name_Len := 0;
Add_Str_To_Name_Buffer (Name);
return Name_Find;
end Create_Name;
function Create_Name (Name : String) return Name_Id is
begin
Name_Len := 0;
Add_Str_To_Name_Buffer (Name);
return Name_Find;
end Create_Name;
function Create_Name (Name : String) return Path_Name_Type is
begin
Name_Len := 0;
Add_Str_To_Name_Buffer (Name);
return Name_Find;
end Create_Name;
---------------------------
-- Ensure_Absolute_Path --
---------------------------
procedure Ensure_Absolute_Path
(Switch : in out String_Access;
Parent : String;
Do_Fail : Fail_Proc;
For_Gnatbind : Boolean := False;
Including_Non_Switch : Boolean := True;
Including_RTS : Boolean := False)
is
begin
if Switch /= null then
declare
Sw : String (1 .. Switch'Length);
Start : Positive;
begin
Sw := Switch.all;
if Sw (1) = '-' then
if Sw'Length >= 3
and then (Sw (2) = 'I'
or else (not For_Gnatbind
and then (Sw (2) = 'L'
or else
Sw (2) = 'A')))
then
Start := 3;
if Sw = "-I-" then
return;
end if;
elsif Sw'Length >= 4
and then
(Sw (2 .. 3) = "aL" or else
Sw (2 .. 3) = "aO" or else
Sw (2 .. 3) = "aI"
or else (For_Gnatbind and then Sw (2 .. 3) = "A="))
then
Start := 4;
elsif Including_RTS
and then Sw'Length >= 7
and then Sw (2 .. 6) = "-RTS="
then
Start := 7;
else
return;
end if;
-- Because relative path arguments to --RTS= may be relative to
-- the search directory prefix, those relative path arguments
-- are converted only when they include directory information.
if not Is_Absolute_Path (Sw (Start .. Sw'Last)) then
if Parent'Length = 0 then
Do_Fail
("relative search path switches ("""
& Sw
& """) are not allowed");
elsif Including_RTS then
for J in Start .. Sw'Last loop
if Sw (J) = Directory_Separator then
Switch :=
new String'
(Sw (1 .. Start - 1)
& Parent
& Directory_Separator
& Sw (Start .. Sw'Last));
return;
end if;
end loop;
else
Switch :=
new String'
(Sw (1 .. Start - 1)
& Parent
& Directory_Separator
& Sw (Start .. Sw'Last));
end if;
end if;
elsif Including_Non_Switch then
if not Is_Absolute_Path (Sw) then
if Parent'Length = 0 then
Do_Fail
("relative paths (""" & Sw & """) are not allowed");
else
Switch := new String'(Parent & Directory_Separator & Sw);
end if;
end if;
end if;
end;
end if;
end Ensure_Absolute_Path;
----------------------------
-- Executable_Prefix_Path --
----------------------------
function Executable_Prefix_Path return String is
Exec_Name : constant String := Command_Name;
function Get_Install_Dir (S : String) return String;
-- S is the executable name preceded by the absolute or relative path,
-- e.g. "c:\usr\bin\gcc.exe". Returns the absolute directory where "bin"
-- lies (in the example "C:\usr"). If the executable is not in a "bin"
-- directory, return "".
---------------------
-- Get_Install_Dir --
---------------------
function Get_Install_Dir (S : String) return String is
Exec : String := S;
Path_Last : Integer := 0;
begin
for J in reverse Exec'Range loop
if Exec (J) = Directory_Separator then
Path_Last := J - 1;
exit;
end if;
end loop;
if Path_Last >= Exec'First + 2 then
To_Lower (Exec (Path_Last - 2 .. Path_Last));
end if;
if Path_Last < Exec'First + 2
or else Exec (Path_Last - 2 .. Path_Last) /= "bin"
or else (Path_Last - 3 >= Exec'First
and then Exec (Path_Last - 3) /= Directory_Separator)
then
return "";
end if;
return Normalize_Pathname
(Exec (Exec'First .. Path_Last - 4),
Resolve_Links => Opt.Follow_Links_For_Dirs)
& Directory_Separator;
end Get_Install_Dir;
-- Beginning of Executable_Prefix_Path
begin
-- First determine if a path prefix was placed in front of the
-- executable name.
for J in reverse Exec_Name'Range loop
if Exec_Name (J) = Directory_Separator then
return Get_Install_Dir (Exec_Name);
end if;
end loop;
-- If we get here, the user has typed the executable name with no
-- directory prefix.
declare
Path : String_Access := Locate_Exec_On_Path (Exec_Name);
begin
if Path = null then
return "";
else
declare
Dir : constant String := Get_Install_Dir (Path.all);
begin
Free (Path);
return Dir;
end;
end if;
end;
end Executable_Prefix_Path;
------------------
-- Fail_Program --
------------------
procedure Fail_Program
(Project_Tree : Project_Tree_Ref;
S : String;
Flush_Messages : Boolean := True)
is
begin
if Flush_Messages and not No_Exit_Message then
if Total_Errors_Detected /= 0 or else Warnings_Detected /= 0 then
Errutil.Finalize;
end if;
end if;
Finish_Program (Project_Tree, E_Fatal, S => S);
end Fail_Program;
--------------------
-- Finish_Program --
--------------------
procedure Finish_Program
(Project_Tree : Project_Tree_Ref;
Exit_Code : Osint.Exit_Code_Type := Osint.E_Success;
S : String := "")
is
begin
if not Debug.Debug_Flag_N then
Delete_Temp_Config_Files (Project_Tree);
if Project_Tree /= null then
Delete_All_Temp_Files (Project_Tree.Shared);
end if;
end if;
if S'Length > 0 then
if Exit_Code /= E_Success then
if No_Exit_Message then
Osint.Exit_Program (E_Fatal);
else
Osint.Fail (S);
end if;
elsif not No_Exit_Message then
Write_Str (S);
end if;
end if;
-- Output Namet statistics
Namet.Finalize;
Exit_Program (Exit_Code);
end Finish_Program;
--------------------------
-- File_Not_A_Source_Of --
--------------------------
function File_Not_A_Source_Of
(Project_Tree : Project_Tree_Ref;
Uname : Name_Id;
Sfile : File_Name_Type) return Boolean
is
Unit : constant Unit_Index :=
Units_Htable.Get (Project_Tree.Units_HT, Uname);
At_Least_One_File : Boolean := False;
begin
if Unit /= No_Unit_Index then
for F in Unit.File_Names'Range loop
if Unit.File_Names (F) /= null then
At_Least_One_File := True;
if Unit.File_Names (F).File = Sfile then
return False;
end if;
end if;
end loop;
if not At_Least_One_File then
-- The unit was probably created initially for a separate unit
-- (which are initially created as IMPL when both suffixes are the
-- same). Later on, Override_Kind changed the type of the file,
-- and the unit is no longer valid in fact.
return False;
end if;
Verbose_Msg (Uname, "sources do not include ", Name_Id (Sfile));
return True;
end if;
return False;
end File_Not_A_Source_Of;
---------------------
-- Get_Directories --
---------------------
procedure Get_Directories
(Project_Tree : Project_Tree_Ref;
For_Project : Project_Id;
Activity : Activity_Type;
Languages : Name_Ids)
is
procedure Recursive_Add
(Project : Project_Id;
Tree : Project_Tree_Ref;
Extended : in out Boolean);
-- Add all the source directories of a project to the path only if
-- this project has not been visited. Calls itself recursively for
-- projects being extended, and imported projects.
procedure Add_Dir (Value : Path_Name_Type);
-- Add directory Value in table Directories, if it is defined and not
-- already there.
-------------
-- Add_Dir --
-------------
procedure Add_Dir (Value : Path_Name_Type) is
Add_It : Boolean := True;
begin
if Value /= No_Path
and then Is_Directory (Get_Name_String (Value))
then
for Index in 1 .. Directories.Last loop
if Directories.Table (Index) = Value then
Add_It := False;
exit;
end if;
end loop;
if Add_It then
Directories.Increment_Last;
Directories.Table (Directories.Last) := Value;
end if;
end if;
end Add_Dir;
-------------------
-- Recursive_Add --
-------------------
procedure Recursive_Add
(Project : Project_Id;
Tree : Project_Tree_Ref;
Extended : in out Boolean)
is
Current : String_List_Id;
Dir : String_Element;
OK : Boolean := False;
Lang_Proc : Language_Ptr := Project.Languages;
begin
-- Add to path all directories of this project
if Activity = Compilation then
Lang_Loop :
while Lang_Proc /= No_Language_Index loop
for J in Languages'Range loop
OK := Lang_Proc.Name = Languages (J);
exit Lang_Loop when OK;
end loop;
Lang_Proc := Lang_Proc.Next;
end loop Lang_Loop;
if OK then
Current := Project.Source_Dirs;
while Current /= Nil_String loop
Dir := Tree.Shared.String_Elements.Table (Current);
Add_Dir (Path_Name_Type (Dir.Value));
Current := Dir.Next;
end loop;
end if;
elsif Project.Library then
if Activity = SAL_Binding and then Extended then
Add_Dir (Project.Object_Directory.Display_Name);
else
Add_Dir (Project.Library_ALI_Dir.Display_Name);
end if;
else
Add_Dir (Project.Object_Directory.Display_Name);
end if;
if Project.Extends = No_Project then
Extended := False;
end if;
end Recursive_Add;
procedure For_All_Projects is
new For_Every_Project_Imported (Boolean, Recursive_Add);
Extended : Boolean := True;
-- Start of processing for Get_Directories
begin
Directories.Init;
For_All_Projects (For_Project, Project_Tree, Extended);
end Get_Directories;
------------------
-- Get_Switches --
------------------
procedure Get_Switches
(Source : Prj.Source_Id;
Pkg_Name : Name_Id;
Project_Tree : Project_Tree_Ref;
Value : out Variable_Value;
Is_Default : out Boolean)
is
begin
Get_Switches
(Source_File => Source.File,
Source_Lang => Source.Language.Name,
Source_Prj => Source.Project,
Pkg_Name => Pkg_Name,
Project_Tree => Project_Tree,
Value => Value,
Is_Default => Is_Default);
end Get_Switches;
------------------
-- Get_Switches --
------------------
procedure Get_Switches
(Source_File : File_Name_Type;
Source_Lang : Name_Id;
Source_Prj : Project_Id;
Pkg_Name : Name_Id;
Project_Tree : Project_Tree_Ref;
Value : out Variable_Value;
Is_Default : out Boolean;
Test_Without_Suffix : Boolean := False;
Check_ALI_Suffix : Boolean := False)
is
Project : constant Project_Id :=
Ultimate_Extending_Project_Of (Source_Prj);
Pkg : constant Package_Id :=
Prj.Util.Value_Of
(Name => Pkg_Name,
In_Packages => Project.Decl.Packages,
Shared => Project_Tree.Shared);
Lang : Language_Ptr;
begin
Is_Default := False;
if Source_File /= No_File then
Value := Prj.Util.Value_Of
(Name => Name_Id (Source_File),
Attribute_Or_Array_Name => Name_Switches,
In_Package => Pkg,
Shared => Project_Tree.Shared,
Allow_Wildcards => True);
end if;
if Value = Nil_Variable_Value and then Test_Without_Suffix then
Lang :=
Get_Language_From_Name (Project, Get_Name_String (Source_Lang));
if Lang /= null then
declare
Naming : Lang_Naming_Data renames Lang.Config.Naming_Data;
SF_Name : constant String := Get_Name_String (Source_File);
Last : Positive := SF_Name'Length;
Name : String (1 .. Last + 3);
Spec_Suffix : String := Get_Name_String (Naming.Spec_Suffix);
Body_Suffix : String := Get_Name_String (Naming.Body_Suffix);
Truncated : Boolean := False;
begin
Canonical_Case_File_Name (Spec_Suffix);
Canonical_Case_File_Name (Body_Suffix);
Name (1 .. Last) := SF_Name;
if Last > Body_Suffix'Length
and then
Name (Last - Body_Suffix'Length + 1 .. Last) = Body_Suffix
then
Truncated := True;
Last := Last - Body_Suffix'Length;
end if;
if not Truncated
and then Last > Spec_Suffix'Length
and then
Name (Last - Spec_Suffix'Length + 1 .. Last) = Spec_Suffix
then
Truncated := True;
Last := Last - Spec_Suffix'Length;
end if;
if Truncated then
Name_Len := 0;
Add_Str_To_Name_Buffer (Name (1 .. Last));
Value := Prj.Util.Value_Of
(Name => Name_Find,
Attribute_Or_Array_Name => Name_Switches,
In_Package => Pkg,
Shared => Project_Tree.Shared,
Allow_Wildcards => True);
end if;
if Value = Nil_Variable_Value and then Check_ALI_Suffix then
Last := SF_Name'Length;
while Name (Last) /= '.' loop
Last := Last - 1;
end loop;
Name_Len := 0;
Add_Str_To_Name_Buffer (Name (1 .. Last));
Add_Str_To_Name_Buffer ("ali");
Value := Prj.Util.Value_Of
(Name => Name_Find,
Attribute_Or_Array_Name => Name_Switches,
In_Package => Pkg,
Shared => Project_Tree.Shared,
Allow_Wildcards => True);
end if;
end;
end if;
end if;
if Value = Nil_Variable_Value then
Is_Default := True;
Value :=
Prj.Util.Value_Of
(Name => Source_Lang,
Attribute_Or_Array_Name => Name_Switches,
In_Package => Pkg,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Value = Nil_Variable_Value then
Value :=
Prj.Util.Value_Of
(Name => All_Other_Names,
Attribute_Or_Array_Name => Name_Switches,
In_Package => Pkg,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Value = Nil_Variable_Value then
Value :=
Prj.Util.Value_Of
(Name => Source_Lang,
Attribute_Or_Array_Name => Name_Default_Switches,
In_Package => Pkg,
Shared => Project_Tree.Shared);
end if;
end Get_Switches;
------------
-- Inform --
------------
procedure Inform (N : File_Name_Type; Msg : String) is
begin
Inform (Name_Id (N), Msg);
end Inform;
procedure Inform (N : Name_Id := No_Name; Msg : String) is
begin
Osint.Write_Program_Name;
Write_Str (": ");
if N /= No_Name then
Write_Str ("""");
declare
Name : constant String := Get_Name_String (N);
begin
if Debug.Debug_Flag_F and then Is_Absolute_Path (Name) then
Write_Str (File_Name (Name));
else
Write_Str (Name);
end if;
end;
Write_Str (""" ");
end if;
Write_Str (Msg);
Write_Eol;
end Inform;
------------------------------
-- Initialize_Source_Record --
------------------------------
procedure Initialize_Source_Record (Source : Prj.Source_Id) is
procedure Set_Object_Project
(Obj_Dir : String;
Obj_Proj : Project_Id;
Obj_Path : Path_Name_Type;
Stamp : Time_Stamp_Type);
-- Update information about object file, switches file,...
------------------------
-- Set_Object_Project --
------------------------
procedure Set_Object_Project
(Obj_Dir : String;
Obj_Proj : Project_Id;
Obj_Path : Path_Name_Type;
Stamp : Time_Stamp_Type) is
begin
Source.Object_Project := Obj_Proj;
Source.Object_Path := Obj_Path;
Source.Object_TS := Stamp;
if Source.Language.Config.Dependency_Kind /= None then
declare
Dep_Path : constant String :=
Normalize_Pathname
(Name =>
Get_Name_String (Source.Dep_Name),
Resolve_Links => Opt.Follow_Links_For_Files,
Directory => Obj_Dir);
begin
Source.Dep_Path := Create_Name (Dep_Path);
Source.Dep_TS := Osint.Unknown_Attributes;
end;
end if;
-- Get the path of the switches file, even if Opt.Check_Switches is
-- not set, as switch -s may be in the Builder switches that have not
-- been scanned yet.
declare
Switches_Path : constant String :=
Normalize_Pathname
(Name =>
Get_Name_String (Source.Switches),
Resolve_Links => Opt.Follow_Links_For_Files,
Directory => Obj_Dir);
begin
Source.Switches_Path := Create_Name (Switches_Path);
if Stamp /= Empty_Time_Stamp then
Source.Switches_TS := File_Stamp (Source.Switches_Path);
end if;
end;
end Set_Object_Project;
Obj_Proj : Project_Id;
begin
-- Nothing to do if source record has already been fully initialized
if Source.Initialized then
return;
end if;
-- Systematically recompute the time stamp
Source.Source_TS := File_Stamp (Source.Path.Display_Name);
-- Parse the source file to check whether we have a subunit
if Source.Language.Config.Kind = Unit_Based
and then Source.Kind = Impl
and then Is_Subunit (Source)
then
Source.Kind := Sep;
end if;
if Source.Language.Config.Object_Generated
and then Is_Compilable (Source)
then
-- First, get the correct object file name and dependency file name
-- if the source is in a multi-unit file.
if Source.Index /= 0 then
Source.Object :=
Object_Name
(Source_File_Name => Source.File,
Source_Index => Source.Index,
Index_Separator =>
Source.Language.Config.Multi_Unit_Object_Separator,
Object_File_Suffix =>
Source.Language.Config.Object_File_Suffix);
Source.Dep_Name :=
Dependency_Name
(Source.Object, Source.Language.Config.Dependency_Kind);
end if;
-- Find the object file for that source. It could be either in the
-- current project or in an extended project (it might actually not
-- exist yet in the ultimate extending project, but if not found
-- elsewhere that's where we'll expect to find it).
Obj_Proj := Source.Project;
while Obj_Proj /= No_Project loop
if Obj_Proj.Object_Directory /= No_Path_Information then
declare
Dir : constant String :=
Get_Name_String (Obj_Proj.Object_Directory.Display_Name);
Object_Path : constant String :=
Normalize_Pathname
(Name => Get_Name_String (Source.Object),
Resolve_Links => Opt.Follow_Links_For_Files,
Directory => Dir);
Obj_Path : constant Path_Name_Type :=
Create_Name (Object_Path);
Stamp : Time_Stamp_Type := Empty_Time_Stamp;
begin
-- For specs, we do not check object files if there is a
-- body. This saves a system call. On the other hand, we do
-- need to know the object_path, in case the user has passed
-- the .ads on the command line to compile the spec only.
if Source.Kind /= Spec
or else Source.Unit = No_Unit_Index
or else Source.Unit.File_Names (Impl) = No_Source
then
Stamp := File_Stamp (Obj_Path);
end if;
if Stamp /= Empty_Time_Stamp
or else (Obj_Proj.Extended_By = No_Project
and then Source.Object_Project = No_Project)
then
Set_Object_Project (Dir, Obj_Proj, Obj_Path, Stamp);
end if;
end;
end if;
Obj_Proj := Obj_Proj.Extended_By;
end loop;
elsif Source.Language.Config.Dependency_Kind = Makefile then
declare
Object_Dir : constant String :=
Get_Name_String (Source.Project.Object_Directory.Display_Name);
Dep_Path : constant String :=
Normalize_Pathname
(Name => Get_Name_String (Source.Dep_Name),
Resolve_Links => Opt.Follow_Links_For_Files,
Directory => Object_Dir);
begin
Source.Dep_Path := Create_Name (Dep_Path);
Source.Dep_TS := Osint.Unknown_Attributes;
end;
end if;
Source.Initialized := True;
end Initialize_Source_Record;
----------------------------
-- Is_External_Assignment --
----------------------------
function Is_External_Assignment
(Env : Prj.Tree.Environment;
Argv : String) return Boolean
is
Start : Positive := 3;
Finish : Natural := Argv'Last;
pragma Assert (Argv'First = 1);
pragma Assert (Argv (1 .. 2) = "-X");
begin
if Argv'Last < 5 then
return False;
elsif Argv (3) = '"' then
if Argv (Argv'Last) /= '"' or else Argv'Last < 7 then
return False;
else
Start := 4;
Finish := Argv'Last - 1;
end if;
end if;
return Prj.Ext.Check
(Self => Env.External,
Declaration => Argv (Start .. Finish));
end Is_External_Assignment;
----------------
-- Is_Subunit --
----------------
function Is_Subunit (Source : Prj.Source_Id) return Boolean is
Src_Ind : Source_File_Index;
begin
if Source.Kind = Sep then
return True;
-- A Spec, a file based language source or a body with a spec cannot be
-- a subunit.
elsif Source.Kind = Spec
or else Source.Unit = No_Unit_Index
or else Other_Part (Source) /= No_Source
then
return False;
end if;
-- Here, we are assuming that the language is Ada, as it is the only
-- unit based language that we know.
Src_Ind :=
Sinput.P.Load_Project_File
(Get_Name_String (Source.Path.Display_Name));
return Sinput.P.Source_File_Is_Subunit (Src_Ind);
end Is_Subunit;
-----------------------------
-- Linker_Options_Switches --
-----------------------------
function Linker_Options_Switches
(Project : Project_Id;
Do_Fail : Fail_Proc;
In_Tree : Project_Tree_Ref) return String_List
is
procedure Recursive_Add
(Proj : Project_Id;
In_Tree : Project_Tree_Ref;
Dummy : in out Boolean);
-- The recursive routine used to add linker options
-------------------
-- Recursive_Add --
-------------------
procedure Recursive_Add
(Proj : Project_Id;
In_Tree : Project_Tree_Ref;
Dummy : in out Boolean)
is
Linker_Package : Package_Id;
Options : Variable_Value;
begin
Linker_Package :=
Prj.Util.Value_Of
(Name => Name_Linker,
In_Packages => Proj.Decl.Packages,
Shared => In_Tree.Shared);
Options :=
Prj.Util.Value_Of
(Name => Name_Ada,
Index => 0,
Attribute_Or_Array_Name => Name_Linker_Options,
In_Package => Linker_Package,
Shared => In_Tree.Shared);
-- If attribute is present, add the project with the attribute to
-- table Linker_Opts.
if Options /= Nil_Variable_Value then
Linker_Opts.Increment_Last;
Linker_Opts.Table (Linker_Opts.Last) :=
(Project => Proj, Options => Options.Values);
end if;
end Recursive_Add;
procedure For_All_Projects is
new For_Every_Project_Imported (Boolean, Recursive_Add);
Dummy : Boolean := False;
-- Start of processing for Linker_Options_Switches
begin
Linker_Opts.Init;
For_All_Projects (Project, In_Tree, Dummy, Imported_First => True);
Last_Linker_Option := 0;
for Index in reverse 1 .. Linker_Opts.Last loop
declare
Options : String_List_Id;
Proj : constant Project_Id :=
Linker_Opts.Table (Index).Project;
Option : Name_Id;
Dir_Path : constant String :=
Get_Name_String (Proj.Directory.Name);
begin
Options := Linker_Opts.Table (Index).Options;
while Options /= Nil_String loop
Option := In_Tree.Shared.String_Elements.Table (Options).Value;
Get_Name_String (Option);
-- Do not consider empty linker options
if Name_Len /= 0 then
Add_Linker_Option (Name_Buffer (1 .. Name_Len));
-- Object files and -L switches specified with relative
-- paths must be converted to absolute paths.
Ensure_Absolute_Path
(Switch =>
Linker_Options_Buffer (Last_Linker_Option),
Parent => Dir_Path,
Do_Fail => Do_Fail,
For_Gnatbind => False);
end if;
Options := In_Tree.Shared.String_Elements.Table (Options).Next;
end loop;
end;
end loop;
return Linker_Options_Buffer (1 .. Last_Linker_Option);
end Linker_Options_Switches;
-----------
-- Mains --
-----------
package body Mains is
package Names is new Table.Table
(Table_Component_Type => Main_Info,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Makeutl.Mains.Names");
-- The table that stores the mains
Current : Natural := 0;
-- The index of the last main retrieved from the table
Count_Of_Mains_With_No_Tree : Natural := 0;
-- Number of main units for which we do not know the project tree
--------------
-- Add_Main --
--------------
procedure Add_Main
(Name : String;
Index : Int := 0;
Location : Source_Ptr := No_Location;
Project : Project_Id := No_Project;
Tree : Project_Tree_Ref := null)
is
begin
if Current_Verbosity = High then
Debug_Output ("Add_Main """ & Name & """ " & Index'Img
& " with_tree? "
& Boolean'Image (Tree /= null));
end if;
Name_Len := 0;
Add_Str_To_Name_Buffer (Name);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
Names.Increment_Last;
Names.Table (Names.Last) :=
(Name_Find, Index, Location, No_Source, Project, Tree);
if Tree /= null then
Builder_Data (Tree).Number_Of_Mains :=
Builder_Data (Tree).Number_Of_Mains + 1;
else
Mains.Count_Of_Mains_With_No_Tree :=
Mains.Count_Of_Mains_With_No_Tree + 1;
end if;
end Add_Main;
--------------------
-- Complete_Mains --
--------------------
procedure Complete_Mains
(Flags : Processing_Flags;
Root_Project : Project_Id;
Project_Tree : Project_Tree_Ref)
is
procedure Do_Complete (Project : Project_Id; Tree : Project_Tree_Ref);
-- Check the mains for this specific project
procedure Complete_All is new For_Project_And_Aggregated
(Do_Complete);
procedure Add_Multi_Unit_Sources
(Tree : Project_Tree_Ref;
Source : Prj.Source_Id);
-- Add all units from the same file as the multi-unit Source
function Find_File_Add_Extension
(Tree : Project_Tree_Ref;
Base_Main : String) return Prj.Source_Id;
-- Search for Main in the project, adding body or spec extensions
----------------------------
-- Add_Multi_Unit_Sources --
----------------------------
procedure Add_Multi_Unit_Sources
(Tree : Project_Tree_Ref;
Source : Prj.Source_Id)
is
Iter : Source_Iterator;
Src : Prj.Source_Id;
begin
Debug_Output
("found multi-unit source file in project", Source.Project.Name);
Iter := For_Each_Source
(In_Tree => Tree, Project => Source.Project);
while Element (Iter) /= No_Source loop
Src := Element (Iter);
if Src.File = Source.File
and then Src.Index /= Source.Index
then
if Src.File = Source.File then
Debug_Output
("add main in project, index=" & Src.Index'Img);
end if;
Names.Increment_Last;
Names.Table (Names.Last) :=
(File => Src.File,
Index => Src.Index,
Location => No_Location,
Source => Src,
Project => Src.Project,
Tree => Tree);
Builder_Data (Tree).Number_Of_Mains :=
Builder_Data (Tree).Number_Of_Mains + 1;
end if;
Next (Iter);
end loop;
end Add_Multi_Unit_Sources;
-----------------------------
-- Find_File_Add_Extension --
-----------------------------
function Find_File_Add_Extension
(Tree : Project_Tree_Ref;
Base_Main : String) return Prj.Source_Id
is
Spec_Source : Prj.Source_Id := No_Source;
Source : Prj.Source_Id;
Iter : Source_Iterator;
Suffix : File_Name_Type;
begin
Source := No_Source;
Iter := For_Each_Source (Tree); -- In all projects
loop
Source := Prj.Element (Iter);
exit when Source = No_Source;
if Source.Kind = Impl then
Get_Name_String (Source.File);
if Name_Len > Base_Main'Length
and then Name_Buffer (1 .. Base_Main'Length) = Base_Main
then
Suffix :=
Source.Language.Config.Naming_Data.Body_Suffix;
if Suffix /= No_File then
declare
Suffix_Str : String := Get_Name_String (Suffix);
begin
Canonical_Case_File_Name (Suffix_Str);
exit when
Name_Buffer (Base_Main'Length + 1 .. Name_Len) =
Suffix_Str;
end;
end if;
end if;
elsif Source.Kind = Spec
and then Source.Language.Config.Kind = Unit_Based
then
-- An Ada spec needs to be taken into account unless there
-- is also a body. So we delay the decision for them.
Get_Name_String (Source.File);
if Name_Len > Base_Main'Length
and then Name_Buffer (1 .. Base_Main'Length) = Base_Main
then
Suffix := Source.Language.Config.Naming_Data.Spec_Suffix;
if Suffix /= No_File then
declare
Suffix_Str : String := Get_Name_String (Suffix);
begin
Canonical_Case_File_Name (Suffix_Str);
if Name_Buffer (Base_Main'Length + 1 .. Name_Len) =
Suffix_Str
then
Spec_Source := Source;
end if;
end;
end if;
end if;
end if;
Next (Iter);
end loop;
if Source = No_Source then
Source := Spec_Source;
end if;
return Source;
end Find_File_Add_Extension;
-----------------
-- Do_Complete --
-----------------
procedure Do_Complete
(Project : Project_Id; Tree : Project_Tree_Ref)
is
J : Integer;
begin
if Mains.Number_Of_Mains (Tree) > 0
or else Mains.Count_Of_Mains_With_No_Tree > 0
then
-- Traverse in reverse order, since in the case of multi-unit
-- files we will be adding extra files at the end, and there's
-- no need to process them in turn.
J := Names.Last;
Main_Loop : loop
declare
File : Main_Info := Names.Table (J);
Main_Id : File_Name_Type := File.File;
Main : constant String :=
Get_Name_String (Main_Id);
Base : constant String := Base_Name (Main);
Source : Prj.Source_Id := No_Source;
Is_Absolute : Boolean := False;
begin
if Base /= Main then
Is_Absolute := True;
if Is_Absolute_Path (Main) then
Main_Id := Create_Name (Base);
-- Not an absolute path
else
-- Always resolve links here, so that users can be
-- specify any name on the command line. If the
-- project itself uses links, the user will be
-- using -eL anyway, and thus files are also stored
-- with resolved names.
declare
Absolute : constant String :=
Normalize_Pathname
(Name => Main,
Directory => "",
Resolve_Links => True,
Case_Sensitive => False);
begin
File.File := Create_Name (Absolute);
Main_Id := Create_Name (Base);
end;
end if;
end if;
-- If no project or tree was specified for the main, it
-- came from the command line.
-- Note that the assignments below will not modify inside
-- the table itself.
if File.Project = null then
File.Project := Project;
end if;
if File.Tree = null then
File.Tree := Tree;
end if;
if File.Source = null then
if Current_Verbosity = High then
Debug_Output
("search for main """ & Main
& '"' & File.Index'Img & " in "
& Get_Name_String (Debug_Name (File.Tree))
& ", project", Project.Name);
end if;
-- First, look for the main as specified. We need to
-- search for the base name though, and if needed
-- check later that we found the correct file.
declare
Sources : constant Source_Ids :=
Find_All_Sources
(In_Tree => File.Tree,
Project => File.Project,
Base_Name => Main_Id,
Index => File.Index,
In_Imported_Only => True);
begin
if Is_Absolute then
for J in Sources'Range loop
if File_Name_Type (Sources (J).Path.Name) =
File.File
then
Source := Sources (J);
exit;
end if;
end loop;
elsif Sources'Length > 1 then
-- This is only allowed if the units are from
-- the same multi-unit source file.
Source := Sources (1);
for J in 2 .. Sources'Last loop
if Sources (J).Path /= Source.Path
or else Sources (J).Index = Source.Index
then
Error_Msg_File_1 := Main_Id;
Prj.Err.Error_Msg
(Flags, "several main sources {",
No_Location, File.Project);
exit Main_Loop;
end if;
end loop;
elsif Sources'Length = 1 then
Source := Sources (Sources'First);
end if;
end;
if Source = No_Source then
Source := Find_File_Add_Extension
(File.Tree, Get_Name_String (Main_Id));
end if;
if Is_Absolute
and then Source /= No_Source
and then
File_Name_Type (Source.Path.Name) /= File.File
then
Debug_Output
("Found a non-matching file",
Name_Id (Source.Path.Display_Name));
Source := No_Source;
end if;
if Source /= No_Source then
if not Is_Allowed_Language
(Source.Language.Name)
then
-- Remove any main that is not in the list of
-- restricted languages.
Names.Table (J .. Names.Last - 1) :=
Names.Table (J + 1 .. Names.Last);
Names.Set_Last (Names.Last - 1);
else
-- If we have found a multi-unit source file but
-- did not specify an index initially, we'll
-- need to compile all the units from the same
-- source file.
if Source.Index /= 0 and then File.Index = 0 then
Add_Multi_Unit_Sources (File.Tree, Source);
end if;
-- Now update the original Main, otherwise it
-- will be reported as not found.
Debug_Output
("found main in project", Source.Project.Name);
Names.Table (J).File := Source.File;
Names.Table (J).Project := Source.Project;
if Names.Table (J).Tree = null then
Names.Table (J).Tree := File.Tree;
Builder_Data (File.Tree).Number_Of_Mains :=
Builder_Data (File.Tree).Number_Of_Mains
+ 1;
Mains.Count_Of_Mains_With_No_Tree :=
Mains.Count_Of_Mains_With_No_Tree - 1;
end if;
Names.Table (J).Source := Source;
Names.Table (J).Index := Source.Index;
end if;
elsif File.Location /= No_Location then
-- If the main is declared in package Builder of
-- the main project, report an error. If the main
-- is on the command line, it may be a main from
-- another project, so do nothing: if the main does
-- not exist in another project, an error will be
-- reported later.
Error_Msg_File_1 := Main_Id;
Error_Msg_Name_1 := File.Project.Name;
Prj.Err.Error_Msg
(Flags, "{ is not a source of project %%",
File.Location, File.Project);
end if;
end if;
end;
J := J - 1;
exit Main_Loop when J < Names.First;
end loop Main_Loop;
end if;
if Total_Errors_Detected > 0 then
Fail_Program (Tree, "problems with main sources");
end if;
end Do_Complete;
-- Start of processing for Complete_Mains
begin
Complete_All (Root_Project, Project_Tree);
if Mains.Count_Of_Mains_With_No_Tree > 0 then
for J in Names.First .. Names.Last loop
if Names.Table (J).Source = No_Source then
Fail_Program
(Project_Tree, '"' & Get_Name_String (Names.Table (J).File)
& """ is not a source of any project");
end if;
end loop;
end if;
end Complete_Mains;
------------
-- Delete --
------------
procedure Delete is
begin
Names.Set_Last (0);
Mains.Reset;
end Delete;
-----------------------
-- Fill_From_Project --
-----------------------
procedure Fill_From_Project
(Root_Project : Project_Id;
Project_Tree : Project_Tree_Ref)
is
procedure Add_Mains_From_Project
(Project : Project_Id;
Tree : Project_Tree_Ref);
-- Add the main units from this project into Mains.
-- This takes into account the aggregated projects
----------------------------
-- Add_Mains_From_Project --
----------------------------
procedure Add_Mains_From_Project
(Project : Project_Id;
Tree : Project_Tree_Ref)
is
List : String_List_Id;
Element : String_Element;
begin
if Number_Of_Mains (Tree) = 0
and then Mains.Count_Of_Mains_With_No_Tree = 0
then
Debug_Output ("Add_Mains_From_Project", Project.Name);
List := Project.Mains;
if List /= Prj.Nil_String then
-- The attribute Main is not an empty list. Get the mains in
-- the list.
while List /= Prj.Nil_String loop
Element := Tree.Shared.String_Elements.Table (List);
Debug_Output ("Add_Main", Element.Value);
if Project.Library then
Fail_Program
(Tree,
"cannot specify a main program "
& "for a library project file");
end if;
Add_Main (Name => Get_Name_String (Element.Value),
Index => Element.Index,
Location => Element.Location,
Project => Project,
Tree => Tree);
List := Element.Next;
end loop;
end if;
end if;
if Total_Errors_Detected > 0 then
Fail_Program (Tree, "problems with main sources");
end if;
end Add_Mains_From_Project;
procedure Fill_All is new For_Project_And_Aggregated
(Add_Mains_From_Project);
-- Start of processing for Fill_From_Project
begin
Fill_All (Root_Project, Project_Tree);
end Fill_From_Project;
---------------
-- Next_Main --
---------------
function Next_Main return String is
Info : constant Main_Info := Next_Main;
begin
if Info = No_Main_Info then
return "";
else
return Get_Name_String (Info.File);
end if;
end Next_Main;
function Next_Main return Main_Info is
begin
if Current >= Names.Last then
return No_Main_Info;
else
Current := Current + 1;
-- If not using projects, and in the gnatmake case, the main file
-- may have not have the extension. Try ".adb" first then ".ads"
if Names.Table (Current).Project = No_Project then
declare
Orig_Main : constant File_Name_Type :=
Names.Table (Current).File;
Current_Main : File_Name_Type;
begin
if Strip_Suffix (Orig_Main) = Orig_Main then
Get_Name_String (Orig_Main);
Add_Str_To_Name_Buffer (".adb");
Current_Main := Name_Find;
if Full_Source_Name (Current_Main) = No_File then
Get_Name_String (Orig_Main);
Add_Str_To_Name_Buffer (".ads");
Current_Main := Name_Find;
if Full_Source_Name (Current_Main) /= No_File then
Names.Table (Current).File := Current_Main;
end if;
else
Names.Table (Current).File := Current_Main;
end if;
end if;
end;
end if;
return Names.Table (Current);
end if;
end Next_Main;
---------------------
-- Number_Of_Mains --
---------------------
function Number_Of_Mains (Tree : Project_Tree_Ref) return Natural is
begin
if Tree = null then
return Names.Last;
else
return Builder_Data (Tree).Number_Of_Mains;
end if;
end Number_Of_Mains;
-----------
-- Reset --
-----------
procedure Reset is
begin
Current := 0;
end Reset;
--------------------------
-- Set_Multi_Unit_Index --
--------------------------
procedure Set_Multi_Unit_Index
(Project_Tree : Project_Tree_Ref := null;
Index : Int := 0)
is
begin
if Index /= 0 then
if Names.Last = 0 then
Fail_Program
(Project_Tree,
"cannot specify a multi-unit index but no main "
& "on the command line");
elsif Names.Last > 1 then
Fail_Program
(Project_Tree,
"cannot specify several mains with a multi-unit index");
else
Names.Table (Names.Last).Index := Index;
end if;
end if;
end Set_Multi_Unit_Index;
end Mains;
-----------------------
-- Path_Or_File_Name --
-----------------------
function Path_Or_File_Name (Path : Path_Name_Type) return String is
Path_Name : constant String := Get_Name_String (Path);
begin
if Debug.Debug_Flag_F then
return File_Name (Path_Name);
else
return Path_Name;
end if;
end Path_Or_File_Name;
-------------------
-- Unit_Index_Of --
-------------------
function Unit_Index_Of (ALI_File : File_Name_Type) return Int is
Start : Natural;
Finish : Natural;
Result : Int := 0;
begin
Get_Name_String (ALI_File);
-- First, find the last dot
Finish := Name_Len;
while Finish >= 1 and then Name_Buffer (Finish) /= '.' loop
Finish := Finish - 1;
end loop;
if Finish = 1 then
return 0;
end if;
-- Now check that the dot is preceded by digits
Start := Finish;
Finish := Finish - 1;
while Start >= 1 and then Name_Buffer (Start - 1) in '0' .. '9' loop
Start := Start - 1;
end loop;
-- If there are no digits, or if the digits are not preceded by the
-- character that precedes a unit index, this is not the ALI file of
-- a unit in a multi-unit source.
if Start > Finish
or else Start = 1
or else Name_Buffer (Start - 1) /= Multi_Unit_Index_Character
then
return 0;
end if;
-- Build the index from the digit(s)
while Start <= Finish loop
Result := Result * 10 +
Character'Pos (Name_Buffer (Start)) - Character'Pos ('0');
Start := Start + 1;
end loop;
return Result;
end Unit_Index_Of;
-----------------
-- Verbose_Msg --
-----------------
procedure Verbose_Msg
(N1 : Name_Id;
S1 : String;
N2 : Name_Id := No_Name;
S2 : String := "";
Prefix : String := " -> ";
Minimum_Verbosity : Opt.Verbosity_Level_Type := Opt.Low)
is
begin
if not Opt.Verbose_Mode
or else Minimum_Verbosity > Opt.Verbosity_Level
then
return;
end if;
Write_Str (Prefix);
Write_Str ("""");
Write_Name (N1);
Write_Str (""" ");
Write_Str (S1);
if N2 /= No_Name then
Write_Str (" """);
Write_Name (N2);
Write_Str (""" ");
end if;
Write_Str (S2);
Write_Eol;
end Verbose_Msg;
procedure Verbose_Msg
(N1 : File_Name_Type;
S1 : String;
N2 : File_Name_Type := No_File;
S2 : String := "";
Prefix : String := " -> ";
Minimum_Verbosity : Opt.Verbosity_Level_Type := Opt.Low)
is
begin
Verbose_Msg
(Name_Id (N1), S1, Name_Id (N2), S2, Prefix, Minimum_Verbosity);
end Verbose_Msg;
-----------
-- Queue --
-----------
package body Queue is
type Q_Record is record
Info : Source_Info;
Processed : Boolean;
end record;
package Q is new Table.Table
(Table_Component_Type => Q_Record,
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 1000,
Table_Increment => 100,
Table_Name => "Makeutl.Queue.Q");
-- This is the actual Queue
package Busy_Obj_Dirs is new GNAT.HTable.Simple_HTable
(Header_Num => Prj.Header_Num,
Element => Boolean,
No_Element => False,
Key => Path_Name_Type,
Hash => Hash,
Equal => "=");
type Mark_Key is record
File : File_Name_Type;
Index : Int;
end record;
-- Identify either a mono-unit source (when Index = 0) or a specific
-- unit (index = 1's origin index of unit) in a multi-unit source.
Max_Mask_Num : constant := 2048;
subtype Mark_Num is Union_Id range 0 .. Max_Mask_Num - 1;
function Hash (Key : Mark_Key) return Mark_Num;
package Marks is new GNAT.HTable.Simple_HTable
(Header_Num => Mark_Num,
Element => Boolean,
No_Element => False,
Key => Mark_Key,
Hash => Hash,
Equal => "=");
-- A hash table to keep tracks of the marked units.
-- These are the units that have already been processed, when using the
-- gnatmake format. When using the gprbuild format, we can directly
-- store in the source_id whether the file has already been processed.
procedure Mark (Source_File : File_Name_Type; Index : Int := 0);
-- Mark a unit, identified by its source file and, when Index is not 0,
-- the index of the unit in the source file. Marking is used to signal
-- that the unit has already been inserted in the Q.
function Is_Marked
(Source_File : File_Name_Type;
Index : Int := 0) return Boolean;
-- Returns True if the unit was previously marked
Q_Processed : Natural := 0;
Q_Initialized : Boolean := False;
Q_First : Natural := 1;
-- Points to the first valid element in the queue
One_Queue_Per_Obj_Dir : Boolean := False;
-- See parameter to Initialize
function Available_Obj_Dir (S : Source_Info) return Boolean;
-- Whether the object directory for S is available for a build
procedure Debug_Display (S : Source_Info);
-- A debug display for S
function Was_Processed (S : Source_Info) return Boolean;
-- Whether S has already been processed. This marks the source as
-- processed, if it hasn't already been processed.
function Insert_No_Roots (Source : Source_Info) return Boolean;
-- Insert Source, but do not look for its roots (see doc for Insert)
-------------------
-- Was_Processed --
-------------------
function Was_Processed (S : Source_Info) return Boolean is
begin
case S.Format is
when Format_Gprbuild =>
if S.Id.In_The_Queue then
return True;
end if;
S.Id.In_The_Queue := True;
when Format_Gnatmake =>
if Is_Marked (S.File, S.Index) then
return True;
end if;
Mark (S.File, Index => S.Index);
end case;
return False;
end Was_Processed;
-----------------------
-- Available_Obj_Dir --
-----------------------
function Available_Obj_Dir (S : Source_Info) return Boolean is
begin
case S.Format is
when Format_Gprbuild =>
return
not Busy_Obj_Dirs.Get
(S.Id.Project.Object_Directory.Name);
when Format_Gnatmake =>
return
S.Project = No_Project
or else not Busy_Obj_Dirs.Get
(S.Project.Object_Directory.Name);
end case;
end Available_Obj_Dir;
-------------------
-- Debug_Display --
-------------------
procedure Debug_Display (S : Source_Info) is
begin
case S.Format is
when Format_Gprbuild =>
Write_Name (S.Id.File);
if S.Id.Index /= 0 then
Write_Str (", ");
Write_Int (S.Id.Index);
end if;
when Format_Gnatmake =>
Write_Name (S.File);
if S.Index /= 0 then
Write_Str (", ");
Write_Int (S.Index);
end if;
end case;
end Debug_Display;
----------
-- Hash --
----------
function Hash (Key : Mark_Key) return Mark_Num is
begin
return Union_Id (Key.File) mod Max_Mask_Num;
end Hash;
---------------
-- Is_Marked --
---------------
function Is_Marked
(Source_File : File_Name_Type;
Index : Int := 0) return Boolean
is
begin
return Marks.Get (K => (File => Source_File, Index => Index));
end Is_Marked;
----------
-- Mark --
----------
procedure Mark (Source_File : File_Name_Type; Index : Int := 0) is
begin
Marks.Set (K => (File => Source_File, Index => Index), E => True);
end Mark;
-------------
-- Extract --
-------------
procedure Extract
(Found : out Boolean;
Source : out Source_Info)
is
begin
Found := False;
if One_Queue_Per_Obj_Dir then
for J in Q_First .. Q.Last loop
if not Q.Table (J).Processed
and then Available_Obj_Dir (Q.Table (J).Info)
then
Found := True;
Source := Q.Table (J).Info;
Q.Table (J).Processed := True;
if J = Q_First then
while Q_First <= Q.Last
and then Q.Table (Q_First).Processed
loop
Q_First := Q_First + 1;
end loop;
end if;
exit;
end if;
end loop;
elsif Q_First <= Q.Last then
Source := Q.Table (Q_First).Info;
Q.Table (Q_First).Processed := True;
Q_First := Q_First + 1;
Found := True;
end if;
if Found then
Q_Processed := Q_Processed + 1;
end if;
if Found and then Debug.Debug_Flag_Q then
Write_Str (" Q := Q - [ ");
Debug_Display (Source);
Write_Str (" ]");
Write_Eol;
Write_Str (" Q_First =");
Write_Int (Int (Q_First));
Write_Eol;
Write_Str (" Q.Last =");
Write_Int (Int (Q.Last));
Write_Eol;
end if;
end Extract;
---------------
-- Processed --
---------------
function Processed return Natural is
begin
return Q_Processed;
end Processed;
----------------
-- Initialize --
----------------
procedure Initialize
(Queue_Per_Obj_Dir : Boolean;
Force : Boolean := False)
is
begin
if Force or else not Q_Initialized then
Q_Initialized := True;
for J in 1 .. Q.Last loop
case Q.Table (J).Info.Format is
when Format_Gprbuild =>
Q.Table (J).Info.Id.In_The_Queue := False;
when Format_Gnatmake =>
null;
end case;
end loop;
Q.Init;
Q_Processed := 0;
Q_First := 1;
One_Queue_Per_Obj_Dir := Queue_Per_Obj_Dir;
end if;
end Initialize;
---------------------
-- Insert_No_Roots --
---------------------
function Insert_No_Roots (Source : Source_Info) return Boolean is
begin
pragma Assert
(Source.Format = Format_Gnatmake or else Source.Id /= No_Source);
-- Only insert in the Q if it is not already done, to avoid
-- simultaneous compilations if -jnnn is used.
if Was_Processed (Source) then
return False;
end if;
-- For gprbuild, check if a source has already been inserted in the
-- queue from the same project in a different project tree.
if Source.Format = Format_Gprbuild then
for J in 1 .. Q.Last loop
if Source.Id.Path.Name = Q.Table (J).Info.Id.Path.Name
and then Source.Id.Index = Q.Table (J).Info.Id.Index
and then
Ultimate_Extending_Project_Of (Source.Id.Project).Path.Name
=
Ultimate_Extending_Project_Of (Q.Table (J).Info.Id.Project).
Path.Name
then
-- No need to insert this source in the queue, but still
-- return True as we may need to insert its roots.
return True;
end if;
end loop;
end if;
if Current_Verbosity = High then
Write_Str ("Adding """);
Debug_Display (Source);
Write_Line (""" to the queue");
end if;
Q.Append (New_Val => (Info => Source, Processed => False));
if Debug.Debug_Flag_Q then
Write_Str (" Q := Q + [ ");
Debug_Display (Source);
Write_Str (" ] ");
Write_Eol;
Write_Str (" Q_First =");
Write_Int (Int (Q_First));
Write_Eol;
Write_Str (" Q.Last =");
Write_Int (Int (Q.Last));
Write_Eol;
end if;
return True;
end Insert_No_Roots;
------------
-- Insert --
------------
function Insert
(Source : Source_Info;
With_Roots : Boolean := False) return Boolean
is
Root_Arr : Array_Element_Id;
Roots : Variable_Value;
List : String_List_Id;
Elem : String_Element;
Unit_Name : Name_Id;
Pat_Root : Boolean;
Root_Pattern : Regexp;
Root_Found : Boolean;
Roots_Found : Boolean;
Root_Source : Prj.Source_Id;
Iter : Source_Iterator;
Dummy : Boolean;
begin
if not Insert_No_Roots (Source) then
-- Was already in the queue
return False;
end if;
if With_Roots and then Source.Format = Format_Gprbuild then
Debug_Output ("looking for roots of", Name_Id (Source.Id.File));
Root_Arr :=
Prj.Util.Value_Of
(Name => Name_Roots,
In_Arrays => Source.Id.Project.Decl.Arrays,
Shared => Source.Tree.Shared);
Roots :=
Prj.Util.Value_Of
(Index => Name_Id (Source.Id.File),
Src_Index => 0,
In_Array => Root_Arr,
Shared => Source.Tree.Shared);
-- If there is no roots for the specific main, try the language
if Roots = Nil_Variable_Value then
Roots :=
Prj.Util.Value_Of
(Index => Source.Id.Language.Name,
Src_Index => 0,
In_Array => Root_Arr,
Shared => Source.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
-- Then try "*"
if Roots = Nil_Variable_Value then
Name_Len := 1;
Name_Buffer (1) := '*';
Roots :=
Prj.Util.Value_Of
(Index => Name_Find,
Src_Index => 0,
In_Array => Root_Arr,
Shared => Source.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Roots = Nil_Variable_Value then
Debug_Output (" -> no roots declared");
else
List := Roots.Values;
Pattern_Loop :
while List /= Nil_String loop
Elem := Source.Tree.Shared.String_Elements.Table (List);
Get_Name_String (Elem.Value);
To_Lower (Name_Buffer (1 .. Name_Len));
Unit_Name := Name_Find;
-- Check if it is a unit name or a pattern
Pat_Root := False;
for J in 1 .. Name_Len loop
if Name_Buffer (J) not in 'a' .. 'z' and then
Name_Buffer (J) not in '0' .. '9' and then
Name_Buffer (J) /= '_' and then
Name_Buffer (J) /= '.'
then
Pat_Root := True;
exit;
end if;
end loop;
if Pat_Root then
begin
Root_Pattern :=
Compile
(Pattern => Name_Buffer (1 .. Name_Len),
Glob => True);
exception
when Error_In_Regexp =>
Err_Vars.Error_Msg_Name_1 := Unit_Name;
Errutil.Error_Msg
("invalid pattern %", Roots.Location);
exit Pattern_Loop;
end;
end if;
Roots_Found := False;
Iter := For_Each_Source (Source.Tree);
Source_Loop :
loop
Root_Source := Prj.Element (Iter);
exit Source_Loop when Root_Source = No_Source;
Root_Found := False;
if Pat_Root then
Root_Found := Root_Source.Unit /= No_Unit_Index
and then Match
(Get_Name_String (Root_Source.Unit.Name),
Root_Pattern);
else
Root_Found :=
Root_Source.Unit /= No_Unit_Index
and then Root_Source.Unit.Name = Unit_Name;
end if;
if Root_Found then
case Root_Source.Kind is
when Impl =>
null;
when Spec =>
Root_Found :=
Other_Part (Root_Source) = No_Source;
when Sep =>
Root_Found := False;
end case;
end if;
if Root_Found then
Roots_Found := True;
Debug_Output
(" -> ", Name_Id (Root_Source.Display_File));
Dummy := Queue.Insert_No_Roots
(Source => (Format => Format_Gprbuild,
Tree => Source.Tree,
Id => Root_Source,
Closure => False));
Initialize_Source_Record (Root_Source);
if Other_Part (Root_Source) /= No_Source then
Initialize_Source_Record (Other_Part (Root_Source));
end if;
-- Save the root for the binder
Source.Id.Roots := new Source_Roots'
(Root => Root_Source,
Next => Source.Id.Roots);
exit Source_Loop when not Pat_Root;
end if;
Next (Iter);
end loop Source_Loop;
if not Roots_Found then
if Pat_Root then
if not Quiet_Output then
Error_Msg_Name_1 := Unit_Name;
Errutil.Error_Msg
("?no unit matches pattern %", Roots.Location);
end if;
else
Errutil.Error_Msg
("Unit " & Get_Name_String (Unit_Name)
& " does not exist", Roots.Location);
end if;
end if;
List := Elem.Next;
end loop Pattern_Loop;
end if;
end if;
return True;
end Insert;
------------
-- Insert --
------------
procedure Insert
(Source : Source_Info;
With_Roots : Boolean := False)
is
Discard : Boolean;
begin
Discard := Insert (Source, With_Roots);
end Insert;
--------------
-- Is_Empty --
--------------
function Is_Empty return Boolean is
begin
return Q_Processed >= Q.Last;
end Is_Empty;
------------------------
-- Is_Virtually_Empty --
------------------------
function Is_Virtually_Empty return Boolean is
begin
if One_Queue_Per_Obj_Dir then
for J in Q_First .. Q.Last loop
if not Q.Table (J).Processed
and then Available_Obj_Dir (Q.Table (J).Info)
then
return False;
end if;
end loop;
return True;
else
return Is_Empty;
end if;
end Is_Virtually_Empty;
----------------------
-- Set_Obj_Dir_Busy --
----------------------
procedure Set_Obj_Dir_Busy (Obj_Dir : Path_Name_Type) is
begin
if One_Queue_Per_Obj_Dir then
Busy_Obj_Dirs.Set (Obj_Dir, True);
end if;
end Set_Obj_Dir_Busy;
----------------------
-- Set_Obj_Dir_Free --
----------------------
procedure Set_Obj_Dir_Free (Obj_Dir : Path_Name_Type) is
begin
if One_Queue_Per_Obj_Dir then
Busy_Obj_Dirs.Set (Obj_Dir, False);
end if;
end Set_Obj_Dir_Free;
----------
-- Size --
----------
function Size return Natural is
begin
return Q.Last;
end Size;
-------------
-- Element --
-------------
function Element (Rank : Positive) return File_Name_Type is
begin
if Rank <= Q.Last then
case Q.Table (Rank).Info.Format is
when Format_Gprbuild =>
return Q.Table (Rank).Info.Id.File;
when Format_Gnatmake =>
return Q.Table (Rank).Info.File;
end case;
else
return No_File;
end if;
end Element;
------------------
-- Remove_Marks --
------------------
procedure Remove_Marks is
begin
Marks.Reset;
end Remove_Marks;
----------------------------
-- Insert_Project_Sources --
----------------------------
procedure Insert_Project_Sources
(Project : Project_Id;
Project_Tree : Project_Tree_Ref;
All_Projects : Boolean;
Unique_Compile : Boolean)
is
procedure Do_Insert
(Project : Project_Id;
Tree : Project_Tree_Ref;
Context : Project_Context);
-- Local procedures must be commented ???
---------------
-- Do_Insert --
---------------
procedure Do_Insert
(Project : Project_Id;
Tree : Project_Tree_Ref;
Context : Project_Context)
is
Unit_Based : constant Boolean :=
Unique_Compile
or else not Builder_Data (Tree).Closure_Needed;
-- When Unit_Based is True, we enqueue all compilable sources
-- including the unit based (Ada) one. When Unit_Based is False,
-- put the Ada sources only when they are in a library project.
Iter : Source_Iterator;
Source : Prj.Source_Id;
OK : Boolean;
Closure : Boolean;
begin
-- Nothing to do when "-u" was specified and some files were
-- specified on the command line
if Unique_Compile and then Mains.Number_Of_Mains (Tree) > 0 then
return;
end if;
Iter := For_Each_Source (Tree);
loop
Source := Prj.Element (Iter);
exit when Source = No_Source;
if Is_Allowed_Language (Source.Language.Name)
and then Is_Compilable (Source)
and then (All_Projects
or else Is_Extending (Project, Source.Project))
and then not Source.Locally_Removed
and then Source.Replaced_By = No_Source
and then (not Source.Project.Externally_Built
or else (Is_Extending (Project, Source.Project)
and then not Project.Externally_Built))
and then Source.Kind /= Sep
and then Source.Path /= No_Path_Information
then
if Source.Kind = Impl
or else (Source.Unit /= No_Unit_Index
and then Source.Kind = Spec
and then (Other_Part (Source) = No_Source
or else
Other_Part (Source).Locally_Removed))
then
if (Unit_Based
or else Source.Unit = No_Unit_Index
or else Source.Project.Library
or else Context.In_Aggregate_Lib
or else Project.Qualifier = Aggregate_Library)
and then not Is_Subunit (Source)
then
OK := True;
Closure := False;
if Source.Unit /= No_Unit_Index
and then
(Source.Project.Library
or else Project.Qualifier = Aggregate_Library
or else Context.In_Aggregate_Lib)
and then Source.Project.Standalone_Library /= No
then
-- Check if the unit is in the interface
OK := False;
declare
List : String_List_Id;
Element : String_Element;
begin
List := Source.Project.Lib_Interface_ALIs;
while List /= Nil_String loop
Element :=
Project_Tree.Shared.String_Elements.Table
(List);
if Element.Value = Name_Id (Source.Dep_Name)
then
OK := True;
Closure := True;
exit;
end if;
List := Element.Next;
end loop;
end;
end if;
if OK then
Queue.Insert
(Source => (Format => Format_Gprbuild,
Tree => Tree,
Id => Source,
Closure => Closure));
end if;
end if;
end if;
end if;
Next (Iter);
end loop;
end Do_Insert;
procedure Insert_All is
new For_Project_And_Aggregated_Context (Do_Insert);
begin
Insert_All (Project, Project_Tree);
end Insert_Project_Sources;
-------------------------------
-- Insert_Withed_Sources_For --
-------------------------------
procedure Insert_Withed_Sources_For
(The_ALI : ALI.ALI_Id;
Project_Tree : Project_Tree_Ref;
Excluding_Shared_SALs : Boolean := False)
is
Sfile : File_Name_Type;
Afile : File_Name_Type;
Src_Id : Prj.Source_Id;
begin
-- Insert in the queue the unmarked source files (i.e. those which
-- have never been inserted in the queue and hence never considered).
for J in ALI.ALIs.Table (The_ALI).First_Unit ..
ALI.ALIs.Table (The_ALI).Last_Unit
loop
for K in ALI.Units.Table (J).First_With ..
ALI.Units.Table (J).Last_With
loop
Sfile := ALI.Withs.Table (K).Sfile;
-- Skip generics
if Sfile /= No_File then
Afile := ALI.Withs.Table (K).Afile;
Src_Id := Source_Files_Htable.Get
(Project_Tree.Source_Files_HT, Sfile);
while Src_Id /= No_Source loop
Initialize_Source_Record (Src_Id);
if Is_Compilable (Src_Id)
and then Src_Id.Dep_Name = Afile
then
case Src_Id.Kind is
when Spec =>
declare
Bdy : constant Prj.Source_Id :=
Other_Part (Src_Id);
begin
if Bdy /= No_Source
and then not Bdy.Locally_Removed
then
Src_Id := Other_Part (Src_Id);
end if;
end;
when Impl =>
if Is_Subunit (Src_Id) then
Src_Id := No_Source;
end if;
when Sep =>
Src_Id := No_Source;
end case;
exit;
end if;
Src_Id := Src_Id.Next_With_File_Name;
end loop;
-- If Excluding_Shared_SALs is True, do not insert in the
-- queue the sources of a shared Stand-Alone Library.
if Src_Id /= No_Source
and then (not Excluding_Shared_SALs
or else Src_Id.Project.Standalone_Library = No
or else Src_Id.Project.Library_Kind = Static)
then
Queue.Insert
(Source => (Format => Format_Gprbuild,
Tree => Project_Tree,
Id => Src_Id,
Closure => True));
end if;
end if;
end loop;
end loop;
end Insert_Withed_Sources_For;
end Queue;
----------
-- Free --
----------
procedure Free (Data : in out Builder_Project_Tree_Data) is
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Binding_Data_Record, Binding_Data);
TmpB, Binding : Binding_Data := Data.Binding;
begin
while Binding /= null loop
TmpB := Binding.Next;
Unchecked_Free (Binding);
Binding := TmpB;
end loop;
end Free;
------------------
-- Builder_Data --
------------------
function Builder_Data
(Tree : Project_Tree_Ref) return Builder_Data_Access
is
begin
if Tree.Appdata = null then
Tree.Appdata := new Builder_Project_Tree_Data;
end if;
return Builder_Data_Access (Tree.Appdata);
end Builder_Data;
--------------------------------
-- Compute_Compilation_Phases --
--------------------------------
procedure Compute_Compilation_Phases
(Tree : Project_Tree_Ref;
Root_Project : Project_Id;
Option_Unique_Compile : Boolean := False; -- Was "-u" specified ?
Option_Compile_Only : Boolean := False; -- Was "-c" specified ?
Option_Bind_Only : Boolean := False;
Option_Link_Only : Boolean := False)
is
procedure Do_Compute (Project : Project_Id; Tree : Project_Tree_Ref);
----------------
-- Do_Compute --
----------------
procedure Do_Compute (Project : Project_Id; Tree : Project_Tree_Ref) is
Data : constant Builder_Data_Access := Builder_Data (Tree);
All_Phases : constant Boolean :=
not Option_Compile_Only
and then not Option_Bind_Only
and then not Option_Link_Only;
-- Whether the command line asked for all three phases. Depending on
-- the project settings, we might still disable some of the phases.
Has_Mains : constant Boolean := Data.Number_Of_Mains > 0;
-- Whether there are some main units defined for this project tree
-- (either from one of the projects, or from the command line)
begin
if Option_Unique_Compile then
-- If -u or -U is specified on the command line, disregard any -c,
-- -b or -l switch: only perform compilation.
Data.Closure_Needed := False;
Data.Need_Compilation := True;
Data.Need_Binding := False;
Data.Need_Linking := False;
else
Data.Closure_Needed :=
Has_Mains
or else (Root_Project.Library
and then Root_Project.Standalone_Library /= No);
Data.Need_Compilation := All_Phases or Option_Compile_Only;
Data.Need_Binding := All_Phases or Option_Bind_Only;
Data.Need_Linking := (All_Phases or Option_Link_Only)
and Has_Mains;
end if;
if Current_Verbosity = High then
Debug_Output ("compilation phases: "
& " compile=" & Data.Need_Compilation'Img
& " bind=" & Data.Need_Binding'Img
& " link=" & Data.Need_Linking'Img
& " closure=" & Data.Closure_Needed'Img
& " mains=" & Data.Number_Of_Mains'Img,
Project.Name);
end if;
end Do_Compute;
procedure Compute_All is new For_Project_And_Aggregated (Do_Compute);
begin
Compute_All (Root_Project, Tree);
end Compute_Compilation_Phases;
------------------------------
-- Compute_Builder_Switches --
------------------------------
procedure Compute_Builder_Switches
(Project_Tree : Project_Tree_Ref;
Env : in out Prj.Tree.Environment;
Main_Project : Project_Id;
Only_For_Lang : Name_Id := No_Name)
is
Builder_Package : constant Package_Id :=
Value_Of (Name_Builder, Main_Project.Decl.Packages,
Project_Tree.Shared);
Global_Compilation_Array : Array_Element_Id;
Global_Compilation_Elem : Array_Element;
Global_Compilation_Switches : Variable_Value;
Default_Switches_Array : Array_Id;
Builder_Switches_Lang : Name_Id := No_Name;
List : String_List_Id;
Element : String_Element;
Index : Name_Id;
Source : Prj.Source_Id;
Lang : Name_Id := No_Name; -- language index for Switches
Switches_For_Lang : Variable_Value := Nil_Variable_Value;
-- Value of Builder'Default_Switches(lang)
Name : Name_Id := No_Name; -- main file index for Switches
Switches_For_Main : Variable_Value := Nil_Variable_Value;
-- Switches for a specific main. When there are several mains, Name is
-- set to No_Name, and Switches_For_Main might be left with an actual
-- value (so that we can display a warning that it was ignored).
Other_Switches : Variable_Value := Nil_Variable_Value;
-- Value of Builder'Switches(others)
Defaults : Variable_Value := Nil_Variable_Value;
Switches : Variable_Value := Nil_Variable_Value;
-- The computed builder switches
Success : Boolean := False;
begin
if Builder_Package /= No_Package then
Mains.Reset;
-- If there is no main, and there is only one compilable language,
-- use this language as the switches index.
if Mains.Number_Of_Mains (Project_Tree) = 0 then
if Only_For_Lang = No_Name then
declare
Language : Language_Ptr := Main_Project.Languages;
begin
while Language /= No_Language_Index loop
if Language.Config.Compiler_Driver /= No_File
and then Language.Config.Compiler_Driver /= Empty_File
then
if Lang /= No_Name then
Lang := No_Name;
exit;
else
Lang := Language.Name;
end if;
end if;
Language := Language.Next;
end loop;
end;
else
Lang := Only_For_Lang;
end if;
else
for Index in 1 .. Mains.Number_Of_Mains (Project_Tree) loop
Source := Mains.Next_Main.Source;
if Source /= No_Source then
if Switches_For_Main = Nil_Variable_Value then
Switches_For_Main := Value_Of
(Name => Name_Id (Source.File),
Attribute_Or_Array_Name => Name_Switches,
In_Package => Builder_Package,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => False,
Allow_Wildcards => True);
-- If not found, try without extension.
-- That's because gnatmake accepts truncated file names
-- in Builder'Switches
if Switches_For_Main = Nil_Variable_Value
and then Source.Unit /= null
then
Switches_For_Main := Value_Of
(Name => Source.Unit.Name,
Attribute_Or_Array_Name => Name_Switches,
In_Package => Builder_Package,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => False,
Allow_Wildcards => True);
end if;
end if;
if Index = 1 then
Lang := Source.Language.Name;
Name := Name_Id (Source.File);
else
Name := No_Name; -- Can't use main specific switches
if Lang /= Source.Language.Name then
Lang := No_Name;
end if;
end if;
end if;
end loop;
end if;
Global_Compilation_Array := Value_Of
(Name => Name_Global_Compilation_Switches,
In_Arrays => Project_Tree.Shared.Packages.Table
(Builder_Package).Decl.Arrays,
Shared => Project_Tree.Shared);
Default_Switches_Array :=
Project_Tree.Shared.Packages.Table (Builder_Package).Decl.Arrays;
while Default_Switches_Array /= No_Array
and then
Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Name /=
Name_Default_Switches
loop
Default_Switches_Array :=
Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Next;
end loop;
if Global_Compilation_Array /= No_Array_Element
and then Default_Switches_Array /= No_Array
then
Prj.Err.Error_Msg
(Env.Flags,
"Default_Switches forbidden in presence of "
& "Global_Compilation_Switches. Use Switches instead.",
Project_Tree.Shared.Arrays.Table
(Default_Switches_Array).Location);
Fail_Program
(Project_Tree, "*** illegal combination of Builder attributes");
end if;
if Lang /= No_Name then
Switches_For_Lang := Prj.Util.Value_Of
(Name => Lang,
Index => 0,
Attribute_Or_Array_Name => Name_Switches,
In_Package => Builder_Package,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => True);
Defaults := Prj.Util.Value_Of
(Name => Lang,
Index => 0,
Attribute_Or_Array_Name => Name_Default_Switches,
In_Package => Builder_Package,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => True);
end if;
Other_Switches := Prj.Util.Value_Of
(Name => All_Other_Names,
Index => 0,
Attribute_Or_Array_Name => Name_Switches,
In_Package => Builder_Package,
Shared => Project_Tree.Shared);
if not Quiet_Output
and then Mains.Number_Of_Mains (Project_Tree) > 1
and then Switches_For_Main /= Nil_Variable_Value
then
-- More than one main, but we had main-specific switches that
-- are ignored.
if Switches_For_Lang /= Nil_Variable_Value then
Write_Line
("Warning: using Builder'Switches("""
& Get_Name_String (Lang)
& """), as there are several mains");
elsif Other_Switches /= Nil_Variable_Value then
Write_Line
("Warning: using Builder'Switches(others), "
& "as there are several mains");
elsif Defaults /= Nil_Variable_Value then
Write_Line
("Warning: using Builder'Default_Switches("""
& Get_Name_String (Lang)
& """), as there are several mains");
else
Write_Line
("Warning: using no switches from package "
& "Builder, as there are several mains");
end if;
end if;
Builder_Switches_Lang := Lang;
if Name /= No_Name then
-- Get the switches for the single main
Switches := Switches_For_Main;
end if;
if Switches = Nil_Variable_Value or else Switches.Default then
-- Get the switches for the common language of the mains
Switches := Switches_For_Lang;
end if;
if Switches = Nil_Variable_Value or else Switches.Default then
Switches := Other_Switches;
end if;
-- For backward compatibility with gnatmake, if no Switches
-- are declared, check for Default_Switches (<language>).
if Switches = Nil_Variable_Value or else Switches.Default then
Switches := Defaults;
end if;
-- If switches have been found, scan them
if Switches /= Nil_Variable_Value and then not Switches.Default then
List := Switches.Values;
while List /= Nil_String loop
Element := Project_Tree.Shared.String_Elements.Table (List);
Get_Name_String (Element.Value);
if Name_Len /= 0 then
declare
-- Add_Switch might itself be using the name_buffer, so
-- we make a temporary here.
Switch : constant String := Name_Buffer (1 .. Name_Len);
begin
Success := Add_Switch
(Switch => Switch,
For_Lang => Builder_Switches_Lang,
For_Builder => True,
Has_Global_Compilation_Switches =>
Global_Compilation_Array /= No_Array_Element);
end;
if not Success then
for J in reverse 1 .. Name_Len loop
Name_Buffer (J + J) := Name_Buffer (J);
Name_Buffer (J + J - 1) := ''';
end loop;
Name_Len := Name_Len + Name_Len;
Prj.Err.Error_Msg
(Env.Flags,
'"' & Name_Buffer (1 .. Name_Len)
& """ is not a builder switch. Consider moving "
& "it to Global_Compilation_Switches.",
Element.Location);
Fail_Program
(Project_Tree,
"*** illegal switch """
& Get_Name_String (Element.Value) & '"');
end if;
end if;
List := Element.Next;
end loop;
end if;
-- Reset the Builder Switches language
Builder_Switches_Lang := No_Name;
-- Take into account attributes Global_Compilation_Switches
while Global_Compilation_Array /= No_Array_Element loop
Global_Compilation_Elem :=
Project_Tree.Shared.Array_Elements.Table
(Global_Compilation_Array);
Get_Name_String (Global_Compilation_Elem.Index);
To_Lower (Name_Buffer (1 .. Name_Len));
Index := Name_Find;
if Only_For_Lang = No_Name or else Index = Only_For_Lang then
Global_Compilation_Switches := Global_Compilation_Elem.Value;
if Global_Compilation_Switches /= Nil_Variable_Value
and then not Global_Compilation_Switches.Default
then
-- We have found an attribute
-- Global_Compilation_Switches for a language: put the
-- switches in the appropriate table.
List := Global_Compilation_Switches.Values;
while List /= Nil_String loop
Element :=
Project_Tree.Shared.String_Elements.Table (List);
if Element.Value /= No_Name then
Success := Add_Switch
(Switch => Get_Name_String (Element.Value),
For_Lang => Index,
For_Builder => False,
Has_Global_Compilation_Switches =>
Global_Compilation_Array /= No_Array_Element);
end if;
List := Element.Next;
end loop;
end if;
end if;
Global_Compilation_Array := Global_Compilation_Elem.Next;
end loop;
end if;
end Compute_Builder_Switches;
---------------------
-- Write_Path_File --
---------------------
procedure Write_Path_File (FD : File_Descriptor) is
Last : Natural;
Status : Boolean;
begin
Name_Len := 0;
for Index in Directories.First .. Directories.Last loop
Add_Str_To_Name_Buffer (Get_Name_String (Directories.Table (Index)));
Add_Char_To_Name_Buffer (ASCII.LF);
end loop;
Last := Write (FD, Name_Buffer (1)'Address, Name_Len);
if Last = Name_Len then
Close (FD, Status);
else
Status := False;
end if;
if not Status then
Prj.Com.Fail ("could not write temporary file");
end if;
end Write_Path_File;
end Makeutl;
|
oeis/014/A014019.asm | neoneye/loda-programs | 11 | 240623 | ; A014019: Inverse of 10th cyclotomic polynomial.
; 1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0
seq $0,53698 ; a(n) = n^3 + n^2 + n + 1.
seq $0,163812 ; Expansion of (1 - x^5) * (1 - x^6) / ((1 - x) * (1 - x^10)) in powers of x.
|
experiments/test-suite/mutation-based/10/2/fsm.als | kaiyuanw/AlloyFLCore | 1 | 5114 | <reponame>kaiyuanw/AlloyFLCore<filename>experiments/test-suite/mutation-based/10/2/fsm.als
pred test11 {
some disj FSM0: FSM {some disj State0, State1: State {
FSM = FSM0
start = FSM0->State1
stop = FSM0->State0
State = State0 + State1
transition = State1->State0 + State1->State1
}}
}
run test11 for 3 expect 0
|
smsq/java/driver/snd/init.asm | olifink/smsqe | 0 | 4253 | <filename>smsq/java/driver/snd/init.asm<gh_stars>0
; SOUND device initialisation V1.00 2014 <NAME>
; 1.00 2014 Jan 16 0
; BASED ON tt'S NUL device V2.01 1989 <NAME> QJUMP
section sound
xdef snd_init
xref iou_idset
xref iou_idlk
include 'dev8_keys_iod'
include 'dev8_mac_vec'
;+++
; SOUND driver initialisation
;---
snd_init
lea snd_link,a3
jsr iou_idset ; setup sound linkage
jmp iou_idlk ; and link in
snd_link
dc.l $34+iod.sqhd
dc.l 1<<iod..ssr+1<<iod..scn serial and name
novec ; no servers
novec
novec
vec snd_io
vec snd_open
vec snd_close
vec snd_cnam
end
|
oeis/164/A164044.asm | neoneye/loda-programs | 11 | 177521 | <filename>oeis/164/A164044.asm<gh_stars>10-100
; A164044: a(n+1) = 4*a(n) - n.
; 1,3,10,37,144,571,2278,9105,36412,145639,582546,2330173,9320680,37282707,149130814,596523241,2386092948,9544371775,38177487082,152709948309,610839793216,2443359172843,9773436691350,39093746765377,156374987061484,625499948245911,2501999792983618,10007999171934445,40031996687737752,160127986750950979,640511947003803886,2562047788015215513,10248191152060862020,40992764608243448047,163971058432973792154,655884233731895168581,2623536934927580674288,10494147739710322697115,41976590958841290788422
mov $1,1
lpb $0
sub $0,1
mul $1,4
add $2,1
sub $1,$2
lpe
mov $0,$1
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c54a42f.ada | best08618/asylo | 7 | 18182 | <reponame>best08618/asylo
-- C54A42F.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT A CASE_STATEMENT CORRECTLY HANDLES SEVERAL SMALL,
-- NON-CONTIGUOUS RANGES OF INTEGERS COVERED BY A SINGLE 'OTHERS'
-- ALTERNATIVE.
-- (OPTIMIZATION TEST.)
-- RM 03/31/81
WITH REPORT;
PROCEDURE C54A42F IS
USE REPORT ;
BEGIN
TEST( "C54A42F" , "TEST THAT A CASE_STATEMENT CORRECTLY HANDLES" &
" SEVERAL SMALL, NON-CONTIGUOUS ENUMERATION" &
" RANGES COVERED BY A SINGLE 'OTHERS' " &
" ALTERNATIVE" );
DECLARE
TYPE DAY IS (SUN , MON , TUE , WED , THU , FRI , SAT );
DYNVAR2 : DAY := MON ;
STATVAR : DAY := TUE ;
STATCON : CONSTANT DAY := WED ;
DYNVAR : DAY := THU ;
DYNCON : CONSTANT DAY := DAY'VAL( IDENT_INT(5) ); -- FRI
BEGIN
IF EQUAL(1,289) THEN
DYNVAR := SUN ;
DYNVAR2 := SUN ;
END IF;
CASE SUN IS -- SUN
WHEN THU => FAILED("WRONG ALTERNATIVE F1");
WHEN SUN => NULL ;
WHEN SAT => FAILED("WRONG ALTERNATIVE F3");
WHEN TUE..WED => FAILED("WRONG ALTERNATIVE F4");
WHEN OTHERS => FAILED("WRONG ALTERNATIVE F5");
END CASE;
CASE DYNVAR2 IS -- MON
WHEN THU => FAILED("WRONG ALTERNATIVE G1");
WHEN SUN => FAILED("WRONG ALTERNATIVE G2");
WHEN SAT => FAILED("WRONG ALTERNATIVE G3");
WHEN TUE..WED => FAILED("WRONG ALTERNATIVE G4");
WHEN OTHERS => NULL ;
END CASE;
CASE STATVAR IS -- TUE
WHEN THU => FAILED("WRONG ALTERNATIVE H1");
WHEN SUN => FAILED("WRONG ALTERNATIVE H2");
WHEN SAT => FAILED("WRONG ALTERNATIVE H3");
WHEN TUE..WED => NULL ;
WHEN OTHERS => FAILED("WRONG ALTERNATIVE H5");
END CASE;
CASE STATCON IS -- WED
WHEN THU => FAILED("WRONG ALTERNATIVE I1");
WHEN SUN => FAILED("WRONG ALTERNATIVE I2");
WHEN SAT => FAILED("WRONG ALTERNATIVE I3");
WHEN TUE..WED => NULL ;
WHEN OTHERS => FAILED("WRONG ALTERNATIVE I5");
END CASE;
CASE DYNVAR IS -- THU
WHEN THU => NULL ;
WHEN SUN => FAILED("WRONG ALTERNATIVE J2");
WHEN SAT => FAILED("WRONG ALTERNATIVE J3");
WHEN TUE..WED => FAILED("WRONG ALTERNATIVE J4");
WHEN OTHERS => FAILED("WRONG ALTERNATIVE J5");
END CASE;
CASE DYNCON IS -- FRI
WHEN THU => FAILED("WRONG ALTERNATIVE K1");
WHEN SUN => FAILED("WRONG ALTERNATIVE K2");
WHEN SAT => FAILED("WRONG ALTERNATIVE K3");
WHEN TUE..WED => FAILED("WRONG ALTERNATIVE K4");
WHEN OTHERS => NULL ;
END CASE;
CASE DAY'SUCC( DYNCON ) IS -- SAT
WHEN THU => FAILED("WRONG ALTERNATIVE L1");
WHEN SUN => FAILED("WRONG ALTERNATIVE L2");
WHEN SAT => NULL ;
WHEN TUE..WED => FAILED("WRONG ALTERNATIVE L4");
WHEN OTHERS => FAILED("WRONG ALTERNATIVE L5");
END CASE;
END ;
RESULT ;
END C54A42F ;
|
power_station.adb | frmr/power-station | 0 | 24150 | package body power_station with SPARK_Mode is
-------------------
-- Start_Reactor --
-------------------
procedure Start_Reactor is
Pressure, Temperature : Integer;
Pressure_Warning, Pressure_Danger : Boolean;
Temperature_Warning, Temperature_Danger : Boolean;
Shutdown : Boolean;
begin
Pressure := 0;
Temperature := 0;
loop
pragma Loop_Invariant (Status (Standard_Output) = Success and
Pressure >= 0 and
Pressure <= 3 and
Temperature >= 0 and
Temperature <= 3);
Update_Reading("Pressure", Pressure, Shutdown);
if Shutdown = True then
Emergency_Shutdown;
exit;
end if;
Update_Reading("Temperature", Temperature, Shutdown);
if Shutdown = True then
Emergency_Shutdown;
exit;
end if;
Check_Reading(Pressure, Pressure_Warning, Pressure_Danger);
Check_Reading(Temperature, Temperature_Warning, Temperature_Danger);
if Pressure_Danger then
Put_Line("Pressure at dangerous level.");
Emergency_Shutdown;
exit;
end if;
if Temperature_Danger then
Put_Line("Temperature at dangerous level.");
Emergency_Shutdown;
exit;
end if;
if Pressure_Warning and Temperature_Warning then
Put_Line("Pressure and temperature at warning levels.");
Emergency_Shutdown;
exit;
elsif not Pressure_Warning and Temperature_Warning then
Increase_Pressure;
elsif Pressure_Warning and not Temperature_Warning then
Decrease_Pressure;
end if;
pragma Assert(Shutdown = False and
Pressure_Danger = False and
Temperature_Danger = False and
not (Pressure_Warning = True and Temperature_Warning = True));
end loop;
end Start_Reactor;
-------------------
-- Check_Reading --
-------------------
procedure Check_Reading(Value : in Integer;
Warning, Danger : out Boolean) is
begin
if Value >= 2 then
Warning := True;
if Value = 3 then
Danger := True;
else
Danger := False;
end if;
else
Warning := False;
Danger := False;
end if;
end Check_Reading;
-----------------------
-- Decrease_Pressure --
-----------------------
procedure Decrease_Pressure is
begin
Put_Line("Decreasing pressure.");
end Decrease_Pressure;
------------------------
-- Emergency_Shutdown --
------------------------
procedure Emergency_Shutdown is
begin
Put_Line("SCRAM initiated.");
Put_Line("Opening relief valve.");
end Emergency_Shutdown;
-----------------------
-- Increase_Pressure --
-----------------------
procedure Increase_Pressure is
begin
Put_Line("Increasing pressure.");
end Increase_Pressure;
---------------------
-- Update_Reading --
---------------------
procedure Update_Reading(Name : in String;
Value : in out Integer;
Shutdown : out Boolean) is
Input : String(1..2);
Stop : Integer;
begin
Shutdown := False;
Put("Current ");
Put(Name);
Put(": ");
Put_Line(Integer'Image(Value));
Put(Name);
Put(" change: ");
loop
pragma Loop_Invariant (Status (Standard_Output) = Success);
Get_Line(Input,Stop);
exit when not (Stop = 0);
end loop;
if Input(1) = '+' then
if Value < 3 then
Value := Value + 1;
end if;
elsif Input(1) = '-' then
if Value > 0 then
Value := Value - 1;
end if;
elsif Input(1) /= '=' then
Put_Line("Invalid input. Requesting shutdown.");
Shutdown := True;
end if;
end Update_Reading;
end power_station;
|
ubb/asc/lab06/c.asm | AlexanderChristian/private_courses | 0 | 14508 | <reponame>AlexanderChristian/private_courses
assume cs:code, ds:data
data segment
;a dd 0aa00bf12h ;a= 1010 1010 0000 0000 1011 1111 0001 0010
; 5df ; 0000 0000 0000 0000 0000 0110 1101 1111
a dd 0fffffh
bmask dw ?
nbits dw 0
data ends
code segment
start:
mov ax, data
mov ds, ax
mov ax, word ptr a
mov dx, word ptr a + 2
mov cx, 16
mov si, 0 ; this is where we keep the number of 1 bits from the representation
cnt_biti_ax:
dec cx
mov bx, ax
mov bmask, 1
shl bmask, cl
and bx, bmask
cmp bx, 0
jne incr_bits_ax
jmp not_incr_ax
incr_bits_ax:
inc si
not_incr_ax:
inc cx
loop cnt_biti_ax
mov cx, 16
cnt_biti_dx: ; now count the 1 bits from the dx register
dec cx
mov bx, dx
mov bmask, 1
shl bmask, cl
and bx, bmask
cmp bx, 0
jne incr_bits_dx
jmp not_incr_dx
incr_bits_dx:
inc si
not_incr_dx:
inc cx
loop cnt_biti_dx
mov nbits, si
cmp si, 16
ja invert
jmp divide
invert:
xor ax, 0000000101010000b
xor dx, 0000001000000000b
jmp end_of_pr
divide:
mov cx, 2
divide_by_two:
sar dx, 1
rcr ax, 1
loop divide_by_two
end_of_pr:
mov word ptr a, ax
mov word ptr a + 2, dx
mov ax, 4c00h
int 21h
code ends
end start
for(int i = 0 ; i < 16 ; ++ i) {
if(ax & (1 << i)) {
++ cnt
}
}
|
coverage/IN_CTS/0583-COVERAGE-cmp-inst-analysis-31-26-47/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 0 | 82551 | ; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 90
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %23
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %8 "a"
OpName %12 "buf0"
OpMemberName %12 0 "_GLF_uniform_int_values"
OpName %14 ""
OpName %23 "_GLF_color"
OpName %34 "buf1"
OpMemberName %34 0 "five"
OpName %36 ""
OpDecorate %11 ArrayStride 16
OpMemberDecorate %12 0 Offset 0
OpDecorate %12 Block
OpDecorate %14 DescriptorSet 0
OpDecorate %14 Binding 0
OpDecorate %23 Location 0
OpMemberDecorate %34 0 Offset 0
OpDecorate %34 Block
OpDecorate %36 DescriptorSet 0
OpDecorate %36 Binding 1
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeInt 32 1
%7 = OpTypePointer Function %6
%9 = OpTypeInt 32 0
%10 = OpConstant %9 2
%11 = OpTypeArray %6 %10
%12 = OpTypeStruct %11
%13 = OpTypePointer Uniform %12
%14 = OpVariable %13 Uniform
%15 = OpConstant %6 0
%16 = OpConstant %6 1
%17 = OpTypePointer Uniform %6
%20 = OpTypeFloat 32
%21 = OpTypeVector %20 4
%22 = OpTypePointer Output %21
%23 = OpVariable %22 Output
%34 = OpTypeStruct %6
%35 = OpTypePointer Uniform %34
%36 = OpVariable %35 Uniform
%39 = OpTypeBool
%65 = OpConstant %6 20
%4 = OpFunction %2 None %3
%5 = OpLabel
%8 = OpVariable %7 Function
%18 = OpAccessChain %17 %14 %15 %16
%19 = OpLoad %6 %18
OpStore %8 %19
%24 = OpAccessChain %17 %14 %15 %15
%25 = OpLoad %6 %24
%26 = OpConvertSToF %20 %25
%27 = OpCompositeConstruct %21 %26 %26 %26 %26
OpStore %23 %27
OpBranch %28
%28 = OpLabel
OpLoopMerge %30 %31 None
OpBranch %29
%29 = OpLabel
%32 = OpAccessChain %17 %14 %15 %16
%33 = OpLoad %6 %32
%37 = OpAccessChain %17 %36 %15
%38 = OpLoad %6 %37
%40 = OpSGreaterThanEqual %39 %33 %38
OpSelectionMerge %42 None
OpBranchConditional %40 %41 %42
%41 = OpLabel
OpBranch %30
%42 = OpLabel
%44 = OpLoad %6 %8
%45 = OpIAdd %6 %44 %16
OpStore %8 %45
OpBranch %31
%31 = OpLabel
%46 = OpAccessChain %17 %14 %15 %16
%47 = OpLoad %6 %46
%48 = OpAccessChain %17 %14 %15 %16
%49 = OpLoad %6 %48
%50 = OpSLessThan %39 %47 %49
OpBranchConditional %50 %28 %30
%30 = OpLabel
OpBranch %51
%51 = OpLabel
OpLoopMerge %53 %54 None
OpBranch %52
%52 = OpLabel
%55 = OpLoad %6 %8
%56 = OpAccessChain %17 %36 %15
%57 = OpLoad %6 %56
%58 = OpSGreaterThanEqual %39 %55 %57
OpSelectionMerge %60 None
OpBranchConditional %58 %59 %60
%59 = OpLabel
OpBranch %53
%60 = OpLabel
%62 = OpLoad %6 %8
%63 = OpIAdd %6 %62 %16
OpStore %8 %63
OpBranch %54
%54 = OpLabel
%64 = OpLoad %6 %8
%66 = OpSLessThan %39 %64 %65
OpBranchConditional %66 %51 %53
%53 = OpLabel
OpBranch %67
%67 = OpLabel
OpLoopMerge %69 %70 None
OpBranch %68
%68 = OpLabel
%71 = OpLoad %6 %8
%72 = OpIAdd %6 %71 %16
OpStore %8 %72
%73 = OpAccessChain %17 %14 %15 %16
%74 = OpLoad %6 %73
%75 = OpConvertSToF %20 %74
%76 = OpAccessChain %17 %14 %15 %15
%77 = OpLoad %6 %76
%78 = OpConvertSToF %20 %77
%79 = OpAccessChain %17 %14 %15 %15
%80 = OpLoad %6 %79
%81 = OpConvertSToF %20 %80
%82 = OpAccessChain %17 %14 %15 %16
%83 = OpLoad %6 %82
%84 = OpConvertSToF %20 %83
%85 = OpCompositeConstruct %21 %75 %78 %81 %84
OpStore %23 %85
OpBranch %70
%70 = OpLabel
%86 = OpLoad %6 %8
%87 = OpAccessChain %17 %14 %15 %16
%88 = OpLoad %6 %87
%89 = OpSLessThan %39 %86 %88
OpBranchConditional %89 %67 %69
%69 = OpLabel
OpReturn
OpFunctionEnd
|
org.alloytools.alloy.extra/extra/models/book/chapter2/addressBook2c.als | Kaixi26/org.alloytools.alloy | 527 | 3353 | <reponame>Kaixi26/org.alloytools.alloy
module tour/addressBook2c ----- Page 20
abstract sig Target { }
sig Addr extends Target { }
abstract sig Name extends Target { }
sig Alias, Group extends Name { }
sig Book {
addr: Name->Target
} {
no n: Name | n in n.^addr
}
pred show [b:Book] { some Alias.(b.addr) }
// This command generates an instance similar to Fig 2.11
run show for 3 but 1 Book
|
agda/par-swap/union-confluent.agda | florence/esterel-calculus | 3 | 15362 | <filename>agda/par-swap/union-confluent.agda
module par-swap.union-confluent where
open import par-swap
open import par-swap.properties
open import par-swap.confluent
open import par-swap.dpg
open import Data.Nat using (_+_ ; _≤′_ ; _<′_ ; suc ; zero ; ≤′-refl ; ℕ)
open import Data.Nat.Properties.Simple using ( +-comm ; +-assoc)
open import Data.Nat.Properties using (s≤′s ; z≤′n)
open import Data.MoreNatProp using (≤′-trans ; suc≤′⇒≤′)
open import Data.Product
open import Data.Sum
open import Data.Bool
open import Data.List using ([] ; [_] ; _∷_ ; List ; _++_)
open import Data.Empty
open import Induction.Nat using (<-rec)
open import Induction.Lexicographic using ()
open import Induction using ()
open import Induction.WellFounded using ()
open import Level using ()
open import Relation.Binary using (Rel)
open import Esterel.Lang
open import Esterel.Lang.Properties
open import Esterel.Environment as Env
open import Esterel.Context
open import Esterel.Lang.Binding
open import Relation.Binary.PropositionalEquality
using (_≡_ ; refl ; sym ; subst ; cong ; trans ;
module ≡-Reasoning ; cong₂ ; subst₂ ; inspect)
open import sn-calculus
open import context-properties -- get view, E-views
open import binding-preserve using (sn⟶-maintains-binding ; sn⟶*-maintains-binding)
open import noetherian using (noetherian ; ∥_∥s)
open import sn-calculus-props
∥R-preserves-∥∥s : ∀ {p q} -> p ∥R q -> ∥ q ∥s ≡ ∥ p ∥s
∥R-preserves-∥∥s (∥Rstep{C}{p}{q} d≐C⟦p∥q⟧c)
rewrite sym (unplugc d≐C⟦p∥q⟧c) = ∥∥par-sym p q C where
∥∥par-sym : ∀ p q C -> ∥ C ⟦ q ∥ p ⟧c ∥s ≡ ∥ C ⟦ p ∥ q ⟧c ∥s
∥∥par-sym p q [] rewrite +-comm ∥ p ∥s ∥ q ∥s = refl
∥∥par-sym p q (_ ∷ C) with ∥∥par-sym p q C
∥∥par-sym p q (ceval (epar₁ _) ∷ C) | R rewrite R = refl
∥∥par-sym p q (ceval (epar₂ _) ∷ C) | R rewrite R = refl
∥∥par-sym p q (ceval (eseq _) ∷ C) | R rewrite R = refl
∥∥par-sym p q (ceval (eloopˢ _) ∷ C) | R rewrite R = refl
∥∥par-sym p q (ceval (esuspend _) ∷ C) | R rewrite R = refl
∥∥par-sym p q (ceval etrap ∷ C) | R rewrite R = refl
∥∥par-sym p q (csignl _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cpresent₁ _ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cpresent₂ _ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cloop ∷ C) | R rewrite R = refl
∥∥par-sym p q (cloopˢ₂ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cseq₂ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cshared _ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cvar _ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cif₁ _ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cif₂ _ _ ∷ C) | R rewrite R = refl
∥∥par-sym p q (cenv _ _ ∷ C) | R rewrite R = refl
∥R*-preserves-∥∥s : ∀ {p q} -> p ∥R* q -> ∥ q ∥s ≡ ∥ p ∥s
∥R*-preserves-∥∥s ∥R0 = refl
∥R*-preserves-∥∥s (∥Rn p∥Rq p∥R*q) with ∥R*-preserves-∥∥s p∥R*q
... | x rewrite ∥R-preserves-∥∥s p∥Rq = x
module LexicographicLE {a b ℓ₁ ℓ₂} {A : Set a} {B : Set b}
(RelA : Rel A ℓ₁)
(RelB : Rel B ℓ₂) where
open import Level
open import Relation.Binary
open import Induction.WellFounded
open import Data.Product
open import Function
open import Induction
open import Relation.Unary
data _<_ : Rel (Σ A \ _ → B) (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
left : ∀ {x₁ y₁ x₂ y₂} (x₁<x₂ : RelA x₁ x₂) → (x₁ , y₁) < (x₂ , y₂)
right : ∀ {x₁ y₁ x₂ y₂} (y₁<y₂ : RelB y₁ y₂) → (x₁ ≡ x₂ ⊎ RelA x₁ x₂) →
(x₁ , y₁) < (x₂ , y₂)
mutual
accessibleLE : ∀ {x y} →
Acc RelA x → WellFounded RelB →
Acc _<_ (x , y)
accessibleLE accA wfB = acc (accessibleLE′ accA (wfB _) wfB)
accessibleLE′ :
∀ {x y} →
Acc RelA x → Acc RelB y → WellFounded RelB →
WfRec _<_ (Acc _<_) (x , y)
accessibleLE′ (acc rsA) _ wfB ._ (left x′<x) = accessibleLE (rsA _ x′<x) wfB
accessibleLE′ accA (acc rsB) wfB .(_ , _) (right y′<y (inj₁ refl)) =
acc (accessibleLE′ accA (rsB _ y′<y) wfB)
accessibleLE′ (acc rsA) (acc rsB) wfB .(_ , _) (right y′<y (inj₂ x′<x)) =
acc (accessibleLE′ (rsA _ x′<x) (rsB _ y′<y) wfB)
wellFounded : WellFounded RelA → WellFounded RelB →
WellFounded _<_
wellFounded wfA wfB p = accessibleLE (wfA (proj₁ p)) wfB
module _ where
open LexicographicLE _<′_ _<′_ public
renaming (_<_ to _<<′_;
wellFounded to <<′-wellFounded;
left to <<′-left;
right to <<′-right)
module _ {ℓ} where
open Induction.WellFounded.All
(<<′-wellFounded Induction.Nat.<′-wellFounded Induction.Nat.<′-wellFounded) ℓ public
renaming (wfRec-builder to <<′-rec-builder;
wfRec to <<′-rec)
{-
proof from _On the Power of Simple Diagrams_
by <NAME>, RTA 1996 (lemma 7)
-}
∥R*-sn⟶*-commute : CB-COMMUTE _∥R*_ _sn⟶*_
∥R*-sn⟶*-commute = thm where
redlen : ∀ {p q} -> p ∥R* q -> ℕ
redlen ∥R0 = zero
redlen (∥Rn p∥Rq p∥R*q) = suc (redlen p∥R*q)
sharedtype : (ℕ × ℕ) -> Set
sharedtype (sizeb , distab) =
∀ {a b c BV FV} ->
CorrectBinding a BV FV ->
(a∥R*b : a ∥R* b) ->
a sn⟶* c ->
redlen a∥R*b ≡ distab ->
∥ b ∥s ≡ sizeb ->
∃ \ {d -> b sn⟶* d × c ∥R* d}
{- this proof is not working the way that
Di Cosmo intended; it uses properties
about ∥R* reduction directly -}
composing-the-diagram-in-the-hypothesis-down :
∀ {p1 p2 p3 q1 q3} ->
p1 sn⟶ p2 ->
p2 sn⟶* p3 ->
p1 ∥R* q1 ->
p3 ∥R* q3 ->
(∥ q3 ∥s) <′ (∥ q1 ∥s)
composing-the-diagram-in-the-hypothesis-down = thm where
thm-no-∥R* : ∀ {p1 p2 p3} ->
p1 sn⟶ p2 ->
p2 sn⟶* p3 ->
∥ p3 ∥s <′ ∥ p1 ∥s
thm-no-∥R* p1sn⟶p2 rrefl = noetherian p1sn⟶p2
thm-no-∥R* {p1}{p2}{p3} p1sn⟶p2 (rstep{q = r} p2sn⟶r rsn⟶*p3)
with thm-no-∥R* p2sn⟶r rsn⟶*p3
... | ∥p3∥s<′∥p2∥s =
≤′-trans {y = ∥ p2 ∥s}
∥p3∥s<′∥p2∥s
(suc≤′⇒≤′ ∥ p2 ∥s ∥ p1 ∥s (noetherian p1sn⟶p2))
thm : ∀ {p1 p2 p3 q1 q3} ->
p1 sn⟶ p2 ->
p2 sn⟶* p3 ->
p1 ∥R* q1 ->
p3 ∥R* q3 ->
(∥ q3 ∥s) <′ (∥ q1 ∥s)
thm p1sn⟶p2 p2sn⟶*p3 p1∥R*q1 p3∥R*q3
rewrite ∥R*-preserves-∥∥s p1∥R*q1
| ∥R*-preserves-∥∥s p3∥R*q3 =
thm-no-∥R* p1sn⟶p2 p2sn⟶*p3
step : ∀ nm ->
(∀ (nm′ : ℕ × ℕ) -> nm′ <<′ nm -> sharedtype nm′) ->
sharedtype nm
step (sizeb , distab) rec CBa ∥R0 asn⟶*c redlena∥R*b≡distab ∥b∥s≡sizeb = _ , asn⟶*c , ∥R0
step (sizeb , distab) rec CBa a∥R*b rrefl redlena∥R*b≡distab ∥b∥s≡sizeb = _ , rrefl , a∥R*b
step (sizeb , distab) rec {a} {b} {c} CBa
(∥Rn{q = a″} a∥Ra″ a″∥R*b)
(rstep{q = a′} asn⟶a′ a′sn⟶*c)
redlena∥R*b≡distab
∥b∥s≡sizeb rewrite sym redlena∥R*b≡distab
with sn⟶-maintains-binding CBa asn⟶a′
... | (_ , CBa′ , _)
with DPG a∥Ra″ asn⟶a′
... | (a‴ , gap) , a″sn⟶gap , gapsn⟶*a‴ , a′∥R*a‴
with rec (sizeb , redlen a″∥R*b) (<<′-right (s≤′s ≤′-refl) (inj₁ refl))
(∥R-maintains-binding CBa a∥Ra″)
a″∥R*b (rstep a″sn⟶gap gapsn⟶*a‴) refl ∥b∥s≡sizeb
... | (b′ , bsn⟶*b′ , a‴∥R*b′) rewrite sym ∥b∥s≡sizeb
with composing-the-diagram-in-the-hypothesis-down a″sn⟶gap gapsn⟶*a‴ a″∥R*b a‴∥R*b′
... | ∥b′∥s<′∥b∥s
with rec (∥ b′ ∥s , redlen (∥R*-concat a′∥R*a‴ a‴∥R*b′))
(<<′-left ∥b′∥s<′∥b∥s)
CBa′ (∥R*-concat a′∥R*a‴ a‴∥R*b′) a′sn⟶*c refl refl
... | ( d , b′sn⟶*d , c∥R*d) = d , sn⟶*+ bsn⟶*b′ b′sn⟶*d , c∥R*d
lemma7-commutation : ∀ (nm : ℕ × ℕ) -> sharedtype nm
lemma7-commutation = <<′-rec _ step
thm : CB-COMMUTE _∥R*_ _sn⟶*_
thm {p}{q}{r} CBp p∥R*q psn⟶*r =
lemma7-commutation (∥ q ∥s , redlen p∥R*q) CBp p∥R*q psn⟶*r refl refl
∥R*∪sn⟶*-confluent : CB-CONFLUENT _∥R*∪sn⟶*_
∥R*∪sn⟶*-confluent =
\ { CBp p∥R*∪sn⟶*q p∥R*∪sn⟶*r ->
hindley-rosen
(redlen p∥R*∪sn⟶*q , redlen p∥R*∪sn⟶*r)
CBp p∥R*∪sn⟶*q p∥R*∪sn⟶*r refl refl} where
redlen : ∀ {p q} -> p ∥R*∪sn⟶* q -> ℕ
redlen (∪∥R* _ r) = suc (redlen r)
redlen (∪sn⟶* _ r) = suc (redlen r)
redlen ∪refl = zero
sharedtype : ℕ × ℕ -> Set
sharedtype (n , m) = ∀ {p q r BV FV} ->
CorrectBinding p BV FV ->
(p∥R*∪sn⟶*q : p ∥R*∪sn⟶* q) ->
(p∥R*∪sn⟶*r : p ∥R*∪sn⟶* r) ->
n ≡ redlen p∥R*∪sn⟶*q ->
m ≡ redlen p∥R*∪sn⟶*r ->
∃ λ {z → (q ∥R*∪sn⟶* z × r ∥R*∪sn⟶* z)}
length-lemma : ∀ {a b} (l : a ∥R*∪sn⟶* b) ->
suc zero ≡ suc (redlen l) ⊎
suc zero <′ suc (redlen l)
length-lemma (∪∥R* p∥R*q l) = inj₂ (s≤′s (s≤′s z≤′n))
length-lemma (∪sn⟶* psn⟶*q l) = inj₂ (s≤′s (s≤′s z≤′n))
length-lemma ∪refl = inj₁ refl
step : ∀ nm ->
(∀ (nm′ : ℕ × ℕ) -> nm′ <<′ nm -> sharedtype nm′) ->
sharedtype nm
step (n , m) rec CBp (∪∥R* p∥R*q a) ∪refl n≡ m≡ = _ , ∪refl , ∪∥R* p∥R*q a
step (n , m) rec CBp (∪sn⟶* psn⟶*q a) ∪refl n≡ m≡ = _ , ∪refl , ∪sn⟶* psn⟶*q a
step (n , m) rec CBp ∪refl (∪∥R* p∥R*q b) n≡ m≡ = _ , ∪∥R* p∥R*q b , ∪refl
step (n , m) rec CBp ∪refl (∪sn⟶* psn⟶*q b) n≡ m≡ = _ , ∪sn⟶* psn⟶*q b , ∪refl
step (n , m) rec CBp ∪refl ∪refl n≡ m≡ = _ , ∪refl , ∪refl
step(n , m) rec {p}{q}{r} CBp
(∪∥R* {_}{q₁} p∥R*q₁ q₁∥R*∪sn⟶*q)
(∪∥R* {_}{r₁} p∥R*r₁ r₁∥R*∪sn⟶*r)
n≡ m≡ rewrite n≡ | m≡
with BVFVcorrect _ _ _ CBp
... | refl , refl
with ∥R*-maintains-binding CBp p∥R*q₁
... | CBq₁
with BVFVcorrect _ _ _ CBq₁
... | refl , refl
with ∥R*-maintains-binding CBp p∥R*r₁
... | CBr₁
with BVFVcorrect _ _ _ CBr₁
... | refl , refl
with ∥R*-confluent CBp p∥R*q₁ p∥R*r₁
... | q₁r₁ , q₁∥R*q₁r₁ , r₁∥R*q₁r₁
with rec (suc zero , redlen r₁∥R*∪sn⟶*r)
(<<′-right ≤′-refl (length-lemma q₁∥R*∪sn⟶*q))
CBr₁ (∪∥R* r₁∥R*q₁r₁ ∪refl) r₁∥R*∪sn⟶*r
refl refl
... | q₁r₁r , q₁r₁∥R*∪sn⟶*q₁r₁r , r∥R*∪sn⟶*q₁r₁r
with rec (redlen q₁∥R*∪sn⟶*q , suc (redlen q₁r₁∥R*∪sn⟶*q₁r₁r))
(<<′-left ≤′-refl)
CBq₁ q₁∥R*∪sn⟶*q (∪∥R* q₁∥R*q₁r₁ q₁r₁∥R*∪sn⟶*q₁r₁r)
refl refl
... | qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , q₁r₁r∥R*∪sn⟶*qq₁r₁r
= qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , ∥R*∪sn⟶*-concat r∥R*∪sn⟶*q₁r₁r q₁r₁r∥R*∪sn⟶*qq₁r₁r
step (n , m) rec {p}{q}{r} CBp
(∪∥R*{_}{q₁} p∥R*q₁ q₁∥R*∪sn⟶*q)
(∪sn⟶*{_}{r₁} psn⟶*r₁ r₁∥R*∪sn⟶*r)
n≡ m≡ rewrite n≡ | m≡
with BVFVcorrect _ _ _ CBp
... | refl , refl
with ∥R*-maintains-binding CBp p∥R*q₁
... | CBq₁
with BVFVcorrect _ _ _ CBq₁
... | refl , refl
with sn⟶*-maintains-binding CBp psn⟶*r₁
... | (BVr₁ , FVr₁) , CBr₁
with ∥R*-sn⟶*-commute CBp p∥R*q₁ psn⟶*r₁
... | q₁r₁ , q₁sn⟶*q₁r₁ , r₁∥R*q₁r₁
with rec (suc zero , redlen r₁∥R*∪sn⟶*r)
(<<′-right ≤′-refl (length-lemma q₁∥R*∪sn⟶*q))
CBr₁ (∪∥R* r₁∥R*q₁r₁ ∪refl) r₁∥R*∪sn⟶*r
refl refl
... | q₁r₁r , q₁r₁∥R*∪sn⟶*q₁r₁r , r∥R*∪sn⟶*q₁r₁r
with rec (redlen q₁∥R*∪sn⟶*q , suc (redlen q₁r₁∥R*∪sn⟶*q₁r₁r))
(<<′-left ≤′-refl)
CBq₁ q₁∥R*∪sn⟶*q (∪sn⟶* q₁sn⟶*q₁r₁ q₁r₁∥R*∪sn⟶*q₁r₁r)
refl refl
... | qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , q₁r₁r∥R*∪sn⟶*qq₁r₁r
= qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , ∥R*∪sn⟶*-concat r∥R*∪sn⟶*q₁r₁r q₁r₁r∥R*∪sn⟶*qq₁r₁r
step (n , m) rec {p}{q}{r} CBp
(∪sn⟶*{_}{q₁} psn⟶*q₁ q₁∥R*∪sn⟶*q)
(∪∥R*{_}{r₁} p∥R*r₁ r₁∥R*∪sn⟶*r)
n≡ m≡ rewrite n≡ | m≡
with BVFVcorrect _ _ _ CBp
... | refl , refl
with sn⟶*-maintains-binding CBp psn⟶*q₁
... | (BVq₁ , FVq₁) , CBq₁
with ∥R*-maintains-binding CBp p∥R*r₁
... | CBr₁
with BVFVcorrect _ _ _ CBr₁
... | refl , refl
with ∥R*-sn⟶*-commute CBp p∥R*r₁ psn⟶*q₁
... | r₁q₁ , r₁sn⟶*r₁q₁ , q₁∥R*r₁q₁
with rec (suc zero , redlen r₁∥R*∪sn⟶*r)
(<<′-right ≤′-refl (length-lemma q₁∥R*∪sn⟶*q))
CBr₁ (∪sn⟶* r₁sn⟶*r₁q₁ ∪refl) r₁∥R*∪sn⟶*r
refl refl
... | r₁q₁r , r₁q₁∥R*∪sn⟶*r₁q₁r , r∥R*∪sn⟶*r₁q₁r
with rec (redlen q₁∥R*∪sn⟶*q , suc (redlen r₁q₁∥R*∪sn⟶*r₁q₁r))
(<<′-left ≤′-refl)
CBq₁ q₁∥R*∪sn⟶*q (∪∥R* q₁∥R*r₁q₁ r₁q₁∥R*∪sn⟶*r₁q₁r)
refl refl
... | qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , q₁r₁r∥R*∪sn⟶*qq₁r₁r
= qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , ∥R*∪sn⟶*-concat r∥R*∪sn⟶*r₁q₁r q₁r₁r∥R*∪sn⟶*qq₁r₁r
step (n , m) rec {p}{q}{r} CBp
(∪sn⟶*{_}{q₁} psn⟶*q₁ q₁∥R*∪sn⟶*q)
(∪sn⟶*{_}{r₁} psn⟶*r₁ r₁∥R*∪sn⟶*r)
n≡ m≡ rewrite n≡ | m≡
with BVFVcorrect _ _ _ CBp
... | refl , refl
with sn⟶*-maintains-binding CBp psn⟶*q₁
... | (BVq₁ , FVq₁) , CBq₁
with sn⟶*-maintains-binding CBp psn⟶*r₁
... | (BVr₁ , FVr₁) , CBr₁
with sn⟶*-confluent CBp psn⟶*q₁ psn⟶*r₁
... | q₁r₁ , q₁sn⟶*q₁r₁ , r₁sn⟶*q₁r₁
with rec (suc zero , redlen r₁∥R*∪sn⟶*r)
(<<′-right ≤′-refl (length-lemma q₁∥R*∪sn⟶*q))
CBr₁ (∪sn⟶* r₁sn⟶*q₁r₁ ∪refl) r₁∥R*∪sn⟶*r
refl refl
... | q₁r₁r , q₁r₁∥R*∪sn⟶*q₁r₁r , r∥R*∪sn⟶*q₁r₁r
with rec (redlen q₁∥R*∪sn⟶*q , suc (redlen q₁r₁∥R*∪sn⟶*q₁r₁r))
(<<′-left ≤′-refl)
CBq₁ q₁∥R*∪sn⟶*q (∪sn⟶* q₁sn⟶*q₁r₁ q₁r₁∥R*∪sn⟶*q₁r₁r)
refl refl
... | qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , q₁r₁r∥R*∪sn⟶*qq₁r₁r
= qq₁r₁r , q∥R*∪sn⟶*qq₁r₁r , ∥R*∪sn⟶*-concat r∥R*∪sn⟶*q₁r₁r q₁r₁r∥R*∪sn⟶*qq₁r₁r
hindley-rosen : ∀ (nm : ℕ × ℕ) -> sharedtype nm
hindley-rosen = <<′-rec _ step
|
src/kernel/drivers/soc/timer2_dseg.asm | rostislav-nikitin/socOS | 1 | 245237 | <filename>src/kernel/drivers/soc/timer2_dseg.asm<gh_stars>1-10
.dseg
timer2_static_instance: .BYTE SZ_ST_TIMER2 |
programs/oeis/211/A211562.asm | karttu/loda | 0 | 86231 | <reponame>karttu/loda
; A211562: Number of nonnegative integer arrays of length n+2 with new values 0 upwards introduced in order, and containing the value n-1.
; 5,14,36,81,162,295,499,796,1211,1772,2510,3459,4656,6141,7957,10150,12769,15866,19496,23717,28590,34179,40551,47776,55927,65080,75314,86711,99356,113337,128745,145674,164221,184486,206572,230585,256634,284831,315291,348132,383475,421444,462166,505771,552392,602165,655229,711726,771801,835602,903280,974989,1050886,1131131,1215887,1305320,1399599,1498896,1603386,1713247,1828660,1949809,2076881,2210066,2349557,2495550,2648244,2807841,2974546,3148567,3330115,3519404,3716651,3922076,4135902,4358355,4589664,4830061,5079781,5339062,5608145,5887274,6176696,6476661,6787422,7109235,7442359,7787056,8143591,8512232,8893250,9286919,9693516,10113321,10546617,10993690,11454829,11930326,12420476,12925577,13445930,13981839,14533611,15101556,15685987,16287220,16905574,17541371,18194936,18866597,19556685,20265534,20993481,21740866,22508032,23295325,24103094,24931691,25781471,26652792,27546015,28461504,29399626,30360751,31345252,32353505,33385889,34442786,35524581,36631662,37764420,38923249,40108546,41320711,42560147,43827260,45122459,46446156,47798766,49180707,50592400,52034269,53506741,55010246,56545217,58112090,59711304,61343301,63008526,64707427,66440455,68208064,70010711,71848856,73722962,75633495,77580924,79565721,81588361,83649322,85749085,87888134,90066956,92286041,94545882,96846975,99189819,101574916,104002771,106473892,108988790,111547979,114151976,116801301,119496477,122238030,125026489,127862386,130746256,133678637,136660070,139691099,142772271,145904136,149087247,152322160,155609434,158949631,162343316,165791057,169293425,172850994,176464341,180134046,183860692,187644865,191487154,195388151,199348451,203368652,207449355,211591164,215794686,220060531,224389312,228781645,233238149,237759446,242346161,246998922
add $0,1
mov $1,2
mov $3,1
lpb $0,1
add $1,1
add $3,$0
sub $0,1
add $2,$3
add $1,$2
lpe
|
programs/oeis/288/A288933.asm | neoneye/loda | 22 | 27289 | <gh_stars>10-100
; A288933: Positions of 0 in A288932; complement of A288934.
; 2,4,7,9,13,15,18,20,25,27,30,32,36,38,41,43,49,51,54,56,60,62,65,67,72,74,77,79,83,85,88,90,97,99,102,104,108,110,113,115,120,122,125,127,131,133,136,138,144,146,149,151,155,157,160,162,167,169,172,174,178,180,183,185,193,195,198,200,204,206,209,211,216,218,221,223,227,229,232,234,240,242,245,247,251,253,256,258,263,265,268,270,274,276,279,281,288,290,293,295
mov $1,$0
lpb $1
add $0,$1
div $1,2
lpe
add $0,2
|
src/skill-field_declarations.adb | skill-lang/adaCommon | 0 | 22588 | <filename>src/skill-field_declarations.adb
-- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ field handling in skill --
-- |___/_|\_\_|_|____| by: <NAME> --
-- --
pragma Ada_2012;
with Skill.Errors;
with Skill.Field_Types;
with Skill.Internal.Parts;
with Skill.Iterators.Type_Order;
with Interfaces;
with Skill.Types.Pools;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
package body Skill.Field_Declarations is
procedure Delete_Chunk (This : Chunk_Entry) is
procedure Delete is new Ada.Unchecked_Deallocation
(Chunk_Entry_T,
Chunk_Entry);
D : Chunk_Entry := This;
begin
This.C.Free;
This.Input.Free;
Delete (D);
end Delete_Chunk;
function Name
(This : access Field_Declaration_T'Class) return Types.String_Access is
(This.Name);
function Owner
(This : access Field_Declaration_T'Class) return Skill.Types.Pools.Pool
is
function Convert is new Ada.Unchecked_Conversion
(Owner_T,
Skill.Types.Pools.Pool);
begin
return Convert (This.Owner);
end Owner;
function Check (This : access Field_Declaration_T) return Boolean is
Iter : aliased Skill.Iterators.Type_Order.Iterator;
RC : Skill.Field_Restrictions.Checkable;
begin
if This.Restrictions.Is_Empty then
return True;
end if;
for R of This.Restrictions loop
if R.all in Skill.Field_Restrictions.Checkable_T'Class then
RC := Skill.Field_Restrictions.Checkable (R);
Iter.Init (This.Owner.To_Pool);
while Iter.Has_Next loop
if not RC.Check
(Iter.Next.Dynamic.Reflective_Get
(Skill.Field_Declarations.Field_Declaration (This)))
then
return False;
end if;
end loop;
end if;
end loop;
return True;
end Check;
function Check (This : access Lazy_Field_T) return Boolean is
Iter : aliased Skill.Iterators.Type_Order.Iterator;
RC : Skill.Field_Restrictions.Checkable;
begin
if This.Restrictions.Is_Empty then
return True;
end if;
This.Ensure_Is_Loaded;
for R of This.Restrictions loop
if R.all in Skill.Field_Restrictions.Checkable_T'Class then
RC := Skill.Field_Restrictions.Checkable (R);
Iter.Init (This.Owner.To_Pool);
while Iter.Has_Next loop
if not RC.Check (This.Data.Element (Iter.Next)) then
return False;
end if;
end loop;
end if;
end loop;
return True;
end Check;
function Hash
(This : Field_Declaration) return Ada.Containers.Hash_Type is
(Ada.Containers.Hash_Type
(37 * This.Index + 31337 * This.Owner.Pool_Offset));
function Field_ID
(This : access Field_Declaration_T'Class) return Natural is
(This.Index);
procedure Add_Chunk
(This : access Field_Declaration_T'Class;
C : Skill.Internal.Parts.Chunk)
is
begin
This.Data_Chunks.Append (new Chunk_Entry_T'(C, null));
end Add_Chunk;
function Add_Offset_To_Last_Chunk
(This : access Field_Declaration_T'Class;
Input : Skill.Streams.Reader.Input_Stream;
File_Offset : Types.v64) return Types.v64
is
CE : Chunk_Entry := This.Data_Chunks.Last_Element;
C : Skill.Internal.Parts.Chunk := CE.C;
use type Interfaces.Integer_64;
begin
C.First := C.First + File_Offset;
C.Last := C.Last + File_Offset;
CE.Input := Input.Map (0, C.First, C.Last);
return C.Last;
end Add_Offset_To_Last_Chunk;
function Make_Lazy_Field
(Owner : Owner_T;
ID : Natural;
T : Field_Types.Field_Type;
Name : Skill.Types.String_Access;
Restrictions : Field_Restrictions.Vector) return Lazy_Field
is
begin
return new Lazy_Field_T'
(Data_Chunks => Chunk_List_P.Empty_Vector,
T => T,
Name => Name,
Index => ID,
Owner => Owner,
Future_Offset => 0,
Restrictions => Restrictions,
Data => Data_P.Empty_Map,
Parts => Part_P.Empty_Vector);
end Make_Lazy_Field;
procedure Ensure_Is_Loaded (This : access Lazy_Field_T) is
begin
if not This.Is_Loaded then
This.Load;
end if;
end Ensure_Is_Loaded;
procedure Read (This : access Lazy_Field_T; CE : Chunk_Entry) is
begin
This.Parts.Append (CE);
end Read;
procedure Offset (This : access Lazy_Field_T) is
use type Skill.Types.v64;
use type Skill.Types.Uv64;
Rang : constant Skill.Internal.Parts.Block :=
This.Owner.Blocks.Last_Element;
Data : constant Skill.Types.Annotation_Array := This.Owner.Base.Data;
Result : Skill.Types.v64 := 0;
Low : constant Natural := Natural (Rang.BPO);
High : constant Natural := Natural (Rang.BPO + Rang.Dynamic_Count);
begin
This.Ensure_Is_Loaded;
for I in Low + 1 .. High loop
Result := Result + This.T.Offset_Box (This.Data.Element (Data (I)));
end loop;
This.Future_Offset := Result;
end Offset;
procedure Write
(This : access Lazy_Field_T;
Output : Streams.Writer.Sub_Stream)
is
Rang : constant Skill.Internal.Parts.Block :=
This.Owner.Blocks.Last_Element;
Data : constant Skill.Types.Annotation_Array := This.Owner.Base.Data;
Low : constant Natural := Natural (Rang.BPO);
High : constant Natural := Natural (Rang.BPO + Rang.Dynamic_Count);
begin
for I in Low + 1 .. High loop
This.T.Write_Box (Output, This.Data (Data (I)));
end loop;
end Write;
procedure Free (This : access Lazy_Field_T) is
type T is access all Lazy_Field_T;
procedure Delete is new Ada.Unchecked_Deallocation (Lazy_Field_T, T);
D : T := T (This);
begin
This.Data_Chunks.Foreach (Delete_Chunk'Access);
This.Data_Chunks.Free;
Delete (D);
end Free;
procedure Load (This : access Lazy_Field_T'Class) is
D : Types.Annotation_Array := This.Owner.Base.Data;
B : Internal.Parts.Block;
begin
for Ce of This.Parts loop
if Ce.C.all in Skill.Internal.Parts.Simple_Chunk then
for I in
Skill.Internal.Parts.Simple_Chunk_X (Ce.C).BPO + 1 ..
Skill.Internal.Parts.Simple_Chunk_X (Ce.C).BPO + Ce.C.Count
loop
This.Data.Include (D (I), This.T.Read_Box (Ce.Input.To));
end loop;
else
--case bci : BulkChunk ⇒
for I in
0 .. Skill.Internal.Parts.Bulk_Chunk_X (Ce.C).Block_Count - 1
loop
B := This.Owner.Blocks.Element (I);
for I in B.BPO + 1 .. B.BPO + B.Dynamic_Count loop
This.Data.Include (D (I), This.T.Read_Box (Ce.Input.To));
end loop;
end loop;
end if;
end loop;
This.Parts.Clear;
exception
when E : others =>
raise Skill.Errors.Skill_Error with "failed to parse lazy field";
end Load;
end Skill.Field_Declarations;
|
Cubical/Algebra/RingSolver/ReflectionSolving.agda | ecavallo/cubical | 1 | 12500 | <filename>Cubical/Algebra/RingSolver/ReflectionSolving.agda
{-# OPTIONS --safe #-}
{-
This is inspired by/copied from:
https://github.com/agda/agda-stdlib/blob/master/src/Tactic/MonoidSolver.agda
Boilerplate code for calling the ring solver is constructed automatically
with agda's reflection features.
-}
module Cubical.Algebra.RingSolver.ReflectionSolving where
open import Cubical.Foundations.Prelude hiding (Type)
open import Cubical.Functions.Logic
open import Agda.Builtin.Reflection hiding (Type)
open import Agda.Builtin.String
open import Cubical.Reflection.Base
open import Cubical.Data.Maybe
open import Cubical.Data.Sigma
open import Cubical.Data.List
open import Cubical.Data.Nat.Literals
open import Cubical.Data.Int.Base hiding (abs)
open import Cubical.Data.Int using (fromNegℤ; fromNatℤ)
open import Cubical.Data.Nat using (ℕ) renaming (_+_ to _+ℕ_)
open import Cubical.Data.FinData using () renaming (zero to fzero; suc to fsuc)
open import Cubical.Data.Bool
open import Cubical.Data.Bool.SwitchStatement
open import Cubical.Data.Vec using (Vec) renaming ([] to emptyVec; _∷_ to _∷vec_) public
open import Cubical.Algebra.RingSolver.AlgebraExpression
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.RingSolver.RawAlgebra
open import Cubical.Algebra.RingSolver.IntAsRawRing
open import Cubical.Algebra.RingSolver.CommRingSolver renaming (solve to ringSolve)
private
variable
ℓ : Level
_==_ = primQNameEquality
{-# INLINE _==_ #-}
record VarInfo : Type ℓ-zero where
field
varName : String
varType : Arg Term
index : ℕ
{-
`getLastTwoArgsOf` maps a term 'def n (z₁ ∷ … ∷ zₙ ∷ x ∷ y ∷ [])' to the pair '(x,y)'
non-visible arguments are ignored.
-}
getLastTwoArgsOf : Name → Term → Maybe (Term × Term)
getLastTwoArgsOf n' (def n xs) =
if n == n'
then go xs
else nothing
where
go : List (Arg Term) → Maybe (Term × Term)
go (varg x ∷ varg y ∷ []) = just (x , y)
go (x ∷ xs) = go xs
go _ = nothing
getLastTwoArgsOf n' _ = nothing
{-
`getArgs` maps a term 'x ≡ y' to the pair '(x,y)'
-}
getArgs : Term → Maybe (Term × Term)
getArgs = getLastTwoArgsOf (quote PathP)
firstVisibleArg : List (Arg Term) → Maybe Term
firstVisibleArg [] = nothing
firstVisibleArg (varg x ∷ l) = just x
firstVisibleArg (x ∷ l) = firstVisibleArg l
{-
If the solver needs to be applied during equational reasoning,
the right hand side of the equation to solve cannot be given to
the solver directly. The folllowing function extracts this term y
from a more complex expression as in:
x ≡⟨ solve ... ⟩ (y ≡⟨ ... ⟩ z ∎)
-}
getRhs : Term → Maybe Term
getRhs reasoningToTheRight@(def n xs) =
if n == (quote _∎)
then firstVisibleArg xs
else (if n == (quote _≡⟨_⟩_)
then firstVisibleArg xs
else nothing)
getRhs _ = nothing
private
solverCallAsTerm : Term → Arg Term → Term → Term → Term
solverCallAsTerm R varList lhs rhs =
def
(quote ringSolve)
(varg R ∷ varg lhs ∷ varg rhs
∷ varList
∷ varg (def (quote refl) []) ∷ [])
solverCallWithLambdas : ℕ → List VarInfo → Term → Term → Term → Term
solverCallWithLambdas n varInfos R lhs rhs =
encloseWithIteratedLambda
(map VarInfo.varName varInfos)
(solverCallAsTerm R (variableList (rev varInfos)) lhs rhs)
where
encloseWithIteratedLambda : List String → Term → Term
encloseWithIteratedLambda (varName ∷ xs) t = lam visible (abs varName (encloseWithIteratedLambda xs t))
encloseWithIteratedLambda [] t = t
variableList : List VarInfo → Arg Term
variableList [] = varg (con (quote emptyVec) [])
variableList (varInfo ∷ varInfos)
= varg (con (quote _∷vec_) (varg (var (VarInfo.index varInfo) []) ∷ (variableList varInfos) ∷ []))
solverCallByVarIndices : ℕ → List ℕ → Term → Term → Term → Term
solverCallByVarIndices n varIndices R lhs rhs =
solverCallAsTerm R (variableList (rev varIndices)) lhs rhs
where
variableList : List ℕ → Arg Term
variableList [] = varg (con (quote emptyVec) [])
variableList (varIndex ∷ varIndices)
= varg (con (quote _∷vec_) (varg (var (varIndex) []) ∷ (variableList varIndices) ∷ []))
module pr (R : CommRing ℓ) {n : ℕ} where
private
νR = CommRing→RawℤAlgebra R
open CommRingStr (snd R)
0' : Expr ℤAsRawRing (fst R) n
0' = K 0
1' : Expr ℤAsRawRing (fst R) n
1' = K 1
module _ (cring : Term) where
private
νR = def (quote CommRing→RawℤAlgebra) (varg cring ∷ [])
open pr
`0` : List (Arg Term) → Term
`0` [] = def (quote 0') (varg cring ∷ [])
`0` (varg fstcring ∷ xs) = `0` xs
`0` (harg _ ∷ xs) = `0` xs
`0` _ = unknown
`1` : List (Arg Term) → Term
`1` [] = def (quote 1') (varg cring ∷ [])
`1` (varg fstcring ∷ xs) = `1` xs
`1` (harg _ ∷ xs) = `1` xs
`1` _ = unknown
mutual
`_·_` : List (Arg Term) → Term
`_·_` (harg _ ∷ xs) = `_·_` xs
`_·_` (varg _ ∷ varg x ∷ varg y ∷ []) =
con
(quote _·'_) (varg (buildExpression x) ∷ varg (buildExpression y) ∷ [])
`_·_` _ = unknown
`_+_` : List (Arg Term) → Term
`_+_` (harg _ ∷ xs) = `_+_` xs
`_+_` (varg _ ∷ varg x ∷ varg y ∷ []) =
con
(quote _+'_) (varg (buildExpression x) ∷ varg (buildExpression y) ∷ [])
`_+_` _ = unknown
`-_` : List (Arg Term) → Term
`-_` (harg _ ∷ xs) = `-_` xs
`-_` (varg _ ∷ varg x ∷ []) =
con
(quote -'_) (varg (buildExpression x) ∷ [])
`-_` _ = unknown
K' : List (Arg Term) → Term
K' xs = con (quote K) xs
finiteNumberAsTerm : ℕ → Term
finiteNumberAsTerm ℕ.zero = con (quote fzero) []
finiteNumberAsTerm (ℕ.suc n) = con (quote fsuc) (varg (finiteNumberAsTerm n) ∷ [])
buildExpression : Term → Term
buildExpression (var index _) = con (quote ∣) (varg (finiteNumberAsTerm index) ∷ [])
buildExpression t@(def n xs) =
switch (n ==_) cases
case (quote CommRingStr.0r) ⇒ `0` xs break
case (quote CommRingStr.1r) ⇒ `1` xs break
case (quote CommRingStr._·_) ⇒ `_·_` xs break
case (quote CommRingStr._+_) ⇒ `_+_` xs break
case (quote (CommRingStr.-_)) ⇒ `-_` xs break
default⇒ (K' xs)
buildExpression t@(con n xs) =
switch (n ==_) cases
case (quote CommRingStr.0r) ⇒ `0` xs break
case (quote CommRingStr.1r) ⇒ `1` xs break
case (quote CommRingStr._·_) ⇒ `_·_` xs break
case (quote CommRingStr._+_) ⇒ `_+_` xs break
case (quote (CommRingStr.-_)) ⇒ `-_` xs break
default⇒ (K' xs)
buildExpression t = unknown
toAlgebraExpression : Maybe (Term × Term) → Maybe (Term × Term)
toAlgebraExpression nothing = nothing
toAlgebraExpression (just (lhs , rhs)) = just (buildExpression lhs , buildExpression rhs)
private
adjustDeBruijnIndex : (n : ℕ) → Term → Term
adjustDeBruijnIndex n (var k args) = var (k +ℕ n) args
adjustDeBruijnIndex n _ = unknown
extractVarIndices : Maybe (List Term) → Maybe (List ℕ)
extractVarIndices (just ((var index _) ∷ l)) with extractVarIndices (just l)
... | just indices = just (index ∷ indices)
... | nothing = nothing
extractVarIndices (just []) = just []
extractVarIndices _ = nothing
getVarsAndEquation : Term → Maybe (List VarInfo × Term)
getVarsAndEquation t =
let
(rawVars , equationTerm) = extractVars t
maybeVars = addIndices (length rawVars) rawVars
in map-Maybe (_, equationTerm) maybeVars
where
extractVars : Term → List (String × Arg Term) × Term
extractVars (pi argType (abs varName t)) with extractVars t
... | xs , equation
= (varName , argType) ∷ xs , equation
extractVars equation = [] , equation
addIndices : ℕ → List (String × Arg Term) → Maybe (List VarInfo)
addIndices ℕ.zero [] = just []
addIndices (ℕ.suc countVar) ((varName , argType) ∷ list) =
map-Maybe (λ varList → record { varName = varName ; varType = argType ; index = countVar }
∷ varList)
(addIndices countVar list)
addIndices _ _ = nothing
toListOfTerms : Term → Maybe (List Term)
toListOfTerms (con c []) = if (c == (quote [])) then just [] else nothing
toListOfTerms (con c (varg t ∷ varg s ∷ args)) with toListOfTerms s
... | just terms = if (c == (quote _∷_)) then just (t ∷ terms) else nothing
... | nothing = nothing
toListOfTerms (con c (harg t ∷ args)) = toListOfTerms (con c args)
toListOfTerms _ = nothing
solve-macro : Term → Term → TC Unit
solve-macro cring hole =
do
hole′ ← inferType hole >>= normalise
just (varInfos , equation) ← returnTC (getVarsAndEquation hole′)
where
nothing
→ typeError (strErr "Something went wrong when getting the variable names in "
∷ termErr hole′ ∷ [])
{-
The call to the ring solver will be inside a lamba-expression.
That means, that we have to adjust the deBruijn-indices of the variables in 'cring'
-}
adjustedCring ← returnTC (adjustDeBruijnIndex (length varInfos) cring)
just (lhs , rhs) ← returnTC (toAlgebraExpression adjustedCring (getArgs equation))
where
nothing
→ typeError(
strErr "Error while trying to build ASTs for the equation " ∷
termErr equation ∷ [])
let solution = solverCallWithLambdas (length varInfos) varInfos adjustedCring lhs rhs
unify hole solution
solveInPlace-macro : Term → Term → Term → TC Unit
solveInPlace-macro cring varsToSolve hole =
do
equation ← inferType hole >>= normalise
just varIndices ← returnTC (extractVarIndices (toListOfTerms varsToSolve))
where
nothing
→ typeError(
strErr "Error reading variables to solve " ∷
termErr varsToSolve ∷ [])
just (lhs , rhs) ← returnTC (toAlgebraExpression cring (getArgs equation))
where
nothing
→ typeError(
strErr "Error while trying to build ASTs for the equation " ∷
termErr equation ∷ [])
let solution = solverCallByVarIndices (length varIndices) varIndices cring lhs rhs
unify hole solution
solveEqReasoning-macro : Term → Term → Term → Term → Term → TC Unit
solveEqReasoning-macro lhs cring varsToSolve reasoningToTheRight hole =
do
just varIndices ← returnTC (extractVarIndices (toListOfTerms varsToSolve))
where
nothing
→ typeError(
strErr "Error reading variables to solve " ∷
termErr varsToSolve ∷ [])
just rhs ← returnTC (getRhs reasoningToTheRight)
where
nothing
→ typeError(
strErr "Failed to extract right hand side of equation to solve from " ∷
termErr reasoningToTheRight ∷ [])
just (lhsAST , rhsAST) ← returnTC (toAlgebraExpression cring (just (lhs , rhs)))
where
nothing
→ typeError(
strErr "Error while trying to build ASTs from " ∷
termErr lhs ∷ strErr " and " ∷ termErr rhs ∷ [])
let solverCall = solverCallByVarIndices (length varIndices) varIndices cring lhsAST rhsAST
unify hole (def (quote _≡⟨_⟩_) (varg lhs ∷ varg solverCall ∷ varg reasoningToTheRight ∷ []))
macro
solve : Term → Term → TC _
solve = solve-macro
solveInPlace : Term → Term → Term → TC _
solveInPlace = solveInPlace-macro
infixr 2 _≡⟨solveIn_withVars_⟩_
_≡⟨solveIn_withVars_⟩_ : Term → Term → Term → Term → Term → TC Unit
_≡⟨solveIn_withVars_⟩_ = solveEqReasoning-macro
fromℤ : (R : CommRing ℓ) → ℤ → fst R
fromℤ = scalar
|
gfx/pokemon/nuzleaf/anim_idle.asm | Ebernacher90/pokecrystal-allworld | 0 | 21328 | frame 3, 08
frame 4, 08
frame 3, 08
frame 4, 08
frame 0, 06
frame 4, 06
endanim
|
out/euler46.adb | FardaleM/metalang | 22 | 16975 | <reponame>FardaleM/metalang<filename>out/euler46.adb<gh_stars>10-100
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure euler46 is
type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function eratostene(t : in a_PTR; max0 : in Integer) return Integer is
n : Integer;
j : Integer;
begin
n := 0;
for i in integer range 2..max0 - 1 loop
if t(i) = i
then
n := n + 1;
if max0 / i > i
then
j := i * i;
while j < max0 and then j > 0 loop
t(j) := 0;
j := j + i;
end loop;
end if;
end if;
end loop;
return n;
end;
type b is Array (Integer range <>) of Boolean;
type b_PTR is access b;
primes : a_PTR;
nprimes : Integer;
n : Integer;
maximumprimes : Integer;
m2 : Integer;
l : Integer;
era : a_PTR;
canbe : b_PTR;
begin
maximumprimes := 6000;
era := new a (0..maximumprimes - 1);
for j_0 in integer range 0..maximumprimes - 1 loop
era(j_0) := j_0;
end loop;
nprimes := eratostene(era, maximumprimes);
primes := new a (0..nprimes - 1);
for o in integer range 0..nprimes - 1 loop
primes(o) := 0;
end loop;
l := 0;
for k in integer range 2..maximumprimes - 1 loop
if era(k) = k
then
primes(l) := k;
l := l + 1;
end if;
end loop;
PInt(l);
PString(new char_array'( To_C(" == ")));
PInt(nprimes);
PString(new char_array'( To_C("" & Character'Val(10))));
canbe := new b (0..maximumprimes - 1);
for i_0 in integer range 0..maximumprimes - 1 loop
canbe(i_0) := FALSE;
end loop;
for i in integer range 0..nprimes - 1 loop
for j in integer range 0..maximumprimes - 1 loop
n := primes(i) + 2 * j * j;
if n < maximumprimes
then
canbe(n) := TRUE;
end if;
end loop;
end loop;
for m in integer range 1..maximumprimes loop
m2 := m * 2 + 1;
if m2 < maximumprimes and then not canbe(m2)
then
PInt(m2);
PString(new char_array'( To_C("" & Character'Val(10))));
end if;
end loop;
end;
|
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/frexp_callee.asm | Frodevan/z88dk | 0 | 172650 |
SECTION code_fp_math16
PUBLIC f16_frexp_callee
EXTERN cm16_sccz80_frexp_callee
defc f16_frexp_callee = cm16_sccz80_frexp_callee
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _f16_frexp_callee
EXTERN cm16_sdcc_frexp_callee
defc _f16_frexp_callee = cm16_sdcc_frexp_callee
ENDIF
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca2009c0.ada | best08618/asylo | 7 | 30884 | <reponame>best08618/asylo
-- CA2009C0M.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT A GENERIC PACKAGE SUBUNIT CAN BE SPECIFIED AND
-- INSTANTIATED. IN THIS TEST, THE SUBUNIT BODY IS IN A
-- SEPARATE FILE.
-- APPLICABILITY CRITERIA:
-- THIS TEST MUST RUN AND REPORT "PASSED" FOR ALL ADA 95 IMPLEMENTATIONS.
-- SEPARATE FILES ARE:
-- CA2009C0M THE MAIN PROCEDURE.
-- CA2009C1 A SUBUNIT PACKAGE BODY (PKG1).
-- HISTORY:
-- BHS 08/01/84 CREATED ORIGINAL TEST.
-- BCB 01/05/88 MODIFIED HEADER.
-- EDS 08/04/98 REMOVE CONTROL Z AT END OF FILE.
-- RLB 09/13/99 UPDATED APPLICABILITY CRITERIA FOR ADA 95.
-- RLB 09/15/99 REMOVED JUNK COMMENT.
WITH REPORT;
USE REPORT;
PROCEDURE CA2009C0M IS
INT1 : INTEGER := 1;
SUBTYPE STR15 IS STRING (1..15);
SVAR : STR15 := "ABCDEFGHIJKLMNO";
GENERIC
TYPE ITEM IS PRIVATE;
CON1 : IN ITEM;
VAR1 : IN OUT ITEM;
PACKAGE PKG1 IS
END PKG1;
PACKAGE BODY PKG1 IS SEPARATE;
PACKAGE NI_PKG1 IS NEW PKG1 (INTEGER, IDENT_INT(2), INT1);
PACKAGE NS_PKG1 IS NEW PKG1 (STR15, IDENT_STR("REINSTANTIATION"),
SVAR);
BEGIN
TEST ("CA2009C", "SPECIFICATION AND INSTANTIATION " &
"OF GENERIC PACKAGE SUBUNITS " &
" - SEPARATE FILES USED");
IF INT1 /= 2 THEN
FAILED ("INCORRECT INSTANTIATION - INTEGER");
END IF;
IF SVAR /= "REINSTANTIATION" THEN
FAILED ("INCORRECT INSTANTIATION - STRING");
END IF;
RESULT;
END CA2009C0M;
|
programs/oeis/038/A038733.asm | neoneye/loda | 22 | 17550 | <reponame>neoneye/loda
; A038733: T(n,n-4), array T as in A038730.
; 1,10,57,245,888,2881,8679,24872,68940,186953,499927,1325204,3494249,9184675,24098536,63165197,165471668,433350754,1134715190,2970971916,7778430788,20364616458,53315795326,139583244540
lpb $0
mov $2,$0
sub $0,1
seq $2,38740 ; T(n,n-3), array T as in A038738.
add $1,$2
lpe
add $1,1
mov $0,$1
|
llvm-gcc-4.2-2.9/gcc/ada/s-osinte-dummy.ads | vidkidz/crossbridge | 1 | 9004 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ I N T E R F A C E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, 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. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is the no tasking version
-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
package System.OS_Interface is
pragma Preelaborate;
-------------
-- Signals --
-------------
Max_Interrupt : constant := 2;
type Signal is new Integer range 0 .. Max_Interrupt;
type sigset_t is new Integer;
type Thread_Id is new Integer;
end System.OS_Interface;
|
mobile/mobile_42.asm | genterz/pokecross | 28 | 162320 | <gh_stars>10-100
MobileTradeAnimation_SendGivemonToGTS:
ld a, $80
ld [wcf65], a
ld de, .TradeAnimScript
jp RunMobileTradeAnim_NoFrontpics
.TradeAnimScript:
mobiletradeanim_showgtsgivemon
mobiletradeanim_12
mobiletradeanim_10
mobiletradeanim_sendmon
mobiletradeanim_06
mobiletradeanim_0f
mobiletradeanim_end
MobileTradeAnimation_RetrieveGivemonFromGTS:
ld a, $80
jr asm_108018
MobileTradeAnimation_ReceiveGetmonFromGTS:
ld a, $0
asm_108018:
ld [wcf65], a
ld de, .TradeAnimScript
jp RunMobileTradeAnim_NoFrontpics
.TradeAnimScript:
mobiletradeanim_11
mobiletradeanim_07
mobiletradeanim_receivemon
mobiletradeanim_showgtsgetmon
mobiletradeanim_end
Function108026:
ld a, $0
jr asm_10802c
Function10802a:
ld a, $1
asm_10802c:
ld [wcf65], a
ld de, .TradeAnimScript
jp RunMobileTradeAnim_Frontpics
.TradeAnimScript: ; trade
mobiletradeanim_showgivemon
mobiletradeanim_12
mobiletradeanim_02
mobiletradeanim_sendmon
mobiletradeanim_05
mobiletradeanim_receivemon
mobiletradeanim_showgetmon
mobiletradeanim_end
Function10803d:
ld a, $0
ld [wcf65], a
ld de, .TradeAnimScript
jp RunMobileTradeAnim_NoFrontpics
.TradeAnimScript:
mobiletradeanim_11
mobiletradeanim_07
mobiletradeanim_receivemon
mobiletradeanim_showoddegg
mobiletradeanim_end
Function10804d:
ld a, $0
ld [wcf65], a
ld de, .TradeAnimScript
jp RunMobileTradeAnim_NoFrontpics
.TradeAnimScript:
mobiletradeanim_11
mobiletradeanim_showgtsgetmon
mobiletradeanim_end
RunMobileTradeAnim_Frontpics:
ld hl, wTradeAnimAddress
ld [hl], e
inc hl
ld [hl], d
ldh a, [hMapAnims]
push af
xor a
ldh [hMapAnims], a
ld hl, wVramState
ld a, [hl]
push af
res 0, [hl]
ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
call Function1080b7
.loop
call MobileTradeAnim_JumptableLoop
jr nc, .loop
pop af
ld [wOptions], a
pop af
ld [wVramState], a
pop af
ldh [hMapAnims], a
ret
RunMobileTradeAnim_NoFrontpics:
ld hl, wTradeAnimAddress
ld [hl], e
inc hl
ld [hl], d
ldh a, [hMapAnims]
push af
xor a
ldh [hMapAnims], a
ld hl, wVramState
ld a, [hl]
push af
res 0, [hl]
ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
call Function108157
.loop
call MobileTradeAnim_JumptableLoop
jr nc, .loop
pop af
ld [wOptions], a
pop af
ld [wVramState], a
pop af
ldh [hMapAnims], a
ret
Function1080b7:
xor a
ld [wJumptableIndex], a
call ClearBGPalettes
call ClearSprites
call ClearTileMap
call DisableLCD
call MobileTradeAnim_ClearTiles
call MobileTradeAnim_ClearBGMap
call LoadStandardFont
call LoadFontsBattleExtra
ld a, $1
ldh [rVBK], a
ld hl, LZ_108da7
ld de, vTiles2
call Decompress
ld a, $0
ldh [rVBK], a
ld hl, LZ_108d27
ld de, vTiles0 tile $20
call Decompress
call EnableLCD
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
farcall ClearSpriteAnims
call DelayFrame
ld de, TradeBallGFX
ld hl, vTiles0
lb bc, BANK(TradeBallGFX), 6
call Request2bpp
ld de, TradePoofGFX
ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), 12
call Request2bpp
xor a
ld hl, wSpriteAnimDict
ld [hli], a
ld [hl], $0
ld a, [wPlayerTrademonSpecies]
ld hl, wPlayerTrademonDVs
ld de, vTiles0 tile $30
call MobileTradeAnim_GetFrontpic
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
ld de, vTiles2 tile $31
call MobileTradeAnim_GetFrontpic
ld a, [wPlayerTrademonSpecies]
ld de, wPlayerTrademonSpeciesName
call MobileTradeAnim_InitSpeciesName
ld a, [wOTTrademonSpecies]
ld de, wOTTrademonSpeciesName
call MobileTradeAnim_InitSpeciesName
xor a
call Function108b98
call Function108af4
ret
Function108157:
xor a
ld [wJumptableIndex], a
call ClearBGPalettes
call ClearSprites
call ClearTileMap
call DisableLCD
call MobileTradeAnim_ClearTiles
call MobileTradeAnim_ClearBGMap
call LoadStandardFont
call LoadFontsBattleExtra
call EnableLCD
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
farcall ClearSpriteAnims
xor a
ld hl, wSpriteAnimDict
ld [hli], a
ld [hl], $0
call DelayFrame
ld a, [wPlayerTrademonSpecies]
ld de, wPlayerTrademonSpeciesName
call MobileTradeAnim_InitSpeciesName
ld a, [wOTTrademonSpecies]
ld de, wOTTrademonSpeciesName
call MobileTradeAnim_InitSpeciesName
xor a
call Function108b98
call Function108af4
ret
MobileTradeAnim_ClearTiles:
ld a, $1
ldh [rVBK], a
ld hl, vTiles0
ld bc, 3 * $80 tiles
xor a
call ByteFill
ld a, $0
ldh [rVBK], a
ld hl, vTiles0
ld bc, 3 * $80 tiles
xor a
call ByteFill
ret
MobileTradeAnim_ClearBGMap:
ld a, $1
ldh [rVBK], a
hlbgcoord 0, 0
ld bc, 2 * BG_MAP_HEIGHT * BG_MAP_WIDTH
ld a, $0
call ByteFill
ld a, $0
ldh [rVBK], a
hlbgcoord 0, 0
ld bc, 2 * BG_MAP_HEIGHT * BG_MAP_WIDTH
ld a, $7f
call ByteFill
ret
MobileTradeAnim_GetFrontpic:
push de
push af
predef GetUnownLetter
pop af
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call GetBaseData
pop de
predef GetMonFrontpic
ret
Function108201:
push de
push af
predef GetUnownLetter
pop af
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call GetBaseData
pop de
predef GetAnimatedFrontpic
ret
Function108219:
ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_TRADE
predef AnimateFrontpic
ret
Function108229:
ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_TRADE
predef LoadMonAnimation
ret
MobileTradeAnim_InitSpeciesName:
push de
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, wStringBuffer1
pop de
ld bc, MON_NAME_LENGTH
call CopyBytes
ret
MobileTradeAnim_JumptableLoop:
ld a, [wJumptableIndex]
bit 7, a
jr nz, .StopAnim
call .ExecuteMobileTradeAnimCommand
call DelayFrame
and a
ret
.StopAnim:
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
call LoadStandardFont
call LoadFontsBattleExtra
farcall Stubbed_Function106462
farcall Function106464
scf
ret
.ExecuteMobileTradeAnimCommand:
ld a, [wJumptableIndex]
ld e, a
ld d, 0
ld hl, .Jumptable
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
jp hl
.Jumptable:
dw GetMobileTradeAnimByte ; 00
dw MobileTradeAnim_ShowPlayerMonToBeSent ; 01
dw MobileTradeAnim_02 ; 02
dw MobileTradeAnim_GiveTrademon1 ; 03
dw MobileTradeAnim_GiveTrademon2 ; 04
dw MobileTradeAnim_05 ; 05
dw MobileTradeAnim_06 ; 06
dw MobileTradeAnim_07 ; 07
dw MobileTradeAnim_GetTrademon1 ; 08
dw MobileTradeAnim_GetTrademon2 ; 09
dw MobileTradeAnim_GetTrademon3 ; 0a
dw MobileTradeAnim_ShowOTMonFromTrade ; 0b
dw EndMobileTradeAnim ; 0c
dw MobileTradeAnim_ShowPlayerMonForGTS ; 0d
dw MobileTradeAnim_ShowOTMonFromGTS ; 0e
dw MobileTradeAnim_0f ; 0f
dw MobileTradeAnim_10 ; 10
dw MobileTradeAnim_11 ; 11
dw MobileTradeAnim_FadeToBlack ; 12
dw MobileTradeAnim_GetOddEgg ; 13 get odd egg
MobileTradeAnim_Next:
ld hl, wJumptableIndex
inc [hl]
ret
GetMobileTradeAnimByte:
ld hl, wTradeAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
ld a, [de]
ld [wJumptableIndex], a
inc de
ld [hl], d
dec hl
ld [hl], e
ret
EndMobileTradeAnim:
ld hl, wJumptableIndex
set 7, [hl]
ret
WaitMobileTradeSpriteAnims:
.loop
push bc
farcall PlaySpriteAnimations
pop bc
call DelayFrame
dec c
jr nz, .loop
ret
Function1082db:
.loop
farcall PlaySpriteAnimations
farcall SetUpPokeAnim
farcall HDMATransferTileMapToWRAMBank3
jr nc, .loop
ret
Function1082f0:
.loop
call Function108b78
call DelayFrame
dec c
jr nz, .loop
ret
Function1082fa:
.loop
call Function108b78
push hl
push bc
farcall PlaySpriteAnimations
pop bc
pop hl
call DelayFrame
dec c
jr nz, .loop
ret
MobileTradeAnim_ShowPlayerMonToBeSent:
ld de, MUSIC_EVOLUTION
call PlayMusic2
ld a, $80
ldh [hSCX], a
xor a
ldh [hSCY], a
ld a, $87
ldh [hWX], a
ld a, $50
ldh [hWY], a
call MobileTradeAnim_DisplayMonToBeSent
ld a, [wPlayerTrademonSpecies]
ld [wCurPartySpecies], a
call Function10895e
ld a, [wPlayerTrademonDVs]
ld [wTempMonDVs], a
ld a, [wPlayerTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
call WaitBGMap
.loop
ldh a, [hWX]
cp $7
jr z, .okay
sub $4
ldh [hWX], a
ldh a, [hSCX]
sub $4
ldh [hSCX], a
call DelayFrame
jr .loop
.okay
ld a, $7
ldh [hWX], a
xor a
ldh [hSCX], a
ld a, [wPlayerTrademonSpecies]
call GetCryIndex
jr c, .skip_cry
ld e, c
ld d, b
call PlayCry
.skip_cry
ld c, 80
call DelayFrames
call Function108bec
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_SENT_BALL
call _InitSpriteAnimStruct
ld de, SFX_BALL_POOF
call PlaySFX
hlcoord 0, 0
ld bc, 12 * SCREEN_WIDTH
ld a, " "
call ByteFill
ld c, 80
call WaitMobileTradeSpriteAnims
call GetMobileTradeAnimByte
ret
MobileTradeAnim_ShowOTMonFromTrade:
call ClearBGPalettes
call ClearSprites
call ClearTileMap
call DisableLCD
call MobileTradeAnim_ClearBGMap
ld a, [wOTTrademonSpecies]
ld [wCurPartySpecies], a
ld hl, wOTTrademonDVs
ld de, vTiles2
call Function108201
call EnableLCD
farcall DeinitializeAllSprites
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_BALL
call _InitSpriteAnimStruct
call Function108b45
ld a, $1
call Function108b98
call Function108af4
ld c, 48
call WaitMobileTradeSpriteAnims
ld de, SFX_BALL_POOF
call PlaySFX
call MobileTradeAnim_DisplayReceivedMon
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $50
ldh [hWY], a
ld a, [wOTTrademonSpecies]
ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
call Function108963
ld a, [wOTTrademonSpecies]
call Function108229
call Function1082db
call Function108c16
call GetMobileTradeAnimByte
ret
MobileTradeAnim_ShowPlayerMonForGTS:
ld de, MUSIC_EVOLUTION
call PlayMusic2
ld a, $80
ldh [hSCX], a
xor a
ldh [hSCY], a
ld a, $87
ldh [hWX], a
ld a, $50
ldh [hWY], a
call MobileTradeAnim_DisplayMonToBeSent
ld a, [wPlayerTrademonSpecies]
ld [wCurPartySpecies], a
ld hl, wPlayerTrademonDVs
call Function10898a
call DelayFrame
ld de, TradeBallGFX
ld hl, vTiles0
lb bc, BANK(TradeBallGFX), 6
call Request2bpp
ld de, TradePoofGFX
ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), 12
call Request2bpp
ld a, [wPlayerTrademonDVs]
ld [wTempMonDVs], a
ld a, [wPlayerTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
call WaitBGMap
.loop
ldh a, [hWX]
cp $7
jr z, .done
sub $4
ldh [hWX], a
ldh a, [hSCX]
sub $4
ldh [hSCX], a
call DelayFrame
jr .loop
.done
ld a, $7
ldh [hWX], a
xor a
ldh [hSCX], a
ld a, [wPlayerTrademonSpecies]
call GetCryIndex
jr c, .skip_cry
ld e, c
ld d, b
call PlayCry
.skip_cry
ld c, 80
call DelayFrames
call Function108c2b
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_SENT_BALL
call _InitSpriteAnimStruct
ld de, SFX_BALL_POOF
call PlaySFX
hlcoord 0, 0
ld bc, 12 * SCREEN_WIDTH
ld a, " "
call ByteFill
ld c, 80
call WaitMobileTradeSpriteAnims
call GetMobileTradeAnimByte
ret
MobileTradeAnim_ShowOTMonFromGTS:
call ClearBGPalettes
call ClearSprites
call ClearTileMap
call DisableLCD
call MobileTradeAnim_ClearBGMap
ld a, [wOTTrademonSpecies]
ld [wCurPartySpecies], a
ld hl, wOTTrademonDVs
ld de, vTiles2
call Function108201
call EnableLCD
farcall DeinitializeAllSprites
call DelayFrame
ld de, TradeBallGFX
ld hl, vTiles0
lb bc, BANK(TradeBallGFX), 6
call Request2bpp
ld de, TradePoofGFX
ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), 12
call Request2bpp
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_BALL
call _InitSpriteAnimStruct
call Function108b45
ld a, $1
call Function108b98
call Function108af4
ld c, 48
call WaitMobileTradeSpriteAnims
ld de, SFX_BALL_POOF
call PlaySFX
call MobileTradeAnim_DisplayReceivedMon
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $50
ldh [hWY], a
ld a, [wOTTrademonSpecies]
ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
call Function10898a
ld a, [wOTTrademonSpecies]
call Function108229
call Function1082db
call Function108c40
call GetMobileTradeAnimByte
ret
MobileTradeAnim_GetOddEgg:
call ClearBGPalettes
call ClearSprites
call ClearTileMap
call DisableLCD
call MobileTradeAnim_ClearBGMap
ld a, [wOTTrademonSpecies]
ld [wCurPartySpecies], a
ld hl, wOTTrademonDVs
ld de, vTiles2
call Function108201
call EnableLCD
farcall DeinitializeAllSprites
call DelayFrame
ld de, TradeBallGFX
ld hl, vTiles0
lb bc, BANK(TradeBallGFX), 6
call Request2bpp
ld de, TradePoofGFX
ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), 12
call Request2bpp
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_BALL
call _InitSpriteAnimStruct
call Function108b45
ld a, $1
call Function108b98
call Function108af4
ld c, 48
call WaitMobileTradeSpriteAnims
ld de, SFX_BALL_POOF
call PlaySFX
call Function108a33
xor a
ldh [hSCX], a
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $50
ldh [hWY], a
ld a, [wOTTrademonSpecies]
ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
call Function10898a
ld a, [wOTTrademonSpecies]
call Function108229
call Function1082db
call GetMobileTradeAnimByte
ret
MobileTradeAnim_02:
farcall DeinitializeAllSprites
call ClearBGPalettes
call ClearSprites
call ClearTileMap
xor a
ldh [hBGMapMode], a
call DisableLCD
call MobileTradeAnim_ClearBGMap
call Function108c80
call Function108c6d
call EnableLCD
ld a, $c
ldh [hSCX], a
ld a, $78
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld hl, Palette_109107
ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
pop af
ldh [rSVBK], a
call Function108d07
call Function108af4
call GetMobileTradeAnimByte
ret
MobileTradeAnim_10:
farcall DeinitializeAllSprites
call ClearBGPalettes
call ClearSprites
call ClearTileMap
xor a
ldh [hBGMapMode], a
call DisableLCD
call MobileTradeAnim_ClearBGMap
ld a, $1
ldh [rVBK], a
ld hl, LZ_108da7
ld de, vTiles2
call Decompress
ld a, $0
ldh [rVBK], a
ld hl, LZ_108d27
ld de, vTiles0 tile $20
call Decompress
call Function108c80
call Function108c6d
call EnableLCD
ld a, $c
ldh [hSCX], a
ld a, $78
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld hl, Palette_109107
ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
pop af
ldh [rSVBK], a
call Function108d07
call Function108af4
call GetMobileTradeAnimByte
ret
MobileTradeAnim_11:
call ClearBGPalettes
call ClearSprites
call ClearTileMap
xor a
ldh [hBGMapMode], a
call DisableLCD
ld a, $1
ldh [rVBK], a
ld hl, LZ_108da7
ld de, vTiles2
call Decompress
ld a, $0
ldh [rVBK], a
ld hl, LZ_108d27
ld de, vTiles0 tile $20
call Decompress
call Function108c80
call Function108c6d
call EnableLCD
ld a, $80
ldh [hSCX], a
ld a, $90
ldh [hSCY], a
ld a, $7
ldh [hWX], a
ld a, $90
ldh [hWY], a
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld hl, Palette_109107
ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
pop af
ldh [rSVBK], a
call Function108d07
call Function108af4
call Function108b5a
ld a, $e0
ldh [hSCX], a
ld de, MUSIC_EVOLUTION
call PlayMusic2
call GetMobileTradeAnimByte
ret
MobileTradeAnim_GiveTrademon1:
ld de, SFX_GIVE_TRADEMON
call PlaySFX
ld c, 40
ld hl, wBGPals2 palette 6
call Function1082f0
call Function108af4
.loop
ldh a, [hSCX]
cp $e0
jr z, .loop2
dec a
dec a
ldh [hSCX], a
cp $f8
jr nz, .next
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_CABLE_BULGE
call _InitSpriteAnimStruct
.next
ld c, 1
call WaitMobileTradeSpriteAnims
jr .loop
.loop2
ldh a, [hSCY]
cp $f8
jr z, .done
dec a
dec a
ldh [hSCY], a
cp $40
jr z, .init
cp $30
jr z, .delete
cp $68
jr z, .replace
jr .next2
.init
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_CABLE_BULGE
call _InitSpriteAnimStruct
xor a
call Function108ad4
jr .next2
.delete
call MobileTradeAnim_DeleteSprites
jr .next2
.replace
call MobileTradeAnim_DeleteSprites
ld a, $1
call Function108ad4
.next2
ld c, 1
call WaitMobileTradeSpriteAnims
jr .loop2
.done
call MobileTradeAnim_Next
ret
MobileTradeAnim_GiveTrademon2:
ld c, 40
ld hl, wBGPals2 + 1 palettes
call Function1082f0
call Function108af4
call Function108b5a
depixel 9, 10, 2, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_PING
call _InitSpriteAnimStruct
ld de, SFX_FORESIGHT
call PlaySFX
ld c, 10
call WaitMobileTradeSpriteAnims
xor a
ld [wcf64], a
depixel 9, 10, 2, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_SENT_PULSE
call _InitSpriteAnimStruct
.loop
ldh a, [hSCY]
cp $90
jr z, .done
sub $8
ldh [hSCY], a
ld c, 1
call WaitMobileTradeSpriteAnims
jr .loop
.done
call GetMobileTradeAnimByte
ret
MobileTradeAnim_05:
ld c, 40
call WaitMobileTradeSpriteAnims
ld a, $1
ld [wcf64], a
ld de, SFX_SHARPEN
call PlaySFX
ld c, 60
call WaitMobileTradeSpriteAnims
depixel 30, 10, 2, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_PULSE
call _InitSpriteAnimStruct
call GetMobileTradeAnimByte
ld de, SFX_THROW_BALL
call PlaySFX
ret
MobileTradeAnim_06:
ld c, 40
call WaitMobileTradeSpriteAnims
ld a, $1
ld [wcf64], a
ld de, SFX_SHARPEN
call PlaySFX
call GetMobileTradeAnimByte
ret
MobileTradeAnim_07:
ld c, 80
call DelayFrames
depixel 30, 10, 2, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_PULSE
call _InitSpriteAnimStruct
call GetMobileTradeAnimByte
ld de, SFX_THROW_BALL
call PlaySFX
ret
MobileTradeAnim_GetTrademon1:
ld c, 40
call WaitMobileTradeSpriteAnims
.loop
ldh a, [hSCY]
cp $f8
jr z, .done
add $8
ldh [hSCY], a
ld c, 1
call WaitMobileTradeSpriteAnims
jr .loop
.done
farcall DeinitializeAllSprites
depixel 9, 10, 2, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_PING
call _InitSpriteAnimStruct
ld de, SFX_GLASS_TING_2
call PlaySFX
call Function108af4
call MobileTradeAnim_Next
ret
MobileTradeAnim_GetTrademon2:
ld c, 20
ld hl, wBGPals2 + 1 palettes
call Function1082fa
ld de, SFX_GIVE_TRADEMON
call PlaySFX
ld c, 20
ld hl, wBGPals2 + 1 palettes
call Function1082fa
call Function108af4
.asm_1088ad
ldh a, [hSCY]
cp $78
jr z, .asm_1088ee
inc a
inc a
ldh [hSCY], a
cp $30
jr z, .asm_1088c5
cp $40
jr z, .asm_1088dd
cp $68
jr z, .asm_1088cf
jr .asm_1088e7
.asm_1088c5
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_CABLE_BULGE
call _InitSpriteAnimStruct
jr .asm_1088e7
.asm_1088cf
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_MOBILE_TRADE_CABLE_BULGE
call _InitSpriteAnimStruct
xor a
call Function108ad4
jr .asm_1088e7
.asm_1088dd
call MobileTradeAnim_DeleteSprites
ld a, $1
call Function108ad4
jr .asm_1088e7
.asm_1088e7
ld c, 1
call WaitMobileTradeSpriteAnims
jr .asm_1088ad
.asm_1088ee
ldh a, [hSCX]
cp $c
jr z, .asm_108906
inc a
inc a
ldh [hSCX], a
cp -8
jr nz, .asm_1088e7
call MobileTradeAnim_DeleteSprites
ld c, 1
call WaitMobileTradeSpriteAnims
jr .asm_1088ee
.asm_108906
call MobileTradeAnim_Next
ret
MobileTradeAnim_GetTrademon3:
ld c, 40
ld hl, wBGPals2 palette 6
call Function1082f0
call Function108af4
call GetMobileTradeAnimByte
ret
MobileTradeAnim_0f:
ld c, 40
call WaitMobileTradeSpriteAnims
farcall DeinitializeAllSprites
call ClearBGPalettes
call ClearSprites
call ClearTileMap
call DisableLCD
call MobileTradeAnim_ClearTiles
call MobileTradeAnim_ClearBGMap
call EnableLCD
call GetMobileTradeAnimByte
ret
MobileTradeAnim_FadeToBlack:
.loop
ldh a, [rBGP]
and a
jr z, .blank
sla a
sla a
call DmgToCgbBGPals
call DmgToCgbObjPal0
ld c, 4
call DelayFrames
jr .loop
.blank
xor a
call DmgToCgbBGPals
call DmgToCgbObjPal0
call GetMobileTradeAnimByte
ret
Function10895e:
ld de, vTiles0 tile $30
jr asm_108966
Function108963:
ld de, vTiles2 tile $31
asm_108966:
call DelayFrame
ld hl, vTiles2
lb bc, $a, $31 ; $a is the bank of ?????
call Request2bpp
call WaitTop
call MobileTradeAnim_ClearTilemap
hlcoord 7, 2
xor a
ldh [hGraphicStartTile], a
lb bc, 7, 7
predef PlaceGraphic
call WaitBGMap
ret
Function10898a:
ld de, vTiles2
call MobileTradeAnim_GetFrontpic
call WaitTop
call MobileTradeAnim_ClearTilemap
hlcoord 7, 2
xor a
ldh [hGraphicStartTile], a
lb bc, 7, 7
predef PlaceGraphic
call WaitBGMap
ret
MobileTradeAnim_DisplayMonToBeSent:
ld de, wPlayerTrademonSpecies
ld a, [de]
cp EGG
jr z, MobileTradeAnim_DisplayEggData
call MobileTradeAnim_LoadMonTemplate
ld de, wPlayerTrademonSpecies
call MobileTradeAnim_MonDisplay_PrintSpeciesNumber
ld de, wPlayerTrademonSpeciesName
call MobileTradeAnim_MonDisplay_PrintSpeciesName
ld a, [wPlayerTrademonCaughtData]
ld de, wPlayerTrademonOTName
call MobileTradeAnim_MonDisplay_PrintOTNameAndGender
ld de, wPlayerTrademonID
call MobileTradeAnim_MonDisplay_PrintIDNumber
call MobileTradeAnim_MonDisplay_UpdateBGMap
ret
MobileTradeAnim_DisplayReceivedMon:
ld de, wOTTrademonSpecies
ld a, [de]
cp EGG
jr z, MobileTradeAnim_DisplayEggData
call MobileTradeAnim_LoadMonTemplate
ld de, wOTTrademonSpecies
call MobileTradeAnim_MonDisplay_PrintSpeciesNumber
ld de, wOTTrademonSpeciesName
call MobileTradeAnim_MonDisplay_PrintSpeciesName
ld a, [wOTTrademonCaughtData]
ld de, wOTTrademonOTName
call MobileTradeAnim_MonDisplay_PrintOTNameAndGender
ld de, wOTTrademonID
call MobileTradeAnim_MonDisplay_PrintIDNumber
call MobileTradeAnim_MonDisplay_UpdateBGMap
ret
MobileTradeAnim_DisplayEggData:
call WaitTop
call MobileTradeAnim_ClearTilemap
ld a, HIGH(vBGMap1)
ldh [hBGMapAddress + 1], a
hlcoord 5, 0
ld b, 6
ld c, 9
call Textbox
hlcoord 6, 2
ld de, .EggTemplate
call PlaceString
call MobileTradeAnim_MonDisplay_UpdateBGMap
ret
.EggTemplate:
db "タマゴ"
next "おや/?????"
next "<ID>№<DOT>?????"
db "@"
Function108a33:
call WaitTop
call MobileTradeAnim_ClearTilemap
ld a, HIGH(vBGMap1)
ldh [hBGMapAddress + 1], a
hlcoord 5, 0
ld b, 6
ld c, 9
call Textbox
hlcoord 7, 4
ld de, .OddEgg
call PlaceString
call MobileTradeAnim_MonDisplay_UpdateBGMap
ret
.OddEgg:
db "なぞのタマゴ@"
MobileTradeAnim_LoadMonTemplate:
call WaitTop
call MobileTradeAnim_ClearTilemap
ld a, HIGH(vBGMap1)
ldh [hBGMapAddress + 1], a
hlcoord 4, 0
ld b, 6
ld c, 10
call Textbox
hlcoord 5, 0
ld de, .MonTemplate
call PlaceString
ret
.MonTemplate:
db "─ №<DOT>"
next ""
next "おや/"
next "<ID>№<DOT>"
db "@"
MobileTradeAnim_MonDisplay_UpdateBGMap:
call WaitBGMap
call WaitTop
ld a, HIGH(vBGMap0)
ldh [hBGMapAddress + 1], a
ret
MobileTradeAnim_MonDisplay_PrintSpeciesNumber:
hlcoord 9, 0
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
call PrintNum
ret
MobileTradeAnim_MonDisplay_PrintSpeciesName:
hlcoord 5, 2
call PlaceString
ret
MobileTradeAnim_MonDisplay_PrintOTNameAndGender:
cp $3
jr c, .got_gender
xor a
.got_gender
push af
hlcoord 8, 4
call PlaceString
inc bc
pop af
ld hl, .GenderChars
ld d, 0
ld e, a
add hl, de
ld a, [hl]
ld [bc], a
ret
.GenderChars:
db " "
db "♂"
db "♀"
MobileTradeAnim_MonDisplay_PrintIDNumber:
hlcoord 8, 6
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ret
MobileTradeAnim_ClearTilemap:
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
ret
Function108ad4:
and a
jr z, .asm_108adc
ld de, GFX_1092c7
jr .asm_108adf
.asm_108adc
ld de, GFX_1091c7
.asm_108adf
ld a, $1
ldh [rVBK], a
ld hl, vTiles2 tile $4a
lb bc, BANK(GFX_1092c7), 16
call Get2bpp_2
call DelayFrame
ld a, $0
ldh [rVBK], a
ret
Function108af4:
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld a, [wcf65]
and $1
jr z, .copy_palette_109147
ld hl, Palette_109187
ld de, wOBPals1
ld bc, 8 palettes
call CopyBytes
ld hl, Palette_109187
ld de, wOBPals2
ld bc, 8 palettes
call CopyBytes
jr .done_copy
.copy_palette_109147
ld hl, Palette_109147
ld de, wOBPals1
ld bc, 8 palettes
call CopyBytes
ld hl, Palette_109147
ld de, wOBPals2
ld bc, 8 palettes
call CopyBytes
.done_copy
pop af
ldh [rSVBK], a
ld a, %11100100 ; 3,2,1,0
call DmgToCgbObjPal0
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
call DelayFrame
ret
Function108b45:
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld de, PALRGB_WHITE
ld hl, wBGPals1
ld a, e
ld [hli], a
ld d, a
ld [hli], a
pop af
ldh [rSVBK], a
ret
Function108b5a:
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld de, palred 18 + palgreen 31 + palblue 15
ld hl, wBGPals2 + 4 palettes
ld c, $10
.loop
ld a, e
ld [hli], a
ld a, d
ld [hli], a
dec c
jr nz, .loop
pop af
ldh [rSVBK], a
ld a, $1
ldh [hCGBPalUpdate], a
ret
Function108b78:
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld a, c
and $2
jr z, .Orange
ld de, PALRGB_WHITE
jr .load_pal
.Orange:
ld de, palred 31 + palgreen 15 + palblue 1
.load_pal
ld a, e
ld [hli], a
ld a, d
ld [hld], a
pop af
ldh [rSVBK], a
ld a, $1
ldh [hCGBPalUpdate], a
ret
Palette_108b98:
; removed
Function108b98:
ld d, a
ldh a, [rSVBK]
push af
ld a, $5
ldh [rSVBK], a
ld a, [wcf65]
and $1
xor d
jr z, .asm_108bad
ld hl, Palette_108b98 + 1 palettes
jr .asm_108bb0
.asm_108bad
ld hl, Palette_108b98
.asm_108bb0
ld de, wBGPals1 + 7 palettes
ld bc, 8 palettes
call CopyBytes
pop af
ldh [rSVBK], a
ret
MobileTradeAnim_DeleteSprites:
farcall DeinitializeAllSprites
call ClearSprites
ret
Function108bc7:
ld a, [wcf64]
and a
ret z
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
cp -1 * 8 - 6
jr z, .delete
sub 1 * 8
ld [hl], a
ret
.delete
farcall DeinitializeSprite
ret
Function108be0:
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
cp 9 * 8 + 2
ret z
add 1 * 8
ld [hl], a
ret
Function108bec:
ld a, $90
ldh [hWY], a
ld hl, .PlayerWillTradeMon
call PrintText
ld c, 80
call DelayFrames
ld hl, .ForPartnersMon
call PrintText
ld c, 80
call DelayFrames
ret
.PlayerWillTradeMon:
text_far _TradingText10
text_end
.ForPartnersMon:
text_far _TradingText11
text_end
.UnusedTextPlayersMonTrade:
text_far _TradingText12
text_end
Function108c16:
ld a, $90
ldh [hWY], a
ld hl, .TakeGoodCareOfMon
call PrintText
ld c, 80
call DelayFrames
ret
.TakeGoodCareOfMon:
text_far _TradingText13
text_end
Function108c2b:
ld a, $90
ldh [hWY], a
ld hl, .PlayersMonTrade
call PrintText
ld c, 80
call DelayFrames
ret
.PlayersMonTrade:
text_far _TradingText14
text_end
Function108c40:
ld a, $90
ldh [hWY], a
ld a, [wcf65]
and %10000000
jr z, .Getmon
ld hl, .CameBack
call PrintText
ld c, 80
call DelayFrames
ret
.Getmon:
ld hl, .TakeGoodCareOf
call PrintText
ld c, 80
call DelayFrames
ret
.TakeGoodCareOf:
text_far _TradingText15
text_end
.CameBack:
text_far _TradingText16
text_end
Function108c6d:
ld hl, LZ_108fe7
debgcoord 0, 0
call Decompress
ld hl, LZ_108fe7
debgcoord 0, 0, vBGMap1
call Decompress
ret
Function108c80:
ld a, $1
ldh [rVBK], a
ld hl, LZ_1090a7
debgcoord 0, 0
call Decompress
ld hl, LZ_1090a7
debgcoord 0, 0, vBGMap1
call Decompress
ld a, $0
ldh [rVBK], a
ret
DebugMobileTrade:
; localization error: NAME_LENGTH (11) should be NAME_LENGTH_JAPANESE (6) here
ld hl, .DebugTradeData
ld a, [hli]
ld [wPlayerTrademonSpecies], a
ld de, wPlayerTrademonSenderName
ld c, NAME_LENGTH
.your_name_loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .your_name_loop
ld de, wPlayerTrademonID
ld c, 2
.your_id_loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .your_id_loop
ld de, wPlayerTrademonOTName
ld c, NAME_LENGTH
.your_ot_loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .your_ot_loop
ld a, [hli]
ld [wOTTrademonSpecies], a
ld de, wOTTrademonSenderName
ld c, NAME_LENGTH
.their_name_loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .their_name_loop
ld de, wOTTrademonID
ld c, 2
.their_id_loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .their_id_loop
ld de, wOTTrademonOTName
ld c, NAME_LENGTH
.their_ot_loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .their_ot_loop
ret
.DebugTradeData:
db VENUSAUR
db "ゲーフり@@"
dw $0123
db "かびーん@@"
db CHARIZARD
db "クりーチャ@"
dw $0456
db "マツミヤ@@"
Function108d07:
ld a, [wc74e]
and $7f
cp $8
jr c, .asm_108d12
ld a, $7
.asm_108d12
ld bc, 1 palettes
ld hl, Palette_1093c7
call AddNTimes
ld a, $5
ld de, wBGPals1 + 4 palettes
ld bc, 1 palettes
call FarCopyWRAM
ret
LZ_108d27:
INCBIN "gfx/unknown/108d27.2bpp.lz"
LZ_108da7:
INCBIN "gfx/unknown/108da7.2bpp.lz"
LZ_108fe7:
INCBIN "gfx/unknown/108fe7.tilemap.lz"
LZ_1090a7:
INCBIN "gfx/unknown/1090a7.tilemap.lz"
Palette_1090f7:
; unused
RGB 31, 31, 31
RGB 00, 00, 00
RGB 31, 00, 25
RGB 00, 00, 00
RGB 31, 31, 31
RGB 00, 00, 00
RGB 09, 19, 31
RGB 00, 00, 00
Palette_109107:
RGB 18, 31, 15
RGB 20, 20, 20
RGB 11, 11, 11
RGB 00, 00, 00
RGB 31, 15, 1
RGB 14, 14, 31
RGB 12, 09, 31
RGB 00, 00, 00
RGB 18, 31, 15
RGB 14, 14, 31
RGB 12, 09, 31
RGB 00, 00, 00
RGB 18, 31, 15
RGB 20, 20, 20
RGB 11, 11, 11
RGB 00, 00, 00
RGB 18, 31, 15
RGB 31, 07, 09
RGB 18, 00, 01
RGB 00, 00, 00
RGB 18, 31, 15
RGB 20, 20, 20
RGB 11, 11, 11
RGB 00, 00, 00
RGB 31, 15, 1
RGB 18, 00, 30
RGB 09, 00, 17
RGB 00, 00, 00
RGB 18, 31, 15
RGB 18, 00, 30
RGB 09, 00, 17
RGB 00, 00, 00
Palette_109147:
RGB 31, 31, 31
RGB 31, 31, 12
RGB 31, 13, 12
RGB 00, 00, 00
RGB 31, 31, 31
RGB 31, 23, 15
RGB 31, 18, 07
RGB 31, 15, 00
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 00, 00, 00
RGB 31, 31, 31
RGB 31, 00, 25
RGB 31, 00, 25
RGB 00, 00, 00
RGB 31, 31, 31
RGB 09, 19, 31
RGB 09, 19, 31
RGB 00, 00, 00
RGB 31, 31, 31
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
RGB 31, 31, 31
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
RGB 31, 31, 31
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
Palette_109187:
RGB 31, 31, 31
RGB 31, 31, 12
RGB 31, 13, 12
RGB 00, 00, 00
RGB 31, 31, 31
RGB 31, 23, 15
RGB 31, 18, 07
RGB 31, 15, 00
RGB 31, 31, 31
RGB 20, 20, 20
RGB 11, 11, 11
RGB 00, 00, 00
RGB 31, 31, 31
RGB 09, 19, 31
RGB 09, 19, 31
RGB 00, 00, 00
RGB 31, 31, 31
RGB 31, 00, 25
RGB 31, 00, 25
RGB 00, 00, 00
RGB 31, 31, 31
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
RGB 31, 31, 31
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
RGB 31, 31, 31
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
GFX_1091c7:
INCBIN "gfx/unknown/1091c7.2bpp"
GFX_1092c7:
INCBIN "gfx/unknown/1092c7.2bpp"
Palette_1093c7:
RGB 18, 31, 15
RGB 04, 13, 31
RGB 00, 00, 31
RGB 00, 00, 00
RGB 18, 31, 15
RGB 31, 31, 00
RGB 31, 15, 00
RGB 00, 00, 00
RGB 18, 31, 15
RGB 09, 24, 00
RGB 02, 16, 00
RGB 00, 00, 00
RGB 18, 31, 15
RGB 31, 07, 09
RGB 18, 00, 01
RGB 00, 00, 00
RGB 18, 31, 15
RGB 28, 05, 31
RGB 17, 00, 17
RGB 00, 00, 00
RGB 18, 31, 15
RGB 09, 09, 09
RGB 04, 04, 04
RGB 00, 00, 00
RGB 18, 31, 15
RGB 31, 13, 21
RGB 27, 07, 12
RGB 00, 00, 00
RGB 18, 31, 15
RGB 21, 20, 20
RGB 14, 14, 31
RGB 00, 00, 00
|
levels/all.asm | cppchriscpp/ld40 | 2 | 103743 | .export _lvl_details
.segment "ROM_02"
_lvl_details: ; NOTE: This only exists here, but applies for all banks. DON'T CHANGE THE SIZE w/o considering this
; Start location; tileId, x, y, Number of chunks
.byte 27, 80, 80, 3
.include "levels/processed/lvl1_tiles.asm"
|
Transynther/x86/_processed/AVXALIGN/_st_zr_un_sm_/i9-9900K_12_0xca.log_21829_482.asm | ljhsiun2/medusa | 9 | 174744 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x17ccf, %rsi
lea addresses_normal_ht+0x60a7, %rdi
nop
nop
add $56869, %r10
mov $74, %rcx
rep movsb
nop
nop
nop
add $63981, %rax
lea addresses_normal_ht+0x1a16b, %rbp
nop
nop
nop
nop
sub $39895, %r10
mov (%rbp), %di
cmp $23933, %rsi
lea addresses_D_ht+0x685f, %r10
nop
nop
and %r11, %r11
mov (%r10), %rbp
nop
nop
sub $46583, %rax
lea addresses_A_ht+0x192ff, %rsi
lea addresses_A_ht+0x97bf, %rdi
nop
nop
nop
nop
nop
xor $44457, %r12
mov $24, %rcx
rep movsq
nop
nop
dec %rax
lea addresses_D_ht+0x2ff, %rbp
clflush (%rbp)
cmp %rax, %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm4
movups %xmm4, (%rbp)
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_WC_ht+0x1d3f9, %rsi
lea addresses_A_ht+0x19dff, %rdi
nop
nop
inc %rax
mov $10, %rcx
rep movsw
nop
nop
nop
dec %rbp
lea addresses_A_ht+0x1f8f, %r12
nop
nop
nop
add $11691, %r11
movb $0x61, (%r12)
nop
and $36156, %rbp
lea addresses_D_ht+0x1311f, %rcx
nop
nop
cmp %r12, %r12
mov $0x6162636465666768, %rax
movq %rax, %xmm7
movups %xmm7, (%rcx)
nop
nop
nop
nop
add $13531, %rsi
lea addresses_UC_ht+0xb47f, %rdi
nop
nop
nop
dec %rsi
mov $0x6162636465666768, %r12
movq %r12, %xmm6
vmovups %ymm6, (%rdi)
nop
xor $21816, %r11
lea addresses_WC_ht+0x69ff, %r12
nop
nop
nop
xor $1187, %r10
movl $0x61626364, (%r12)
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WC_ht+0xf13f, %rsi
lea addresses_WC_ht+0x4157, %rdi
dec %rax
mov $56, %rcx
rep movsl
nop
nop
nop
cmp $59985, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbp
push %rbx
push %rdi
push %rsi
// Store
lea addresses_US+0x11bff, %rbx
clflush (%rbx)
sub %rdi, %rdi
movl $0x51525354, (%rbx)
nop
and $32248, %rbp
// Faulty Load
lea addresses_US+0x11bff, %rbx
nop
nop
nop
add $50077, %r10
mov (%rbx), %bp
lea oracles, %rsi
and $0xff, %rbp
shlq $12, %rbp
mov (%rsi,%rbp,1), %rbp
pop %rsi
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': True, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 1}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': True, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}}
{'10': 2, '54': 21826, '00': 1}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
|
ZORTON.reko/ZORTON_2725.asm | 0xLiso/dePIXELator | 0 | 9197 | ;;; Segment 2725 (2725:0000)
2725:0000 83 C4 04 5D CB ...].
268D:0985 C8 02 00 00 A0 C4 94 98 0B C0 75 ..........u
268D:0990 2E C7 46 FE 00 00 EB 21 8B 5E FE 80 BF AC AA 00 ..F....!.^......
268D:09A0 74 14 66 6A 00 6A D2 9A BA 00 31 23 83 C4 06 C6 t.fj.j....1#....
268D:09B0 06 C4 94 01 EB 09 FF 46 FE 83 7E FE 06 7C D9 C9 .......F..~..|..
268D:09C0 CB C8 02 00 00 B8 BA 28 8E C0 66 26 83 3E 7E A1 .......(..f&.>~.
268D:09D0 00 74 3B B8 BA 28 8E C0 26 C4 1E 30 30 26 8B 47 .t;..(..&..00&.G
268D:09E0 18 89 46 FE 8B 5E FE 80 BF AC AA 05 7D 20 FE 87 ..F..^......} ..
268D:09F0 AC AA 66 6A 00 8A 46 FE 04 C8 50 9A BA 00 31 23 ..fj..F...P...1#
268D:0A00 83 C4 06 B8 BA 28 8E C0 66 26 FF 0E 7E A1 C9 CB .....(..f&..~...
268D:0A10 C8 02 00 00 C6 46 FF 00 EB 1A 9A 3F 08 00 08 BB .....F.....?....
268D:0A20 06 00 99 F7 FB FE C2 8A 46 FF 98 8B D8 88 97 B2 ........F.......
268D:0A30 AA FE 46 FF 80 7E FF 05 7C E0 C9 CB C8 04 00 00 ..F..~..|.......
268D:0A40 FA 9A E8 01 25 24 FB C7 46 FC 00 00 E9 CD 00 B8 ....%$..F.......
268D:0A50 BA 28 8E C0 26 C7 06 84 A1 14 00 B8 BA 28 8E C0 .(..&........(..
268D:0A60 66 26 FF 36 80 AA 66 FF 36 94 AA 66 68 79 00 39 f&.6..f.6..fhy.9
268D:0A70 00 9A 00 00 6E 21 83 C4 0C B8 BA 28 8E C0 26 83 ....n!.....(..&.
268D:0A80 3E 84 A1 0F 7F F3 B8 BA 28 8E C0 66 26 FF 36 80 >.......(..f&.6.
268D:0A90 AA A1 94 AA 05 C7 00 FF 36 96 AA 50 66 68 79 00 ........6..Pfhy.
268D:0AA0 39 00 9A 00 00 6E 21 83 C4 0C B8 BA 28 8E C0 26 9....n!.....(..&
268D:0AB0 83 3E 84 A1 0A 7F F3 B8 BA 28 8E C0 66 26 FF 36 .>.......(..f&.6
268D:0AC0 80 AA A1 94 AA 05 8E 01 FF 36 96 AA 50 66 68 79 .........6..Pfhy
268D:0AD0 00 39 00 9A 00 00 6E 21 83 C4 0C B8 BA 28 8E C0 .9....n!.....(..
268D:0AE0 26 83 3E 84 A1 05 7F F3 B8 BA 28 8E C0 66 26 FF &.>.......(..f&.
268D:0AF0 36 80 AA A1 94 AA 05 C7 00 FF 36 96 AA 50 66 68 6.........6..Pfh
268D:0B00 79 00 39 00 9A 00 00 6E 21 83 C4 0C B8 BA 28 8E y.9....n!.....(.
268D:0B10 C0 26 83 3E 84 A1 00 7F F3 FF 46 FC 83 7E FC 03 .&.>......F..~..
268D:0B20 7D 03 E9 2A FF A0 B2 AA 98 48 A3 88 94 C7 06 8A }..*.....H......
268D:0B30 94 14 00 A0 B3 AA 98 48 A3 96 94 C7 06 98 94 23 .......H.......#
268D:0B40 00 A0 B4 AA 98 48 A3 A4 94 C7 06 A6 94 19 00 A0 .....H..........
268D:0B50 B5 AA 98 48 A3 B2 94 C7 06 B4 94 1E 00 A0 B6 AA ...H............
268D:0B60 98 48 A3 C0 94 C7 06 C2 94 28 00 B8 BA 28 8E C0 .H.......(...(..
268D:0B70 26 80 3E 83 A1 00 74 0E 6A 00 1E 68 ED 95 9A D2 &.>...t.j..h....
268D:0B80 08 9F 20 83 C4 06 C7 46 FE 00 00 1E 68 7E 94 90 .. ....F....h~..
268D:0B90 0E E8 1E 03 83 C4 04 09 46 FE 1E 68 8C 94 90 0E ........F..h....
268D:0BA0 E8 0F 03 83 C4 04 09 46 FE 1E 68 9A 94 90 0E E8 .......F..h.....
268D:0BB0 00 03 83 C4 04 09 46 FE 1E 68 A8 94 90 0E E8 F1 ......F..h......
268D:0BC0 02 83 C4 04 09 46 FE 1E 68 B6 94 90 0E E8 E2 02 .....F..h.......
268D:0BD0 83 C4 04 09 46 FE 66 FF 36 84 AA 9A 9D 06 44 17 ....F.f.6.....D.
268D:0BE0 83 C4 04 66 FF 36 84 AA 9A 4D 04 44 17 83 C4 04 ...f.6...M.D....
268D:0BF0 BA DA 03 EC B4 00 A9 08 00 75 F5 B8 BA 28 8E C0 .........u...(..
268D:0C00 66 26 FF 36 82 A8 9A 39 04 CC 16 83 C4 04 83 7E f&.6...9.......~
268D:0C10 FE 00 74 03 E9 6F FF FA 9A 86 02 25 24 FB C9 CB ..t..o.....%$...
268D:0C20 C8 04 00 00 8B 46 06 6B C0 13 05 2C 00 89 46 FE .....F.k...,..F.
268D:0C30 8B 5E 06 8A 87 AC AA 98 D1 E0 BA 8A 00 2B D0 89 .^...........+..
268D:0C40 56 FC FA 9A E8 01 25 24 FB B8 BA 28 8E C0 66 26 V.....%$...(..f&
268D:0C50 FF 36 82 A8 66 FF 36 88 AA FF 76 FC FF 76 FE 9A .6..f.6...v..v..
268D:0C60 DC 01 6E 21 83 C4 0C B8 BA 28 8E C0 66 26 FF 36 ..n!.....(..f&.6
268D:0C70 82 A8 9A 39 04 CC 16 83 C4 04 FA 9A 86 02 25 24 ...9..........%$
268D:0C80 FB 9A 7F 05 6D 22 C9 CB C8 02 00 00 C6 46 FF 00 ....m".......F..
268D:0C90 EB 0E 8A 46 FF 98 8B D8 C6 87 AC AA 00 FE 46 FF ...F..........F.
268D:0CA0 80 7E FF 06 7C EC C9 CB C8 04 00 00 C6 46 FD 01 .~..|........F..
268D:0CB0 C6 46 FF 00 E9 86 00 8A 46 FF 98 8B D8 80 BF AC .F......F.......
268D:0CC0 AA 00 74 76 C6 46 FE 00 EB 6A 8A 46 FE 98 8B D8 ..tv.F...j.F....
268D:0CD0 8A 87 B2 AA 98 50 8A 46 FF 98 40 5A 3B D0 75 51 .....P.F..@Z;.uQ
268D:0CE0 8A 46 FF 98 8B D8 8A 87 AC AA 98 66 0F BF C0 BA .F.........f....
268D:0CF0 BA 28 8E C2 66 26 01 06 7E A1 C6 46 FD 00 B8 BA .(..f&..~..F....
268D:0D00 28 8E C0 26 80 3E 83 A1 00 74 26 6A 01 8A 46 FF (..&.>...t&j..F.
268D:0D10 98 C1 E0 02 8B D8 66 FF B7 C5 94 9A D2 08 9F 20 ......f........
268D:0D20 83 C4 06 6A 01 1E 68 F6 95 9A D2 08 9F 20 83 C4 ...j..h...... ..
268D:0D30 06 FE 46 FE 80 7E FE 05 7C 90 FE 46 FF 80 7E FF ..F..~..|..F..~.
268D:0D40 06 7D 03 E9 71 FF 80 7E FD 01 75 1B B8 BA 28 8E .}..q..~..u...(.
268D:0D50 C0 26 80 3E 83 A1 00 74 0E 6A 01 1E 68 00 96 9A .&.>...t.j..h...
268D:0D60 D2 08 9F 20 83 C4 06 9A 7F 05 6D 22 C9 CB C8 04 ... ......m"....
268D:0D70 00 00 66 8B 46 06 66 3B 06 98 AA 75 0A 8C 5E FE ..f.F.f;...u..^.
268D:0D80 C7 46 FC 7E 94 EB 47 66 8B 46 06 66 3B 06 9C AA .F.~..Gf.F.f;...
268D:0D90 75 0A 8C 5E FE C7 46 FC 8C 94 EB 32 66 8B 46 06 u..^..F....2f.F.
268D:0DA0 66 3B 06 A0 AA 75 0A 8C 5E FE C7 46 FC 9A 94 EB f;...u..^..F....
268D:0DB0 1D 66 8B 46 06 66 3B 06 A4 AA 75 0A 8C 5E FE C7 .f.F.f;...u..^..
268D:0DC0 46 FC A8 94 EB 08 8C 5E FE C7 46 FC B6 94 C4 5E F......^..F....^
268D:0DD0 FC 26 83 7F 0C 00 75 73 26 8B 47 08 26 3B 47 0A .&....us&.G.&;G.
268D:0DE0 75 69 83 7E 0A 01 75 16 C4 5E 06 26 FF 47 06 26 ui.~..u..^.&.G.&
268D:0DF0 83 7F 06 7A 7E 55 26 C7 47 06 7A 00 EB 4D 83 7E ...z~U&.G.z..M.~
268D:0E00 0A 04 75 16 C4 5E 06 26 FF 4F 06 26 83 7F 06 0A ..u..^.&.O.&....
268D:0E10 7D 39 26 C7 47 06 0A 00 EB 31 83 7E 0A 02 75 17 }9&.G....1.~..u.
268D:0E20 C4 5E 06 26 FF 47 04 26 81 7F 04 D2 00 7E 1C 26 .^.&.G.&.....~.&
268D:0E30 C7 47 04 D2 00 EB 14 C4 5E 06 26 FF 4F 04 26 83 .G......^.&.O.&.
268D:0E40 7F 04 0A 7D 06 26 C7 47 04 0A 00 F7 46 0A 01 00 ...}.&.G....F...
268D:0E50 74 16 C4 5E FC 26 FF 77 02 9A 25 10 94 10 59 C4 t..^.&.w..%...Y.
268D:0E60 5E FC 26 89 47 02 EB 48 F7 46 0A 04 00 74 18 C4 ^.&.G..H.F...t..
268D:0E70 5E FC 26 FF 77 02 9A 25 10 94 10 59 F7 D8 C4 5E ^.&.w..%...Y...^
268D:0E80 FC 26 89 47 02 EB 29 F7 46 0A 02 00 74 0E C4 5E .&.G..).F...t..^
268D:0E90 FC 26 FF 37 9A 25 10 94 10 59 EB 0E C4 5E FC 26 .&.7.%...Y...^.&
268D:0EA0 FF 37 9A 25 10 94 10 59 F7 D8 C4 5E FC 26 89 07 .7.%...Y...^.&..
268D:0EB0 C9 CB 55 8B EC 56 C4 5E 06 26 83 7F 0C 00 75 0D ..U..V.^.&....u.
268D:0EC0 26 8B 47 08 26 3B 47 0A 75 03 E9 CE 00 C4 5E 06 &.G.&;G.u.....^.
268D:0ED0 26 C4 5F 04 06 C4 76 06 26 8B 04 07 26 01 47 04 &._...v.&...&.G.
268D:0EE0 C4 5E 06 26 C4 5F 04 26 81 7F 04 D2 00 7E 08 26 .^.&._.&.....~.&
268D:0EF0 C7 47 04 D2 00 EB 14 C4 5E 06 26 C4 5F 04 26 83 .G......^.&._.&.
268D:0F00 7F 04 0A 7D 11 26 C7 47 04 0A 00 C4 5E 06 26 8B ...}.&.G....^.&.
268D:0F10 07 F7 D8 26 89 07 C4 5E 06 26 8B 47 02 26 C4 5F ...&...^.&.G.&._
268D:0F20 04 26 01 47 06 26 83 7F 06 7A 7E 08 26 C7 47 06 .&.G.&...z~.&.G.
268D:0F30 7A 00 EB 14 C4 5E 06 26 C4 5F 04 26 83 7F 06 0A z....^.&._.&....
268D:0F40 7D 13 26 C7 47 06 0A 00 C4 5E 06 26 8B 47 02 F7 }.&.G....^.&.G..
268D:0F50 D8 26 89 47 02 C4 5E 06 26 FF 47 08 26 83 7F 08 .&.G..^.&.G.&...
268D:0F60 07 7E 06 26 C7 47 08 00 00 C4 5E 06 26 8B 47 08 .~.&.G....^.&.G.
268D:0F70 69 C0 14 03 8B 16 8E AA 8B 1E 8C AA 03 D8 8B 76 i..............v
268D:0F80 06 26 C4 74 04 26 89 54 10 26 89 5C 0E C4 5E 06 .&.t.&.T.&.\..^.
268D:0F90 26 83 7F 0C 00 74 04 26 FF 4F 0C C4 5E 06 26 83 &....t.&.O..^.&.
268D:0FA0 7F 0C 00 75 0E 26 8B 47 08 26 3B 47 0A 75 04 33 ...u.&.G.&;G.u.3
268D:0FB0 C0 EB 03 B8 01 00 5E 5D CB C8 04 01 00 B8 BA 28 ......^].......(
268D:0FC0 8E C0 66 26 83 3E 7E A1 00 75 4C 6A 00 1E 68 0C ..f&.>~..uLj..h.
268D:0FD0 96 9A D2 08 9F 20 83 C4 06 1E 68 15 96 16 8D 86 ..... ....h.....
268D:0FE0 FC FE 50 9A E6 3D 00 08 83 C4 08 66 68 04 00 03 ..P..=.....fh...
268D:0FF0 00 6A 04 16 8D 86 FC FE 50 66 68 30 01 6D 00 9A .j......Pfh0.m..
268D:1000 4D 09 04 25 83 C4 0E B8 BA 28 8E C0 26 80 3E 22 M..%.....(..&.>"
268D:1010 A4 01 74 F3 E9 D0 06 B8 BA 28 8E C0 66 26 FF 36 ..t......(..f&.6
268D:1020 82 A8 9A 0A 00 44 17 83 C4 04 89 16 86 AA A3 84 .....D..........
268D:1030 AA 66 68 1C 00 1C 00 66 68 01 00 24 00 66 68 14 .fh....fh..$.fh.
268D:1040 00 1E 00 66 68 48 00 0F 00 9A 72 09 44 17 83 C4 ...fhH....r.D...
268D:1050 10 89 16 9A AA A3 98 AA 66 A1 98 AA 66 A3 82 94 ........f...f...
268D:1060 66 68 1C 00 1C 00 66 68 02 00 24 00 66 68 14 00 fh....fh..$.fh..
268D:1070 1D 00 66 68 61 00 19 00 9A 72 09 44 17 83 C4 10 ..fha....r.D....
268D:1080 89 16 9E AA A3 9C AA 66 A1 9C AA 66 A3 90 94 66 .......f...f...f
268D:1090 68 1C 00 1C 00 66 68 04 00 24 00 66 68 14 00 1B h....fh..$.fh...
268D:10A0 00 66 68 55 00 14 00 9A 72 09 44 17 83 C4 10 89 .fhU....r.D.....
268D:10B0 16 A2 AA A3 A0 AA 66 A1 A0 AA 66 A3 9E 94 66 68 ......f...f...fh
268D:10C0 1C 00 1C 00 66 68 08 00 24 00 66 68 14 00 17 00 ....fh..$.fh....
268D:10D0 66 68 72 00 23 00 9A 72 09 44 17 83 C4 10 89 16 fhr.#..r.D......
268D:10E0 A6 AA A3 A4 AA 66 A1 A4 AA 66 A3 AC 94 66 68 1C .....f...f...fh.
268D:10F0 00 1C 00 66 68 10 00 24 00 66 68 14 00 0F 00 66 ...fh..$.fh....f
268D:1100 68 64 00 32 00 9A 72 09 44 17 83 C4 10 89 16 AA hd.2..r.D.......
268D:1110 AA A3 A8 AA 66 A1 A8 AA 66 A3 BA 94 66 C7 46 F0 ....f...f...f.F.
268D:1120 10 27 00 00 8D 46 CA 16 50 1E 68 DD 94 B9 20 00 .'...F..P.h... .
268D:1130 9A F4 03 00 08 8D 46 CA 8C 16 1B 95 A3 19 95 8D ......F.........
268D:1140 46 AA 16 50 1E 68 FD 94 B9 20 00 9A F4 03 00 08 F..P.h... ......
268D:1150 8D 46 AA 8C 16 3B 95 A3 39 95 8D 46 8A 16 50 1E .F...;..9..F..P.
268D:1160 68 1D 95 B9 20 00 9A F4 03 00 08 8D 46 8A 8C 16 h... .......F...
268D:1170 5B 95 A3 59 95 8D 86 6A FF 16 50 1E 68 3D 95 B9 [..Y...j..P.h=..
268D:1180 20 00 9A F4 03 00 08 8D 86 6A FF 8C 16 7B 95 A3 ........j...{..
268D:1190 79 95 8D 86 4A FF 16 50 1E 68 5D 95 B9 20 00 9A y...J..P.h].. ..
268D:11A0 F4 03 00 08 8D 86 4A FF 8C 16 9B 95 A3 99 95 8D ......J.........
268D:11B0 86 2A FF 16 50 1E 68 7D 95 B9 20 00 9A F4 03 00 .*..P.h}.. .....
268D:11C0 08 8D 86 2A FF 8C 16 BB 95 A3 B9 95 8D 86 0A FF ...*............
268D:11D0 16 50 1E 68 9D 95 B9 20 00 9A F4 03 00 08 FA 9A .P.h... ........
268D:11E0 E8 01 25 24 FB B8 BA 28 8E C0 66 26 C7 06 2C 30 ..%$...(..f&..,0
268D:11F0 00 00 00 00 16 8D 46 F0 50 1E 68 2A 96 1E 68 94 ......F.P.h*..h.
268D:1200 AA 1E 68 1F 96 9A 3E 03 3F 26 83 C4 10 16 8D 46 ..h...>.?&.....F
268D:1210 F0 50 1E 68 42 96 1E 68 8C AA 1E 68 39 96 9A 3E .P.hB..h...h9..>
268D:1220 03 3F 26 83 C4 10 16 8D 46 F0 50 1E 68 5C 96 16 .?&.....F.P.h\..
268D:1230 8D 46 FC 50 1E 68 4F 96 9A 3E 03 3F 26 83 C4 10 .F.P.hO..>.?&...
268D:1240 16 8D 46 F0 50 1E 68 71 96 16 8D 46 F8 50 1E 68 ..F.P.hq...F.P.h
268D:1250 65 96 9A 3E 03 3F 26 83 C4 10 16 8D 46 F0 50 1E e..>.?&.....F.P.
268D:1260 68 86 96 16 8D 46 F4 50 1E 68 7A 96 9A 3E 03 3F h....F.P.hz..>.?
268D:1270 26 83 C4 10 16 8D 46 F0 50 1E 68 9E 96 1E 68 88 &.....F.P.h...h.
268D:1280 AA 1E 68 93 96 9A 3E 03 3F 26 83 C4 10 66 FF 36 ..h...>.?&...f.6
268D:1290 84 AA 66 FF 36 98 AA 9A 5B 00 44 17 83 C4 08 66 ..f.6...[.D....f
268D:12A0 FF 36 84 AA 66 FF 36 9C AA 9A 5B 00 44 17 83 C4 .6..f.6...[.D...
268D:12B0 08 66 FF 36 84 AA 66 FF 36 A0 AA 9A 5B 00 44 17 .f.6..f.6...[.D.
268D:12C0 83 C4 08 66 FF 36 84 AA 66 FF 36 A4 AA 9A 5B 00 ...f.6..f.6...[.
268D:12D0 44 17 83 C4 08 66 FF 36 84 AA 66 FF 36 A8 AA 9A D....f.6..f.6...
268D:12E0 5B 00 44 17 83 C4 08 66 68 5E 01 00 00 9A 38 1D [.D....fh^....8.
268D:12F0 00 08 83 C4 04 89 16 92 AA A3 90 AA 66 83 3E 90 ............f.>.
268D:1300 AA 00 75 0C 1E 68 A6 96 9A B6 04 3F 26 83 C4 04 ..u..h.....?&...
268D:1310 C4 1E 98 AA 66 A1 8C AA 66 26 89 47 0E 66 A1 90 ....f...f&.G.f..
268D:1320 AA 66 26 89 47 16 C4 1E 9C AA 66 A1 8C AA 66 26 .f&.G.....f...f&
268D:1330 89 47 0E 66 A1 90 AA 66 26 89 47 16 C4 1E A0 AA .G.f...f&.G.....
268D:1340 66 A1 8C AA 66 26 89 47 0E 66 A1 90 AA 66 26 89 f...f&.G.f...f&.
268D:1350 47 16 C4 1E A4 AA 66 A1 8C AA 66 26 89 47 0E 66 G.....f...f&.G.f
268D:1360 A1 90 AA 66 26 89 47 16 C4 1E A8 AA 66 A1 8C AA ...f&.G.....f...
268D:1370 66 26 89 47 0E 66 A1 90 AA 66 26 89 47 16 66 FF f&.G.f...f&.G.f.
268D:1380 36 90 AA C4 1E 98 AA 66 26 FF 77 0E 9A 5A 05 CC 6......f&.w..Z..
268D:1390 16 83 C4 08 66 FF 36 84 AA 68 25 27 68 EE 03 6A ....f.6..h%'h..j
268D:13A0 00 9A 0E 05 44 17 83 C4 0A 66 FF 36 84 AA 68 25 ....D....f.6..h%
268D:13B0 27 68 EE 03 6A 01 9A 0E 05 44 17 83 C4 0A 66 FF 'h..j....D....f.
268D:13C0 36 84 AA 68 25 27 68 EE 03 6A 02 9A 0E 05 44 17 6..h%'h..j....D.
268D:13D0 83 C4 0A 66 FF 36 84 AA 68 25 27 68 EE 03 6A 03 ...f.6..h%'h..j.
268D:13E0 9A 0E 05 44 17 83 C4 0A 66 FF 36 84 AA 68 25 27 ...D....f.6..h%'
268D:13F0 68 EE 03 6A 04 9A 0E 05 44 17 83 C4 0A 8B 46 F4 h..j....D.....F.
268D:1400 05 02 00 FF 76 F6 50 C4 5E F4 26 8A 47 01 B4 00 ....v.P.^.&.G...
268D:1410 50 26 8A 07 B4 00 50 9A 3B 04 76 24 83 C4 08 66 P&....P.;.v$...f
268D:1420 6A 00 6A 00 16 8D 86 0A FF 50 6A 01 6A 01 6A 01 j.j......Pj.j.j.
268D:1430 6A 00 6A 01 9A 04 00 53 23 83 C4 14 66 68 00 80 j.j....S#...fh..
268D:1440 00 00 9A 38 1D 00 08 83 C4 04 BB BA 28 8E C3 26 ...8........(..&
268D:1450 89 16 88 A8 26 A3 86 A8 0B C2 75 12 66 68 00 80 ....&.....u.fh..
268D:1460 00 00 1E 68 C2 96 9A 3F 04 3F 26 83 C4 08 66 68 ...h...?.?&...fh
268D:1470 00 00 00 7D B8 BA 28 8E C0 66 26 FF 36 86 A8 9A ...}..(..f&.6...
268D:1480 15 47 00 08 83 C4 08 68 BA 28 68 EA 26 9A AE 02 .G.....h.(h.&...
268D:1490 10 1D 83 C4 04 FA 9A E8 01 25 24 68 00 FA B8 BA .........%$h....
268D:14A0 28 8E C0 66 26 FF 36 82 A8 B8 BA 28 8E C0 66 26 (..f&.6....(..f&
268D:14B0 FF 36 80 AA 9A 75 35 00 08 83 C4 0A 9A 86 02 25 .6...u5........%
268D:14C0 24 FB E9 31 01 FA 9A E8 01 25 24 FB B8 BA 28 8E $..1.....%$...(.
268D:14D0 C0 66 26 FF 36 82 A8 66 FF 76 FC 66 68 25 00 6B .f&.6..f.v.fh%.k
268D:14E0 00 9A 00 00 6E 21 83 C4 0C B8 BA 28 8E C0 66 26 ....n!.....(..f&
268D:14F0 FF 36 82 A8 66 FF 76 F8 66 68 0A 00 69 00 9A 00 .6..f.v.fh..i...
268D:1500 00 6E 21 83 C4 0C B8 BA 28 8E C0 66 26 FF 36 82 .n!.....(..f&.6.
268D:1510 A8 9A 39 04 CC 16 83 C4 04 FA 9A 86 02 25 24 FB ..9..........%$.
268D:1520 0E E8 64 F7 0E E8 E8 F4 9A 67 01 31 23 89 56 EE ..d......g.1#.V.
268D:1530 89 46 EC 66 83 7E EC 00 74 EA C4 5E EC 26 8A 07 .F.f.~..t..^.&..
268D:1540 B4 00 3D 03 00 74 19 3D 05 00 74 07 3D D2 00 74 ..=..t.=..t.=..t
268D:1550 5F EB 3D 66 6A 00 6A 05 9A BA 00 31 23 83 C4 06 _.=fj.j....1#...
268D:1560 C6 46 EB 00 EB 1D 8A 46 EB 98 8B D8 8A 87 AC AA .F.....F........
268D:1570 98 66 0F BF C0 BA BA 28 8E C2 66 26 01 06 7E A1 .f.....(..f&..~.
268D:1580 FE 46 EB 80 7E EB 06 7C DD 9A 7F 05 6D 22 EB 77 .F..~..|....m".w
268D:1590 C4 5E EC 26 80 3F C7 76 8B 26 80 3F CE 73 85 26 .^.&.?.v.&.?.s.&
268D:15A0 8A 07 B4 00 05 38 FF 50 0E E8 74 F6 59 E9 74 FF .....8.P..t.Y.t.
268D:15B0 0E E8 88 F4 0E E8 F0 F6 B8 BA 28 8E C0 26 C7 06 ..........(..&..
268D:15C0 84 A1 1E 00 B8 BA 28 8E C0 26 83 3E 84 A1 00 7F ......(..&.>....
268D:15D0 F3 66 FF 36 84 AA 9A B2 02 CC 16 83 C4 04 B8 BA .f.6............
268D:15E0 28 8E C0 66 26 FF 36 82 A8 9A 39 04 CC 16 83 C4 (..f&.6...9.....
268D:15F0 04 C6 06 C4 94 00 B8 BA 28 8E C0 66 26 83 3E 7E ........(..f&.>~
268D:1600 A1 00 74 03 E9 BE FE FA 9A E8 01 25 24 B8 BA 28 ..t........%$..(
268D:1610 8E C0 66 26 C7 06 2C 30 00 00 00 00 FB 66 FF 36 ..f&..,0.....f.6
268D:1620 88 AA 9A 24 1C 00 08 83 C4 04 66 FF 76 F4 9A 24 ...$......f.v..$
268D:1630 1C 00 08 83 C4 04 66 FF 76 FC 9A 24 1C 00 08 83 ......f.v..$....
268D:1640 C4 04 66 FF 36 94 AA 9A 24 1C 00 08 83 C4 04 66 ..f.6...$......f
268D:1650 FF 36 8C AA 9A 24 1C 00 08 83 C4 04 66 FF 76 F8 .6...$......f.v.
268D:1660 9A 24 1C 00 08 83 C4 04 C4 1E 84 AA 66 26 FF 77 .$..........f&.w
268D:1670 08 9A 24 1C 00 08 83 C4 04 66 FF 36 84 AA 9A 24 ..$......f.6...$
268D:1680 1C 00 08 83 C4 04 66 FF 36 90 AA 9A 24 1C 00 08 ......f.6...$...
268D:1690 83 C4 04 66 FF 36 98 AA 9A 6F 0A 44 17 83 C4 04 ...f.6...o.D....
268D:16A0 66 FF 36 9C AA 9A 6F 0A 44 17 83 C4 04 66 FF 36 f.6...o.D....f.6
268D:16B0 A0 AA 9A 6F 0A 44 17 83 C4 04 66 FF 36 A4 AA 9A ...o.D....f.6...
268D:16C0 6F 0A 44 17 83 C4 04 66 FF 36 A8 AA 9A 6F 0A 44 o.D....f.6...o.D
268D:16D0 17 83 C4 04 B8 BA 28 8E C0 66 26 FF 36 86 A8 9A ......(..f&.6...
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.