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 |
|---|---|---|---|---|
oeis/124/A124791.asm | neoneye/loda-programs | 11 | 168999 | <gh_stars>10-100
; A124791: Row sums of number triangle A124790.
; Submitted by <NAME>
; 1,1,1,3,5,13,29,73,181,465,1205,3171,8425,22597,61073,166195,454949,1251985,3461573,9611191,26787377,74916661,210178457,591347989,1668172841,4717282753,13369522249,37970114703,108045430901
add $0,1
mov $1,1
mov $3,$0
mov $4,1
lpb $3
sub $3,1
div $4,-1
mul $4,$3
add $5,$1
add $1,1
mod $1,2
div $4,$5
add $2,$4
lpe
mov $0,$2
add $0,$1
mul $0,2
add $0,1
|
oeis/130/A130068.asm | neoneye/loda-programs | 11 | 82621 | <gh_stars>10-100
; A130068: Maximal power of 2 dividing the binomial coefficient binomial(m, 2^k) where m >= 1 and 1 <= 2^k <= m.
; Submitted by <NAME>(w1)
; 0,1,0,0,0,2,1,0,0,1,0,1,0,0,0,0,0,3,2,1,0,0,2,1,0,1,0,1,0,0,0,1,0,2,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,4,3,2,1,0,0,3,2,1,0,1,0,2,1,0,0,0,2,1,0,2,1,0,1,0,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,3,2,1,0,0,0,2,1,0,0,1
seq $0,120385 ; If a(n-1) = 1 then largest value so far + 1, otherwise floor(a(n-1)/2); or table T(n,k) with T(n,0) = n, T(n,k+1) = floor(T(n,k)/2).
lpb $0
dif $0,2
add $1,1
lpe
mov $0,$1
|
agda/Data/Sum/Properties.agda | oisdk/combinatorics-paper | 4 | 14607 | <reponame>oisdk/combinatorics-paper<gh_stars>1-10
{-# OPTIONS --cubical --safe --postfix-projections #-}
module Data.Sum.Properties where
open import Prelude
open import Data.Sum
open import Data.Bool
sumAsSigma : A ⊎ B ≃ Σ[ x ⦂ Bool ] (if x then A else B)
sumAsSigma = isoToEquiv $
iso
(either (true ,_) (false ,_))
(uncurry (bool inr inl))
(λ { (false , _) → refl ; (true , _) → refl})
(λ { (inl _) → refl ; (inr _) → refl})
|
Eq/ObsTheory.agda | msullivan/godels-t | 4 | 15671 | module Eq.ObsTheory where
open import Prelude
open import T
open import DynTheory
open import SubstTheory
open import Contexts
open import Eq.Defs
open import Eq.KleeneTheory
open ObservEq
---- Proofs about observational equivalence
-- observational equivalence being an equiv reln follows trivially from kleene equiv being one
obs-refl : ∀ {Γ} {A} → Reflexive (ObservEq Γ A)
obs-refl = obs (λ C → kleene-refl)
obs-sym : ∀ {Γ} {A} → Symmetric (ObservEq Γ A)
obs-sym eq = obs (λ C → kleene-sym (observe eq C))
obs-trans : ∀ {Γ} {A} → Transitive (ObservEq Γ A)
obs-trans eq1 eq2 = obs (λ C → kleene-trans (observe eq1 C) (observe eq2 C))
obs-is-equivalence : ∀{Γ} {A} → IsEquivalence (ObservEq Γ A)
obs-is-equivalence = record { refl_ = obs-refl
; sym_ = obs-sym
; trans_ = obs-trans }
obs-congruence : Congruence ObservEq
obs-congruence {e = e} {e' = e'} oeq C = obs help
where help : (C₁ : TCtx _ _ _ _) → KleeneEq (C₁ < C < e > >) (C₁ < C < e' > >)
help C' with observe oeq (C' << C >>)
... | keq = ID.coe2 KleeneEq (composing-commutes C' C e) (composing-commutes C' C e') keq
obs-consistent : Consistent ObservEq
obs-consistent oeq = observe oeq ∘
obs-is-con-congruence : IsConsistentCongruence ObservEq
obs-is-con-congruence = record { equiv = obs-is-equivalence
; cong = obs-congruence
; consistent = obs-consistent
}
-- Prove that observational equivalence is the coarsest consistent congruence.
-- That is, that it contains all other consistent congruences.
-- That is, if two terms are related by a consistent congruence, they are
-- observationally equivalence.
obs-is-coarsest : (R : TRel) → IsConsistentCongruence R →
{Γ : Ctx} {A : TTp} →
(R Γ A) ⊆ (ObservEq Γ A)
obs-is-coarsest R isCC eq = obs help
where help : (C : TCtx _ _ _ _) → KleeneEq (C < _ >) (C < _ >)
help C with (IsConsistentCongruence.cong isCC) eq C
... | eqC = (IsConsistentCongruence.consistent isCC) eqC
-- Produce a program context that is "equivalent" to a substitution.
-- Essentially the idea is, if we have a substitution
-- γ = e1/x1,...,en/xn, we produce the term
-- (λx1. ⋯ λxn. ∘) e1 ⋯ en
--
-- It took me a while of fiddling around before I came up with this
-- implementation based on composing contexts, but it works really nicely.
--
-- The earlier version that I got closest to making work placed the
-- terms we were substituting underneath other lambdas, which almost
-- works; since it requires weakening the terms, it means to prove
-- subst-ctx-respect-obs we would need to show that weakening preserves
-- observational equivalence. I don't know how to do this without using
-- that observational and logical equivalence coincide.
subst-ctx : ∀{Γ C} → (γ : TSubst Γ []) → (TCtx Γ C [] C)
subst-ctx {[]} γ = ∘
subst-ctx {A :: Γ} {C} γ with (subst-ctx {Γ} {A ⇒ C} (dropγ γ))
... | D = (D << Λ ∘ >>) $e (γ Z)
-- This would basically be the end of the world in call by value.
-- On paper, this proof goes:
--
-- Given some substitution γ[x -> e'], want to show that
-- (C << (λ x. ∘) >> e') < e > e'~>* γ[x -> e'](e), where C is the context constructed for γ.
-- We know that (C << (λ x. ∘) >> e') < e > = C << (λ x. e) >> e'.
-- By induction, we have that "C << (λ x. e) >> ~>* (λ x. γ(e))", and by compatability rules,
-- C << (λ x. e) >> e' ~>* (λ x. γ(e)) e'
-- Then, by beta, we have that (λ x. γ(e)) e' ~> γ([e'/x]e)).
subst-ctx-substs : ∀{Γ A} → (γ : TSubst Γ []) → (e : TExp Γ A) →
(subst-ctx γ) < e > ~>* ssubst γ e
subst-ctx-substs {[]} γ e = ID.coe1 (_~>*_ e) (symm (closed-subst γ e)) eval-refl
subst-ctx-substs {x :: Γ} γ e with subst-ctx-substs (dropγ γ) (Λ e)
... | recursive-eval with eval-compat (step-app-l {e₂ = γ Z}) recursive-eval
... | compat-eval with step-beta {e = ssubst (liftγ (dropγ γ)) e} {e' = γ Z}
... | step with eval-trans compat-eval (eval-step step)
... | eval with composing-commutes (subst-ctx (dropγ γ)) (Λ ∘) e
... | ctx-eq with (symm (subcomp (singγ (γ Z)) (liftγ (dropγ γ)) e) ≡≡ symm (subeq (drop-fix γ) e))
... | subst-eq = ID.coe2 (λ y z → (y $ γ Z) ~>* z) (symm ctx-eq) subst-eq eval
-- Straightforward extension of the above theorem to kleene equivalence at nat type.
subst-ctx-substs-eq : ∀{Γ} → (γ : TSubst Γ []) → (e : TExp Γ nat) →
(subst-ctx γ) < e > ≃ ssubst γ e
subst-ctx-substs-eq γ e with subst-ctx-substs γ e | kleene-refl {x = ssubst γ e}
... | eval | kleeneq n val E1 E2 = kleeneq n val (eval-trans eval E1) E2
-- Prove that observationally equivalent substitutions yield
-- contexts that are observationally equivalent when applied to a term.
subst-ctx-respect-obs : ∀{Γ} {A} (e : TExp Γ A) {γ γ' : TSubst Γ []} →
SubstRel (ObservEq []) Γ γ γ' →
[] ⊢ subst-ctx γ < e > ≅ subst-ctx γ' < e > :: A
subst-ctx-respect-obs {[]} e η = obs-refl
subst-ctx-respect-obs {B :: Γ} {A} e {γ} {γ'} η with
subst-ctx-respect-obs (Λ e) {dropγ γ} {dropγ γ'} (λ x → η (S x))
... | D-D'-equiv with obs-congruence D-D'-equiv (∘ $e γ Z)
... | cong1 with obs-congruence (η Z) ((subst-ctx (dropγ γ') < Λ e >) e$ ∘)
... | cong2 with obs-trans cong1 cong2
... | equiv =
ID.coe2 (ObservEq [] A)
(symm (resp (λ x → x $ γ Z) (composing-commutes (subst-ctx (dropγ γ)) (Λ ∘) e)))
(symm (resp (λ x → x $ γ' Z) (composing-commutes (subst-ctx (dropγ γ')) (Λ ∘) e)))
equiv
-- Applying a substitution to two obs equivalent terms yields observational equivalent output.
-- Takes advantage of substitution contexts.
substs-respect-obs-1 : ∀{Γ} {A} {e e' : TExp Γ A} {γ : TSubst Γ []} →
Γ ⊢ e ≅ e' :: A →
[] ⊢ ssubst γ e ≅ ssubst γ e' :: A
substs-respect-obs-1 {Γ} {A} {e} {e'} {γ} (obs observe) = obs help
where help : (C : TCtx [] A [] nat) → KleeneEq (C < ssubst γ e >) (C < ssubst γ e' >)
help C with observe (subst-ctx γ << weaken-closed-tctx C >>)
... | D-equiv with ID.coe2 KleeneEq
(composing-commutes (subst-ctx γ) (weaken-closed-tctx C) e)
(composing-commutes (subst-ctx γ) (weaken-closed-tctx C) e')
D-equiv
... | D-equiv2 with subst-ctx-substs-eq γ ((weaken-closed-tctx C) < e >) |
subst-ctx-substs-eq γ ((weaken-closed-tctx C) < e' >)
... | sub-equiv1 | sub-equiv2 with
kleene-trans (kleene-sym sub-equiv1) (kleene-trans D-equiv2 sub-equiv2)
... | equiv = ID.coe2 KleeneEq
(symm (subst-commutes-w-closed-tctx γ C e))
(symm (subst-commutes-w-closed-tctx γ C e')) equiv
-- Applying observationally equivalent substitutions a term
-- yields observational equivalent output.
-- Takes advantage of substitution contexts.
-- There is much in this proof that is similar to substs-respect-obs-1.
-- Maybe they could have been merged more?
substs-respect-obs-2 : ∀{Γ} {A} (e : TExp Γ A) {γ γ' : TSubst Γ []} →
SubstRel (ObservEq []) Γ γ γ' →
[] ⊢ ssubst γ e ≅ ssubst γ' e :: A
substs-respect-obs-2 {Γ} {A} e {γ} {γ'} η = obs help
where help : (C : TCtx [] A [] nat) → KleeneEq (C < ssubst γ e >) (C < ssubst γ' e >)
help C with subst-ctx-respect-obs (weaken-closed-tctx C < e >) η
... | oeq with obs-consistent oeq
... | keq with subst-ctx-substs-eq γ ((weaken-closed-tctx C) < e >) |
subst-ctx-substs-eq γ' ((weaken-closed-tctx C) < e >)
... | sub-equiv1 | sub-equiv2 with
kleene-trans (kleene-sym sub-equiv1) (kleene-trans keq sub-equiv2)
... | equiv = ID.coe2 KleeneEq
(symm (subst-commutes-w-closed-tctx γ C e))
(symm (subst-commutes-w-closed-tctx γ' C e)) equiv
-- Combine the two previous theorems.
substs-respect-obs : ∀{Γ} {A} {e e' : TExp Γ A} {γ γ' : TSubst Γ []} →
Γ ⊢ e ≅ e' :: A →
SubstRel (ObservEq []) Γ γ γ' →
[] ⊢ ssubst γ e ≅ ssubst γ' e' :: A
substs-respect-obs {Γ} {A} {e} {e'} {γ} {γ'} oeq η =
obs-trans (substs-respect-obs-2 e η) (substs-respect-obs-1 oeq)
|
object.adb | jrcarter/Ada_GUI | 19 | 25152 | <reponame>jrcarter/Ada_GUI
-- --
-- package Object.Tasking Copyright (c) <NAME> --
-- Implementation Luebeck --
-- Winter, 2009 --
-- Multiple tasking version --
-- Last revision : 10:33 11 May 2019 --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public License as --
-- published by the Free Software Foundation; either version 2 of --
-- the License, or (at your option) any later version. This library --
-- is distributed in the hope that it will be useful, but WITHOUT --
-- ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have --
-- received a copy of the GNU General Public License along with --
-- this library; if not, write to the Free Software Foundation, --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
--____________________________________________________________________--
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Tags; use Ada.Tags;
with Ada.Unchecked_Deallocation;
with System; use type System.Address;
package body Object is
Decrement_Error : exception;
protected Lock is
procedure Decrement
( Object : in out Entity'Class;
New_Value : out Natural
);
procedure Increment (Object : in out Entity'Class);
private
pragma Inline (Decrement);
pragma Inline (Increment);
end Lock;
protected body Lock is
procedure Decrement
( Object : in out Entity'Class;
New_Value : out Natural
) is
begin
if Object.Use_Count = 0 then
raise Decrement_Error;
else
Object.Use_Count := Object.Use_Count - 1;
New_Value := Object.Use_Count;
end if;
end Decrement;
procedure Increment (Object : in out Entity'Class) is
begin
Object.Use_Count := Object.Use_Count + 1;
end Increment;
end Lock;
function Equal
( Left : Entity;
Right : Entity'Class;
Flag : Boolean := False
) return Boolean is
begin
if Flag or else Right in Entity then
return Left'Address = Right'Address;
else
return Equal (Right, Left, True);
end if;
end Equal;
procedure Finalize (Object : in out Entity) is
begin
if 0 /= Object.Use_Count then
Raise_Exception
( Program_Error'Identity,
( Ada.Tags.Expanded_Name (Entity'Class (Object)'Tag)
& " is still in use"
) );
end if;
end Finalize;
procedure Decrement_Count
( Object : in out Entity;
Use_Count : out Natural
) is
begin
Lock.Decrement (Object, Use_Count);
exception
when Decrement_Error =>
Raise_Exception
( Program_Error'Identity,
( Ada.Tags.Expanded_Name (Entity'Class (Object)'Tag)
& " has zero count"
) );
end Decrement_Count;
procedure Increment_Count (Object : in out Entity) is
begin
Lock.Increment (Object);
end Increment_Count;
procedure Initialize (Object : in out Entity) is
begin
null;
end Initialize;
function Less
( Left : Entity;
Right : Entity'Class;
Flag : Boolean := False
) return Boolean is
begin
if Flag or else Right in Entity then
return Left'Address < Right'Address;
else
return not ( Less (Right, Left, True)
or else
Equal (Right, Left, True)
);
end if;
end Less;
procedure Put_Traceback (Object : Entity'Class) is
begin
null;
end Put_Traceback;
procedure Release (Ptr : in out Entity_Ptr) is
procedure Free is new
Ada.Unchecked_Deallocation (Entity'Class, Entity_Ptr);
begin
if Ptr /= null then
declare
Object : Entity'Class renames Ptr.all;
Count : Natural;
begin
Decrement_Count (Object, Count);
if Count > 0 then
return;
end if;
end;
Free (Ptr);
end if;
end Release;
procedure Set_Trace_File (File : String) is
begin
null;
end Set_Trace_File;
end Object;
|
src/babel-base-text.adb | stcarrez/babel | 1 | 24579 | <gh_stars>1-10
-----------------------------------------------------------------------
-- babel-base -- Database for files
-- Copyright (C) 2014 Stephane.Carrez
-- Written by Stephane.Carrez (<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.Streams;
with Ada.Calendar;
with Ada.Exceptions;
with Util.Dates.ISO8601;
with Util.Files;
with Util.Strings;
with Util.Encoders.Base16;
with Util.Encoders.SHA1;
with Util.Log.Loggers;
with Babel.Files.Sets;
with Babel.Files.Maps;
with Babel.Files.Lifecycles;
with Ada.Text_IO;
package body Babel.Base.Text is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Babel.Base.Text");
-- ------------------------------
-- Insert the file in the database.
-- ------------------------------
overriding
procedure Insert (Into : in out Text_Database;
File : in Babel.Files.File_Type) is
begin
Into.Files.Insert (File);
end Insert;
overriding
procedure Iterate (From : in Text_Database;
Process : not null access procedure (File : in Babel.Files.File_Type)) is
procedure Process_One (Pos : in Babel.Files.Sets.File_Cursor) is
begin
Process (Babel.Files.Sets.File_Sets.Element (Pos));
end Process_One;
begin
From.Files.Iterate (Process_One'Access);
end Iterate;
-- ------------------------------
-- Save the database file description in the file.
-- ------------------------------
procedure Save (Database : in Text_Database;
Path : in String) is
Checksum : Ada.Text_IO.File_Type;
procedure Write_Checksum (Position : in Babel.Files.Sets.File_Cursor) is
File : constant Babel.Files.File_Type := Babel.Files.Sets.File_Sets.Element (Position);
SHA1 : constant String := Babel.Files.Get_SHA1 (File);
Path : constant String := Babel.Files.Get_Path (File);
begin
Ada.Text_IO.Put (Checksum, SHA1);
Ada.Text_IO.Put (Checksum, Babel.Uid_Type'Image (Babel.Files.Get_User (File)));
Ada.Text_IO.Put (Checksum, Babel.Gid_Type'Image (Babel.Files.Get_Group (File)));
Ada.Text_IO.Put (Checksum, " ");
Ada.Text_IO.Put (Checksum, Util.Dates.ISO8601.Image (Babel.Files.Get_Date (File)));
Ada.Text_IO.Put (Checksum, Babel.Files.File_Size'Image (Babel.Files.Get_Size (File)));
Ada.Text_IO.Put (Checksum, " ");
Ada.Text_IO.Put (Checksum, Path);
Ada.Text_IO.New_Line (Checksum);
end Write_Checksum;
begin
Log.Info ("Save text database {0}", Path);
Ada.Text_IO.Create (File => Checksum, Name => Path);
Database.Files.Iterate (Write_Checksum'Access);
Ada.Text_IO.Close (File => Checksum);
end Save;
-- ------------------------------
-- Load the database file description from the file.
-- ------------------------------
procedure Load (Database : in out Text_Database;
Path : in String) is
Checksum : Ada.Text_IO.File_Type;
Dirs : Babel.Files.Maps.Directory_Map;
Files : Babel.Files.Maps.File_Map;
Hex_Decoder : Util.Encoders.Base16.Decoder;
Line_Number : Natural := 0;
procedure Read_Line (Line : in String) is
File : Babel.Files.File_Type;
Pos : Natural;
First : Natural;
Sign : Util.Encoders.SHA1.Hash_Array;
Sign_Size : Ada.Streams.Stream_Element_Offset;
User : Uid_Type;
Group : Gid_Type;
Date : Ada.Calendar.Time;
Size : Babel.Files.File_Size;
begin
Line_Number := Line_Number + 1;
Pos := Util.Strings.Index (Line, ' ');
if Pos = 0 then
return;
end if;
Hex_Decoder.Transform (Line (Line'First .. Pos - 1), Sign, Sign_Size);
-- Extract the user ID.
First := Pos + 1;
Pos := Util.Strings.Index (Line, ' ', First);
if Pos = 0 then
return;
end if;
User := Uid_Type'Value (Line (First .. Pos - 1));
-- Extract the group ID.
First := Pos + 1;
Pos := Util.Strings.Index (Line, ' ', First);
if Pos = 0 then
return;
end if;
Group := Uid_Type'Value (Line (First .. Pos - 1));
-- Extract the file date.
First := Pos + 1;
Pos := Util.Strings.Index (Line, ' ', First);
if Pos = 0 then
return;
end if;
Date := Util.Dates.ISO8601.Value (Line (First .. Pos - 1));
-- Extract the file size.
First := Pos + 1;
Pos := Util.Strings.Index (Line, ' ', First);
if Pos = 0 then
return;
end if;
Size := Babel.Files.File_Size'Value (Line (First .. Pos - 1));
Babel.Files.Maps.Add_File (Dirs, Files, Line (Pos + 1 .. Line'Last), File);
Babel.Files.Set_Owner (File, User, Group);
Babel.Files.Set_Size (File, Size);
Babel.Files.Set_Signature (File, Sign);
Babel.Files.Set_Date (File, Date);
Database.Insert (File);
exception
when E : others =>
Log.Error ("{0}:{1}: Error: {2}: {3}: " & Line, Path, Natural'Image (Line_Number),
Ada.Exceptions.Exception_Message (E));
end Read_Line;
begin
Log.Info ("Load text database {0}", Path);
Util.Files.Read_File (Path, Read_Line'Access);
end Load;
end Babel.Base.Text;
|
GCCio.asm | Sahilsinggh/MP_SEM4 | 1 | 244652 | ;GCC scanf and printf function for input and output of double (8bytes)
extern printf,scanf
%macro _printf 1
pop qword[stack];
mov rdi,formatpf;
movsd xmm0,qword[%1];
mov rax,1;
call printf;
push qword[stack];
%endmacro
%macro _scanf 1
pop qword[stack];
mov rdi,formatsf;
mov rsi,rsp;
call scanf
mov rax,qword[rsp];
mov qword[%1],rax;
push qword[stack];
%endmacro
section .data
formatpf: db "%lf",10,0;
formatsf: db "%lf",0;
x: dq 5.0
section .bss
stack: resq 1;
var: resq 1;
section .text
global main
main:
_scanf var;
_printf var;
exit:
mov rax,60;
mov rdi,0;
syscall;
|
Express.g4 | lutaml/express-grammar | 1 | 644 | grammar Express;
// A.1.5 Interpreted identifiers
attributeRef
: attributeId
; // 150
constantRef
: constantId
; // 151
entityRef
: entityId
; // 152
enumerationRef
: enumerationId
; // 153
functionRef
: functionId
; // 154
parameterRef
: parameterId
; // 155
procedureRef
: procedureId
; // 156
ruleLabelRef
: ruleLabelId
; // 157
ruleRef
: ruleId
; // 158
schemaRef
: schemaId
; // 159
subtypeConstraintRef
: subtypeConstraintId
; // 160
typeLabelRef
: typeLabelId
; // 161
typeRef
: typeId
; // 162
variableRef
: variableId
; // 163
// A.2 Grammar rules
abstractEntityDeclaration
: ABSTRACT
; // 164
abstractSupertype
: ABSTRACT SUPERTYPE ';'
; // 165
abstractSupertypeDeclaration
: ABSTRACT SUPERTYPE subtypeConstraint?
; // 166
actualParameterList
: '(' parameter (',' parameter)* ')'
; // 167
addLikeOp
: '+'
| '-'
| OR
| XOR
; // 168
aggregateInitializer
: '[' (element (',' element)*)? ']'
; // 169
aggregateSource
: simpleExpression
; // 170
aggregateType
: AGGREGATE (':' typeLabel)? OF parameterType
; // 171
aggregationTypes
: arrayType
| bagType
| listType
| setType
; // 172
algorithmHead
: declaration* constantDecl? localDecl?
; // 173
aliasStmt
: ALIAS variableId FOR generalRef qualifier* ';' stmt stmt* END_ALIAS ';'
; // 174
arrayType
: ARRAY boundSpec OF OPTIONAL? UNIQUE? instantiableType
; // 175
assignmentStmt
: generalRef qualifier* ':=' expression ';'
; // 176
attributeDecl
: attributeId
| redeclaredAttribute
; // 177
attributeId
: SimpleId
; // 178
attributeQualifier
: '.' attributeRef
; // 179
bagType
: BAG boundSpec? OF instantiableType
; // 180
binaryType
: BINARY widthSpec?
; // 181
booleanType
: BOOLEAN
; // 182
bound1
: numericExpression
; // 183
bound2
: numericExpression
; // 184
boundSpec
: '[' bound1 ':' bound2 ']'
; // 185
builtInConstant
: CONST_E
| PI
| SELF
| '?'
; // 186
builtInFunction
: ABS
| ACOS
| ASIN
| ATAN
| BLENGTH
| COS
| EXISTS
| EXP
| FORMAT
| HIBOUND
| HIINDEX
| LENGTH
| LOBOUND
| LOINDEX
| LOG
| LOG2
| LOG10
| NVL
| ODD
| ROLESOF
| SIN
| SIZEOF
| SQRT
| TAN
| TYPEOF
| USEDIN
| VALUE_
| VALUE_IN
| VALUE_UNIQUE
; // 187
builtInProcedure
: INSERT
| REMOVE
; // 188
caseAction
: caseLabel (',' caseLabel)* ':' stmt
; // 189
caseLabel
: expression
; // 190
caseStmt
: CASE selector OF caseAction* (OTHERWISE ':' stmt)? END_CASE ';'
; // 191
compoundStmt
: BEGIN_ stmt stmt* END_ ';'
; // 192
concreteTypes
: aggregationTypes
| simpleTypes
| typeRef
; // 193
constantBody
: constantId ':' instantiableType ':=' expression ';'
; // 194
constantDecl
: CONSTANT constantBody constantBody* END_CONSTANT ';'
; // 195
constantFactor
: builtInConstant
| constantRef
; // 196
constantId
: SimpleId
; // 197
constructedTypes
: enumerationType
| selectType
; // 198
declaration
: entityDecl
| functionDecl
| procedureDecl
| subtypeConstraintDecl
| typeDecl
; // 199
derivedAttr
: attributeDecl ':' parameterType ':=' expression ';'
; // 200
deriveClause
: DERIVE derivedAttr derivedAttr*
; // 201
domainRule
: (ruleLabelId ':')? expression
; // 202
element
: expression (':' repetition)?
; // 203
entityBody
: explicitAttr* deriveClause? inverseClause? uniqueClause? whereClause?
; // 204
entityConstructor
: entityRef '(' (expression (',' expression)*)? ')'
; // 205
entityDecl
: entityHead entityBody END_ENTITY ';'
; // 206
entityHead
: ENTITY entityId subsuper ';'
; // 207
entityId
: SimpleId
; // 208
enumerationExtension
: BASED_ON typeRef (WITH enumerationItems)?
; // 209
enumerationId
: SimpleId
; // 210
enumerationItems
: '(' enumerationItem (',' enumerationItem)* ')'
; // 211
enumerationItem
: enumerationId
; // custom
enumerationReference
: (typeRef '.')? enumerationRef
; // 212
enumerationType
: EXTENSIBLE? ENUMERATION (OF enumerationItems | enumerationExtension)?
; // 213
escapeStmt
: ESCAPE ';'
; // 214
explicitAttr
: attributeDecl (',' attributeDecl)* ':' OPTIONAL? parameterType ';'
; // 215
expression
: simpleExpression (relOpExtended simpleExpression)?
; // 216
factor
: simpleFactor ('**' simpleFactor)?
; // 217
formalParameter
: parameterId (',' parameterId)* ':' parameterType
; // 218
functionCall
: (builtInFunction | functionRef) actualParameterList?
; // 219
functionDecl
: functionHead algorithmHead stmt stmt* END_FUNCTION ';'
; // 220
functionHead
: FUNCTION functionId ('(' formalParameter (';' formalParameter)* ')')? ':' parameterType ';'
; // 221
functionId
: SimpleId
; // 222
generalizedTypes
: aggregateType
| generalAggregationTypes
| genericEntityType
| genericType
; // 223
generalAggregationTypes
: generalArrayType
| generalBagType
| generalListType
| generalSetType
; // 224
generalArrayType
: ARRAY boundSpec? OF OPTIONAL? UNIQUE? parameterType
; // 225
generalBagType
: BAG boundSpec? OF parameterType
; // 226
generalListType
: LIST boundSpec? OF UNIQUE? parameterType
; // 227
generalRef
: parameterRef
| variableId
; // 228
generalSetType
: SET boundSpec? OF parameterType
; // 229
genericEntityType
: GENERIC_ENTITY (':' typeLabel)?
; // 230
genericType
: GENERIC (':' typeLabel)?
; // 231
groupQualifier
: '\\' entityRef
; // 232
ifStmt
: IF logicalExpression THEN ifStmtStatements (ELSE ifStmtElseStatements)? END_IF ';'
; // 233
ifStmtStatements
: stmt stmt*
; // custom
ifStmtElseStatements
: stmt stmt*
; // custom
increment
: numericExpression
; // 234
incrementControl
: variableId ':=' bound1 TO bound2 (BY increment)?
; // 235
index
: numericExpression
; // 236
index1
: index
; // 237
index2
: index
; // 238
indexQualifier
: '[' index1 (':' index2)? ']'
; // 239
instantiableType
: concreteTypes
| entityRef
; // 240
integerType
: INTEGER
; // 241
interfaceSpecification
: referenceClause
| useClause
; // 242
interval
: '{' intervalLow intervalOp intervalItem intervalOp intervalHigh '}'
; // 243
intervalHigh
: simpleExpression
; // 244
intervalItem
: simpleExpression
; // 245
intervalLow
: simpleExpression
; // 246
intervalOp
: '<'
| '<='
; // 247
inverseAttr
: attributeDecl ':' inverseAttrType FOR (entityRef '.')? attributeRef ';'
; // 248
inverseAttrType
: ((SET | BAG) boundSpec? OF)? entityRef
; // custom
inverseClause
: INVERSE inverseAttr inverseAttr*
; // 249
listType
: LIST boundSpec? OF UNIQUE? instantiableType
; // 250
literal
: BinaryLiteral
| IntegerLiteral
| logicalLiteral
| RealLiteral
| stringLiteral
; // 251
localDecl
: LOCAL localVariable localVariable* END_LOCAL ';'
; // 252
localVariable
: variableId (',' variableId)* ':' parameterType (':=' expression)? ';'
; // 253
logicalExpression
: expression
; // 254
logicalLiteral
: FALSE
| TRUE
| UNKNOWN
; // 255
logicalType
: LOGICAL
; // 256
multiplicationLikeOp
: '*'
| '/'
| DIV
| MOD
| AND
| '||'
; // 257
namedTypes
: entityRef
| typeRef
; // 258
namedTypeOrRename
: namedTypes (AS (entityId | typeId))?
; // 259
nullStmt
: ';'
; // 260
numberType
: NUMBER
; // 261
numericExpression
: simpleExpression
; // 262
oneOf
: ONEOF '(' supertypeExpression (',' supertypeExpression)* ')'
; // 263
parameter
: expression
; // 264
parameterId
: SimpleId
; // 265
parameterType
: generalizedTypes
| namedTypes
| simpleTypes
; // 266
population
: entityRef
; // 267
precisionSpec
: numericExpression
; // 268
primary
: literal
| qualifiableFactor qualifier*
; // 269
procedureCallStmt
: (builtInProcedure | procedureRef) actualParameterList? ';'
; // 270
procedureDecl
: procedureHead algorithmHead stmt* END_PROCEDURE ';'
; // 271
procedureHead
: PROCEDURE procedureId ('(' procedureHeadParameter (';' procedureHeadParameter)* ')')? ';'
; // 272
procedureHeadParameter
: VAR? formalParameter
; // custom
procedureId
: SimpleId
; // 273
qualifiableFactor
: attributeRef
| constantFactor
| functionCall
| generalRef
| population
; // 274
qualifiedAttribute
: SELF groupQualifier attributeQualifier
; // 275
qualifier
: attributeQualifier
| groupQualifier
| indexQualifier
; // 276
queryExpression
: QUERY '(' variableId '<*' aggregateSource '|' logicalExpression ')'
; // 277
realType
: REAL ('(' precisionSpec ')')?
; // 278
redeclaredAttribute
: qualifiedAttribute (RENAMED attributeId)?
; // 279
referencedAttribute
: attributeRef
| qualifiedAttribute
; // 280
referenceClause
: REFERENCE FROM schemaRef ('(' resourceOrRename (',' resourceOrRename)* ')')? ';'
; // 281
relOp
: '<' | '>' | '<=' | '>=' | '<>' | '=' | ':<>:' | ':=:'
; // 282
relOpExtended
: relOp | IN | LIKE
; // 283
renameId
: constantId
| entityId
| functionId
| procedureId
| typeId
; // 284
repeatControl
: incrementControl? whileControl? untilControl?
; // 285
repeatStmt
: REPEAT repeatControl ';' stmt stmt* END_REPEAT ';'
; // 286
repetition
: numericExpression
; // 287
resourceOrRename
: resourceRef (AS renameId)?
; // 288
resourceRef
: constantRef
| entityRef
| functionRef
| procedureRef
| typeRef
; // 289
returnStmt
: RETURN ('(' expression ')')? ';'
; // 290
ruleDecl
: ruleHead algorithmHead stmt* whereClause END_RULE ';'
; // 291
ruleHead
: RULE ruleId FOR '(' entityRef (',' entityRef)* ')' ';'
; // 292
ruleId
: SimpleId
; // 293
ruleLabelId
: SimpleId
; // 294
schemaBody
: interfaceSpecification* constantDecl? schemaBodyDeclaration*
; // 295
schemaBodyDeclaration
: declaration | ruleDecl
; // custom
schemaDecl
: SCHEMA schemaId schemaVersionId? ';' schemaBody END_SCHEMA ';'
; // 296
schemaId
: SimpleId
; // 297
schemaVersionId
: stringLiteral
; // 298
selector
: expression
; // 299
selectExtension
: BASED_ON typeRef (WITH selectList)?
; // 300
selectList
: '(' namedTypes (',' namedTypes)* ')'
; // 301
selectType
: (EXTENSIBLE GENERIC_ENTITY?)? SELECT (selectList | selectExtension)?
; // 302
setType
: SET boundSpec? OF instantiableType
; // 303
simpleExpression
: term (addLikeOp term)*
; // 305
simpleFactor
: aggregateInitializer
| entityConstructor
| enumerationReference
| interval
| queryExpression
| simpleFactorExpression
| simpleFactorUnaryExpression
; // 306
simpleFactorExpression
: '(' expression ')'
| primary
; // custom
simpleFactorUnaryExpression
: unaryOp simpleFactorExpression
; // custom
simpleTypes
: binaryType
| booleanType
| integerType
| logicalType
| numberType
| realType
| stringType
; // 307
skipStmt
: SKIP_ ';'
; // 308
stmt
: aliasStmt
| assignmentStmt
| caseStmt
| compoundStmt
| escapeStmt
| ifStmt
| nullStmt
| procedureCallStmt
| repeatStmt
| returnStmt
| skipStmt
; // 309
stringLiteral
: SimpleStringLiteral
| EncodedStringLiteral
; // 310
stringType
: STRING widthSpec?
; // 311
subsuper
: supertypeConstraint? subtypeDeclaration?
; // 312
subtypeConstraint
: OF '(' supertypeExpression ')'
; // 313
subtypeConstraintBody
: abstractSupertype? totalOver? (supertypeExpression ';')?
; // 314
subtypeConstraintDecl
: subtypeConstraintHead subtypeConstraintBody END_SUBTYPE_CONSTRAINT ';'
; // 315
subtypeConstraintHead
: SUBTYPE_CONSTRAINT subtypeConstraintId FOR entityRef ';'
; // 316
subtypeConstraintId
: SimpleId
; // 317
subtypeDeclaration
: SUBTYPE OF '(' entityRef (',' entityRef)* ')'
; // 318
supertypeConstraint
: abstractEntityDeclaration
| abstractSupertypeDeclaration
| supertypeRule
; // 319
supertypeExpression
: supertypeFactor (ANDOR supertypeFactor)*
; // 320
supertypeFactor
: supertypeTerm (AND supertypeTerm)*
; // 321
supertypeRule
: SUPERTYPE subtypeConstraint
; // 322
supertypeTerm
: entityRef
| oneOf
| '(' supertypeExpression ')'
; // 323
syntax
: schemaDecl+ EOF
; // 324
term
: factor (multiplicationLikeOp factor)*
; // 325
totalOver
: TOTAL_OVER '(' entityRef (',' entityRef)* ')' ';'
; // 326
typeDecl
: TYPE typeId '=' underlyingType ';' whereClause? END_TYPE ';'
; // 327
typeId
: SimpleId
; // 328
typeLabel
: typeLabelId
| typeLabelRef
; // 329
typeLabelId
: SimpleId
; // 330
unaryOp
: '+'
| '-'
| NOT
; // 331
underlyingType
: concreteTypes
| constructedTypes
; // 332
uniqueClause
: UNIQUE uniqueRule ';' (uniqueRule ';')*
; // 333
uniqueRule
: (ruleLabelId ':')? referencedAttribute (',' referencedAttribute)*
; // 334
untilControl
: UNTIL logicalExpression
; // 335
useClause
: USE FROM schemaRef ('(' namedTypeOrRename (',' namedTypeOrRename)* ')')? ';'
; // 336
variableId
: SimpleId
; // 337
whereClause
: WHERE domainRule ';' (domainRule ';')*
; // 338
whileControl
: WHILE logicalExpression
; // 339
width
: numericExpression
; // 340
widthSpec
: '(' width ')' FIXED?
; // 341
// Lexer
// A.1.1 Keywords
fragment A : [Aa] ;
fragment B : [Bb] ;
fragment C : [Cc] ;
fragment D : [Dd] ;
fragment E : [Ee] ;
fragment F : [Ff] ;
fragment G : [Gg] ;
fragment H : [Hh] ;
fragment I : [Ii] ;
fragment J : [Jj] ;
fragment K : [Kk] ;
fragment L : [Ll] ;
fragment M : [Mm] ;
fragment N : [Nn] ;
fragment O : [Oo] ;
fragment P : [Pp] ;
fragment Q : [Qq] ;
fragment R : [Rr] ;
fragment S : [Ss] ;
fragment T : [Tt] ;
fragment U : [Uu] ;
fragment V : [Vv] ;
fragment W : [Ww] ;
fragment X : [Xx] ;
fragment Y : [Yy] ;
fragment Z : [Zz] ;
ABS : A B S ;
ABSTRACT : A B S T R A C T ;
ACOS : A C O S ;
AGGREGATE : A G G R E G A T E ;
ALIAS : A L I A S ;
AND : A N D ;
ANDOR : A N D O R ;
ARRAY : A R R A Y ;
AS : A S ;
ASIN : A S I N ;
ATAN : A T A N ;
BAG : B A G ;
BASED_ON : B A S E D '_' O N ;
BEGIN_ : B E G I N ;
BINARY : B I N A R Y ;
BLENGTH : B L E N G T H ;
BOOLEAN : B O O L E A N ;
BY : B Y ;
CASE : C A S E ;
CONSTANT : C O N S T A N T ;
CONST_E : C O N S T '_' E ;
COS : C O S ;
DERIVE : D E R I V E ;
DIV : D I V ;
ELSE : E L S E ;
END_ : E N D ;
END_ALIAS : E N D '_' A L I A S ;
END_CASE : E N D '_' C A S E ;
END_CONSTANT : E N D '_' C O N S T A N T ;
END_ENTITY : E N D '_' E N T I T Y ;
END_FUNCTION : E N D '_' F U N C T I O N ;
END_IF : E N D '_' I F ;
END_LOCAL : E N D '_' L O C A L ;
END_PROCEDURE : E N D '_' P R O C E D U R E ;
END_REPEAT : E N D '_' R E P E A T ;
END_RULE : E N D '_' R U L E ;
END_SCHEMA : E N D '_' S C H E M A ;
END_SUBTYPE_CONSTRAINT : E N D '_' S U B T Y P E '_' C O N S T R A I N T ;
END_TYPE : E N D '_' T Y P E ;
ENTITY : E N T I T Y ;
ENUMERATION : E N U M E R A T I O N ;
ESCAPE : E S C A P E ;
EXISTS : E X I S T S ;
EXP : E X P ;
EXTENSIBLE : E X T E N S I B L E ;
FALSE : F A L S E ;
FIXED : F I X E D ;
FOR : F O R ;
FORMAT : F O R M A T ;
FROM : F R O M ;
FUNCTION : F U N C T I O N ;
GENERIC : G E N E R I C ;
GENERIC_ENTITY : G E N E R I C '_' E N T I T Y ;
HIBOUND : H I B O U N D ;
HIINDEX : H I I N D E X ;
IF : I F ;
IN : I N ;
INSERT : I N S E R T ;
INTEGER : I N T E G E R ;
INVERSE : I N V E R S E ;
LENGTH : L E N G T H ;
LIKE : L I K E ;
LIST : L I S T ;
LOBOUND : L O B O U N D ;
LOCAL : L O C A L ;
LOG : L O G ;
LOG10 : L O G '10' ;
LOG2 : L O G '2' ;
LOGICAL : L O G I C A L ;
LOINDEX : L O I N D E X ;
MOD : M O D ;
NOT : N O T ;
NUMBER : N U M B E R ;
NVL : N V L ;
ODD : O D D ;
OF : O F ;
ONEOF : O N E O F ;
OPTIONAL : O P T I O N A L ;
OR : O R ;
OTHERWISE : O T H E R W I S E ;
PI : P I ;
PROCEDURE : P R O C E D U R E ;
QUERY : Q U E R Y ;
REAL : R E A L ;
REFERENCE : R E F E R E N C E ;
REMOVE : R E M O V E ;
RENAMED : R E N A M E D ;
REPEAT : R E P E A T ;
RETURN : R E T U R N ;
ROLESOF : R O L E S O F ;
RULE : R U L E ;
SCHEMA : S C H E M A ;
SELECT : S E L E C T ;
SELF : S E L F ;
SET : S E T ;
SIN : S I N ;
SIZEOF : S I Z E O F ;
SKIP_ : S K I P ;
SQRT : S Q R T ;
STRING : S T R I N G ;
SUBTYPE : S U B T Y P E ;
SUBTYPE_CONSTRAINT : S U B T Y P E '_' C O N S T R A I N T ;
SUPERTYPE : S U P E R T Y P E ;
TAN : T A N ;
THEN : T H E N ;
TO : T O ;
TRUE : T R U E ;
TYPE : T Y P E ;
TYPEOF : T Y P E O F ;
TOTAL_OVER : T O T A L '_' O V E R ;
UNIQUE : U N I Q U E ;
UNKNOWN : U N K N O W N ;
UNTIL : U N T I L ;
USE : U S E ;
USEDIN : U S E D I N ;
VALUE_ : V A L U E ;
VALUE_IN : V A L U E '_' I N ;
VALUE_UNIQUE : V A L U E '_' U N I Q U E ;
VAR : V A R ;
WITH : W I T H ;
WHERE : W H E R E ;
WHILE : W H I L E ;
XOR : X O R ;
// A.1.2 Character classes
fragment
Bit
: [0-1]
; // 123
fragment
Digit
: [0-9]
; // 124
fragment
Digits
: Digit Digit*
; // 125
fragment
EncodedCharacter
: Octet Octet Octet Octet
; // 126
fragment
HexDigit
: Digit | [a-fA-F]
; // 127
fragment
Letter
: [a-zA-Z]
; // 128
fragment
Octet
: HexDigit HexDigit
; // 136
fragment
Sign
: '+' | '-'
; // 304
// A.1.3 Lexical elements
BinaryLiteral
: '%' Bit Bit*
; // 139
EncodedStringLiteral
: '"' EncodedCharacter EncodedCharacter* '"'
; // 140
IntegerLiteral
: Digits
; // 141
RealLiteral
: Digits '.' Digits? (E Sign? Digits)?
; // 142
SimpleId
: Letter (Letter | Digit | '_')*
; // 143
SimpleStringLiteral
: '\'' .*? '\''
; // 144
// A.1.4 Remarks
EmbeddedRemark
: '(*' (EmbeddedRemark | .)*? '*)'
-> channel(2)
; // 145
TailRemark
: '--' ~[\n]*
-> channel(2)
; // 149
// Whitespace
Whitespace
: [ \t\r\n\u000c]+
-> channel(1)
;
|
pwnlib/shellcraft/templates/amd64/mov.asm | magnologan/pwntools | 0 | 18654 | <%
from pwnlib.util import lists, packing, fiddling, misc
from pwnlib import constants
from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context
from pwnlib.log import getLogger
log = getLogger('pwnlib.shellcraft.amd64.mov')
%>
<%page args="dest, src, stack_allowed = True"/>
<%docstring>
Move src into dest without newlines and null bytes.
If the src is a register smaller than the dest, then it will be
zero-extended to fit inside the larger register.
If the src is a register larger than the dest, then only some of the bits will
be used.
If src is a string that is not a register, then it will locally set
`context.arch` to `'amd64'` and use :func:`pwnlib.constants.eval` to evaluate the
string. Note that this means that this shellcode can change behavior depending
on the value of `context.os`.
Example:
>>> print shellcraft.amd64.mov('eax','ebx').rstrip()
mov eax, ebx
>>> print shellcraft.amd64.mov('eax', 0).rstrip()
xor eax, eax
>>> print shellcraft.amd64.mov('ax', 0).rstrip()
xor ax, ax
>>> print shellcraft.amd64.mov('rax', 0).rstrip()
xor eax, eax
>>> print shellcraft.amd64.mov('al', 'ax').rstrip()
/* moving ax into al, but this is a no-op */
>>> print shellcraft.amd64.mov('bl', 'ax').rstrip()
mov bl, al
>>> print shellcraft.amd64.mov('ax', 'bl').rstrip()
movzx ax, bl
>>> print shellcraft.amd64.mov('eax', 1).rstrip()
push 0x1
pop rax
>>> print shellcraft.amd64.mov('rax', 0xc0).rstrip()
xor eax, eax
mov al, 0xc0
>>> print shellcraft.amd64.mov('rax', 0xc000).rstrip()
xor eax, eax
mov ah, 0xc0
>>> print shellcraft.amd64.mov('rax', 0xc0c0).rstrip()
xor eax, eax
mov ax, 0xc0c0
>>> print shellcraft.amd64.mov('rax', 0xdead00ff).rstrip()
mov eax, 0x1010101
xor eax, 0xdfac01fe
>>> print shellcraft.amd64.mov('ah', 'al').rstrip()
mov ah, al
>>> print shellcraft.amd64.mov('ah', 'r8').rstrip()
Traceback (most recent call last):
...
PwnlibException: The amd64 instruction set does not support moving from r8 to ah
>>> print shellcraft.amd64.mov('rax', 0x11dead00ff).rstrip()
mov rax, 0x101010101010101
push rax
mov rax, 0x1010110dfac01fe
xor [rsp], rax
pop rax
>>> with context.local(os = 'linux'):
... print shellcraft.amd64.mov('eax', 'SYS_read').rstrip()
xor eax, eax
>>> with context.local(os = 'freebsd'):
... print shellcraft.amd64.mov('eax', 'SYS_read').rstrip()
push 0x3
pop rax
>>> with context.local(os = 'linux'):
... print shellcraft.amd64.mov('eax', 'PROT_READ | PROT_WRITE | PROT_EXEC').rstrip()
push 0x7
pop rax
Args:
dest (str): The destination register.
src (str): Either the input register, or an immediate value.
stack_allowed (bool): Can the stack be used?
</%docstring>
<%
regs = [['rax', 'eax', 'ax', 'ah', 'al'],
['rbx', 'ebx', 'bx', 'bh', 'bl'],
['rcx', 'ecx', 'cx', 'ch', 'cl'],
['rdx', 'edx', 'dx', 'dh', 'dl'],
['rdi', 'edi', 'di', 'dil'],
['rsi', 'esi', 'si', 'sil'],
['rbp', 'ebp', 'bp', 'bpl'],
['rsp', 'esp', 'sp', 'spl'],
['r8', 'r8d', 'r8w', 'r8b'],
['r9', 'r9d', 'r9w', 'r9b'],
['r10', 'r10d', 'r10w', 'r10b'],
['r11', 'r11d', 'r11w', 'r11b'],
['r12', 'r12d', 'r12w', 'r12b'],
['r13', 'r13d', 'r13w', 'r13b'],
['r14', 'r14d', 'r14w', 'r14b'],
['r15', 'r15d', 'r15w', 'r15b']
]
def okay(s):
return '\0' not in s and '\n' not in s
def pretty(n):
if n < 0:
return str(n)
else:
return hex(n)
all_regs, sizes, bigger, smaller = misc.register_sizes(regs, [64, 32, 16, 8, 8])
if isinstance(src, (str, unicode)):
src = src.strip()
if src.lower() in all_regs:
src = src.lower()
else:
with ctx.local(arch = 'amd64'):
try:
src = constants.eval(src)
except:
log.error("Could not figure out the value of %r" % src)
dest_orig = dest
%>
% if dest not in all_regs:
<% log.error('%s is not a register' % str(dest_orig)) %>\
% elif isinstance(src, (int, long)):
<%
if not (-2 ** (sizes[dest]-1) <= src < 2**sizes[dest]):
log.error('Number %s does not fit into %s' % (pretty(src), dest_orig))
# Calculate the unsigned and signed versions
srcu = src & (2 ** sizes[dest] - 1)
srcs = srcu - 2 * (srcu & (2 ** (sizes[dest] - 1)))
# micro-optimization: if you ever touch e.g. eax, then all the upper bits
# of rax will be set to 0. We exploit this fact here
if 0 <= src < 2 ** 32 and sizes[dest] == 64:
dest = smaller[dest][0]
# Calculate the packed version
srcp = packing.pack(srcu, sizes[dest], 'little', False)
%>\
% if src == 0:
xor ${dest}, ${dest}
% elif src == 10 and stack_allowed and sizes[dest] == 32: # sizes[dest] == 64 not possible here
push 9
pop ${bigger[dest][0]}
inc ${dest}
% elif stack_allowed and sizes[dest] in [32, 64] and -2**7 <= srcs < 2**7 and okay(srcp[0]):
push ${pretty(srcs)}
pop ${dest if sizes[dest] == 64 else bigger[dest][0]}
% elif okay(srcp):
mov ${dest}, ${pretty(src)}
% elif stack_allowed and sizes[dest] in [32, 64] and -2**31 <= srcs < 2**31 and okay(srcp[:4]):
push ${pretty(srcs)}
pop ${dest if sizes[dest] == 64 else bigger[dest][0]}
% elif 0 <= srcu < 2**8 and okay(srcp[0]) and sizes[smaller[dest][-1]] == 8:
xor ${dest}, ${dest}
mov ${smaller[dest][-1]}, ${pretty(srcu)}
% elif srcu == srcu & 0xff00 and okay(srcp[1]) and sizes[smaller[dest][-2]] == 8:
xor ${dest}, ${dest}
mov ${smaller[dest][-2]}, ${pretty(srcu >> 8)}
% elif 0 <= srcu < 2**16 and okay(srcp[:2]) and sizes[smaller[dest][0]] == 16:
xor ${dest}, ${dest}
mov ${smaller[dest][0]}, ${pretty(src)}
% else:
<%
a,b = fiddling.xor_pair(srcp, avoid = '\x00\n')
a = pretty(packing.unpack(a, sizes[dest], 'little', False))
b = pretty(packing.unpack(b, sizes[dest], 'little', False))
%>\
% if sizes[dest] != 64:
mov ${dest}, ${a}
xor ${dest}, ${b}
% elif stack_allowed:
mov ${dest}, ${a}
push ${dest}
mov ${dest}, ${b}
xor [rsp], ${dest}
pop ${dest}
% else:
<% log.error("Cannot put %s into '%s' without using stack." % (pretty(src), dest_orig)) %>\
% endif
% endif
% elif src in all_regs:
<%
# micro-optimization: if you ever touch e.g. eax, then all the upper bits
# of rax will be set to 0. We exploit this fact here
if sizes[dest] == 64 and sizes[src] != 64:
dest = smaller[dest][0]
def rex_mode(reg):
# This returns a number with two bits
# The first bit is set, if the register can be used with a REX-mode
# The seond bit is set, if the register can be used without a REX-prefix
res = 0
if reg[-1] != 'h':
res |= 1
if reg[0] != 'r' and reg not in ['dil', 'sil', 'bpl', 'spl']:
res |= 2
return res
if rex_mode(src) & rex_mode(dest) == 0:
log.error('The amd64 instruction set does not support moving from %s to %s' % (src, dest))
%>\
% if src == dest or src in bigger[dest] or src in smaller[dest]:
/* moving ${src} into ${dest_orig}, but this is a no-op */
% elif sizes[dest] == sizes[src]:
mov ${dest}, ${src}
% elif sizes[dest] > sizes[src]:
movzx ${dest}, ${src}
% else:
% for r in reversed(smaller[src]):
% if sizes[r] == sizes[dest]:
mov ${dest}, ${r}
<% return %>\
% endif
% endfor
% endif
% else:
<% log.error('%s is neither a register nor an immediate' % src) %>\
% endif
|
data/maps/headers/CeladonMart3F.asm | opiter09/ASM-Machina | 1 | 26069 |
map_header CeladonMart3F, CELADON_MART_3F, LOBBY, 0
end_map_header
|
source/oasis/program-lexical_elements.ads | reznikmm/gela | 0 | 9102 | <filename>source/oasis/program-lexical_elements.ads
-- SPDX-FileCopyrightText: 2019-2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package Program.Lexical_Elements is
pragma Pure;
type Lexical_Element is limited interface;
type Lexical_Element_Access is
access all Lexical_Element'Class with Storage_Size => 0;
function Assigned (Self : access Lexical_Element'Class) return Boolean
is (Self /= null);
not overriding function Image (Self : Lexical_Element) return Text
is abstract;
-- Return text of the lexical element.
type Lexical_Element_Kind is
(Less, Equal, Greater, Hyphen, Slash,
Star, Ampersand, Plus,
Less_Or_Equal, Greater_Or_Equal, Inequality,
Double_Star,
Or_Keyword, And_Keyword, Xor_Keyword, Mod_Keyword, Rem_Keyword,
Abs_Keyword, Not_Keyword,
Right_Label,
Box, Left_Label,
Assignment, Arrow,
Double_Dot,
Apostrophe, Left_Parenthesis,
Right_Parenthesis,
Comma, Dot,
Colon, Semicolon,
Vertical_Line,
Abort_Keyword,
Abstract_Keyword, Accept_Keyword,
Access_Keyword, Aliased_Keyword, All_Keyword,
Array_Keyword, At_Keyword,
Begin_Keyword, Body_Keyword, Case_Keyword,
Constant_Keyword, Declare_Keyword, Delay_Keyword,
Delta_Keyword, Digits_Keyword, Do_Keyword,
Else_Keyword, Elsif_Keyword, End_Keyword,
Entry_Keyword, Exception_Keyword, Exit_Keyword,
For_Keyword, Function_Keyword, Generic_Keyword,
Goto_Keyword, If_Keyword, In_Keyword,
Interface_Keyword, Is_Keyword, Limited_Keyword,
Loop_Keyword, New_Keyword,
Null_Keyword, Of_Keyword,
Others_Keyword, Out_Keyword,
Overriding_Keyword, Package_Keyword, Pragma_Keyword,
Private_Keyword, Procedure_Keyword, Protected_Keyword,
Raise_Keyword, Range_Keyword, Record_Keyword,
Renames_Keyword, Requeue_Keyword,
Return_Keyword, Reverse_Keyword, Select_Keyword,
Separate_Keyword, Some_Keyword, Subtype_Keyword, Synchronized_Keyword,
Tagged_Keyword, Task_Keyword, Terminate_Keyword,
Then_Keyword, Type_Keyword, Until_Keyword,
Use_Keyword, When_Keyword, While_Keyword,
With_Keyword,
Comment, Identifier, Numeric_Literal,
Character_Literal, String_Literal,
Error, End_Of_Input);
subtype Operator_Kind is Lexical_Element_Kind range Less .. Not_Keyword;
subtype Keyword_Operator_Kind is Lexical_Element_Kind
range Or_Keyword .. Not_Keyword;
subtype Keyword_Kind is Lexical_Element_Kind
range Abort_Keyword .. With_Keyword;
not overriding function Kind (Self : Lexical_Element)
return Lexical_Element_Kind is abstract;
type Location is record
Line : Positive;
Column : Positive;
end record;
function "<" (Left, Right : Location) return Boolean with Inline;
function ">" (Left, Right : Location) return Boolean with Inline;
function "<=" (Left, Right : Location) return Boolean with Inline;
function ">=" (Left, Right : Location) return Boolean with Inline;
not overriding function From (Self : Lexical_Element) return Location
is abstract;
-- Line and column where the lexical element is located.
function From_Image (Self : Lexical_Element'Class) return Program.Text;
-- Line:column where the lexical element is located as a string.
type Lexical_Element_Vector is limited interface;
-- Vector of lexical elements.
type Lexical_Element_Vector_Access is
access all Lexical_Element_Vector'Class
with Storage_Size => 0;
not overriding function First_Index (Self : Lexical_Element_Vector)
return Positive is abstract;
not overriding function Last_Index (Self : Lexical_Element_Vector)
return Positive is abstract;
-- The vector always has at least one element.
function Length (Self : Lexical_Element_Vector'Class)
return Positive is (Self.Last_Index - Self.First_Index + 1);
-- Return number of elements in the vector
not overriding function Element
(Self : Lexical_Element_Vector;
Index : Positive)
return not null Lexical_Element_Access
is abstract
with Pre'Class => Index in Self.First_Index .. Self.Last_Index;
-- Return an element of the vector
function First
(Self : Lexical_Element_Vector'Class)
return not null Program.Lexical_Elements.Lexical_Element_Access
with Inline;
-- Get the first element of the vector
function Last
(Self : Lexical_Element_Vector'Class)
return not null Program.Lexical_Elements.Lexical_Element_Access
with Inline;
-- Get the last element of the vector
end Program.Lexical_Elements;
|
generated/natools-static_maps-web-fallback_render-commands.ads | faelys/natools-web | 1 | 3775 | <reponame>faelys/natools-web<gh_stars>1-10
package Natools.Static_Maps.Web.Fallback_Render.Commands is
pragma Pure;
function Hash (S : String) return Natural;
end Natools.Static_Maps.Web.Fallback_Render.Commands;
|
mp3/sched1.asm | Candy-Crusher/ece220 | 0 | 166483 | <filename>mp3/sched1.asm
.ORIG x4000
.FILL 16 ; values
.STRINGZ "samplelabel"
.FILL 3
.FILL 8 ; values
.STRINGZ "one"
.FILL 3
.FILL 6 ; values
.STRINGZ "two"
.FILL 3
.FILL 31 ; values
.STRINGZ "three"
.FILL 4
.FILL 1 ; values
.STRINGZ "four"
.FILL 3
.FILL 21 ; values
.STRINGZ "seven"
.FILL 6
.FILL 10 ; values
.STRINGZ "exactly"
.FILL 6
.FILL 16 ; values
.STRINGZ "exacty"
.FILL 10
.FILL 2 ; values
.STRINGZ "ok"
.FILL 1
.FILL -1
.END
|
programs/oeis/136/A136008.asm | neoneye/loda | 22 | 243345 | ; A136008: a(n) = n^6 - n^2.
; 0,0,60,720,4080,15600,46620,117600,262080,531360,999900,1771440,2985840,4826640,7529340,11390400,16776960,24137280,34011900,47045520,63999600,85765680,113379420,148035360,191102400,244140000,308915100,387419760,481889520,594822480,728999100,887502720,1073740800,1291466880,1544803260,1838264400,2176781040,2565725040,3010934940,3518742240,4095998400,4750102560,5489029980,6321361200,7256311920,8303763600,9474294780,10779213120,12230588160,13841284800,15624997500,17596285200,19770606960,22164358320,24794908380,27680637600,30840976320,34296444000,38068689180,42180530160,46655996400,51520370640,56800231740,62523498240,68719472640,75418886400,82653945660,90458377680,98867478000,107918158320,117648995100,128100278880,139314064320,151334220960,164206484700,177978510000,192699922800,208422374160,225199594620,243087449280,262143993600,282429529920,304006664700,326940366480,351298024560,377149508400,404567227740,433626193440,464404079040,496981283040,531440991900,567869243760,606354992880,646990174800,689869772220,735091881600,782757780480,832971995520,885842371260,941480139600
pow $0,2
mov $1,$0
pow $0,3
sub $0,$1
|
Transynther/x86/_processed/AVXALIGN/_zr_un_/i3-7100_9_0x84_notsx.log_21829_1225.asm | ljhsiun2/medusa | 9 | 178131 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_zr_un_/i3-7100_9_0x84_notsx.log_21829_1225.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x7e18, %rsi
lea addresses_UC_ht+0x19478, %rdi
clflush (%rsi)
nop
nop
nop
sub $18100, %rdx
mov $59, %rcx
rep movsl
and %r13, %r13
lea addresses_A_ht+0x1b818, %rbp
clflush (%rbp)
nop
nop
nop
and $201, %r14
mov $0x6162636465666768, %rcx
movq %rcx, (%rbp)
nop
nop
nop
add %rbp, %rbp
lea addresses_UC_ht+0x15658, %rsi
lea addresses_A_ht+0xa148, %rdi
nop
nop
nop
nop
lfence
mov $113, %rcx
rep movsq
nop
nop
nop
nop
nop
add $7843, %r11
lea addresses_A_ht+0x1a618, %rbp
nop
nop
sub $46372, %rdx
movw $0x6162, (%rbp)
nop
nop
cmp %rdi, %rdi
lea addresses_A_ht+0x13e18, %rsi
nop
nop
nop
dec %rdx
movl $0x61626364, (%rsi)
nop
nop
nop
nop
cmp $19317, %r14
lea addresses_UC_ht+0x9218, %r11
nop
nop
nop
nop
inc %rsi
movb $0x61, (%r11)
add $44975, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %r15
push %rdx
push %rsi
// Store
lea addresses_A+0x2518, %r11
nop
sub %r13, %r13
movl $0x51525354, (%r11)
nop
nop
nop
nop
nop
add %rsi, %rsi
// Store
lea addresses_WT+0x2258, %rdx
nop
nop
cmp %r13, %r13
mov $0x5152535455565758, %rsi
movq %rsi, %xmm4
vmovups %ymm4, (%rdx)
nop
nop
inc %rsi
// Store
lea addresses_A+0x1e6a8, %r10
nop
cmp $16351, %rdx
movw $0x5152, (%r10)
nop
sub %r14, %r14
// Store
lea addresses_WT+0x3618, %r13
clflush (%r13)
nop
nop
nop
nop
inc %r10
movw $0x5152, (%r13)
nop
nop
nop
nop
add $41019, %r15
// Store
lea addresses_WT+0x11f18, %rdx
xor %r13, %r13
movl $0x51525354, (%rdx)
nop
nop
nop
nop
nop
xor %r10, %r10
// Store
lea addresses_normal+0xe918, %r11
nop
nop
nop
nop
nop
xor %r14, %r14
movw $0x5152, (%r11)
nop
nop
nop
xor %r13, %r13
// Store
mov $0x3ab3bc0000000e18, %r13
nop
nop
nop
nop
nop
add %r11, %r11
mov $0x5152535455565758, %r15
movq %r15, %xmm0
vmovaps %ymm0, (%r13)
xor $38456, %rdx
// Faulty Load
lea addresses_UC+0x12a18, %rdx
nop
nop
xor $18714, %r10
vmovntdqa (%rdx), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r14
lea oracles, %rdx
and $0xff, %r14
shlq $12, %r14
mov (%rdx,%r14,1), %r14
pop %rsi
pop %rdx
pop %r15
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'04': 1, '80': 16269, '00': 5523, '08': 36}
04 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 00 80 80 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 00 80 80 00 80 80 80 80 80 80 00 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 00 80 00 80 00 00 80 80 80 80 80 80 80 00 80 80 00 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 80 00 80 00 00 80 80 80 00 80 80 80 00 80 80 80 80 00 80 00 80 80 80 80 80 80 80 80 80 80 00 00 80 00 80 80 80 00 00 00 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 00 80 80 80 80 00 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 80 80 00 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 00 80 00 80 80 80 80 80 80 80 80 00 80 00 80 80 00 00 80 80 80 80 00 80 80 80 80 00 80 80 80 00 80 80 80 80 80 00 80 00 80 80 00 80 80 80 00 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 80 80 00 80 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 00 00 00 80 00 00 00 80 80 80 00 80 80 80 00 80 80 80 80 80 80 00 80 80 00 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 80 00 80 00 80 80 80 80 80 80 80 80 80 80 80 00 00 80 80 80 80 80 00 80 00 80 80 80 80 80 00 80 80 80 80 80 00 80 80 80 80 00 80 00 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 00 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 00 00 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 80 00 80 80 00 00 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 08 00 00 80 80 80 80 00 80 80 80 00 80 80 00 80 80 80 80 80 80 80 80 00 00 80 80 00 80 80 00 80 80 80 80 00 00 80 80 80 80 80 00 80 80 80 80 80 80 00 00 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 00 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 00 80 80 00 00 80 80 80 80 80 80 00 00 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 00 80 80 00 80 80 80 00 80 80 80 00 80 00 80 80 80 00 00 80 80 00 00 80 80 00 00 80 80 00 80 00 80 00 80 80 80 00 80 00 80 00 00 80 00 80 00 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 00 00 80 80 00 80 80 80 80 00 80 00 00 00 80 80 80 80 80 80 00 80 80 80 80 00 80 80 80 80 80 80 00 00 80 80 80 00 80 80 00 80 80 00 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 00 80 00 00 80 80 80 80 80 00 80 80 80 80 00 80 80 00 80 80 80 80 80 00 00 80 80 80 80 00 80 00 80 80 80 80 80 80 80 80 00 80 00 80 00 00 80 00 80 80 80 80 80 00 00 80 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 00 00 80 80 80 00 00 80 80 80 80 00 80 80 80 80 80 80 00 80 80 80 00 80 80 80 00 80 80 80 00 80 80 80 80 80 80 00 80 00 80 80 80 80 00 80 00 80 00 80 80 00 80 00 00 00 80 00 80 80 80 80 80 80 80 80 80 80 00 80 80 80 80 80 80 80 80 80 80 80 80 80 00 80 80 80 00 00 80 00 80 80 80 00 80 00 80 80 80 80 00 80 80 00 80 80 80 00 80 80 80 80 80 00 00 80 00 80 00 00 80 80 80 80 00 80 00 80 80 80 80 80 80 80 80 00 00 80 80 80 80 00 80 80 80 00 80 80
*/
|
programs/oeis/006/A006454.asm | karttu/loda | 1 | 169048 | ; A006454: Solution to a Diophantine equation: each term is a triangular number and each term + 1 is a square.
; 0,3,15,120,528,4095,17955,139128,609960,4726275,20720703,160554240,703893960,5454117903,23911673955,185279454480,812293020528,6294047334435,27594051024015,213812329916328,937385441796000,7263325169820735,31843510970040003
cal $0,77447 ; Numbers n such that (n^2 - 14)/2 is a square.
pow $0,2
mov $1,$0
div $1,48
mul $1,3
|
source/web/servlet/http/servlet-http_requests.ads | svn2github/matreshka | 24 | 10257 | <reponame>svn2github/matreshka
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014-2018, <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$
------------------------------------------------------------------------------
-- Extends the ServletRequest interface to provide request information for
-- HTTP servlets.
--
-- The servlet container creates an HttpServletRequest object and passes it as
-- an argument to the servlet's service methods (doGet, doPost, etc).
------------------------------------------------------------------------------
with League.IRIs;
with League.String_Vectors;
with League.Strings;
with Servlet.HTTP_Cookie_Sets;
with Servlet.HTTP_Parameters;
with Servlet.HTTP_Parameter_Vectors;
with Servlet.HTTP_Sessions;
with Servlet.HTTP_Upgrade_Handlers;
with Servlet.Requests;
package Servlet.HTTP_Requests is
pragma Preelaborate;
type HTTP_Method is
(Options, Get, Head, Post, Put, Delete, Trace, Connect);
type HTTP_Servlet_Request is limited interface
and Servlet.Requests.Servlet_Request;
not overriding function Change_Session_Id
(Self : HTTP_Servlet_Request)
return League.Strings.Universal_String is abstract;
procedure Change_Session_Id (Self : HTTP_Servlet_Request'Class);
-- Change the session id of the current session associated with this
-- request and return the new session id.
--
-- Raises Program_Error if there is no session associates with the request.
not overriding function Get_Context_Path
(Self : HTTP_Servlet_Request)
return League.String_Vectors.Universal_String_Vector is abstract;
function Get_Context_Path
(Self : HTTP_Servlet_Request'Class) return League.Strings.Universal_String;
-- Returns the portion of the request URI that indicates the context of the
-- request. The context path always comes first in a request URI. The path
-- starts with a "/" character but does not end with a "/" character. For
-- servlets in the default (root) context, this method returns "". The
-- container does not decode this string.
--
-- It is possible that a servlet container may match a context by more than
-- one context path. In such cases this method will return the actual
-- context path used by the request and it may differ from the path
-- returned by the ServletContext.getContextPath() method. The context path
-- returned by ServletContext.getContextPath() should be considered as the
-- prime or preferred context path of the application.
not overriding function Get_Cookies
(Self : HTTP_Servlet_Request)
return Servlet.HTTP_Cookie_Sets.Cookie_Set is abstract;
-- Returns an array containing all of the Cookie objects the client sent
-- with this request. This method returns null if no cookies were sent.
not overriding function Get_Headers
(Self : HTTP_Servlet_Request;
Name : League.Strings.Universal_String)
return League.String_Vectors.Universal_String_Vector is abstract;
-- Returns all the values of the specified request header as an Enumeration
-- of String objects.
--
-- Some headers, such as Accept-Language can be sent by clients as several
-- headers each with a different value rather than sending the header as a
-- comma separated list.
--
-- If the request did not include any headers of the specified name, this
-- method returns an empty Enumeration. The header name is case
-- insensitive. You can use this method with any request header.
not overriding function Get_Method
(Self : HTTP_Servlet_Request) return HTTP_Method is abstract;
-- Returns the name of the HTTP method with which this request was made,
-- for example, GET, POST, or PUT. Same as the value of the CGI variable
-- REQUEST_METHOD.
function Get_Parameter
(Self : HTTP_Servlet_Request'Class;
Name : League.Strings.Universal_String)
return Servlet.HTTP_Parameters.HTTP_Parameter;
-- Gets the Parameters with the given name.
not overriding function Get_Parameter_Values
(Self : HTTP_Servlet_Request;
Name : League.Strings.Universal_String)
return Servlet.HTTP_Parameter_Vectors.HTTP_Parameter_Vector is abstract;
-- Gets the Parameters with the given name.
not overriding function Get_Path_Info
(Self : HTTP_Servlet_Request)
return League.String_Vectors.Universal_String_Vector is abstract;
function Get_Path_Info
(Self : HTTP_Servlet_Request'Class) return League.Strings.Universal_String;
-- Returns any extra path information associated with the URL the client
-- sent when it made this request. The extra path information follows the
-- servlet path but precedes the query string and will start with a "/"
-- character.
--
-- This method returns null if there was no extra path information.
--
-- Same as the value of the CGI variable PATH_INFO.
not overriding function Get_Request_URL
(Self : HTTP_Servlet_Request) return League.IRIs.IRI is abstract;
-- Returns the URL the client used to make the request. The returned URL
-- contains a protocol, server name, port number, and server path, but it
-- does not include query string parameters.
--
-- If this request has been forwarded using RequestDispatcher.forward
-- (ServletRequest, ServletResponse), the server path in the reconstructed
-- URL must reflect the path used to obtain the RequestDispatcher, and not
-- the server path specified by the client.
--
-- This method is useful for creating redirect messages and for reporting errors.
not overriding function Get_Requested_Session_Id
(Self : HTTP_Servlet_Request)
return League.Strings.Universal_String is abstract;
-- Returns the session ID specified by the client. This may not be the same
-- as the ID of the current valid session for this request. If the client
-- did not specify a session ID, this method returns null.
not overriding function Get_Servlet_Path
(Self : HTTP_Servlet_Request)
return League.String_Vectors.Universal_String_Vector is abstract;
function Get_Servlet_Path
(Self : HTTP_Servlet_Request'Class) return League.Strings.Universal_String;
-- Returns the part of this request's URL that calls the servlet. This path
-- starts with a "/" character and includes either the servlet name or a
-- path to the servlet, but does not include any extra path information or
-- a query string. Same as the value of the CGI variable SCRIPT_NAME.
--
-- This method will return an empty string ("") if the servlet used to
-- process this request was matched using the "/*" pattern.
not overriding function Get_Session
(Self : HTTP_Servlet_Request;
Create : Boolean := True)
return access Servlet.HTTP_Sessions.HTTP_Session'Class is abstract;
-- Returns the current HttpSession associated with this request or, if
-- there is no current session and create is true, returns a new session.
--
-- If create is false and the request has no valid HttpSession, this method
-- returns null.
--
-- To make sure the session is properly maintained, you must call this
-- method before the response is committed. If the container is using
-- cookies to maintain session integrity and is asked to create a new
-- session when the response is committed, an IllegalStateException is
-- thrown.
not overriding function Is_Requested_Session_Id_Valid
(Self : HTTP_Servlet_Request) return Boolean is abstract;
-- Checks whether the requested session ID is still valid.
--
-- If the client did not specify any session ID, this method returns false.
not overriding procedure Upgrade
(Self : HTTP_Servlet_Request;
Handler :
not null Servlet.HTTP_Upgrade_Handlers.HTTP_Upgrade_Handler_Access)
is abstract;
-- Uses given upgrade handler for the http protocol upgrade processing.
end Servlet.HTTP_Requests;
|
data/mapHeaders/PewterPokecenter.asm | AmateurPanda92/pokemon-rby-dx | 9 | 173055 | <filename>data/mapHeaders/PewterPokecenter.asm
PewterPokecenter_h:
db POKECENTER ; tileset
db PEWTER_POKECENTER_HEIGHT, PEWTER_POKECENTER_WIDTH ; dimensions (y, x)
dw PewterPokecenter_Blocks ; blocks
dw PewterPokecenter_TextPointers ; texts
dw PewterPokecenter_Script ; scripts
db 0 ; connections
dw PewterPokecenter_Object ; objects
|
oeis/269/A269907.asm | neoneye/loda-programs | 11 | 100027 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A269907: Number of active (ON,black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 1", based on the 5-celled von Neumann neighborhood.
; Submitted by <NAME>(s2.)
; 1,4,44,220,956,3964,16124,65020,261116,1046524,4190204,16769020,67092476,268402684,1073676284,4294836220
mov $1,2
pow $1,$0
bin $1,2
mul $1,8
trn $1,5
add $1,1
mov $0,$1
|
java/src/main/antlr4/io/rapidpro/expressions/Excellent.g4 | greatnonprofits-nfp/ccl-expressions | 1 | 7896 | grammar Excellent;
COMMA : ',';
LPAREN : '(';
RPAREN : ')';
PLUS : '+';
MINUS : '-';
TIMES : '*';
DIVIDE : '/';
EXPONENT : '^';
EQ : '=';
NEQ : '<>';
LTE : '<=';
LT : '<';
GTE : '>=';
GT : '>';
AMPERSAND : '&';
DECIMAL : [0-9]+('.'[0-9]+)?;
STRING : '"' (~["] | '""')* '"';
TRUE : [Tt][Rr][Uu][Ee];
FALSE : [Ff][Aa][Ll][Ss][Ee];
NAME : [a-zA-Z][a-zA-Z0-9_\.]*; // variable names, e.g. contact.name or function names, e.g. SUM
WS : [ \t\n\r]+ -> skip; // ignore whitespace
ERROR : . ;
parse : expression EOF;
expression : fnname LPAREN parameters? RPAREN # functionCall
| MINUS expression # negation
| expression EXPONENT expression # exponentExpression
| expression (TIMES | DIVIDE) expression # multiplicationOrDivisionExpression
| expression (PLUS | MINUS) expression # additionOrSubtractionExpression
| expression (LTE | LT | GTE | GT) expression # comparisonExpression
| expression (EQ | NEQ) expression # equalityExpression
| expression AMPERSAND expression # concatenation
| STRING # stringLiteral
| DECIMAL # decimalLiteral
| TRUE # true
| FALSE # false
| NAME # contextReference
| LPAREN expression RPAREN # parentheses
;
fnname : NAME
| TRUE
| FALSE
;
parameters : expression (COMMA expression)* # functionParameters
;
|
issues/Issue81/Definition07d.agda | asr/apia | 10 | 15360 | ------------------------------------------------------------------------------
-- Testing the translation of definitions
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module Definition07d where
infixl 6 _+_
infix 4 _≡_
postulate
D : Set
zero : D
succ : D → D
_≡_ : D → D → Set
data N : D → Set where
nzero : N zero
nsucc : ∀ {n} → N n → N (succ n)
N-ind : (A : D → Set) →
A zero →
(∀ {n} → A n → A (succ n)) →
∀ {n} → N n → A n
N-ind A A0 h nzero = A0
N-ind A A0 h (nsucc Nn) = h (N-ind A A0 h Nn)
postulate
_+_ : D → D → D
+-0x : ∀ n → zero + n ≡ n
+-Sx : ∀ m n → succ m + n ≡ succ (m + n)
{-# ATP axioms +-0x +-Sx #-}
-- We test the translation of a definition where we need to erase
-- proof terms.
+-rightIdentity : ∀ {n} → N n → n + zero ≡ n
+-rightIdentity Nn = N-ind A A0 is Nn
where
A : D → Set
A i = i + zero ≡ i
{-# ATP definition A #-}
postulate A0 : A zero
{-# ATP prove A0 #-}
postulate is : ∀ {i} → A i → A (succ i)
{-# ATP prove is #-}
|
programs/oeis/168/A168224.asm | karttu/loda | 0 | 82713 | <gh_stars>0
; A168224: Where record values occur in A168223.
; 0,5,7,11,17,19,23,29,31,35,41,43,47,53,55,59,65,67,71,77,79,83,89,91,95,101,103,107,113,115,119,125,127,131,137,139,143,149,151,155,161,163,167,173,175,179,185,187,191,197,199,203,209,211,215,221,223,227,233
mov $2,2
mov $4,$0
cmp $0,6
add $0,1
sub $4,1
mov $1,$4
mul $2,$4
mov $3,-4
add $3,$0
mov $0,$2
add $0,2
gcd $1,$3
add $1,$2
mov $2,$1
lpb $2,1
add $0,1
sub $2,1
lpe
mov $1,$0
|
legend-pure-m3-core/src/main/antlr4/org/finos/legend/pure/m3/serialization/grammar/m3parser/antlr/M3Parser.g4 | msbg/legend-pure | 1 | 4364 | parser grammar M3Parser;
options
{
tokenVocab = M3Lexer;
}
definition: imports
(
profile
| classDefinition
| association
| enumDefinition
| nativeFunction
| functionDefinition
| instance
| measureDefinition
)*
EOF
;
imports: import_statement*
;
import_statement: IMPORT packagePath STAR END_LINE
;
classDefinition: CLASS stereotypes? taggedValues? qualifiedName typeParametersWithContravarianceAndMultiplicityParameters?
(
(
PROJECTS projection
)
|
(
( EXTENDS type (COMMA type)* )?
constraints?
classBody
)
)
;
measureDefinition: MEASURE qualifiedName
measureBody
;
measureBody: CURLY_BRACKET_OPEN
(
(
measureExpr* canonicalExpr measureExpr*
)
|
nonConvertibleMeasureExpr+
)
CURLY_BRACKET_CLOSE
;
canonicalExpr: STAR measureExpr
;
measureExpr: qualifiedName COLON unitExpr
;
nonConvertibleMeasureExpr : qualifiedName END_LINE
;
unitExpr: identifier ARROW codeBlock
;
mapping : (MAPPING_SRC qualifiedName)? (MAPPING_FILTER combinedExpression)? mappingLine (COMMA mappingLine)*
;
mappingLine: ((PLUS qualifiedName COLON type multiplicity) | qualifiedName (sourceAndTargetMappingId)?) STAR? COLON (ENUMERATION_MAPPING identifier COLON)? combinedExpression
;
sourceAndTargetMappingId: BRACKET_OPEN sourceId (COMMA targetId)? BRACKET_CLOSE
;
sourceId: qualifiedName
;
targetId: qualifiedName
;
classBody: CURLY_BRACKET_OPEN
properties
CURLY_BRACKET_CLOSE
;
properties: ( property | qualifiedProperty )*
;
property: stereotypes? taggedValues? aggregation? identifier COLON propertyReturnType END_LINE
;
qualifiedProperty: stereotypes? taggedValues? identifier qualifiedPropertyBody COLON propertyReturnType END_LINE
;
qualifiedPropertyBody:
GROUP_OPEN
(functionVariableExpression (COMMA functionVariableExpression)*)?
GROUP_CLOSE
CURLY_BRACKET_OPEN
codeBlock
CURLY_BRACKET_CLOSE
;
association: ASSOCIATION stereotypes? taggedValues? qualifiedName (associationProjection | associationBody)
;
associationBody:
CURLY_BRACKET_OPEN
properties
CURLY_BRACKET_CLOSE
;
associationProjection: PROJECTS qualifiedName LESSTHAN qualifiedName COMMA qualifiedName GREATERTHAN
;
enumDefinition: ENUM stereotypes? taggedValues? qualifiedName
CURLY_BRACKET_OPEN
enumValue (COMMA enumValue)*
CURLY_BRACKET_CLOSE
;
enumValue: stereotypes? taggedValues? identifier
;
nativeFunction: NATIVE FUNCTION qualifiedName typeAndMultiplicityParameters? functionTypeSignature END_LINE
;
functionTypeSignature: GROUP_OPEN (functionVariableExpression (COMMA functionVariableExpression)*)? GROUP_CLOSE COLON type multiplicity
;
functionDefinition: FUNCTION stereotypes? taggedValues? qualifiedName typeAndMultiplicityParameters? functionTypeSignature
constraints?
CURLY_BRACKET_OPEN
codeBlock
CURLY_BRACKET_CLOSE
;
expression:
(
(
sliceExpression
|
atomicExpression
|
notExpression
|
signedExpression
|
expressionsArray
)
(
(
propertyOrFunctionExpression
)*
(equalNotEqual)?
)
)
|
( GROUP_OPEN combinedExpression GROUP_CLOSE )
;
instanceBlock: BRACKET_OPEN (instance (COMMA instance)* )? BRACKET_CLOSE
;
instance: NEW_SYMBOL qualifiedName (LESSTHAN typeArguments? (PIPE multiplicityArguments)? GREATERTHAN)? identifier?
(FILE_NAME COLON INTEGER COMMA INTEGER COMMA INTEGER COMMA INTEGER COMMA INTEGER COMMA INTEGER FILE_NAME_END)? (AT qualifiedName)?
GROUP_OPEN
(instancePropertyAssignment (COMMA instancePropertyAssignment)*)?
GROUP_CLOSE
;
unitInstance: unitInstanceLiteral unitName
;
unitName: qualifiedName TILDE identifier
;
instancePropertyAssignment: identifier EQUAL instanceRightSide
;
instanceRightSide: instanceAtomicRightSideScalar | instanceAtomicRightSideVector
;
instanceAtomicRightSideScalar: instanceAtomicRightSide
;
instanceAtomicRightSideVector: BRACKET_OPEN (instanceAtomicRightSide (COMMA instanceAtomicRightSide)* )? BRACKET_CLOSE
;
instanceAtomicRightSide: instanceLiteral | LATEST_DATE | instance | qualifiedName | enumReference | stereotypeReference | tagReference | identifier
;
enumReference: qualifiedName DOT identifier
;
stereotypeReference: qualifiedName AT identifier
;
tagReference: qualifiedName PERCENT identifier
;
propertyReturnType: type multiplicity
;
stereotypes: LESSTHAN LESSTHAN stereotype (COMMA stereotype)* GREATERTHAN GREATERTHAN
;
stereotype: qualifiedName DOT identifier
;
taggedValues: CURLY_BRACKET_OPEN taggedValue (COMMA taggedValue)* CURLY_BRACKET_CLOSE
;
taggedValue: qualifiedName DOT identifier EQUAL STRING
;
profile: PROFILE qualifiedName
CURLY_BRACKET_OPEN
stereotypeDefinitions?
tagDefinitions?
CURLY_BRACKET_CLOSE
;
stereotypeDefinitions: (STEREOTYPES COLON BRACKET_OPEN identifier (COMMA identifier)* BRACKET_CLOSE END_LINE)
;
tagDefinitions: (TAGS COLON BRACKET_OPEN identifier (COMMA identifier)* BRACKET_CLOSE END_LINE)
;
codeBlock: programLine (END_LINE (programLine END_LINE)*)?
;
programLine: combinedExpression | letExpression
;
equalNotEqual: (TEST_EQUAL | TEST_NOT_EQUAL ) combinedArithmeticOnly
;
combinedArithmeticOnly: expressionOrExpressionGroup arithmeticPart*
;
expressionPart: booleanPart | arithmeticPart
;
letExpression: LET identifier EQUAL combinedExpression
;
combinedExpression: expressionOrExpressionGroup expressionPart*
;
expressionOrExpressionGroup: expression
;
expressionsArray: BRACKET_OPEN ( expression (COMMA expression)* )? BRACKET_CLOSE
;
propertyOrFunctionExpression: propertyExpression | functionExpression;
propertyExpression: DOT identifier (functionExpressionLatestMilestoningDateParameter | functionExpressionParameters)?
;
functionExpression: ARROW qualifiedName functionExpressionParameters (ARROW qualifiedName functionExpressionParameters)*
;
functionExpressionLatestMilestoningDateParameter: GROUP_OPEN LATEST_DATE (COMMA LATEST_DATE)? GROUP_CLOSE
;
functionExpressionParameters: GROUP_OPEN (combinedExpression (COMMA combinedExpression)*)? GROUP_CLOSE
;
atomicExpression:
dsl
| instanceLiteralToken
| expressionInstance
| unitInstance
| variable
| (AT type)
| lambdaPipe
| lambdaFunction
| instanceReference
| (lambdaParam lambdaPipe)
;
instanceReference: (PATH_SEPARATOR | qualifiedName | unitName) allOrFunction?
;
lambdaFunction: CURLY_BRACKET_OPEN (lambdaParam (COMMA lambdaParam)* )? lambdaPipe CURLY_BRACKET_CLOSE
;
variable: DOLLAR identifier
;
allOrFunction: allFunction
| allVersionsFunction
| allVersionsInRangeFunction
| allFunctionWithMilestoning
| functionExpressionParameters
;
allFunction: DOT ALL GROUP_OPEN GROUP_CLOSE
;
allVersionsFunction: DOT ALL_VERSIONS GROUP_OPEN GROUP_CLOSE
;
allVersionsInRangeFunction: DOT ALL_VERSIONS_IN_RANGE GROUP_OPEN buildMilestoningVariableExpression COMMA buildMilestoningVariableExpression GROUP_CLOSE
;
allFunctionWithMilestoning: DOT ALL GROUP_OPEN buildMilestoningVariableExpression (COMMA buildMilestoningVariableExpression)? GROUP_CLOSE
;
buildMilestoningVariableExpression: LATEST_DATE | DATE | variable
;
expressionInstance: NEW_SYMBOL (variable | qualifiedName)
(LESSTHAN typeArguments? (PIPE multiplicityArguments)? GREATERTHAN)? (identifier)?
GROUP_OPEN
expressionInstanceParserPropertyAssignment? (COMMA expressionInstanceParserPropertyAssignment)*
GROUP_CLOSE
;
expressionInstanceRightSide: expressionInstanceAtomicRightSide
;
expressionInstanceAtomicRightSide: combinedExpression | expressionInstance | qualifiedName
;
expressionInstanceParserPropertyAssignment: identifier (DOT identifier)* PLUS? EQUAL expressionInstanceRightSide
;
sliceExpression: BRACKET_OPEN ( (COLON expression) | (expression COLON expression) | (expression COLON expression COLON expression) ) BRACKET_CLOSE
;
constraints: BRACKET_OPEN constraint (COMMA constraint)* BRACKET_CLOSE
;
constraint: simpleConstraint | complexConstraint
;
simpleConstraint: constraintId? combinedExpression
;
complexConstraint: VALID_STRING
GROUP_OPEN
constraintOwner?
constraintExternalId?
constraintFunction
constraintEnforcementLevel?
constraintMessage?
GROUP_CLOSE
;
constraintOwner: CONSTRAINT_OWNER COLON VALID_STRING
;
constraintExternalId: CONSTRAINT_EXTERNAL_ID COLON STRING
;
constraintFunction: CONSTRAINT_FUNCTION COLON combinedExpression
;
constraintEnforcementLevel: CONSTRAINT_ENFORCEMENT COLON ENFORCEMENT_LEVEL
;
constraintMessage: CONSTRAINT_MESSAGE COLON combinedExpression
;
constraintId : VALID_STRING COLON
;
notExpression: NOT expression
;
signedExpression: (MINUS | PLUS) expression
;
lambdaPipe: PIPE codeBlock
;
lambdaParam: identifier lambdaParamType?
;
lambdaParamType: COLON type multiplicity
;
instanceLiteral: instanceLiteralToken | (MINUS INTEGER) | (MINUS FLOAT) | (MINUS DECIMAL) | (PLUS INTEGER) | (PLUS FLOAT) | (PLUS DECIMAL)
;
instanceLiteralToken: STRING | INTEGER | FLOAT | DECIMAL | DATE | BOOLEAN
;
unitInstanceLiteral: (MINUS? INTEGER) | (MINUS? FLOAT) | (MINUS? DECIMAL) | (PLUS INTEGER) | (PLUS FLOAT) | (PLUS DECIMAL)
;
arithmeticPart: PLUS expression (PLUS expression)*
| (STAR expression (STAR expression)*)
| (MINUS expression (MINUS expression)*)
| (DIVIDE expression (DIVIDE expression)*)
| (LESSTHAN expression)
| (LESSTHANEQUAL expression)
| (GREATERTHAN expression)
| (GREATERTHANEQUAL expression)
;
booleanPart: AND expression
| (OR expression )
| equalNotEqual
;
functionVariableExpression: identifier COLON type multiplicity
;
qualifiedName: packagePath? identifier
;
packagePath: (identifier PATH_SEPARATOR)+
;
type: ( qualifiedName (LESSTHAN typeArguments? (PIPE multiplicityArguments)? GREATERTHAN)? )
|
(
CURLY_BRACKET_OPEN
functionTypePureType? (COMMA functionTypePureType)*
ARROW type multiplicity
CURLY_BRACKET_CLOSE
)
|
unitName
;
multiplicity: BRACKET_OPEN multiplicityArgument BRACKET_CLOSE
;
fromMultiplicity: INTEGER;
toMultiplicity: INTEGER | STAR;
projection: dsl | treePath
;
functionTypePureType: type multiplicity
;
typeAndMultiplicityParameters: LESSTHAN ((typeParameters multiplictyParameters?) | multiplictyParameters) GREATERTHAN
;
typeParametersWithContravarianceAndMultiplicityParameters: LESSTHAN ((contravarianceTypeParameters multiplictyParameters?) | multiplictyParameters) GREATERTHAN
;
typeParameters: typeParameter (COMMA typeParameter)*
;
typeParameter: identifier
;
contravarianceTypeParameters: contravarianceTypeParameter (COMMA contravarianceTypeParameter)*
;
contravarianceTypeParameter: MINUS? identifier
;
multiplicityArguments: multiplicityArgument (COMMA multiplicityArgument)*
;
multiplicityArgument: identifier | ((fromMultiplicity DOTDOT)? toMultiplicity)
;
typeArguments: type (COMMA type)*
;
multiplictyParameters: PIPE identifier (COMMA identifier)*
;
identifier: VALID_STRING | CLASS | FUNCTION | PROFILE | ASSOCIATION | ENUM | MEASURE | STEREOTYPES | TAGS | IMPORT | LET | AGGREGATION_TYPE | PATH_SEPARATOR | AS | ALL | PROJECTS | ENFORCEMENT_LEVEL | ENUMERATION_MAPPING
;
dsl: DSL_TEXT
;
aggregation: GROUP_OPEN AGGREGATION_TYPE GROUP_CLOSE
;
aggregateSpecification: CAN_AGGREGATE BOOLEAN COMMA
GROUP_BY_FUNCTIONS GROUP_OPEN
groupByFunctionSpecifications?
GROUP_CLOSE
COMMA
AGGREGATE_VALUES GROUP_OPEN
aggregationFunctionSpecifications?
GROUP_CLOSE
;
groupByFunctionSpecifications: groupByFunctionSpecification (COMMA groupByFunctionSpecification)*
;
groupByFunctionSpecification: combinedExpression
;
aggregationFunctionSpecifications: aggregationFunctionSpecification (COMMA aggregationFunctionSpecification)*
;
aggregationFunctionSpecification: GROUP_OPEN
MAP_FN COLON combinedExpression COMMA AGGREGATE_FN COLON combinedExpression
GROUP_CLOSE
;
//tree stuff
treePath: type alias? stereotypes? taggedValues?
treePathClassBody
;
treePathClassBody:
CURLY_BRACKET_OPEN
simplePropertyFilter?
(derivedProperty | complexProperty)*
CURLY_BRACKET_CLOSE
;
alias : AS identifier;
simplePropertyFilter: STAR | ((PLUS | MINUS) (BRACKET_OPEN simpleProperty (COMMA simpleProperty)* BRACKET_CLOSE))
;
simpleProperty: propertyRef stereotypes? taggedValues?
;
complexProperty: propertyRef alias? stereotypes? taggedValues? treePathClassBody?
;
derivedProperty: GREATERTHAN propertyRef BRACKET_OPEN codeBlock BRACKET_CLOSE alias? stereotypes? taggedValues? treePathClassBody?
;
propertyRef: identifier (GROUP_OPEN (treePathPropertyParameterType (COMMA treePathPropertyParameterType)*)? GROUP_CLOSE)*
;
treePathPropertyParameterType: type multiplicity
;
//end tree stuff
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_5_230.asm | ljhsiun2/medusa | 9 | 105566 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %rbp
push %rcx
push %rdi
lea addresses_WT_ht+0x1cc8, %rcx
nop
cmp %r14, %r14
movb $0x61, (%rcx)
nop
sub %rdi, %rdi
lea addresses_normal_ht+0x5584, %rcx
xor %r14, %r14
movw $0x6162, (%rcx)
add $50193, %r11
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r9
push %rbp
push %rbx
push %rsi
// Store
mov $0x12b230000000078, %rsi
xor %rbp, %rbp
movw $0x5152, (%rsi)
nop
nop
cmp $54003, %rbp
// Store
lea addresses_PSE+0xde08, %r13
nop
sub $53224, %rbx
movl $0x51525354, (%r13)
nop
nop
nop
add %rsi, %rsi
// Load
lea addresses_WC+0x1c2c8, %rbx
sub $4176, %r15
vmovntdqa (%rbx), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r9
nop
nop
and $19433, %r12
// Store
lea addresses_UC+0xa788, %r12
nop
nop
nop
nop
cmp $1595, %rbx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm2
and $0xffffffffffffffc0, %r12
movntdq %xmm2, (%r12)
inc %r9
// Load
lea addresses_normal+0x5148, %r12
nop
xor $16663, %r9
movups (%r12), %xmm7
vpextrq $0, %xmm7, %rbx
nop
add $7100, %rsi
// Store
lea addresses_UC+0x4048, %r9
nop
nop
nop
nop
nop
inc %rsi
movw $0x5152, (%r9)
nop
cmp $32220, %r13
// Faulty Load
lea addresses_normal+0x3448, %rsi
cmp $42707, %r12
movups (%rsi), %xmm3
vpextrq $0, %xmm3, %rbp
lea oracles, %r13
and $0xff, %rbp
shlq $12, %rbp
mov (%r13,%rbp,1), %rbp
pop %rsi
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 5, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': True, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'34': 5}
34 34 34 34 34
*/
|
software/driver/px4io-protocol.ads | TUM-EI-RCS/StratoX | 12 | 1171 | --***************************************************************************
--
-- Copyright (c)2_0122_014 PX4 Development Team. All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
--
-- 1. Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- 2. Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in
-- the documentation and/or other materials provided with the
-- distribution.
-- 3. Neither the name PX4 nor the names of its contributors may be
-- used to endorse or promote products derived from this software
-- without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-- OF USE, DATA, PROFITS : OR; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-- AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
--**************************************************************************
with Interfaces; use Interfaces;
with HIL; use HIL;
package PX4IO.Protocol with SPARK_Mode is
--*
-- @file protocol.h
--
-- PX4IO interface protocol.
--
-- Communication is performed via writes to and reads from 16-bit virtual
-- registers organised into pages of 255 registers each.
--
-- The first two bytes of each write select a page and offset address
-- respectively. Subsequent reads and writes increment the offset within
-- the page.
--
-- Some pages are read- or write-only.
--
-- Note that some pages may permit offset values greater than 255, which
-- can only be achieved by long writes. The offset does not wrap.
--
-- Writes to unimplemented registers are ignored. Reads from unimplemented
-- registers return undefined values.
--
-- As convention, values that would be floating point in other parts of
-- the PX4 system are expressed as signed integer values scaled by10_000,
-- e.g. control values range from 10_000..10000. Use the REG_TO_SIGNED and
-- SIGNED_TO_REG macros to convert between register representation and
-- the signed version, and REG_TO_FLOAT/FLOAT_TO_REG to convert to Float.
--
-- Note that the implementation of readable pages prefers registers within
-- readable pages to be densely packed. Page numbers do not need to be
-- packed.
--
-- Definitions marked [1] are only valid on PX4IOv1 boards. Likewise,
-- [2] denotes definitions specific to the PX4IOv2 board.
--
-- Per C, this is safe for all 2's complement systems
-- REG_TO_SIGNED : constant := (reg) (Integer_16(reg));
-- SIGNED_TO_REG : constant := (signed) (Unsigned_16(signed));
--
-- REG_TO_FLOAT : constant := (reg) (FloatREG_TO_SIGNED(reg) /10_000.0f);
-- FLOAT_TO_REG : constant := Float SIGNED_TO_REG(Integer_16(Float *10_000.0f));
type Page_Type is new Unsigned_8;
type Offset_Type is new Unsigned_8;
subtype Bit_Mask_Type is HIL.Unsigned_16_Mask;
--subtype Value_Type is HIL.Byte;
PX4IO_PROTOCOL_VERSION : constant := 4;
-- maximum allowable sizes on this protocol version
PX4IO_PROTOCOL_MAX_CONTROL_COUNT : constant := 8;
-- The protocol does not support more than set here, individual units might support less - see PX4IO_P_CONFIG_CONTROL_COUNT
-- static configuration page
PX4IO_PAGE_CONFIG : constant := 0;
PX4IO_P_CONFIG_PROTOCOL_VERSION : constant := 0; -- PX4IO_PROTOCOL_VERSION
PX4IO_P_CONFIG_HARDWARE_VERSION : constant := 1; -- magic numbers TBD
PX4IO_P_CONFIG_BOOTLOADER_VERSION : constant := 2; -- get this how?
PX4IO_P_CONFIG_MAX_TRANSFER : constant := 3; -- maximum I2C transfer size
PX4IO_P_CONFIG_CONTROL_COUNT : constant := 4; -- hardcoded max control count supported
PX4IO_P_CONFIG_ACTUATOR_COUNT : constant := 5; -- hardcoded max actuator output count
PX4IO_P_CONFIG_RC_INPUT_COUNT : constant := 6; -- hardcoded max R/C input count supported
PX4IO_P_CONFIG_ADC_INPUT_COUNT : constant := 7; -- hardcoded max ADC inputs
PX4IO_P_CONFIG_RELAY_COUNT : constant := 8; -- hardcoded # of relay outputs
-- dynamic status page
PX4IO_PAGE_STATUS : constant := 1;
PX4IO_P_STATUS_FREEMEM : constant := 0;
PX4IO_P_STATUS_CPULOAD : constant := 1;
PX4IO_P_STATUS_FLAGS : constant := 2 ;-- monitoring flags
PX4IO_P_STATUS_FLAGS_OUTPUTS_ARMED : constant Bit_Mask_Type := (Shift_Left(1, 0)) ;-- arm-ok and locally armed
PX4IO_P_STATUS_FLAGS_OVERRIDE : constant Bit_Mask_Type := (Shift_Left(1, 1)) ;-- in manual override
PX4IO_P_STATUS_FLAGS_RC_OK : constant Bit_Mask_Type := (Shift_Left(1, 2)) ;-- RC input is valid
PX4IO_P_STATUS_FLAGS_RC_PPM : constant Bit_Mask_Type := (Shift_Left(1, 3)) ;-- PPM input is valid
PX4IO_P_STATUS_FLAGS_RC_DSM : constant Bit_Mask_Type := (Shift_Left(1, 4)) ;-- DSM input is valid
PX4IO_P_STATUS_FLAGS_RC_SBUS : constant Bit_Mask_Type := (Shift_Left(1, 5)) ;-- SBUS input is valid
PX4IO_P_STATUS_FLAGS_FMU_OK : constant Bit_Mask_Type := (Shift_Left(1, 6)) ;-- controls from FMU are valid
PX4IO_P_STATUS_FLAGS_RAW_PWM : constant Bit_Mask_Type := (Shift_Left(1, 7)) ;-- raw PWM from FMU is bypassing the mixer
PX4IO_P_STATUS_FLAGS_MIXER_OK : constant Bit_Mask_Type := (Shift_Left(1, 8)) ;-- mixer is OK
PX4IO_P_STATUS_FLAGS_ARM_SYNC : constant Bit_Mask_Type := (Shift_Left(1, 9)) ;-- the arming state between IO and FMU is in sync
PX4IO_P_STATUS_FLAGS_INIT_OK : constant Bit_Mask_Type := (Shift_Left(1, 10)) ;-- initialisation of the IO completed without error
PX4IO_P_STATUS_FLAGS_FAILSAFE : constant Bit_Mask_Type := (Shift_Left(1, 11)) ;-- failsafe is active
PX4IO_P_STATUS_FLAGS_SAFETY_OFF : constant Bit_Mask_Type := (Shift_Left(1, 12)) ;-- safety is off
PX4IO_P_STATUS_FLAGS_FMU_INITIALIZED : constant Bit_Mask_Type := (Shift_Left(1, 13)) ;-- FMU was initialized and OK once
PX4IO_P_STATUS_FLAGS_RC_ST24 : constant Bit_Mask_Type := (Shift_Left(1, 14)) ;-- ST24 input is valid
PX4IO_P_STATUS_FLAGS_RC_SUMD : constant Bit_Mask_Type := (Shift_Left(1, 15)) ;-- SUMD input is valid
PX4IO_P_STATUS_ALARMS : constant := 3 ;-- alarm flags - alarms latch, write 1 to a bit to clear it
PX4IO_P_STATUS_ALARMS_VBATT_LOW : constant Bit_Mask_Type := (Shift_Left(1, 0)) ;-- [1] VBatt is very close to regulator dropout
PX4IO_P_STATUS_ALARMS_TEMPERATURE : constant Bit_Mask_Type := (Shift_Left(1, 1)) ;-- board temperature is high
PX4IO_P_STATUS_ALARMS_SERVO_CURRENT : constant Bit_Mask_Type := (Shift_Left(1, 2)) ;-- [1] servo current limit was exceeded
PX4IO_P_STATUS_ALARMS_ACC_CURRENT : constant Bit_Mask_Type := (Shift_Left(1, 3)) ;-- [1] accessory current limit was exceeded
PX4IO_P_STATUS_ALARMS_FMU_LOST : constant Bit_Mask_Type := (Shift_Left(1, 4)) ;-- timed out waiting for controls from FMU
PX4IO_P_STATUS_ALARMS_RC_LOST : constant Bit_Mask_Type := (Shift_Left(1, 5)) ;-- timed out waiting for RC input
PX4IO_P_STATUS_ALARMS_PWM_ERROR : constant Bit_Mask_Type := (Shift_Left(1, 6)) ;-- PWM configuration or output was bad
PX4IO_P_STATUS_ALARMS_VSERVO_FAULT : constant Bit_Mask_Type := (Shift_Left(1, 7)) ;-- [2] VServo was out of the valid range (2.5 - 5.5 V)
PX4IO_P_STATUS_VBATT : constant := 4 ;-- [1] battery voltage in mV
PX4IO_P_STATUS_IBATT : constant := 5 ;-- [1] battery current (ADC : raw)
PX4IO_P_STATUS_VSERVO : constant := 6 ;-- [2] servo rail voltage in mV
PX4IO_P_STATUS_VRSSI : constant := 7 ;-- [2] RSSI voltage
PX4IO_P_STATUS_PRSSI : constant := 8 ;-- [2] RSSI PWM value
PX4IO_P_STATUS_MIXER : constant := 9 ;-- mixer actuator limit flags
PX4IO_P_STATUS_MIXER_LOWER_LIMIT : constant Bit_Mask_Type := (Shift_Left(1, 0)) ;--*< at least one actuator output has reached lower limit
PX4IO_P_STATUS_MIXER_UPPER_LIMIT : constant Bit_Mask_Type := (Shift_Left(1, 1)) ;--*< at least one actuator output has reached upper limit
PX4IO_P_STATUS_MIXER_YAW_LIMIT : constant Bit_Mask_Type := (Shift_Left(1, 2)) ;--*< yaw control is limited because it causes output clipping
-- array of post-mix actuator outputs, 10_000..10000
PX4IO_PAGE_ACTUATORS : constant := 2 ;-- 0..CONFIG_ACTUATOR_COUNT-1
-- array of PWM servo output values, microseconds
PX4IO_PAGE_SERVOS : constant := 3 ;-- 0..CONFIG_ACTUATOR_COUNT-1
-- array of raw RC input values, microseconds
PX4IO_PAGE_RAW_RC_INPUT : constant := 4;
PX4IO_P_RAW_RC_COUNT : constant := 0 ;-- number of valid channels
PX4IO_P_RAW_RC_FLAGS : constant := 1 ;-- RC detail status flags
PX4IO_P_RAW_RC_FLAGS_FRAME_DROP : constant Bit_Mask_Type := (Shift_Left(1, 0)) ;-- single frame drop
PX4IO_P_RAW_RC_FLAGS_FAILSAFE : constant Bit_Mask_Type := (Shift_Left(1, 1)) ;-- receiver is in failsafe mode
PX4IO_P_RAW_RC_FLAGS_RC_DSM11 : constant Bit_Mask_Type := (Shift_Left(1, 2)) ;-- DSM decoding is 11 bit mode
PX4IO_P_RAW_RC_FLAGS_MAPPING_OK : constant Bit_Mask_Type := (Shift_Left(1, 3)) ;-- Channel mapping is ok
PX4IO_P_RAW_RC_FLAGS_RC_OK : constant Bit_Mask_Type := (Shift_Left(1, 4)) ;-- RC reception ok
PX4IO_P_RAW_RC_NRSSI : constant := 2 ;-- [2] Normalized RSSI value, 0: no reception, 255: perfect reception
PX4IO_P_RAW_RC_DATA : constant := 3 ;-- [1] + [2] Details about the RC source (PPM frame length, Spektrum protocol type)
PX4IO_P_RAW_FRAME_COUNT : constant := 4 ;-- Number of total received frames (counter : wrapping)
PX4IO_P_RAW_LOST_FRAME_COUNT : constant := 5 ;-- Number of total dropped frames (counter : wrapping)
PX4IO_P_RAW_RC_BASE : constant := 6 ;-- CONFIG_RC_INPUT_COUNT channels from here
-- array of scaled RC input values, 10_000..10000
PX4IO_PAGE_RC_INPUT : constant := 5;
PX4IO_P_RC_VALID : constant := 0 ;-- bitmask of valid controls
PX4IO_P_RC_BASE : constant := 1 ;-- CONFIG_RC_INPUT_COUNT controls from here
-- array of raw ADC values
PX4IO_PAGE_RAW_ADC_INPUT : constant := 6 ;-- 0..CONFIG_ADC_INPUT_COUNT-1
-- PWM servo information
PX4IO_PAGE_PWM_INFO : constant := 7;
PX4IO_RATE_MAP_BASE : constant := 0 ;-- 0..CONFIG_ACTUATOR_COUNT bitmaps of PWM rate groups
-- setup page
PX4IO_PAGE_SETUP : constant := 50;
PX4IO_P_SETUP_FEATURES : constant := 0;
PX4IO_P_SETUP_FEATURES_SBUS1_OUT : constant Bit_Mask_Type := (Shift_Left(1, 0)) ;--*< enable S.Bus v1 output
PX4IO_P_SETUP_FEATURES_SBUS2_OUT : constant Bit_Mask_Type := (Shift_Left(1, 1)) ;--*< enable S.Bus v2 output
PX4IO_P_SETUP_FEATURES_PWM_RSSI : constant Bit_Mask_Type := (Shift_Left(1, 2)) ;--*< enable PWM RSSI parsing
PX4IO_P_SETUP_FEATURES_ADC_RSSI : constant Bit_Mask_Type := (Shift_Left(1, 3)) ;--*< enable ADC RSSI parsing
PX4IO_P_SETUP_ARMING : constant := 1 ;-- arming controls
PX4IO_P_SETUP_ARMING_IO_ARM_OK : constant Bit_Mask_Type := (Shift_Left(1, 0)) ;-- OK to arm the IO side
PX4IO_P_SETUP_ARMING_FMU_ARMED : constant Bit_Mask_Type := (Shift_Left(1, 1)) ;-- FMU is already armed
PX4IO_P_SETUP_ARMING_MANUAL_OVERRIDE_OK : constant Bit_Mask_Type := (Shift_Left(1, 2)) ;-- OK to switch to manual override via override RC channel
PX4IO_P_SETUP_ARMING_FAILSAFE_CUSTOM : constant Bit_Mask_Type := (Shift_Left(1, 3)) ;-- use custom failsafe values, not 0 values of mixer
PX4IO_P_SETUP_ARMING_INAIR_RESTART_OK : constant Bit_Mask_Type := (Shift_Left(1, 4)) ;-- OK to try in-air restart
PX4IO_P_SETUP_ARMING_ALWAYS_PWM_ENABLE : constant Bit_Mask_Type := (Shift_Left(1, 5)) ;-- Output of PWM right after startup enabled to help ESCs
-- initialize and prevent them from beeping
PX4IO_P_SETUP_ARMING_RC_HANDLING_DISABLED : constant Bit_Mask_Type := (Shift_Left(1, 6)) ;-- Disable the IO-internal evaluation of the RC
PX4IO_P_SETUP_ARMING_LOCKDOWN : constant Bit_Mask_Type := (Shift_Left(1, 7)) ;-- If set, the system operates normally, but won't actuate any servos
PX4IO_P_SETUP_ARMING_FORCE_FAILSAFE : constant Bit_Mask_Type := (Shift_Left(1, 8)) ;-- If set, the system will always output the failsafe values
PX4IO_P_SETUP_ARMING_TERMINATION_FAILSAFE : constant Bit_Mask_Type := (Shift_Left(1, 9)) ;
-- If set, the system will never return from a failsafe, but remain in failsafe once triggered.
PX4IO_P_SETUP_ARMING_OVERRIDE_IMMEDIATE : constant Bit_Mask_Type := (Shift_Left(1, 10)) ;
-- If set then on FMU failure override is immediate. Othewise it waits for the mode switch to go past the override thrshold
PX4IO_P_SETUP_PWM_RATES : constant := 2 ;-- bitmask, 0 := low rate, 1 := high rate
PX4IO_P_SETUP_PWM_DEFAULTRATE : constant := 3 ;-- 'low' PWM frame output rate in Hz
PX4IO_P_SETUP_PWM_ALTRATE : constant := 4 ;-- 'high' PWM frame output rate in Hz
PX4IO_P_SETUP_RELAYS_PAD : constant := 5;
PX4IO_P_SETUP_VBATT_SCALE : constant := 6 ;-- hardware rev [1] battery voltage correction factor Float
PX4IO_P_SETUP_VSERVO_SCALE : constant := 6 ;-- hardware rev [2] servo voltage correction factor Float
PX4IO_P_SETUP_DSM : constant := 7 ;-- DSM bind state
type PX4IO_DSM_Bind_Type is ( -- DSM bind states
dsm_bindpower_down,
dsm_bindpower_up,
dsm_bind_set_rx_out,
dsm_bind_sendpulses,
dsm_bind_reinit_uart
);
-- 8
PX4IO_P_SETUP_SET_DEBUG : constant := 9 ;-- debug level for IO board
PX4IO_P_SETUP_REBOOT_BL : constant := 10 ;-- reboot IO into bootloader
PX4IO_REBOOT_BL_MAGIC : constant :=14_662 ;-- required argument for reboot (random)
PX4IO_P_SETUP_CRC : constant := 11 ;-- get CRC of IO firmware
-- storage space of 12 occupied by CRC
PX4IO_P_SETUP_FORCE_SAFETY_OFF : constant := 12 ;-- force safety switch into
--'armed' (enabled : PWM) state - this is a non-data write and
--hence index 12 can safely be used.
PX4IO_P_SETUP_RC_THR_FAILSAFE_US : constant := 13 ;--*< the throttle failsafe pulse length in microseconds
PX4IO_P_SETUP_FORCE_SAFETY_ON : constant := 14 ;-- force safety switch into 'disarmed' (PWM disabled state)
PX4IO_FORCE_SAFETY_MAGIC : constant Unsigned_16 := 22_027 ;-- required argument for force safety (random)
PX4IO_P_SETUP_PWM_REVERSE : constant := 15 ;--*< Bitmask to reverse PWM channels 1-8
PX4IO_P_SETUP_TRIM_ROLL : constant := 16 ;--*< Roll trim, in actuator units
PX4IO_P_SETUP_TRIM_PITCH : constant := 17 ;--*< Pitch trim, in actuator units
PX4IO_P_SETUP_TRIM_YAW : constant := 18 ;--*< Yaw trim, in actuator units
PX4IO_P_SETUP_SBUS_RATE : constant := 19 ;-- frame rate of SBUS1 output in Hz
-- autopilot control values, 10_000..10000
PX4IO_PAGE_CONTROLS : constant := 51 ;--*< actuator control groups, one after the other, 8 wide
PX4IO_P_CONTROLS_GROUP_0 : constant := (PX4IO_PROTOCOL_MAX_CONTROL_COUNT * 0) ;--*< 0..PX4IO_PROTOCOL_MAX_CONTROL_COUNT - 1
PX4IO_P_CONTROLS_GROUP_1 : constant := (PX4IO_PROTOCOL_MAX_CONTROL_COUNT * 1) ;--*< 0..PX4IO_PROTOCOL_MAX_CONTROL_COUNT - 1
PX4IO_P_CONTROLS_GROUP_2 : constant := (PX4IO_PROTOCOL_MAX_CONTROL_COUNT * 2) ;--*< 0..PX4IO_PROTOCOL_MAX_CONTROL_COUNT - 1
PX4IO_P_CONTROLS_GROUP_3 : constant := (PX4IO_PROTOCOL_MAX_CONTROL_COUNT * 3) ;--*< 0..PX4IO_PROTOCOL_MAX_CONTROL_COUNT - 1
PX4IO_P_CONTROLS_GROUP_VALID : constant := 64;
PX4IO_P_CONTROLS_GROUP_VALID_GROUP0 : constant Bit_Mask_Type := (Shift_Left(1, 0)) ;--*< group 0 is valid / received
PX4IO_P_CONTROLS_GROUP_VALID_GROUP1 : constant Bit_Mask_Type := (Shift_Left(1, 1)) ;--*< group 1 is valid / received
PX4IO_P_CONTROLS_GROUP_VALID_GROUP2 : constant Bit_Mask_Type := (Shift_Left(1, 2)) ;--*< group 2 is valid / received
PX4IO_P_CONTROLS_GROUP_VALID_GROUP3 : constant Bit_Mask_Type := (Shift_Left(1, 3)) ;--*< group 3 is valid / received
-- raw text load to the mixer parser - ignores offset
PX4IO_PAGE_MIXERLOAD : constant := 52;
-- R/C channel config
PX4IO_PAGE_RC_CONFIG : constant := 53 ;--*< R/C input configuration
PX4IO_P_RC_CONFIG_MIN : constant := 0 ;--*< lowest input value
PX4IO_P_RC_CONFIG_CENTER : constant := 1 ;--*< center input value
PX4IO_P_RC_CONFIG_MAX : constant := 2 ;--*< highest input value
PX4IO_P_RC_CONFIG_DEADZONE : constant := 3 ;--*< band around center that is ignored
PX4IO_P_RC_CONFIG_ASSIGNMENT : constant := 4 ;--*< mapped input value
PX4IO_P_RC_CONFIG_ASSIGNMENT_MODESWITCH : constant := 100 ;--*< magic value for mode switch
PX4IO_P_RC_CONFIG_OPTIONS : constant := 5 ;--*< channel options bitmask
PX4IO_P_RC_CONFIG_OPTIONS_ENABLED : constant Bit_Mask_Type := (Shift_Left(1, 0));
PX4IO_P_RC_CONFIG_OPTIONS_REVERSE : constant Bit_Mask_Type := (Shift_Left(1, 1));
PX4IO_P_RC_CONFIG_STRIDE : constant := 6 ;--*< spacing between channel config data
-- PWM output - overrides mixer
PX4IO_PAGE_DIRECT_PWM : constant := 54 ;--*< 0..CONFIG_ACTUATOR_COUNT-1
-- PWM failsafe values - zero disables the output
PX4IO_PAGE_FAILSAFE_PWM : constant := 55 ;--*< 0..CONFIG_ACTUATOR_COUNT-1
-- PWM failsafe values - zero disables the output
PX4IO_PAGE_SENSORS : constant := 56 ;--*< Sensors connected to PX4IO
PX4IO_P_SENSORS_ALTITUDE : constant := 0 ;--*< Altitude of an external sensor (HoTT or S.BUS2)
-- Debug and test page - not used in normal operation
PX4IO_PAGE_TEST : constant := 127;
PX4IO_P_TEST_LED : constant := 0 ;--*< set the amber LED on/off
-- PWM minimum values for certain ESCs
PX4IO_PAGE_CONTROL_MIN_PWM : constant := 106 ;--*< 0..CONFIG_ACTUATOR_COUNT-1
-- PWM maximum values for certain ESCs
PX4IO_PAGE_CONTROL_MAX_PWM : constant := 107 ;--*< 0..CONFIG_ACTUATOR_COUNT-1
-- PWM disarmed values that are active, even when SAFETY_SAFE
PX4IO_PAGE_DISARMED_PWM : constant := 108 ;-- 0..CONFIG_ACTUATOR_COUNT-1
--*
-- As-needed mixer data upload.
--
-- This message adds text to the mixer text buffer; the text
-- buffer is drained as the definitions are consumed.
--
F2I_MIXER_MAGIC : constant := 16#6d74#;
F2I_MIXER_ACTION_RESET : constant := 0;
F2I_MIXER_ACTION_APPEND : constant := 1;
type px4io_mixdata is
record
f2i_mixer_magic : Unsigned_16;
action : Unsigned_8;
text : String(1 .. 10); -- actual text size may vary
end record;
--*
-- Serial protocol encapsulation.
--
PKT_MAX_REGS : constant := 32 ;-- by agreement w/FMU
type Register_Array is array (1 .. PKT_MAX_REGS) of Unsigned_16;
type IOPacket_Type is
record
count_code : Unsigned_8;
crc : Unsigned_8;
page : Unsigned_8;
offset : Unsigned_8;
regs : Register_Array;
end record;
PKT_CODE_READ : constant := 16#00# ;-- FMU->IO read transaction
PKT_CODE_WRITE : constant := 16#40# ;-- FMU->IO write transaction
PKT_CODE_SUCCESS : constant := 16#00# ;-- IO->FMU success reply
PKT_CODE_CORRUPT : constant := 16#40# ;-- IO->FMU bad packet reply
PKT_CODE_ERROR : constant := 16#80# ;-- IO->FMU register op error reply
PKT_CODE_MASK : constant := 16#c0#;
PKT_COUNT_MASK : constant := 16#3f#;
-- function Package_Count(pkt : IOPacket) return Unsigned_8 is
-- (pkt.count_code and PKT_COUNT_MASK);
--
-- function Package_Code(pkt : IOPacket) return Unsigned_8 is
-- (pkt.count_code and PKT_CODE_MASK);
--
-- function Package_Size(pkt : IOPacket) return Unsigned_8 is
-- ( (pkt.count_code and PKT_COUNT_MASK) + 4); -- ToDo: check this
crc8_tab : array (1 .. 256) of Unsigned_8 := (
16#00#, 16#07#, 16#0E#, 16#09#, 16#1C#, 16#1B#, 16#12#, 16#15#,
16#38#, 16#3F#, 16#36#, 16#31#, 16#24#, 16#23#, 16#2A#, 16#2D#,
16#70#, 16#77#, 16#7E#, 16#79#, 16#6C#, 16#6B#, 16#62#, 16#65#,
16#48#, 16#4F#, 16#46#, 16#41#, 16#54#, 16#53#, 16#5A#, 16#5D#,
16#E0#, 16#E7#, 16#EE#, 16#E9#, 16#FC#, 16#FB#, 16#F2#, 16#F5#,
16#D8#, 16#DF#, 16#D6#, 16#D1#, 16#C4#, 16#C3#, 16#CA#, 16#CD#,
16#90#, 16#97#, 16#9E#, 16#99#, 16#8C#, 16#8B#, 16#82#, 16#85#,
16#A8#, 16#AF#, 16#A6#, 16#A1#, 16#B4#, 16#B3#, 16#BA#, 16#BD#,
16#C7#, 16#C0#, 16#C9#, 16#CE#, 16#DB#, 16#DC#, 16#D5#, 16#D2#,
16#FF#, 16#F8#, 16#F1#, 16#F6#, 16#E3#, 16#E4#, 16#ED#, 16#EA#,
16#B7#, 16#B0#, 16#B9#, 16#BE#, 16#AB#, 16#AC#, 16#A5#, 16#A2#,
16#8F#, 16#88#, 16#81#, 16#86#, 16#93#, 16#94#, 16#9D#, 16#9A#,
16#27#, 16#20#, 16#29#, 16#2E#, 16#3B#, 16#3C#, 16#35#, 16#32#,
16#1F#, 16#18#, 16#11#, 16#16#, 16#03#, 16#04#, 16#0D#, 16#0A#,
16#57#, 16#50#, 16#59#, 16#5E#, 16#4B#, 16#4C#, 16#45#, 16#42#,
16#6F#, 16#68#, 16#61#, 16#66#, 16#73#, 16#74#, 16#7D#, 16#7A#,
16#89#, 16#8E#, 16#87#, 16#80#, 16#95#, 16#92#, 16#9B#, 16#9C#,
16#B1#, 16#B6#, 16#BF#, 16#B8#, 16#AD#, 16#AA#, 16#A3#, 16#A4#,
16#F9#, 16#FE#, 16#F7#, 16#F0#, 16#E5#, 16#E2#, 16#EB#, 16#EC#,
16#C1#, 16#C6#, 16#CF#, 16#C8#, 16#DD#, 16#DA#, 16#D3#, 16#D4#,
16#69#, 16#6E#, 16#67#, 16#60#, 16#75#, 16#72#, 16#7B#, 16#7C#,
16#51#, 16#56#, 16#5F#, 16#58#, 16#4D#, 16#4A#, 16#43#, 16#44#,
16#19#, 16#1E#, 16#17#, 16#10#, 16#05#, 16#02#, 16#0B#, 16#0C#,
16#21#, 16#26#, 16#2F#, 16#28#, 16#3D#, 16#3A#, 16#33#, 16#34#,
16#4E#, 16#49#, 16#40#, 16#47#, 16#52#, 16#55#, 16#5C#, 16#5B#,
16#76#, 16#71#, 16#78#, 16#7F#, 16#6A#, 16#6D#, 16#64#, 16#63#,
16#3E#, 16#39#, 16#30#, 16#37#, 16#22#, 16#25#, 16#2C#, 16#2B#,
16#06#, 16#01#, 16#08#, 16#0F#, 16#1A#, 16#1D#, 16#14#, 16#13#,
16#AE#, 16#A9#, 16#A0#, 16#A7#, 16#B2#, 16#B5#, 16#BC#, 16#BB#,
16#96#, 16#91#, 16#98#, 16#9F#, 16#8A#, 16#8D#, 16#84#, 16#83#,
16#DE#, 16#D9#, 16#D0#, 16#D7#, 16#C2#, 16#C5#, 16#CC#, 16#CB#,
16#E6#, 16#E1#, 16#E8#, 16#EF#, 16#FA#, 16#FD#, 16#F4#, 16#F3#
);
-- function crcpacket(struct IOPacket *pkt) return static Unsigned_8;
-- function crcpacket(pkt : IOPacket_Type) return Unsigned_8 is
-- c : Unsigned_8 := 0;
-- begin
-- end : Unsigned_8 := PKT_COUNT(pkt);
-- p : Unsigned_8 := 0;
--
-- while p < end loop
-- c := crc8_tab(c xor * (p := p + 1)); -- loop over all bytes
-- end loop;
--
-- return c;
-- end crcpacket;
end PX4IO.Protocol;
|
Library/NetUtils/address.asm | steakknife/pcgeos | 504 | 5641 | <reponame>steakknife/pcgeos
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT: socket
MODULE: network utilities library
FILE: address.asm
AUTHOR: <NAME>, Oct 31, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 10/31/94 Initial revision
DESCRIPTION:
Code for SocketAddressControlClass
$Id: address.asm,v 1.1 97/04/05 01:25:32 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CANNOT_CHANGE_TO_NON_ANCESTOR_CLASS enum FatalErrors
; UtilChangeClass was called asking to change an object to some class that
; is not a superclass of the base class of the object.
CANNOT_REMOVE_MASTER_LEVELS_WHEN_CHANGING_CLASS enum FatalErrors
; You are attempting to change the class of an object using UtilChangeClass
; and the class to which you wish to change it is in a different master group
; than the class to which the object currently belongs. UtilChangeClass doesn't
; have code in it to support this.
UtilClasses segment resource
SocketAddressControlClass
UtilClasses ends
AddressCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SocketAddressControlSetAction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the destination and message to be outputted when
address becomes valid or invalid
CALLED BY: MSG_SOCKET_ADDRESS_CONTROL_SET_ACTION
PASS: ds:di = SocketAddressControlClass instance data
^lcx:dx = destination
(or cx=0, dx=travel option)
bp = message id
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 10/31/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SocketAddressControlSetAction method dynamic SocketAddressControlClass,
MSG_SOCKET_ADDRESS_CONTROL_SET_ACTION
mov ds:[di].SACI_actionMsg, bp
CheckHack <GenControl_offset eq SocketAddressControl_offset>
movdw ds:[di].GCI_output, cxdx
ret
SocketAddressControlSetAction endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SocketAddressControlSetValidState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Generate a valid notification
CALLED BY: MSG_SOCKET_ADDRESS_CONTROL_SET_VALID_STATE
PASS: *ds:si = SocketAddressControlClass object
ds:di = SocketAddressControlClass instance data
cx = FALSE if address not valid
= TRUE if address is valid
RETURN: nothing
DESTROYED: ax,bx,cx,dx,bp,di
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 10/31/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SocketAddressControlSetValidState method dynamic SocketAddressControlClass,
MSG_SOCKET_ADDRESS_CONTROL_SET_VALID_STATE
;
; record an event
;
mov dx, ds:[LMBH_handle]
mov bp, si ; ^ldx:bp= this object
mov ax, ds:[di].SACI_actionMsg
clrdw bxsi ; no class
mov di, mask MF_RECORD
call ObjMessage ; di = classed event
;
; dispatch it
;
mov si, bp
mov bp, di ; bp = event
mov di, ds:[si]
add di, ds:[di].GenControl_offset
mov ax, MSG_GEN_OUTPUT_ACTION
movdw cxdx, ds:[di].GCI_output
call ObjCallInstanceNoLock
ret
SocketAddressControlSetValidState endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SocketAddressControlFinalObjFree
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Remove the geode reference
CALLED BY: MSG_META_FINAL_OBJ_FREE
PASS: *ds:si = SocketAddressControlClass object
ds:di = SocketAddressControlClass instance data
es = segment of SocketAddressControlClass
ax = message #
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS: changes the class of this object to SocketAddressControlClass
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 1/ 5/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SocketAddressControlFinalObjFree method dynamic SocketAddressControlClass,
MSG_META_FINAL_OBJ_FREE
push ax
;
; get the address of GeodeRemoveReference
;
mov ax, enum GeodeRemoveReference
mov bx, handle geos
call ProcGetLibraryEntry ; bx:ax = vfptr to routine
;
; set up parameters for GeodeRemoveReference
;
sub sp, size ProcessCallRoutineParams
mov bp,sp
movdw ss:[bp].PCRP_address, bxax
segmov ss:[bp].PCRP_dataBX, ds:[di].SACI_geode, ax
;
; get our thread
;
mov bx, ds:[LMBH_handle]
mov ax, MGIT_EXEC_THREAD
call MemGetInfo
;
; Ask our own thread's process to call GeodeRemoveReference
; on the driver. It can't do this until this message completes,
; so it is safe even if this library exits as a result.
;
mov bx,ax
mov ax, MSG_PROCESS_CALL_ROUTINE
mov dx, size ProcessCallRoutineParams
mov di, mask MF_FORCE_QUEUE or mask MF_STACK
call ObjMessage
add sp, size ProcessCallRoutineParams
;
; call the superclass
;
pop ax
mov di, offset SocketAddressControlClass
GOTO ObjCallSuperNoLock
SocketAddressControlFinalObjFree endm
AddressCode ends
|
archive/agda-2/Oscar/Level.agda | m0davis/oscar | 0 | 2892 | <filename>archive/agda-2/Oscar/Level.agda
module Oscar.Level where
open import Agda.Primitive public
using ()
renaming (Level to Ł̂; lzero to Ø̂; lsuc to ↑̂_; _⊔_ to _+̂_)
open import Agda.Primitive public
using ()
renaming (Level to Ł̂; lzero to lzero; lsuc to lsuc; _⊔_ to _⊔_)
𝑶 : ∀ a → Set (lsuc a)
𝑶 a = Set a
open import Agda.Primitive public
using ()
renaming ( Level to Ł
; lzero to ∅̂
; lsuc to ↑̂_
; _⊔_ to _∙̂_ )
infix 0 Ø_
Ø_ : ∀ 𝔬 → Set (↑̂ 𝔬)
Ø_ 𝔬 = Set 𝔬
Ø₀ = Ø ∅̂
|
oeis/226/A226459.asm | neoneye/loda-programs | 11 | 166416 | <gh_stars>10-100
; A226459: a(n) = Sum_{d|n} phi(d^d), where phi(n) is the Euler totient function A000010(n).
; Submitted by <NAME>
; 1,3,19,131,2501,15573,705895,8388739,258280345,4000002503,259374246011,2972033498453,279577021469773,4762288640230761,233543408203127519,9223372036863164547,778579070010669895697,13115469358432437487707,1874292305362402347591139,41943040000000004000002631,3338621153363418583647062725,155194489711008889985122756733,19972621565071915858948292349239,444578592283428041485999199501653,71054273576010018587112426757815001,2841285960095611066521821556283102287,295617658828691846632166420413024875547
add $0,1
mov $2,$0
lpb $0
mov $3,$2
gcd $3,$0
sub $0,1
mov $4,$2
div $4,$3
mov $3,$4
sub $4,1
pow $3,$4
add $1,$3
lpe
mov $0,$1
|
Engine Hacks/Strmag/Strmag/Str Mag Split/Prep Screen and Mag Booster/Mag Stat Booster Cap Check.asm | sme23/Christmas2 | 3 | 170648 | .thumb
.org 0x0
mov r2,r4
add r2,#0x3A
ldrb r1,[r2] @mag
ldr r0,[r4,#0x4]
ldrb r0,[r0,#0x4]
lsl r0,#0x2
ldr r3,MagClassCap
add r0,r3
ldrb r0,[r0,#0x2]
cmp r1,r0
ble NotOverCap
strb r0,[r2]
NotOverCap:
mov r2,#0x1D
ldsb r2,[r4,r2]
mov r1,#0x12
ldsb r1,[r7,r1]
mov r0,#0xF
sub r0,r0,r1
cmp r2,r0
bx r14
.align
MagClassCap:
|
libsrc/_DEVELOPMENT/target/scz180/device/csio/sdcc/csio_sd_write_block_fastcall.asm | Frodevan/z88dk | 640 | 2663 | <reponame>Frodevan/z88dk
SECTION code_driver
PUBLIC _sd_write_block_fastcall
EXTERN asm_sd_write_block
;Write a block of 512 bytes (one sector) from (HL++) to the drive
;
;input HL = pointer to block to write
;uses AF, BC, DE, HL
defc _sd_write_block_fastcall = asm_sd_write_block
|
mdexplorer.applescript | neuroklinik/mdexplorer | 0 | 1888 | -- mdexplorer.applescript
-- mdexplorer
-- Created by <NAME> on 1/9/06.
-- Copyright 2006 __MyCompanyName__. All rights reserved.
on will finish launching theObject
(* Setting up the mdAttributes data source *)
set mdAttributesDS to data source of table view "mdAttributes" of scroll view "mdAttributes" of split view "tableSplitView" of window "mdexplorer" of theObject
tell mdAttributesDS
make new data column at the end of the data columns with properties {name:"key"}
make new data column at the end of the data columns with properties {name:"description"}
set theKeys to do shell script "mdimport -A | awk -F\\' 'BEGIN { OFS=\"\\t\"}{ print $2, $6 }'"
set oldTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to tab
repeat with eachKey from 1 to (count of paragraphs of theKeys)
set newRow to make new data row at the end of the data rows
set contents of data cell "key" of newRow to text item 1 of paragraph eachKey of theKeys
set contents of data cell "description" of newRow to text item 2 of paragraph eachKey of theKeys
end repeat
set AppleScript's text item delimiters to oldTIDs
end tell
end will finish launching
on selection changed theObject
(* The user has selected a search key. Get the one selected. Set the contents of the searchKey textfield to the name of the key. *)
set theWindow to the window of theObject
set selectedRow to selected data row of theObject
tell theWindow
set contents of text field "searchKey" to contents of data cell "key" of selectedRow
end tell
end selection changed
on clicked theObject
(* The user has clicked the Search button. *)
-- Collect some data.
set theWindow to window of theObject
tell theWindow
set theSearchKey to contents of text field "searchKey"
set theSearchBool to title of current menu item of popup button "searchBool"
set theSearchValue to contents of text field "searchValue"
-- display dialog theSearchKey & return & theSearchBool & return & theSearchValue
end tell
-- Run the search.
if theSearchValue = "" then
set foundFiles to do shell script "mdfind \"" & theSearchKey & " " & theSearchBool & " ''\""
else
set foundFiles to do shell script "mdfind \"" & theSearchKey & " " & theSearchBool & " " & "'" & theSearchValue & "'\""
end if
-- Populate the search results window.
set theSearchResultsDS to data source of table view "foundItems" of scroll view "foundItems" of split view "tableSplitView" of window of theObject
delete data rows of theSearchResultsDS
tell theSearchResultsDS
make new data column at the end of the data columns with properties {name:"filename"}
make new data column at the end of the data columns with properties {name:"keyValue"}
repeat with eachFile from 1 to (count of paragraphs of foundFiles)
set filesKey to do shell script "mdls -name " & theSearchKey & " " & quoted form of (paragraph eachFile of foundFiles) & " | awk '{ print $3 }' | tr -d \\\""
set newRow to make new data row at the end of the data rows
set contents of data cell "filename" of newRow to paragraph eachFile of foundFiles
set contents of data cell "keyValue" of newRow to filesKey
end repeat
end tell
end clicked
|
data/pokemon/base_stats/sinnoh/shieldon.asm | Dev727/ancientplatinum | 0 | 16312 | db 0 ; 410 DEX NO
db 30, 42, 118, 30, 42, 88
; hp atk def spd sat sdf
db ROCK, STEEL ; type
db 45 ; catch rate
db 99 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F12_5 ; gender ratio
db 100 ; unknown 1
db 30 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/sinnoh/shieldon/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_ERRATIC ; growth rate
dn EGG_MONSTER, EGG_MONSTER ; egg groups
; tm/hm learnset
tmhm
; end
|
oeis/134/A134636.asm | neoneye/loda-programs | 11 | 244613 | <reponame>neoneye/loda-programs
; A134636: Triangle formed by Pascal's rule given borders = 2n+1.
; Submitted by <NAME>
; 1,3,3,5,6,5,7,11,11,7,9,18,22,18,9,11,27,40,40,27,11,13,38,67,80,67,38,13,15,51,105,147,147,105,51,15,17,66,156,252,294,252,156,66,17,19,83,222,408,546,546,408,222,83,19,21,102,305,630,954,1092,954,630,305,102,21,23,123,407,935,1584,2046,2046,1584,935,407,123,23,25,146,530,1342,2519,3630,4092,3630,2519,1342,530,146,25,27,171,676,1872,3861,6149,7722,7722,6149
lpb $0
add $2,1
sub $0,$2
lpe
mov $1,$2
bin $1,$0
add $0,1
div $1,-1
mul $1,3
add $2,2
bin $2,$0
mul $2,2
add $1,$2
mov $0,$1
|
1-base/lace/applet/demo/event/distributed/source/chat-client-local.ads | charlie5/lace | 20 | 8302 | with
lace.Any;
private
with
lace.make_Subject,
lace.make_Observer,
ada.Strings.unbounded;
package chat.Client.local
--
-- Provides a local client.
-- Names must be unique.
--
is
type Item is limited new lace.Any.limited_item
and chat.Client .item with private;
type View is access all Item'Class;
-- Forge
--
function to_Client (Name : in String) return Item;
-- Attributes
--
overriding
function Name (Self : in Item) return String;
overriding
function as_Observer (Self : access Item) return lace.Observer.view;
overriding
function as_Subject (Self : access Item) return lace.Subject.view;
-- Operations
--
procedure start (Self : in out chat.Client.local.item);
overriding
procedure register_Client (Self : in out Item; other_Client : in Client.view);
overriding
procedure deregister_Client (Self : in out Item; other_Client_as_Observer : in lace.Observer.view;
other_Client_Name : in String);
overriding
procedure Registrar_has_shutdown (Self : in out Item);
private
package Observer is new lace.make_Observer (lace.Any.limited_item);
package Subject is new lace.make_Subject (Observer .item);
use ada.Strings.unbounded;
type Item is limited new Subject .item
and chat.Client.item with
record
Name : unbounded_String;
Registrar_has_shutdown : Boolean := False;
Registrar_is_dead : Boolean := False;
end record;
end chat.Client.local;
|
libsrc/_DEVELOPMENT/adt/ba_priority_queue/c/sccz80/ba_priority_queue_empty.asm | jpoikela/z88dk | 640 | 169564 |
; int ba_priority_queue_empty(ba_priority_queue_t *q)
SECTION code_clib
SECTION code_adt_ba_priority_queue
PUBLIC ba_priority_queue_empty
EXTERN asm_ba_priority_queue_empty
defc ba_priority_queue_empty = asm_ba_priority_queue_empty
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _ba_priority_queue_empty
defc _ba_priority_queue_empty = ba_priority_queue_empty
ENDIF
|
programs/oeis/098/A098500.asm | neoneye/loda | 22 | 10531 | ; A098500: Number of squares on infinite quarter chessboard at <=n knight moves from the corner.
; 1,3,12,32,59,91,130,176,229,289,356,430,511,599,694,796,905,1021,1144,1274,1411,1555,1706,1864,2029,2201,2380,2566,2759,2959,3166,3380,3601,3829,4064,4306,4555,4811,5074,5344,5621,5905,6196,6494,6799,7111,7430
mov $1,$0
mov $3,7
mov $6,$0
lpb $1
sub $1,1
mov $4,$0
mov $5,$3
add $3,1
trn $3,$0
add $0,$1
lpe
add $4,5
sub $4,$5
sub $4,4
trn $4,$5
mov $0,$4
mov $7,$6
mov $9,$6
lpb $9
add $8,$7
sub $9,1
lpe
mov $2,3
mov $7,$8
lpb $2
add $0,$7
sub $2,1
lpe
|
lang/french/ynaq.asm | olifink/smsqe | 0 | 176427 | <reponame>olifink/smsqe<filename>lang/french/ynaq.asm
; Reply strings for query V2.00 1990 <NAME> QJUMP
section language
include 'dev8_mac_text'
mktext ynch,{ONTQ}
mktext ynaq,{O/N/T/Q}
mktext yn,{O ou N}
end
|
source/streams/machine-w64-mingw32/s-naioso.ads | ytomino/drake | 33 | 6668 | pragma License (Unrestricted);
-- implementation unit specialized for Windows
with C.psdk_inc.qip_types;
with C.psdk_inc.qsocket_types;
with C.ws2tcpip;
package System.Native_IO.Sockets is
pragma Preelaborate;
pragma Linker_Options ("-lws2_32");
type Port_Number is range 0 .. 16#ffff#;
subtype Socket_Address is C.psdk_inc.qip_types.SOCKADDR;
procedure Close_Socket (Handle : Handle_Type; Raise_On_Error : Boolean);
-- Close_Ordinary without Name
-- client
subtype End_Point is C.ws2tcpip.struct_addrinfoW_ptr;
function Resolve (Host_Name : String; Service : String)
return End_Point;
function Resolve (Host_Name : String; Port : Port_Number)
return End_Point;
procedure Connect (Handle : aliased out Handle_Type; Peer : End_Point);
procedure Finalize (Item : End_Point);
-- server
subtype Listener is C.psdk_inc.qsocket_types.SOCKET;
Invalid_Listener : constant Listener :=
C.psdk_inc.qsocket_types.INVALID_SOCKET;
procedure Listen (Server : aliased out Listener; Port : Port_Number);
procedure Accept_Socket (
Server : Listener;
Handle : aliased out Handle_Type;
Remote_Address : out Socket_Address);
procedure Close_Listener (Server : Listener; Raise_On_Error : Boolean);
end System.Native_IO.Sockets;
|
programs/oeis/040/A040255.asm | neoneye/loda | 22 | 162669 | ; A040255: Continued fraction for sqrt(272).
; 16,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32,2,32
sub $0,1
mod $0,2
mul $0,11
add $0,2
pow $0,2
div $0,11
mul $0,2
add $0,2
|
programs/oeis/029/A029609.asm | jmorken/loda | 1 | 11810 | ; A029609: Central numbers in the (2,3)-Pascal triangle A029600.
; 1,5,15,50,175,630,2310,8580,32175,121550,461890,1763580,6760390,26001500,100291500,387793800,1502700975,5834015550,22687838250,88363159500,344616322050,1345644686100,5260247409300,20583576819000,80619009207750,316026516094380,1239796332370260,4867348564120280
mov $3,$0
mul $0,2
mov $2,$0
bin $2,$3
lpb $0
mov $0,1
mov $1,$2
div $1,2
sub $2,1
add $1,$2
add $2,$1
sub $1,$1
add $2,9
add $1,$2
lpe
trn $1,8
add $1,1
|
Mockingbird/Problems/Chapter13.agda | splintah/combinatory-logic | 1 | 4011 | <reponame>splintah/combinatory-logic
open import Mockingbird.Forest using (Forest)
-- A Gallery of Sage Birds
module Mockingbird.Problems.Chapter13 {b ℓ} (forest : Forest {b} {ℓ}) where
open import Function using (_$_)
open import Data.Product using (proj₂)
open import Mockingbird.Forest.Birds forest
import Mockingbird.Problems.Chapter09 forest as Chapter₉
import Mockingbird.Problems.Chapter10 forest as Chapter₁₀
import Mockingbird.Problems.Chapter11 forest as Chapter₁₁
import Mockingbird.Problems.Chapter12 forest as Chapter₁₂
open Forest forest
problem₁ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasRobin ⦄ → HasSageBird
problem₁ = record
{ Θ = B ∙ M ∙ (R ∙ M ∙ B)
; isSageBird = λ x → begin
x ∙ (B ∙ M ∙ (R ∙ M ∙ B) ∙ x) ≈⟨ congˡ lemma ⟩
x ∙ (M ∙ (B ∙ x ∙ M)) ≈⟨ isFond ⟩
M ∙ (B ∙ x ∙ M) ≈˘⟨ lemma ⟩
B ∙ M ∙ (R ∙ M ∙ B) ∙ x ∎
} where
isFond = λ {x} → proj₂ (Chapter₁₁.problem₂ x)
lemma : ∀ {x} → B ∙ M ∙ (R ∙ M ∙ B) ∙ x ≈ M ∙ (B ∙ x ∙ M)
lemma {x} = begin
B ∙ M ∙ (R ∙ M ∙ B) ∙ x ≈⟨ isBluebird M (R ∙ M ∙ B) x ⟩
M ∙ (R ∙ M ∙ B ∙ x) ≈⟨ congˡ $ isRobin M B x ⟩
M ∙ (B ∙ x ∙ M) ∎
problem₂ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasCardinal ⦄ → HasSageBird
problem₂ = record
{ Θ = B ∙ M ∙ (C ∙ B ∙ M)
; isSageBird = λ x → begin
x ∙ (B ∙ M ∙ (C ∙ B ∙ M) ∙ x) ≈⟨ congˡ lemma ⟩
x ∙ (M ∙ (B ∙ x ∙ M)) ≈⟨ isFond ⟩
M ∙ (B ∙ x ∙ M) ≈˘⟨ lemma ⟩
B ∙ M ∙ (C ∙ B ∙ M) ∙ x ∎
} where
isFond = λ {x} → proj₂ (Chapter₁₁.problem₂ x)
lemma : ∀ {x} → B ∙ M ∙ (C ∙ B ∙ M) ∙ x ≈ M ∙ (B ∙ x ∙ M)
lemma {x} = begin
B ∙ M ∙ (C ∙ B ∙ M) ∙ x ≈⟨ isBluebird M (C ∙ B ∙ M) x ⟩
M ∙ (C ∙ B ∙ M ∙ x) ≈⟨ congˡ $ isCardinal B M x ⟩
M ∙ (B ∙ x ∙ M) ∎
problem₃ : ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasBluebird ⦄ ⦃ _ : HasLark ⦄ → HasSageBird
problem₃ = record
{ Θ = B ∙ M ∙ L
; isSageBird = isSageBird ⦃ Chapter₁₀.hasSageBird ⦄
} where instance hasComposition = Chapter₁₁.problem₁
problem₄ : ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasBluebird ⦄ ⦃ _ : HasWarbler ⦄ → HasSageBird
problem₄ = record
{ Θ = B ∙ M ∙ (B ∙ W ∙ B)
; isSageBird = isSageBird ⦃ problem₃ ⦄
} where instance hasLark = Chapter₁₂.problem₃
problem₆ : ⦃ _ : HasQueerBird ⦄ ⦃ _ : HasLark ⦄ ⦃ _ : HasWarbler ⦄ → HasSageBird
problem₆ = record
{ Θ = W ∙ (Q ∙ L ∙ (Q ∙ L))
; isSageBird = λ x → begin
x ∙ (W ∙ (Q ∙ L ∙ (Q ∙ L)) ∙ x) ≈⟨ congˡ lemma ⟩
x ∙ (L ∙ x ∙ (L ∙ x)) ≈⟨ isFond ⟩
L ∙ x ∙ (L ∙ x) ≈˘⟨ lemma ⟩
W ∙ (Q ∙ L ∙ (Q ∙ L)) ∙ x ∎
} where
isFond = λ {x} → proj₂ (Chapter₉.problem₂₅ x)
lemma : ∀ {x} → W ∙ (Q ∙ L ∙ (Q ∙ L)) ∙ x ≈ L ∙ x ∙ (L ∙ x)
lemma {x} = begin
W ∙ (Q ∙ L ∙ (Q ∙ L)) ∙ x ≈⟨ isWarbler (Q ∙ L ∙ (Q ∙ L)) x ⟩
Q ∙ L ∙ (Q ∙ L) ∙ x ∙ x ≈⟨ congʳ $ isQueerBird L (Q ∙ L) x ⟩
Q ∙ L ∙ (L ∙ x) ∙ x ≈⟨ isQueerBird L (L ∙ x) x ⟩
L ∙ x ∙ (L ∙ x) ∎
problem₅ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasCardinal ⦄ ⦃ _ : HasWarbler ⦄ → HasSageBird
problem₅ = problem₆
where
instance
hasQueerBird = Chapter₁₁.problem₃₇′
hasLark = Chapter₁₂.problem₃
problem₇ = problem₅
problem₈ : ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasQueerBird ⦄ → HasSageBird
problem₈ = record
{ Θ = Q ∙ (Q ∙ M) ∙ M
; isSageBird = λ x → sym $ begin
Q ∙ (Q ∙ M) ∙ M ∙ x ≈⟨ isQueerBird (Q ∙ M) M x ⟩
M ∙ (Q ∙ M ∙ x) ≈⟨ isMockingbird (Q ∙ M ∙ x) ⟩
Q ∙ M ∙ x ∙ (Q ∙ M ∙ x) ≈⟨ isQueerBird M x (Q ∙ M ∙ x) ⟩
x ∙ (M ∙ (Q ∙ M ∙ x)) ≈˘⟨ congˡ $ isQueerBird (Q ∙ M) M x ⟩
x ∙ (Q ∙ (Q ∙ M) ∙ M ∙ x) ∎
}
-- TODO: formalise regularity.
problem₉ : ⦃ _ : HasStarling ⦄ ⦃ _ : HasLark ⦄ → HasSageBird
problem₉ = record
{ Θ = S ∙ L ∙ L
; isSageBird = λ x → begin
x ∙ (S ∙ L ∙ L ∙ x) ≈⟨ congˡ $ isStarling L L x ⟩
x ∙ (L ∙ x ∙ (L ∙ x)) ≈⟨ isFond ⟩
L ∙ x ∙ (L ∙ x) ≈˘⟨ isStarling L L x ⟩
S ∙ L ∙ L ∙ x ∎
} where
isFond = λ {x} → proj₂ (Chapter₉.problem₂₅ x)
problem₁₀ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasWarbler ⦄ ⦃ _ : HasStarling ⦄ → HasSageBird
problem₁₀ = record
{ Θ = W ∙ S ∙ (B ∙ W ∙ B)
; isSageBird = λ x → begin
x ∙ (W ∙ S ∙ (B ∙ W ∙ B) ∙ x) ≈⟨⟩
x ∙ (W ∙ S ∙ L ∙ x) ≈⟨ congˡ $ congʳ $ isWarbler S L ⟩
x ∙ (S ∙ L ∙ L ∙ x) ≈⟨ isSageBird ⦃ problem₉ ⦄ x ⟩
S ∙ L ∙ L ∙ x ≈˘⟨ congʳ $ isWarbler S L ⟩
W ∙ S ∙ L ∙ x ≈⟨⟩
W ∙ S ∙ (B ∙ W ∙ B) ∙ x ∎
} where instance hasLark = Chapter₁₂.problem₃
problem₁₁ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasThrush ⦄ → HasTuringBird
problem₁₁ = record
{ U = B ∙ (B ∙ W ∙ (C ∙ B)) ∙ M
; isTuringBird = λ x y → begin
B ∙ (B ∙ W ∙ (C ∙ B)) ∙ M ∙ x ∙ y ≈⟨ congʳ $ isBluebird (B ∙ W ∙ (C ∙ B)) M x ⟩
B ∙ W ∙ (C ∙ B) ∙ (M ∙ x) ∙ y ≈⟨ congʳ $ isBluebird W (C ∙ B) (M ∙ x) ⟩
W ∙ (C ∙ B ∙ (M ∙ x)) ∙ y ≈⟨ isWarbler (C ∙ B ∙ (M ∙ x)) y ⟩
C ∙ B ∙ (M ∙ x) ∙ y ∙ y ≈⟨ congʳ $ isCardinal B (M ∙ x) y ⟩
B ∙ y ∙ (M ∙ x) ∙ y ≈⟨ isBluebird y (M ∙ x) y ⟩
y ∙ (M ∙ x ∙ y) ≈⟨ congˡ $ congʳ $ isMockingbird x ⟩
y ∙ (x ∙ x ∙ y) ∎
} where
instance
hasCardinal = Chapter₁₁.problem₂₁′
hasLark = Chapter₁₂.problem₇
problem₁₂ : ⦃ _ : HasTuringBird ⦄ → HasSageBird
problem₁₂ = record
{ Θ = U ∙ U
; isSageBird = λ x → sym $ isTuringBird U x
}
problem₁₃ : ⦃ _ : HasQueerBird ⦄ ⦃ _ : HasWarbler ⦄ → HasOwl
problem₁₃ = record
{ O = Q ∙ Q ∙ W
; isOwl = λ x y → begin
Q ∙ Q ∙ W ∙ x ∙ y ≈⟨ congʳ $ isQueerBird Q W x ⟩
W ∙ (Q ∙ x) ∙ y ≈⟨ isWarbler (Q ∙ x) y ⟩
Q ∙ x ∙ y ∙ y ≈⟨ isQueerBird x y y ⟩
y ∙ (x ∙ y) ∎
}
problem₁₄ : ⦃ _ : HasOwl ⦄ ⦃ _ : HasLark ⦄ → HasTuringBird
problem₁₄ = record
{ U = L ∙ O
; isTuringBird = λ x y → begin
L ∙ O ∙ x ∙ y ≈⟨ congʳ $ isLark O x ⟩
O ∙ (x ∙ x) ∙ y ≈⟨ isOwl (x ∙ x) y ⟩
y ∙ (x ∙ x ∙ y) ∎
}
problem₁₅ : ⦃ _ : HasOwl ⦄ ⦃ _ : HasIdentity ⦄ → HasMockingbird
problem₁₅ = record
{ M = O ∙ I
; isMockingbird = λ x → begin
O ∙ I ∙ x ≈⟨ isOwl I x ⟩
x ∙ (I ∙ x) ≈⟨ congˡ $ isIdentity x ⟩
x ∙ x ∎
}
problem₁₆ : ⦃ _ : HasStarling ⦄ ⦃ _ : HasIdentity ⦄ → HasOwl
problem₁₆ = record
{ O = S ∙ I
; isOwl = λ x y → begin
S ∙ I ∙ x ∙ y ≈⟨ isStarling I x y ⟩
I ∙ y ∙ (x ∙ y) ≈⟨ congʳ $ isIdentity y ⟩
y ∙ (x ∙ y) ∎
}
problem₁₇ : ∀ x y → x IsFondOf y → x IsFondOf x ∙ y
problem₁₇ x y xy≈y = begin
x ∙ (x ∙ y) ≈⟨ congˡ xy≈y ⟩
x ∙ y ∎
problem₁₈ : ⦃ _ : HasOwl ⦄ ⦃ _ : HasSageBird ⦄ → IsSageBird (O ∙ Θ)
problem₁₈ x = begin
x ∙ (O ∙ Θ ∙ x) ≈⟨ congˡ $ isOwl Θ x ⟩
x ∙ (x ∙ (Θ ∙ x)) ≈⟨ isFond ⟩
x ∙ (Θ ∙ x) ≈˘⟨ isOwl Θ x ⟩
O ∙ Θ ∙ x ∎
where
isFond : x IsFondOf (x ∙ (Θ ∙ x))
isFond = problem₁₇ x (Θ ∙ x) (isSageBird x)
problem₁₉ : ⦃ _ : HasOwl ⦄ ⦃ _ : HasSageBird ⦄ → IsSageBird (Θ ∙ O)
problem₁₉ x = sym $ begin
Θ ∙ O ∙ x ≈˘⟨ congʳ $ isSageBird O ⟩
O ∙ (Θ ∙ O) ∙ x ≈⟨ isOwl (Θ ∙ O) x ⟩
x ∙ (Θ ∙ O ∙ x) ∎
problem₂₀ : ⦃ _ : HasOwl ⦄ → ∀ A → O IsFondOf A → IsSageBird A
problem₂₀ A OA≈A x = begin
x ∙ (A ∙ x) ≈˘⟨ isOwl A x ⟩
O ∙ A ∙ x ≈⟨ congʳ OA≈A ⟩
A ∙ x ∎
problem₂₁ : ⦃ _ : HasSageBird ⦄ → ∀ A → IsChoosy A → IsSageBird (Θ ∙ A)
problem₂₁ A isChoosy = isChoosy (Θ ∙ A) $ isSageBird A
open import Mockingbird.Forest.Extensionality forest
problem₂₂ : ⦃ _ : HasOwl ⦄ ⦃ _ : HasSageBird ⦄ → O ∙ Θ ≋ Θ
problem₂₂ x = begin
O ∙ Θ ∙ x ≈⟨ isOwl Θ x ⟩
x ∙ (Θ ∙ x) ≈⟨ isSageBird x ⟩
Θ ∙ x ∎
problem₂₃ : ⦃ _ : Extensional ⦄ ⦃ _ : HasOwl ⦄ ⦃ _ : HasSageBird ⦄ → O IsFondOf Θ
problem₂₃ = ext problem₂₂
|
Ada/inc/Problem_51.ads | Tim-Tom/project-euler | 0 | 312 | <gh_stars>0
package Problem_51 is
procedure Solve;
end Problem_51;
|
projects/batfish/src/batfish/grammar/logicblox/LogiQLParser.g4 | luispedrosa/batfish | 0 | 5134 | parser grammar LogiQLParser;
options {
superClass = 'batfish.grammar.BatfishParser';
tokenVocab = LogiQLLexer;
}
@header {
package batfish.grammar.logicblox;
}
alias_all
:
ALIAS_ALL LEFT_PAREN GRAVE VARIABLE
(
COLON VARIABLE
)* RIGHT_PAREN
;
block
:
BLOCK LEFT_PAREN GRAVE blockname = VARIABLE RIGHT_PAREN LEFT_BRACE
block_directive
(
COMMA block_directive
)* RIGHT_BRACE DOUBLE_LEFT_ARROW PERIOD
;
block_directive
:
alias_all
| clauses
| export
;
boolean_predicate_decl
:
predicate = VARIABLE LEFT_PAREN RIGHT_PAREN RIGHT_ARROW PERIOD
;
clauses
:
CLAUSES LEFT_PAREN GRAVE LEFT_BRACE constructor_decl+ RIGHT_BRACE
RIGHT_PAREN
;
constructor_decl
:
CONSTRUCTOR LEFT_PAREN GRAVE VARIABLE RIGHT_PAREN PERIOD
;
entity_predicate_decl
:
predicate = VARIABLE LEFT_PAREN VARIABLE RIGHT_PAREN RIGHT_ARROW PERIOD
;
export
:
EXPORT LEFT_PAREN GRAVE LEFT_BRACE
(
predicate_semantics?
(
function_decl
| predicate_decl
| refmode_decl
)
)+ RIGHT_BRACE RIGHT_PAREN
;
function_decl
:
function = VARIABLE LEFT_BRACKET parameter_list RIGHT_BRACKET EQUALS
output_var = VARIABLE RIGHT_ARROW type_decl_list PERIOD
;
parameter_list
:
(
vars += VARIABLE
(
COMMA vars += VARIABLE
)*
)?
;
predicate_decl
:
boolean_predicate_decl
| entity_predicate_decl
| regular_predicate_decl
;
predicate_semantics
:
(
PREDICATE_SEMANTICS_COMMENT_HEADER lines += M_PredicateSemantics_LINE
M_PredicatSemantics_NEWLINE
)+
;
regular_predicate_decl
:
predicate = VARIABLE LEFT_PAREN parameter_list RIGHT_PAREN RIGHT_ARROW
type_decl_list PERIOD
;
refmode_decl
:
refmode_predicate = VARIABLE LEFT_PAREN VARIABLE RIGHT_PAREN COMMA VARIABLE
LEFT_PAREN VARIABLE COLON VARIABLE RIGHT_PAREN RIGHT_ARROW type_decl PERIOD
;
type_decl
:
type = VARIABLE LEFT_PAREN var = VARIABLE RIGHT_PAREN
;
type_decl_list
:
type_decls += type_decl
(
COMMA type_decls += type_decl
)*
;
|
source/bios/joy.asm | arbruijn/d2gl | 0 | 179216 | ; THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
; SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
; END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
; ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
; IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
; SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
; FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
; CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
; AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
; COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
.386
_DATA SEGMENT BYTE PUBLIC USE32 'DATA'
rcsid db "$Id: joy.asm 1.16 1995/03/30 11:03:30 john Exp $"
LastTick dd 0
TotalTicks dd 0
_DATA ENDS
DGROUP GROUP _DATA
_TEXT SEGMENT BYTE PUBLIC USE32 'CODE'
ASSUME ds:_DATA
ASSUME cs:_TEXT
JOY_PORT EQU 0201h
TDATA EQU 40h
TCOMMAND EQU 43h
joy_get_timer:
xor al, al ; Latch timer 0 command
out TCOMMAND, al ; Latch timer
in al, TDATA ; Read lo byte
mov ah, al
in al, TDATA ; Read hi byte
xchg ah, al
and eax, 0ffffh
ret
PUBLIC joy_read_stick_asm_
joy_read_stick_asm_:
; ebx = read mask
; edi = pointer to event buffer
; ecx = timeout value
; returns in eax the number of events
and ebx, 01111b ; Make sure we only check the right values
; number of events we found will be in bh, so this also clears it to zero.
mov dx, JOY_PORT
cli ; disable interrupts while reading time...
call joy_get_timer ; Returns counter in EAX
sti ; enable interrupts after reading time...
mov LastTick, eax
waitforstable: in al, dx
and al, bl
jz ready ; Wait for the port in question to be done reading...
cli ; disable interrupts while reading time...
call joy_get_timer ; Returns counter in EAX
sti ; enable interrupts after reading time...
xchg eax, LastTick
cmp eax, LastTick
jb @f
sub eax, LastTick
@@: ; Higher...
add TotalTicks, eax
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae ready
jmp waitforstable
ready:
cli
mov al, 0ffh
out dx, al ; Start joystick a readin'
call joy_get_timer ; Returns counter in EAX
mov LastTick, eax
mov TotalTicks, 0
mov [edi], eax ; Store initial count
add edi, 4
again: in al, dx ; Read Joystick port
not al
and al, bl ; Mask off channels we don't want to read
jnz flip ; See if any of the channels flipped
call joy_get_timer ; Returns counter in EAX
xchg eax, LastTick
cmp eax, LastTick
jb @f
sub eax, LastTick
@@: ; Higher...
add TotalTicks, eax
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae timedout
jmp again
flip: and eax, 01111b ; Only care about axis values
mov [edi], eax ; Record what channel(s) flipped
add edi, 4
xor bl, al ; Unmark the channels that just tripped
call joy_get_timer ; Returns counter in EAX
mov [edi], eax ; Record the time this channel flipped
add edi, 4
inc bh ; Increment number of events
cmp bl, 0
jne again ; If there are more channels to read, keep looping
timedout:
movzx eax, bh ; Return number of events
sti
ret
PUBLIC joy_read_stick_polled_
joy_read_stick_polled_:
; ebx = read mask
; edi = pointer to event buffer
; ecx = timeout value
; returns in eax the number of events
and ebx, 01111b ; Make sure we only check the right values
; number of events we found will be in bh, so this also clears it to zero.
mov dx, JOY_PORT
mov TotalTicks, 0
waitforstable1: in al, dx
and al, bl
jz ready1 ; Wait for the port in question to be done reading...
inc TotalTicks
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae ready1
jmp waitforstable1
ready1:
cli
mov al, 0ffh
out dx, al ; Start joystick a readin'
mov TotalTicks, 0
mov dword ptr [edi], 0 ; Store initial count
add edi, 4
again1: in al, dx ; Read Joystick port
not al
and al, bl ; Mask off channels we don't want to read
jnz flip1 ; See if any of the channels flipped
inc TotalTicks
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae timedout1
jmp again1
flip1: and eax, 01111b ; Only care about axis values
mov [edi], eax ; Record what channel(s) flipped
add edi, 4
xor bl, al ; Unmark the channels that just tripped
mov eax, TotalTicks
mov [edi], eax ; Record the time this channel flipped
add edi, 4
inc bh ; Increment number of events
cmp bl, 0
jne again1 ; If there are more channels to read, keep looping
timedout1:
movzx eax, bh ; Return number of events
sti
ret
PUBLIC joy_read_stick_bios_
joy_read_stick_bios_:
; ebx = read mask
; edi = pointer to event buffer
; ecx = timeout value
; returns in eax the number of events
pusha
mov dword ptr [edi], 0
mov eax, 08400h
mov edx, 1
cli
int 15h
sti
mov dword ptr [edi+4], 1 ; Axis 1
and eax, 0ffffh
mov [edi+8], eax ; Axis 1 value
mov dword ptr [edi+12], 2 ; Axis 2
and ebx, 0ffffh
mov [edi+16], ebx ; Axis 2 value
mov dword ptr [edi+20], 4 ; Axis 3
and ecx, 0ffffh
mov [edi+24], ecx ; Axis 3 value
mov dword ptr [edi+28], 8 ; Axis 3
and edx, 0ffffh
mov [edi+32], edx ; Axis 3 value
popa
mov eax, 4 ; 4 events
ret
PUBLIC joy_read_buttons_bios_
joy_read_buttons_bios_:
; returns in eax the button settings
push ebx
push ecx
push edx
mov eax, 08400h
mov edx, 0 ; Read switches
int 15h
pop edx
pop ecx
pop ebx
shr eax, 4
not eax
and eax, 01111b
ret
_TEXT ENDS
END
|
ada/src/nymph.ada | Watch-Later/NymphRPC | 52 | 29345 | <gh_stars>10-100
-- nymph.ada - Main package file for the NymphRPC package.
--
-- Revision 0
--
-- 2018/09/24, <NAME>
package nymph is
-- public
private
--
end nymph;
|
src/helios-monitor-sysfile.ads | stcarrez/helios | 1 | 10275 | -----------------------------------------------------------------------
-- helios-monitor-sysfile -- Generic system file monitor
-- 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.Strings.Unbounded;
package Helios.Monitor.Sysfile is
type Agent_Type is new Helios.Monitor.Agent_Type with record
Path : Ada.Strings.Unbounded.Unbounded_String;
Value : Schemas.Definition_Type_Access;
end record;
-- Start the agent and build the definition tree.
overriding
procedure Start (Agent : in out Agent_Type;
Config : in Util.Properties.Manager);
-- Collect the values in the snapshot.
overriding
procedure Collect (Agent : in out Agent_Type;
Values : in out Datas.Snapshot_Type);
end Helios.Monitor.Sysfile;
|
oeis/099/A099618.asm | neoneye/loda-programs | 11 | 97736 | ; A099618: a(n) = 1 if the n-th prime == 1 mod 6, otherwise a(n) = 0.
; Submitted by <NAME>(w4)
; 0,0,0,1,0,1,0,1,0,0,1,1,0,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,1,1,0,0,0,1,0,1,0,1,1,1,0,1,0,0,1,0,0,0,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,0,1,0,1,0,0,1,0,1,0,0,0,1,1
trn $0,1
seq $0,65091 ; Odd primes.
div $0,3
sub $0,1
mod $0,2
|
_build/dispatcher/jmp_ippsMontInit_032ad735.asm | zyktrcn/ippcp | 1 | 17165 | <gh_stars>1-10
extern m7_ippsMontInit:function
extern n8_ippsMontInit:function
extern y8_ippsMontInit:function
extern e9_ippsMontInit:function
extern l9_ippsMontInit:function
extern n0_ippsMontInit:function
extern k0_ippsMontInit:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsMontInit
.Larraddr_ippsMontInit:
dq m7_ippsMontInit
dq n8_ippsMontInit
dq y8_ippsMontInit
dq e9_ippsMontInit
dq l9_ippsMontInit
dq n0_ippsMontInit
dq k0_ippsMontInit
segment .text
global ippsMontInit:function (ippsMontInit.LEndippsMontInit - ippsMontInit)
.Lin_ippsMontInit:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsMontInit:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsMontInit]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsMontInit:
|
bugs/bug17a.ada | daveshields/AdaEd | 3 | 17953 | -- If you comment out the Nested_Package.Comment_Out_This_Line_And_All_Ok;
-- lines in Buggy_Package, all is well, or if you only comment out one of
-- these lines and don't instantiate the other generic in Buggy_Package_Demo,
-- then all is well.
package Nested_Package is
procedure Comment_Out_This_Line_And_All_Ok;
end Nested_Package;
package body Nested_Package is
procedure Comment_Out_This_Line_And_All_Ok is
begin
NULL;
end;
end Nested_Package;
package Buggy_Package is
generic
type INT is range <>;
function Func_INT return INT;
generic
type INT is range <>;
procedure Proc_INT;
end Buggy_Package;
with Nested_Package;
package body Buggy_Package is
function Func_INT return INT is
begin
Nested_Package.Comment_Out_This_Line_And_All_Ok;
return INT'FIRST;
end Func_INT;
procedure Proc_INT is
begin
Nested_Package.Comment_Out_This_Line_And_All_Ok;
null;
end Proc_INT;
end Buggy_Package;
|
alloy4fun_models/trashltl/models/7/SeqiRJMDbbScpoLJT.als | Kaixi26/org.alloytools.alloy | 0 | 4955 | <gh_stars>0
open main
pred idSeqiRJMDbbScpoLJT_prop8 {
always all f:File | some f.link implies f in Trash
}
pred __repair { idSeqiRJMDbbScpoLJT_prop8 }
check __repair { idSeqiRJMDbbScpoLJT_prop8 <=> prop8o } |
dowload_manager/src/aws-resources-streams-pipes.adb | persan/AWS-producer-experiments | 2 | 111 | <reponame>persan/AWS-producer-experiments
package body AWS.Resources.Streams.Pipes is
------------
-- Append --
------------
procedure Append
(Resource : in out Stream_Type;
Buffer : Stream_Element_Array;
Trim : Boolean := False)
is
Lock : Lock_Type (Resource.Guard'Access) with Warnings => Off;
begin
if Resource.Has_Read then
Streams.Memory.Stream_Type (Resource).Append (Buffer, Trim);
Resource.Has_Write := True;
end if;
end Append;
------------
-- Append --
------------
procedure Append
(Resource : in out Stream_Type;
Buffer : Stream_Element_Access)
is
Lock : Lock_Type (Resource.Guard'Access) with Warnings => Off;
begin
if Resource.Has_Read then
Streams.Memory.Stream_Type (Resource).Append (Buffer);
Resource.Has_Write := True;
end if;
end Append;
------------
-- Append --
------------
procedure Append
(Resource : in out Stream_Type;
Buffer : Buffer_Access)
is
Lock : Lock_Type (Resource.Guard'Access) with Warnings => Off;
begin
if Resource.Has_Read then
Streams.Memory.Stream_Type (Resource).Append (Buffer);
Resource.Has_Write := True;
end if;
end Append;
----------
-- Read --
----------
overriding procedure Read
(Resource : in out Stream_Type;
Buffer : out Stream_Element_Array;
Last : out Stream_Element_Offset)
is
Lock : Lock_Type (Resource.Guard'Access) with Warnings => Off;
begin
Resource.Has_Read := True;
while not Resource.Has_Write loop
delay 0.01;
end loop;
Streams.Memory.Stream_Type (Resource).Read (Buffer, Last);
end Read;
-----------------
-- End_Of_File --
-----------------
overriding function End_Of_File (Resource : Stream_Type) return Boolean is
begin
return Streams.Memory.Stream_Type (Resource).End_Of_File;
end End_Of_File;
-----------
-- Clear --
-----------
procedure Clear (Resource : in out Stream_Type) is
Lock : Lock_Type (Resource.Guard'Access) with Warnings => Off;
begin
Streams.Memory.Stream_Type (Resource).Clear;
end Clear;
-----------
-- Close --
-----------
overriding procedure Close (Resource : in out Stream_Type) is
Lock : Lock_Type (Resource.Guard'Access) with Warnings => Off;
begin
Streams.Memory.Stream_Type (Resource).Close;
end Close;
----------------
-- Initialize --
----------------
procedure Initialize (Object : in out Lock_Type) is
begin
OBJECT.Guard.Seize;
end Initialize;
--------------
-- Finalize --
--------------
procedure Finalize (Object : in out Lock_Type) is
begin
OBJECT.Guard.Release;
end Finalize;
end AWS.Resources.Streams.Pipes;
|
lemmas-progress-checks.agda | hazelgrove/hazelnut-dynamics-agda | 16 | 2249 | open import Nat
open import Prelude
open import core
module lemmas-progress-checks where
-- boxed values don't have an instruction transition
boxedval-not-trans : ∀{d d'} → d boxedval → d →> d' → ⊥
boxedval-not-trans (BVVal VConst) ()
boxedval-not-trans (BVVal VLam) ()
boxedval-not-trans (BVArrCast x bv) (ITCastID) = x refl
boxedval-not-trans (BVHoleCast () bv) (ITCastID)
boxedval-not-trans (BVHoleCast () bv) (ITCastSucceed x₁)
boxedval-not-trans (BVHoleCast GHole bv) (ITGround (MGArr x)) = x refl
boxedval-not-trans (BVHoleCast x a) (ITExpand ())
boxedval-not-trans (BVHoleCast x x₁) (ITCastFail x₂ () x₄)
-- indets don't have an instruction transition
indet-not-trans : ∀{d d'} → d indet → d →> d' → ⊥
indet-not-trans IEHole ()
indet-not-trans (INEHole x) ()
indet-not-trans (IAp x₁ () x₂) (ITLam)
indet-not-trans (IAp x (ICastArr x₁ ind) x₂) (ITApCast ) = x _ _ _ _ _ refl
indet-not-trans (ICastArr x ind) (ITCastID) = x refl
indet-not-trans (ICastGroundHole () ind) (ITCastID)
indet-not-trans (ICastGroundHole x ind) (ITCastSucceed ())
indet-not-trans (ICastGroundHole GHole ind) (ITGround (MGArr x)) = x refl
indet-not-trans (ICastHoleGround x ind ()) (ITCastID)
indet-not-trans (ICastHoleGround x ind x₁) (ITCastSucceed x₂) = x _ _ refl
indet-not-trans (ICastHoleGround x ind GHole) (ITExpand (MGArr x₂)) = x₂ refl
indet-not-trans (ICastGroundHole x a) (ITExpand ())
indet-not-trans (ICastHoleGround x a x₁) (ITGround ())
indet-not-trans (ICastGroundHole x x₁) (ITCastFail x₂ () x₄)
indet-not-trans (ICastHoleGround x x₁ x₂) (ITCastFail x₃ x₄ x₅) = x _ _ refl
indet-not-trans (IFailedCast x x₁ x₂ x₃) ()
-- finals don't have an instruction transition
final-not-trans : ∀{d d'} → d final → d →> d' → ⊥
final-not-trans (FBoxedVal x) = boxedval-not-trans x
final-not-trans (FIndet x) = indet-not-trans x
-- finals cast from a ground are still final
final-gnd-cast : ∀{ d τ } → d final → τ ground → (d ⟨ τ ⇒ ⦇-⦈ ⟩) final
final-gnd-cast (FBoxedVal x) gnd = FBoxedVal (BVHoleCast gnd x)
final-gnd-cast (FIndet x) gnd = FIndet (ICastGroundHole gnd x)
-- if an expression results from filling a hole in an evaluation context,
-- the hole-filler must have been final
final-sub-final : ∀{d ε x} → d final → d == ε ⟦ x ⟧ → x final
final-sub-final x FHOuter = x
final-sub-final (FBoxedVal (BVVal ())) (FHAp1 eps)
final-sub-final (FBoxedVal (BVVal ())) (FHAp2 eps)
final-sub-final (FBoxedVal (BVVal ())) (FHNEHole eps)
final-sub-final (FBoxedVal (BVVal ())) (FHCast eps)
final-sub-final (FBoxedVal (BVVal ())) (FHFailedCast y)
final-sub-final (FBoxedVal (BVArrCast x₁ x₂)) (FHCast eps) = final-sub-final (FBoxedVal x₂) eps
final-sub-final (FBoxedVal (BVHoleCast x₁ x₂)) (FHCast eps) = final-sub-final (FBoxedVal x₂) eps
final-sub-final (FIndet (IAp x₁ x₂ x₃)) (FHAp1 eps) = final-sub-final (FIndet x₂) eps
final-sub-final (FIndet (IAp x₁ x₂ x₃)) (FHAp2 eps) = final-sub-final x₃ eps
final-sub-final (FIndet (INEHole x₁)) (FHNEHole eps) = final-sub-final x₁ eps
final-sub-final (FIndet (ICastArr x₁ x₂)) (FHCast eps) = final-sub-final (FIndet x₂) eps
final-sub-final (FIndet (ICastGroundHole x₁ x₂)) (FHCast eps) = final-sub-final (FIndet x₂) eps
final-sub-final (FIndet (ICastHoleGround x₁ x₂ x₃)) (FHCast eps) = final-sub-final (FIndet x₂) eps
final-sub-final (FIndet (IFailedCast x₁ x₂ x₃ x₄)) (FHFailedCast y) = final-sub-final x₁ y
final-sub-not-trans : ∀{d d' d'' ε} → d final → d == ε ⟦ d' ⟧ → d' →> d'' → ⊥
final-sub-not-trans f sub step = final-not-trans (final-sub-final f sub) step
|
programs/oeis/218/A218075.asm | neoneye/loda | 22 | 164627 | <gh_stars>10-100
; A218075: a(n) = 2^(prime(n+1) - prime(n)).
; 2,4,4,16,4,16,4,16,64,4,64,16,4,16,64,64,4,64,16,4,64,16,64,256,16,4,16,4,16,16384,16,64,4,1024,4,64,64,16,64,64,4,1024,4,16,4,4096,4096,16,4,16,64,4,1024,64,64,64,4,64,16,4,1024,16384,16,4,16
add $0,1
seq $0,40 ; The prime numbers.
div $0,2
mul $0,2
sub $0,1
seq $0,64722 ; a(1) = 0; for n >= 2, a(n) = n - (largest prime <= n).
mov $1,2
pow $1,$0
mul $1,2
mov $0,$1
|
scripts/safari.scpt | bobheadxi/btt | 5 | 2368 | tell application "Safari"
make new document with properties {URL:"https://www.google.com"}
activate
end tell
|
Pascal/Project_2/LCDDriver.asm | edosedgar/avr_8bit | 0 | 95887 |
_InitPortsIO:
;LCDDriver.mpas,9 :: begin
;LCDDriver.mpas,10 :: DDRD :=%11111111;
LDI R27, 255
OUT DDRD+0, R27
;LCDDriver.mpas,11 :: DDRB :=%00010011;
LDI R27, 19
OUT DDRB+0, R27
;LCDDriver.mpas,12 :: DDRC :=%00111000;
LDI R27, 56
OUT DDRC+0, R27
;LCDDriver.mpas,13 :: PORTC:=%00000011;
LDI R27, 3
OUT PORTC+0, R27
;LCDDriver.mpas,14 :: end;
L_end_InitPortsIO:
RET
; end of _InitPortsIO
_WriteData:
;LCDDriver.mpas,17 :: begin
;LCDDriver.mpas,19 :: CBI PORTC,4
CBI PORTC+0, 4
;LCDDriver.mpas,20 :: CBI PORTC,3
CBI PORTC+0, 3
;LCDDriver.mpas,21 :: SBI PORTC,5
SBI PORTC+0, 5
;LCDDriver.mpas,22 :: OUT PORTD,R2
OUT PORTD+0, R2
;LCDDriver.mpas,23 :: CBI PORTC,5
CBI PORTC+0, 5
;LCDDriver.mpas,24 :: SBI PORTB,0
SBI PORTB+0, 0
;LCDDriver.mpas,26 :: delay_us(1);
LDI R16, 2
L__WriteData2:
DEC R16
BRNE L__WriteData2
NOP
NOP
;LCDDriver.mpas,27 :: end;
L_end_WriteData:
RET
; end of _WriteData
_WriteCommand:
;LCDDriver.mpas,30 :: begin
;LCDDriver.mpas,32 :: CBI PORTB,0
CBI PORTB+0, 0
;LCDDriver.mpas,33 :: CBI PORTC,4
CBI PORTC+0, 4
;LCDDriver.mpas,34 :: SBI PORTC,3
SBI PORTC+0, 3
;LCDDriver.mpas,35 :: SBI PORTC,5
SBI PORTC+0, 5
;LCDDriver.mpas,36 :: OUT PORTD,R2
OUT PORTD+0, R2
;LCDDriver.mpas,37 :: CBI PORTC,5
CBI PORTC+0, 5
;LCDDriver.mpas,39 :: delay_us(1);
LDI R16, 2
L__WriteCommand5:
DEC R16
BRNE L__WriteCommand5
NOP
NOP
;LCDDriver.mpas,40 :: end;
L_end_WriteCommand:
RET
; end of _WriteCommand
_SetByteAdrCursor:
;LCDDriver.mpas,43 :: begin
;LCDDriver.mpas,45 :: WriteCommand(%00001010);
PUSH R2
PUSH R2
LDI R27, 10
MOV R2, R27
CALL _WriteCommand+0
POP R2
;LCDDriver.mpas,46 :: WriteData(LowAdrByte);
CALL _WriteData+0
;LCDDriver.mpas,48 :: WriteCommand(%00001011);
LDI R27, 11
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,49 :: WriteData(HighAdrByte);
MOV R2, R3
CALL _WriteData+0
;LCDDriver.mpas,50 :: end;
L_end_SetByteAdrCursor:
POP R2
RET
; end of _SetByteAdrCursor
_EnableLcd:
;LCDDriver.mpas,54 :: begin
;LCDDriver.mpas,56 :: SBI PORTB,1
SBI PORTB+0, 1
;LCDDriver.mpas,58 :: end;
L_end_EnableLcd:
RET
; end of _EnableLcd
_InitSPI:
;LCDDriver.mpas,61 :: begin
;LCDDriver.mpas,63 :: SBI SPCR,6
SBI SPCR+0, 6
;LCDDriver.mpas,65 :: end;
L_end_InitSPI:
RET
; end of _InitSPI
_InitLC7981:
;LCDDriver.mpas,70 :: begin
;LCDDriver.mpas,72 :: EnableLcd;
PUSH R2
PUSH R3
CALL _EnableLcd+0
;LCDDriver.mpas,74 :: WriteCommand(%00000000);
CLR R2
CALL _WriteCommand+0
;LCDDriver.mpas,75 :: WriteData(%00110010);
LDI R27, 50
MOV R2, R27
CALL _WriteData+0
;LCDDriver.mpas,77 :: WriteCommand(%00000001);
LDI R27, 1
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,78 :: WriteData(%00000111);
LDI R27, 7
MOV R2, R27
CALL _WriteData+0
;LCDDriver.mpas,80 :: WriteCommand(%00000010);
LDI R27, 2
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,81 :: WriteData(%00011101);
LDI R27, 29
MOV R2, R27
CALL _WriteData+0
;LCDDriver.mpas,83 :: WriteCommand(%00000011);
LDI R27, 3
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,84 :: WriteData(%01111111);
LDI R27, 127
MOV R2, R27
CALL _WriteData+0
;LCDDriver.mpas,86 :: WriteCommand(%00000100);
LDI R27, 4
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,87 :: WriteData(%00000000);
CLR R2
CALL _WriteData+0
;LCDDriver.mpas,90 :: WriteCommand(%00001000);
LDI R27, 8
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,91 :: WriteData(%00000000);
CLR R2
CALL _WriteData+0
;LCDDriver.mpas,93 :: WriteCommand(%00001001);
LDI R27, 9
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,94 :: WriteData(%00000000);
CLR R2
CALL _WriteData+0
;LCDDriver.mpas,96 :: SetByteAdrCursor(0,0);
CLR R3
CLR R2
CALL _SetByteAdrCursor+0
;LCDDriver.mpas,97 :: for i:=0 to 3840 do
; i start address is: 18 (R18)
LDI R18, 0
LDI R19, 0
; i end address is: 18 (R18)
L__InitLC798112:
;LCDDriver.mpas,99 :: WriteCommand(%00001100);
; i start address is: 18 (R18)
PUSH R19
PUSH R18
LDI R27, 12
MOV R2, R27
CALL _WriteCommand+0
;LCDDriver.mpas,100 :: WriteData(0);
CLR R2
CALL _WriteData+0
POP R18
POP R19
;LCDDriver.mpas,101 :: end;
CPI R19, 15
BRNE L__InitLC798134
CPI R18, 0
L__InitLC798134:
BRNE L__InitLC798135
JMP L__InitLC798115
L__InitLC798135:
MOVW R16, R18
SUBI R16, 255
SBCI R17, 255
MOVW R18, R16
; i end address is: 18 (R18)
JMP L__InitLC798112
L__InitLC798115:
;LCDDriver.mpas,102 :: SetByteAdrCursor(0,0);
CLR R3
CLR R2
CALL _SetByteAdrCursor+0
;LCDDriver.mpas,103 :: end;
L_end_InitLC7981:
POP R3
POP R2
RET
; end of _InitLC7981
_ReadSPI:
;LCDDriver.mpas,107 :: begin
;LCDDriver.mpas,109 :: WaitReception:
WaitReception:
;LCDDriver.mpas,111 :: sbis SPSR,SPIF
SBIS SPSR+0, 7
;LCDDriver.mpas,112 :: rjmp WaitReception
RJMP WaitReception
;LCDDriver.mpas,115 :: ReadSPI:=SPDR;
; Result start address is: 17 (R17)
IN R17, SPDR+0
;LCDDriver.mpas,116 :: end;
MOV R16, R17
; Result end address is: 17 (R17)
L_end_ReadSPI:
RET
; end of _ReadSPI
_main:
LDI R27, 255
OUT SPL+0, R27
LDI R27, 0
OUT SPL+1, R27
;LCDDriver.mpas,120 :: begin
;LCDDriver.mpas,121 :: InitPortsIO;
PUSH R2
CALL _InitPortsIO+0
;LCDDriver.mpas,122 :: InitLC7981;
CALL _InitLC7981+0
;LCDDriver.mpas,123 :: InitSPI;
CALL _InitSPI+0
;LCDDriver.mpas,124 :: while true do
L__main20:
;LCDDriver.mpas,126 :: if PINB3_bit=1 then
IN R27, PINB3_bit+0
SBRS R27, 3
JMP L__main25
;LCDDriver.mpas,128 :: WriteCommand(ReadSPI);
CALL _ReadSPI+0
MOV R2, R16
CALL _WriteCommand+0
;LCDDriver.mpas,129 :: WriteData(ReadSPI);
CALL _ReadSPI+0
MOV R2, R16
CALL _WriteData+0
;LCDDriver.mpas,130 :: end;
L__main25:
;LCDDriver.mpas,131 :: end;
JMP L__main20
;LCDDriver.mpas,132 :: end.
L_end_main:
L__main_end_loop:
JMP L__main_end_loop
; end of _main
|
oeis/201/A201709.asm | neoneye/loda-programs | 11 | 22437 | ; A201709: Primes of the form 10n^2 + 1.
; Submitted by <NAME>(w4)
; 11,41,251,491,641,811,2251,4001,6761,7841,9001,10891,12251,13691,16001,16811,22091,23041,32491,33641,40961,50411,68891,72251,73961,81001,82811,86491,98011,108161,110251,112361,121001,125441,127691,139241,158761,163841,174241,198811,216091,219041,222011,231041,237161,259211,278891,282241,285611,289001,331241,334891,357211,361001,380251,404011,408041,436811,449441,466561,470891,497291,506251,524411,542891,566441,571211,576001,670811,696961,707561,712891,718241,734411,756251,789611,852641,864361
mov $2,332202
lpb $2
mov $3,$6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $5,$1
add $1,10
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
mov $6,$5
lpe
mov $0,$5
add $0,1
|
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_212.asm | ljhsiun2/medusa | 9 | 102064 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x5603, %r8
nop
nop
nop
nop
nop
xor %rdx, %rdx
movw $0x6162, (%r8)
sub %r12, %r12
lea addresses_WC_ht+0x14b1b, %rsi
lea addresses_WC_ht+0x9f1b, %rdi
clflush (%rdi)
nop
add $5313, %rbx
mov $82, %rcx
rep movsl
nop
add %r8, %r8
lea addresses_WT_ht+0xdd1b, %r8
nop
nop
nop
nop
and %rbx, %rbx
vmovups (%r8), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r12
nop
nop
nop
nop
xor %r12, %r12
lea addresses_UC_ht+0x939b, %rcx
nop
nop
nop
nop
dec %r8
mov (%rcx), %bx
nop
nop
inc %r8
lea addresses_D_ht+0x1051b, %r14
nop
nop
nop
nop
nop
cmp %r8, %r8
mov (%r14), %r12d
nop
xor $13037, %rsi
lea addresses_UC_ht+0x751b, %rsi
lea addresses_UC_ht+0x9fdb, %rdi
nop
nop
cmp $8841, %r12
mov $49, %rcx
rep movsl
nop
nop
nop
nop
nop
add $46378, %rbx
lea addresses_A_ht+0x1d51b, %rbx
nop
nop
nop
nop
add $6697, %rdi
movl $0x61626364, (%rbx)
nop
nop
nop
nop
nop
add $15400, %rdi
lea addresses_WT_ht+0xaf5b, %rsi
lea addresses_UC_ht+0x119db, %rdi
nop
nop
nop
add %rbx, %rbx
mov $23, %rcx
rep movsq
nop
nop
nop
sub %rdx, %rdx
lea addresses_A_ht+0x911b, %rsi
lea addresses_WC_ht+0x19d1b, %rdi
cmp $53237, %r8
mov $100, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $21108, %r12
lea addresses_WC_ht+0x76d7, %rsi
nop
nop
nop
nop
dec %r12
mov $0x6162636465666768, %rbx
movq %rbx, (%rsi)
nop
nop
nop
nop
and $60359, %rsi
lea addresses_D_ht+0xfa7e, %r12
nop
cmp $26818, %rcx
movb $0x61, (%r12)
nop
nop
nop
nop
nop
cmp $42367, %rbx
lea addresses_D_ht+0x851b, %r8
nop
nop
add %r14, %r14
mov $0x6162636465666768, %r12
movq %r12, %xmm3
movups %xmm3, (%r8)
cmp $9791, %rdi
lea addresses_WT_ht+0x1d31b, %rbx
nop
nop
nop
inc %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm1
movups %xmm1, (%rbx)
sub $12805, %r12
lea addresses_UC_ht+0x10bb, %r14
clflush (%r14)
nop
xor $54414, %r8
mov $0x6162636465666768, %rsi
movq %rsi, (%r14)
inc %rcx
lea addresses_WT_ht+0x7777, %rsi
lea addresses_WT_ht+0x1edfb, %rdi
nop
nop
nop
nop
nop
cmp %rbx, %rbx
mov $80, %rcx
rep movsl
nop
nop
xor %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r9
push %rbx
// Faulty Load
lea addresses_US+0xd1b, %r13
clflush (%r13)
nop
nop
nop
sub $2389, %r9
mov (%r13), %r10w
lea oracles, %r9
and $0xff, %r10
shlq $12, %r10
mov (%r9,%r10,1), %r10
pop %rbx
pop %r9
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_UC_ht', 'same': True, 'AVXalign': False, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_UC_ht', 'same': True, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}, 'dst': {'same': True, 'type': 'addresses_UC_ht', 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}, 'dst': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_18669_840.asm | ljhsiun2/medusa | 9 | 241096 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x141c8, %r9
nop
nop
nop
nop
and $35839, %r13
movl $0x61626364, (%r9)
nop
nop
nop
nop
nop
xor $62238, %r15
lea addresses_A_ht+0x15810, %r15
nop
nop
nop
nop
dec %r9
movups (%r15), %xmm3
vpextrq $1, %xmm3, %rbx
nop
nop
nop
nop
dec %r13
lea addresses_WC_ht+0x1bcc6, %rsi
lea addresses_WT_ht+0x990, %rdi
nop
nop
nop
and $18955, %r13
mov $118, %rcx
rep movsb
nop
xor $6457, %rcx
lea addresses_normal_ht+0x12d46, %rcx
nop
sub $1390, %rbx
mov (%rcx), %r13w
nop
sub %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %rax
push %rbp
push %rbx
push %rcx
push %rdx
push %rsi
// Store
lea addresses_normal+0xc438, %rbp
nop
nop
nop
nop
inc %rax
movw $0x5152, (%rbp)
nop
nop
nop
nop
add %rbp, %rbp
// Store
lea addresses_WT+0x16310, %rsi
nop
nop
nop
nop
nop
xor %rdx, %rdx
mov $0x5152535455565758, %rax
movq %rax, (%rsi)
nop
sub $18799, %rsi
// Faulty Load
mov $0x409cd80000000d10, %rdx
nop
nop
sub $38125, %rbx
mov (%rdx), %r14d
lea oracles, %rcx
and $0xff, %r14
shlq $12, %r14
mov (%rcx,%r14,1), %r14
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT', 'size': 8, 'AVXalign': True}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': True, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'}
{'00': 18669}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
src/gpsmodule.ads | Kurinkitos/Twizy-Security | 1 | 14962 | <reponame>Kurinkitos/Twizy-Security
pragma SPARK_Mode(ON);
with Types; use Types;
package gpsModule with SPARK_Mode is
Top_Left : constant Types.Point := (667271.0, 6398091.0, 0.0);
Bottom_Right : constant Types.Point := (677862.0, 6397724.0, 0.0);
function gpstest(Position : Types.Point) return Boolean with
Post => (if Gpstest'Result then (Position.X > Top_Left.X and Position.Y < Top_Left.Y
and Position.X < Bottom_Right.X and Position.Y > Bottom_Right.Y)) and
(if not Gpstest'Result then not (Position.X > Top_Left.X and Position.Y < Top_Left.Y
and Position.X < Bottom_Right.X and Position.Y > Bottom_Right.Y)),
Global => null;
end gpsModule;
|
programs/oeis/184/A184102.asm | jmorken/loda | 1 | 166959 | <reponame>jmorken/loda<gh_stars>1-10
; A184102: n+floor(4*sqrt(n)); complement of A184103.
; 5,7,9,12,13,15,17,19,21,22,24,25,27,28,30,32,33,34,36,37,39,40,42,43,45,46,47,49,50,51,53,54,55,57,58,60,61,62,63,65,66,67,69,70,71,73,74,75,77,78,79,80,82,83,84,85,87,88,89,90,92,93,94,96,97,98,99,100,102,103,104,105,107,108,109,110,112,113,114,115,117,118,119,120,121,123,124,125,126,127,129,130,131,132,133,135,136,137,138,140
mov $4,$0
add $0,1
mul $0,16
lpb $0
sub $0,1
add $1,3
add $1,$3
add $1,1
add $3,2
trn $0,$3
mov $2,$3
add $2,4
trn $1,$2
add $1,3
lpe
lpb $4
add $1,1
sub $4,1
lpe
sub $1,1
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr22.adb | best08618/asylo | 7 | 22516 | -- { dg-do compile }
-- { dg-options "-gnatws" }
procedure Discr22 is
subtype Precision is Integer range 1 .. 5;
type Rec(D1 : Precision; D2 : Integer) is record
case D1 is
when 1 => I : Integer;
when others => null;
end case;
end record;
for Rec use record
D1 at 0 range 0 .. 7;
end record;
P : Precision;
X : Rec(P, 0);
begin
null;
end;
|
oeis/000/A000501.asm | neoneye/loda-programs | 11 | 244706 | ; A000501: a(n) = floor(cosh(n)).
; Submitted by <NAME>
; 1,1,3,10,27,74,201,548,1490,4051,11013,29937,81377,221206,601302,1634508,4443055,12077476,32829984,89241150,242582597,659407867,1792456423,4872401723,13244561064,36002449668,97864804714,266024120300,723128532145,1965667148572,5343237290762,14524424832623,39481480091340,107321789892958,291730871263727,793006726156715,2155615773557597,5859571186401305,15927965878556878,43296700211996873,117692633418509992,319921746765027474,869637470760250523,2363919734114673280,6425800057179654137
mov $1,1
mov $3,$0
mul $3,4
mov $5,1
lpb $3
mul $1,$3
mov $4,$0
cmp $4,0
add $0,$4
div $1,$0
add $2,$1
sub $3,1
lpe
div $2,2
cmp $5,0
cmp $5,0
add $2,$5
div $2,$1
mov $0,$2
|
alloy4fun_models/trainstlt/models/8/oqCnumi9AJxFBk7CX.als | Kaixi26/org.alloytools.alloy | 0 | 2380 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idoqCnumi9AJxFBk7CX_prop9 {
(all t:Train| once(no t.pos and after one t.pos:>Entry) )
}
pred __repair { idoqCnumi9AJxFBk7CX_prop9 }
check __repair { idoqCnumi9AJxFBk7CX_prop9 <=> prop9o } |
courses/fundamentals_of_ada/labs/prompts/140_access_types/datastore.ads | AdaCore/training_material | 15 | 7111 | package Datastore is
pragma Elaborate_Body;
-- Create an array of strings that can be of any length
-- (i.e. array of string pointers)
-- Create a record that contains this array
type Element_T is null record;
-- Create two access types to the element
-- An immutable access type
-- An access type that allows us to modify the pointed-to object
subtype Index_T is Integer range 1 .. 100;
-- Create functions that return the different access types
-- based on the index into the array
end Datastore;
|
alloy4fun_models/trashltl/models/4/jPzQLM8Ygca985bd7.als | Kaixi26/org.alloytools.alloy | 0 | 346 | <reponame>Kaixi26/org.alloytools.alloy<gh_stars>0
open main
pred idjPzQLM8Ygca985bd7_prop5 {
some File eventually File in Trash
}
pred __repair { idjPzQLM8Ygca985bd7_prop5 }
check __repair { idjPzQLM8Ygca985bd7_prop5 <=> prop5o } |
alloy4fun_models/trashltl/models/11/XeXKoQ3nY2ozkQfQ6.als | Kaixi26/org.alloytools.alloy | 0 | 149 | open main
pred idXeXKoQ3nY2ozkQfQ6_prop12 {
eventually always all f:File | eventually f in Trash implies always f in Trash'
}
pred __repair { idXeXKoQ3nY2ozkQfQ6_prop12 }
check __repair { idXeXKoQ3nY2ozkQfQ6_prop12 <=> prop12o } |
oeis/275/A275363.asm | neoneye/loda-programs | 11 | 93040 | ; A275363: a(1)=3, a(2)=6, a(3)=3; thereafter a(n) = a(n-a(n-1)) + a(n-1-a(n-2)).
; Submitted by <NAME>
; 3,6,3,3,9,6,3,12,9,3,15,12,3,18,15,3,21,18,3,24,21,3,27,24,3,30,27,3,33,30,3,36,33,3,39,36,3,42,39,3,45,42,3,48,45,3,51,48,3,54,51,3,57,54,3,60,57,3,63,60,3,66,63,3,69,66,3,72,69,3,75,72,3,78,75,3,81,78,3,84,81,3,87,84,3,90,87,3,93,90,3,96,93,3,99,96,3,102,99,3
lpb $0
mov $2,$0
mod $2,3
pow $2,2
mov $3,$0
sub $0,$2
add $3,2
lpe
mov $0,$3
add $0,3
|
proglangs-learning/Agda/sv20/assign2/SetTheory/Logic.agda | helq/old_code | 0 | 12178 | -----------------------------------
-- First order logic
-----------------------------------
module sv20.assign2.SetTheory.Logic where
infix 4 _,_
infix 3 ¬_
infix 1 _∧_
infix 1 _∨_
infix 0 _⇔_
-- Some First order logic I need.
-- ∧ data type (conjunction).
data _∧_ (A B : Set) : Set where
_,_ : A → B → A ∧ B
∧-proj₁ : ∀ {A B} → A ∧ B → A
∧-proj₁ (a , _) = a
∧-proj₂ : ∀ {A B} → A ∧ B → B
∧-proj₂ (_ , b) = b
-- ∨ data type (disjunction), with many useful properties.
data _∨_ (A B : Set) : Set where
inj₁ : A → A ∨ B
inj₂ : B → A ∨ B
∨-e : (A B C : Set) → A ∨ B → (A → C) → (B → C) → C
∨-e A B C (inj₁ a) i₁ i₂ = i₁ a
∨-e A B C (inj₂ b) i₁ i₂ = i₂ b
∨-sym : (A B : Set) → A ∨ B → B ∨ A
∨-sym A B (inj₁ a) = inj₂ a
∨-sym A B (inj₂ b) = inj₁ b
trivial : (A : Set) → A → A
trivial _ A = A
∨-idem : (A : Set) → A ∨ A → A
∨-idem A (inj₁ a) = a
∨-idem A (inj₂ a) = a
∨-prop₁ : {A B C : Set} → (A ∨ B → C) → A → C
∨-prop₁ i a = i (inj₁ a)
∨-prop₂ : {A B C : Set} → (A ∨ B → C) → B → C
∨-prop₂ i b = i (inj₂ b)
∨-prop₃ : {A B C : Set} → A ∨ B → (A → C) → C ∨ B
∨-prop₃ (inj₁ x) i = inj₁ (i x)
∨-prop₃ (inj₂ x) i = inj₂ x
∨-prop₄ : {A B C : Set} → A ∨ B → (B → C) → A ∨ C
∨-prop₄ (inj₁ x) x₁ = inj₁ x
∨-prop₄ (inj₂ x) x₁ = inj₂ (x₁ x)
∨-prop₅ : {A B C D : Set} → A ∨ B → (A → C) → (B → D) → C ∨ D
∨-prop₅ (inj₁ a) a→c b→d = inj₁ (a→c a)
∨-prop₅ (inj₂ b) a→c b→d = inj₂ (b→d b)
∨-∧ : {A B : Set} → (A ∧ B) ∨ (B ∧ A) → A ∧ B
∨-∧ (inj₁ (a , b)) = a , b
∨-∧ (inj₂ (b , a)) = a , b
-- Bi-implication.
_⇔_ : Set → Set → Set
A ⇔ B = (A → B) ∧ (B → A)
⇔-p : (A B C : Set) → A ⇔ (B ∧ C) → (C → B) → A ⇔ C
⇔-p A B C (h₁ , h₂) h₃ = prf₁ , prf₂
where
prf₁ : A → C
prf₁ A = ∧-proj₂ (h₁ A)
prf₂ : C → A
prf₂ C = h₂ ((h₃ C) , C)
-- Empty data type.
data ⊥ : Set where
⊥-elim : {A : Set} → ⊥ → A
⊥-elim ()
data ⊤ : Set where
tt : ⊤
-- Negation
¬_ : Set → Set
¬ A = A → ⊥
cont : (A : Set) → A ∧ ¬ A → ⊥
cont _ (x , ¬x) = ¬x x
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_m_tapein_getpos.asm | Toysoft/z88dk | 0 | 244136 | ; uint16_t esx_m_tapein_getpos(void)
SECTION code_esxdos
PUBLIC esx_m_tapein_getpos
EXTERN asm_esx_m_tapein_getpos
defc esx_m_tapein_getpos = asm_esx_m_tapein_getpos
|
src/pp/block3/cc/antlr/ExpressionAttr.g4 | Pieterjaninfo/PP | 0 | 506 | <reponame>Pieterjaninfo/PP
grammar ExpressionAttr;
import ExpressionVocab;
expr returns [ pp.block3.cc.antlr.Type val ]
: e0=expr POW e1=expr
{ $val = ($e0.val != Type.BOOL && $e1.val == Type.NUM ) ? $e0.val : Type.ERR; }
| e0=expr PLUS e1=expr
{ $val = ($e0.val == $e1.val) ? $e0.val : Type.ERR; }
| e0=expr EQ e1=expr
{ $val = ($e0.val == $e1.val) ? Type.BOOL : Type.ERR; }
| LPAR e=expr RPAR
{ $val = $e.val; }
| NUM
{ $val = Type.NUM; }
| BOOL
{ $val = Type.BOOL; }
| STR
{ $val = Type.STR; }
;
|
Levels/Misc/Map - Still Sprites S3.asm | NatsumiFox/AMPS-Sonic-3-Knuckles | 5 | 7369 | dc.w word_2B3DA-Map_StillSprites
dc.w word_2B3E8-Map_StillSprites
dc.w word_2B3F0-Map_StillSprites
dc.w word_2B3F8-Map_StillSprites
dc.w word_2B400-Map_StillSprites
dc.w word_2B3DA-Map_StillSprites
dc.w word_2B40E-Map_StillSprites
dc.w word_2B470-Map_StillSprites
dc.w word_2B4A2-Map_StillSprites
dc.w word_2B4BC-Map_StillSprites
dc.w word_2B4F4-Map_StillSprites
dc.w word_2B53E-Map_StillSprites
dc.w word_2B552-Map_StillSprites
dc.w word_2B566-Map_StillSprites
dc.w word_2B57A-Map_StillSprites
dc.w word_2B58E-Map_StillSprites
dc.w word_2B5A8-Map_StillSprites
dc.w word_2B5CE-Map_StillSprites
dc.w word_2B5DC-Map_StillSprites
dc.w word_2B60E-Map_StillSprites
dc.w word_2B616-Map_StillSprites
dc.w word_2B61E-Map_StillSprites
dc.w word_2B638-Map_StillSprites
dc.w word_2B61E-Map_StillSprites
word_2B3DA: dc.w 2
dc.b $F4, 5, 1, $26, $FF, $F4
dc.b 4, 8, 1, $2A, $FF, $F4
word_2B3E8: dc.w 1
dc.b $F8, $D, 0, 0, $FF, $F0
word_2B3F0: dc.w 1
dc.b $FC, 4, 0, 8, $FF, $F8
word_2B3F8: dc.w 1
dc.b $F8, 5, 0, $26, $FF, $F8
word_2B400: dc.w 2
dc.b $E0, 7, 0, $3A, $FF, $F8
dc.b 0, 7, 0, $42, $FF, $F8
word_2B40E: dc.w $10
dc.b $C0, $F, 0, $50, $FF, $C0
dc.b $C0, $F, 0, $50, $FF, $E0
dc.b $C0, $F, 0, $50, 0, 0
dc.b $C0, $F, 0, $50, 0, $20
dc.b $E0, $F, 0, $50, $FF, $C0
dc.b $E0, $F, 0, $50, $FF, $E0
dc.b $E0, $F, 0, $50, 0, 0
dc.b $E0, $F, 0, $50, 0, $20
dc.b 0, $F, 0, $50, $FF, $C0
dc.b 0, $F, 0, $50, $FF, $E0
dc.b 0, $F, 0, $50, 0, 0
dc.b 0, $F, 0, $50, 0, $20
dc.b $20, $F, 0, $50, $FF, $C0
dc.b $20, $F, 0, $50, $FF, $E0
dc.b $20, $F, 0, $50, 0, 0
dc.b $20, $F, 0, $50, 0, $20
word_2B470: dc.w 8
dc.b $E0, $F, 0, $50, $FF, $C0
dc.b $E0, $F, 0, $50, $FF, $E0
dc.b $E0, $F, 0, $50, 0, 0
dc.b $E0, $F, 0, $50, 0, $20
dc.b 0, $F, 0, $50, $FF, $C0
dc.b 0, $F, 0, $50, $FF, $E0
dc.b 0, $F, 0, $50, 0, 0
dc.b 0, $F, 0, $50, 0, $20
word_2B4A2: dc.w 4
dc.b $F0, $F, 0, $50, $FF, $C0
dc.b $F0, $F, 0, $50, $FF, $E0
dc.b $F0, $F, 0, $50, 0, 0
dc.b $F0, $F, 0, $50, 0, $20
word_2B4BC: dc.w 9
dc.b $C0, $F, 0, $50, 0, $20
dc.b $E0, $F, 0, $50, 0, 0
dc.b $E0, $F, 0, $50, 0, $20
dc.b 0, $F, 0, $50, $FF, $E0
dc.b 0, $F, 0, $50, 0, 0
dc.b 0, $F, 0, $50, 0, $20
dc.b $20, $F, 0, $50, $FF, $C0
dc.b $20, $F, 0, $50, $FF, $E0
dc.b $20, $F, 0, $50, 0, 0
word_2B4F4: dc.w $C
dc.b $A0, $F, 0, $50, $FF, $C0
dc.b $C0, $F, 0, $50, $FF, $C0
dc.b $C0, $F, 0, $50, $FF, $E0
dc.b $E0, $F, 0, $50, $FF, $C0
dc.b $E0, $F, 0, $50, $FF, $E0
dc.b $E0, $F, 0, $50, 0, 0
dc.b 0, $F, 0, $50, $FF, $E0
dc.b 0, $F, 0, $50, 0, 0
dc.b 0, $F, 0, $50, 0, $20
dc.b $20, $F, 0, $50, 0, 0
dc.b $20, $F, 0, $50, 0, $20
dc.b $40, $F, 0, $50, 0, $20
word_2B53E: dc.w 3
dc.b $F0, $E, 0, 3, $FF, $F0
dc.b $E8, 0, 0, 0, $FF, $FC
dc.b 8, 1, 0, 1, $FF, $FC
word_2B552: dc.w 3
dc.b $F0, $E, 8, 3, $FF, $F0
dc.b $E8, 0, 0, 0, $FF, $FC
dc.b 8, 1, 0, 1, $FF, $FC
word_2B566: dc.w 3
dc.b $EC, $B, 0, $F, $FF, $F4
dc.b $E8, 0, 0, 0, $FF, $FC
dc.b 8, 1, 0, 1, $FF, $FC
word_2B57A: dc.w 3
dc.b $EC, $B, 0, $1B, $FF, $F4
dc.b $E8, 0, 0, 0, $FF, $FC
dc.b 8, 1, 0, 1, $FF, $FC
word_2B58E: dc.w 4
dc.b $D0, 5, 0, 0, $FF, $F8
dc.b $E0, 3, 0, 4, $FF, $F8
dc.b 0, 2, 0, 8, $FF, $F8
dc.b $18, 6, 0, $B, $FF, $F8
word_2B5A8: dc.w 6
dc.b $E8, 9, 0, 0, $FF, $D0
dc.b $F8, $C, 0, 6, $FF, $D0
dc.b 0, $C, 0, $A, $FF, $D8
dc.b 8, $D, 0, $E, $FF, $D8
dc.b 8, 9, 0, $16, $FF, $F8
dc.b $10, $C, 0, $1C, 0, $10
word_2B5CE: dc.w 2
dc.b $F0, 4, 0, 0, $FF, $FC
dc.b $F8, $A, 0, 2, $FF, $F4
word_2B5DC: dc.w 8
dc.b $CC, 7, 0, 0, $FF, $E0
dc.b $EC, 6, 0, 8, $FF, $E0
dc.b $DC, 7, 0, 0, $FF, $F0
dc.b $FC, 6, 0, 8, $FF, $F0
dc.b $EC, 7, 0, 0, 0, 0
dc.b $C, 6, 0, 8, 0, 0
dc.b $FC, 7, 0, 0, 0, $10
dc.b $1C, 6, 0, 8, 0, $10
word_2B60E: dc.w 1
dc.b $F0, 3, 0, 0, $FF, $FC
word_2B616: dc.w 1
dc.b $F8, 5, 0, $22, $FF, $F8
word_2B61E: dc.w 4
dc.b $C0, $F, 0, 9, $FF, $F0
dc.b $E0, $F, 8, 9, $FF, $F0
dc.b 0, $F, 0, 9, $FF, $F0
dc.b $20, $F, 8, 9, $FF, $F0
word_2B638: dc.w 8
dc.b $80, $F, 0, 9, $FF, $F0
dc.b $A0, $F, 8, 9, $FF, $F0
dc.b $C0, $F, 0, 9, $FF, $F0
dc.b $E0, $F, 8, 9, $FF, $F0
dc.b 0, $F, 0, 9, $FF, $F0
dc.b $20, $F, 8, 9, $FF, $F0
dc.b $40, $F, 0, 9, $FF, $F0
dc.b $60, $F, 8, 9, $FF, $F0
|
awa/plugins/awa-wikis/src/awa-wikis-servlets.ads | twdroeger/ada-awa | 81 | 11410 | -----------------------------------------------------------------------
-- awa-wikis-servlets -- Serve files saved in the storage service
-- Copyright (C) 2016, 2019 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Ada.Calendar;
with ADO;
with ASF.Requests;
with AWA.Storages.Servlets;
package AWA.Wikis.Servlets is
-- The <b>Storage_Servlet</b> represents the component that will handle
-- an HTTP request received by the server.
type Image_Servlet is new AWA.Storages.Servlets.Storage_Servlet with private;
-- Load the data content that correspond to the GET request and get the name as well
-- as mime-type and date.
overriding
procedure Load (Server : in Image_Servlet;
Request : in out ASF.Requests.Request'Class;
Name : out Ada.Strings.Unbounded.Unbounded_String;
Mime : out Ada.Strings.Unbounded.Unbounded_String;
Date : out Ada.Calendar.Time;
Data : out ADO.Blob_Ref);
-- Get the expected return mode (content disposition for download or inline).
overriding
function Get_Format (Server : in Image_Servlet;
Request : in ASF.Requests.Request'Class)
return AWA.Storages.Servlets.Get_Type;
private
type Image_Servlet is new AWA.Storages.Servlets.Storage_Servlet with null record;
end AWA.Wikis.Servlets;
|
src/_test/fixtures/apsepp_scope_debug_test_fixture.adb | thierr26/ada-apsepp | 0 | 15228 | <reponame>thierr26/ada-apsepp
-- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
package body Apsepp_Scope_Debug_Test_Fixture is
----------------------------------------------------------------------------
Scope_Entry_Count_Var : Natural := 0;
Scope_Exit_Count_Var : Natural := 0;
----------------------------------------------------------------------------
procedure Increment_Scope_Entry_Count is
begin
Scope_Entry_Count_Var := Scope_Entry_Count_Var + 1;
end Increment_Scope_Entry_Count;
----------------------------------------------------------------------------
procedure Increment_Scope_Exit_Count is
begin
Scope_Exit_Count_Var := Scope_Exit_Count_Var + 1;
end Increment_Scope_Exit_Count;
----------------------------------------------------------------------------
not overriding
procedure Reset (Obj : Scope_Debug_Test_Fixture) is
pragma Unreferenced (Obj);
begin
Scope_Entry_Count_Var := 0;
Scope_Exit_Count_Var := 0;
end Reset;
----------------------------------------------------------------------------
not overriding
function Scope_Entry_Count (Obj : Scope_Debug_Test_Fixture) return Natural
is (Scope_Entry_Count_Var);
----------------------------------------------------------------------------
not overriding
function Scope_Exit_Count (Obj : Scope_Debug_Test_Fixture) return Natural
is (Scope_Exit_Count_Var);
----------------------------------------------------------------------------
overriding
procedure Trace (Obj : in out SDFDT;
Message : String;
Entity_Name : String := "") is
pragma Unreferenced (Obj, Entity_Name);
begin
if Message = "Entry" then
Increment_Scope_Entry_Count;
elsif Message = "Exit" then
Increment_Scope_Exit_Count;
end if;
end Trace;
----------------------------------------------------------------------------
end Apsepp_Scope_Debug_Test_Fixture;
|
v0100/srclib/c0dh.asm | domesticmouse/SmallerC | 1,130 | 104033 | ;
; Copyright (c) 2014-2015, <NAME>
; 2-clause BSD license.
;
bits 16
extern ___start__
extern __start__relot, __stop__relot
extern __start__relod, __stop__relod
extern __start__bss
extern __stop__bss
section .text
global __start
__start:
; perform code/data relocations
call labnext
labnext:
xor ebx, ebx
mov bx, cs
shl ebx, 4
xor eax, eax
pop ax
add ebx, eax
sub ebx, labnext ; ebx = base physical address
mov esi, __start__relot
relo_text_loop:
cmp esi, __stop__relot
jae relo_text_done
lea edi, [ebx + esi] ; edi = physical address of a relocation table element
ror edi, 4
mov ds, di
shr edi, 28
mov edi, [di]
add edi, ebx ; edi = physical address of a dword to which to add ebx and which then to transform into seg:ofs far pointer
ror edi, 4
mov ds, di
shr edi, 28
mov eax, [di]
add eax, ebx
shl eax, 12
rol ax, 4
mov [di], eax
add esi, 4
jmp relo_text_loop
relo_text_done:
mov esi, __start__relod
relo_data_loop:
cmp esi, __stop__relod
jae relo_data_done
lea edi, [ebx + esi] ; edi = physical address of a relocation table element
ror edi, 4
mov ds, di
shr edi, 28
mov edi, [di]
add edi, ebx ; edi = physical address of a dword to which to add ebx
ror edi, 4
mov ds, di
shr edi, 28
add [di], ebx ; actual relocation
add esi, 4
jmp relo_data_loop
relo_data_done:
; Init .bss
push ebx
lea edi, [ebx + __start__bss]
lea ebx, [ebx + __stop__bss]
sub ebx, edi
ror edi, 4
mov es, di
shr edi, 28
xor al, al
cld
bss1:
mov ecx, 32768
cmp ebx, ecx
jc bss2
sub ebx, ecx
rep stosb
and di, 15
mov si, es
add si, 2048
mov es, si
jmp bss1
bss2:
mov cx, bx
rep stosb
pop ebx
lea eax, [ebx + ___start__]
shl eax, 12
rol ax, 4
push eax
retf ; __start__() will set up argc and argv for main() and call exit(main(argc, argv))
section .text
rt: dd rt
section .relot
dd rt ; .relot must exist for __start__relot and __stop__relot to also exist
section .data
rd: dd rd
section .relod
dd rd ; .relod must exist for __start__relod and __stop__relod to also exist
section .bss
; .bss must exist for __start__bss and __stop__bss to also exist
resd 1
|
fiat-amd64/54.52_ratio13237_seed2165586197121668_square_p256.asm | dderjoel/fiat-crypto | 491 | 245433 | SECTION .text
GLOBAL square_p256
square_p256:
sub rsp, 0xa8 ; last 0x30 (6) for Caller - save regs
mov [ rsp + 0x78 ], rbx; saving to stack
mov [ rsp + 0x80 ], rbp; saving to stack
mov [ rsp + 0x88 ], r12; saving to stack
mov [ rsp + 0x90 ], r13; saving to stack
mov [ rsp + 0x98 ], r14; saving to stack
mov [ rsp + 0xa0 ], r15; saving to stack
mov rax, [ rsi + 0x10 ]; load m64 x2 to register64
mov rdx, rax; x2 to rdx
mulx rax, r10, [ rsi + 0x8 ]; x89, x88<- x2 * arg1[1]
mulx r11, rbx, [ rsi + 0x0 ]; x91, x90<- x2 * arg1[0]
test al, al
adox r10, r11
mov rbp, [ rsi + 0x8 ]; load m64 x1 to register64
mulx r12, r13, [ rsi + 0x18 ]; x85, x84<- x2 * arg1[3]
xchg rdx, rbp; x1, swapping with x2, which is currently in rdx
mulx r14, r15, [ rsi + 0x0 ]; x46, x45<- x1 * arg1[0]
xchg rdx, rbp; x2, swapping with x1, which is currently in rdx
mulx rdx, rcx, [ rsi + 0x10 ]; x87, x86<- x2 * arg1[2]
mov r8, rdx; preserving value of x87 into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mulx r9, r11, rbp; x44, x43<- x1 * arg1[1]
mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx
mov [ rsp + 0x0 ], rdi; spilling out1 to mem
mov [ rsp + 0x8 ], r10; spilling x92 to mem
mulx rdi, r10, rbp; x40, x39<- x1 * arg1[3]
adcx r11, r14
mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx
mulx rbp, r14, rbp; x42, x41<- x1 * arg1[2]
mov rdx, [ rsi + 0x18 ]; load m64 x3 to register64
adcx r14, r9
adcx r10, rbp
mulx r9, rbp, [ rsi + 0x10 ]; x132, x131<- x3 * arg1[2]
mov [ rsp + 0x10 ], r10; spilling x51 to mem
mov [ rsp + 0x18 ], r14; spilling x49 to mem
mulx r10, r14, [ rsi + 0x0 ]; x136, x135<- x3 * arg1[0]
mov [ rsp + 0x20 ], r14; spilling x135 to mem
mov r14, 0x0 ; moving imm to reg
adcx rdi, r14
adox rcx, rax
mulx rax, r14, [ rsi + 0x8 ]; x134, x133<- x3 * arg1[1]
mov [ rsp + 0x28 ], rcx; spilling x94 to mem
mov rcx, [ rsi + 0x0 ]; load m64 x4 to register64
mov [ rsp + 0x30 ], rdi; spilling x53 to mem
mulx rdx, rdi, [ rsi + 0x18 ]; x130, x129<- x3 * arg1[3]
adox r13, r8
clc;
adcx r14, r10
xchg rdx, rcx; x4, swapping with x130, which is currently in rdx
mulx r8, r10, [ rsi + 0x0 ]; x12, x11<- x4 * arg1[0]
adcx rbp, rax
adcx rdi, r9
mulx r9, rax, [ rsi + 0x8 ]; x10, x9<- x4 * arg1[1]
mov [ rsp + 0x38 ], rdi; spilling x141 to mem
mov [ rsp + 0x40 ], rbp; spilling x139 to mem
mulx rdi, rbp, [ rsi + 0x10 ]; x8, x7<- x4 * arg1[2]
mov [ rsp + 0x48 ], r14; spilling x137 to mem
mov r14, 0x0 ; moving imm to reg
adcx rcx, r14
mov r14, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r10; x11, swapping with x4, which is currently in rdx
mov [ rsp + 0x50 ], rcx; spilling x143 to mem
mov [ rsp + 0x58 ], r13; spilling x96 to mem
mulx rcx, r13, r14; x25, x24<- x11 * 0xffffffffffffffff
mov r14, 0x0 ; moving imm to reg
adox r12, r14
mov r14, 0xffffffff ; moving imm to reg
mov [ rsp + 0x60 ], r12; spilling x98 to mem
mov [ rsp + 0x68 ], rdi; spilling x8 to mem
mulx r12, rdi, r14; x23, x22<- x11 * 0xffffffff
xor r14, r14
adox r13, rdx
adcx rdi, rcx
setc r13b; spill CF x27 to reg (r13)
clc;
adcx rax, r8
adox rdi, rax
movzx r8, r13b; x28, copying x27 here, cause x27 is needed in a reg for other than x28, namely all: , x28, size: 1
lea r8, [ r8 + r12 ]
adcx rbp, r9
setc r9b; spill CF x16 to reg (r9)
clc;
adcx r15, rdi
mov rcx, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r15; x54, swapping with x11, which is currently in rdx
mulx r12, r13, rcx; x69, x68<- x54 * 0xffffffffffffffff
adox r8, rbp
adcx r11, r8
mov rax, 0xffffffff ; moving imm to reg
mulx rdi, rbp, rax; x67, x66<- x54 * 0xffffffff
mov r8, 0xffffffff00000001 ; moving imm to reg
xchg rdx, r15; x11, swapping with x54, which is currently in rdx
mulx rdx, r14, r8; x21, x20<- x11 * 0xffffffff00000001
setc r8b; spill CF x57 to reg (r8)
clc;
adcx rbp, r12
setc r12b; spill CF x71 to reg (r12)
clc;
adcx r13, r15
adcx rbp, r11
setc r13b; spill CF x76 to reg (r13)
clc;
adcx rbx, rbp
xchg rdx, rcx; 0xffffffffffffffff, swapping with x21, which is currently in rdx
mulx r11, rbp, rbx; x114, x113<- x99 * 0xffffffffffffffff
xchg rdx, r10; x4, swapping with 0xffffffffffffffff, which is currently in rdx
mulx rdx, rax, [ rsi + 0x18 ]; x6, x5<- x4 * arg1[3]
setc r10b; spill CF x100 to reg (r10)
clc;
adcx rbp, rbx
setc bpl; spill CF x119 to reg (rbp)
clc;
mov byte [ rsp + 0x70 ], r10b; spilling byte x100 to mem
mov r10, -0x1 ; moving imm to reg
movzx r9, r9b
adcx r9, r10; loading flag
adcx rax, [ rsp + 0x68 ]
mov r9, 0x0 ; moving imm to reg
adcx rdx, r9
adox r14, rax
clc;
movzx r8, r8b
adcx r8, r10; loading flag
adcx r14, [ rsp + 0x18 ]
movzx r8, r12b; x72, copying x71 here, cause x71 is needed in a reg for other than x72, namely all: , x72, size: 1
lea r8, [ r8 + rdi ]
adox rcx, rdx
mov rdi, 0xffffffff ; moving imm to reg
mov rdx, rbx; x99 to rdx
mulx rbx, r12, rdi; x112, x111<- x99 * 0xffffffff
setc al; spill CF x59 to reg (rax)
clc;
adcx r12, r11
seto r11b; spill OF x38 to reg (r11)
inc r10; OF<-0x0, preserve CF (debug: state 1(-0x1) (thanks Paul))
mov r9, -0x1 ; moving imm to reg
movzx r13, r13b
adox r13, r9; loading flag
adox r14, r8
adcx rbx, r10
movzx r13, byte [ rsp + 0x70 ]; load byte memx100 to register64
clc;
adcx r13, r9; loading flag
adcx r14, [ rsp + 0x8 ]
setc r13b; spill CF x102 to reg (r13)
clc;
movzx rax, al
adcx rax, r9; loading flag
adcx rcx, [ rsp + 0x10 ]
movzx r11, r11b
mov rax, [ rsp + 0x30 ]; x62, copying x53 here, cause x53 is needed in a reg for other than x62, namely all: , x62--x63, size: 1
adcx rax, r11
setc r8b; spill CF x63 to reg (r8)
clc;
movzx rbp, bpl
adcx rbp, r9; loading flag
adcx r14, r12
mov rbp, 0xffffffff00000001 ; moving imm to reg
xchg rdx, r15; x54, swapping with x99, which is currently in rdx
mulx rdx, r11, rbp; x65, x64<- x54 * 0xffffffff00000001
adox r11, rcx
xchg rdx, rbp; 0xffffffff00000001, swapping with x65, which is currently in rdx
mulx r15, r12, r15; x110, x109<- x99 * 0xffffffff00000001
adox rbp, rax
movzx rcx, r8b; x83, copying x63 here, cause x63 is needed in a reg for other than x83, namely all: , x83, size: 1
adox rcx, r10
inc r9; OF<-0x0, preserve CF (debug: state 1(-0x1) (thanks Paul))
mov r10, -0x1 ; moving imm to reg
movzx r13, r13b
adox r13, r10; loading flag
adox r11, [ rsp + 0x28 ]
mov r13, [ rsp + 0x58 ]; x105, copying x96 here, cause x96 is needed in a reg for other than x105, namely all: , x105--x106, size: 1
adox r13, rbp
mov r8, [ rsp + 0x60 ]; x107, copying x98 here, cause x98 is needed in a reg for other than x107, namely all: , x107--x108, size: 1
adox r8, rcx
adcx rbx, r11
seto al; spill OF x108 to reg (rax)
mov rbp, -0x3 ; moving imm to reg
inc rbp; OF<-0x0, preserve CF (debug 7; load -3, increase it, save it as -2). #last resort
adox r14, [ rsp + 0x20 ]
adcx r12, r13
mov rcx, [ rsp + 0x48 ]; x146, copying x137 here, cause x137 is needed in a reg for other than x146, namely all: , x146--x147, size: 1
adox rcx, rbx
mov r11, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r11; 0xffffffffffffffff, swapping with 0xffffffff00000001, which is currently in rdx
mulx r13, rbx, r14; x159, x158<- x144 * 0xffffffffffffffff
adcx r15, r8
mov r8, [ rsp + 0x40 ]; x148, copying x139 here, cause x139 is needed in a reg for other than x148, namely all: , x148--x149, size: 1
adox r8, r12
xchg rdx, rdi; 0xffffffff, swapping with 0xffffffffffffffff, which is currently in rdx
mulx r12, r9, r14; x157, x156<- x144 * 0xffffffff
movzx rbp, al; x128, copying x108 here, cause x108 is needed in a reg for other than x128, namely all: , x128, size: 1
mov r10, 0x0 ; moving imm to reg
adcx rbp, r10
clc;
adcx r9, r13
adcx r12, r10
mov rax, [ rsp + 0x38 ]; x150, copying x141 here, cause x141 is needed in a reg for other than x150, namely all: , x150--x151, size: 1
adox rax, r15
clc;
adcx rbx, r14
mov rbx, [ rsp + 0x50 ]; x152, copying x143 here, cause x143 is needed in a reg for other than x152, namely all: , x152--x153, size: 1
adox rbx, rbp
xchg rdx, r11; 0xffffffff00000001, swapping with 0xffffffff, which is currently in rdx
mulx r14, r13, r14; x155, x154<- x144 * 0xffffffff00000001
adcx r9, rcx
adcx r12, r8
setc cl; spill CF x168 to reg (rcx)
seto r15b; spill OF x153 to reg (r15)
mov r8, r9; x174, copying x165 here, cause x165 is needed in a reg for other than x174, namely all: , x184, x174--x175, size: 2
sub r8, rdi
mov rbp, r12; x176, copying x167 here, cause x167 is needed in a reg for other than x176, namely all: , x185, x176--x177, size: 2
sbb rbp, r11
dec r10; OF<-0x0, preserve CF (debug: state 3 (y: 0, n: -1))
movzx rcx, cl
adox rcx, r10; loading flag
adox rax, r13
adox r14, rbx
movzx rbx, r15b; x173, copying x153 here, cause x153 is needed in a reg for other than x173, namely all: , x173, size: 1
mov r13, 0x0 ; moving imm to reg
adox rbx, r13
mov r15, rax; x178, copying x169 here, cause x169 is needed in a reg for other than x178, namely all: , x186, x178--x179, size: 2
sbb r15, 0x00000000
mov rcx, r14; x180, copying x171 here, cause x171 is needed in a reg for other than x180, namely all: , x187, x180--x181, size: 2
sbb rcx, rdx
sbb rbx, 0x00000000
cmovc rbp, r12; if CF, x185<- x167 (nzVar)
cmovc r8, r9; if CF, x184<- x165 (nzVar)
cmovc rcx, r14; if CF, x187<- x171 (nzVar)
mov rbx, [ rsp + 0x0 ]; load m64 out1 to register64
mov [ rbx + 0x0 ], r8; out1[0] = x184
cmovc r15, rax; if CF, x186<- x169 (nzVar)
mov [ rbx + 0x8 ], rbp; out1[1] = x185
mov [ rbx + 0x18 ], rcx; out1[3] = x187
mov [ rbx + 0x10 ], r15; out1[2] = x186
mov rbx, [ rsp + 0x78 ]; restoring from stack
mov rbp, [ rsp + 0x80 ]; restoring from stack
mov r12, [ rsp + 0x88 ]; restoring from stack
mov r13, [ rsp + 0x90 ]; restoring from stack
mov r14, [ rsp + 0x98 ]; restoring from stack
mov r15, [ rsp + 0xa0 ]; restoring from stack
add rsp, 0xa8
ret
; cpu AMD Ryzen 7 5800X 8-Core Processor
; clocked at 2200 MHz
; first cyclecount 74.29, best 53.14492753623188, lastGood 54.52173913043478
; seed 2165586197121668
; CC / CFLAGS clang / -march=native -mtune=native -O3
; time needed: 634766 ms / 60000 runs=> 10.579433333333334ms/run
; Time spent for assembling and measureing (initial batch_size=138, initial num_batches=101): 157898 ms
; Ratio (time for assembling + measure)/(total runtime for 60000runs): 0.2487499330461934
; number reverted permutation/ tried permutation: 25036 / 29947 =83.601%
; number reverted decision/ tried decision: 22006 / 30054 =73.222% |
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1259.asm | ljhsiun2/medusa | 9 | 19300 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xb537, %r9
nop
nop
nop
nop
nop
xor %r13, %r13
movl $0x61626364, (%r9)
nop
nop
xor %rdx, %rdx
lea addresses_WC_ht+0x18967, %rsi
lea addresses_normal_ht+0x1dba7, %rdi
nop
nop
nop
nop
sub %r9, %r9
mov $53, %rcx
rep movsq
nop
and $11867, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %r9
push %rax
push %rdx
// Store
lea addresses_PSE+0x12f9b, %r15
and %rdx, %rdx
movb $0x51, (%r15)
nop
nop
and %r15, %r15
// Store
lea addresses_A+0x1e0a7, %rax
nop
nop
sub $11783, %r10
mov $0x5152535455565758, %r12
movq %r12, %xmm0
vmovups %ymm0, (%rax)
nop
nop
nop
nop
and $1978, %rax
// Load
lea addresses_PSE+0xd227, %r14
nop
nop
nop
and %r15, %r15
vmovups (%r14), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %r12
nop
nop
nop
xor $43950, %r12
// Store
lea addresses_WC+0x1227, %r9
sub %r12, %r12
movb $0x51, (%r9)
nop
nop
nop
xor %r9, %r9
// Faulty Load
lea addresses_WC+0x1227, %rax
nop
nop
add $57999, %r15
vmovups (%rax), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r12
lea oracles, %r10
and $0xff, %r12
shlq $12, %r12
mov (%r10,%r12,1), %r12
pop %rdx
pop %rax
pop %r9
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
programs/oeis/002/A002089.asm | neoneye/loda | 22 | 23575 | <filename>programs/oeis/002/A002089.asm
; A002089: a(n) = 11*4^n.
; 11,44,176,704,2816,11264,45056,180224,720896,2883584,11534336,46137344,184549376,738197504,2952790016,11811160064,47244640256,188978561024,755914244096,3023656976384,12094627905536,48378511622144,193514046488576,774056185954304,3096224743817216,12384898975268864,49539595901075456,198158383604301824,792633534417207296,3170534137668829184,12682136550675316736,50728546202701266944,202914184810805067776,811656739243220271104,3246626956972881084416,12986507827891524337664,51946031311566097350656,207784125246264389402624,831136500985057557610496,3324546003940230230441984,13298184015760920921767936,53192736063043683687071744,212770944252174734748286976,851083777008698938993147904,3404335108034795755972591616,13617340432139183023890366464,54469361728556732095561465856,217877446914226928382245863424,871509787656907713528983453696,3486039150627630854115933814784,13944156602510523416463735259136,55776626410042093665854941036544,223106505640168374663419764146176,892426022560673498653679056584704,3569704090242693994614716226338816,14278816360970775978458864905355264,57115265443883103913835459621421056,228461061775532415655341838485684224,913844247102129662621367353942736896
mov $1,4
pow $1,$0
mul $1,11
mov $0,$1
|
programs/oeis/066/A066300.asm | neoneye/loda | 22 | 9020 | <filename>programs/oeis/066/A066300.asm
; A066300: Number of n X n matrices with exactly 2 1's in each row, other entries 0.
; 0,1,27,1296,100000,11390625,1801088541,377801998336,101559956668416,34050628916015625,13931233916552734375,6831675453247426400256,3955759092264800909058048,2670419511272061205254504361
add $0,1
gcd $2,$0
bin $0,2
pow $0,$2
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_120.asm | ljhsiun2/medusa | 9 | 175466 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1574e, %rdx
nop
nop
nop
xor $860, %r14
mov $0x6162636465666768, %rbx
movq %rbx, (%rdx)
nop
nop
inc %r10
lea addresses_D_ht+0xa4a, %rsi
lea addresses_WC_ht+0xd6fa, %rdi
clflush (%rsi)
nop
nop
nop
nop
cmp %r14, %r14
mov $83, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $52313, %rdi
lea addresses_WC_ht+0x14622, %rsi
lea addresses_WT_ht+0x1e5a2, %rdi
clflush (%rsi)
nop
nop
nop
nop
add $3636, %r8
mov $125, %rcx
rep movsb
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_WT_ht+0x15f22, %rdx
nop
xor $50585, %r8
movb (%rdx), %r14b
nop
nop
cmp $5382, %r8
lea addresses_D_ht+0x15b42, %rsi
nop
inc %r10
movb $0x61, (%rsi)
nop
nop
and $7242, %rcx
lea addresses_WC_ht+0xa722, %rsi
lea addresses_A_ht+0x13722, %rdi
nop
add $7835, %r14
mov $2, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %r8, %r8
lea addresses_D_ht+0xb322, %rcx
nop
nop
nop
sub $5157, %r10
movb $0x61, (%rcx)
nop
nop
add $28507, %rdx
lea addresses_WT_ht+0x1b0a, %r14
nop
cmp %rbx, %rbx
movl $0x61626364, (%r14)
nop
nop
nop
nop
add $25250, %rdi
lea addresses_UC_ht+0x13722, %rdi
nop
add $3475, %rbx
mov $0x6162636465666768, %r8
movq %r8, %xmm5
vmovups %ymm5, (%rdi)
lfence
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %rbx
push %rdi
push %rdx
push %rsi
// Faulty Load
lea addresses_normal+0x8f22, %rbx
nop
nop
sub %rdi, %rdi
mov (%rbx), %r11d
lea oracles, %rbx
and $0xff, %r11
shlq $12, %r11
mov (%rbx,%r11,1), %r11
pop %rsi
pop %rdx
pop %rdi
pop %rbx
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 8, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': True, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': True, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
src/lang/stemmer-irish.adb | stcarrez/ada-stemmer | 3 | 9906 | -- Generated by Snowball 2.2.0 - https://snowballstem.org/
package body Stemmer.Irish is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*variable*is never read and never assigned*");
pragma Warnings (Off, "*mode could be*instead of*");
pragma Warnings (Off, "*formal parameter.*is not modified*");
pragma Warnings (Off, "*this line is too long*");
pragma Warnings (Off, "*is not referenced*");
procedure R_Verb_sfx (Z : in out Context_Type; Result : out Boolean);
procedure R_Deriv (Z : in out Context_Type; Result : out Boolean);
procedure R_Noun_sfx (Z : in out Context_Type; Result : out Boolean);
procedure R_Mark_regions (Z : in out Context_Type; Result : out Boolean);
procedure R_Initial_morph (Z : in out Context_Type; Result : out Boolean);
procedure R_RV (Z : in out Context_Type; Result : out Boolean);
procedure R_R2 (Z : in out Context_Type; Result : out Boolean);
procedure R_R1 (Z : in out Context_Type; Result : out Boolean);
G_V : constant Grouping_Array (0 .. 159) := (
True, False, False, False, True, False, False, False,
True, False, False, False, False, False, True, False,
False, False, False, False, True, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
True, False, False, False, False, False, False, False,
True, False, False, False, True, False, False, False,
False, False, True, False, False, False, False, False,
False, True, False, False, False, False, False, False
);
Among_String : constant String := "b'" & "bh" & "bhf" & "bp" & "ch" & "d'"
& "d'fh" & "dh" & "dt" & "fh" & "gc" & "gh" & "h-" & "m'" & "mb" & "mh" & "n-"
& "nd" & "ng" & "ph" & "sh" & "t-" & "th" & "ts" & "íochta" & "aíochta" & "ire"
& "aire" & "abh" & "eabh" & "ibh" & "aibh" & "amh" & "eamh" & "imh" & "aimh"
& "íocht" & "aíocht" & "irí" & "airí" & "óideacha" & "patacha" & "achta"
& "arcachta" & "eachta" & "grafaíochta" & "paite" & "ach" & "each" & "óideach"
& "gineach" & "patach" & "grafaíoch" & "pataigh" & "óidigh" & "achtúil"
& "eachtúil" & "gineas" & "ginis" & "acht" & "arcacht" & "eacht" & "grafaíocht"
& "arcachtaí" & "grafaíochtaí" & "imid" & "aimid" & "ímid" & "aímid" & "adh"
& "eadh" & "faidh" & "fidh" & "áil" & "ain" & "tear" & "tar";
A_0 : constant Among_Array_Type (0 .. 23) := (
(1, 2, -1, 1, 0),
(3, 4, -1, 4, 0),
(5, 7, 1, 2, 0),
(8, 9, -1, 8, 0),
(10, 11, -1, 5, 0),
(12, 13, -1, 1, 0),
(14, 17, 5, 2, 0),
(18, 19, -1, 6, 0),
(20, 21, -1, 9, 0),
(22, 23, -1, 2, 0),
(24, 25, -1, 5, 0),
(26, 27, -1, 7, 0),
(28, 29, -1, 1, 0),
(30, 31, -1, 1, 0),
(32, 33, -1, 4, 0),
(34, 35, -1, 10, 0),
(36, 37, -1, 1, 0),
(38, 39, -1, 6, 0),
(40, 41, -1, 7, 0),
(42, 43, -1, 8, 0),
(44, 45, -1, 3, 0),
(46, 47, -1, 1, 0),
(48, 49, -1, 9, 0),
(50, 51, -1, 3, 0));
A_1 : constant Among_Array_Type (0 .. 15) := (
(52, 58, -1, 1, 0),
(59, 66, 0, 1, 0),
(67, 69, -1, 2, 0),
(70, 73, 2, 2, 0),
(74, 76, -1, 1, 0),
(77, 80, 4, 1, 0),
(81, 83, -1, 1, 0),
(84, 87, 6, 1, 0),
(88, 90, -1, 1, 0),
(91, 94, 8, 1, 0),
(95, 97, -1, 1, 0),
(98, 101, 10, 1, 0),
(102, 107, -1, 1, 0),
(108, 114, 12, 1, 0),
(115, 118, -1, 2, 0),
(119, 123, 14, 2, 0));
A_2 : constant Among_Array_Type (0 .. 24) := (
(124, 132, -1, 6, 0),
(133, 139, -1, 5, 0),
(140, 144, -1, 1, 0),
(145, 152, 2, 2, 0),
(153, 158, 2, 1, 0),
(159, 170, -1, 4, 0),
(171, 175, -1, 5, 0),
(176, 178, -1, 1, 0),
(179, 182, 7, 1, 0),
(183, 190, 8, 6, 0),
(191, 197, 8, 3, 0),
(198, 203, 7, 5, 0),
(204, 213, -1, 4, 0),
(214, 220, -1, 5, 0),
(221, 227, -1, 6, 0),
(228, 235, -1, 1, 0),
(236, 244, 15, 1, 0),
(245, 250, -1, 3, 0),
(251, 255, -1, 3, 0),
(256, 259, -1, 1, 0),
(260, 266, 19, 2, 0),
(267, 271, 19, 1, 0),
(272, 282, -1, 4, 0),
(283, 292, -1, 2, 0),
(293, 306, -1, 4, 0));
A_3 : constant Among_Array_Type (0 .. 11) := (
(307, 310, -1, 1, 0),
(311, 315, 0, 1, 0),
(316, 320, -1, 1, 0),
(321, 326, 2, 1, 0),
(327, 329, -1, 2, 0),
(330, 333, 4, 2, 0),
(334, 338, -1, 1, 0),
(339, 342, -1, 1, 0),
(343, 346, -1, 2, 0),
(347, 349, -1, 2, 0),
(350, 353, -1, 2, 0),
(354, 356, -1, 2, 0));
procedure R_Mark_regions (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
v_1 : Char_Index;
begin
-- (, line 28
Z.I_PV := Z.L;
Z.I_P1 := Z.L;
Z.I_P2 := Z.L;
-- do, line 34
v_1 := Z.C;
-- (, line 34
-- gopast, line 35
-- grouping v, line 35
Out_Grouping (Z, G_V, 97, 250, True, C);
if C < 0 then
goto lab0;
end if;
Z.C := Z.C + C;
-- setmark pV, line 35
Z.I_PV := Z.C;
-- gopast, line 36
-- non v, line 36
In_Grouping (Z, G_V, 97, 250, True, C);
if C < 0 then
goto lab0;
end if;
Z.C := Z.C + C;
-- setmark p1, line 36
Z.I_P1 := Z.C;
-- gopast, line 37
-- grouping v, line 37
Out_Grouping (Z, G_V, 97, 250, True, C);
if C < 0 then
goto lab0;
end if;
Z.C := Z.C + C;
-- gopast, line 37
-- non v, line 37
In_Grouping (Z, G_V, 97, 250, True, C);
if C < 0 then
goto lab0;
end if;
Z.C := Z.C + C;
-- setmark p2, line 37
Z.I_P2 := Z.C;
<<lab0>>
Z.C := v_1;
Result := True;
end R_Mark_regions;
procedure R_Initial_morph (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
begin
-- (, line 41
Z.Bra := Z.C; -- [, line 42
-- substring, line 42
Find_Among (Z, A_0, Among_String, null, A);
if A = 0 then
Result := False;
return;
end if;
Z.Ket := Z.C; -- ], line 42
-- among, line 42
case A is
when 1 =>
-- (, line 44
-- delete, line 44
Slice_Del (Z);
when 2 =>
-- (, line 50
-- <-, line 50
Slice_From (Z, "f");
when 3 =>
-- (, line 56
-- <-, line 56
Slice_From (Z, "s");
when 4 =>
-- (, line 59
-- <-, line 59
Slice_From (Z, "b");
when 5 =>
-- (, line 61
-- <-, line 61
Slice_From (Z, "c");
when 6 =>
-- (, line 63
-- <-, line 63
Slice_From (Z, "d");
when 7 =>
-- (, line 67
-- <-, line 67
Slice_From (Z, "g");
when 8 =>
-- (, line 69
-- <-, line 69
Slice_From (Z, "p");
when 9 =>
-- (, line 73
-- <-, line 73
Slice_From (Z, "t");
when 10 =>
-- (, line 87
-- <-, line 87
Slice_From (Z, "m");
when others =>
null;
end case;
Result := True;
end R_Initial_morph;
procedure R_RV (Z : in out Context_Type; Result : out Boolean) is
begin
Result := (Z.I_PV <= Z.C);
end R_RV;
procedure R_R1 (Z : in out Context_Type; Result : out Boolean) is
begin
Result := (Z.I_P1 <= Z.C);
end R_R1;
procedure R_R2 (Z : in out Context_Type; Result : out Boolean) is
begin
Result := (Z.I_P2 <= Z.C);
end R_R2;
procedure R_Noun_sfx (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
begin
-- (, line 101
Z.Ket := Z.C; -- [, line 102
-- substring, line 102
Find_Among_Backward (Z, A_1, Among_String, null, A);
if A = 0 then
Result := False;
return;
end if;
Z.Bra := Z.C; -- ], line 102
-- among, line 102
case A is
when 1 =>
-- (, line 106
-- call R1, line 106
R_R1 (Z, Result);
if not Result then
Result := False;
return;
end if;
-- delete, line 106
Slice_Del (Z);
when 2 =>
-- (, line 108
-- call R2, line 108
R_R2 (Z, Result);
if not Result then
Result := False;
return;
end if;
-- delete, line 108
Slice_Del (Z);
when others =>
null;
end case;
Result := True;
end R_Noun_sfx;
procedure R_Deriv (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
begin
-- (, line 111
Z.Ket := Z.C; -- [, line 112
-- substring, line 112
Find_Among_Backward (Z, A_2, Among_String, null, A);
if A = 0 then
Result := False;
return;
end if;
Z.Bra := Z.C; -- ], line 112
-- among, line 112
case A is
when 1 =>
-- (, line 114
-- call R2, line 114
R_R2 (Z, Result);
if not Result then
Result := False;
return;
end if;
-- delete, line 114
Slice_Del (Z);
when 2 =>
-- (, line 116
-- <-, line 116
Slice_From (Z, "arc");
when 3 =>
-- (, line 118
-- <-, line 118
Slice_From (Z, "gin");
when 4 =>
-- (, line 120
-- <-, line 120
Slice_From (Z, "graf");
when 5 =>
-- (, line 122
-- <-, line 122
Slice_From (Z, "paite");
when 6 =>
-- (, line 124
-- <-, line 124
Slice_From (Z, "óid");
when others =>
null;
end case;
Result := True;
end R_Deriv;
procedure R_Verb_sfx (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
begin
-- (, line 127
Z.Ket := Z.C; -- [, line 128
-- substring, line 128
if Z.C - 2 <= Z.Lb or else Check_Among (Z, Z.C - 1, 3, 16#45110#) then
Result := False;
return;
-- substring, line 128
end if;
Find_Among_Backward (Z, A_3, Among_String, null, A);
if A = 0 then
Result := False;
return;
end if;
Z.Bra := Z.C; -- ], line 128
-- among, line 128
case A is
when 1 =>
-- (, line 131
-- call RV, line 131
R_RV (Z, Result);
if not Result then
Result := False;
return;
end if;
-- delete, line 131
Slice_Del (Z);
when 2 =>
-- (, line 136
-- call R1, line 136
R_R1 (Z, Result);
if not Result then
Result := False;
return;
end if;
-- delete, line 136
Slice_Del (Z);
when others =>
null;
end case;
Result := True;
end R_Verb_sfx;
procedure Stem (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
v_1 : Char_Index;
v_3 : Char_Index;
v_4 : Char_Index;
v_5 : Char_Index;
begin
-- (, line 141
-- do, line 142
v_1 := Z.C;
-- call initial_morph, line 142
R_Initial_morph (Z, Result);
Z.C := v_1;
-- do, line 143
-- call mark_regions, line 143
R_Mark_regions (Z, Result);
Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 144
-- (, line 144
-- do, line 145
v_3 := Z.L - Z.C;
-- call noun_sfx, line 145
R_Noun_sfx (Z, Result);
Z.C := Z.L - v_3;
-- do, line 146
v_4 := Z.L - Z.C;
-- call deriv, line 146
R_Deriv (Z, Result);
Z.C := Z.L - v_4;
-- do, line 147
v_5 := Z.L - Z.C;
-- call verb_sfx, line 147
R_Verb_sfx (Z, Result);
Z.C := Z.L - v_5;
Z.C := Z.Lb;
Result := True;
end Stem;
end Stemmer.Irish;
|
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/polygon.lzh/polygon/sample1/datas.asm | prismotizm/gigaleak | 0 | 163216 | Name: datas.asm
Type: file
Size: 12323
Last-Modified: '1992-09-24T02:23:51Z'
SHA-1: 1389D24523B599659EAB08E89E2F30E5C5A24134
Description: null
|
src/fot/FOTC/Program/MapIterate/MapIterateATP.agda | asr/fotc | 11 | 8352 | ------------------------------------------------------------------------------
-- The map-iterate property: A property using co-induction
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
-- The map-iterate property (Gibbons and Hutton, 2005):
-- map f (iterate f x) = iterate f (f · x)
module FOTC.Program.MapIterate.MapIterateATP where
open import FOTC.Base
open import FOTC.Base.List
open import FOTC.Data.List
open import FOTC.Relation.Binary.Bisimilarity.Type
------------------------------------------------------------------------------
-- The map-iterate property.
≈-map-iterate : ∀ f x → map f (iterate f x) ≈ iterate f (f · x)
≈-map-iterate f x = ≈-coind B h₁ h₂
where
-- Based on the relation used by (Giménez and Castéran, 2007).
B : D → D → Set
B xs ys = ∃[ y ] xs ≡ map f (iterate f y) ∧ ys ≡ iterate f (f · y)
{-# ATP definition B #-}
postulate
h₁ : ∀ {xs} {ys} → B xs ys →
∃[ x' ] ∃[ xs' ] ∃[ ys' ] xs ≡ x' ∷ xs' ∧ ys ≡ x' ∷ ys' ∧ B xs' ys'
{-# ATP prove h₁ #-}
postulate h₂ : B (map f (iterate f x)) (iterate f (f · x))
{-# ATP prove h₂ #-}
------------------------------------------------------------------------------
-- References
--
-- Giménez, <NAME> <NAME> (2007). A Tutorial on
-- [Co-]Inductive Types in Coq.
--
-- <NAME> <NAME> (2005). Proof Methods for
-- Corecursive Programs. Fundamenta Informaticae XX, pp. 1–14.
|
libsrc/_DEVELOPMENT/math/float/am9511/asm/8085/am32_f2long.asm | ped7g/z88dk | 1 | 99514 | ;
; Copyright (c) 2022 <NAME>
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; feilipu, January 2022
;
;-------------------------------------------------------------------------
SECTION code_clib
SECTION code_fp_am9511
EXTERN asm_am9511_zero, asm_am9511_max
IFDEF __CPU_8085__
INCLUDE "../../_DEVELOPMENT/target/am9511/config_am9511_private.inc"
ELSE
INCLUDE "config_am9511_private.inc"
ENDIF
EXTERN asm_am9511_pushf_fastcall
EXTERN asm_am9511_popl
EXTERN asm_am9511_popi
PUBLIC asm_am9511_f2sint
PUBLIC asm_am9511_f2uint
PUBLIC asm_am9511_f2slong
PUBLIC asm_am9511_f2ulong
; Convert floating point number to int
.asm_am9511_f2sint
.asm_am9511_f2uint
ld a,e ;Holds sign + 7bits of exponent
rla
ld a,d ;a = Exponent
rla
or a
jp Z,asm_am9511_zero ;exponent was 0, return 0
cp $7e + 16
jp NC,asm_am9511_max ;number too large
call asm_am9511_pushf_fastcall ;float x
ld a,__IO_APU_OP_FIXS
out (__IO_APU_CONTROL),a ;int x
jp asm_am9511_popi
; Convert floating point number to long
.asm_am9511_f2slong
.asm_am9511_f2ulong
ld a,e ;Holds sign + 7bits of exponent
rla
ld a,d ;a = Exponent
rla
or a
jp Z,asm_am9511_zero ;exponent was 0, return 0
cp $7e + 32
jp NC,asm_am9511_max ;number too large
call asm_am9511_pushf_fastcall ;float x
ld a,__IO_APU_OP_FIXD
out (__IO_APU_CONTROL),a ;long x
jp asm_am9511_popl
|
Structure/Operator/Group/Proofs.agda | Lolirofle/stuff-in-agda | 6 | 4361 | <reponame>Lolirofle/stuff-in-agda
module Structure.Operator.Group.Proofs where
open import Functional hiding (id)
open import Function.Iteration.Order
import Lvl
open import Lang.Instance
open import Logic.Propositional
open import Logic.Predicate
open import Structure.Setoid
open import Structure.Function.Domain
open import Structure.Operator.Group
open import Structure.Operator.Monoid
open import Structure.Operator.Properties
open import Structure.Operator.Proofs
open import Structure.Relator.Properties
open import Syntax.Transitivity
open import Type
{-
module _ {ℓ₁ ℓ₂} {X : Type{ℓ₁}} ⦃ _ : Equiv(X) ⦄ {_▫X_ : X → X → X} ⦃ structureₗ : Group(_▫X_) ⦄ {Y : Type{ℓ₂}} ⦃ _ : Equiv(Y) ⦄ {_▫Y_ : Y → Y → Y} ⦃ structureᵣ : Group(_▫Y_) ⦄ (f : X → Y) where
monomorphic-cyclic : ⦃ (_▫X_) ↣ (_▫Y_) ⦄ → Cyclic(_▫X_) → Cyclic(_▫Y_)
monomorphic-cyclic ⦃ [∃]-intro θ ⦃ θ-proof ⦄ ⦄ ([∃]-intro index ⦃ intro a ⦄) = {!!}
-}
{-
module _ {T : Type{ℓ₂}} {_▫_ : T → T → T} ⦃ group : Group(_▫_) ⦄ where
open Group {T} ⦃ [≡]-equiv ⦄ {_▫_} (group)
open Monoid {T} ⦃ [≡]-equiv ⦄ {_▫_} (monoid)
commutationₗ : ∀{x y} → (x ▫ y ≡ y ▫ x) ← ((x ▫ y) ▫ inv (x) ≡ y)
commutationₗ {x}{y} (comm) =
symmetry(
(congruence₁(_▫ x)
(symmetry comm)
)
🝖 (associativity)
🝖 (congruence₁((x ▫ y) ▫_)) (inverseₗ)
🝖 (identityᵣ)
)
-- (x▫y)▫inv(x) = y //comm
-- y = (x▫y)▫inv(x) //[≡]-symmetry
-- y▫x
-- = ((x▫y)▫inv(x))▫x //congruence₁(expr ↦ expr ▫ x) (..)
-- = (x▫y)▫(inv(x)▫x) //Group.associativity
-- = (x▫y)▫id //congruence₁(_) Group.inverseₗ
-- = x▫y //Group.identityᵣ
-- x▫y = y▫x //[≡]-symmetry
commutationᵣ : ∀{x y} → (x ▫ y ≡ y ▫ x) → ((x ▫ y) ▫ inv(x) ≡ y)
commutationᵣ {x}{y} (comm) =
(congruence₁(_▫ inv(x)) comm)
🝖 (associativity)
🝖 (congruence₁(y ▫_) (inverseᵣ))
🝖 (identityᵣ)
-- x▫y = y▫x //comm
-- (x▫y)▫inv(x)
-- = (y▫x)▫inv(x) //congruence₁(expr ↦ expr ▫ inv(x)) (..)
-- = y▫(x▫inv(x)) //Group.associativity
-- = y▫id //congruence₁(expr ↦ y ▫ expr) Group.inverseᵣ
-- = y //Group.identityᵣ
module _ {T : Type} {_▫_ : T → T → T} ⦃ commGroup : CommutativeGroup(_▫_) ⦄ where
open CommutativeGroup {T} ⦃ [≡]-equiv ⦄ {_▫_} (commGroup)
open Group {T} ⦃ [≡]-equiv ⦄ {_▫_} (group)
open Monoid {T} ⦃ [≡]-equiv ⦄ {_▫_} (monoid)
commutation : ∀{x y} → ((x ▫ y) ▫ inv(x) ≡ y)
commutation = commutationᵣ(commutativity)
module _ {T : Type} {_▫_ : T → T → T} ⦃ associativity : Associativity(_▫_) ⦄ where
-}
|
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/unit_1.adb | ouankou/rose | 488 | 22800 | procedure Unit_1 is
begin
null;
end;
|
libsrc/target/zx81/gen_tv_field.asm | jpoikela/z88dk | 640 | 4225 | <reponame>jpoikela/z88dk<gh_stars>100-1000
;
; ZX81 libraries - Stefano Dec 2012
;
;----------------------------------------------------------------
;
; $Id: gen_tv_field.asm,v 1.4 2016-06-26 20:36:33 dom Exp $
;
;----------------------------------------------------------------
;
; ZX80 (and ZX81 in FAST mode) trick to try to keep the display stable.
; This subroutine should be called in theory after every 1475ms (4731 T-states, corresponding to 22.99 scan lines).
; According to this article: http://www.fruitcake.plus.com/Sinclair/ZX80/FlickerFree/ZX80_DisplayMechanism.htm
; .. a margin has to be considered.
;
;----------------------------------------------------------------
SECTION code_clib
PUBLIC gen_tv_field
PUBLIC _gen_tv_field
PUBLIC DFILE_PTRA
PUBLIC DFILE_PTRB
gen_tv_field:
_gen_tv_field:
OUT ($FF),A ; 11 Turn off the vertical sync generator.
; Generate the top border and main display area.
; NOP
DFILE_PTRA:
LD A,$E9 ; 7 Timing counter for the duration of the first
; scan line of the top border. Thereafter set
; to $DD by the ROM.
; LD BC,$1900 ; 10 There are 25 HALTs within the display file,
LD B,$19
; i.e. 24 rows and 1 top border. C is set only
; to achieve perfect timing.
; LD HL,DFILE+$8000 ; 10 Point to the start of the display file, i.e.
; the initial HALT representing the top border,
; but with bit 15 of the address set.
LD HL,($400C) ;; point HL to D-FILE the first HALT
;; instruction.
SET 7,H ;; now point to the DFILE echo in the
;; top 32K of address space.
DFILE_PTRB:
;LD C,24 ;
LD C,48 ; 7 There are 48 scan lines (UK) above the ZX80
; main display area, or 24 for USA models.
CALL $01B0 ; 17+n Produce the top border and main area.
; Generate the bottom border.
LD A,$EC ; 7 Timing counter for the duration of the first
; scan line of the bottom border. Thereafter
; set to $DD by the ROM.
INC B ; 4 Increment the row count, i.e. B holds $01.
DEC HL ; 6 Decrement the screen address, i.e. point to
; the last HALT.
LD C,$2F ; 7 the blank line counter, i.e. 47 or 23
; scan lines below the ZX80 main display area.
CALL $01B0 ; 17+n Produce the bottom border.
; Start the vertical sync pulse.
IN A,($FE) ; 11 Turn on the vertical sync generator. It be
; will be turned off approximately 23 scan
RET ; 10 lines from now.
|
programs/oeis/114/A114364.asm | karttu/loda | 1 | 11351 | ; A114364: a(n) = n*(n+1)^2.
; 4,18,48,100,180,294,448,648,900,1210,1584,2028,2548,3150,3840,4624,5508,6498,7600,8820,10164,11638,13248,15000,16900,18954,21168,23548,26100,28830,31744,34848,38148,41650,45360,49284,53428,57798,62400
mov $1,$0
add $0,2
pow $0,2
add $1,1
mul $1,$0
|
sk/sfx/75.asm | Cancer52/flamedriver | 9 | 97026 | Sound_75_Header:
smpsHeaderStartSong 3, 1
smpsHeaderVoice Sound_75_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cFM5, Sound_75_FM5, $15, $05
; FM5 Data
Sound_75_FM5:
smpsSetvoice $00
smpsModSet $01, $01, $20, $85
dc.b nD0, $03, nB0, $1E
smpsStop
Sound_75_Voices:
; Voice $00
; $35
; $02, $FD, $01, $F6, $0F, $16, $14, $11, $06, $04, $0F, $08
; $02, $03, $03, $04, $7F, $6F, $3F, $2F, $31, $28, $0E, $80
smpsVcAlgorithm $05
smpsVcFeedback $06
smpsVcUnusedBits $00
smpsVcDetune $0F, $00, $0F, $00
smpsVcCoarseFreq $06, $01, $0D, $02
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $11, $14, $16, $0F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $08, $0F, $04, $06
smpsVcDecayRate2 $04, $03, $03, $02
smpsVcDecayLevel $02, $03, $06, $07
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $80, $0E, $28, $31
|
programs/oeis/173/A173833.asm | neoneye/loda | 22 | 24476 | <filename>programs/oeis/173/A173833.asm<gh_stars>10-100
; A173833: 10^n - 3.
; 7,97,997,9997,99997,999997,9999997,99999997,999999997,9999999997,99999999997,999999999997,9999999999997,99999999999997,999999999999997,9999999999999997,99999999999999997,999999999999999997,9999999999999999997,99999999999999999997,999999999999999999997,9999999999999999999997,99999999999999999999997,999999999999999999999997,9999999999999999999999997,99999999999999999999999997,999999999999999999999999997,9999999999999999999999999997,99999999999999999999999999997,999999999999999999999999999997,9999999999999999999999999999997,99999999999999999999999999999997,999999999999999999999999999999997,9999999999999999999999999999999997,99999999999999999999999999999999997,999999999999999999999999999999999997
add $0,1
mov $1,10
pow $1,$0
sub $1,3
mov $0,$1
|
ReAssemblerTest.asm | hackingotter/LC3-Simulator | 0 | 18557 | .ORIG x3000
AND R0, R0, #0;
AND R1, R0, R0;
ADD R0, R0, #1;
ADD R1, R1, x10;
TEST_STRING .STRINGZ "abcdefg"
.FILL -1
Te .FILL x12bd
.FILL 0x343d
Anothing .STRINGZ 'a'
.FILL -1
AND R4,R3,R2
.END |
hott/level/sets.agda | HoTT/M-types | 27 | 8961 | {-# OPTIONS --without-K #-}
module hott.level.sets where
open import level
open import decidable
open import sum
open import equality.core
open import equality.calculus
open import equality.reasoning
open import function.core
open import function.extensionality.proof
open import sets.empty
open import sets.unit
open import hott.level.core
-- ⊤ is contractible
⊤-contr : contr ⊤
⊤-contr = tt , λ { tt → refl }
-- ⊥ is propositional
⊥-prop : h 1 ⊥
⊥-prop x _ = ⊥-elim x
⊥-initial : ∀ {i} {A : Set i} → contr (⊥ → A)
⊥-initial = (λ ()) , (λ f → funext λ ())
-- Hedberg's theorem
hedberg : ∀ {i} {A : Set i}
→ ((x y : A) → Dec (x ≡ y))
→ h 2 A
hedberg {A = A} dec x y = prop⇒h1 ≡-prop
where
open ≡-Reasoning
canonical : {x y : A} → x ≡ y → x ≡ y
canonical {x} {y} p with dec x y
... | yes q = q
... | no _ = p
canonical-const : {x y : A}
→ (p q : x ≡ y)
→ canonical p ≡ canonical q
canonical-const {x} {y} p q with dec x y
... | yes _ = refl
... | no f = ⊥-elim (f p)
canonical-inv : {x y : A}(p : x ≡ y)
→ canonical p · sym (canonical refl) ≡ p
canonical-inv refl = left-inverse (canonical refl)
≡-prop : {x y : A}(p q : x ≡ y) → p ≡ q
≡-prop p q = begin
p
≡⟨ sym (canonical-inv p) ⟩
canonical p · sym (canonical refl)
≡⟨ ap (λ z → z · sym (canonical refl))
(canonical-const p q) ⟩
canonical q · sym (canonical refl)
≡⟨ canonical-inv q ⟩
q
∎
-- Bool is a set
private
module BoolSet where
open import sets.bool
bool-set : h 2 Bool
bool-set = hedberg _≟_
open BoolSet public
-- Nat is a set
private
module NatSet where
open import sets.nat.core
nat-set : h 2 ℕ
nat-set = hedberg _≟_
open NatSet public
-- Fin is a set
private
module FinSet where
open import sets.fin.core
fin-set : ∀ n → h 2 (Fin n)
fin-set n = hedberg _≟_
open FinSet public
|
programs/oeis/225/A225055.asm | neoneye/loda | 22 | 11589 | ; A225055: Irregular triangle which lists the three positions of 2*n-1 in A060819 in row n.
; 1,2,4,3,6,12,5,10,20,7,14,28,9,18,36,11,22,44,13,26,52,15,30,60,17,34,68,19,38,76,21,42,84,23,46,92,25,50,100,27,54,108,29,58,116,31,62,124,33,66,132,35,70,140,37,74,148,39,78,156,41,82,164,43,86,172,45,90,180,47,94,188,49,98,196,51,102,204,53,106,212,55,110,220,57,114,228,59,118,236,61,122,244,63,126,252,65,130,260,67
mov $2,$0
mov $3,$0
mod $0,3
add $3,1
add $2,$3
lpb $0
sub $2,$0
sub $0,1
mul $2,2
lpe
mul $2,2
add $0,$2
div $0,6
add $0,1
|
oeis/174/A174785.asm | neoneye/loda-programs | 11 | 15199 | <filename>oeis/174/A174785.asm
; A174785: Expansion of (1+2x-x^2+x^3-x^4-x^5)/(1+x^3)^2.
; 1,2,-1,-1,-5,1,1,8,-1,-1,-11,1,1,14,-1,-1,-17,1,1,20,-1,-1,-23,1,1,26,-1,-1,-29,1,1,32,-1,-1,-35,1,1,38,-1,-1,-41,1,1,44,-1,-1,-47,1,1,50,-1
mul $0,2
mov $2,2
mov $3,$0
lpb $0
sub $0,1
trn $0,2
add $2,$3
sub $3,$2
sub $3,$2
lpe
mov $0,$2
div $0,2
|
examenes/examenpracticas/ejercicios/examen4.asm | ajah1/EC | 0 | 162413 | #programa que pide un numero y muestra por pantalla desde 1 hasta ese numero.
.data
cadena1:.asciiz "Introduce un numero: "
.text
li $v0, 4
la $a0, cadena1
syscall
li $v0, 5
syscall
move $t2, $v0
li $t1, 1
inicio_bucle:
bgt $t1, $t2, fin_bucle
li $v0, 1
move $a0, $t1
syscall
addi $t1, $t1, 1
j inicio_bucle
fin_bucle:
#5. programa que pide un numero y muestra la suma desde 1 hasta ese numero:
# numero: 3 => 1 + 2 + 3 = 6 |
Library/Mailbox/VMStore/vmstoreCode.asm | steakknife/pcgeos | 504 | 89797 | <filename>Library/Mailbox/VMStore/vmstoreCode.asm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1994 -- All Rights Reserved
PROJECT: Clavin
MODULE: VM store
FILE: vmstoreCode.asm
AUTHOR: <NAME>, Apr 14, 1994
ROUTINES:
Name Description
---- -----------
VMSStringLengthWithNull
VMSLock
* MailboxGetVMFile
VMSGetVMFileCallback
VMSCreateNewFile
VMSCreateFilename
* MailboxGetVMFileName
VMSFindFileCallback
* MailboxDoneWithVMFile
* MailboxOpenVMFile
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 4/14/94 Initial revision
DESCRIPTION:
$Id: vmstoreCode.asm,v 1.1 97/04/05 01:20:35 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMStore segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMSLock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Lock down the VMStore map in the admin file
CALLED BY: (INTERNAL) MailboxGetVMFile, MailboxGetVMFileName,
MailboxDoneWithVMFile
PASS: nothing
RETURN: *ds:si = vm store name array
DESTROYED: nothing
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMSLock proc near
uses bx, bp, ax
.enter
call AdminGetVMStore
EC < call ECVMCheckVMFile >
EC < push cx, ax >
EC < call VMInfo >
EC < ERROR_C VM_STORE_HANDLE_INVALID >
EC < cmp di, MBVMID_VM_STORE >
EC < ERROR_NE VM_STORE_HANDLE_INVALID >
EC < pop cx, ax >
call VMLock
mov ds, ax
EC < mov bx, bp >
EC < call ECCheckLMemHandle >
EC < call ECLMemValidateHeap >
mov si, ds:[LMBH_offset]
EC < call ECLMemValidateHandle >
.leave
ret
VMSLock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MailboxGetVMFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fetch the handle of a VM file to use for storing message data
CALLED BY: (GLOBAL)
PASS: bx = expected number of VM blocks to be added to the file
RETURN: carry set on error:
ax = VMStatus
bx = destroyed
carry clear if ok:
bx = VMFileHandle
ax = destroyed
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MailboxGetVMFile proc far
uses ds, cx, dx, si, di
.enter
tst bx
jnz haveNumBlocks
mov bx, VMS_DEFAULT_NUM_BLOCKS
haveNumBlocks:
;
; Look for a file with the requisite number of block handles
; available.
;
call VMSLock ; *ds:si <- name array
mov cx, bx
mov bx, cs
mov di, offset VMSGetVMFileCallback
call ChunkArrayEnum ; ax <- file handle, if found
mov_tr bx, ax
cmc
jnc done
;
; Not one available, so create a new one.
;
call VMSCreateNewFile
done:
pushf
call UtilVMDirtyDS
call UtilVMUnlockDS
call UtilUpdateAdminFile
popf
.leave
ret
MailboxGetVMFile endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMSGetVMFileCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Locate a VM file suitable for use
CALLED BY: (INTERNAL) MailboxGetVMFile via ChunkArrayEnum
PASS: ds:di = VMStoreEntry
cx = number of blocks expected to be used
RETURN: carry set if this element is suitable:
ax = file handle
VMSE_refCount incremented
carry clear if this element is not suitable
ax = destroyed
DESTROYED: bx, si, di allowed
dx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMSGetVMFileCallback proc far
uses cx
.enter
cmp ds:[di].VMSE_meta.NAE_meta.REH_refCount.WAAH_high,
EA_FREE_ELEMENT
je done ; keep looking (carry clear)
;
; Element is in-use, so figure the number of used handles in the file.
; If the file is open, we prefer to get the info from the horse's
; mouth (this still won't take care of all potential overcommit
; problems, but does mean we don't have to keep the array up-to-date).
;
mov bx, ds:[di].VMSE_handle
tst bx
jz useStoredValues
push cx
call VMGetHeaderInfo ; ax <- # used blocks
pop cx
jmp checkHandles
useStoredValues:
mov ax, ds:[di].VMSE_usedBlocks
checkHandles:
;
; Add the number of blocks we anticipate being used for this
; message to the number of handles already used in the file. If
; that pushes the header over the limit, keep looking.
;
add ax, cx
cmc
jnc done ; => more than 64K handles, so
; keep looking (might have passed
; 0xffff to insist on getting its
; own file)
cmp ax, VMS_MAX_HANDLES
ja done ; if would put it over the top,
; keep looking (carry clear)
;
; Add another reference to the file entry. If the file is already
; open, we're done.
;
inc ds:[di].VMSE_refCount
mov ax, ds:[di].VMSE_handle
tst ax
stc ; assume already open
jnz done
;
; Not open yet, so go to the mailbox directory and attempt to
; open the file.
;
call MailboxPushToMailboxDir
lea dx, ds:[di].VMSE_name
mov ax, (VMO_OPEN shl 8) or \
mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \
mask VMAF_ALLOW_SHARED_MEMORY or \
mask VMAF_FORCE_DENY_WRITE
call VMOpen
jc openFailed
openOK:
call FilePopDir
;
; Open succeeded: store the handle away and return it in AX.
;
mov ds:[di].VMSE_handle, bx
mov ds:[di].VMSE_vmStatus, ax
mov_tr ax, bx
stc
done:
.leave
ret
openFailed:
;
; Couldn't open the file, so we have to decrement the ref count before
; continuing our search.
;
WARNING UNABLE_TO_OPEN_EXISTING_VMSTORE_FILE
cmp ax, VM_OPEN_INVALID_VM_FILE
jne ignoreEntry
;
; If file is invalid, delete it and create it anew.
;
call FileDelete
mov ax, (VMO_CREATE shl 8) or \
mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \
mask VMAF_ALLOW_SHARED_MEMORY or \
mask VMAF_FORCE_DENY_WRITE
call VMOpen
jnc openOK
ignoreEntry:
call FilePopDir
dec ds:[di].VMSE_refCount
clc
jmp done
VMSGetVMFileCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMSCreateNewFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a new data file for storing message bodies and record
it in the vm store map
CALLED BY: (INTERNAL) MailboxGetVMFile
PASS: *ds:si = vm store map
RETURN: carry set on failure:
ax = VMStatus
bx = destroyed
carry clear if ok:
bx = file handle
ds = fixed up
ax = destroyed
DESTROYED: cx, dx, di
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMSCreateNewFile proc near
slack local UHTA_NO_NULL_TERM_BUFFER_SIZE dup(char)
filename local FileLongName
newElement local VMStoreEntry
ForceRef filename
ForceRef slack
uses si, bp, es
.enter
call VMSCreateFilename
call MailboxPushToMailboxDir
push ds
segmov ds, ss
lea dx, ss:[filename]
retry:
mov ax, (VMO_CREATE_TRUNCATE shl 8) or \
mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \
mask VMAF_ALLOW_SHARED_MEMORY or \
mask VMAF_FORCE_DENY_WRITE
clr cx
call VMOpen
jc openFailed
pop ds
;
; Make the file owned by mailbox library
;
push ax
mov ax, handle 0
call HandleModifyOwner
pop ax ;preserve VMStatus
;
; Initialize the data to store along with the name.
;
mov ss:[newElement].VMSE_handle, bx
mov ss:[newElement].VMSE_vmStatus, ax
clr ax
mov ss:[newElement].VMSE_usedBlocks, ax
mov ss:[newElement].VMSE_freeBlocks, ax
movdw ss:[newElement].VMSE_fileSize, axax
inc ax ; ref count of one, please
mov ss:[newElement].VMSE_refCount, ax
mov dx, ss
mov es, dx ; es, dx <- ss
lea di, ss:[filename] ; es:di <- name
CheckHack <offset VMSE_handle eq size NameArrayElement>
lea ax, ss:[newElement].VMSE_handle ; dx:ax <- data, minus
; RefElementHeader
mov bx, mask NAAF_SET_DATA_ON_REPLACE
;
; Store the element in the array.
;
call LocalStringLength
inc cx ; include null
call NameArrayAdd
;
; Return the file handle w/carry clear, please.
;
mov bx, ss:[newElement].VMSE_handle
clc
done:
call FilePopDir
.leave
ret
openFailed:
;
; Couldn't create the file, for some reason. The only one about which
; we can do anything is when the thing already exists and is an invalid
; VM file (I'm assuming the FILE_FORMAT_MISMATCH can't happen...)
;
cmp ax, VM_OPEN_INVALID_VM_FILE
je deleteAndRetry
WARNING UNABLE_TO_CREATE_VMSTORE_FILE
error:
pop ds
stc
jmp done
deleteAndRetry:
;
; Some lingering thing from an earlier session. Nuke the file and
; retry the open (if the nuking succeeds, that is).
;
push ax
call FileDelete
WARNING_C UNABLE_TO_DELETE_EXISTING_BAD_VMSTORE_FILE
pop ax
jnc retry
jmp error
VMSCreateNewFile endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMSCreateFilename
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Generate a filename for the new file.
CALLED BY: (INTERNAL) VMSCreateNewFile
PASS: *ds:si = vm store map
ss:bp = inherited frame
RETURN: nothing
DESTROYED: ax, bx, cx, dx, di, es
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMSCreateFilename proc near
uses ds, si
.enter inherit VMSCreateNewFile
;
; Figure the number that will be assigned to the new element, when we
; add it, so we can generate an appropriate name. If there are any
; free elements in the array, the first one will be used. If there
; are none, one will be appended.
;
mov di, ds:[si]
mov dx, ds:[di].EAH_freePtr ; assume something free
cmp dx, EA_FREE_LIST_TERMINATOR
jne haveElementNum
mov dx, ds:[di].CAH_count ; none free, so count
; is the index of the
; elt that will be
; appended
haveElementNum:
; dx = number of new element
mov bx, handle uiMessagesNameTemplate
call MemLock
mov ds, ax
assume ds:segment uiMessagesNameTemplate
mov si, ds:[uiMessagesNameTemplate]
segmov es, ss
lea di, ss:[filename]
ChunkSizePtr ds, si, cx
EC < cmp cx, size filename >
EC < ERROR_A MESSAGE_BODY_FILENAME_CHUNK_TOO_LARGE >
DBCS < shr cx ; cx = # chars w/ null >
copyLoop:
LocalGetChar ax, dssi
LocalCmpChar ax, '\1'
jne storeChar
;
; Convert the token number to decimal at this point in the name.
;
EC < cmp dx, EA_FREE_LIST_TERMINATOR >
EC < ERROR_E MESSAGE_BODY_FILENAME_CHUNK_HAS_DUPLICATE_PLACEHOLDER>
mov_tr ax, dx ; ax < 8000h
cwd ; dxax <- number to convert
push cx
clr cx ; don't null-t, don't add
; leading zeroes
call UtilHex32ToAscii ; cx = # chars added
DBCS < shl cx ; cx = # bytes added >
add di, cx ; es:di <- past result
pop cx ; cx <- chars left in template
EC < mov dx, EA_FREE_LIST_TERMINATOR; note \1 seen >
EC < ornf ax, 1 ; force non-z in case \1>
EC < ; is last char >
jmp nextChar
storeChar:
LocalPutChar esdi, ax
nextChar:
loop copyLoop
; EC: sanity-check the template chunk
EC < LocalIsNull ax >
EC < ERROR_NZ MESSAGE_BODY_FILENAME_CHUNK_NOT_NULL_TERMINATED>
EC < cmp dx, EA_FREE_LIST_TERMINATOR >
EC < ERROR_NE MESSAGE_BODY_FILENAME_CHUNK_DOESNT_CONTAIN_NUMBER_PLACEHOLDER>
EC < lea ax, ss:[filename] >
EC < sub ax, di >
EC < neg ax ; ax = size incl. null >
EC < cmp ax, (FILE_LONGNAME_LENGTH + 1) * size TCHAR >
EC < ERROR_A MESSAGE_FILENAME_TOO_LONG >
call MemUnlock
.leave
ret
VMSCreateFilename endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MailboxGetVMFileName
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fetch the name of a file gotten with MailboxGetVMFile
CALLED BY: (GLOBAL)
PASS: cx:dx = buffer in which to place the file's longname
bx = file handle whose name is required
RETURN: buffer filled with null-terminated filename
DESTROYED: ax
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MailboxGetVMFileName proc far
uses bx, di, bp, ds, si
.enter
Assert vmFileHandle, bx
Assert fptr, cxdx
call VMSLock
mov bp, bx
mov bx, cs
mov di, offset VMSFindFileCallback
call ChunkArrayEnum
EC < ERROR_NC ASKED_FOR_NAME_OF_VM_FILE_NOT_OPENED_BY_US >
call UtilVMUnlockDS
.leave
ret
MailboxGetVMFileName endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMSFindFileCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine to find an entry in the name array that
has the indicated file handle and copy the file's name out.
CALLED BY: (INTERNAL) MailboxGetVMFileName via ChunkArrayEnum
MailboxDoneWithVMFile via ChunkArrayEnum
PASS: ds:di = VMStoreEntry
cx:dx = buffer for filename (cx = 0 means don't copy
bp = file handle being sought
RETURN: carry set to stop enumerating (found element)
if cx passed non-zero
buffer filled
else
cx = offset of VMStoreEntry found
DESTROYED: bx, si, di allowed
SIDE EFFECTS: buffer will be overwritten if element found
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMSFindFileCallback proc far
.enter
cmp ds:[di].VMSE_meta.NAE_meta.REH_refCount.WAAH_high,
EA_FREE_ELEMENT
je done ; (carry clear)
cmp ds:[di].VMSE_handle, bp
clc
jne done
jcxz returnElement
push es
lea si, ds:[di].VMSE_name
movdw esdi, cxdx
LocalCopyString
pop es
found:
stc
done:
.leave
ret
returnElement:
call ChunkArrayPtrToElement
mov cx, di
jmp found
VMSFindFileCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MailboxDoneWithVMFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Let the library know caller is done using the given VM file.
CALLED BY: (GLOBAL)
PASS: bx = VM file handle
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS: file may be closed
file & array entry may be deleted (if only one used block
left [i.e. the header is all that's used])
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MailboxDoneWithVMFile proc far
uses ax,bx,cx,dx,ds,si,di,bp
.enter
Assert vmFileHandle, bx
;
; Lock down the map.
;
call VMSLock ; *ds:si <- name array
;
; Locate the element with the file.
;
clr cx ; cx <- return elt #, please
mov bp, bx ; bp <- file being sought
mov bx, cs
mov di, offset VMSFindFileCallback
call ChunkArrayEnum ; ax <- elt #, ds:cx <- element
EC < ERROR_NC DONE_WITH_VM_FILE_NOT_OPENED_BY_US >
;
; Reduce the reference count by one. If still referenced, leave open.
;
mov di, cx
dec ds:[di].VMSE_refCount
jnz done
call VMSClose
;
; If the file is down to just the header block, then delete it and the
; name array element.
;
cmp ds:[di].VMSE_usedBlocks, 1
jne done
call MailboxPushToMailboxDir
push ax ; save element # (again)
lea dx, ds:[di].VMSE_name
call FileDelete
WARNING_C UNABLE_TO_DELETE_EMPTY_VMSTORE_FILE
pop ax ; ax <- element #
call ElementArrayDelete
done:
;
; Something got changed, so dirty the block before unlocking it.
;
call UtilVMDirtyDS
call UtilVMUnlockDS
call UtilUpdateAdminFile
.leave
ret
MailboxDoneWithVMFile endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMSClose
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Close down a file we've opened, gathering usage info before
doing it.
CALLED BY: (INTERNAL) MailboxDoneWithVMFile, VMSExitCallback
PASS: ds:di = VMStoreElement whose file is to be closed
RETURN: nothing
DESTROYED: bx
SIDE EFFECTS: ds:[di].VMSE_handle = 0, VMSE_usedBlocks, VMSE_freeBlocks,
and VMSE_fileSize all updated
Admin file is updated on disk (via VMUpdate).
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMSClose proc near
uses ax, dx
.enter
;
; Want to close the thing. Fetch the resource usage of the file before
; doing so.
;
mov bx, ds:[di].VMSE_handle
call VMGetHeaderInfo
mov ds:[di].VMSE_usedBlocks, ax
mov ds:[di].VMSE_freeBlocks, dx
call VMUpdate
call FileSize
movdw ds:[di].VMSE_fileSize, dxax
;
; Now close the file down, please, and clear the VMSE_handle to prevent
; erroneous finding of entry later.
;
mov al, FILE_NO_ERRORS ; force file out
call VMClose
mov ds:[di].VMSE_handle, 0
call UtilVMDirtyDS
call UtilUpdateAdminFile
.leave
ret
VMSClose endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MailboxOpenVMFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Reopen a VM file that was previously returned by
MailboxGetVMFile, and whose name was gotten through
MailboxGetVMFileName.
The call must be matched by a call to MailboxDoneWithVMFile.
CALLED BY: (GLOBAL) VM Tree Data Driver
PASS: cx:dx = name of the file to open
RETURN: carry set on error:
ax = VMStatus
bx = destroyed
carry clear if ok
ax = VMStatus
bx = file handle
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CL 7/11/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MailboxOpenVMFile proc far
uses cx,dx,si,di,ds,es
.enter
;
; Lock down the map.
;
call VMSLock ;*ds:si = name array
;
; Locate the filename's VMStoreEntry
;
movdw esdi, cxdx ;es:di = name to find
call LocalStringLength
inc cx ;include null-termination.
clr dx ;do not return data
call NameArrayFind ;ax = element number
jc haveEntry
EC < WARNING OPEN_VM_FILE_NOT_OPENED_BY_US >
mov ax, VM_FILE_NOT_FOUND
stc
jmp done
haveEntry:
call ChunkArrayElementToPtr ;ds:di = VMStoreEntry
EC < ERROR_C VM_STORE_ELEMENT_INVALID >
;
; If the file is already open, inc the ref-count and return
; the handle. Otherwise, open the file.
;
tst ds:[di].VMSE_refCount
jz openFile
inc ds:[di].VMSE_refCount
mov bx, ds:[di].VMSE_handle
mov ax, ds:[di].VMSE_vmStatus
clc
jmp exit
openFile:
call MailboxPushToMailboxDir
lea dx, ds:[di].VMSE_name
mov ax, (VMO_OPEN shl 8) or \
mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \
mask VMAF_ALLOW_SHARED_MEMORY or \
mask VMAF_FORCE_DENY_WRITE
call VMOpen
call FilePopDir
jc done ;open failed
mov ds:[di].VMSE_handle, bx
mov ds:[di].VMSE_vmStatus, ax
mov ds:[di].VMSE_refCount, 1
exit:
call UtilVMDirtyDS ;flags preserved
done:
call UtilVMUnlockDS ;flags preserved
.leave
ret
MailboxOpenVMFile endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMStoreExit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Make sure that all the open VMStore files are closed
CALLED BY: (EXTERNAL) AdminExit
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS: all open VM files are closed
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMStoreExit proc far
uses ds, si, bx, di
.enter
call VMSLock
mov bx, cs
mov di, offset VMSExitCallback
call ChunkArrayEnum
call UtilVMDirtyDS
call UtilVMUnlockDS
.leave
ret
VMStoreExit endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VMSExitCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine to close down any errantly-still-open
files from the VMStore
CALLED BY: (INTERNAL) VMStoreExit via ChunkArrayEnum
PASS: ds:di = VMStoreElement to check
RETURN: carry set to stop enumerating (always clear)
DESTROYED: bx
SIDE EFFECTS: refCount set to 0, but block not dirtied
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VMSExitCallback proc far
.enter
cmp ds:[di].VMSE_meta.NAE_meta.REH_refCount.WAAH_high,
EA_FREE_ELEMENT
je done
tst ds:[di].VMSE_refCount
jz done
WARNING MISSING_CALL_TO_MailboxDoneWithVMFile
mov ds:[di].VMSE_refCount, 0
call VMSClose
done:
clc
.leave
ret
VMSExitCallback endp
VMStore ends
|
cli.adb | annexi-strayline/ASAP-CLI | 0 | 13254 | ------------------------------------------------------------------------------
-- --
-- Command Line Interface Toolkit --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2019-2021, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Text_IO; use Ada;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Interfaces.C; use Interfaces.C;
with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
pragma External_With ("tty_ifo.c");
package body CLI is
--
-- Helper functions, state, and constants
--
Column_Actual: Positive;
-- This is initialized by the package elaboration, which actually ensures
-- the cursor is at this position by calling Clear_Line
Control_Preamble: constant Character := Character'Val (8#33#); -- '\033'
-- Needs to be output at the beginning of all ANSI terminal control codes
CSI: constant String := Control_Preamble & '[';
function Trim_Num (Num : Integer) return String is
(Ada.Strings.Fixed.Trim(Integer'Image(Num), Ada.Strings.Left));
-- Helper function to ensure our codes with ordinals don't have extra spaces
--------------------
-- Terminal_Width --
--------------------
function Terminal_Width return Positive is
function term_width return Interfaces.C.unsigned_short with
Import => True,
Convention => C,
External_Name => "tty_ifo__term_width";
begin
if Output_Is_Terminal then
return Positive (term_width);
else
return 80;
end if;
end Terminal_Width;
-----------------------
-- Ouput_Is_Terminal --
-----------------------
use type Interfaces.C.int;
function isatty return Interfaces.C.int with
Import => True,
Convention => C,
External_Name => "tty_ifo__isatty";
Is_TTY: constant Boolean := (isatty > 0);
function Output_Is_Terminal return Boolean is
(Is_TTY);
----------------
-- Set_Column --
----------------
procedure Set_Column (Col: in Positive) is
begin
if Is_TTY then
Text_IO.Put (CSI & Trim_Num (Col) & 'G');
end if;
Column_Actual := Col;
end Set_Column;
--------------------
-- Current_Column --
--------------------
function Current_Column return Positive is (Column_Actual);
------------------
-- Clear_Screen --
------------------
procedure Clear_Screen is
Clear_Screen_Sequence : constant String
:= CSI & "2J" & -- Clear entire screen
CSI & ";H"; -- Home cursor to top-left
begin
if Is_TTY then
Text_IO.Put (Clear_Screen_Sequence);
end if;
Column_Actual := 1;
end Clear_Screen;
----------------
-- Clear_Line --
----------------
procedure Clear_Line is
begin
-- Move cursor to column 1 and clear line
Set_Column (1);
Clear_To_End;
end Clear_Line;
------------------
-- Clear_To_End --
------------------
procedure Clear_To_End is
begin
if Is_TTY then
Text_IO.Put (CSI & 'K'); -- Clear to end
end if;
end Clear_To_End;
---------
-- Put --
---------
procedure Put (Char : Character;
Style : Text_Style := Neutral)
is begin
Put (Message => String'(1 .. 1 => Char),
Style => Style);
end Put;
--------------------------------------------------
procedure Put (Message: String;
Style : Text_Style := Neutral)
is begin
Clear_Style;
Apply_Style(Style);
Text_IO.Put(Message);
Clear_Style;
Column_Actual := Column_Actual + Message'Length;
end Put;
-------------------
-- Wide_Wide_Put --
-------------------
procedure Wide_Wide_Put (Char : in Wide_Wide_Character;
Style: in Text_Style := Neutral)
is begin
Wide_Wide_Put (Message => Wide_Wide_String'(1 .. 1 => Char),
Style => Style);
end Wide_Wide_Put;
--------------------------------------------------
procedure Wide_Wide_Put (Message: in Wide_Wide_String;
Style : in Text_Style := Neutral)
is
use Ada.Strings.UTF_Encoding;
use Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
Encoded_Message: constant UTF_8_String := Encode (Message);
begin
Clear_Style;
Apply_Style(Style);
Text_IO.Put(Encoded_Message);
Clear_Style;
Column_Actual := Column_Actual + Message'Length;
end Wide_Wide_Put;
------------
-- Put_At --
------------
procedure Put_At (Char : in Character;
Column : in Positive;
Style : in Text_Style := Neutral)
is begin
Put_At (Message => String'(1 .. 1 => Char),
Column => Column,
Style => Style);
end Put_At;
--------------------------------------------------
procedure Put_At (Message: in String;
Column : in Positive;
Style : in Text_Style := Neutral)
is
Save_Col: constant Positive := Current_Column;
begin
Set_Column (Column);
Put (Message => Message,
Style => Style);
Set_Column (Save_Col);
end Put_At;
----------------------
-- Wide_Wide_Put_At --
----------------------
procedure Wide_Wide_Put_At (Char : in Wide_Wide_Character;
Column: in Positive;
Style : in Text_Style := Neutral)
is begin
Wide_Wide_Put_At (Message => Wide_Wide_String'(1 .. 1 => Char),
Column => Column,
Style => Style);
end Wide_Wide_Put_At;
--------------------------------------------------
procedure Wide_Wide_Put_At (Message: in Wide_Wide_String;
Column : in Positive;
Style : in Text_Style := Neutral)
is
Save_Col: constant Positive := Current_Column;
begin
Set_Column (Column);
Wide_Wide_Put (Message => Message,
Style => Style);
Set_Column (Save_Col);
end Wide_Wide_Put_At;
--------------
-- Put_Line --
--------------
procedure Put_Line (Message: String;
Style : Text_Style := Neutral)
is begin
Put (Message, Style);
New_Line;
end Put_Line;
------------------------
-- Wide_Wide_Put_Line --
------------------------
procedure Wide_Wide_Put_Line (Message: Wide_Wide_String;
Style : Text_Style := Neutral)
is begin
Wide_Wide_Put (Message, Style);
New_Line;
end Wide_Wide_Put_Line;
--------------
-- New_Line --
--------------
procedure New_Line is
begin
Text_IO.New_Line;
Set_Column (1);
end New_Line;
-----------------------
-- Get/Get_Immediate --
-----------------------
procedure Get (Item: out String) renames Text_IO.Get;
procedure Get (Item: out Character) renames Text_IO.Get;
procedure Get_Line (Item: out String; Last: out Natural)
renames Text_IO.Get_Line;
procedure Get_Immediate (Item: out Character; Available: out Boolean)
renames Text_IO.Get_Immediate;
--------------------------
-- Text_Style Operators --
--------------------------
-- "+" --
function "+" (Left, Right : Text_Style) return Text_Style is
-- This function will always take the color of the right Cursor, because
-- addition works like an overwrite for all the attributes that are not
-- currently turned on for Left cursor
FG : Color := (if (Right.Foreground /= Default)
then Right.Foreground
else Left.Foreground);
BG : Color := (if (Right.Background /= Default)
then Right.Background
else Left.Background);
begin
return (Text_Style'(Foreground => FG,
Background => BG,
Bold => Left.Bold or Right.Bold,
Underscore => Left.Underscore or Right.Underscore,
Blink => Left.Blink or Right.Blink,
Reverse_Vid => Left.Reverse_Vid or Right.Reverse_Vid,
Concealed => Left.Concealed or Right.Concealed));
end "+";
-- "-" --
function "-" (Left, Right : Text_Style) return Text_Style is
-- This function will always take the color of the left Cursor, unless
-- they are the same
-- This is because subtracting the right Cursor means we cannot have that
-- property of it
FG : Color := (if (Left.Foreground = Right.Foreground)
then Default
else Left.Foreground);
BG : Color := (if (Left.Background = Right.Background)
then Default
else Left.Background);
begin
return (Text_Style'(Foreground => FG,
Background => BG,
Bold => Left.Bold and (Left.Bold xor Right.Bold),
Underscore =>
Left.Underscore and
(Left.Underscore xor Right.Underscore),
Blink =>
Left.Blink and (Left.Blink xor Right.Blink),
Reverse_Vid =>
Left.Reverse_Vid
and (Left.Reverse_Vid xor Right.Reverse_Vid),
Concealed => Left.Concealed
and (Left.Concealed xor Right.Concealed)));
end "-";
-----------------
-- Apply_Style --
-----------------
procedure Apply_Style (Style : Text_Style) is
Attribute_Sequence : String := CSI & "0m";
Change_Foreground_Sequence : String :=
CSI & Trim_Num(Color'Pos(Style.Foreground) + 30) & 'm';
Change_Background_Sequence : String :=
CSI & Trim_Num(Color'Pos(Style.Background) + 40) & 'm';
begin
if not Is_TTY then return; end if;
if Style.Foreground /= Default then
Text_IO.Put(Change_Foreground_Sequence);
end if;
if Style.Background /= Default then
Text_IO.Put(Change_Background_Sequence);
end if;
declare
procedure Apply_Attribute (Attribute_Num : Integer) with Inline is
begin
-- Take first index of Trim_Num return because it is a string but
-- we need a char
Attribute_Sequence(3) := Trim_Num(Attribute_Num)(1);
Text_IO.Put(Attribute_Sequence);
end Apply_Attribute;
begin
if Style.Bold then
Apply_Attribute(1);
end if;
if Style.Underscore then
Apply_Attribute(4);
end if;
if Style.Blink then
Apply_Attribute(5);
end if;
if Style.Reverse_Vid then
Apply_Attribute(7);
end if;
if Style.Concealed then
Apply_Attribute(8);
end if;
end;
end Apply_Style;
-----------------
-- Clear_Style --
-----------------
procedure Clear_Style is
begin
if not Is_TTY then return; end if;
Text_IO.Put (CSI & "0m"); -- "Reset attributes";
end Clear_Style;
begin
Clear_Line;
end CLI;
|
src/main/antlr/CFGrammar.g4 | Furetur/LLkChecker | 1 | 5327 | grammar CFGrammar;
// Tokens
TERM: [a-z]+;
NONTERM: [A-Z]+;
DEF: ':=';
SEMI: ';';
WHITESPACE: [ \r\n\t]+ -> skip;
// Rules
gram : grammarRule+ EOF;
grammarRule : def=NONTERM DEF symbol* SEMI;
symbol
: TERM # term
| NONTERM # nonTerm
;
|
programs/oeis/182/A182307.asm | jmorken/loda | 1 | 179838 | <filename>programs/oeis/182/A182307.asm
; A182307: a(n+1) = a(n) + floor(a(n)/6) with a(0)=6.
; 6,7,8,9,10,11,12,14,16,18,21,24,28,32,37,43,50,58,67,78,91,106,123,143,166,193,225,262,305,355,414,483,563,656,765,892,1040,1213,1415,1650,1925,2245,2619,3055,3564,4158,4851,5659,6602,7702,8985,10482,12229,14267,16644
mov $1,6
mov $2,$0
lpb $2
mov $4,$1
mov $5,4
lpb $5
mov $3,3
sub $4,$5
trn $5,3
lpe
lpb $4
add $1,1
sub $4,$3
trn $4,$3
lpe
sub $2,1
lpe
|
deps/openssl/asm/x64-win32-masm/rc4/rc4-x86_64.asm | sgallagher/node | 2 | 91596 | <reponame>sgallagher/node
OPTION DOTNAME
.text$ SEGMENT ALIGN(64) 'CODE'
PUBLIC RC4
ALIGN 16
RC4 PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_RC4::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
or rsi,rsi
jne $L$entry
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$entry::
push rbx
push r12
push r13
$L$prologue::
add rdi,8
mov r8d,DWORD PTR[((-8))+rdi]
mov r12d,DWORD PTR[((-4))+rdi]
cmp DWORD PTR[256+rdi],-1
je $L$RC4_CHAR
inc r8b
mov r9d,DWORD PTR[r8*4+rdi]
test rsi,-8
jz $L$loop1
jmp $L$loop8
ALIGN 16
$L$loop8::
add r12b,r9b
mov r10,r8
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r10b
mov r11d,DWORD PTR[r10*4+rdi]
cmp r12,r10
mov DWORD PTR[r12*4+rdi],r9d
cmove r11,r9
mov DWORD PTR[r8*4+rdi],r13d
add r13b,r9b
mov al,BYTE PTR[r13*4+rdi]
add r12b,r11b
mov r8,r10
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r8b
mov r9d,DWORD PTR[r8*4+rdi]
cmp r12,r8
mov DWORD PTR[r12*4+rdi],r11d
cmove r9,r11
mov DWORD PTR[r10*4+rdi],r13d
add r13b,r11b
mov al,BYTE PTR[r13*4+rdi]
add r12b,r9b
mov r10,r8
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r10b
mov r11d,DWORD PTR[r10*4+rdi]
cmp r12,r10
mov DWORD PTR[r12*4+rdi],r9d
cmove r11,r9
mov DWORD PTR[r8*4+rdi],r13d
add r13b,r9b
mov al,BYTE PTR[r13*4+rdi]
add r12b,r11b
mov r8,r10
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r8b
mov r9d,DWORD PTR[r8*4+rdi]
cmp r12,r8
mov DWORD PTR[r12*4+rdi],r11d
cmove r9,r11
mov DWORD PTR[r10*4+rdi],r13d
add r13b,r11b
mov al,BYTE PTR[r13*4+rdi]
add r12b,r9b
mov r10,r8
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r10b
mov r11d,DWORD PTR[r10*4+rdi]
cmp r12,r10
mov DWORD PTR[r12*4+rdi],r9d
cmove r11,r9
mov DWORD PTR[r8*4+rdi],r13d
add r13b,r9b
mov al,BYTE PTR[r13*4+rdi]
add r12b,r11b
mov r8,r10
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r8b
mov r9d,DWORD PTR[r8*4+rdi]
cmp r12,r8
mov DWORD PTR[r12*4+rdi],r11d
cmove r9,r11
mov DWORD PTR[r10*4+rdi],r13d
add r13b,r11b
mov al,BYTE PTR[r13*4+rdi]
add r12b,r9b
mov r10,r8
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r10b
mov r11d,DWORD PTR[r10*4+rdi]
cmp r12,r10
mov DWORD PTR[r12*4+rdi],r9d
cmove r11,r9
mov DWORD PTR[r8*4+rdi],r13d
add r13b,r9b
mov al,BYTE PTR[r13*4+rdi]
add r12b,r11b
mov r8,r10
mov r13d,DWORD PTR[r12*4+rdi]
ror rax,8
inc r8b
mov r9d,DWORD PTR[r8*4+rdi]
cmp r12,r8
mov DWORD PTR[r12*4+rdi],r11d
cmove r9,r11
mov DWORD PTR[r10*4+rdi],r13d
add r13b,r11b
mov al,BYTE PTR[r13*4+rdi]
ror rax,8
sub rsi,8
xor rax,QWORD PTR[rdx]
add rdx,8
mov QWORD PTR[rcx],rax
add rcx,8
test rsi,-8
jnz $L$loop8
cmp rsi,0
jne $L$loop1
jmp $L$exit
ALIGN 16
$L$loop1::
add r12b,r9b
mov r13d,DWORD PTR[r12*4+rdi]
mov DWORD PTR[r12*4+rdi],r9d
mov DWORD PTR[r8*4+rdi],r13d
add r9b,r13b
inc r8b
mov r13d,DWORD PTR[r9*4+rdi]
mov r9d,DWORD PTR[r8*4+rdi]
xor r13b,BYTE PTR[rdx]
inc rdx
mov BYTE PTR[rcx],r13b
inc rcx
dec rsi
jnz $L$loop1
jmp $L$exit
ALIGN 16
$L$RC4_CHAR::
add r8b,1
movzx r9d,BYTE PTR[r8*1+rdi]
test rsi,-8
jz $L$cloop1
cmp DWORD PTR[260+rdi],0
jnz $L$cloop1
jmp $L$cloop8
ALIGN 16
$L$cloop8::
mov eax,DWORD PTR[rdx]
mov ebx,DWORD PTR[4+rdx]
add r12b,r9b
lea r10,QWORD PTR[1+r8]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r10d,r10b
movzx r11d,BYTE PTR[r10*1+rdi]
mov BYTE PTR[r12*1+rdi],r9b
cmp r12,r10
mov BYTE PTR[r8*1+rdi],r13b
jne $L$cmov0
mov r11,r9
$L$cmov0::
add r13b,r9b
xor al,BYTE PTR[r13*1+rdi]
ror eax,8
add r12b,r11b
lea r8,QWORD PTR[1+r10]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r8d,r8b
movzx r9d,BYTE PTR[r8*1+rdi]
mov BYTE PTR[r12*1+rdi],r11b
cmp r12,r8
mov BYTE PTR[r10*1+rdi],r13b
jne $L$cmov1
mov r9,r11
$L$cmov1::
add r13b,r11b
xor al,BYTE PTR[r13*1+rdi]
ror eax,8
add r12b,r9b
lea r10,QWORD PTR[1+r8]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r10d,r10b
movzx r11d,BYTE PTR[r10*1+rdi]
mov BYTE PTR[r12*1+rdi],r9b
cmp r12,r10
mov BYTE PTR[r8*1+rdi],r13b
jne $L$cmov2
mov r11,r9
$L$cmov2::
add r13b,r9b
xor al,BYTE PTR[r13*1+rdi]
ror eax,8
add r12b,r11b
lea r8,QWORD PTR[1+r10]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r8d,r8b
movzx r9d,BYTE PTR[r8*1+rdi]
mov BYTE PTR[r12*1+rdi],r11b
cmp r12,r8
mov BYTE PTR[r10*1+rdi],r13b
jne $L$cmov3
mov r9,r11
$L$cmov3::
add r13b,r11b
xor al,BYTE PTR[r13*1+rdi]
ror eax,8
add r12b,r9b
lea r10,QWORD PTR[1+r8]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r10d,r10b
movzx r11d,BYTE PTR[r10*1+rdi]
mov BYTE PTR[r12*1+rdi],r9b
cmp r12,r10
mov BYTE PTR[r8*1+rdi],r13b
jne $L$cmov4
mov r11,r9
$L$cmov4::
add r13b,r9b
xor bl,BYTE PTR[r13*1+rdi]
ror ebx,8
add r12b,r11b
lea r8,QWORD PTR[1+r10]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r8d,r8b
movzx r9d,BYTE PTR[r8*1+rdi]
mov BYTE PTR[r12*1+rdi],r11b
cmp r12,r8
mov BYTE PTR[r10*1+rdi],r13b
jne $L$cmov5
mov r9,r11
$L$cmov5::
add r13b,r11b
xor bl,BYTE PTR[r13*1+rdi]
ror ebx,8
add r12b,r9b
lea r10,QWORD PTR[1+r8]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r10d,r10b
movzx r11d,BYTE PTR[r10*1+rdi]
mov BYTE PTR[r12*1+rdi],r9b
cmp r12,r10
mov BYTE PTR[r8*1+rdi],r13b
jne $L$cmov6
mov r11,r9
$L$cmov6::
add r13b,r9b
xor bl,BYTE PTR[r13*1+rdi]
ror ebx,8
add r12b,r11b
lea r8,QWORD PTR[1+r10]
movzx r13d,BYTE PTR[r12*1+rdi]
movzx r8d,r8b
movzx r9d,BYTE PTR[r8*1+rdi]
mov BYTE PTR[r12*1+rdi],r11b
cmp r12,r8
mov BYTE PTR[r10*1+rdi],r13b
jne $L$cmov7
mov r9,r11
$L$cmov7::
add r13b,r11b
xor bl,BYTE PTR[r13*1+rdi]
ror ebx,8
lea rsi,QWORD PTR[((-8))+rsi]
mov DWORD PTR[rcx],eax
lea rdx,QWORD PTR[8+rdx]
mov DWORD PTR[4+rcx],ebx
lea rcx,QWORD PTR[8+rcx]
test rsi,-8
jnz $L$cloop8
cmp rsi,0
jne $L$cloop1
jmp $L$exit
ALIGN 16
$L$cloop1::
add r12b,r9b
movzx r13d,BYTE PTR[r12*1+rdi]
mov BYTE PTR[r12*1+rdi],r9b
mov BYTE PTR[r8*1+rdi],r13b
add r13b,r9b
add r8b,1
movzx r13d,r13b
movzx r8d,r8b
movzx r13d,BYTE PTR[r13*1+rdi]
movzx r9d,BYTE PTR[r8*1+rdi]
xor r13b,BYTE PTR[rdx]
lea rdx,QWORD PTR[1+rdx]
mov BYTE PTR[rcx],r13b
lea rcx,QWORD PTR[1+rcx]
sub rsi,1
jnz $L$cloop1
jmp $L$exit
ALIGN 16
$L$exit::
sub r8b,1
mov DWORD PTR[((-8))+rdi],r8d
mov DWORD PTR[((-4))+rdi],r12d
mov r13,QWORD PTR[rsp]
mov r12,QWORD PTR[8+rsp]
mov rbx,QWORD PTR[16+rsp]
add rsp,24
$L$epilogue::
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_RC4::
RC4 ENDP
EXTERN OPENSSL_ia32cap_P:NEAR
PUBLIC RC4_set_key
ALIGN 16
RC4_set_key PROC PUBLIC
mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
mov QWORD PTR[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_RC4_set_key::
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
lea rdi,QWORD PTR[8+rdi]
lea rdx,QWORD PTR[rsi*1+rdx]
neg rsi
mov rcx,rsi
xor eax,eax
xor r9,r9
xor r10,r10
xor r11,r11
mov r8d,DWORD PTR[OPENSSL_ia32cap_P]
bt r8d,20
jnc $L$w1stloop
bt r8d,30
setc r9b
mov DWORD PTR[260+rdi],r9d
jmp $L$c1stloop
ALIGN 16
$L$w1stloop::
mov DWORD PTR[rax*4+rdi],eax
add al,1
jnc $L$w1stloop
xor r9,r9
xor r8,r8
ALIGN 16
$L$w2ndloop::
mov r10d,DWORD PTR[r9*4+rdi]
add r8b,BYTE PTR[rsi*1+rdx]
add r8b,r10b
add rsi,1
mov r11d,DWORD PTR[r8*4+rdi]
cmovz rsi,rcx
mov DWORD PTR[r8*4+rdi],r10d
mov DWORD PTR[r9*4+rdi],r11d
add r9b,1
jnc $L$w2ndloop
jmp $L$exit_key
ALIGN 16
$L$c1stloop::
mov BYTE PTR[rax*1+rdi],al
add al,1
jnc $L$c1stloop
xor r9,r9
xor r8,r8
ALIGN 16
$L$c2ndloop::
mov r10b,BYTE PTR[r9*1+rdi]
add r8b,BYTE PTR[rsi*1+rdx]
add r8b,r10b
add rsi,1
mov r11b,BYTE PTR[r8*1+rdi]
jnz $L$cnowrap
mov rsi,rcx
$L$cnowrap::
mov BYTE PTR[r8*1+rdi],r10b
mov BYTE PTR[r9*1+rdi],r11b
add r9b,1
jnc $L$c2ndloop
mov DWORD PTR[256+rdi],-1
ALIGN 16
$L$exit_key::
xor eax,eax
mov DWORD PTR[((-8))+rdi],eax
mov DWORD PTR[((-4))+rdi],eax
mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
mov rsi,QWORD PTR[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_RC4_set_key::
RC4_set_key ENDP
PUBLIC RC4_options
ALIGN 16
RC4_options PROC PUBLIC
lea rax,QWORD PTR[$L$opts]
mov edx,DWORD PTR[OPENSSL_ia32cap_P]
bt edx,20
jnc $L$done
add rax,12
bt edx,30
jnc $L$done
add rax,13
$L$done::
DB 0F3h,0C3h ;repret
ALIGN 64
$L$opts::
DB 114,99,52,40,56,120,44,105,110,116,41,0
DB 114,99,52,40,56,120,44,99,104,97,114,41,0
DB 114,99,52,40,49,120,44,99,104,97,114,41,0
DB 82,67,52,32,102,111,114,32,120,56,54,95,54,52,44,32
DB 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
DB 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
DB 62,0
ALIGN 64
RC4_options ENDP
EXTERN __imp_RtlVirtualUnwind:NEAR
ALIGN 16
stream_se_handler PROC PRIVATE
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD PTR[120+r8]
mov rbx,QWORD PTR[248+r8]
lea r10,QWORD PTR[$L$prologue]
cmp rbx,r10
jb $L$in_prologue
mov rax,QWORD PTR[152+r8]
lea r10,QWORD PTR[$L$epilogue]
cmp rbx,r10
jae $L$in_prologue
lea rax,QWORD PTR[24+rax]
mov rbx,QWORD PTR[((-8))+rax]
mov r12,QWORD PTR[((-16))+rax]
mov r13,QWORD PTR[((-24))+rax]
mov QWORD PTR[144+r8],rbx
mov QWORD PTR[216+r8],r12
mov QWORD PTR[224+r8],r13
$L$in_prologue::
mov rdi,QWORD PTR[8+rax]
mov rsi,QWORD PTR[16+rax]
mov QWORD PTR[152+r8],rax
mov QWORD PTR[168+r8],rsi
mov QWORD PTR[176+r8],rdi
jmp $L$common_seh_exit
stream_se_handler ENDP
ALIGN 16
key_se_handler PROC PRIVATE
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD PTR[152+r8]
mov rdi,QWORD PTR[8+rax]
mov rsi,QWORD PTR[16+rax]
mov QWORD PTR[168+r8],rsi
mov QWORD PTR[176+r8],rdi
$L$common_seh_exit::
mov rdi,QWORD PTR[40+r9]
mov rsi,r8
mov ecx,154
DD 0a548f3fch
mov rsi,r9
xor rcx,rcx
mov rdx,QWORD PTR[8+rsi]
mov r8,QWORD PTR[rsi]
mov r9,QWORD PTR[16+rsi]
mov r10,QWORD PTR[40+rsi]
lea r11,QWORD PTR[56+rsi]
lea r12,QWORD PTR[24+rsi]
mov QWORD PTR[32+rsp],r10
mov QWORD PTR[40+rsp],r11
mov QWORD PTR[48+rsp],r12
mov QWORD PTR[56+rsp],rcx
call QWORD PTR[__imp_RtlVirtualUnwind]
mov eax,1
add rsp,64
popfq
pop r15
pop r14
pop r13
pop r12
pop rbp
pop rbx
pop rdi
pop rsi
DB 0F3h,0C3h ;repret
key_se_handler ENDP
.text$ ENDS
.pdata SEGMENT READONLY ALIGN(4)
ALIGN 4
DD imagerel $L$SEH_begin_RC4
DD imagerel $L$SEH_end_RC4
DD imagerel $L$SEH_info_RC4
DD imagerel $L$SEH_begin_RC4_set_key
DD imagerel $L$SEH_end_RC4_set_key
DD imagerel $L$SEH_info_RC4_set_key
.pdata ENDS
.xdata SEGMENT READONLY ALIGN(8)
ALIGN 8
$L$SEH_info_RC4::
DB 9,0,0,0
DD imagerel stream_se_handler
$L$SEH_info_RC4_set_key::
DB 9,0,0,0
DD imagerel key_se_handler
.xdata ENDS
END
|
automaton.als | vasil-sd/alloy_automata | 0 | 568 | module automaton[Obj, Time, S, P, InitialS, FinalS]
-- Obj - сигнатура объектов, которые могут менять состояния
-- Time - время
-- S - множество состояний
-- P - множество атомарных предикатов
-- InitialS - множество начальных состояний
-- FinalS - множество конечных состояний
-- Работа автомата моделируется так:
-- для каждого момента времени есть множество активных предикатов
-- и множество текущих (на этот момент времени) состояний.
-- Соответственно множество состояний в следующий момент времени
-- определяется таблицей переходов P -> S -> S.
-- предикат Automaton соотвественно определяет возможные
-- трассы состояний в соотв. с таблицей.
open util/ordering[Time] -- вводим порядок на времени
fact InitialAndFinalStatesInS {
InitialS in S
FinalS in S
}
sig State in Obj {
Predicates : P -> Time, -- задаёт предикаты для
-- моментов времени
Current : S -> Time
}
fact {
Obj in State -- для каждого объекта есть State
}
fun Predicates[o : State, t : Time] : set P {
o.Predicates.t
}
fun State[o : State, t : Time] : S {
o.Current.t
}
pred Transitions[tr : P -> S -> S] {
all t: Time - last | -- для каждого момента времени,
-- кроме последнего
let t' = t.next | -- t' следующий за t
all s : State | -- для всех объектов (State <-> Obj)
let curr_s = s.Current.t | -- curr_s - состояние объекта
-- в момент времени t
let next_s = s.Current.t' | -- состояние объекта в t'
let preds = s.Predicates.t | -- предикаты допустимых
-- переходов в момент t
let possible_s = preds.tr[curr_s] | -- возможные будущие
-- состояния
( curr_s in FinalS and next_s = curr_s )
-- ^^ если текущее состояние - конечное, то объект в
-- нём и остаётся
or -- иначе
some nxt : possible_s | next_s = nxt
-- берём произвольно какое-нибудь из возможных
-- будущих состояний и делаем его следующим
-- актуальным состоянием объекта в момент t'
}
pred Init {
all s : State |
some i : InitialS |
s.Current.first = i
}
pred Final [o : State, t : Time] {
o.Current.t in FinalS and o.Predicates.t = none
}
pred Automaton[tr : P -> S -> S] {
Init
Consistent[tr]
Transitions[tr]
all t : Time
| all o : State
| let curr_s = o.Current.t
| let curr_p = o.Predicates.t
| (some curr_p and curr_p in tr.S.curr_s)
or
o.Final[t]
}
pred Consistent[tr : P -> S -> S] {
-- Есть хоть одно начальное состояние
some InitialS
-- начальные и конечные состояния не пересекаются
no InitialS & FinalS
-- Если нет исходящих дуг, то это финальное
-- состояние и наоборот.
all s : S | no P.tr[s] iff s in FinalS
-- Если нет входящих дуг, то это только
-- начальное состояние, обратное, кстати,
-- неверно.
all s : S | no P.tr.s => s in InitialS
-- Нет разных дуг из одного состояния с
-- одинаковыми предикатами.
all p : P, s : S | lone p -> s -> S & tr
-- Один предикат на дугу.
all s1, s2 : S | lone P -> s1 -> s2 & tr
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.