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
|
---|---|---|---|---|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/loop_optimization2.adb | best08618/asylo | 7 | 14633 | -- { dg-do compile }
-- { dg-options "-gnata -O2 -fno-inline" }
with Ada.Unchecked_Conversion;
package body Loop_Optimization2 is
function To_Addr_Ptr is
new Ada.Unchecked_Conversion (System.Address, Addr_Ptr);
function To_Address is
new Ada.Unchecked_Conversion (Tag, System.Address);
function To_Type_Specific_Data_Ptr is
new Ada.Unchecked_Conversion (System.Address, Type_Specific_Data_Ptr);
function Interface_Ancestor_Tags (T : Tag) return Tag_Array is
TSD_Ptr : constant Addr_Ptr := To_Addr_Ptr (To_Address (T));
TSD : constant Type_Specific_Data_Ptr :=
To_Type_Specific_Data_Ptr (TSD_Ptr.all);
Iface_Table : constant Interface_Data_Ptr := TSD.Interfaces_Table;
begin
if Iface_Table = null then
declare
Table : Tag_Array (1 .. 0);
begin
return Table;
end;
else
declare
Table : Tag_Array (1 .. Iface_Table.Nb_Ifaces);
begin
for J in 1 .. Iface_Table.Nb_Ifaces loop
Table (J) := Iface_Table.Ifaces_Table (J).Iface_Tag;
end loop;
return Table;
end;
end if;
end Interface_Ancestor_Tags;
end Loop_Optimization2;
|
test/asset/agda-stdlib-1.0/Data/Vec/Properties.agda | omega12345/agda-mode | 0 | 8915 | <reponame>omega12345/agda-mode
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some Vec-related properties
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Vec.Properties where
open import Algebra.FunctionProperties
open import Data.Empty using (⊥-elim)
open import Data.Fin as Fin using (Fin; zero; suc; toℕ; fromℕ)
open import Data.Fin.Properties using (_+′_)
open import Data.List.Base as List using (List)
open import Data.Nat
open import Data.Nat.Properties using (+-assoc; ≤-step)
open import Data.Product as Prod
using (_×_; _,_; proj₁; proj₂; <_,_>; uncurry)
open import Data.Vec
open import Function
open import Function.Inverse using (_↔_; inverse)
open import Relation.Binary as B hiding (Decidable)
open import Relation.Binary.PropositionalEquality as P
using (_≡_; _≢_; refl; _≗_)
open import Relation.Unary using (Pred; Decidable)
open import Relation.Nullary using (yes; no)
------------------------------------------------------------------------
-- Properties of propositional equality over vectors
module _ {a} {A : Set a} {n} {x y : A} {xs ys : Vec A n} where
∷-injectiveˡ : x ∷ xs ≡ y ∷ ys → x ≡ y
∷-injectiveˡ refl = refl
∷-injectiveʳ : x ∷ xs ≡ y ∷ ys → xs ≡ ys
∷-injectiveʳ refl = refl
∷-injective : (x ∷ xs) ≡ (y ∷ ys) → x ≡ y × xs ≡ ys
∷-injective refl = refl , refl
module _ {a} {A : Set a} where
≡-dec : B.Decidable _≡_ → ∀ {n} → B.Decidable {A = Vec A n} _≡_
≡-dec _≟_ [] [] = yes refl
≡-dec _≟_ (x ∷ xs) (y ∷ ys) with x ≟ y | ≡-dec _≟_ xs ys
... | yes refl | yes refl = yes refl
... | no x≢y | _ = no (x≢y ∘ ∷-injectiveˡ)
... | yes _ | no xs≢ys = no (xs≢ys ∘ ∷-injectiveʳ)
------------------------------------------------------------------------
-- _[_]=_
module _ {a} {A : Set a} where
[]=-injective : ∀ {n} {xs : Vec A n} {i x y} →
xs [ i ]= x → xs [ i ]= y → x ≡ y
[]=-injective here here = refl
[]=-injective (there xsᵢ≡x) (there xsᵢ≡y) = []=-injective xsᵢ≡x xsᵢ≡y
-- See also Data.Vec.Properties.WithK.[]=-irrelevant.
------------------------------------------------------------------------
-- lookup
module _ {a} {A : Set a} where
[]=⇒lookup : ∀ {n} {x : A} {xs} {i : Fin n} →
xs [ i ]= x → lookup xs i ≡ x
[]=⇒lookup here = refl
[]=⇒lookup (there xs[i]=x) = []=⇒lookup xs[i]=x
lookup⇒[]= : ∀ {n} (i : Fin n) {x : A} xs →
lookup xs i ≡ x → xs [ i ]= x
lookup⇒[]= zero (_ ∷ _) refl = here
lookup⇒[]= (suc i) (_ ∷ xs) p = there (lookup⇒[]= i xs p)
[]=↔lookup : ∀ {n i} {x} {xs : Vec A n} →
xs [ i ]= x ↔ lookup xs i ≡ x
[]=↔lookup {i = i} =
inverse []=⇒lookup (lookup⇒[]= _ _)
lookup⇒[]=∘[]=⇒lookup ([]=⇒lookup∘lookup⇒[]= _ i)
where
lookup⇒[]=∘[]=⇒lookup :
∀ {n x xs} {i : Fin n} (p : xs [ i ]= x) →
lookup⇒[]= i xs ([]=⇒lookup p) ≡ p
lookup⇒[]=∘[]=⇒lookup here = refl
lookup⇒[]=∘[]=⇒lookup (there p) =
P.cong there (lookup⇒[]=∘[]=⇒lookup p)
[]=⇒lookup∘lookup⇒[]= :
∀ {n} xs (i : Fin n) {x} (p : lookup xs i ≡ x) →
[]=⇒lookup (lookup⇒[]= i xs p) ≡ p
[]=⇒lookup∘lookup⇒[]= (x ∷ xs) zero refl = refl
[]=⇒lookup∘lookup⇒[]= (x ∷ xs) (suc i) p =
[]=⇒lookup∘lookup⇒[]= xs i p
------------------------------------------------------------------------
-- updateAt (_[_]%=_)
module _ {a} {A : Set a} where
-- (+) updateAt i actually updates the element at index i.
updateAt-updates : ∀ {n} (i : Fin n) {f : A → A} (xs : Vec A n) {x : A} →
xs [ i ]= x → (updateAt i f xs) [ i ]= f x
updateAt-updates zero (x ∷ xs) here = here
updateAt-updates (suc i) (x ∷ xs) (there loc) = there (updateAt-updates i xs loc)
-- (-) updateAt i does not touch the elements at other indices.
updateAt-minimal : ∀ {n} (i j : Fin n) {f : A → A} {x : A} (xs : Vec A n) →
i ≢ j → xs [ i ]= x → (updateAt j f xs) [ i ]= x
updateAt-minimal zero zero (x ∷ xs) 0≢0 here = ⊥-elim (0≢0 refl)
updateAt-minimal zero (suc j) (x ∷ xs) _ here = here
updateAt-minimal (suc i) zero (x ∷ xs) _ (there loc) = there loc
updateAt-minimal (suc i) (suc j) (x ∷ xs) i≢j (there loc) =
there (updateAt-minimal i j xs (i≢j ∘ P.cong suc) loc)
-- The other properties are consequences of (+) and (-).
-- We spell the most natural properties out.
-- Direct inductive proofs are in most cases easier than just using
-- the defining properties.
-- In the explanations, we make use of shorthand f = g ↾ x
-- meaning that f and g agree at point x, i.e. f x ≡ g x.
-- updateAt i is a morphism from the monoid of endofunctions A → A
-- to the monoid of endofunctions Vec A n → Vec A n
-- 1a. relative identity: f = id ↾ (lookup xs i)
-- implies updateAt i f = id ↾ xs
updateAt-id-relative : ∀ {n} (i : Fin n) (xs : Vec A n) {f : A → A} →
f (lookup xs i) ≡ lookup xs i →
updateAt i f xs ≡ xs
updateAt-id-relative zero (x ∷ xs) eq = P.cong (_∷ xs) eq
updateAt-id-relative (suc i) (x ∷ xs) eq = P.cong (x ∷_) (updateAt-id-relative i xs eq)
-- 1b. identity: updateAt i id ≗ id
updateAt-id : ∀ {n} (i : Fin n) (xs : Vec A n) →
updateAt i id xs ≡ xs
updateAt-id i xs = updateAt-id-relative i xs refl
-- 2a. relative composition: f ∘ g = h ↾ (lookup i xs)
-- implies updateAt i f ∘ updateAt i g ≗ updateAt i h
updateAt-compose-relative : ∀ {n} (i : Fin n) {f g h : A → A} (xs : Vec A n) →
f (g (lookup xs i)) ≡ h (lookup xs i) →
updateAt i f (updateAt i g xs) ≡ updateAt i h xs
updateAt-compose-relative zero (x ∷ xs) fg=h = P.cong (_∷ xs) fg=h
updateAt-compose-relative (suc i) (x ∷ xs) fg=h =
P.cong (x ∷_) (updateAt-compose-relative i xs fg=h)
-- 2b. composition: updateAt i f ∘ updateAt i g ≗ updateAt i (f ∘ g)
updateAt-compose : ∀ {n} (i : Fin n) {f g : A → A} →
updateAt i f ∘ updateAt i g ≗ updateAt i (f ∘ g)
updateAt-compose i xs = updateAt-compose-relative i xs refl
-- 3. congruence: updateAt i is a congruence wrt. extensional equality.
-- 3a. If f = g ↾ (lookup i xs)
-- then updateAt i f = updateAt i g ↾ xs
updateAt-cong-relative : ∀ {n} (i : Fin n) {f g : A → A} (xs : Vec A n) →
f (lookup xs i) ≡ g (lookup xs i) →
updateAt i f xs ≡ updateAt i g xs
updateAt-cong-relative zero (x ∷ xs) f=g = P.cong (_∷ xs) f=g
updateAt-cong-relative (suc i) (x ∷ xs) f=g = P.cong (x ∷_) (updateAt-cong-relative i xs f=g)
-- 3b. congruence: f ≗ g → updateAt i f ≗ updateAt i g
updateAt-cong : ∀ {n} (i : Fin n) {f g : A → A} →
f ≗ g → updateAt i f ≗ updateAt i g
updateAt-cong i f≗g xs = updateAt-cong-relative i xs (f≗g (lookup xs i))
-- The order of updates at different indices i ≢ j does not matter.
-- This a consequence of updateAt-updates and updateAt-minimal
-- but easier to prove inductively.
updateAt-commutes : ∀ {n} (i j : Fin n) {f g : A → A} → i ≢ j →
updateAt i f ∘ updateAt j g ≗ updateAt j g ∘ updateAt i f
updateAt-commutes zero zero 0≢0 (x ∷ xs) = ⊥-elim (0≢0 refl)
updateAt-commutes zero (suc j) i≢j (x ∷ xs) = refl
updateAt-commutes (suc i) zero i≢j (x ∷ xs) = refl
updateAt-commutes (suc i) (suc j) i≢j (x ∷ xs) =
P.cong (x ∷_) (updateAt-commutes i j (i≢j ∘ P.cong suc) xs)
-- lookup after updateAt reduces.
-- For same index this is an easy consequence of updateAt-updates
-- using []=↔lookup.
lookup∘updateAt : ∀ {n} (i : Fin n) {f : A → A} →
∀ xs → lookup (updateAt i f xs) i ≡ f (lookup xs i)
lookup∘updateAt i xs =
[]=⇒lookup (updateAt-updates i xs (lookup⇒[]= i _ refl))
-- For different indices it easily follows from updateAt-minimal.
lookup∘updateAt′ : ∀ {n} (i j : Fin n) {f : A → A} → i ≢ j →
∀ xs → lookup (updateAt j f xs) i ≡ lookup xs i
lookup∘updateAt′ i j xs i≢j =
[]=⇒lookup (updateAt-minimal i j i≢j xs (lookup⇒[]= i _ refl))
-- Aliases for notation _[_]%=_
[]%=-id : ∀ {n} (xs : Vec A n) (i : Fin n) → xs [ i ]%= id ≡ xs
[]%=-id xs i = updateAt-id i xs
[]%=-compose : ∀ {n} (xs : Vec A n) (i : Fin n) {f g : A → A} →
xs [ i ]%= f
[ i ]%= g
≡ xs [ i ]%= g ∘ f
[]%=-compose xs i = updateAt-compose i xs
------------------------------------------------------------------------
-- _[_]≔_ (update)
--
-- _[_]≔_ is defined in terms of updateAt, and all of its properties
-- are special cases of the ones for updateAt.
module _ {a} {A : Set a} where
[]≔-idempotent : ∀ {n} (xs : Vec A n) (i : Fin n) {x₁ x₂ : A} →
(xs [ i ]≔ x₁) [ i ]≔ x₂ ≡ xs [ i ]≔ x₂
[]≔-idempotent xs i = updateAt-compose i xs
[]≔-commutes : ∀ {n} (xs : Vec A n) (i j : Fin n) {x y : A} → i ≢ j →
(xs [ i ]≔ x) [ j ]≔ y ≡ (xs [ j ]≔ y) [ i ]≔ x
[]≔-commutes xs i j i≢j = updateAt-commutes j i (i≢j ∘ P.sym) xs
[]≔-updates : ∀ {n} (xs : Vec A n) (i : Fin n) {x : A} →
(xs [ i ]≔ x) [ i ]= x
[]≔-updates xs i = updateAt-updates i xs (lookup⇒[]= i xs refl)
[]≔-minimal : ∀ {n} (xs : Vec A n) (i j : Fin n) {x y : A} → i ≢ j →
xs [ i ]= x → (xs [ j ]≔ y) [ i ]= x
[]≔-minimal xs i j i≢j loc = updateAt-minimal i j xs i≢j loc
[]≔-lookup : ∀ {n} (xs : Vec A n) (i : Fin n) →
xs [ i ]≔ lookup xs i ≡ xs
[]≔-lookup xs i = updateAt-id-relative i xs refl
lookup∘update : ∀ {n} (i : Fin n) (xs : Vec A n) x →
lookup (xs [ i ]≔ x) i ≡ x
lookup∘update i xs x = lookup∘updateAt i xs
lookup∘update′ : ∀ {n} {i j : Fin n} → i ≢ j → ∀ (xs : Vec A n) y →
lookup (xs [ j ]≔ y) i ≡ lookup xs i
lookup∘update′ {n} {i} {j} i≢j xs y = lookup∘updateAt′ i j i≢j xs
------------------------------------------------------------------------
-- map
map-id : ∀ {a n} {A : Set a} → map {n = n} {A} id ≗ id
map-id [] = refl
map-id (x ∷ xs) = P.cong (x ∷_) (map-id xs)
map-cong : ∀ {a b n} {A : Set a} {B : Set b} {f g : A → B} →
f ≗ g → map {n = n} f ≗ map g
map-cong f≗g [] = refl
map-cong f≗g (x ∷ xs) = P.cong₂ _∷_ (f≗g x) (map-cong f≗g xs)
map-∘ : ∀ {a b c n} {A : Set a} {B : Set b} {C : Set c}
(f : B → C) (g : A → B) →
map {n = n} (f ∘ g) ≗ map f ∘ map g
map-∘ f g [] = refl
map-∘ f g (x ∷ xs) = P.cong (f (g x) ∷_) (map-∘ f g xs)
lookup-map : ∀ {a b n} {A : Set a} {B : Set b}
(i : Fin n) (f : A → B) (xs : Vec A n) →
lookup (map f xs) i ≡ f (lookup xs i)
lookup-map zero f (x ∷ xs) = refl
lookup-map (suc i) f (x ∷ xs) = lookup-map i f xs
map-updateAt : ∀ {n a b} {A : Set a} {B : Set b} →
∀ {f : A → B} {g : A → A} {h : B → B} (xs : Vec A n) (i : Fin n)
→ f (g (lookup xs i)) ≡ h (f (lookup xs i))
→ map f (updateAt i g xs) ≡ updateAt i h (map f xs)
map-updateAt (x ∷ xs) zero eq = P.cong (_∷ _) eq
map-updateAt (x ∷ xs) (suc i) eq = P.cong (_ ∷_) (map-updateAt xs i eq)
map-[]≔ : ∀ {n a b} {A : Set a} {B : Set b}
(f : A → B) (xs : Vec A n) (i : Fin n) {x : A} →
map f (xs [ i ]≔ x) ≡ map f xs [ i ]≔ f x
map-[]≔ f xs i = map-updateAt xs i refl
------------------------------------------------------------------------
-- _++_
module _ {a} {A : Set a} {m} {ys ys' : Vec A m} where
-- See also Data.Vec.Properties.WithK.++-assoc.
++-injectiveˡ : ∀ {n} (xs xs' : Vec A n) →
xs ++ ys ≡ xs' ++ ys' → xs ≡ xs'
++-injectiveˡ [] [] _ = refl
++-injectiveˡ (x ∷ xs) (x' ∷ xs') eq =
P.cong₂ _∷_ (∷-injectiveˡ eq) (++-injectiveˡ _ _ (∷-injectiveʳ eq))
++-injectiveʳ : ∀ {n} (xs xs' : Vec A n) →
xs ++ ys ≡ xs' ++ ys' → ys ≡ ys'
++-injectiveʳ [] [] eq = eq
++-injectiveʳ (x ∷ xs) (x' ∷ xs') eq =
++-injectiveʳ xs xs' (∷-injectiveʳ eq)
++-injective : ∀ {n} (xs xs' : Vec A n) →
xs ++ ys ≡ xs' ++ ys' → xs ≡ xs' × ys ≡ ys'
++-injective xs xs' eq =
(++-injectiveˡ xs xs' eq , ++-injectiveʳ xs xs' eq)
module _ {a} {A : Set a} where
lookup-++-< : ∀ {m n} (xs : Vec A m) (ys : Vec A n) →
∀ i (i<m : toℕ i < m) →
lookup (xs ++ ys)i ≡ lookup xs (Fin.fromℕ≤ i<m)
lookup-++-< [] ys i ()
lookup-++-< (x ∷ xs) ys zero (s≤s z≤n) = refl
lookup-++-< (x ∷ xs) ys (suc i) (s≤s (s≤s i<m)) =
lookup-++-< xs ys i (s≤s i<m)
lookup-++-≥ : ∀ {m n} (xs : Vec A m) (ys : Vec A n) →
∀ i (i≥m : toℕ i ≥ m) →
lookup (xs ++ ys) i ≡ lookup ys (Fin.reduce≥ i i≥m)
lookup-++-≥ [] ys i i≥m = refl
lookup-++-≥ (x ∷ xs) ys zero ()
lookup-++-≥ (x ∷ xs) ys (suc i) (s≤s i≥m) = lookup-++-≥ xs ys i i≥m
lookup-++-inject+ : ∀ {m n} (xs : Vec A m) (ys : Vec A n) i →
lookup (xs ++ ys) (Fin.inject+ n i) ≡ lookup xs i
lookup-++-inject+ [] ys ()
lookup-++-inject+ (x ∷ xs) ys zero = refl
lookup-++-inject+ (x ∷ xs) ys (suc i) = lookup-++-inject+ xs ys i
lookup-++-+′ : ∀ {m n} (xs : Vec A m) (ys : Vec A n) i →
lookup (xs ++ ys) (fromℕ m +′ i) ≡ lookup ys i
lookup-++-+′ [] ys zero = refl
lookup-++-+′ [] (y ∷ xs) (suc i) = lookup-++-+′ [] xs i
lookup-++-+′ (x ∷ xs) ys i = lookup-++-+′ xs ys i
[]≔-++-inject+ : ∀ {m n x} (xs : Vec A m) (ys : Vec A n) i →
(xs ++ ys) [ Fin.inject+ n i ]≔ x ≡ (xs [ i ]≔ x) ++ ys
[]≔-++-inject+ [] ys ()
[]≔-++-inject+ (x ∷ xs) ys zero = refl
[]≔-++-inject+ (x ∷ xs) ys (suc i) =
P.cong (x ∷_) $ []≔-++-inject+ xs ys i
------------------------------------------------------------------------
-- zipWith
module _ {a} {A : Set a} {f : A → A → A} where
zipWith-assoc : Associative _≡_ f → ∀ {n} →
Associative _≡_ (zipWith {n = n} f)
zipWith-assoc assoc [] [] [] = refl
zipWith-assoc assoc (x ∷ xs) (y ∷ ys) (z ∷ zs) =
P.cong₂ _∷_ (assoc x y z) (zipWith-assoc assoc xs ys zs)
zipWith-idem : Idempotent _≡_ f → ∀ {n} →
Idempotent _≡_ (zipWith {n = n} f)
zipWith-idem idem [] = refl
zipWith-idem idem (x ∷ xs) =
P.cong₂ _∷_ (idem x) (zipWith-idem idem xs)
zipWith-identityˡ : ∀ {1#} → LeftIdentity _≡_ 1# f → ∀ {n} →
LeftIdentity _≡_ (replicate 1#) (zipWith {n = n} f)
zipWith-identityˡ idˡ [] = refl
zipWith-identityˡ idˡ (x ∷ xs) =
P.cong₂ _∷_ (idˡ x) (zipWith-identityˡ idˡ xs)
zipWith-identityʳ : ∀ {1#} → RightIdentity _≡_ 1# f → ∀ {n} →
RightIdentity _≡_ (replicate 1#) (zipWith {n = n} f)
zipWith-identityʳ idʳ [] = refl
zipWith-identityʳ idʳ (x ∷ xs) =
P.cong₂ _∷_ (idʳ x) (zipWith-identityʳ idʳ xs)
zipWith-zeroˡ : ∀ {0#} → LeftZero _≡_ 0# f → ∀ {n} →
LeftZero _≡_ (replicate 0#) (zipWith {n = n} f)
zipWith-zeroˡ zeˡ [] = refl
zipWith-zeroˡ zeˡ (x ∷ xs) =
P.cong₂ _∷_ (zeˡ x) (zipWith-zeroˡ zeˡ xs)
zipWith-zeroʳ : ∀ {0#} → RightZero _≡_ 0# f → ∀ {n} →
RightZero _≡_ (replicate 0#) (zipWith {n = n} f)
zipWith-zeroʳ zeʳ [] = refl
zipWith-zeroʳ zeʳ (x ∷ xs) =
P.cong₂ _∷_ (zeʳ x) (zipWith-zeroʳ zeʳ xs)
zipWith-inverseˡ : ∀ {⁻¹ 0#} → LeftInverse _≡_ 0# ⁻¹ f → ∀ {n} →
LeftInverse _≡_ (replicate {n = n} 0#) (map ⁻¹) (zipWith f)
zipWith-inverseˡ invˡ [] = refl
zipWith-inverseˡ invˡ (x ∷ xs) =
P.cong₂ _∷_ (invˡ x) (zipWith-inverseˡ invˡ xs)
zipWith-inverseʳ : ∀ {⁻¹ 0#} → RightInverse _≡_ 0# ⁻¹ f → ∀ {n} →
RightInverse _≡_ (replicate {n = n} 0#) (map ⁻¹) (zipWith f)
zipWith-inverseʳ invʳ [] = refl
zipWith-inverseʳ invʳ (x ∷ xs) =
P.cong₂ _∷_ (invʳ x) (zipWith-inverseʳ invʳ xs)
zipWith-distribˡ : ∀ {g} → _DistributesOverˡ_ _≡_ f g → ∀ {n} →
_DistributesOverˡ_ _≡_ (zipWith {n = n} f) (zipWith g)
zipWith-distribˡ distribˡ [] [] [] = refl
zipWith-distribˡ distribˡ (x ∷ xs) (y ∷ ys) (z ∷ zs) =
P.cong₂ _∷_ (distribˡ x y z) (zipWith-distribˡ distribˡ xs ys zs)
zipWith-distribʳ : ∀ {g} → _DistributesOverʳ_ _≡_ f g → ∀ {n} →
_DistributesOverʳ_ _≡_ (zipWith {n = n} f) (zipWith g)
zipWith-distribʳ distribʳ [] [] [] = refl
zipWith-distribʳ distribʳ (x ∷ xs) (y ∷ ys) (z ∷ zs) =
P.cong₂ _∷_ (distribʳ x y z) (zipWith-distribʳ distribʳ xs ys zs)
zipWith-absorbs : ∀ {g} → _Absorbs_ _≡_ f g → ∀ {n} →
_Absorbs_ _≡_ (zipWith {n = n} f) (zipWith g)
zipWith-absorbs abs [] [] = refl
zipWith-absorbs abs (x ∷ xs) (y ∷ ys) =
P.cong₂ _∷_ (abs x y) (zipWith-absorbs abs xs ys)
module _ {a b} {A : Set a} {B : Set b} {f : A → A → B} where
zipWith-comm : (∀ x y → f x y ≡ f y x) → ∀ {n}
(xs ys : Vec A n) → zipWith f xs ys ≡ zipWith f ys xs
zipWith-comm comm [] [] = refl
zipWith-comm comm (x ∷ xs) (y ∷ ys) =
P.cong₂ _∷_ (comm x y) (zipWith-comm comm xs ys)
module _ {a b c d} {A : Set a} {B : Set b} {C : Set c} {D : Set d} where
zipWith-map₁ : ∀ {n} (_⊕_ : B → C → D) (f : A → B)
(xs : Vec A n) (ys : Vec C n) →
zipWith _⊕_ (map f xs) ys ≡ zipWith (λ x y → f x ⊕ y) xs ys
zipWith-map₁ _⊕_ f [] [] = refl
zipWith-map₁ _⊕_ f (x ∷ xs) (y ∷ ys) =
P.cong (f x ⊕ y ∷_) (zipWith-map₁ _⊕_ f xs ys)
zipWith-map₂ : ∀ {n} (_⊕_ : A → C → D) (f : B → C)
(xs : Vec A n) (ys : Vec B n) →
zipWith _⊕_ xs (map f ys) ≡ zipWith (λ x y → x ⊕ f y) xs ys
zipWith-map₂ _⊕_ f [] [] = refl
zipWith-map₂ _⊕_ f (x ∷ xs) (y ∷ ys) =
P.cong (x ⊕ f y ∷_) (zipWith-map₂ _⊕_ f xs ys)
module _ {a b c} {A : Set a} {B : Set b} {C : Set c} where
lookup-zipWith : ∀ (f : A → B → C) {n} (i : Fin n) xs ys →
lookup (zipWith f xs ys) i ≡ f (lookup xs i) (lookup ys i)
lookup-zipWith _ zero (x ∷ _) (y ∷ _) = refl
lookup-zipWith _ (suc i) (_ ∷ xs) (_ ∷ ys) = lookup-zipWith _ i xs ys
------------------------------------------------------------------------
-- zip
module _ {a b} {A : Set a} {B : Set b} where
lookup-zip : ∀ {n} (i : Fin n) (xs : Vec A n) (ys : Vec B n) →
lookup (zip xs ys) i ≡ (lookup xs i , lookup ys i)
lookup-zip = lookup-zipWith _,_
-- map lifts projections to vectors of products.
map-proj₁-zip : ∀ {n} (xs : Vec A n) (ys : Vec B n) →
map proj₁ (zip xs ys) ≡ xs
map-proj₁-zip [] [] = refl
map-proj₁-zip (x ∷ xs) (y ∷ ys) = P.cong (x ∷_) (map-proj₁-zip xs ys)
map-proj₂-zip : ∀ {n} (xs : Vec A n) (ys : Vec B n) →
map proj₂ (zip xs ys) ≡ ys
map-proj₂-zip [] [] = refl
map-proj₂-zip (x ∷ xs) (y ∷ ys) = P.cong (y ∷_) (map-proj₂-zip xs ys)
-- map lifts pairing to vectors of products.
map-<,>-zip : ∀ {a b c n} {A : Set a} {B : Set b} {C : Set c}
(f : A → B) (g : A → C) (xs : Vec A n) →
map < f , g > xs ≡ zip (map f xs) (map g xs)
map-<,>-zip f g [] = P.refl
map-<,>-zip f g (x ∷ xs) = P.cong (_ ∷_) (map-<,>-zip f g xs)
map-zip : ∀ {a b c d n} {A : Set a} {B : Set b} {C : Set c} {D : Set d}
(f : A → B) (g : C → D) (xs : Vec A n) (ys : Vec C n) →
map (Prod.map f g) (zip xs ys) ≡ zip (map f xs) (map g ys)
map-zip f g [] [] = refl
map-zip f g (x ∷ xs) (y ∷ ys) = P.cong (_ ∷_) (map-zip f g xs ys)
------------------------------------------------------------------------
-- unzip
module _ {a b} {A : Set a} {B : Set b} where
lookup-unzip : ∀ {n} (i : Fin n) (xys : Vec (A × B) n) →
let xs , ys = unzip xys
in (lookup xs i , lookup ys i) ≡ lookup xys i
lookup-unzip () []
lookup-unzip zero ((x , y) ∷ xys) = refl
lookup-unzip (suc i) ((x , y) ∷ xys) = lookup-unzip i xys
map-unzip : ∀ {c d n} {C : Set c} {D : Set d}
(f : A → B) (g : C → D) (xys : Vec (A × C) n) →
let xs , ys = unzip xys
in (map f xs , map g ys) ≡ unzip (map (Prod.map f g) xys)
map-unzip f g [] = refl
map-unzip f g ((x , y) ∷ xys) =
P.cong (Prod.map (f x ∷_) (g y ∷_)) (map-unzip f g xys)
-- Products of vectors are isomorphic to vectors of products.
unzip∘zip : ∀ {n} (xs : Vec A n) (ys : Vec B n) →
unzip (zip xs ys) ≡ (xs , ys)
unzip∘zip [] [] = refl
unzip∘zip (x ∷ xs) (y ∷ ys) =
P.cong (Prod.map (x ∷_) (y ∷_)) (unzip∘zip xs ys)
zip∘unzip : ∀ {n} (xys : Vec (A × B) n) →
uncurry zip (unzip xys) ≡ xys
zip∘unzip [] = refl
zip∘unzip ((x , y) ∷ xys) = P.cong ((x , y) ∷_) (zip∘unzip xys)
×v↔v× : ∀ {n} → (Vec A n × Vec B n) ↔ Vec (A × B) n
×v↔v× = inverse (uncurry zip) unzip (uncurry unzip∘zip) zip∘unzip
------------------------------------------------------------------------
-- _⊛_
module _ {a b} {A : Set a} {B : Set b} where
lookup-⊛ : ∀ {n} i (fs : Vec (A → B) n) (xs : Vec A n) →
lookup (fs ⊛ xs) i ≡ (lookup fs i $ lookup xs i)
lookup-⊛ zero (f ∷ fs) (x ∷ xs) = refl
lookup-⊛ (suc i) (f ∷ fs) (x ∷ xs) = lookup-⊛ i fs xs
map-is-⊛ : ∀ {n} (f : A → B) (xs : Vec A n) →
map f xs ≡ (replicate f ⊛ xs)
map-is-⊛ f [] = refl
map-is-⊛ f (x ∷ xs) = P.cong (_ ∷_) (map-is-⊛ f xs)
⊛-is-zipWith : ∀ {n} (fs : Vec (A → B) n) (xs : Vec A n) →
(fs ⊛ xs) ≡ zipWith _$_ fs xs
⊛-is-zipWith [] [] = refl
⊛-is-zipWith (f ∷ fs) (x ∷ xs) = P.cong (f x ∷_) (⊛-is-zipWith fs xs)
zipWith-is-⊛ : ∀ {c} {C : Set c} {n} (f : A → B → C) →
(xs : Vec A n) (ys : Vec B n) →
zipWith f xs ys ≡ (replicate f ⊛ xs ⊛ ys)
zipWith-is-⊛ f [] [] = refl
zipWith-is-⊛ f (x ∷ xs) (y ∷ ys) = P.cong (_ ∷_) (zipWith-is-⊛ f xs ys)
------------------------------------------------------------------------
-- foldr
-- See also Data.Vec.Properties.WithK.foldr-cong.
-- The (uniqueness part of the) universality property for foldr.
foldr-universal : ∀ {a b} {A : Set a} (B : ℕ → Set b)
(f : ∀ {n} → A → B n → B (suc n)) {e}
(h : ∀ {n} → Vec A n → B n) →
h [] ≡ e →
(∀ {n} x → h ∘ (x ∷_) ≗ f {n} x ∘ h) →
∀ {n} → h ≗ foldr B {n} f e
foldr-universal B f {_} h base step [] = base
foldr-universal B f {e} h base step (x ∷ xs) = begin
h (x ∷ xs)
≡⟨ step x xs ⟩
f x (h xs)
≡⟨ P.cong (f x) (foldr-universal B f h base step xs) ⟩
f x (foldr B f e xs)
∎
where open P.≡-Reasoning
foldr-fusion : ∀ {a b c} {A : Set a}
{B : ℕ → Set b} {f : ∀ {n} → A → B n → B (suc n)} e
{C : ℕ → Set c} {g : ∀ {n} → A → C n → C (suc n)}
(h : ∀ {n} → B n → C n) →
(∀ {n} x → h ∘ f {n} x ≗ g x ∘ h) →
∀ {n} → h ∘ foldr B {n} f e ≗ foldr C g (h e)
foldr-fusion {B = B} {f} e {C} h fuse =
foldr-universal C _ _ refl (λ x xs → fuse x (foldr B f e xs))
idIsFold : ∀ {a n} {A : Set a} → id ≗ foldr (Vec A) {n} _∷_ []
idIsFold = foldr-universal _ _ id refl (λ _ _ → refl)
------------------------------------------------------------------------
-- sum
sum-++-commute : ∀ {m n} (xs : Vec ℕ m) {ys : Vec ℕ n} →
sum (xs ++ ys) ≡ sum xs + sum ys
sum-++-commute [] {_} = refl
sum-++-commute (x ∷ xs) {ys} = begin
x + sum (xs ++ ys) ≡⟨ P.cong (x +_) (sum-++-commute xs) ⟩
x + (sum xs + sum ys) ≡⟨ P.sym (+-assoc x (sum xs) (sum ys)) ⟩
sum (x ∷ xs) + sum ys ∎
where open P.≡-Reasoning
------------------------------------------------------------------------
-- replicate
lookup-replicate : ∀ {a n} {A : Set a} (i : Fin n) (x : A) →
lookup (replicate x) i ≡ x
lookup-replicate zero = λ _ → refl
lookup-replicate (suc i) = lookup-replicate i
map-replicate : ∀ {a b} {A : Set a} {B : Set b} (f : A → B) (x : A) →
∀ n → map f (replicate x) ≡ replicate {n = n} (f x)
map-replicate f x zero = refl
map-replicate f x (suc n) = P.cong (f x ∷_) (map-replicate f x n)
module _ {a b c} {A : Set a} {B : Set b} {C : Set c} where
zipWith-replicate₁ : ∀ {n} (_⊕_ : A → B → C) (x : A) (ys : Vec B n) →
zipWith _⊕_ (replicate x) ys ≡ map (x ⊕_) ys
zipWith-replicate₁ _⊕_ x [] = refl
zipWith-replicate₁ _⊕_ x (y ∷ ys) =
P.cong (x ⊕ y ∷_) (zipWith-replicate₁ _⊕_ x ys)
zipWith-replicate₂ : ∀ {n} (_⊕_ : A → B → C) (xs : Vec A n) (y : B) →
zipWith _⊕_ xs (replicate y) ≡ map (_⊕ y) xs
zipWith-replicate₂ _⊕_ [] y = refl
zipWith-replicate₂ _⊕_ (x ∷ xs) y =
P.cong (x ⊕ y ∷_) (zipWith-replicate₂ _⊕_ xs y)
------------------------------------------------------------------------
-- tabulate
lookup∘tabulate : ∀ {a n} {A : Set a} (f : Fin n → A) (i : Fin n) →
lookup (tabulate f) i ≡ f i
lookup∘tabulate f zero = refl
lookup∘tabulate f (suc i) = lookup∘tabulate (f ∘ suc) i
tabulate∘lookup : ∀ {a n} {A : Set a} (xs : Vec A n) →
tabulate (lookup xs) ≡ xs
tabulate∘lookup [] = refl
tabulate∘lookup (x ∷ xs) = P.cong (x ∷_) (tabulate∘lookup xs)
tabulate-∘ : ∀ {n a b} {A : Set a} {B : Set b}
(f : A → B) (g : Fin n → A) →
tabulate (f ∘ g) ≡ map f (tabulate g)
tabulate-∘ {zero} f g = refl
tabulate-∘ {suc n} f g = P.cong (f (g zero) ∷_) (tabulate-∘ f (g ∘ suc))
tabulate-cong : ∀ {n a} {A : Set a} {f g : Fin n → A} → f ≗ g → tabulate f ≡ tabulate g
tabulate-cong {zero} p = refl
tabulate-cong {suc n} p = P.cong₂ _∷_ (p zero) (tabulate-cong (p ∘ suc))
------------------------------------------------------------------------
-- allFin
lookup-allFin : ∀ {n} (i : Fin n) → lookup (allFin n) i ≡ i
lookup-allFin = lookup∘tabulate id
allFin-map : ∀ n → allFin (suc n) ≡ zero ∷ map suc (allFin n)
allFin-map n = P.cong (zero ∷_) $ tabulate-∘ suc id
tabulate-allFin : ∀ {n a} {A : Set a} (f : Fin n → A) →
tabulate f ≡ map f (allFin n)
tabulate-allFin f = tabulate-∘ f id
-- If you look up every possible index, in increasing order, then you
-- get back the vector you started with.
map-lookup-allFin : ∀ {a} {A : Set a} {n} (xs : Vec A n) →
map (lookup xs) (allFin n) ≡ xs
map-lookup-allFin {n = n} xs = begin
map (lookup xs) (allFin n) ≡˘⟨ tabulate-∘ (lookup xs) id ⟩
tabulate (lookup xs) ≡⟨ tabulate∘lookup xs ⟩
xs ∎
where open P.≡-Reasoning
------------------------------------------------------------------------
-- count
module _ {a p} {A : Set a} {P : Pred A p} (P? : Decidable P) where
count≤n : ∀ {n} (xs : Vec A n) → count P? xs ≤ n
count≤n [] = z≤n
count≤n (x ∷ xs) with P? x
... | yes _ = s≤s (count≤n xs)
... | no _ = ≤-step (count≤n xs)
------------------------------------------------------------------------
-- insert
module _ {a} {A : Set a} where
insert-lookup : ∀ {n} (xs : Vec A n) (i : Fin (suc n)) (v : A) →
lookup (insert xs i v) i ≡ v
insert-lookup xs zero v = refl
insert-lookup [] (suc ()) v
insert-lookup (x ∷ xs) (suc i) v = insert-lookup xs i v
insert-punchIn : ∀ {n} (xs : Vec A n) (i : Fin (suc n)) (v : A)
(j : Fin n) →
lookup (insert xs i v) (Fin.punchIn i j) ≡ lookup xs j
insert-punchIn xs zero v j = refl
insert-punchIn [] (suc ()) v j
insert-punchIn (x ∷ xs) (suc i) v zero = refl
insert-punchIn (x ∷ xs) (suc i) v (suc j) = insert-punchIn xs i v j
remove-punchOut : ∀ {n} (xs : Vec A (suc n))
{i : Fin (suc n)} {j : Fin (suc n)} (i≢j : i ≢ j) →
lookup (remove xs i) (Fin.punchOut i≢j) ≡ lookup xs j
remove-punchOut (x ∷ xs) {zero} {zero} i≢j = ⊥-elim (i≢j refl)
remove-punchOut (x ∷ xs) {zero} {suc j} i≢j = refl
remove-punchOut (x ∷ []) {suc ()} {j} i≢j
remove-punchOut (x ∷ y ∷ xs) {suc i} {zero} i≢j = refl
remove-punchOut (x ∷ y ∷ xs) {suc i} {suc j} i≢j =
remove-punchOut (y ∷ xs) (i≢j ∘ P.cong suc)
------------------------------------------------------------------------
-- remove
remove-insert : ∀ {n} (xs : Vec A n) (i : Fin (suc n)) (v : A) →
remove (insert xs i v) i ≡ xs
remove-insert xs zero v = refl
remove-insert [] (suc ()) v
remove-insert (x ∷ xs) (suc zero) v = refl
remove-insert (x ∷ []) (suc (suc ())) v
remove-insert (x ∷ y ∷ xs) (suc (suc i)) v =
P.cong (x ∷_) (remove-insert (y ∷ xs) (suc i) v)
insert-remove : ∀ {n} (xs : Vec A (suc n)) (i : Fin (suc n)) →
insert (remove xs i) i (lookup xs i) ≡ xs
insert-remove (x ∷ xs) zero = refl
insert-remove (x ∷ []) (suc ())
insert-remove (x ∷ y ∷ xs) (suc i) =
P.cong (x ∷_) (insert-remove (y ∷ xs) i)
------------------------------------------------------------------------
-- Conversion function
module _ {a} {A : Set a} where
toList∘fromList : (xs : List A) → toList (fromList xs) ≡ xs
toList∘fromList List.[] = refl
toList∘fromList (x List.∷ xs) = P.cong (x List.∷_) (toList∘fromList xs)
|
programs/oeis/240/A240001.asm | jmorken/loda | 1 | 105203 | <filename>programs/oeis/240/A240001.asm<gh_stars>1-10
; A240001: Number of 2 X n 0..3 arrays with no element equal to one plus the sum of elements to its left or two plus the sum of the elements above it or one plus the sum of the elements diagonally to its northwest, modulo 4.
; 5,13,25,42,65,95,133,180,237,305,385,478,585,707,845,1000,1173,1365,1577,1810,2065,2343,2645,2972,3325,3705,4113,4550,5017,5515,6045,6608,7205,7837,8505,9210,9953,10735,11557,12420,13325,14273,15265,16302
add $0,4
mov $1,$0
bin $1,3
add $1,$0
add $1,$0
sub $1,7
|
examples/zmq-examples-multi_thread_server.adb | persan/zeromq-Ada | 33 | 9363 | <filename>examples/zmq-examples-multi_thread_server.adb
-------------------------------------------------------------------------------
-- Copyright (C) 2020-2030, <EMAIL> --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files --
-- (the "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, sublicense, and / or sell copies of the Software, and to --
-- permit persons to whom the Software is furnished to do so, subject to --
-- the following conditions : --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, --
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR --
-- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, --
-- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR --
-- OTHER DEALINGS IN THE SOFTWARE. --
-------------------------------------------------------------------------------
with ZMQ.Sockets;
with ZMQ.Contexts;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with ZMQ.Proxys;
procedure ZMQ.Examples.Multi_Thread_Server is
task type Server_Task (Ctx : not null access ZMQ.Contexts.Context;
Id : Integer) is
end Server_Task;
type Server_Task_Access is access all Server_Task;
task body Server_Task is
Msg : Ada.Strings.Unbounded.Unbounded_String;
S : ZMQ.Sockets.Socket;
begin
S.Initialize (Ctx.all, Sockets.REP);
S.Connect ("inproc://workers");
loop
Msg := S.Recv;
Append (Msg, "<Served by thread:" & Id'Img & ">");
S.Send (Msg);
end loop;
end Server_Task;
Ctx : aliased ZMQ.Contexts.Context;
Number_Of_Servers : constant := 10;
Servers : array (1 .. Number_Of_Servers) of Server_Task_Access;
Workers : aliased ZMQ.Sockets.Socket;
Clients : aliased ZMQ.Sockets.Socket;
begin
-- Initialise 0MQ context, requesting a single application thread
-- and a single I/O thread
Ctx.Set_Number_Of_IO_Threads (Servers'Length + 1);
-- Create a ZMQ_REP socket to receive requests and send replies
Workers.Initialize (Ctx, Sockets.ROUTER);
Workers.Bind ("tcp://lo:5555");
-- Bind to the TCP transport and port 5555 on the 'lo' interface
Clients.Initialize (Ctx, Sockets.DEALER);
Clients.Bind ("inproc://workers");
for I in Servers'Range loop
Servers (I) := new Server_Task (Ctx'Access, I);
end loop;
ZMQ.Proxys.Proxy (Frontend => Clients'Access,
Backend => Workers'Access);
end ZMQ.Examples.Multi_Thread_Server;
|
alloy4fun_models/trashltl/models/7/baLfa5utchAB5WMgd.als | Kaixi26/org.alloytools.alloy | 0 | 5354 | <filename>alloy4fun_models/trashltl/models/7/baLfa5utchAB5WMgd.als
open main
pred idbaLfa5utchAB5WMgd_prop8 {
always (some f : File | some f.link implies after eventually f in Trash)
}
pred __repair { idbaLfa5utchAB5WMgd_prop8 }
check __repair { idbaLfa5utchAB5WMgd_prop8 <=> prop8o } |
src/ado-sessions-entities.adb | My-Colaborations/ada-ado | 0 | 27392 | <reponame>My-Colaborations/ada-ado<gh_stars>0
-----------------------------------------------------------------------
-- ado-sessions-entities -- Find entity types
-- Copyright (C) 2011, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ADO.Schemas.Entities;
package body ADO.Sessions.Entities is
-- ------------------------------
-- Find the entity type object associated with the given database table.
-- Raises the No_Entity_Type exception if no such mapping exist.
-- ------------------------------
function Find_Entity_Type (Session : in ADO.Sessions.Session'Class;
Object : in ADO.Objects.Object_Key)
return ADO.Entity_Type is
begin
Check_Session (Session);
return ADO.Schemas.Entities.Find_Entity_Type (Session.Impl.Entities.all,
Object.Of_Class);
end Find_Entity_Type;
-- ------------------------------
-- Find the entity type index associated with the given database table.
-- Raises the No_Entity_Type exception if no such mapping exist.
-- ------------------------------
function Find_Entity_Type (Session : in ADO.Sessions.Session'Class;
Table : in ADO.Schemas.Class_Mapping_Access)
return ADO.Entity_Type is
begin
Check_Session (Session);
return ADO.Schemas.Entities.Find_Entity_Type (Session.Impl.Entities.all, Table);
end Find_Entity_Type;
-- ------------------------------
-- Find the entity type index associated with the given database table.
-- Raises the No_Entity_Type exception if no such mapping exist.
-- ------------------------------
function Find_Entity_Type (Session : in ADO.Sessions.Session'Class;
Name : in Util.Strings.Name_Access)
return ADO.Entity_Type is
begin
Check_Session (Session);
return ADO.Schemas.Entities.Find_Entity_Type (Session.Impl.Entities.all, Name);
end Find_Entity_Type;
-- ------------------------------
-- Find the entity type index associated with the given database table.
-- Raises the No_Entity_Type exception if no such mapping exist.
-- ------------------------------
function Find_Entity_Type (Session : in ADO.Sessions.Session'Class;
Name : in String) return ADO.Entity_Type is
begin
return Find_Entity_Type (Session, Name'Unrestricted_Access);
end Find_Entity_Type;
-- ------------------------------
-- Resolve the entity type associated with the database table <b>Table</b> by using
-- the <b<Session</b> connection object. Then, bind the parameter identified by
-- <b>Name</b> in the parameter list.
-- ------------------------------
procedure Bind_Param (Params : in out ADO.Parameters.Abstract_List'Class;
Name : in String;
Table : in ADO.Schemas.Class_Mapping_Access;
Session : in ADO.Sessions.Session'Class) is
Value : constant Entity_Type := Find_Entity_Type (Session, Table.Table.all);
begin
Params.Bind_Param (Name, Value);
end Bind_Param;
end ADO.Sessions.Entities;
|
Peterson.als | nishio/learning_alloy | 1 | 498 | open util/ordering[Time]
sig Time {}
one sig Memory {
turn: Int -> Time,
flag: Int -> Int -> Time
}{
all t: Time {
one flag[0].t
one flag[1].t
no flag[Int - 0 - 1].t
}
}
one sig PC {
proc: Int -> Int -> Time,
current_pid: Int -> Time
}{
all t: Time {
one proc[0].t
one proc[1].t
no proc[Int - 0 - 1].t
}
}
fact {
// 最初はメモリはみんな0
let t = first {
Memory.turn.t = 0
Memory.flag[0].t = 0
Memory.flag[1].t = 0
// 最初はプログラムカウンタは0
PC.proc[0].t = 0
PC.proc[1].t = 0
}
}
pred store(t: Time, target: univ -> Time, value: univ){
one value
target.t = value
}
pred must_wait(t: Time, pid: Int){
let other = (0 + 1) - pid {
Memory.flag[other].t = 1 // otherがwaitしている
Memory.turn.t = other // otherが優先権を持っている
}
}
pred no_change(t: Time, changable: univ -> Time){
changable.t = changable.(t.prev)
}
pred step(t: Time) {
// 各時刻でどちらかのプロセスが1命令実行する
some pid: (0 + 1) {
PC.current_pid.t = pid
let pc = PC.proc[pid].(t.prev),
nextpc = PC.proc[pid].t,
other = (0 + 1) - pid
{
(pc = 0) => {
// flag[0] = 1
store[t, Memory.flag[pid], 1]
nextpc = plus[pc, 1]
no_change[t, Memory.turn]
}
(pc = 1) => {
// turn = 1
store[t, Memory.turn, other]
nextpc = plus[pc, 1]
no_change[t, Memory.flag[pid]]
}
(pc = 2) => {
// while( flag[1] && turn == 1 );
must_wait[t, pid] => {
nextpc = pc
}else{
nextpc = plus[pc, 1]
}
no_change[t, Memory.turn]
no_change[t, Memory.flag[pid]]
}
(pc = 3) => {
// flag[0] = 0
store[t, Memory.flag[pid], 0]
nextpc = 0
no_change[t, Memory.turn]
}
// no change
no_change[t, PC.proc[other]]
no_change[t, Memory.flag[other]]
}
}
}
check MutualExclusion {
no t: Time {
PC.proc[0].t = 3
PC.proc[1].t = 3
}
} for 15 Time
check BoundedWaiting_Bad {
no t: Time, pid: Int {
PC.proc[pid].t = 2
PC.proc[pid].(t.next) = 2
PC.proc[pid].(t.next.next) = 2
PC.proc[pid].(t.next.next.next) = 2
PC.proc[pid].(t.next.next.next.next) = 2
}
} for 15 Time
check BoundedWaiting {
no t, t': Time, pid: Int {
let range = Time - t.prevs - t'.nexts {
// あるプロセスがずっと2(ロック待ち)で
all t'': range | PC.proc[pid].t'' = 2
// その間、もう片方のプロセスが2回以上3(クリティカルセクション)を実行
#{t'': range |
PC.proc[PC.current_pid.t''].t'' = 3
} >= 2
}
}
} for 15 Time
fact {
all t: Time - first {
step[t]
}
}
run {
} for exactly 20 Time
|
applescript/csvMessage.applescript | Grassroots-Democrats-HQ/Autotexter | 1 | 99 | <reponame>Grassroots-Democrats-HQ/Autotexter
on run
set pathCSVFile to (choose file with prompt "Select the CSV file" of type "csv")
set strCSV to read pathCSVFile
set pathTemplateFile to (choose file with prompt "Select the message template" of type "txt")
set messageTemplate to read pathTemplateFile
repeat with contact in csvToList(strCSV, {})
set firstName to first item of contact
set phoneNumber to second item of contact
set theDialogText to "Click ok to send texts"
display dialog theDialogText
set message to replace(messageTemplate, "<<firstName>>", firstName)
sendMessage(phoneNumber, message)
end repeat
end run
on sendMessage(phoneNumber, message)
activate application "Messages"
tell application "System Events" to tell process "Messages"
key code 45 using command down -- press Command + N to start a new window
keystroke phoneNumber -- input the phone number
key code 36 -- press Enter to focus on the message area
keystroke message -- type some message
key code 36 -- press Enter to send
end tell
end sendMessage
on replace(theText, theSearchString, theReplacementString)
set AppleScript's text item delimiters to theSearchString
set theTextItems to every text item of theText
set AppleScript's text item delimiters to theReplacementString
set theText to theTextItems as string
set AppleScript's text item delimiters to ""
return theText
end replace
on csvToList(csvText, implementation)
-- The 'implementation' parameter is a record with optional properties specifying the field separator character and/or trimming state. The defaults are: {separator:",", trimming:false}.
set {separator:separator, trimming:trimming} to (implementation & {separator:",", trimming:false})
script o -- For fast list access.
property textBlocks : missing value -- For the double-quote-delimited text item(s) of the CSV text.
property possibleFields : missing value -- For the separator-delimited text items of a non-quoted block.
property subpossibilities : missing value -- For the paragraphs of any non-quoted field candidate actually covering multiple records. (Single-column CSVs only.)
property fieldsOfCurrentRecord : {} -- For the fields of the CSV record currently being processed.
property finalResult : {} -- For the final list-of-lists result.
end script
set astid to AppleScript's text item delimiters
considering case
set AppleScript's text item delimiters to quote
set o's textBlocks to csvText's text items
-- o's textBlocks is a list of the CSV text's text items after delimitation with the double-quote character.
-- Assuming the convention described at top of this script, the number of blocks is always odd.
-- Even-numbered blocks, if any, are the unquoted contents of quoted fields (or parts thereof) and don't need parsing.
-- Odd-numbered blocks are everything else. Empty strings in odd-numbered slots (except at the beginning and end) are due to escaped double-quotes in quoted fields.
set blockCount to (count o's textBlocks)
set escapedQuoteFound to false
-- Parse the odd-numbered blocks only.
repeat with i from 1 to blockCount by 2
set thisBlock to item i of o's textBlocks
if (((count thisBlock) > 0) or (i is blockCount)) then
-- Either this block is not "" or it's the last item in the list, so it's not due to an escaped double-quote. Add the quoted field just skipped (if any) to the field list for the current record.
if (escapedQuoteFound) then
-- The quoted field contained escaped double-quote(s) (now unescaped) and is spread over three or more blocks. Join the blocks, add the result to the current field list, and cancel the escapedQuoteFound flag.
set AppleScript's text item delimiters to ""
set end of o's fieldsOfCurrentRecord to (items quotedFieldStart thru (i - 1) of o's textBlocks) as text
set escapedQuoteFound to false
else if (i > 1) then -- (if this isn't the first block)
-- The preceding even-numbered block is an entire quoted field. Add it to the current field list as is.
set end of o's fieldsOfCurrentRecord to item (i - 1) of o's textBlocks
end if
-- Now parse the current block's separator-delimited text items, which are either complete non-quoted fields, stubs from the removal of quoted fields, or still-joined fields from adjacent records.
set AppleScript's text item delimiters to separator
set o's possibleFields to thisBlock's text items
set possibleFieldCount to (count o's possibleFields)
repeat with j from 1 to possibleFieldCount
set thisPossibleField to item j of o's possibleFields
set c to (count thisPossibleField each paragraph)
if (c < 2) then
-- This possible field doesn't contain a line break. If it's not the stub of a preceding or following quoted field, add it (trimmed if trimming) to the current field list.
-- It's not a stub if it's an inner candidate from the block, the last candidate from the last block, the first candidate from the first block, or it contains non-white characters.
if (((j > 1) and ((j < possibleFieldCount) or (i is blockCount))) or ((j is 1) and (i is 1)) or (notBlank(thisPossibleField))) then set end of o's fieldsOfCurrentRecord to trim(thisPossibleField, trimming)
else if (c is 2) then -- Special-cased for efficiency.
-- This possible field contains a line break, so it's really two possible fields from consecutive records. Split it.
set subpossibility1 to paragraph 1 of thisPossibleField
set subpossibility2 to paragraph 2 of thisPossibleField
-- If the first subpossibility's not just the stub of a preceding quoted field, add it to the field list for the current record.
if ((j > 1) or (i is 1) or (notBlank(subpossibility1))) then set end of o's fieldsOfCurrentRecord to trim(subpossibility1, trimming)
-- Add the now-complete field list to the final result list and start one for a new record.
set end of o's finalResult to o's fieldsOfCurrentRecord
set o's fieldsOfCurrentRecord to {}
-- If the second subpossibility's not the stub of a following quoted field, add it to the new list.
if ((j < possibleFieldCount) or (notBlank(subpossibility2))) then set end of o's fieldsOfCurrentRecord to trim(subpossibility2, trimming)
else
-- This possible field contains more than one line break, so it's three or more possible fields from consecutive single-field records. Split it.
set o's subpossibilities to thisPossibleField's paragraphs
-- With each subpossibility except the last, complete the field list for the current record and initialise another. Omit the first subpossibility if it's just the stub of a preceding quoted field.
repeat with k from 1 to c - 1
set thisSubpossibility to item k of o's subpossibilities
if ((k > 1) or (j > 1) or (i is 1) or (notBlank(thisSubpossibility))) then set end of o's fieldsOfCurrentRecord to trim(thisSubpossibility, trimming)
set end of o's finalResult to o's fieldsOfCurrentRecord
set o's fieldsOfCurrentRecord to {}
end repeat
-- With the last subpossibility, just add it to the new field list (if it's not the stub of a following quoted field).
set thisSubpossibility to end of o's subpossibilities
if ((j < possibleFieldCount) or (notBlank(thisSubpossibility))) then set end of o's fieldsOfCurrentRecord to trim(thisSubpossibility, trimming)
end if
end repeat
-- Otherwise, the current block's an empty text item due to either an escaped double-quote in a quoted field or the opening quote of a quoted field at the very beginning of the CSV text.
else if (escapedQuoteFound) then
-- It's another escaped double-quote in a quoted field already flagged as containing one. Just replace the empty text with a literal double-quote.
set item i of o's textBlocks to quote
else if (i > 1) then -- (if this isn't the first block)
-- It's the first escaped double-quote in a quoted field. Replace the empty text with a literal double-quote, note the index of the preceding even-numbered block (the first part of the field), and flag the find.
set item i of o's textBlocks to quote
set quotedFieldStart to i - 1
set escapedQuoteFound to true
end if
end repeat
end considering
set AppleScript's text item delimiters to astid
-- Add the remaining field list to the output if it's not empty or if the output list itself has remained empty.
if ((o's fieldsOfCurrentRecord is not {}) or (o's finalResult is {})) then set end of o's finalResult to o's fieldsOfCurrentRecord
return o's finalResult
end csvToList
-- Test whether or not a string contains any non-white characters.
on notBlank(txt)
ignoring white space
return (txt > "")
end ignoring
end notBlank
-- Trim any leading or trailing spaces from a string.
on trim(txt, trimming)
if (trimming) then
set c to (count txt)
repeat while ((txt begins with space) and (c > 1))
set txt to text 2 thru -1 of txt
set c to c - 1
end repeat
repeat while ((txt ends with space) and (c > 1))
set txt to text 1 thru -2 of txt
set c to c - 1
end repeat
if (txt is space) then set txt to ""
end if
return txt
end trim
|
fatorialrecursivo.asm | JoaoVitorBoer/MIPS-Assembly | 0 | 105418 | <filename>fatorialrecursivo.asm<gh_stars>0
# int fact (int n)
# {
# if (n<1) return (1);
# else return (n*fact(n-1);
# }
.text
.globl main
main:
jalr $t0, $t1
addiu $a0, $zero, 3
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal fact
addu $s0, $zero, $v0
lw $ra, 0($sp)
addiu $sp, $sp, 4
jr $ra
fact: addiu $sp, $sp, -8
sw $ra, 4($sp)
sw $a0, 0($sp)
sltiu $t0, $a0, 1 # teste se n<1. Se n>= 1 salta para L1.
beq $t0, $zero, L1 # Lembrando: se $a0 <1, entao $t0 = 1
addiu $v0, $zero, 1 # caso n<1, retorna 1
addiu $sp, $sp, 8
jr $ra
L1: addiu $a0, $a0, -1 # n-1
jal fact
lw $a0, 0($sp)
lw $ra, 4($sp)
addiu $sp, $sp, 8 #ao retornar da chamada recursiva, restaura $a0 (n)
mul $v0, $a0, $v0 #retorna n*fact(n-1)
jr $ra |
programs/oeis/317/A317591.asm | neoneye/loda | 22 | 165343 | <reponame>neoneye/loda<filename>programs/oeis/317/A317591.asm
; A317591: Lexicographically earliest sequence of distinct terms such that erasing the last digit of a(n+1) and adding the resulting integer to a(n) gives back a(n+1).
; 9,10,11,12,13,14,15,16,17,18,19,21,23,25,27,29,32,35,38,42,46,51,56,62,68,75,83,92,102,113,125,138,153,169,187,207,229,254,282,313,347,385,427,474,526,584,648,719,798,886,984,1093,1214,1348,1497,1663,1847,2052,2279,2532,2813,3125,3472,3857,4285,4761,5289,5876,6528,7253,8058,8953,9947,11052,12279,13643,15158,16842,18713,20792,23102,25668,28519,31687,35207,39118,43464,48293,53658,59619,66243,73603,81781,90867,100963,112181,124645,138494,153882,170979
mov $2,$0
mov $5,1
lpb $5
mov $3,2
sub $5,1
mov $10,$2
lpb $3
mov $0,$10
sub $0,1
sub $3,1
mov $6,$0
mov $8,2
lpb $8
mov $0,$6
mov $4,0
mov $7,0
sub $8,1
add $0,$8
sub $0,1
lpb $0
sub $0,1
add $7,1
mov $4,$7
div $7,9
add $7,$4
lpe
sub $4,1
add $0,$4
add $0,2
mov $7,$0
mov $9,$8
lpb $9
mov $1,$7
sub $9,1
lpe
lpe
lpe
lpe
add $1,9
mov $0,$1
|
src/asm/Tablas.asm | vgonisanz/pipero-dakar | 3 | 171449 | <filename>src/asm/Tablas.asm<gh_stars>1-10
ORG H'4000
; Toda TABLA debe acabar con un CERO!!!!
; Todas las secuencias de colores y datos que se van a usar
;****************************************************************************************************
TablaCarretera: DW 32,221,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,222,32,0
TablaCoche: DW 32,194,32 ;pieza...
DW 195,219,180
DW 32,49,32
DW 199,219,182
DW 218,193,191,0
TablaCarColor3: DW 1,6,2,6,1,6 ; Color pieza, fondo...
DW 2,6,40,6,2,6 ; 0s Color fondo (tierra)
DW 1,6,55,40,1,6 ; rojo/verde
DW 2,6,40,6,2,6
DW 40,6,40,6,40,6,0
TablaCarColor4: DW 3,255,55,255,3,255 ; Color pieza, fondo...
DW 6,255,55,255,6,255 ; 0s Color fondo (negro)
DW 3,255,14,55,3,255 ; AZUL
DW 6,255,55,255,6,255
DW 55,255,55,255,55,255,0
TablaPrueba: DW 1,2,3,4,5,6
DW 1,2,3,4,5,6
DW 1,2,3,4,5,6
DW 1,2,3,4,5,6
DW 1,2,3,4,5,6,0
TablaBorrarCar1: DW 32,32,32
DW 32,32,32
DW 32,32,32
DW 32,32,32
DW 32,32,32,0
TablaBorrarCar2: DW 6,6,6,6,6,6
DW 6,6,6,6,6,6
DW 6,6,6,6,6,6
DW 6,6,6,6,6,6
DW 6,6,6,6,6,6
TablaBorrarCar3: DW 6,43,6,39,6,43
DW 6,40,6,40,6,39
DW 6,39,6,43,6,40
DW 6,39,6,43,6,43
DW 6,43,6,39,6,39
TablaBorrarCar4: DW 6,40,6,39,6,40
DW 6,40,6,39,6,39
DW 6,43,6,40,6,43
DW 6,39,6,40,6,43
DW 6,43,6,39,6,39
TablaBorrarCar5: DW 6,43,6,39,6,43
DW 6,40,6,40,6,39
DW 6,43,6,43,6,40
DW 6,39,6,40,6,43
DW 6,43,6,43,6,43
TablaBorrarCar6: DW 6,43,6,39,6,43
DW 6,40,6,43,6,39
DW 6,39,6,43,6,40
DW 6,39,6,40,6,43
DW 6,43,6,39,6,43
;****************************************************************************************************
FraseVidas: DW 32,3,32,86,105,100,97,115,58,32,3,32,0
Frase12: DW 32,32,32,32,32,32,32,32,32,32,32,32,0
Puntuacion: DW 80,117,110,116,117,97,99,105,111,110,58,0
TablaBien1: DW 66,105,101,110,118,101,110,105,100,111,0
TablaBien2: DW 97,108,32,112,105,112,101,114,111,45,68,97,107,97,114,0
TablaPulsa: DW 80,117,108,115,97,32,69,115,112,97,99,105,111,0
TablaVamos: DW 86,65,77,79,83,33,33,33,33,32,32,32,32,32,32,0
Bom: DW 66,111,109,0
Nivel: DW 78,105,118,101,108,58,0
;****************************************************************************************************
TablaPal1: DW 32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32,0
TablaPal2: DW 43,43,43,43,43,43,43,43,43,43,43,10,43,10,43,10
DW 43,43,43,10,43,10,43,10,43,43,43,43,43,10,43,10
DW 43,10,43,43,43,43,43,10,43,10,43,10,43,43,43,43
DW 43,43,43,43,43,10,43,10,43,10,43,43,43,10,43,43
DW 43,43,43,10,43,10,43,6,43,6,43,43,43,43,43,10
DW 43,10,43,43,43,43,43,6,43,6,43,43,43,43,43,10
DW 43,43,43,43,43,43,43,6,43,6,43,43,43,43,43,43
DW 43,43,43,43,43,43,43,6,43,6,43,43,43,43,43,43
TablaArena: DW 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
DW 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0
TablaCactus: DW 43,2,43,43,43,2
DW 43,2,43,43,43,2
DW 43,2,43,2,43,2
DW 43,43,43,2,43,43
DW 43,43,43,2,43,43
;****************************************************************************************************
TablaPiedra: DW 176,0
TablaNoPiedra: DW 32,0
;****************************************************************************************************
; GAME OVER LIENAS DE 40 ESPACIOS
Tablago1: DW 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0
Tablago2: DW 71,97,109,101,32,79,118,101,114,0
END |
test/siotest.asm | ceharris/sbz80 | 0 | 97126 | <reponame>ceharris/sbz80
.include ../os/sio_defs.asm
.include ../os/ports.asm
sioa_data .equ sio0_base+sio_port_a
sioa_command .equ sioa_data+sio_cfg
siob_data .equ sio0_base+sio_port_b
siob_command .equ siob_data+sio_cfg
blue .equ 1
green .equ 2
stbufa_size .equ 64
stbufb_size .equ 64
srbufa_size .equ 256
srbufb_size .equ 256
srbufa_emptyish .equ 16
srbufb_emptyish .equ 16
srbufa_fullish .equ srbufa_size - 16
srbufb_fullish .equ srbufb_size - 16
isr_txrdyb .equ $8000
isr_txstatb .equ $8002
isr_rxrdyb .equ $8004
isr_rxerrb .equ $8006
isr_txrdya .equ $8008
isr_txstata .equ $800a
isr_rxrdya .equ $800c
isr_rxerra .equ $800e
led_state .equ $8010
stcnta .equ $8040
stcntb .equ $8041
srcnta .equ $8042
srcntb .equ $8043
stina .equ $8044
stouta .equ $8046
stinb .equ $8048
stoutb .equ $804a
srina .equ $804c
srouta .equ $804e
srinb .equ $8050
sroutb .equ $8052
sstata .equ $8054
sstatb .equ $8055
serra .equ $8056
serrb .equ $8057
stbufa .equ $8080
stbufb .equ $80c0
srbufa .equ $8100
srbufb .equ $8200
.org 0
ld sp,0
ld a,high isr_txrdyb
ld i,a
im 2
; initialize interrupt vector
ld hl,siob_txrdy
ld (isr_txrdyb),hl
ld hl,siob_txstat
ld (isr_txstatb),hl
ld hl,siob_rxrdy
ld (isr_rxrdyb),hl
ld hl,siob_rxerr
ld (isr_rxerrb),hl
ld hl,sioa_txrdy
ld (isr_txrdya),hl
ld hl,sioa_txstat
ld (isr_txstata),hl
ld hl,sioa_rxrdy
ld (isr_rxrdya),hl
ld hl,sioa_rxerr
ld (isr_rxerra),hl
; initialize port A buffers
xor a
ld (stcnta),a
ld (srcnta),a
ld (sstata),a
ld (serra),a
ld hl,stbufa
ld (stina),hl
ld (stouta),hl
ld hl,srbufa
ld (srina),hl
ld (srouta),hl
; initialize port B buffers
xor a
ld (stcntb),a
ld (srcntb),a
ld (sstatb),a
ld (serrb),a
ld hl,stbufb
ld (stinb),hl
ld (stoutb),hl
ld hl,srbufb
ld (srinb),hl
ld (sroutb),hl
; reset port A
ld a,sio_channel_reset
out (sioa_command),a
nop
nop
; reset port B
ld a,sio_channel_reset
out (siob_command),a
nop
nop
; select port B WR2
ld a,sio_reg2
out (siob_command),a
; port B WR2: set interrupt vector
xor a
out (siob_command),a
; select port B WR1
ld a,sio_reg1
out (siob_command),a
; port B WR1: vary interrupt vector by status
ld a,sio_vector_by_status
out (siob_command),a
; select port A WR4, reset external/status interrupt
ld a,sio_reg4+sio_reset_ext_stat_int
out (sioa_command),a
; port A WR4: async mode, divisor 64, 1 stop bit, no parity
ld a,sio_clock_x64+sio_stop_1bit+sio_parity_none
out (sioa_command),a
; select port A WR3
ld a,sio_reg3
out (sioa_command),a
; port A WR3: receiver enable, auto enables, receive 8 bits/char
ld a,sio_rx_enable+sio_rx_auto_enables+sio_rx_8bits
out (sioa_command),a
; select port A WR5
ld a,sio_reg5
out (sioa_command),a
; port A WR5: tranmitter enable, transmit 8 bits/char, assert DTR and RTS
ld a,sio_tx_enable+sio_tx_8bits+sio_dtr+sio_rts
out (sioa_command),a
; select port A WR1 and reset external/status interrupt (again)
ld a,sio_reg1+sio_reset_ext_stat_int
out (sioa_command),a
; port A WR1: enable interupt on all received characters (ignoring parity),
; enable tx interrupt
ld a,sio_rx_int_all+sio_tx_int_enable+sio_vector_by_status
out (sioa_command),a
ei
xor a
ld (led_state),a
out (gpio_port),a
loop:
next:
call sioa_getc
jp nc,next
ld c,a
call sioa_putc
jp loop
sioa_puts:
ld a,(hl)
or a
ret z
ld c,a
call sioa_putc
inc hl
jp sioa_puts
sioa_tx:
in a,(sioa_command)
and sio_tx_buffer_empty
jp z,sioa_tx
ld a,c
out (sioa_data),a
ret
;---------------------------------------------------------------
; SIO port A Transmiter Status ISR
;
sioa_txstat:
ei
push af
; read RR0 for status bits
in a,(sioa_command)
ld (sstata),a
; reset interrupt latch
ld a,sio_reset_ext_stat_int
out (sioa_command),a
pop af
reti
;---------------------------------------------------------------
; SIO port A Transmitter Ready ISR
;
sioa_txrdy:
ei
push af
ld a,(stcnta) ; get num chars waiting
or a
jr z,sioa_txrdy_reset
push hl
ld hl,(stouta) ; get ring head pointer
ld a,(hl) ; get char to transmit
out (sioa_data),a ; transmit it
inc l ; update the head pointer
ld a,stbufa_size-1 ; load buffer size (n^2)-1
and l ; wrap if needed
or low stbufa ; offset to base
ld l,a
ld (stouta),hl ; put new ring head pointer
ld hl,stcnta
dec (hl) ; atomically decrement num waiting
pop hl
jr nz,sioa_txrdy_end ; go if ring not empty
sioa_txrdy_reset:
ld a,sio_reset_tx_int ; command to reset tx ready interrupt
out (sioa_command),a ; write command to WR0
; turn off blue LED
ld a,(led_state)
and ~blue
ld (led_state),a
out (gpio_port),a
sioa_txrdy_end:
pop af
reti
;---------------------------------------------------------------
; SIO port A Receiver Ready ISR
;
sioa_rxrdy:
ei
push af
push hl
sioa_rxrdy_get:
in a,(sioa_data) ; get the received char
ld l,a ; preserve it
ld a,(srcnta) ; get num chars waiting
cp srbufa_size-1 ; is there room for another
jr nc,sioa_rxrdy_check ; nope...
ld a,l ; recover received char
ld hl,(srina) ; get ring tail pointer
ld (hl),a ; put received char in buf
inc l ; increment pointer (rolls over)
ld (srina),hl ; put ring tail pointer
ld hl,srcnta
inc (hl) ; atomically update waiting count
ld a,(srcnta) ; get new waiting count
cp srbufa_fullish ; is getting kinda full?
jp nz,sioa_rxrdy_check ; nope
; clear RTS as buffer nears full
ld a,sio_reg5
out (sioa_command),a ; select WR5
ld a,sio_dtr+sio_tx_8bits+sio_tx_enable
out (sioa_command),a ; write WR5
sioa_rxrdy_check:
; turn on green LED
ld a,(led_state)
or green
ld (led_state),a
out (gpio_port),a
; check to see if more availble to read
in a,(sioa_command) ; read RR0
rrca
jr c,sioa_rxrdy_get ; go if received char available
pop hl
pop af
reti
;---------------------------------------------------------------
; SIO port A Receiver Error ISR
;
sioa_rxerr:
ei
push af
; select RR 1
ld a,sio_reg1
out (sioa_command),a
; read RR 1 for error bits
in a,(sioa_command)
ld (serra),a
; reset error latch
ld a,sio_error_reset
out (sioa_command),a
pop af
reti
;---------------------------------------------------------------
; SIO port A Put Character
;
sioa_putc:
push hl
di
ld a,(stcnta) ; get num chars waiting
or a ; is the buffer empty?
jr nz,sioa_putc_ring ; nope -- go add to ring
in a,(sioa_command) ; get register R0
and sio_tx_buffer_empty ; can we transmit now?
jr z,sioa_putc_ring ; nope -- go add to ring
ld a,c ; get char to transmit
out (sioa_data),a ; transmit it
ei
pop hl
ret
sioa_putc_again:
ei
sioa_putc_ring:
ld a,(stcnta) ; get num chars waiting
cp stbufa_size-1
jr nc,sioa_putc_again ; buffer full, keep trying
ld hl,stcnta
di
inc (hl) ; increment num waiting
ld hl,(stina) ; get tail pointer
ld (hl),c ; put character into buffer
ei
inc l ; increment pointer
ld a,stbufa_size-1 ; load buffer size (n^2)-1
and l ; wrap if needed
or low stbufa ; offset to base
ld l,a
ld (stina),hl ; store new tail pointer
; turn on blue LED
ld a,(led_state)
or blue
ld (led_state),a
out (gpio_port),a
pop hl
ret
;---------------------------------------------------------------
; SIO port A Get Character
;
sioa_getc:
push hl
ld a,(srcnta) ; get num chars waiting
or a
jp nz,sioa_getc_cont
; turn off green LED
ld a,(led_state)
and ~green
ld (led_state),a
out (gpio_port),a
or a
pop hl
ret
sioa_getc_cont:
cp srbufb_emptyish
jp nz,sioa_getc_get
; set RTS as buffer nears empty
ld a,sio_reg5
out (sioa_command),a ; select WR5
ld a,sio_dtr+sio_tx_8bits+sio_tx_enable+sio_rts
out (sioa_command),a ; write WR5
sioa_getc_get:
ld hl,(srouta) ; get ring head pointer
ld a,(hl) ; get the received char
inc l ; update the tail (rolls over)
ld (srouta),hl ; put the ring head pointer
ld hl,srcnta
dec (hl) ; atomically update waiting count
scf ; indicate char received
pop hl
ret
;---------------------------------------------------------------
; SIO port B Transmiter Status ISR
;
siob_txstat:
ei
push af
; read RR0 for status bits
in a,(siob_command)
ld (sstatb),a
; reset interrupt latch
ld a,sio_reset_ext_stat_int
out (siob_command),a
pop af
reti
;---------------------------------------------------------------
; SIO port B Transmitter Ready ISR
;
siob_txrdy:
ei
push af
ld a,(stcntb) ; get num chars waiting
or a
jr z,siob_txrdy_reset
push hl
ld hl,(stoutb) ; get ring head pointer
ld a,(hl) ; get char to transmit
out (siob_data),a ; transmit it
inc l ; update the head pointer
ld a,stbufb_size-1 ; load buffer size (n^2)-1
and l ; wrap if needed
or low stbufb ; offset to base
ld l,a
ld (stoutb),hl ; put new ring head pointer
ld hl,stcntb
dec (hl) ; atomically decrement num waiting
pop hl
jr nz,siob_txrdy_end ; go if ring not empty
siob_txrdy_reset:
ld a,sio_reset_tx_int ; command to reset tx ready interrupt
out (siob_command),a ; write command to WR0
siob_txrdy_end:
pop af
reti
;---------------------------------------------------------------
; SIO port B Receiver Ready ISR
;
siob_rxrdy:
ei
push af
push hl
siob_rxrdy_get:
in a,(siob_data) ; get the received char
ld l,a ; preserve it
ld a,(srcntb) ; get num chars waiting
cp srbufb_size-1 ; is there room for another
jr nc,siob_rxrdy_check ; nope...
ld a,l ; recover received char
ld hl,(srinb) ; get ring tail pointer
ld (hl),a ; put received char in buf
inc l ; increment pointer (rolls over)
ld (srinb),hl ; put ring tail pointer
ld hl,srcntb
inc (hl) ; atomically update waiting count
ld a,(srcntb) ; get new waiting count
cp srbufb_fullish ; is getting kinda full?
jp nz,siob_rxrdy_check ; nope
; clear RTS as buffer nears full
ld a,sio_reg5
out (siob_command),a ; select WR5
ld a,sio_dtr+sio_tx_8bits+sio_tx_enable
out (siob_command),a ; write WR5
siob_rxrdy_check:
; check to see if more availble to read
in a,(siob_command) ; read RR0
rrca
jr c,siob_rxrdy_get ; go if received char available
pop hl
pop af
reti
;---------------------------------------------------------------
; SIO port B Receiver Error ISR
;
siob_rxerr:
ei
push af
; select RR 1
ld a,sio_reg1
out (siob_command),a
; read RR 1 for error bits
in a,(siob_command)
ld (serrb),a
; reset error latch
ld a,sio_error_reset
out (siob_command),a
pop af
reti
;---------------------------------------------------------------
; SIO port B Put Character
;
siob_putc:
push hl
ld a,(stcntb) ; get num chars waiting
or a ; is the buffer empty?
jr nz,siob_putc_ring ; nope -- go add to ring
in a,(siob_command) ; get register R0
and sio_tx_buffer_empty ; can we transmit now?
jr z,siob_putc_ring ; nope -- go add to ring
ld a,c ; get char to transmit
out (siob_data),a ; transmit it
pop hl
ret
siob_putc_ring:
ld a,(stcntb) ; get num chars waiting
cp stbufb_size-1
jr nc,siob_putc_ring ; buffer full, keep trying
di
ld hl,stcntb
inc (hl) ; increment num waiting
ld hl,(stinb) ; get tail pointer
ld (hl),c ; put character into buffer
ei
inc l ; increment pointer
ld a,stbufb_size-1 ; load buffer size (n^2)-1
and l ; wrap if needed
or low stbufb ; offset to base
ld l,a
ld (stinb),hl ; store new tail pointer
pop hl
ret
;---------------------------------------------------------------
; SIO port B Get Character
;
siob_getc:
push hl
ld a,(srcntb) ; get num chars waiting
ld l,a
or a
jp z,siob_getc_done
cp srbufb_emptyish
jp nz,siob_getc_get
; set RTS as buffer nears empty
ld a,sio_reg5
out (siob_command),a ; select WR5
ld a,sio_dtr+sio_tx_8bits+sio_tx_enable+sio_rts
out (siob_command),a ; write WR5
siob_getc_get:
ld hl,(sroutb) ; get ring head pointer
ld a,(hl) ; get the received char
inc l ; update the tail (rolls over)
ld (sroutb),hl ; put the ring head pointer
ld hl,srcntb
dec (hl) ; atomically update waiting count
scf ; indicate char received
siob_getc_done:
pop hl
ret
ipsum:
db "Lorem ipsum dolor sit amet, consectetur adipiscing elit,", $d, $a
db "sed do eiusmod tempor incididunt ut labore et dolore", $d, $a
db "magna aliqua. Ut enim ad minim veniam, quis nostrud", $d, $a
db "exercitation ullamco laboris nisi ut aliquip ex ea", $d, $a
db "commodo consequat. Duis aute irure dolor in reprehenderit", $d, $a
db "in voluptate velit esse cillum dolore eu fugiat nulla", $d, $a
db "pariatur. Excepteur sint occaecat cupidatat non proident,", $d, $a
db "sunt in culpa qui officia deserunt mollit anim id est laborum.", $d, $a, 0
.end |
Working Disassembly/Levels/SOZ/Misc Object Data/Map - Spring Vine.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 5 | 164562 | <reponame>TeamASM-Blur/Sonic-3-Blue-Balls-Edition<gh_stars>1-10
dc.w word_40B0E-Map_SOZSpringVine
word_40B0E: dc.w 1 ; DATA XREF: ROM:00040B0Co
dc.b $F8, 5, 0, 0, $FF, $F8
|
weakening.agda | hazelgrove/hazelnut-agda | 0 | 11042 | open import Nat
open import Prelude
open import dynamics-core
open import contexts
open import lemmas-disjointness
open import exchange
-- this module contains all the proofs of different weakening structural
-- properties that we use for the hypothetical judgements
module weakening where
mutual
weaken-subst-Δ : ∀{Δ1 Δ2 Γ σ Γ'} →
Δ1 ## Δ2 →
Δ1 , Γ ⊢ σ :s: Γ' →
(Δ1 ∪ Δ2) , Γ ⊢ σ :s: Γ'
weaken-subst-Δ disj (STAId x) = STAId x
weaken-subst-Δ disj (STASubst subst x) = STASubst (weaken-subst-Δ disj subst) (weaken-ta-Δ1 disj x)
weaken-ta-Δ1 : ∀{Δ1 Δ2 Γ d τ} →
Δ1 ## Δ2 →
Δ1 , Γ ⊢ d :: τ →
(Δ1 ∪ Δ2) , Γ ⊢ d :: τ
weaken-ta-Δ1 disj TANum = TANum
weaken-ta-Δ1 disj (TAPlus wt wt₁) = TAPlus (weaken-ta-Δ1 disj wt) (weaken-ta-Δ1 disj wt₁)
weaken-ta-Δ1 disj (TAVar x₁) = TAVar x₁
weaken-ta-Δ1 disj (TALam x₁ wt) = TALam x₁ (weaken-ta-Δ1 disj wt)
weaken-ta-Δ1 disj (TAAp wt wt₁) = TAAp (weaken-ta-Δ1 disj wt) (weaken-ta-Δ1 disj wt₁)
weaken-ta-Δ1 disj (TAInl wt) = TAInl (weaken-ta-Δ1 disj wt)
weaken-ta-Δ1 disj (TAInr wt) = TAInr (weaken-ta-Δ1 disj wt)
weaken-ta-Δ1 disj (TACase wt x wt₁ x₁ wt₂) = TACase (weaken-ta-Δ1 disj wt) x (weaken-ta-Δ1 disj wt₁) x₁ (weaken-ta-Δ1 disj wt₂)
weaken-ta-Δ1 {Δ1} {Δ2} {Γ} disj (TAEHole {u = u} {Γ' = Γ'} x x₁) = TAEHole (x∈∪l Δ1 Δ2 u _ x ) (weaken-subst-Δ disj x₁)
weaken-ta-Δ1 {Δ1} {Δ2} {Γ} disj (TANEHole {Γ' = Γ'} {u = u} x wt x₁) = TANEHole (x∈∪l Δ1 Δ2 u _ x) (weaken-ta-Δ1 disj wt) (weaken-subst-Δ disj x₁)
weaken-ta-Δ1 disj (TACast wt x) = TACast (weaken-ta-Δ1 disj wt) x
weaken-ta-Δ1 disj (TAFailedCast wt x x₁ x₂) = TAFailedCast (weaken-ta-Δ1 disj wt) x x₁ x₂
weaken-ta-Δ1 disj (TAPair wt wt₁) = TAPair (weaken-ta-Δ1 disj wt) (weaken-ta-Δ1 disj wt₁)
weaken-ta-Δ1 disj (TAFst wt) = TAFst (weaken-ta-Δ1 disj wt)
weaken-ta-Δ1 disj (TASnd wt) = TASnd (weaken-ta-Δ1 disj wt)
-- this is a little bit of a time saver. since ∪ is commutative on
-- disjoint contexts, and we need that premise anyway in both positions,
-- there's no real reason to repeat the inductive argument above
weaken-ta-Δ2 : ∀{Δ1 Δ2 Γ d τ} →
Δ1 ## Δ2 →
Δ2 , Γ ⊢ d :: τ →
(Δ1 ∪ Δ2) , Γ ⊢ d :: τ
weaken-ta-Δ2 {Δ1} {Δ2} {Γ} {d} {τ} disj D = tr (λ q → q , Γ ⊢ d :: τ) (∪comm Δ2 Δ1 (##-comm disj)) (weaken-ta-Δ1 (##-comm disj) D)
-- note that these statements are somewhat stronger than usual. this is
-- because we don't have implcit α-conversion. this reifies the
-- often-silent on paper assumption that if you collide with a bound
-- variable you can just α-convert it away and not worry.
mutual
weaken-synth : ∀{x Γ e τ τ'} →
freshh x e →
Γ ⊢ e => τ →
(Γ ,, (x , τ')) ⊢ e => τ
weaken-synth FRHNum SNum = SNum
weaken-synth (FRHPlus frsh frsh₁) (SPlus x x₁) = SPlus (weaken-ana frsh x) (weaken-ana frsh₁ x₁)
weaken-synth (FRHAsc frsh) (SAsc x₁) = SAsc (weaken-ana frsh x₁)
weaken-synth {Γ = Γ} (FRHVar {x = x} x₁) (SVar {x = y} x₂) = SVar (x∈∪r (■ (x , _)) Γ y _ x₂ (apart-singleton (flip x₁)))
weaken-synth {Γ = Γ} (FRHLam2 x₁ frsh) (SLam x₂ wt) =
SLam (apart-extend1 Γ (flip x₁) x₂)
(exchange-synth {Γ = Γ} (flip x₁) ((weaken-synth frsh wt)))
weaken-synth FRHEHole SEHole = SEHole
weaken-synth (FRHNEHole frsh) (SNEHole wt) = SNEHole (weaken-synth frsh wt)
weaken-synth (FRHAp frsh frsh₁) (SAp wt x₂ x₃) = SAp (weaken-synth frsh wt) x₂ (weaken-ana frsh₁ x₃)
weaken-synth (FRHPair frsh frsh₁) (SPair wt wt₁) = SPair (weaken-synth frsh wt) (weaken-synth frsh₁ wt₁)
weaken-synth (FRHFst frsh) (SFst wt x) = SFst (weaken-synth frsh wt) x
weaken-synth (FRHSnd frsh) (SSnd wt x) = SSnd (weaken-synth frsh wt) x
weaken-ana : ∀{x Γ e τ τ'} →
freshh x e →
Γ ⊢ e <= τ →
(Γ ,, (x , τ')) ⊢ e <= τ
weaken-ana frsh (ASubsume x₁ x₂) = ASubsume (weaken-synth frsh x₁) x₂
weaken-ana {Γ = Γ} (FRHLam1 neq frsh) (ALam x₂ x₃ wt) =
ALam (apart-extend1 Γ (flip neq) x₂)
x₃
(exchange-ana {Γ = Γ} (flip neq) (weaken-ana frsh wt))
weaken-ana (FRHInl frsh) (AInl x x₁) = AInl x (weaken-ana frsh x₁)
weaken-ana (FRHInr frsh) (AInr x x₁) = AInr x (weaken-ana frsh x₁)
weaken-ana {Γ = Γ} (FRHCase frshd newx≠y frshd₁ newx≠z frshd₂)
(ACase {Γ = .Γ} y#Γ z#Γ msum syn ana₁ ana₂) =
ACase (apart-extend1 Γ (flip newx≠y) y#Γ)
(apart-extend1 Γ (flip newx≠z) z#Γ)
msum
(weaken-synth {Γ = Γ} frshd syn)
(exchange-ana {Γ = Γ} (flip newx≠y) (weaken-ana frshd₁ ana₁))
(exchange-ana {Γ = Γ} (flip newx≠z) (weaken-ana frshd₂ ana₂))
mutual
weaken-subst-Γ : ∀{x Γ Δ σ Γ' τ} →
envfresh x σ →
Δ , Γ ⊢ σ :s: Γ' →
Δ , (Γ ,, (x , τ)) ⊢ σ :s: Γ'
weaken-subst-Γ {Γ = Γ} {τ = τ₁} (EFId {x = x₃} x₁) (STAId {Γ' = Γ'} x₂) = STAId (λ x τ x∈Γ' → x∈∪r (■ (x₃ , τ₁)) Γ x τ (x₂ x τ x∈Γ') (apart-singleton λ{refl → somenotnone ((! x∈Γ') · x₁)}))
weaken-subst-Γ {x = x} {Γ = Γ} (EFSubst x₁ efrsh x₂) (STASubst {y = y} {τ = τ'} subst x₃) =
STASubst (exchange-subst-Γ {Γ = Γ} (flip x₂) (weaken-subst-Γ {Γ = Γ ,, (y , τ')} efrsh subst))
(weaken-ta x₁ x₃)
weaken-ta : ∀{x Γ Δ d τ τ'} →
fresh x d →
Δ , Γ ⊢ d :: τ →
Δ , Γ ,, (x , τ') ⊢ d :: τ
weaken-ta FNum TANum = TANum
weaken-ta (FPlus x₁ x₂) (TAPlus x x₃) = TAPlus (weaken-ta x₁ x) (weaken-ta x₂ x₃)
weaken-ta {x} {Γ} {_} {_} {τ} {τ'} (FVar x₂) (TAVar x₃) = TAVar (x∈∪r (■(x , _)) Γ _ _ x₃ (apart-singleton (flip x₂)))
weaken-ta {x = x} frsh (TALam {x = y} x₂ wt) with natEQ x y
weaken-ta (FLam x₁ x₂) (TALam x₃ wt) | Inl refl = abort (x₁ refl)
weaken-ta {Γ = Γ} {τ' = τ'} (FLam x₁ x₃) (TALam {x = y} x₄ wt) | Inr x₂ = TALam (apart-extend1 Γ (flip x₁) x₄) (exchange-ta-Γ {Γ = Γ} (flip x₁) (weaken-ta x₃ wt))
weaken-ta (FAp frsh frsh₁) (TAAp wt wt₁) = TAAp (weaken-ta frsh wt) (weaken-ta frsh₁ wt₁)
weaken-ta (FHole x₁) (TAEHole x₂ x₃) = TAEHole x₂ (weaken-subst-Γ x₁ x₃)
weaken-ta (FNEHole x₁ frsh) (TANEHole x₂ wt x₃) = TANEHole x₂ (weaken-ta frsh wt) (weaken-subst-Γ x₁ x₃)
weaken-ta (FCast frsh) (TACast wt x₁) = TACast (weaken-ta frsh wt) x₁
weaken-ta (FFailedCast frsh) (TAFailedCast wt x₁ x₂ x₃) = TAFailedCast (weaken-ta frsh wt) x₁ x₂ x₃
weaken-ta (FInl frsh) (TAInl wt) = TAInl (weaken-ta frsh wt)
weaken-ta (FInr frsh) (TAInr wt) = TAInr (weaken-ta frsh wt)
weaken-ta {Γ = Γ} (FCase frsh x frsh₁ x₁ frsh₂) (TACase wt x₂ wt₁ x₃ wt₂) =
TACase (weaken-ta frsh wt)
(apart-extend1 Γ (flip x) x₂)
(exchange-ta-Γ {Γ = Γ} (flip x) (weaken-ta frsh₁ wt₁))
(apart-extend1 Γ (flip x₁) x₃)
(exchange-ta-Γ {Γ = Γ} (flip x₁) (weaken-ta frsh₂ wt₂))
weaken-ta (FPair frsh frsh₁) (TAPair wt wt₁) = TAPair (weaken-ta frsh wt) (weaken-ta frsh₁ wt₁)
weaken-ta (FFst frsh) (TAFst wt) = TAFst (weaken-ta frsh wt)
weaken-ta (FSnd frsh) (TASnd wt) = TASnd (weaken-ta frsh wt)
|
source/web/tools/a2js/properties-expressions-record_aggregate.adb | svn2github/matreshka | 24 | 17595 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the <NAME>, 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$
------------------------------------------------------------------------------
with League.String_Vectors;
with Asis.Declarations;
with Asis.Definitions;
with Asis.Elements;
with Asis.Expressions;
with Properties.Tools;
with Properties.Expressions.Identifiers;
package body Properties.Expressions.Record_Aggregate is
----------
-- Code --
----------
function Code
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Text_Property)
return League.Strings.Universal_String
is
use type League.Strings.Universal_String;
use type Asis.Declaration_List;
procedure Append
(Names : League.Strings.Universal_String;
Code : League.Strings.Universal_String);
procedure Mark_Done (Name : League.Strings.Universal_String);
function Get_Name
(Index : Positive) return League.Strings.Universal_String;
function Get_Type_Name return League.Strings.Universal_String;
Tipe : constant Asis.Element :=
Asis.Expressions.Corresponding_Expression_Type_Definition (Element);
Parts : constant Asis.Declaration_List :=
Tools.Corresponding_Type_Discriminants (Tipe) &
Tools.Corresponding_Type_Components (Tipe);
Done : array (Parts'Range) of Boolean := (others => False);
Last : Natural := 0;
Result : League.Strings.Universal_String;
------------
-- Append --
------------
procedure Append
(Names : League.Strings.Universal_String;
Code : League.Strings.Universal_String)
is
Text : League.Strings.Universal_String;
List : constant League.String_Vectors.Universal_String_Vector :=
Names.Split (',');
begin
if List.Length = 0 then -- positional association
Last := Last + 1;
Done (Last) := True;
Text := Get_Name (Last);
Result.Append (Text);
Result.Append (":");
Result.Append (Code);
else
for J in 1 .. List.Length loop
Mark_Done (List.Element (J));
Result.Append (List.Element (J));
Result.Append (":");
Result.Append (Code);
end loop;
end if;
end Append;
--------------
-- Get_Name --
--------------
function Get_Name
(Index : Positive) return League.Strings.Universal_String
is
Names : constant Asis.Defining_Name_List :=
Asis.Declarations.Names (Parts (Index));
begin
pragma Assert (Names'Length = 1);
return Engine.Text.Get_Property (Names (Names'First), Code.Name);
end Get_Name;
-------------------
-- Get_Type_Name --
-------------------
function Get_Type_Name return League.Strings.Universal_String is
use type Asis.Definition_Kinds;
use type Asis.Expression_Kinds;
Result : League.Strings.Universal_String;
Name : League.Strings.Universal_String;
X : Asis.Element := Tipe;
Decl : Asis.Declaration;
begin
-- Unwind all subtype declarations
while Asis.Elements.Definition_Kind (X)
= Asis.A_Subtype_Indication
loop
X := Asis.Definitions.Subtype_Mark (X);
if Asis.Elements.Expression_Kind (X)
= Asis.A_Selected_Component
then
X := Asis.Expressions.Selector (X);
end if;
X := Asis.Expressions.Corresponding_Name_Declaration (X);
X := Asis.Declarations.Type_Declaration_View (X);
end loop;
if Asis.Elements.Definition_Kind (X) = Asis.A_Type_Definition then
Decl := Asis.Elements.Enclosing_Element (X);
Result := Properties.Expressions.Identifiers.Name_Prefix
(Engine => Engine,
Name => Element,
Decl => Asis.Elements.Enclosing_Element (X));
Name := Engine.Text.Get_Property
(Asis.Declarations.Names (Decl) (1), Code.Name);
Result.Append (Name);
end if;
return Result;
end Get_Type_Name;
---------------
-- Mark_Done --
---------------
procedure Mark_Done (Name : League.Strings.Universal_String) is
Text : League.Strings.Universal_String;
begin
for J in Parts'Range loop
if not Done (J) then
Text := Get_Name (J);
if Text = Name then
Done (J) := True;
return;
end if;
end if;
end loop;
end Mark_Done;
Names : League.Strings.Universal_String;
Text : League.Strings.Universal_String;
List : constant Asis.Association_List :=
Asis.Expressions.Record_Component_Associations (Element);
Tipe_Name : constant League.Strings.Universal_String := Get_Type_Name;
begin
if not Tipe_Name.Is_Empty then
Result.Append (Tipe_Name);
Result.Append ("._cast(");
end if;
Result.Append ("{");
for J in List'Range loop
Names := Engine.Text.Get_Property (List (J), Engines.Associations);
if Names /= League.Strings.To_Universal_String ("others") then
Text := Engine.Text.Get_Property (List (J), Name);
if not Text.Is_Empty then
-- Box <> expression returns empty Code. We ignore such assoc.
if J /= List'First then
Result.Append (",");
end if;
Append (Names, Text);
end if;
end if;
end loop;
for J in Parts'Range loop
if not Done (J) then
Text := Get_Name (J);
Result.Append (",");
Result.Append (Text);
Result.Append (":");
Text := Engine.Text.Get_Property (Parts (J), Engines.Initialize);
Result.Append (Text);
end if;
end loop;
Result.Append ("}");
if not Tipe_Name.Is_Empty then
Result.Append (")");
end if;
return Result;
end Code;
----------------------------
-- Typed_Array_Initialize --
----------------------------
function Typed_Array_Initialize
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Text_Property) return League.Strings.Universal_String
is
Result : League.Strings.Universal_String;
Down : League.Strings.Universal_String;
Item : Asis.Expression;
List : constant Asis.Association_List :=
Asis.Expressions.Record_Component_Associations (Element);
begin
Result.Append ("_result._TA_allign(4);");
for J in List'Range loop
pragma Assert (Asis.Expressions.Record_Component_Choices
(List (J))'Length = 0,
"Named associations in Typed_Array aggregate"
& " are not supported");
Item := Asis.Expressions.Component_Expression (List (J));
Down := Engine.Text.Get_Property (Item, Name);
Result.Append (Down);
end loop;
return Result;
end Typed_Array_Initialize;
end Properties.Expressions.Record_Aggregate;
|
oeis/176/A176159.asm | neoneye/loda-programs | 11 | 92939 | ; A176159: A polynomial coefficient sequence:p(x,n,m)=(1 + Binomial[n, m]*x)^n
; Submitted by <NAME>(s4)
; 1,2,2,4,9,4,8,64,64,8,16,625,2401,625,16,32,7776,161051,161051,7776,32,64,117649,16777216,85766121,16777216,117649,64,128,2097152,2494357888,78364164096,78364164096,2494357888,2097152,128,256,43046721
lpb $0
add $2,1
sub $0,$2
mov $1,$2
bin $1,$0
lpe
add $1,1
pow $1,$2
mov $0,$1
|
test/Test/Compile/Golden/windController/windController-output.agda | vehicle-lang/vehicle | 9 | 9304 | -- WARNING: This file was generated automatically by Vehicle
-- and should not be modified manually!
-- Metadata
-- - Agda version: 2.6.2
-- - AISEC version: 0.1.0.1
-- - Time generated: ???
{-# OPTIONS --allow-exec #-}
open import Vehicle
open import Vehicle.Data.Tensor
open import Data.Product
open import Data.Integer as ℤ using (ℤ)
open import Data.Rational as ℚ using (ℚ)
open import Data.Fin as Fin using (Fin; #_)
open import Data.List
module windController-temp-output where
InputVector : Set
InputVector = Tensor ℚ (2 ∷ [])
currentSensor : ∀ {_x0 : Set} {{_x1 : HasNatLits _x0}} → _x0
currentSensor = 0
previousSensor : ∀ {_x4 : Set} {{_x5 : HasNatLits _x4}} → _x4
previousSensor = 1
postulate controller : InputVector → Tensor ℚ (1 ∷ [])
SafeInput : InputVector → Set
SafeInput x = ∀ (i : Fin 2) → ℚ.- (ℤ.+ 13 ℚ./ 4) ℚ.≤ x i × x i ℚ.≤ ℤ.+ 13 ℚ./ 4
SafeOutput : InputVector → Set
SafeOutput x = ℚ.- (ℤ.+ 5 ℚ./ 4) ℚ.< (controller x (# 0) ℚ.+ (ℤ.+ 2 ℚ./ 1) ℚ.* x currentSensor) ℚ.- x previousSensor × (controller x (# 0) ℚ.+ (ℤ.+ 2 ℚ./ 1) ℚ.* x currentSensor) ℚ.- x previousSensor ℚ.< ℤ.+ 5 ℚ./ 4
abstract
safe : ∀ (x : Tensor ℚ (2 ∷ [])) → SafeInput x → SafeOutput x
safe = checkSpecification record
{ proofCache = "/home/matthew/Code/AISEC/vehicle/proofcache.vclp"
} |
src/fot/GroupTheory/PropertiesI.agda | asr/fotc | 11 | 3656 | <reponame>asr/fotc
------------------------------------------------------------------------------
-- Group theory properties
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module GroupTheory.PropertiesI where
open import GroupTheory.Base
open import Common.FOL.Relation.Binary.EqReasoning
------------------------------------------------------------------------------
-- Congruence properties
-- The propositional equality is compatible with the binary operation.
·-leftCong : ∀ {a b c} → a ≡ b → a · c ≡ b · c
·-leftCong refl = refl
·-rightCong : ∀ {a b c} → b ≡ c → a · b ≡ a · c
·-rightCong refl = refl
-- The propositional equality is compatible with the inverse function.
⁻¹-cong : ∀ {a b} → a ≡ b → a ⁻¹ ≡ b ⁻¹
⁻¹-cong refl = refl
------------------------------------------------------------------------------
leftCancellation : ∀ {a b c} → a · b ≡ a · c → b ≡ c
leftCancellation {a} {b} {c} h =
b ≡⟨ sym (leftIdentity b) ⟩
ε · b ≡⟨ ·-leftCong (sym (leftInverse a)) ⟩
a ⁻¹ · a · b ≡⟨ assoc (a ⁻¹) a b ⟩
a ⁻¹ · (a · b) ≡⟨ ·-rightCong h ⟩
a ⁻¹ · (a · c) ≡⟨ sym (assoc (a ⁻¹) a c) ⟩
a ⁻¹ · a · c ≡⟨ ·-leftCong (leftInverse a) ⟩
ε · c ≡⟨ leftIdentity c ⟩
c ∎
-- A different proof without using congruence.
leftCancellation' : ∀ {a b c} → a · b ≡ a · c → b ≡ c
-- Paper proof (Mac Lane and <NAME> 1999. p. 48):
--
-- 1. a⁻¹(ab) = a⁻¹(ac) (hypothesis ab = ac)
-- 2. a⁻¹a(b) = a⁻¹a(c) (associative axiom)
-- 3. εb = εc (left-inverse axiom for a⁻¹)
-- 4. b = c (left-identity axiom)
leftCancellation' {a} {b} {c} h =
b ≡⟨ sym (leftIdentity b) ⟩
ε · b ≡⟨ subst (λ t → ε · b ≡ t · b) (sym (leftInverse a)) refl ⟩
a ⁻¹ · a · b ≡⟨ assoc (a ⁻¹) a b ⟩
a ⁻¹ · (a · b) ≡⟨ subst (λ t → a ⁻¹ · (a · b) ≡ a ⁻¹ · t) h refl ⟩
a ⁻¹ · (a · c) ≡⟨ sym (assoc (a ⁻¹) a c) ⟩
a ⁻¹ · a · c ≡⟨ subst (λ t → a ⁻¹ · a · c ≡ t · c) (leftInverse a) refl ⟩
ε · c ≡⟨ leftIdentity c ⟩
c ∎
-- <NAME> and <NAME> (1999) p. 50, exercise 6.
rightIdentity : ∀ a → a · ε ≡ a
rightIdentity a = leftCancellation prf
where
prf : a ⁻¹ · (a · ε) ≡ a ⁻¹ · a
prf = a ⁻¹ · (a · ε) ≡⟨ sym (assoc (a ⁻¹) a ε) ⟩
a ⁻¹ · a · ε ≡⟨ ·-leftCong (leftInverse a) ⟩
ε · ε ≡⟨ leftIdentity ε ⟩
ε ≡⟨ sym (leftInverse a) ⟩
a ⁻¹ · a ∎
-- <NAME> and <NAME> (1999) p. 50, exercise 6.
rightInverse : ∀ a → a · a ⁻¹ ≡ ε
rightInverse a = leftCancellation prf
where
prf : a ⁻¹ · (a · a ⁻¹) ≡ a ⁻¹ · ε
prf = a ⁻¹ · (a · a ⁻¹) ≡⟨ sym (assoc (a ⁻¹) a (a ⁻¹)) ⟩
a ⁻¹ · a · a ⁻¹ ≡⟨ ·-leftCong (leftInverse a) ⟩
ε · a ⁻¹ ≡⟨ leftIdentity (a ⁻¹) ⟩
a ⁻¹ ≡⟨ sym (rightIdentity (a ⁻¹)) ⟩
a ⁻¹ · ε ∎
rightCancellation : ∀ {a b c} → b · a ≡ c · a → b ≡ c
rightCancellation {a} {b} {c} h =
-- Paper proof:
--
-- 1. (ba)a⁻¹ = (ca)a⁻¹ (hypothesis ab = ac)
-- 2. (b)aa⁻¹ = (c)aa⁻¹ (associative axiom)
-- 3. bε = cε (right-inverse axiom for a⁻¹)
-- 4. b = c (right-identity axiom)
b ≡⟨ sym (rightIdentity b) ⟩
b · ε ≡⟨ ·-rightCong (sym (rightInverse a)) ⟩
b · (a · a ⁻¹) ≡⟨ sym (assoc b a (a ⁻¹)) ⟩
b · a · a ⁻¹ ≡⟨ ·-leftCong h ⟩
c · a · a ⁻¹ ≡⟨ assoc c a (a ⁻¹) ⟩
c · (a · a ⁻¹) ≡⟨ ·-rightCong (rightInverse a) ⟩
c · ε ≡⟨ rightIdentity c ⟩
c ∎
-- Adapted from the Agda standard library 0.8.1 (see
-- Algebra.Properties.Group.right-helper).
y≡x⁻¹[xy] : ∀ a b → b ≡ a ⁻¹ · (a · b)
y≡x⁻¹[xy] a b = b ≡⟨ sym (leftIdentity b) ⟩
ε · b ≡⟨ ·-leftCong (sym (leftInverse a)) ⟩
a ⁻¹ · a · b ≡⟨ assoc (a ⁻¹) a b ⟩
a ⁻¹ · (a · b) ∎
-- Adapted from the Agda standard library 0.8.1 (see
-- Algebra.Properties.Group.left-helper).
x≡[xy]y⁻¹ : ∀ a b → a ≡ (a · b) · b ⁻¹
x≡[xy]y⁻¹ a b = a ≡⟨ sym (rightIdentity a) ⟩
a · ε ≡⟨ ·-rightCong (sym (rightInverse b)) ⟩
a · (b · b ⁻¹) ≡⟨ sym (assoc a b (b ⁻¹)) ⟩
a · b · b ⁻¹ ∎
rightIdentityUnique : ∀ r → (∀ a → a · r ≡ a) → r ≡ ε
-- Paper proof (Mac Lane and Garret 1999. p. 48):
--
-- 1. r = εr (ε is an identity)
-- 2. εr = r (hypothesis)
-- 3. r = ε (transitivity)
rightIdentityUnique r h = trans (sym (leftIdentity r)) (h ε)
-- A more appropiate version to be used in the proofs. Adapted from
-- the Agda standard library 0.8.1 (see
-- Algebra.Properties.Group.right-identity-unique).
rightIdentityUnique' : ∀ a r → a · r ≡ a → r ≡ ε
rightIdentityUnique' a r h = r ≡⟨ y≡x⁻¹[xy] a r ⟩
a ⁻¹ · (a · r) ≡⟨ ·-rightCong h ⟩
a ⁻¹ · a ≡⟨ leftInverse a ⟩
ε ∎
leftIdentityUnique : ∀ l → (∀ a → l · a ≡ a) → l ≡ ε
-- Paper proof:
-- 1. l = le (ε is an identity)
-- 2. le = e (hypothesis)
-- 3. l = e (transitivity)
leftIdentityUnique l h = trans (sym (rightIdentity l)) (h ε)
-- A more appropiate version to be used in the proofs. Adapted from
-- the Agda standard library 0.8.1 (see
-- Algebra.Properties.Group.left-identity-unique).
leftIdentityUnique' : ∀ a l → l · a ≡ a → l ≡ ε
leftIdentityUnique' a l h = l ≡⟨ x≡[xy]y⁻¹ l a ⟩
l · a · a ⁻¹ ≡⟨ ·-leftCong h ⟩
a · a ⁻¹ ≡⟨ rightInverse a ⟩
ε ∎
rightInverseUnique : ∀ {a} → ∃[ r ] (a · r ≡ ε) ∧
(∀ r' → a · r' ≡ ε → r ≡ r')
rightInverseUnique {a} =
-- Paper proof:
--
-- 1. We know that (a⁻¹) is a right inverse for a.
-- 2. Let's suppose there is other right inverse r for a, i.e. ar ≡ ε, then
-- 2.1. aa⁻¹ = ε (right-inverse axiom)
-- 2.2. ar = ε (hypothesis)
-- 2.3. aa⁻¹ = ar (transitivity)
-- 2.4 a⁻¹ = a (left-cancellation)
_ , rightInverse a , prf
where
prf : ∀ r' → a · r' ≡ ε → a ⁻¹ ≡ r'
prf r' ar'≡ε = leftCancellation aa⁻¹≡ar'
where
aa⁻¹≡ar' : a · a ⁻¹ ≡ a · r'
aa⁻¹≡ar' = a · a ⁻¹ ≡⟨ rightInverse a ⟩
ε ≡⟨ sym ar'≡ε ⟩
a · r' ∎
-- A more appropiate version to be used in the proofs.
rightInverseUnique' : ∀ {a r} → a · r ≡ ε → a ⁻¹ ≡ r
rightInverseUnique' {a} {r} ar≡ε = leftCancellation aa⁻¹≡ar
where
aa⁻¹≡ar : a · a ⁻¹ ≡ a · r
aa⁻¹≡ar = a · a ⁻¹ ≡⟨ rightInverse a ⟩
ε ≡⟨ sym ar≡ε ⟩
a · r ∎
leftInverseUnique : ∀ {a} → ∃[ l ] (l · a ≡ ε) ∧
(∀ l' → l' · a ≡ ε → l ≡ l')
leftInverseUnique {a} =
-- Paper proof:
--
-- 1. We know that (a⁻¹) is a left inverse for a.
-- 2. Let's suppose there is other right inverse l for a, i.e. la ≡ ε, then
-- 2.1. a⁻¹a = ε (left-inverse axiom)
-- 2.2. la = ε (hypothesis)
-- 2.3. a⁻¹a = la (transitivity)
-- 2.4 a⁻¹ = l (right-cancellation)
_ , leftInverse a , prf
where
prf : ∀ l' → l' · a ≡ ε → a ⁻¹ ≡ l'
prf l' l'a≡ε = rightCancellation a⁻¹a≡l'a
where
a⁻¹a≡l'a : a ⁻¹ · a ≡ l' · a
a⁻¹a≡l'a = a ⁻¹ · a ≡⟨ leftInverse a ⟩
ε ≡⟨ sym l'a≡ε ⟩
l' · a ∎
-- A more appropiate version to be used in the proofs.
leftInverseUnique' : ∀ {a l} → l · a ≡ ε → a ⁻¹ ≡ l
leftInverseUnique' {a} {l} la≡ε = rightCancellation a⁻¹a≡la
where
a⁻¹a≡la : a ⁻¹ · a ≡ l · a
a⁻¹a≡la = a ⁻¹ · a ≡⟨ leftInverse a ⟩
ε ≡⟨ sym la≡ε ⟩
l · a ∎
⁻¹-involutive : ∀ a → a ⁻¹ ⁻¹ ≡ a
-- Paper proof:
--
-- 1. a⁻¹a = ε (left-inverse axiom)
-- 2. The previous equation states that a is the unique right
-- inverse (a⁻¹)⁻¹ of a⁻¹.
⁻¹-involutive a = rightInverseUnique' (leftInverse a)
identityInverse : ε ⁻¹ ≡ ε
-- Paper proof:
--
-- 1. εε = ε (left/right-identity axiom)
-- 2. The previous equation states that ε is the unique left/right
-- inverse ε⁻¹ of ε.
identityInverse = rightInverseUnique' (leftIdentity ε)
inverseDistribution : ∀ a b → (a · b) ⁻¹ ≡ b ⁻¹ · a ⁻¹
-- Paper proof:
--
-- (b⁻¹a⁻¹)(ab) = b⁻¹(a⁻¹(ab)) (associative axiom)
-- = b⁻¹(a⁻¹a)b (associative axiom)
-- = b⁻¹(εb) (left-inverse axiom)
-- = b⁻¹b (left-identity axiom)
-- = ε (left-inverse axiom)
-- Therefore, b⁻¹a⁻¹ is the unique left inverse of ab.
inverseDistribution a b = leftInverseUnique' b⁻¹a⁻¹[ab]≡ε
where
b⁻¹a⁻¹[ab]≡ε : b ⁻¹ · a ⁻¹ · (a · b) ≡ ε
b⁻¹a⁻¹[ab]≡ε =
b ⁻¹ · a ⁻¹ · (a · b)
≡⟨ assoc (b ⁻¹) (a ⁻¹) (a · b) ⟩
b ⁻¹ · (a ⁻¹ · (a · b))
≡⟨ ·-rightCong (sym (assoc (a ⁻¹) a b)) ⟩
b ⁻¹ · (a ⁻¹ · a · b)
≡⟨ ·-rightCong (·-leftCong (leftInverse a)) ⟩
b ⁻¹ · (ε · b)
≡⟨ ·-rightCong (leftIdentity b) ⟩
b ⁻¹ · b
≡⟨ leftInverse b ⟩
ε ∎
-- If the square of every element is the identity, the system is
-- commutative. From: TPTP 6.4.0 problem GRP/GRP001-2.p.
x²≡ε→comm : (∀ a → a · a ≡ ε) → ∀ {b c d} → b · c ≡ d → c · b ≡ d
-- Paper proof:
--
-- 1. d(bc) = dd (hypothesis bc = d)
-- 2. d(bc) = ε (hypothesis dd = ε)
-- 3. d(bc)c = c (by 2)
-- 4. db(cc) = c (associativity axiom)
-- 5. db = c (hypothesis cc = ε)
-- 6. (db)b = cb (by 5)
-- 7. d(bb) = cb (associativity axiom)
-- 6. d = cb (hypothesis bb = ε)
x²≡ε→comm h {b} {c} {d} bc≡d = sym d≡cb
where
db≡c : d · b ≡ c
db≡c =
d · b
≡⟨ sym (rightIdentity (d · b)) ⟩
d · b · ε
≡⟨ ·-rightCong (sym (h c)) ⟩
d · b · (c · c)
≡⟨ assoc d b (c · c) ⟩
d · (b · (c · c))
≡⟨ ·-rightCong (sym (assoc b c c)) ⟩
d · ((b · c) · c)
≡⟨ ·-rightCong (·-leftCong bc≡d) ⟩
d · (d · c)
≡⟨ sym (assoc d d c) ⟩
d · d · c
≡⟨ ·-leftCong (h d) ⟩
ε · c
≡⟨ leftIdentity c ⟩
c ∎
d≡cb : d ≡ c · b
d≡cb = d ≡⟨ sym (rightIdentity d) ⟩
d · ε ≡⟨ ·-rightCong (sym (h b)) ⟩
d · (b · b) ≡⟨ sym (assoc d b b) ⟩
d · b · b ≡⟨ ·-leftCong db≡c ⟩
c · b ∎
------------------------------------------------------------------------------
-- References
--
-- <NAME>. and <NAME>. (1999). Algebra. 3rd ed. AMS Chelsea
-- Publishing.
|
src/asf-components-html-panels.adb | jquorning/ada-asf | 12 | 3139 | -----------------------------------------------------------------------
-- html.panels -- Layout panels
-- Copyright (C) 2009, 2010, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with EL.Objects;
package body ASF.Components.Html.Panels is
function Get_Layout (UI : UIPanelGroup;
Context : in Faces_Context'Class) return String is
Value : constant EL.Objects.Object := UI.Get_Attribute (Context, "layout");
Layout : constant String := EL.Objects.To_String (Value);
begin
if Layout = "div" or Layout = "block" then
return "div";
elsif Layout = "none" then
return "";
else
return "span";
end if;
end Get_Layout;
procedure Encode_Begin (UI : in UIPanelGroup;
Context : in out Faces_Context'Class) is
begin
if not UI.Is_Rendered (Context) then
return;
end if;
declare
Writer : constant Response_Writer_Access := Context.Get_Response_Writer;
Tag : constant String := UI.Get_Layout (Context);
begin
if Tag'Length > 0 then
if Tag = "span" then
Writer.Start_Optional_Element (Tag);
else
Writer.Start_Element (Tag);
end if;
UI.Render_Attributes (Context, Writer);
end if;
end;
end Encode_Begin;
procedure Encode_End (UI : in UIPanelGroup;
Context : in out Faces_Context'Class) is
begin
if not UI.Is_Rendered (Context) then
return;
end if;
declare
Writer : constant Response_Writer_Access := Context.Get_Response_Writer;
Tag : constant String := UI.Get_Layout (Context);
begin
if Tag'Length > 0 then
if Tag = "span" then
Writer.End_Optional_Element (Tag);
else
Writer.End_Element (Tag);
end if;
end if;
end;
end Encode_End;
end ASF.Components.Html.Panels;
|
source/nodes/program-implicit_element_factories.ads | optikos/oasis | 0 | 17303 | <filename>source/nodes/program-implicit_element_factories.ads<gh_stars>0
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with System.Storage_Pools.Subpools;
with Program.Elements.Pragmas;
with Program.Elements.Defining_Names;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Defining_Character_Literals;
with Program.Elements.Defining_Operator_Symbols;
with Program.Elements.Defining_Expanded_Names;
with Program.Elements.Type_Declarations;
with Program.Elements.Task_Type_Declarations;
with Program.Elements.Protected_Type_Declarations;
with Program.Elements.Subtype_Declarations;
with Program.Elements.Object_Declarations;
with Program.Elements.Single_Task_Declarations;
with Program.Elements.Single_Protected_Declarations;
with Program.Elements.Number_Declarations;
with Program.Elements.Enumeration_Literal_Specifications;
with Program.Elements.Discriminant_Specifications;
with Program.Elements.Component_Declarations;
with Program.Elements.Loop_Parameter_Specifications;
with Program.Elements.Generalized_Iterator_Specifications;
with Program.Elements.Element_Iterator_Specifications;
with Program.Elements.Procedure_Declarations;
with Program.Elements.Function_Declarations;
with Program.Elements.Parameter_Specifications;
with Program.Elements.Procedure_Body_Declarations;
with Program.Elements.Function_Body_Declarations;
with Program.Elements.Return_Object_Specifications;
with Program.Elements.Package_Declarations;
with Program.Elements.Package_Body_Declarations;
with Program.Elements.Object_Renaming_Declarations;
with Program.Elements.Exception_Renaming_Declarations;
with Program.Elements.Procedure_Renaming_Declarations;
with Program.Elements.Function_Renaming_Declarations;
with Program.Elements.Package_Renaming_Declarations;
with Program.Elements.Generic_Package_Renaming_Declarations;
with Program.Elements.Generic_Procedure_Renaming_Declarations;
with Program.Elements.Generic_Function_Renaming_Declarations;
with Program.Elements.Task_Body_Declarations;
with Program.Elements.Protected_Body_Declarations;
with Program.Elements.Entry_Declarations;
with Program.Elements.Entry_Body_Declarations;
with Program.Elements.Entry_Index_Specifications;
with Program.Elements.Procedure_Body_Stubs;
with Program.Elements.Function_Body_Stubs;
with Program.Elements.Package_Body_Stubs;
with Program.Elements.Task_Body_Stubs;
with Program.Elements.Protected_Body_Stubs;
with Program.Elements.Exception_Declarations;
with Program.Elements.Choice_Parameter_Specifications;
with Program.Elements.Generic_Package_Declarations;
with Program.Elements.Generic_Procedure_Declarations;
with Program.Elements.Generic_Function_Declarations;
with Program.Elements.Package_Instantiations;
with Program.Elements.Procedure_Instantiations;
with Program.Elements.Function_Instantiations;
with Program.Elements.Formal_Object_Declarations;
with Program.Elements.Formal_Type_Declarations;
with Program.Elements.Formal_Procedure_Declarations;
with Program.Elements.Formal_Function_Declarations;
with Program.Elements.Formal_Package_Declarations;
with Program.Elements.Definitions;
with Program.Elements.Subtype_Indications;
with Program.Elements.Constraints;
with Program.Elements.Component_Definitions;
with Program.Elements.Discrete_Ranges;
with Program.Elements.Discrete_Subtype_Indications;
with Program.Elements.Discrete_Range_Attribute_References;
with Program.Elements.Discrete_Simple_Expression_Ranges;
with Program.Elements.Unknown_Discriminant_Parts;
with Program.Elements.Known_Discriminant_Parts;
with Program.Elements.Record_Definitions;
with Program.Elements.Null_Components;
with Program.Elements.Variant_Parts;
with Program.Elements.Variants;
with Program.Elements.Others_Choices;
with Program.Elements.Anonymous_Access_To_Objects;
with Program.Elements.Anonymous_Access_To_Procedures;
with Program.Elements.Anonymous_Access_To_Functions;
with Program.Elements.Private_Type_Definitions;
with Program.Elements.Private_Extension_Definitions;
with Program.Elements.Incomplete_Type_Definitions;
with Program.Elements.Task_Definitions;
with Program.Elements.Protected_Definitions;
with Program.Elements.Formal_Type_Definitions;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Real_Range_Specifications;
with Program.Elements.Expressions;
with Program.Elements.Numeric_Literals;
with Program.Elements.String_Literals;
with Program.Elements.Identifiers;
with Program.Elements.Operator_Symbols;
with Program.Elements.Character_Literals;
with Program.Elements.Explicit_Dereferences;
with Program.Elements.Infix_Operators;
with Program.Elements.Function_Calls;
with Program.Elements.Indexed_Components;
with Program.Elements.Slices;
with Program.Elements.Selected_Components;
with Program.Elements.Attribute_References;
with Program.Elements.Record_Aggregates;
with Program.Elements.Extension_Aggregates;
with Program.Elements.Array_Aggregates;
with Program.Elements.Short_Circuit_Operations;
with Program.Elements.Membership_Tests;
with Program.Elements.Null_Literals;
with Program.Elements.Parenthesized_Expressions;
with Program.Elements.Raise_Expressions;
with Program.Elements.Type_Conversions;
with Program.Elements.Qualified_Expressions;
with Program.Elements.Allocators;
with Program.Elements.Case_Expressions;
with Program.Elements.If_Expressions;
with Program.Elements.Quantified_Expressions;
with Program.Elements.Discriminant_Associations;
with Program.Elements.Record_Component_Associations;
with Program.Elements.Array_Component_Associations;
with Program.Elements.Parameter_Associations;
with Program.Elements.Formal_Package_Associations;
with Program.Elements.Null_Statements;
with Program.Elements.Assignment_Statements;
with Program.Elements.If_Statements;
with Program.Elements.Case_Statements;
with Program.Elements.Loop_Statements;
with Program.Elements.While_Loop_Statements;
with Program.Elements.For_Loop_Statements;
with Program.Elements.Block_Statements;
with Program.Elements.Exit_Statements;
with Program.Elements.Goto_Statements;
with Program.Elements.Call_Statements;
with Program.Elements.Simple_Return_Statements;
with Program.Elements.Extended_Return_Statements;
with Program.Elements.Accept_Statements;
with Program.Elements.Requeue_Statements;
with Program.Elements.Delay_Statements;
with Program.Elements.Terminate_Alternative_Statements;
with Program.Elements.Select_Statements;
with Program.Elements.Abort_Statements;
with Program.Elements.Raise_Statements;
with Program.Elements.Code_Statements;
with Program.Elements.Elsif_Paths;
with Program.Elements.Case_Paths;
with Program.Elements.Select_Paths;
with Program.Elements.Case_Expression_Paths;
with Program.Elements.Elsif_Expression_Paths;
with Program.Elements.Use_Clauses;
with Program.Elements.With_Clauses;
with Program.Elements.Component_Clauses;
with Program.Elements.Derived_Types;
with Program.Elements.Derived_Record_Extensions;
with Program.Elements.Enumeration_Types;
with Program.Elements.Signed_Integer_Types;
with Program.Elements.Modular_Types;
with Program.Elements.Root_Types;
with Program.Elements.Floating_Point_Types;
with Program.Elements.Ordinary_Fixed_Point_Types;
with Program.Elements.Decimal_Fixed_Point_Types;
with Program.Elements.Unconstrained_Array_Types;
with Program.Elements.Constrained_Array_Types;
with Program.Elements.Record_Types;
with Program.Elements.Interface_Types;
with Program.Elements.Object_Access_Types;
with Program.Elements.Procedure_Access_Types;
with Program.Elements.Function_Access_Types;
with Program.Elements.Formal_Private_Type_Definitions;
with Program.Elements.Formal_Derived_Type_Definitions;
with Program.Elements.Formal_Discrete_Type_Definitions;
with Program.Elements.Formal_Signed_Integer_Type_Definitions;
with Program.Elements.Formal_Modular_Type_Definitions;
with Program.Elements.Formal_Floating_Point_Definitions;
with Program.Elements.Formal_Ordinary_Fixed_Point_Definitions;
with Program.Elements.Formal_Decimal_Fixed_Point_Definitions;
with Program.Elements.Formal_Unconstrained_Array_Types;
with Program.Elements.Formal_Constrained_Array_Types;
with Program.Elements.Formal_Object_Access_Types;
with Program.Elements.Formal_Procedure_Access_Types;
with Program.Elements.Formal_Function_Access_Types;
with Program.Elements.Formal_Interface_Types;
with Program.Elements.Range_Attribute_References;
with Program.Elements.Simple_Expression_Ranges;
with Program.Elements.Digits_Constraints;
with Program.Elements.Delta_Constraints;
with Program.Elements.Index_Constraints;
with Program.Elements.Discriminant_Constraints;
with Program.Elements.Attribute_Definition_Clauses;
with Program.Elements.Enumeration_Representation_Clauses;
with Program.Elements.Record_Representation_Clauses;
with Program.Elements.At_Clauses;
with Program.Elements.Exception_Handlers;
with Program.Lexical_Elements;
with Program.Element_Vectors;
package Program.Implicit_Element_Factories is
pragma Preelaborate;
type Element_Factory (Subpool : not null System.Storage_Pools.Subpools
.Subpool_Handle) is tagged limited private;
not overriding function Create_Pragma
(Self : Element_Factory;
Name : not null Program.Elements.Identifiers
.Identifier_Access;
Arguments : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Pragmas.Pragma_Access;
not overriding function Create_Defining_Identifier
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
not overriding function Create_Defining_Character_Literal
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Defining_Character_Literals
.Defining_Character_Literal_Access;
not overriding function Create_Defining_Operator_Symbol
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Defining_Operator_Symbols
.Defining_Operator_Symbol_Access;
not overriding function Create_Defining_Expanded_Name
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Selector : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Defining_Expanded_Names
.Defining_Expanded_Name_Access;
not overriding function Create_Type_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Definition : not null Program.Elements.Definitions
.Definition_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Type_Declarations
.Type_Declaration_Access;
not overriding function Create_Task_Type_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Definition : not null Program.Elements.Task_Definitions
.Task_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Task_Type_Declarations
.Task_Type_Declaration_Access;
not overriding function Create_Protected_Type_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Definition : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration_Access;
not overriding function Create_Subtype_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Subtype_Declarations
.Subtype_Declaration_Access;
not overriding function Create_Object_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Object_Subtype : not null Program.Elements.Definitions
.Definition_Access;
Initialization_Expression : Program.Elements.Expressions
.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Aliased : Boolean := False;
Has_Constant : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Object_Declarations
.Object_Declaration_Access;
not overriding function Create_Single_Task_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Definition : not null Program.Elements.Task_Definitions
.Task_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Single_Task_Declarations
.Single_Task_Declaration_Access;
not overriding function Create_Single_Protected_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Definition : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration_Access;
not overriding function Create_Number_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Number_Declarations
.Number_Declaration_Access;
not overriding function Create_Enumeration_Literal_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access;
not overriding function Create_Discriminant_Specification
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Access;
not overriding function Create_Component_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Object_Subtype : not null Program.Elements.Component_Definitions
.Component_Definition_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Component_Declarations
.Component_Declaration_Access;
not overriding function Create_Loop_Parameter_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Definition : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Has_Reverse : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access;
not overriding function Create_Generalized_Iterator_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Iterator_Name : not null Program.Elements.Expressions
.Expression_Access;
Has_Reverse : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access;
not overriding function Create_Element_Iterator_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Iterable_Name : not null Program.Elements.Expressions
.Expression_Access;
Has_Reverse : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access;
not overriding function Create_Procedure_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Has_Abstract : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Procedure_Declarations
.Procedure_Declaration_Access;
not overriding function Create_Function_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Result_Expression : Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Has_Abstract : Boolean := False;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Function_Declarations
.Function_Declaration_Access;
not overriding function Create_Parameter_Specification
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Parameter_Subtype : not null Program.Elements.Element_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access;
Has_Aliased : Boolean := False;
Has_In : Boolean := False;
Has_Out : Boolean := False;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Parameter_Specifications
.Parameter_Specification_Access;
not overriding function Create_Procedure_Body_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access;
not overriding function Create_Function_Body_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Function_Body_Declarations
.Function_Body_Declaration_Access;
not overriding function Create_Return_Object_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Expression : Program.Elements.Expressions.Expression_Access;
Has_Aliased : Boolean := False;
Has_Constant : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Return_Object_Specifications
.Return_Object_Specification_Access;
not overriding function Create_Package_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Package_Declarations
.Package_Declaration_Access;
not overriding function Create_Package_Body_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Package_Body_Declarations
.Package_Body_Declaration_Access;
not overriding function Create_Object_Renaming_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Renamed_Object : not null Program.Elements.Expressions
.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration_Access;
not overriding function Create_Exception_Renaming_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Renamed_Exception : not null Program.Elements.Expressions
.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration_Access;
not overriding function Create_Procedure_Renaming_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Renamed_Procedure : Program.Elements.Expressions.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration_Access;
not overriding function Create_Function_Renaming_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Renamed_Function : Program.Elements.Expressions.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration_Access;
not overriding function Create_Package_Renaming_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renamed_Package : not null Program.Elements.Expressions
.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration_Access;
not overriding function Create_Generic_Package_Renaming_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renamed_Package : not null Program.Elements.Expressions
.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration_Access;
not overriding function Create_Generic_Procedure_Renaming_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renamed_Procedure : not null Program.Elements.Expressions
.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration_Access;
not overriding function Create_Generic_Function_Renaming_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renamed_Function : not null Program.Elements.Expressions
.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration_Access;
not overriding function Create_Task_Body_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Task_Body_Declarations
.Task_Body_Declaration_Access;
not overriding function Create_Protected_Body_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Protected_Operations : not null Program.Element_Vectors
.Element_Vector_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration_Access;
not overriding function Create_Entry_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Entry_Family_Definition : Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Entry_Declarations
.Entry_Declaration_Access;
not overriding function Create_Entry_Body_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Entry_Index : not null Program.Elements
.Entry_Index_Specifications.Entry_Index_Specification_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Entry_Barrier : not null Program.Elements.Expressions
.Expression_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Entry_Body_Declarations
.Entry_Body_Declaration_Access;
not overriding function Create_Entry_Index_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Entry_Index_Subtype : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Entry_Index_Specifications
.Entry_Index_Specification_Access;
not overriding function Create_Procedure_Body_Stub
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Procedure_Body_Stubs
.Procedure_Body_Stub_Access;
not overriding function Create_Function_Body_Stub
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Function_Body_Stubs
.Function_Body_Stub_Access;
not overriding function Create_Package_Body_Stub
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Package_Body_Stubs
.Package_Body_Stub_Access;
not overriding function Create_Task_Body_Stub
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Task_Body_Stubs.Task_Body_Stub_Access;
not overriding function Create_Protected_Body_Stub
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Protected_Body_Stubs
.Protected_Body_Stub_Access;
not overriding function Create_Exception_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Exception_Declarations
.Exception_Declaration_Access;
not overriding function Create_Choice_Parameter_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access;
not overriding function Create_Generic_Package_Declaration
(Self : Element_Factory;
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Access;
not overriding function Create_Generic_Procedure_Declaration
(Self : Element_Factory;
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration_Access;
not overriding function Create_Generic_Function_Declaration
(Self : Element_Factory;
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration_Access;
not overriding function Create_Package_Instantiation
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Generic_Package_Name : not null Program.Elements.Expressions
.Expression_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Package_Instantiations
.Package_Instantiation_Access;
not overriding function Create_Procedure_Instantiation
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Generic_Procedure_Name : not null Program.Elements.Expressions
.Expression_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Procedure_Instantiations
.Procedure_Instantiation_Access;
not overriding function Create_Function_Instantiation
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Generic_Function_Name : not null Program.Elements.Expressions
.Expression_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Function_Instantiations
.Function_Instantiation_Access;
not overriding function Create_Formal_Object_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_In : Boolean := False;
Has_Out : Boolean := False;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Object_Declarations
.Formal_Object_Declaration_Access;
not overriding function Create_Formal_Type_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Definition : not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Access;
not overriding function Create_Formal_Procedure_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Subprogram_Default : Program.Elements.Expressions.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Abstract : Boolean := False;
Has_Null : Boolean := False;
Has_Box : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration_Access;
not overriding function Create_Formal_Function_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Subprogram_Default : Program.Elements.Expressions.Expression_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Has_Not_Null : Boolean := False;
Has_Abstract : Boolean := False;
Has_Box : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration_Access;
not overriding function Create_Formal_Package_Declaration
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Generic_Package_Name : not null Program.Elements.Expressions
.Expression_Access;
Parameters : Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration_Access;
not overriding function Create_Subtype_Indication
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Constraint : Program.Elements.Constraints.Constraint_Access;
Has_Not_Null : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
not overriding function Create_Component_Definition
(Self : Element_Factory;
Subtype_Indication : not null Program.Elements.Element_Access;
Has_Aliased : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Component_Definitions
.Component_Definition_Access;
not overriding function Create_Discrete_Subtype_Indication
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Constraint : Program.Elements.Constraints
.Constraint_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Is_Discrete_Subtype_Definition : Boolean := False)
return not null Program.Elements.Discrete_Subtype_Indications
.Discrete_Subtype_Indication_Access;
not overriding function Create_Discrete_Range_Attribute_Reference
(Self : Element_Factory;
Range_Attribute : not null Program.Elements
.Attribute_References.Attribute_Reference_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Is_Discrete_Subtype_Definition : Boolean := False)
return not null Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference_Access;
not overriding function Create_Discrete_Simple_Expression_Range
(Self : Element_Factory;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Is_Discrete_Subtype_Definition : Boolean := False)
return not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access;
not overriding function Create_Unknown_Discriminant_Part
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Unknown_Discriminant_Parts
.Unknown_Discriminant_Part_Access;
not overriding function Create_Known_Discriminant_Part
(Self : Element_Factory;
Discriminants : Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access;
not overriding function Create_Record_Definition
(Self : Element_Factory;
Components : not null Program.Element_Vectors
.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Record_Definitions
.Record_Definition_Access;
not overriding function Create_Null_Component
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Null_Components.Null_Component_Access;
not overriding function Create_Variant_Part
(Self : Element_Factory;
Discriminant : not null Program.Elements.Identifiers
.Identifier_Access;
Variants : not null Program.Elements.Variants
.Variant_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Variant_Parts.Variant_Part_Access;
not overriding function Create_Variant
(Self : Element_Factory;
Choices : not null Program.Element_Vectors
.Element_Vector_Access;
Components : not null Program.Element_Vectors
.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Variants.Variant_Access;
not overriding function Create_Others_Choice
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Others_Choices.Others_Choice_Access;
not overriding function Create_Anonymous_Access_To_Object
(Self : Element_Factory;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Has_Not_Null : Boolean := False;
Has_All : Boolean := False;
Has_Constant : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object_Access;
not overriding function Create_Anonymous_Access_To_Procedure
(Self : Element_Factory;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Has_Not_Null : Boolean := False;
Has_Protected : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure_Access;
not overriding function Create_Anonymous_Access_To_Function
(Self : Element_Factory;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Has_Not_Null : Boolean := False;
Has_Protected : Boolean := False;
Has_Not_Null_2 : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function_Access;
not overriding function Create_Private_Type_Definition
(Self : Element_Factory;
Has_Abstract : Boolean := False;
Has_Tagged : Boolean := False;
Has_Limited : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Private_Type_Definitions
.Private_Type_Definition_Access;
not overriding function Create_Private_Extension_Definition
(Self : Element_Factory;
Ancestor : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Has_Abstract : Boolean := False;
Has_Limited : Boolean := False;
Has_Synchronized : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Private_Extension_Definitions
.Private_Extension_Definition_Access;
not overriding function Create_Incomplete_Type_Definition
(Self : Element_Factory;
Has_Tagged : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Incomplete_Type_Definitions
.Incomplete_Type_Definition_Access;
not overriding function Create_Task_Definition
(Self : Element_Factory;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Task_Definitions.Task_Definition_Access;
not overriding function Create_Protected_Definition
(Self : Element_Factory;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Protected_Definitions
.Protected_Definition_Access;
not overriding function Create_Aspect_Specification
(Self : Element_Factory;
Aspect_Mark : not null Program.Elements.Expressions
.Expression_Access;
Aspect_Definition : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Aspect_Specifications
.Aspect_Specification_Access;
not overriding function Create_Real_Range_Specification
(Self : Element_Factory;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access;
not overriding function Create_Numeric_Literal
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Numeric_Literals.Numeric_Literal_Access;
not overriding function Create_String_Literal
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.String_Literals.String_Literal_Access;
not overriding function Create_Identifier
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Identifiers.Identifier_Access;
not overriding function Create_Operator_Symbol
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Operator_Symbols.Operator_Symbol_Access;
not overriding function Create_Character_Literal
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Character_Literals
.Character_Literal_Access;
not overriding function Create_Explicit_Dereference
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Explicit_Dereferences
.Explicit_Dereference_Access;
not overriding function Create_Infix_Operator
(Self : Element_Factory;
Left : Program.Elements.Expressions.Expression_Access;
Operator : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access;
Right : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Infix_Operators.Infix_Operator_Access;
not overriding function Create_Function_Call
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Function_Calls.Function_Call_Access;
not overriding function Create_Indexed_Component
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Expressions : Program.Elements.Expressions
.Expression_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Indexed_Components
.Indexed_Component_Access;
not overriding function Create_Slice
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Slice_Range : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Slices.Slice_Access;
not overriding function Create_Selected_Component
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Selector : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Selected_Components
.Selected_Component_Access;
not overriding function Create_Attribute_Reference
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Attribute_Designator : not null Program.Elements.Identifiers
.Identifier_Access;
Expressions : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Attribute_References
.Attribute_Reference_Access;
not overriding function Create_Record_Aggregate
(Self : Element_Factory;
Components : Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access;
not overriding function Create_Extension_Aggregate
(Self : Element_Factory;
Ancestor : not null Program.Elements.Expressions
.Expression_Access;
Components : Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Extension_Aggregates
.Extension_Aggregate_Access;
not overriding function Create_Array_Aggregate
(Self : Element_Factory;
Components : Program.Elements.Array_Component_Associations
.Array_Component_Association_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Array_Aggregates.Array_Aggregate_Access;
not overriding function Create_Short_Circuit_Operation
(Self : Element_Factory;
Left : not null Program.Elements.Expressions
.Expression_Access;
Right : not null Program.Elements.Expressions
.Expression_Access;
Has_And_Then : Boolean := False;
Has_Or_Else : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Short_Circuit_Operations
.Short_Circuit_Operation_Access;
not overriding function Create_Membership_Test
(Self : Element_Factory;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Choices : not null Program.Element_Vectors
.Element_Vector_Access;
Has_Not : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Membership_Tests.Membership_Test_Access;
not overriding function Create_Null_Literal
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Null_Literals.Null_Literal_Access;
not overriding function Create_Parenthesized_Expression
(Self : Element_Factory;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access;
not overriding function Create_Raise_Expression
(Self : Element_Factory;
Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Raise_Expressions
.Raise_Expression_Access;
not overriding function Create_Type_Conversion
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Operand : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Type_Conversions.Type_Conversion_Access;
not overriding function Create_Qualified_Expression
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Operand : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Qualified_Expressions
.Qualified_Expression_Access;
not overriding function Create_Allocator
(Self : Element_Factory;
Subpool_Name : Program.Elements.Expressions.Expression_Access;
Subtype_Indication : Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Qualified_Expression : Program.Elements.Qualified_Expressions
.Qualified_Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Allocators.Allocator_Access;
not overriding function Create_Case_Expression
(Self : Element_Factory;
Selecting_Expression : not null Program.Elements.Expressions
.Expression_Access;
Paths : not null Program.Elements.Case_Expression_Paths
.Case_Expression_Path_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Case_Expressions.Case_Expression_Access;
not overriding function Create_If_Expression
(Self : Element_Factory;
Condition : not null Program.Elements.Expressions
.Expression_Access;
Then_Expression : not null Program.Elements.Expressions
.Expression_Access;
Elsif_Paths : Program.Elements.Elsif_Paths
.Elsif_Path_Vector_Access;
Else_Expression : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.If_Expressions.If_Expression_Access;
not overriding function Create_Quantified_Expression
(Self : Element_Factory;
Parameter : Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access;
Generalized_Iterator : Program.Elements
.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access;
Element_Iterator : Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access;
Predicate : not null Program.Elements.Expressions
.Expression_Access;
Has_All : Boolean := False;
Has_Some : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Quantified_Expressions
.Quantified_Expression_Access;
not overriding function Create_Discriminant_Association
(Self : Element_Factory;
Selector_Names : Program.Elements.Identifiers
.Identifier_Vector_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Discriminant_Associations
.Discriminant_Association_Access;
not overriding function Create_Record_Component_Association
(Self : Element_Factory;
Choices : Program.Element_Vectors.Element_Vector_Access;
Expression : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Record_Component_Associations
.Record_Component_Association_Access;
not overriding function Create_Array_Component_Association
(Self : Element_Factory;
Choices : Program.Element_Vectors.Element_Vector_Access;
Expression : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Array_Component_Associations
.Array_Component_Association_Access;
not overriding function Create_Parameter_Association
(Self : Element_Factory;
Formal_Parameter : Program.Elements.Expressions.Expression_Access;
Actual_Parameter : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Parameter_Associations
.Parameter_Association_Access;
not overriding function Create_Formal_Package_Association
(Self : Element_Factory;
Formal_Parameter : Program.Elements.Expressions.Expression_Access;
Actual_Parameter : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Access;
not overriding function Create_Null_Statement
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Null_Statements.Null_Statement_Access;
not overriding function Create_Assignment_Statement
(Self : Element_Factory;
Variable_Name : not null Program.Elements.Expressions
.Expression_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Assignment_Statements
.Assignment_Statement_Access;
not overriding function Create_If_Statement
(Self : Element_Factory;
Condition : not null Program.Elements.Expressions
.Expression_Access;
Then_Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Elsif_Paths : Program.Elements.Elsif_Paths
.Elsif_Path_Vector_Access;
Else_Statements : Program.Element_Vectors.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.If_Statements.If_Statement_Access;
not overriding function Create_Case_Statement
(Self : Element_Factory;
Selecting_Expression : not null Program.Elements.Expressions
.Expression_Access;
Paths : not null Program.Elements.Case_Paths
.Case_Path_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Case_Statements.Case_Statement_Access;
not overriding function Create_Loop_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Loop_Statements.Loop_Statement_Access;
not overriding function Create_While_Loop_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Condition : not null Program.Elements.Expressions
.Expression_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.While_Loop_Statements
.While_Loop_Statement_Access;
not overriding function Create_For_Loop_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Loop_Parameter : Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access;
Generalized_Iterator : Program.Elements
.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access;
Element_Iterator : Program.Elements
.Element_Iterator_Specifications
.Element_Iterator_Specification_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.For_Loop_Statements
.For_Loop_Statement_Access;
not overriding function Create_Block_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Block_Statements.Block_Statement_Access;
not overriding function Create_Exit_Statement
(Self : Element_Factory;
Exit_Loop_Name : Program.Elements.Expressions.Expression_Access;
Condition : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Exit_Statements.Exit_Statement_Access;
not overriding function Create_Goto_Statement
(Self : Element_Factory;
Goto_Label : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Goto_Statements.Goto_Statement_Access;
not overriding function Create_Call_Statement
(Self : Element_Factory;
Called_Name : not null Program.Elements.Expressions
.Expression_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Call_Statements.Call_Statement_Access;
not overriding function Create_Simple_Return_Statement
(Self : Element_Factory;
Expression : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Simple_Return_Statements
.Simple_Return_Statement_Access;
not overriding function Create_Extended_Return_Statement
(Self : Element_Factory;
Return_Object : not null Program.Elements
.Return_Object_Specifications.Return_Object_Specification_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Extended_Return_Statements
.Extended_Return_Statement_Access;
not overriding function Create_Accept_Statement
(Self : Element_Factory;
Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Accept_Statements
.Accept_Statement_Access;
not overriding function Create_Requeue_Statement
(Self : Element_Factory;
Entry_Name : not null Program.Elements.Expressions
.Expression_Access;
Has_With_Abort : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Requeue_Statements
.Requeue_Statement_Access;
not overriding function Create_Delay_Statement
(Self : Element_Factory;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Delay_Statements.Delay_Statement_Access;
not overriding function Create_Terminate_Alternative_Statement
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Terminate_Alternative_Statements
.Terminate_Alternative_Statement_Access;
not overriding function Create_Select_Statement
(Self : Element_Factory;
Paths : not null Program.Elements.Select_Paths
.Select_Path_Vector_Access;
Then_Abort_Statements : Program.Element_Vectors.Element_Vector_Access;
Else_Statements : Program.Element_Vectors.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Select_Statements
.Select_Statement_Access;
not overriding function Create_Abort_Statement
(Self : Element_Factory;
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Abort_Statements.Abort_Statement_Access;
not overriding function Create_Raise_Statement
(Self : Element_Factory;
Raised_Exception : Program.Elements.Expressions.Expression_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Raise_Statements.Raise_Statement_Access;
not overriding function Create_Code_Statement
(Self : Element_Factory;
Expression : not null Program.Elements.Qualified_Expressions
.Qualified_Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Code_Statements.Code_Statement_Access;
not overriding function Create_Elsif_Path
(Self : Element_Factory;
Condition : not null Program.Elements.Expressions
.Expression_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Elsif_Paths.Elsif_Path_Access;
not overriding function Create_Case_Path
(Self : Element_Factory;
Choices : not null Program.Element_Vectors
.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Case_Paths.Case_Path_Access;
not overriding function Create_Select_Path
(Self : Element_Factory;
Guard : Program.Elements.Expressions.Expression_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Select_Paths.Select_Path_Access;
not overriding function Create_Case_Expression_Path
(Self : Element_Factory;
Choices : not null Program.Element_Vectors
.Element_Vector_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Case_Expression_Paths
.Case_Expression_Path_Access;
not overriding function Create_Elsif_Expression_Path
(Self : Element_Factory;
Condition : not null Program.Elements.Expressions
.Expression_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Elsif_Expression_Paths
.Elsif_Expression_Path_Access;
not overriding function Create_Use_Clause
(Self : Element_Factory;
Clause_Names : not null Program.Elements.Expressions
.Expression_Vector_Access;
Has_All : Boolean := False;
Has_Type : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Use_Clauses.Use_Clause_Access;
not overriding function Create_With_Clause
(Self : Element_Factory;
Clause_Names : not null Program.Elements.Expressions
.Expression_Vector_Access;
Has_Limited : Boolean := False;
Has_Private : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.With_Clauses.With_Clause_Access;
not overriding function Create_Component_Clause
(Self : Element_Factory;
Clause_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Position : not null Program.Elements.Expressions
.Expression_Access;
Clause_Range : not null Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Component_Clauses
.Component_Clause_Access;
not overriding function Create_Derived_Type
(Self : Element_Factory;
Parent : not null Program.Elements.Expressions
.Expression_Access;
Has_Abstract : Boolean := False;
Has_Limited : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Derived_Types.Derived_Type_Access;
not overriding function Create_Derived_Record_Extension
(Self : Element_Factory;
Parent : not null Program.Elements.Expressions
.Expression_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Record_Definition : not null Program.Elements.Definitions
.Definition_Access;
Has_Abstract : Boolean := False;
Has_Limited : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Derived_Record_Extensions
.Derived_Record_Extension_Access;
not overriding function Create_Enumeration_Type
(Self : Element_Factory;
Literals : not null Program.Elements
.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Enumeration_Types
.Enumeration_Type_Access;
not overriding function Create_Signed_Integer_Type
(Self : Element_Factory;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Signed_Integer_Types
.Signed_Integer_Type_Access;
not overriding function Create_Modular_Type
(Self : Element_Factory;
Modulus : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Modular_Types.Modular_Type_Access;
not overriding function Create_Root_Type
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Root_Types.Root_Type_Access;
not overriding function Create_Floating_Point_Type
(Self : Element_Factory;
Digits_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range : Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Floating_Point_Types
.Floating_Point_Type_Access;
not overriding function Create_Ordinary_Fixed_Point_Type
(Self : Element_Factory;
Delta_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range : not null Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Ordinary_Fixed_Point_Types
.Ordinary_Fixed_Point_Type_Access;
not overriding function Create_Decimal_Fixed_Point_Type
(Self : Element_Factory;
Delta_Expression : not null Program.Elements.Expressions
.Expression_Access;
Digits_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range : Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Decimal_Fixed_Point_Types
.Decimal_Fixed_Point_Type_Access;
not overriding function Create_Unconstrained_Array_Type
(Self : Element_Factory;
Index_Subtypes : not null Program.Elements.Expressions
.Expression_Vector_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Unconstrained_Array_Types
.Unconstrained_Array_Type_Access;
not overriding function Create_Constrained_Array_Type
(Self : Element_Factory;
Index_Subtypes : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Vector_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Constrained_Array_Types
.Constrained_Array_Type_Access;
not overriding function Create_Record_Type
(Self : Element_Factory;
Record_Definition : not null Program.Elements.Definitions
.Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Record_Types.Record_Type_Access;
not overriding function Create_Interface_Type
(Self : Element_Factory;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Has_Limited : Boolean := False;
Has_Task : Boolean := False;
Has_Protected : Boolean := False;
Has_Synchronized : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Interface_Types.Interface_Type_Access;
not overriding function Create_Object_Access_Type
(Self : Element_Factory;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Has_Not_Null : Boolean := False;
Has_All : Boolean := False;
Has_Constant : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Object_Access_Types
.Object_Access_Type_Access;
not overriding function Create_Procedure_Access_Type
(Self : Element_Factory;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Has_Not_Null : Boolean := False;
Has_Protected : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Procedure_Access_Types
.Procedure_Access_Type_Access;
not overriding function Create_Function_Access_Type
(Self : Element_Factory;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Has_Not_Null : Boolean := False;
Has_Protected : Boolean := False;
Has_Not_Null_2 : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Function_Access_Types
.Function_Access_Type_Access;
not overriding function Create_Formal_Private_Type_Definition
(Self : Element_Factory;
Has_Abstract : Boolean := False;
Has_Tagged : Boolean := False;
Has_Limited : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Private_Type_Definitions
.Formal_Private_Type_Definition_Access;
not overriding function Create_Formal_Derived_Type_Definition
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Has_Abstract : Boolean := False;
Has_Limited : Boolean := False;
Has_Synchronized : Boolean := False;
Has_With_Private : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition_Access;
not overriding function Create_Formal_Discrete_Type_Definition
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Discrete_Type_Definitions
.Formal_Discrete_Type_Definition_Access;
not overriding function Create_Formal_Signed_Integer_Type_Definition
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Signed_Integer_Type_Definitions
.Formal_Signed_Integer_Type_Definition_Access;
not overriding function Create_Formal_Modular_Type_Definition
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Modular_Type_Definitions
.Formal_Modular_Type_Definition_Access;
not overriding function Create_Formal_Floating_Point_Definition
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Floating_Point_Definitions
.Formal_Floating_Point_Definition_Access;
not overriding function Create_Formal_Ordinary_Fixed_Point_Definition
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Ordinary_Fixed_Point_Definitions
.Formal_Ordinary_Fixed_Point_Definition_Access;
not overriding function Create_Formal_Decimal_Fixed_Point_Definition
(Self : Element_Factory;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Decimal_Fixed_Point_Definitions
.Formal_Decimal_Fixed_Point_Definition_Access;
not overriding function Create_Formal_Unconstrained_Array_Type
(Self : Element_Factory;
Index_Subtypes : not null Program.Elements.Expressions
.Expression_Vector_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type_Access;
not overriding function Create_Formal_Constrained_Array_Type
(Self : Element_Factory;
Index_Subtypes : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Vector_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type_Access;
not overriding function Create_Formal_Object_Access_Type
(Self : Element_Factory;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Has_Not_Null : Boolean := False;
Has_All : Boolean := False;
Has_Constant : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Object_Access_Types
.Formal_Object_Access_Type_Access;
not overriding function Create_Formal_Procedure_Access_Type
(Self : Element_Factory;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Has_Not_Null : Boolean := False;
Has_Protected : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type_Access;
not overriding function Create_Formal_Function_Access_Type
(Self : Element_Factory;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Has_Not_Null : Boolean := False;
Has_Protected : Boolean := False;
Has_Not_Null_2 : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Function_Access_Types
.Formal_Function_Access_Type_Access;
not overriding function Create_Formal_Interface_Type
(Self : Element_Factory;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Has_Limited : Boolean := False;
Has_Task : Boolean := False;
Has_Protected : Boolean := False;
Has_Synchronized : Boolean := False;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Formal_Interface_Types
.Formal_Interface_Type_Access;
not overriding function Create_Range_Attribute_Reference
(Self : Element_Factory;
Range_Attribute : not null Program.Elements.Attribute_References
.Attribute_Reference_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Range_Attribute_References
.Range_Attribute_Reference_Access;
not overriding function Create_Simple_Expression_Range
(Self : Element_Factory;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access;
not overriding function Create_Digits_Constraint
(Self : Element_Factory;
Digits_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range_Constraint : Program.Elements.Constraints.Constraint_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Digits_Constraints
.Digits_Constraint_Access;
not overriding function Create_Delta_Constraint
(Self : Element_Factory;
Delta_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range_Constraint : Program.Elements.Constraints.Constraint_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Delta_Constraints
.Delta_Constraint_Access;
not overriding function Create_Index_Constraint
(Self : Element_Factory;
Ranges : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Index_Constraints
.Index_Constraint_Access;
not overriding function Create_Discriminant_Constraint
(Self : Element_Factory;
Discriminants : not null Program.Elements.Discriminant_Associations
.Discriminant_Association_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Discriminant_Constraints
.Discriminant_Constraint_Access;
not overriding function Create_Attribute_Definition_Clause
(Self : Element_Factory;
Name : not null Program.Elements.Expressions
.Expression_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Access;
not overriding function Create_Enumeration_Representation_Clause
(Self : Element_Factory;
Name : not null Program.Elements.Expressions
.Expression_Access;
Expression : not null Program.Elements.Array_Aggregates
.Array_Aggregate_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause_Access;
not overriding function Create_Record_Representation_Clause
(Self : Element_Factory;
Name : not null Program.Elements.Expressions
.Expression_Access;
Mod_Clause_Expression : Program.Elements.Expressions.Expression_Access;
Component_Clauses : not null Program.Elements.Component_Clauses
.Component_Clause_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause_Access;
not overriding function Create_At_Clause
(Self : Element_Factory;
Name : not null Program.Elements.Identifiers
.Identifier_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.At_Clauses.At_Clause_Access;
not overriding function Create_Exception_Handler
(Self : Element_Factory;
Choice_Parameter : Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access;
Choices : not null Program.Element_Vectors
.Element_Vector_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return not null Program.Elements.Exception_Handlers
.Exception_Handler_Access;
private
type Element_Factory (Subpool : not null System.Storage_Pools.Subpools
.Subpool_Handle) is tagged limited null record;
end Program.Implicit_Element_Factories;
|
instructions/a.asm | zrsharp/assembly | 0 | 6548 | data segment
number dw Y
addr dw number
count dw ?
data ends
prog segment
main proc far
assume cs:prog, ds:data
_start:
push ds
xor ax, ax
push ax
mov ax, data
mov ds, ax
xor cx, cx
mov bx, addr
mov ax, [bx]
_repeat:
test ax, 0ffffh
jz _exit
jns _shift
inc cx
_shift:
shl ax, 1
jmp _repeat
_exit:
mov count, ax
ret
main endp
prog ends
end _start
|
libsrc/stdio/cpc/getk.asm | jpoikela/z88dk | 640 | 100313 | <filename>libsrc/stdio/cpc/getk.asm<gh_stars>100-1000
;
; Amstrad CPC Stdio
;
; getk() Read key status
;
; <NAME> - 8/6/2001
;
;
; $Id: getk.asm $
;
SECTION code_clib
PUBLIC getk
PUBLIC _getk
INCLUDE "target/cpc/def/cpcfirm.def"
.getk
._getk
call firmware
defw km_read_char
push af
; clear buffer for next reading
call firmware
defw km_initialise
pop af
ld hl,0
ret nc
ld l,a
cp 127
ret nz
ld l,12
ret
|
alloy4fun_models/trashltl/models/9/ei3bkG4ybrC7myJ2P.als | Kaixi26/org.alloytools.alloy | 0 | 3617 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idei3bkG4ybrC7myJ2P_prop10 {
always all f: File | always f in Protected implies always f in Protected
}
pred __repair { idei3bkG4ybrC7myJ2P_prop10 }
check __repair { idei3bkG4ybrC7myJ2P_prop10 <=> prop10o } |
src/test/resources/samples/langs/AppleScript/center.applescript | JavascriptID/sourcerer-app | 8,271 | 1088 | <filename>src/test/resources/samples/langs/AppleScript/center.applescript
set windowWidth to 800
set windowHeight to 600
delay 0.1
set AppleScript's text item delimiters to "x"
set res to text returned of (display dialog "Enter the width x height:" default answer ((windowWidth & windowHeight) as text))
if res is "" then
display dialog "You need to enter a correct response"
return
end if
set {windowWidth, windowHeight} to text items of res
set AppleScript's text item delimiters to ""
tell application "Safari"
set screen_width to (do JavaScript "screen.availWidth" in document 1)
set screen_height to (do JavaScript "screen.availHeight" in document 1)
end tell
tell application "System Events"
set myFrontMost to name of first item of (processes whose frontmost is true)
end tell
tell application "Finder"
set {desktopTop, desktopLeft, desktopRight, desktopBottom} to bounds of desktop
end tell
try
tell application "System Events"
tell process myFrontMost
set {{w, h}} to size of drawer of window 1
end tell
end tell
on error
set {w, h} to {0, 0}
end try
tell application "System Events"
tell process myFrontMost
try
set {{w, h}} to size of drawer of window 1
on error
set {w, h} to {0, 0}
end try
set position of window 1 to {((screen_width - windowWidth) / 2), ((screen_height - windowHeight) / 2.0) - desktopTop}
set size of window 1 to {windowWidth -w, windowHeight}
end tell
end tell |
llvm-gcc-4.2-2.9/gcc/ada/s-sopco4.adb | vidkidz/crossbridge | 1 | 3918 | <gh_stars>1-10
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . S T R I N G _ O P S _ C O N C A T _ 4 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-1998, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body System.String_Ops_Concat_4 is
------------------
-- Str_Concat_4 --
------------------
function Str_Concat_4 (S1, S2, S3, S4 : String) return String is
begin
if S1'Length <= 0 then
return S2 & S3 & S4;
else
declare
L12 : constant Natural := S1'Length + S2'Length;
L13 : constant Natural := L12 + S3'Length;
L14 : constant Natural := L13 + S4'Length;
R : String (S1'First .. S1'First + L14 - 1);
begin
R (S1'First .. S1'Last) := S1;
R (S1'Last + 1 .. S1'First + L12 - 1) := S2;
R (S1'First + L12 .. S1'First + L13 - 1) := S3;
R (S1'First + L13 .. R'Last) := S4;
return R;
end;
end if;
end Str_Concat_4;
end System.String_Ops_Concat_4;
|
errorcheck.als | blockchainhelppro/Bitcoin-Escrow-Application | 0 | 1779 | <filename>errorcheck.als<gh_stars>0
; A Battle Arena error checking script
; version 1.6 (8 September 2016)
; by <NAME>
check {
; The main command for the script. To prevent abuse, this alias cannot be used as a function.
; $1 : What to check: techs, items, monsters, weapons or everything.
; $2 : Set to 'ignoreversion' to skip the Arena version check.
if ($isid) return
if (($version < 7) && (!$isalias(noop))) {
; Older versions of mIRC lack the noop command, which this script uses. If we're running on such a platform, write an alias to emulate /noop.
echo 12 Writing alias noop to $nopath($script) $+ .
write " $+ $script $+ " noop return
.timer -do 1 0 reload -a " $+ $script $+ "
.timer -do 1 1 check $1-
halt
}
if (($2 != ignoreversion) && ($3 != ignoreversion)) {
; Do a quick check on the Arena version.
if ($regex($battle.version(), ^(\d\.\d)$) > 0) {
if ($regml(1) > 3.2) { echo 4 This script appears to be out of date. Use /check $1 ignoreversion to ignore this. | halt }
else if ($regml(1) < 3.0) set -u0 %old $true
}
else if ($regex($battle.version(), ^(\d\.\d)_?beta_?(\d\d)(\d\d)(\d\d)$) > 0) {
if ($regml(1) > 3.2) { echo 4 This script appears to be out of date. Use /check $1 ignoreversion to ignore this. | halt }
else if ($regml(1) < 3.0) set -u0 %old $true
else if ($regml(4) > 16) { echo 4 This script appears to be out of date. Use /check $1 ignoreversion to ignore this. | halt }
else if ($regml(4) < 15) set -u0 %old $true
else if ($regml(4) == 16) {
if ($regml(2) > 11) { echo 4 This script appears to be out of date. Use /check $1 ignoreversion to ignore this. | halt }
}
else {
if ($regml(2) < 2) set -u0 %old $true
else if (($regml(2) == 2) && ($regml(3) < 21)) set -u0 %old $true
}
}
else {
echo 4 Could not parse the Arena version ($battle.version).
}
}
if ($0 < 1) { echo 2 Usage: /check category [subcategory] [ignoreversion] | echo 2 The following can be checked: techs, items, NPCs, weapons, armor, all. Subcategories for NPCs are monsters, allies and bosses. | halt }
var %old_title = $titlebar
set %issues_total 0
set %issues_major 0
if ($window(@issues) != $null) aline @issues ----------------
; Some things have issues when no battles have taken place yet.
if ($readini(battlestats.dat, Battle, WinningStreak) == $null) {
writeini battlestats.dat Battle WinningStreak 0
writeini battlestats.dat Battle LosingStreak 0
}
if ($1 == all || $1 == everything) {
window @issues
echo 12 Checking all known entries. This may take a minute or so.
aline @issues Checking all known entries. This may take a minute or so.
check_techs new_chr DoublePunch new_chr
set %issues_total 0 | set %issues_major 0
check_items
set %issues_total 0 | set %issues_major 0
check_monsters
set %issues_total 0 | set %issues_major 0
check_weapons
set %issues_total 0 | set %issues_major 0
check_armor
}
else if ($1 == techs || $1 == techniques) check_techs new_chr DoublePunch new_chr
; Those parameters are there in case of techniques like Asura Strike that need to reference a character.
else if ($1 == items) check_items
else if ($1 == monsters || $1 == npcs) {
if ($2 == monsters || $2 == mons) set -u0 %subcategory monsters
else if ($2 == allies || $2 == npcs) set -u0 %subcategory allies
else if ($2 == bosses) set -u0 %subcategory bosses
else if ($2 != $null && $2 != ignoreversion) { echo 2 ' $+ $2 $+ ' isn't a known subcategory. Use monsters, allies or bosses. | halt }
check_monsters
}
else if ($1 == weapons) check_weapons
else if ($1 == armor || $1 == armour) check_armor
else { echo 2 Usage: /check category [subcategory] [ignoreversion] | echo 2 The following can be checked: techs, items, NPCs, weapons, all. Subcategories for NPCs are monsters, allies and bosses. | halt }
titlebar %old_title
}
check_techs {
; Checks techniques
; No parameters
if ($isid) return
window -e @issues
set %total_techniques $ini($dbfile(techniques.db), 0)
var %current_technique = 0
while (%current_technique < %total_techniques) {
inc %current_technique
var %technique_name = $ini($dbfile(techniques.db), %current_technique)
if (%technique_name == techs) continue
if (%technique_name == ExampleTech) continue
titlebar Battle Arena $battle.version — Checking technique %current_technique / %total_techniques : %technique_name ...
; Spaces and = can't be in technique names.
if (($chr(32) isin %technique_name) || (= isin %technique_name)) log_issue Moderate Technique %technique_name has an invalid name: technique will be unusable.
; Either a TP or mech energy cost must be specified.
var %tp.needed = $readini($dbfile(techniques.db), p, %technique_name, TP)
var %energydrain = $readini($dbfile(techniques.db), $2, energyCost)
if (%tp.needed != $null) {
if (%tp.needed !isnum) log_issue Moderate Technique %technique_name $+ 's TP cost ( $+ %tp.needed $+ ) is not a number: technique will cost 0 TP.
}
if (%energydrain != $null) {
if (%energydrain !isnum) log_issue Minor Technique %technique_name $+ 's energy cost ( $+ %tp.needed $+ ) is not a number: technique will cost 100 energy.
}
if ((%tp.needed == $null) && (%energydrain == $null)) log_issue Moderate Technique %technique_name has no TP or energy cost; the technique may be unusable.
var %tech.type = $readini($dbfile(techniques.db), %technique_name, Type)
if (%tech.type == boost) {
; Check that the base power is a number.
var %tech.base = $readini($dbfile(techniques.db), p, %technique_name, BasePower)
if (%tech.base !isnum) log_issue Moderate Technique %technique_name $+ 's power is not a number: power will be zeroed.
continue
}
if (%tech.type == finalgetsuga) {
; Check that the base power is a number.
var %tech.base = $readini($dbfile(techniques.db), p, %technique_name, BasePower)
if (%tech.base !isnum) log_issue Moderate Technique %technique_name $+ 's power is not a number: power will be zeroed.
continue
}
if (%tech.type == Buff) {
; Not really much to check for here. We either have a resist buff, or a status effect.
var %buff.type = $readini($dbfile(techniques.db), %technique_name, status)
if (%buff.type == en-spell) {
var %enspell.element = $readini($dbfile(techniques.db), %technique_name, element)
if ((. isin %enspell.element) || (%enspell.element !isin Earth.Fire.Wind.Water.Ice.Lightning.Light.Dark && (!$isweapontype(%enspell.element)))) $&
log_issue Moderate Technique %technique_name uses an invalid modifier: technique will have no effect.
}
else {
var %modifier.type = $readini($dbfile(techniques.db), %technique_name, modifier)
if (%modifier.type != $null) {
if ((. isin %modifier.type) || (%modifier.type !isin Earth.Fire.Wind.Water.Ice.Lightning.Light.Dark && (!$isweapontype(%modifier.type)))) $&
log_issue Moderate Technique %technique_name uses an invalid modifier: technique will have no effect.
}
}
continue
}
if (%tech.type == ClearStatusPositive) continue
if (%tech.type == ClearStatusNegative) continue
if (%tech.type == Heal) {
goto damage_checks
}
if (%tech.type == Heal-AoE) {
goto damage_checks
}
if (%tech.type = single || %tech.type = status) {
; Check the absorb setting.
var %technique_absorb = $readini($dbfile(techniques.db), %technique_name, Absorb)
if ((%technique_absorb != $null) && (%technique_absorb != yes) && (%technique_absorb != no)) log_issue Minor Technique %technique_name $+ 's absorb field is specified, but not as 'yes': field will be ignored.
goto damage_checks
}
if (%tech.type == Suicide) {
goto damage_checks
}
if (%tech.type == Suicide-AoE) {
goto damage_checks
}
if (%tech.type == StealPower) {
; Check that the base power is a number.
goto damage_checks
}
if (%tech.type == AoE) {
; Check the absorb setting.
var %technique_absorb = $readini($dbfile(techniques.db), %technique_name, Absorb)
if ((%technique_absorb != $null) && (%technique_absorb != yes) && (%technique_absorb != no)) log_issue Minor Technique %technique_name $+ 's absorb field is specified, but not as 'yes': field will be ignored.
goto damage_checks
}
if (%tech.type == Death || %tech.type == Death-AoE) {
; The success chance must be a percentage.
var %chance = $readini($dbfile(techniques.db), %technique_name, DeathChance)
if (%chance !isnum) log_issue Moderate Technique %technique_name $+ 's success chance is not a number: it will be ineffective.
else if (%chance > 0 && %chance < 1) log_issue Minor Technique %technique_name $+ 's success chance is a decimal where a percentage (1-100) is expected.
continue
}
log_issue Moderate Technique %technique_name has an unrecognised type ( $+ %tech.type $+ ).
continue
:damage_checks
; The base stat needed must actually exist.
var %base.stat.needed = $readini($dbfile(techniques.db), %technique_name, stat)
if (%base.stat.needed == $null) { var %base.stat.needed int }
if ((. isin %base.stat.needed) || (%base.stat.needed !isin STR.DEF.INT.SPD.HP.TP.IgnitionGauge)) $&
log_issue Moderate Technique %technique_name uses an invalid attribute: technique will do very little damage.
; Check that the base power is a number.
var %tech.base = $readini($dbfile(techniques.db), p, %technique_name, BasePower)
if (%tech.base !isnum) log_issue Moderate Technique %technique_name $+ 's power is not a number: power will be zeroed.
; Check the magic setting.
var %technique_magic = $readini($dbfile(techniques.db), %technique_name, magic)
if ((%technique_magic != $null) && (%technique_magic != yes) && (%technique_magic != no)) log_issue Minor Technique %technique_name $+ 's magic field is specified, but not as 'yes': field will be ignored.
; Check the element.
var %tech.elements = $readini($dbfile(techniques.db), %technique_name, element)
if ((%tech.elements != $null) && (%tech.elements != none) && (%tech.elements != no)) {
var %count = $numtok(%tech.elements, 46)
if (%count >= 1) {
var %i = 1
while (%i <= %count) {
var %element = $gettok(%tech.elements, %i, 46)
if (%element !isin fire.water.ice.lightning.wind.earth.light.dark) $&
log_issue Minor Technique %technique_name uses an unknown element ( $+ %element $+ ): it will be unaffected by weather.
inc %i
}
}
}
; Check that the ignore defense percent is a number and not a decimal.
var %ignore.defense.percent = $readini($dbfile(techniques.db), %technique_name, IgnoreDefense)
if ((%ignore.defense.percent) && (%ignore.defense.percent !isnum)) log_issue Moderate Technique %technique_name $+ 's ignore defense is not a number: it will be zeroed.
else if (%ignore.defense.percent > 0 && %ignore.defense.percent < 1) log_issue Minor Technique %technique_name $+ 's ignore defense is a decimal where a percentage (0-100) is expected.
; Check that the status types are valid.
var %status.type.list = $readini($dbfile(techniques.db), %technique_name, StatusType)
if (%status.type.list != $null) check_statuseffects %status.type.list Technique $+ %technique_name $+
var %selfstatus.type.list = $readini($dbfile(techniques.db), %technique_name, SelfStatus)
if (%selfstatus.type.list != $null) check_statuseffects %selfstatus.type.list Technique $+ %technique_name $+ 's SelfStatus field
; Check the number of hits.
var %tech.howmany.hits = $readini($dbfile(techniques.db), %technique_name, hits)
if ((%tech.howmany.hits) && (%tech.howmany.hits !isnum)) /log_issue Minor Technique %technique_name $+ 's number of hits is not a number: it will be zeroed.
continue
:error
log_issue Critical Checking technique %technique_name failed: $error
reseterror
}
if (%issues_total == 0) echo -a 12Checked $calc(%current_technique - 1) techniques and found no issues. Yay!
else echo -a 12Checked $calc(%current_technique - 1) techniques and found %issues_total $+ $iif(%issues_total = 1, issue, issues) $+ .
}
check_items {
; Checks items
; No parameters
if ($isid) return
window @issues
titlebar Battle Arena $battle.version — Checking item lists...
; Read in the lists at the top of the database, and make sure there are no broken references there.
check_db_item_lists Gems gem
check_db_item_lists Keys key
check_db_item_lists Runes rune
; Read in the item list files, and make sure there are no broken references there.
check_item_lists items_accessories.lst accessory
check_item_lists items_battle.lst status.damage.snatch
check_item_lists items_consumable.lst consume
check_item_lists items_food.lst food
check_item_lists items_gems.lst gem
check_item_lists items_healing.lst heal.tp.revive.autorevive.ignitiongauge.curestatus
check_item_lists items_misc.lst misc.trade
check_item_lists items_portal.lst portal.torment
check_item_lists items_random.lst random.tormentreward
check_item_lists items_reset.lst shopreset
check_item_lists items_summons.lst summon
; Now go through the database checking for errors in each item.
set %total_items $ini($dbfile(items.db), 0)
var %current_item = 0
while (%current_item < %total_items) {
inc %current_item
var %item_name = $ini($dbfile(items.db), %current_item)
if (%item_name == Items) continue
titlebar Battle Arena $battle.version � Checking item %current_item / %total_items : %item_name ...
check_item new_chr %item_name on new_chr
}
if (%issues_total == 0) echo -a 12Checked $calc(%current_item - 1) items and found no issues. Yay!
else echo -a 12Checked $calc(%current_item - 1) items and found %issues_total $+ $iif(%issues_total = 1, issue, issues) $+ .
}
check_db_item_lists {
; Ensures that all of the items in an items.db list are the correct type.
; $1 : The header of the list in items.db
; $2 : The type of item that is considered valid.
if ($isid) return
var %db_list = $readini($dbfile(items.db), Items, $1)
set %total_items $numtok(%db_list, 46)
var %current_item = 0
while (%current_item < %total_items) {
inc %current_item
var %item_name = $gettok(%db_list, %current_item, 46)
var %item_type = $readini($dbfile(items.db), %item_name, Type)
if (%item_type) {
if (%item_type != $2) log_issue Moderate Item %item_name is listed under ' $+ $1 $+ ' but isn't a $2 $+ .
}
else log_issue Moderate Missing item %item_name is listed under ' $+ $1 $+ '.
}
}
check_item_lists {
; Checks an item .lst file to ensure all items listed are of the correct type.
; $1 : The filename to check, relative to the /lsts folder.
; $2 : One of more types of items that are considered valid. Can be a single type or a period-delimited list.
if ($isid) return
var %total_items = $lines($lstfile($1))
var %current_item = 0
while (%current_item < %total_items) {
inc %current_item
set %item_name $read($lstfile($1), %current_item)
var %item_type = $readini($dbfile(items.db), %item_name, Type)
if (%item_type) {
if ((. isin %item_type) || (%item_type !isin $2)) log_issue Moderate Item %item_name is listed in $1 but isn't a $+ $iif($left($2, 1) isin aeiou,n,$null) $2 $+ .
}
else /log_issue Moderate Missing item %item_name is listed in $1 $+ .
}
}
check_item {
; Checks an individual item definition for errors.
; $1 : A character name. new_chr is recommended as all bots should have it.
; $2 : The item to check.
; $3 : 'on'
; $4 : A character name. new_chr is recommended as all bots should have it.
if ($isid) return
var %item_type = $readini($dbfile(items.db), $2, Type)
; Check for the exclusive tag.
var %exclusive = $readini($dbfile(items.db), $2, exclusive)
if ((%exclusive != $null) && (%exclusive != yes) && (%exclusive != no)) /log_issue Minor Item %item_name $+ 's exclusive field is specified, but not as 'yes': field will be ignored.
if (%item_type == Food) {
; Food items must use a valid attribute and amount. The amount MAY be negative.
var %food.type = $readini($dbfile(items.db), $2, target)
var %food.bonus = $readini($dbfile(items.db), $2, amount)
if ((. isin %food.type) || (%food.type !isin HP.TP.STR.DEF.INT.SPD.IgnitionGauge.Style.RedOrbs.BlackOrbs)) $&
log_issue Moderate Item $2 $+ 's attribute is invalid; it will have no effect. Use one of: HP, TP, STR, DEF, INT, SPD, IgnitionGauge, Style, RedOrbs, BlackOrbs.
if (%food.bonus !isnum) log_issue Moderate Item $2 $+ 's bonus amount is not a number; it will have no effect.
return
}
if (%item_type == Portal) {
; Portal items must refer to existing monsters.
var %monster.to.spawn = $readini($dbfile(items.db), $2, Monster)
var %battlefield = $readini($dbfile(items.db), $2, Battlefield)
var %weather = $readini($dbfile(items.db), $2, weather)
var %allied.notes = $readini($dbfile(items.db), $2, alliednotes)
var %value = 1 | var %number.of.monsters $numtok(%monster.to.spawn,46)
while (%value <= %number.of.monsters) {
set %current.monster.to.spawn $gettok(%monster.to.spawn,%value,46)
var %isboss = $isfile($boss(%current.monster.to.spawn))
var %ismonster = $isfile($mon(%current.monster.to.spawn))
if ((%isboss != $true) && (%ismonster != $true)) log_issue Moderate Item $2 $+ references missing monster %current.monster.to.spawn $+ ; it will be skipped.
inc %value
}
; Portal items must use an existing battlefield.
var %battlefield = $readini($dbfile(items.db), $2, Battlefield)
if ($ini($dbfile(battlefields.db), %battlefield) = $null) log_issue Moderate Item $2 $+ references missing battlefield %battlefield $+ .
return
}
if (%item_type == Torment) {
; Torment reward items must define a valid level.
var %level = $readini($dbfile(items.db), $2, TormentLevel)
if (%level != anguish && %level != misery && (%level !isnum)) log_issue Moderate Item $2 $+ 's level is not a number; it will have no effect.
else if (%level < 0) log_issue Moderate Item $2 $+ has a negative level.
return
}
if (%item_type == Key) {
var %unlocks = $readini($dbfile(items.db), $2, Unlocks)
; Keys must use a valid chest colour.
if ((%unlocks != Red) && (!$isfile($lstfile(chest_ $+ %unlocks $+ .lst)))) $&
log_issue Moderate Item $2 $+ references a non-existent colour of treasure chest; it will be useless.
return
}
if (%item_type == Consume) {
; Skill items should reference an existing skill.
var %skill = $readini($dbfile(items.db), $2, Skill)
if ((!$read($lstfile(skills_active.lst), w, %skill)) && (!$read($lstfile(skills_active2.lst), w, %skill))) $&
log_issue Minor Item $2 $+ references a non-existent skill; its !view-info entry will be invalid.
return
}
if ((%item_type == Gem) || (%item_type == Misc) || (%item_type == Trade)) {
return
}
if (%item_type == Rune) {
var %augment.name = $readini($dbfile(items.db), $2, augment)
if (!%augment.name) log_issue Moderate Item $2 is missing an augment.
return
}
if (%item_type == Accessory) {
; Accessories must be of a valid type.
var %i = 1
var %types = $readini($dbfile(items.db), $2, accessoryType)
var %total_types = $numtok(%types, 46)
while (%i <= %total_types) {
var %type = $gettok(%types, %i, 46)
if (%type isin IncreaseMeleeAddPoison.IncreaseH2HDamage.IncreaseSpearDamage.IncreaseSwordDamage.IncreaseGreatSwordDamage.IncreaseWhipDamage.IncreaseGunDamage.IncreaseBowDamage.IncreaseGlyphDamage.IncreaseKatanaDamage.IncreaseWandDamage.IncreaseStaffDamage.IncreaseScytheDamage.IncreaseAxeDamage.IncreaseDaggerDamage.IncreaseHealing.ElementalDefense.IncreaseRedOrbs.IncreaseSpellDamage.IncreaseMeleeDamage.IncreaseMagic, %i, 46) {
var %amount = $readini($dbfile(items.db), $2, %type $+ .amount)
if (%amount = $null) log_issue Moderate Accessory $2 has no %type amount; it will have no effect.
else if (%amount !isnum) log_issue Moderate Accessory $2 $+ 's %type amount is not a number; it will have no effect.
else if (%amount >= 10) log_issue Moderate Accessory $2 $+ 's %type amount is very high. It should be a fractional factor instead of a percentage.
}
else if (%type isin IncreaseCriticalHits.BlockAllStatus.IncreaseSteal.IncreaseTreasureOdds.IncreaseMimicOdds.EnhanceBlocking.EnhanceDragonHunt.IncreaseTurnSpeed, %i, 46) {
var %amount = $readini($dbfile(items.db), $2, %type $+ .amount)
if (%amount = $null) log_issue Moderate Accessory $2 has no %type amount; it will have no effect.
else if (%amount !isnum) log_issue Moderate Accessory $2 $+ 's %type amount is not a number; it will have no effect.
else if ((%amount > -0.5) && (%amount < 0.5) && (%amount != 0)) log_issue Moderate Accessory $2 $+ 's %type amount is very low. It should be a percentage instead of a fraction.
}
else if (%type isin IncreaseMechEngineLevel.ReduceShopLevel.IncreaseTrustFriendship.IncreaseWrestlingDamage, %i, 46) {
var %amount = $readini($dbfile(items.db), $2, %type $+ .amount)
if (%amount = $null) log_issue Moderate Accessory $2 has no %type amount; it will have no effect.
else if (%amount !isnum) log_issue Moderate Accessory $2 $+ 's %type amount is not a number; it will have no effect.
else if ((%amount > -0.5) && (%amount < 0.5) && (%amount != 0)) log_issue Moderate Accessory $2 $+ 's %type amount is very low. It should be a number to add directly instead of a fraction.
}
else if (%type !isin CurseAddDrain.Mug.Stylish.IgnoreQuicksilver.AutoRegen) $&
log_issue Moderate Accessory $2 has unrecognised type %type $+ .
inc %i
}
return
}
if (%item_type == Random) {
return
}
if (%item_type == TormentReward) {
; Torment reward items must define a valid amount.
var %item_count = $readini($dbfile(items.db), $2, ItemsInside)
if (%item_count !isnum) log_issue Moderate Item $2 $+ 's reward count is not a number; it will give d10 items.
return
}
if (%item_type == ShopReset) {
; Discount items must define a valid amount.
var %shop.reset.amount = $readini($dbfile(items.db), $2, amount)
if (%shop.reset.amount !isnum) log_issue Moderate Item $2 $+ 's discount amount is not a number; it will have no effect.
return
}
if (%item_type == IncreaseWeaponLevel) {
; Weapon enhancement items must define a valid amount.
var %enhancement.amount = $readini($dbfile(items.db), $2, IncreaseAmount)
if (%enhancement.amount !isnum) log_issue Moderate Item $2 $+ 's increase amount is not a number; it will enhance by 1 level.
return
}
if (%item_type == Damage) {
var %fullbring_item.base = $readini($dbfile(items.db), $2, FullbringAmount)
var %item.base = $readini($dbfile(items.db), $2, Amount)
if (%item.base !isnum) log_issue Moderate Item $2 $+ 's damage amount is not a number; its power will be zeroed.
var %current.element = $readini($dbfile(items.db), $2, element)
if ((%current.element) && (. isin %current.element || %current.element !isin none.fire.water.ice.lightning.wind.earth.light.dark)) $&
log_issue Minor Item $2 uses an unknown element ( $+ %tech.element $+ ).
return
}
if (%item_type == Snatch) {
return
}
if (%item_type == Heal) {
; Healing items must define a valid amount.
var %item.base = $readini($dbfile(items.db), $2, Amount)
if (%item.base !isnum) log_issue Moderate Item $2 $+ 's healing amount is not a number; its power will be zeroed.
return
}
if (%item_type == CureStatus) {
return
}
if (%item_type == TP) {
; TP items must define a valid amount.
var %tp.amount = $readini($dbfile(items.db), $2, amount)
if (%tp.amount !isnum) log_issue Moderate Item $2 $+ 's TP amount is not a number; it will have no effect.
return
}
if (%item_type == IgnitionGauge) {
; Ignition charge items must define a valid amount.
var %IG.amount = $readini($dbfile(items.db), $2, amount)
if (%IG.amount !isnum) log_issue Moderate Item $2 $+ 's charge amount is not a number; it will have no effect.
return
}
if (%item_type == Status) {
var %status.type.list = $readini($dbfile(items.db), $2, StatusType)
if (%status.type.list != $null) check_statuseffects %status.type.list Item $+ $2 $+
var %fullbring_item.base = $readini($dbfile(items.db), $2, FullbringAmount)
var %item.base = $readini($dbfile(items.db), $2, Amount)
if (%item.base !isnum) /log_issue Moderate Item $2 $+ 's damage amount is not a number; its power will be zeroed.
var %current.element = $readini($dbfile(items.db), $2, element)
if ((%current.element) && ((. isin %current.element) || (%current.element !isin none.fire.water.ice.lightning.wind.earth.light.dark))) $&
log_issue Minor Item $2 uses an unknown element ( $+ %tech.element $+ ).
return
}
if (%item_type == Revive) return
if (%item_type == AutoRevive) return
if (%item_type == Summon) {
; Summon items must define an existing summon.
var %summon.name = $readini($dbfile(items.db), $2, summon)
if (!$isfile($summon(%summon.name))) log_issue Moderate Item $2 $+ references missing summon %summon.name $+ ; it will have no effect.
return
}
if (%item_type == MechCore) {
; Mech cores must define an energy cost and augments.
var %energy.cost = $readini($dbfile(items.db), $2, energyCost)
if (%energy.cost = $null) log_issue Moderate Item $2 $+ has no energy cost; it will cost 100 energy.
else if (%energy.cost !isnum) log_issue Moderate Item $2 $+ 's energy cost is not a number.
;var %augments $readini($dbfile(items.db), $2, augment)
;var %total_augments $numtok(%augments, 46)
;var %augment 1
;while (%augment <= %total_augments) {
; var %current_augment $gettok(%augments, %augment, 46)
;}
return
}
if (%item_type == Instrument) return
if (%item_type == Special) {
var %special_type = $readini($dbfile(items.db), $2, SpecialType)
if (%special_type == GainWeapon) {
var %weapon = $readini($dbfile(items.db), $2, Weapon)
if (!$ini($dbfile(weapons.db), %weapon)) /log_issue Moderate Item $2 references missing weapon ( $+ %weapon $+ ).
return
}
if (%special_type == GainSong) {
var %song = $readini($dbfile(items.db), $2, Song)
if (!$ini($dbfile(songs.db), %song)) /log_issue Moderate Item $2 references missing song ( $+ %song $+ ).
return
}
log_issue Moderate Item $2 $+ has an unrecognised special type ( $+ %special_type $+ ). If it's a mod, this script will need to be edited. Otherwise, the item will have no effect.
return
}
if (%item_type == Trust) {
; The Ally must actually exist.
var %trust.npc = $readini($dbfile(items.db), $2, NPC)
if (!$isfile($npc(%trust.npc))) log_issue Moderate Item $2 $+ references missing Ally %trust.npc $+ ; it cannot be used.
return
}
if (%item_type == Dungeon) {
; Dungeon items must specify an existing dungeon.
var %dungeon = $readini($dbfile(items.db), $2, Dungeon)
if (!$isfile($dungeonfile(%dungeon))) log_issue Moderate Item $2 $+ references missing dungeon %dungeon $+ ; it cannot be used.
return
}
if (%item_type == Armor) return
if (%item_type == Ammo) return
if (%item_type == TradingCard) return
log_issue Moderate Item $2 $+ has an unrecognised type ( $+ %item_type $+ ). If it's a mod, this script will need to be edited. Otherwise, the item will have no effect.
return
:error
log_issue Critical Checking item $2 failed: $error
reseterror
}
check_monsters {
; Checks monsters (including bosses and NPCs)
; No parameters
if ($isid) return
window @issues
set %monster_count 0
if ((%subcategory == $null) || (%subcategory == monsters)) {
set -u0 %category Monster
noop $findfile($mon_path, *, 0, 0, check_monster_file $1-)
}
if ((%subcategory == $null) || (%subcategory == bosses)) {
set -u0 %category Boss
noop $findfile($boss_path, *, 0, 0, check_monster_file $1-)
}
if ((%subcategory == $null) || (%subcategory == allies)) {
set -u0 %category NPC
noop $findfile($npc_path, *, 0, 0, check_monster_file $1-)
}
; Make sure that the orb fountain is present.
if (!$isfile($mon(orb_fountain))) log_issue Critical The Red Orb Fountain is missing! ( $+ $mon(orb_fountain) $+ )
if (%issues_total == 0) echo -a 12Checked %monster_count characters and found no issues. Yay!
else echo -a 12Checked %monster_count characters and found %issues_total $+ $iif(%issues_total = 1, issue, issues) $+ .
}
check_monster_file {
; Ensures that all files in the /monsters and /bosses folders have a .char extension.
; $1-: The file path to check, relative to the working directory.
if ($isid) return
inc %monster_count
set -u0 %file_path $1-
var %file = $nopath($1-)
if (%file == Note.txt) return
titlebar Battle Arena $battle.version — Checking $lower(%category) %file ...
; Check the file extension.
noop $regex(%file, ^.*\.([^.]+)$)
if ($regml(1) != char) { /log_issue Minor Found file %file in the monsters folder without a .char extension; it will be ignored. | return }
var %name = $remove(%file, .char)
if ((%name == new_mon) || (%name == new_boss) || (%name == $null)) return
check_monster %name
}
check_monster {
; Checks a monster's character file for errors.
; $1 : The monster's name.
; %file.path : The path to their character file.
if ($isid) return
; Check the monster's attributes.
set %hp $readini(%file_path, BaseStats, HP)
noop $monster_get_hp($1, $null, 1)
set %tp $readini(%file_path, BaseStats, TP)
if (!$validate_expression($readini(%file_path, n, BaseStats, TP))) set %tp 0
set %str $readini(%file_path, BaseStats, Str)
set %def $readini(%file_path, BaseStats, Def)
set %int $readini(%file_path, BaseStats, Int)
set %spd $readini(%file_path, BaseStats, Spd)
noop $monster_get_attributes($1, 1, $null)
if (%hp !isnum) log_issue Moderate %category $+ $1 $+ 's base HP is not a number; their HP will be zeroed.
if (%tp !isnum) log_issue $iif($readini(%file_path, info, BattleStats) = ignore, Moderate, Minor) %category $+ $1 $+ 's base TP is not a number; their TP will be zeroed.
if (%str !isnum) log_issue Moderate %category $+ $1 $+ 's base STR is not a number; their STR will be zeroed.
if (%def !isnum) log_issue Moderate %category $+ $1 $+ 's base DEF is not a number; their DEF will be zeroed.
if (%int !isnum) log_issue Moderate %category $+ $1 $+ 's base INT is not a number; their INT will be zeroed.
if (%spd !isnum) log_issue Moderate %category $+ $1 $+ 's base SPD is not a number; their SPD will be zeroed.
unset %hp %tp %str %def %int %spd
if ((%category != NPC) && ($readini(%file_path, Info, Flag) != monster)) log_issue Moderate %category $+ $1 $+ 's info flag is not set as 'monster'.
if ((%category == NPC) && ($readini(%file_path, Info, Flag) != npc)) log_issue Moderate %category $+ $1 $+ 's info flag is not set as 'npc'.
if (($readini(%file_path, Info, Streak) != $null) && ($readini(%file_path, Info, Streak) !isnum)) log_issue Moderate %category $+ $1 $+ 's Streak field is not a number; the value will be zeroed.
if (($readini(%file_path, Info, StreakMax) != $null) && ($readini(%file_path, Info, StreakMax) !isnum)) log_issue Moderate %category $+ $1 $+ 's StreakMax field is not a number; the value will be zeroed.
if (($readini(%file_path, Info, BossLevel) != $null) && ($readini(%file_path, Info, BossLevel) !isnum)) log_issue Moderate %category $+ $1 $+ 's BossLevel field is not a number; the value will be zeroed.
if ($readini(%file_path, Info, Month) != $null) {
if ($readini(%file_path, Info, Month) !isnum) log_issue Moderate %category $+ $1 $+ 's Month field is not a number.
else if ($readini(%file_path, Info, Month) < 1 || $readini(%file_path, Info, Month) > 12) log_issue Moderate %category $+ $1 $+ 's Month field is not within the valid range (01-12).
}
if ($readini(%file_path, Info, AI-Type) != $null) {
if ((. isin $readini(%file_path, Info, AI-Type)) || ($readini(%file_path, Info, AI-Type) !isin Berserker.Defender)) log_issue Minor %category $+ $1 $+ 's AI-Type field is invalid. Use one of: Berserker, Defender
}
if (($readini(%file_path, Info, OrbBonus) != $null) && ($readini(%file_path, Info, OrbBonus) !isin yes.no.false)) log_issue Minor %category $+ $1 $+ 's OrbBonus field is specified, but not as 'yes'; the field will be ignored.
if (($readini(%file_path, Info, CanFlee) != $null) && ($readini(%file_path, Info, CanFlee) !isin true.no.false)) log_issue Minor %category $+ $1 $+ 's CanFlee field is specified, but not as 'yes'; it will not flee.
if (($readini(%file_path, Info, MetalDefense) != $null) && ($readini(%file_path, Info, MetalDefense) !isin true.no.false)) log_issue Moderate %category $+ $1 $+ 's MetalDefense field is specified, but not as 'true'; it will not take effect.
; Check the biome.
var %biome.list = $readini(%file_path, Info, Biome)
if (%biome.list != $null) {
var %number.of.biomes = $numtok(%biome.list, 46)
var %i = 1
while (%i <= %number.of.statuseffects) {
var %current.biome = $gettok(%biome.list, %i, 46)
if (!$read($lstfile(battlefields.lst), w, %current.biome)) var %bad_biomes $addtok(%bad_biomes, %current.biome, 46)
inc %i
}
}
if (%bad_biomes) log_issue Moderate %category $+ $1 $+ 's Biome list includes unlisted battlefield(s) $replace(%bad_biomes, ., $chr(44) $+ $chr(32)) $+ .
; Check the weapons.
if ($readini(%file_path, n, weapons, $readini(%file_path, weapons, equipped)) = $null) log_issue Minor %category $+ $1 is missing $readini(%file_path, Info, Gender) equipped weapon ( $+ $readini(%file_path, weapons, equipped) $+ ); its power will be zeroed.
if (($readini(%file_path, weapons, equippedleft) != $null) && ($readini(%file_path, n, weapons, $readini(%file_path, weapons, equippedleft)) = $null)) {
if ($readini($dbfile(weapons.db), $readini(%file_path, weapons, equippedleft), type) != shield) log_issue Minor %category $+ $1 is missing $readini(%file_path, Info, Gender) equipped weapon ( $+ $readini(%file_path, weapons, equippedleft) $+ ); its power will be zeroed.
}
var %ai_type = $readini(%file_path, info, ai_type)
var %i = 0
var %count = $ini(%file_path, weapons, 0)
while (%i < %count) {
inc %i
var %weapon = $ini(%file_path, weapons, %i)
if (;* iswm %weapon) continue
if ((. !isin %weapon) && (%weapon isin Equipped.EquippedLeft.Weakness.Strong)) continue
if ((%weapon == none) && (%ai_type = defender)) continue
if (!$ini($dbfile(weapons.db), %weapon)) /log_issue Minor %category $+ $1 uses missing weapon ( $+ %weapon $+ ).
if (!$validate_expression($readini(%file_path, n, weapons, %weapon))) continue
if ($readini(%file_path, weapons, %weapon) !isnum) /log_issue Minor %category $+ $1 $+ 's weapon level for %weapon is not a number; it will be zeroed.
}
; Check the skills.
var %i = 0
var %count = $ini(%file_path, skills, 0)
while (%i < %count) {
inc %i
var %skill = $ini(%file_path, skills, %i)
if (;* iswm %skill) continue
if ((. isin %skill) || (%skill isin CoverTarget.shadowcopy_name.Summon.resist-weaponlock.Singing.Resist-Disarm.Flying)) continue
if (%skill isin CocoonEvolve.MonsterConsume.Snatch.MagicShift.DemonPortal.MonsterSummon.RepairNaturalArmor.ChangeBattlefield.Quicksilver) noop
else if (%skill == Resist-Paralyze) continue
else if (%skill == Wizardy) continue
else if (Resist- isin %skill) {
var %status_resisted = $gettok(%skill, 2-, 45)
if (%status_resisted !isin stop.poison.silence.blind.drunk.virus.amnesia.paralysis.zombie.slow.stun.curse.charm.intimidate.defensedown.strengthdown.intdown.petrify.bored.confuse.sleep) $&
var %missing_resists = $addtok(%missing_resists, Resist- $+ %status_resisted, 46)
}
else if (-killer isin %skill) continue
else if ((!$read($lstfile(skills_passive.lst), w, %skill)) && (!$read($lstfile(skills_active.lst), w, %skill)) && (!$read($lstfile(skills_killertraits.lst), w, %skill))) $&
var %missing_skills = $addtok(%missing_skills, %skill, 46)
if (!$validate_expression($readini(%file_path, n, skills, %weapon))) continue
if ($readini(%file_path, skills, %skill) !isnum) log_issue Minor %category $+ $1 $+ 's skill level for %skill is not a number; it will be zeroed.
}
if (%missing_skills) log_issue Moderate %category $+ $1 uses missing skill(s) $replace(%missing_skills, ., $chr(44) $+ $chr(32)) $+ ; it might not work.
if (%missing_resists) log_issue Moderate %category $+ $1 uses invalid resistance(s) $replace(%missing_resists, ., $chr(44) $+ $chr(32)) $+ ; it will not work.
unset %missing_skills | unset %missing_resists
if ($readini(%file_path, skills, CoverTarget)) log_issue Moderate %category $+ $1 has an initial Cover target. This is inadvisable.
if ($readini(%file_path, skills, provoke.target)) log_issue Moderate %category $+ $1 has an initial Provoke target. This is inadvisable.
if ($readini(%file_path, skills, royalguard.on)) if ($readini(%file_path, skills, royalguard.on) !isin on.off) log_issue Minor %category $+ $1 has an initial royalguard.on field, but it isn't 'on'; it will be ignored.
if ($readini(%file_path, skills, manawall.on)) if ($readini(%file_path, skills, manawall.on) !isin on.off) log_issue Minor %category $+ $1 has an initial manawall.on field, but it isn't 'on'; it will be ignored.
if ($readini(%file_path, skills, doubleturn.on)) if ($readini(%file_path, skills, doubleturn.on) !isin on.off) log_issue Minor %category $+ $1 has an initial doubleturn.on field, but it isn't 'on'; it will be ignored.
if ($readini(%file_path, skills, mightystrike.on)) if ($readini(%file_path, skills, mightystrike.on) !isin on.off) log_issue Minor %category $+ $1 has an initial mightystrike.on field, but it isn't 'on'; it will be ignored.
if ($readini(%file_path, skills, konzen-ittai.on)) if ($readini(%file_path, skills, konzen-ittai.on) !isin on.off) log_issue Minor %category $+ $1 has an initial konzen-ittai.on field, but it isn't 'on'; it will be ignored.
if ($readini(%file_path, skills, elementalseal.on)) if ($readini(%file_path, skills, elementalseal.on) !isin on.off) log_issue Minor %category $+ $1 has an initial elementalseal.on field, but it isn't 'on'; it will be ignored.
if ($readini(%file_path, skills, utsusemi.on)) if ($readini(%file_path, skills, utsusemi.on) !isin on.off) log_issue Minor %category $+ $1 has an initial utsusemi.on field, but it isn't 'on'; it will be ignored.
; Make sure its Monster Summon data is valid.
if ($readini(%file_path, skills, monstersummon)) {
if (!$readini(%file_path, skills, monstersummon.chance)) log_issue Moderate %category $+ $1 has no monstersummon.chance field; it won't use the skill.
if (!$readini(%file_path, skills, monstersummon.numberspawn)) log_issue Moderate %category $+ $1 has no monstersummon.numberspawn field; it won't use the skill.
if (!$readini(%file_path, skills, monstersummon.monster)) log_issue Moderate %category $+ $1 has no monstersummon.monster field; it won't use the skill.
}
if ($readini(%file_path, skills, monstersummon.chance)) {
if ($!char !isin $readini(%file_path, n, skills, monstersummon.chance)) {
if ($readini(%file_path, skills, monstersummon.chance) !isnum) log_issue Moderate %category $+ $1 $+ 's monstersummon.chance field is not a number; it won't use the skill.
else if ($readini(%file_path, skills, monstersummon.chance) < 1) log_issue Moderate %category $+ $1 $+ 's monstersummon.chance field is not within the valid range (1-100); it won't use the skill.
else if ($readini(%file_path, skills, monstersummon.chance) > 100) log_issue Minor %category $+ $1 $+ 's monstersummon.chance field is not within the valid range (1-100).
}
if ($readini(%file_path, n, skills, monstersummon) = $null) log_issue Moderate %category $+ $1 has a monstersummon.chance field, but does not know the Monster Summon skill.
}
if ($readini(%file_path, skills, monstersummon.numberspawn)) {
if ($!char !isin $readini(%file_path, n, skills, monstersummon.numberspawn)) {
if ($readini(%file_path, skills, monstersummon.numberspawn) !isnum) log_issue Moderate %category $+ $1 $+ 's monstersummon.numberspawn field is not a number; it won't use the skill.
}
if ($readini(%file_path, n, skills, monstersummon) = $null) log_issue Moderate %category $+ $1 has a monstersummon.numberspawn field, but does not know the Monster Summon skill.
}
if ($readini(%file_path, skills, monstersummon.monster)) if (!$isfile($mon($readini(%file_path, skills, monstersummon.monster)))) log_issue Moderate %category $+ $1 's monstersummon.monster field references missing monster $readini(%file_path, skills, monstersummon.monster) $+ ; the skill won't work.
; Make sure the Change Battlefield data is valid.
if ($readini(%file_path, skills, ChangeBattlefield.chance)) {
if ($!char !isin $readini(%file_path, n, skills, ChangeBattlefield.chance)) {
if ($readini(%file_path, skills, ChangeBattlefield.chance) !isnum) log_issue Moderate %category $+ $1 $+ 's ChangeBattlefield.chance field is not a number; it won't use the skill.
else if ($readini(%file_path, skills, ChangeBattlefield.chance) < 1) log_issue Moderate %category $+ $1 $+ 's ChangeBattlefield.chance field is not within the valid range (1-100); it won't use the skill.
else if ($readini(%file_path, skills, ChangeBattlefield.chance) > 100) log_issue Minor %category $+ $1 $+ 's ChangeBattlefield.chance field is not within the valid range (1-100).
}
if ($readini(%file_path, n, skills, ChangeBattlefield) = $null) log_issue Moderate %category $+ $1 has a ChangeBattlefield.chance field, but does not know the Change Battlefield skill.
}
if ($readini(%file_path, skills, ChangeBattlefield.battlefields)) {
var %battlefields = $readini(%file_path, skills, ChangeBattlefield.battlefields)
var %total_battlefields = $numtok(%battlefields,46)
var %battlefield = 1
while (%battlefield <= %total_battlefields) {
var %battlefield_name = $gettok(%battlefields, %battlefield, 46)
if (!$ini($dbfile(battlefields.db), %battlefield_name)) log_issue Moderate %category $+ $1 $+ 's ChangeBattlefield.battlefields field includes undefined battlefield %battlefield_name $+ .
inc %battlefield
}
}
else if ($readini(%file_path, n, Skills, ChangeBattlefield) != $null) log_issue Moderate %category $+ $1 has the Change Battlefield skill, but no ChangeBattlefield.battlefields list.
if ($readini(%file_path, n, Skills, RepairNaturalArmor) != $null) {
if (!$ini(%file_path, NaturalArmor)) log_issue Moderate %category $+ $1 has the Repair Natural Armor skill, but no natural armor.
}
; Check the techniques.
var %i = 0
var %count = $ini(%file_path, Techniques, 0)
while (%i < %count) {
inc %i
var %technique = $ini(%file_path, Techniques, %i)
if (;* iswm %technique) continue
if (!$ini($dbfile(techniques.db), %technique)) log_issue Minor %category $+ $1 has missing technique %technique $+ .
if (!$validate_expression($readini(%file_path, n, Techniques, %technique))) continue
if ($readini(%file_path, Techniques, %technique) !isnum) log_issue Minor %category $+ $1 $+ 's technique level for %technique is not a number; it won't use the technique.
}
; Check the modifiers.
var %absorb = $readini(%file_path, Modifiers, Heal)
if ((%absorb != $null) && (%absorb != none)) {
var %i = 0
var %count = $numtok(%absorb, 46)
while (%i < %count) {
inc %i
var %modifier = $gettok(%absorb, %i, 46)
if ((. isin %modifier) || (%modifier !isin fire.ice.earth.wind.lightning.water.light.dark)) var %bad_absorbs $addtok(%bad_absorbs, %modifier, 46)
}
}
var %weakness = $readini(%file_path, Weapons, Weakness)
if ((%weakness != $null) && (%weakness != none)) {
var %i = 0
var %count = $numtok(%weakness, 46)
while (%i < %count) {
inc %i
var %modifier = $gettok(%weakness, %i, 46)
if (. isin %modifier) noop
else if (%modifier isin fire.ice.earth.wind.lightning.water.light.dark || ($isweapontype(%modifier))) continue
else if ($ini($dbfile(weapons.db), %modifier)) continue
else if ($ini($dbfile(techniques.db), %modifier)) continue
else if ($ini($dbfile(items.db), %modifier)) continue
var %bad_weaknesses = $addtok(%bad_weaknesses, %modifier, 46)
}
}
var %strong = $readini(%file_path, Weapons, Strong)
if ((%strong != $null) && (%strong != none)) {
var %i = 0
var %count = $numtok(%strong, 46)
while (%i < %count) {
inc %i
var %modifier = $gettok(%strong, %i, 46)
if (. isin %modifier) noop
else if (%modifier isin fire.ice.earth.wind.lightning.water.light.dark || ($isweapontype(%modifier))) continue
else if ($ini($dbfile(weapons.db), %modifier)) continue
else if ($ini($dbfile(techniques.db), %modifier)) continue
else if ($ini($dbfile(items.db), %modifier)) continue
var %bad_strengths = $addtok(%bad_strengths, %modifier, 46)
}
}
if (%bad_absorbs) log_issue Minor %category $+ $1 $+ 's absorb list includes unrecognised element(s) $replace(%bad_absorbs, ., $chr(44) $+ $chr(32)) $+ . (Only elements can be used here.)
if (%bad_weaknesses) log_issue Minor %category $+ $1 $+ 's weakness list includes unrecognised modifier(s) $replace(%bad_weaknesses, ., $chr(44) $+ $chr(32)) $+ .
if (%bad_strengths) log_issue Minor %category $+ $1 $+ 's strength list includes unrecognised modifier(s) $replace(%bad_strengths, ., $chr(44) $+ $chr(32)) $+ .
unset %bad_*
var %i = 0
var %count = $ini(%file_path, Modifiers, 0)
while (%i < %count) {
inc %i
var %modifier = $ini(%file_path, Modifiers, %i)
if (;* iswm %modifier) continue
if (%modifier == Heal) continue
if ($validate_expression($readini(%file_path, n, Modifiers, %modifier))) {
var %modifier_value = $readini(%file_path, Modifiers, %modifier)
if (%modifier_value !isnum) log_issue Minor %category $+ $1 $+ 's %modifier modifier value is not a number; these attacks will have no effect.
else if (%modifier_value < 0) log_issue Minor %category $+ $1 $+ 's %modifier modifier value is less than 0; these attacks will have no effect.
}
if ((. !isin %modifier) && ($iselementmodifier(%modifier) || ($isweapontype(%modifier)))) continue
if ($ini($dbfile(techniques.db), %modifier)) continue
if ($ini($dbfile(weapons.db), %modifier)) continue
if ($ini($dbfile(items.db), %modifier)) continue
log_issue Minor %category $+ $1 references unrecognised modifier %modifier $+ . Use an element, weapon type, weapon or technique name.
}
return
:error
log_issue Critical Checking %category $+ $1 failed: $error
reseterror
}
monster_get_hp {
; Retrieves a monster's HP.
; $1 : The monster's name.
; $2 : $null
; $3 : 1
; Output to %hp : The monster's base HP.
; Check the BattleStats flag.
if ($readini(%file_path, info, BattleStats) = ignoreHP) return
; Further checking will be done in $monster_get_attributes
set %hp $readini(%file_path, BaseStats, HP)
if (!$validate_expression($readini(%file_path, n, BaseStats, HP))) set %hp 0
}
monster_get_attributes {
; Retrieves a monster's attributes (STR, DEF, INT, SPD).
; $1 : The monster's name.
; $2 : 1
; $3 : $null
; Output to %str, %def, %int, %spd : The attributes.
; Check the BattleStats flag.
if ($readini(%file_path, info, BattleStats) = ignore) return
if ($readini(%file_path, info, BattleStats) != $null && $readini(%file_path, info, BattleStats) != ignoreHP) /log_issue Moderate %category $+ $1 $+ 's Info-BattleStats field is specified, but not as 'ignore'; the monster will be boosted as normal.
; We ignore the check if the value contains $char
set %str $readini(%file_path, BaseStats, Str)
if (!$validate_expression($readini(%file_path, n, BaseStats, Str))) set %str 0
set %def $readini(%file_path, BaseStats, Def)
if (!$validate_expression($readini(%file_path, n, BaseStats, Def))) set %def 0
set %int $readini(%file_path, BaseStats, Int)
if (!$validate_expression($readini(%file_path, n, BaseStats, Int))) set %int 0
set %spd $readini(%file_path, BaseStats, Spd)
if (!$validate_expression($readini(%file_path, n, BaseStats, Spd))) set %spd 0
}
validate_expression {
; Checks whether an expression can be checked. If the expression contains the $char function
; or references any battle txt files, it cannot be checked fully.
; $1-: The expression to check.
if ($!char isin $1-) return $false
if ($!dungeon.haukke.lampcount isin $1-) return $false
if (battle.txt isin $1-) return $false
if (battle2.txt isin $1-) return $false
return $true
}
iselementmodifier {
; Checks whether a modifier is an element modifier (possibly with a + prefix).
; $1: The modifier name to check.
if ($1 isin fire.ice.earth.wind.lightning.water.light.dark) return $true
if ($left($1, 1) == + && $mid($1, 2) isin fire.ice.earth.wind.lightning.water.light.dark) return $true
return $false
}
check_weapons {
; Checks weapons.
; No parameters.
if ($isid) return
window @issues
; Check the weapon lists and make sure there's nothing missing.
titlebar Battle Arena $battle.version — Checking weapon lists...
var %i = 0
var %lcount = $ini(weapons.db, weapons, 0)
while (%i < %lcount) {
inc %i
var %list = $ini(weapons.db, weapons, %i)
var %j = 0
var %count = $numtok($readini(weapons.db, weapons, %list),46)
while (%j < %count) {
inc %j
var %weapon = $gettok($readini(weapons.db, weapons, %list), %j, 46)
if (!$ini(weapons.db, %weapon)) var %missing_weapons $addtok(%missing_weapons, %weapon, 46)
}
if (%missing_weapons) log_issue Moderate Weapon list %list references missing weapon(s) %missing_weapons $+ .
unset %missing_weapons
}
; Check the technique lists in techniques.db.
titlebar Battle Arena $battle.version � Checking weapon technique lists...
var %i = 0
var %count = $ini($dbfile(techniques.db), Techs, 0)
while (%i < %count) {
inc %i
var %weapon_name = $ini($dbfile(techniques.db), Techs, %i)
var %weapon_techniques = $readini($dbfile(techniques.db), Techs, %weapon_name)
if (;* iswm %weapon_name) continue
var %total_techniques2 = $numtok(%weapon_techniques, 46)
var %current_technique = 0
while (%current_technique < %total_techniques2) {
inc %current_technique
var %technique_name = $gettok(%weapon_techniques, %current_technique, 46)
if (!$ini($dbfile(techniques.db), %technique_name)) log_issue Minor Technique list for %weapon_name has missing technique %technique_name $+ .
}
}
; Now check each weapon.
set %total_weapons $ini($dbfile(weapons.db), 0)
var %current_weapon = 0
while (%current_weapon < %total_weapons) {
inc %current_weapon
var %weapon_name = $ini($dbfile(weapons.db), %current_weapon)
if (%weapon_name == Weapons) continue
if (%weapon_name == WeaponDisplayTitles) continue
if (%weapon_name == Shields) continue
if (%weapon_name == ExampleWeapon) continue
titlebar Battle Arena $battle.version � Checking weapon %current_weapon / %total_weapons : %weapon_name ...
; Spaces and = can't be in weapon names.
if (($chr(32) isin %weapon_name) || (= isin %weapon_name)) log_issue Moderate Weapon %weapon_name has an invalid name: the weapon will be unusable.
; Weapon cost
var %weapon_cost = $readini($dbfile(weapons.db), %weapon_name, Cost)
if (%weapon_cost != $null && (%weapon_cost !isnum)) log_issue Moderate Weapon %weapon_name $+ 's cost is not a number; it cannot be bought or used by players.
; Base power
var %weapon_power = $readini($dbfile(weapons.db), p, %weapon_name, BasePower)
if (%weapon_power !isnum) log_issue Moderate Weapon %weapon_name $+ 's power is not a number: power will be zeroed.
; Weapon type
var %weapon_type = $readini($dbfile(weapons.db), %weapon_name, Type)
if (%weapon_type == Shield) {
check_shield %weapon_name
continue
}
if (!$isfile($txtfile(attack_ $+ %weapon_type $+ .txt))) $&
log_issue Minor Weapon %weapon_name has an unknown type ( $+ %weapon_type $+ ).
; Special flag
var %weapon_special = $readini($dbfile(weapons.db), %weapon_name, SpecialWeapon)
if (%weapon_special != $null && %weapon_special != true && %weapon_special != false) log_issue Moderate Weapon %weapon_name $+ 's special field is specified, but not as 'true': the weapon will be treated as one-handed.
; Weapon techniques
var %weapon_techniques = $readini($dbfile(weapons.db), %weapon_name, Abilities)
var %total_techniques2 = $numtok(%weapon_techniques, 46)
var %current_technique = 0
while (%current_technique < %total_techniques2) {
inc %current_technique
var %technique_name = $gettok(%weapon_techniques, %current_technique, 46)
if (!$ini($dbfile(techniques.db), %technique_name)) log_issue Minor Weapon %weapon_name has missing technique %technique_name $+ .
}
; Make sure the weapon is in techniques.db if it has techniques.
if ((%total_techniques2 > 0) && (!$ini($dbfile(techniques.db), Techs, %weapon_name))) $&
log_issue Moderate Weapon %weapon_name is missing from techniques.db!
; Element
var %weapon_element = $readini($dbfile(weapons.db), %weapon_name, Element)
if ((%weapon_element) && (. isin %weapon_element || %weapon_element !isin none.fire.water.ice.lightning.wind.earth.light.dark)) $&
log_issue Minor Weapon %weapon_name uses an unknown element ( $+ %weapon_element $+ ): it will be unaffected by weather.
; Number of hits
var %weapon_hits = $readini($dbfile(weapons.db), %weapon_name, Hits)
if ((%weapon_hits) && (%weapon_hits !isnum)) log_issue Minor Weapon %weapon_name $+ 's number of hits is not a number: it will be zeroed.
; Upgrade cost
if ((!$read($lstfile(items_mech.lst), w, %weapon_name)) && (%weapon_cost isnum) && (%weapon_cost != 0)) {
var %weapon_upgradecost = $readini($dbfile(weapons.db), p, %weapon_name, Upgrade)
if (%weapon_upgradecost !isnum) log_issue Major Weapon %weapon_name $+ 's upgrade cost is not a number: it will cost zero.
else if (%weapon_upgradecost <= 0) log_issue Major Weapon %weapon_name $+ 's upgrade cost is not positive!
}
; Piercing ability
var %weapon_piercing = $readini($dbfile(weapons.db), %weapon_name, IgnoreDefense)
if ((%weapon_piercing) && (%weapon_piercing !isnum)) log_issue Moderate Weapon %weapon_name $+ 's ignore defense is not a number: it will be zeroed.
else if (%weapon_piercing > 0 && %weapon_piercing < 1) log_issue Minor Weapon %weapon_name $+ 's ignore defense is a decimal where a percentage (0-100) is expected.
; Hurt ethereal flag
var %weapon_ethereal = $readini($dbfile(weapons.db), %weapon_name, HurtEthereal)
if (%weapon_ethereal != $null && %weapon_ethereal != true && %weapon_ethereal != false) log_issue Minor Weapon %weapon_name $+ 's hurt ethereal field is specified, but not as 'true': field will be ignored.
; Two-handed flag
var %weapon_twohanded = $readini($dbfile(weapons.db), %weapon_name, 2Handed)
if (%weapon_twohanded != $null && %weapon_twohanded != true && %weapon_twohanded != false) log_issue Minor Weapon %weapon_name $+ 's two-handed field is specified, but not as 'true': the weapon will be treated as one-handed.
; Mech energy cost
var %weapon_energycost = $readini($dbfile(weapons.db), %weapon_name, EnergyCost)
if ((%weapon_energycost) && (%weapon_energycost !isnum)) log_issue Moderate Weapon %weapon_name $+ 's energy cost is not a number; it will use 100 energy per turn.
; Reflect flag
var %weapon_reflect = $readini($dbfile(weapons.db), %weapon_name, CanShieldReflect)
if (%weapon_reflect != $null && %weapon_reflect != true && %weapon_reflect != false) log_issue Minor Weapon %weapon_name $+ 's reflect field is specified, but not as 'true': field will be ignored.
; Counter flag
var %weapon_counter = $readini($dbfile(weapons.db), %weapon_name, CanCounter)
if (%weapon_counter != $null && %weapon_counter != true && %weapon_counter != false) log_issue Minor Weapon %weapon_name $+ 's counter field is specified, but not as 'true': field will be ignored.
; Special effect
var %weapon_specialeffect = $readini($dbfile(weapons.db), %weapon_name, Special)
if (%weapon_specialeffect != $null && %weapon_specialeffect != GemConvert) log_issue Minor Weapon %weapon_name has an unknown special effect ( $+ %weapon_specialeffect $+ ).
; Target type
var %weapon_target = $readini($dbfile(weapons.db), %weapon_name, Target)
if (%weapon_target != $null && %weapon_target != AoE) log_issue Minor Weapon %weapon_name has an unknown target type ( $+ %weapon_target $+ ).
; Status effect
var %weapon_status = $readini($dbfile(weapons.db), %weapon_name, StatusType)
if (%weapon_status != $null) check_statuseffects %weapon_status Weapon $+ %weapon_name $+
continue
:error
log_issue Critical Checking weapon %weapon_name failed: $error
reseterror
}
if (%issues_total == 0) echo -a 12Checked $calc(%current_weapon - 1) weapons and found no issues. Yay!
else echo -a 12Checked $calc(%current_weapon - 1) weapons and found %issues_total $+ $iif(%issues_total == 1, issue, issues) $+ .
}
check_shield {
; Checks an individual shield definition for errors.
; $1 : The name of the shield.
if ($isid) return
; Block chance
var %weapon_blockchance = $readini($dbfile(weapons.db), $1, BlockChance)
if (%weapon_blockchance !isnum) log_issue Moderate Shield $1 $+ 's block chance is not a number: it will be useless.
else if (%weapon_blockchance > 0 && %weapon_blockchance < 1) log_issue Minor Shield $1 $+ 's block chance is a decimal where a percentage (0-100) is expected.
; Block amount
var %weapon_blockamount = $readini($dbfile(weapons.db), $1, AbsorbAmount)
if (%weapon_blockamount !isnum) log_issue Moderate Shield $1 $+ 's block amount is not a number: it will be useless.
else if (%weapon_blockamount > 0 && %weapon_blockamount < 1) log_issue Minor Shield $1 $+ 's block amount is a decimal where a percentage (0-100) is expected.
}
isweapontype {
; Returns $true if the parameter is a weapon type, or $false if it isn't.
return $isfile($txtfile(attack_ $+ $1- $+ .txt))
}
check_statuseffects {
; Checks a list of status effects, to make sure that they all exist.
; $1 : the list of effects
; $2-: the entry being checked
if ($isid) return
if ($1 != $null) {
var %count = $numtok($1, 46)
if (%count >= 1) {
var %i = 1
while (%i <= %count) {
var %current.status.effect = $gettok($1, %i, 46)
if ((%current.status.effect == sleep) && (%old)) $&
log_issue Minor $2- uses the sleep status effect, which may not work in this version of Battle Arena.
else if (%current.status.effect !isin stop.poison.silence.blind.drunk.virus.amnesia.paralysis.zombie.slow.stun.curse.charm.intimidate.defensedown.strengthdown.intdown.petrify.bored.confuse.defenseup.speedup.sleep.random) $&
log_issue Minor $2- uses an invalid status effect ( $+ %current.status.effect $+ )! Use one of: stop, poison, silence, blind, drunk, virus, amnesia, paralysis, zombie, slow, stun, curse, charm, intimidate, defensedown, strengthdown, intdown, petrify, bored, confuse, defenseup, speedup, sleep, random.
inc %i
}
}
}
}
check_armor_lists {
; Checks an armor .lst file to ensure all armor listed are of the correct type.
; $1 : The filename to check, relative to the /lsts folder.
; $2 : The type (equipment slot) of armor that is considered valid.
if ($isid) return
var %total_armor = $lines($lstfile($1))
var %current_armor = 0
while (%current_armor < %total_armor) {
inc %current_armor
set %armor_name $read($lstfile($1), %current_armor)
var %armor_type = $readini($dbfile(equipment.db), %armor_name, EquipLocation)
if (%armor_type) {
if (%armor_type != $2) log_issue Moderate Armor %armor_name is listed in $1 but isn't for the $2 slot.
}
else log_issue Moderate Missing item %armor_name is listed in $1 $+ .
}
}
check_armor {
; Checks armor.
; No parameters.
if ($isid) return
window @issues
; Check armor lists.
check_armor_lists armor_head.lst head
check_armor_lists armor_body.lst body
check_armor_lists armor_hands.lst hands
check_armor_lists armor_legs.lst legs
check_armor_lists armor_feet.lst feet
; Now check each armor piece.
set %total_armor $ini($dbfile(equipment.db), 0)
var %current_armor = 0
while (%current_armor < %total_armor) {
inc %current_armor
var %armor_name = $ini($dbfile(equipment.db), %current_armor)
titlebar Battle Arena $battle.version � Checking armor %current_armor / %total_armor : %armor_name ...
; Spaces and = can't be in armor names.
if (($chr(32) isin %armor_name) || (= isin %armor_name)) log_issue Moderate Armor %armor_name has an invalid name: the armor will be unusable.
; Sell price
var %armor_price = $readini($dbfile(equipment.db), %armor_name, SellPrice)
if (%armor_price == $null) {
var %armor_price = $readini($dbfile(equipment.db), %armor_name, Cost)
}
if (%armor_price == $null) log_issue Minor Armor %armor_name $+ has no sell price.
else if (%armor_price !isnum) log_issue Minor Armor %armor_name $+ 's sell price is not a number.
; Attributes
armor_get_attributes new_chr %armor_name
if (%hp !isnum) log_issue Moderate Armor %armor_name $+ 's HP bonus is not a number.
if (%tp !isnum) log_issue Moderate Armor %armor_name $+ 's TP bonus is not a number.
if (%str !isnum) log_issue Moderate Armor %armor_name $+ 's strength bonus is not a number.
if (%def !isnum) log_issue Moderate Armor %armor_name $+ 's defense bonus is not a number.
if (%int !isnum) log_issue Moderate Armor %armor_name $+ 's intelligence bonus is not a number.
if (%spd !isnum) log_issue Moderate Armor %armor_name $+ 's speed bonus is not a number.
; Augments
var %armor_augments = $readini($dbfile(equipment.db), %armor_name, Augment)
if (%armor_augments && %armor_augments != none) {
var %total_augments = $numtok(%armor_augments, 46), %i = 1
while (%i <= %total_augments) {
var %augment = $gettok(%armor_augments, %i, 46)
if (!$read($lstfile(augments.lst), w, %augment)) log_issue Moderate Armor %armor_name has unknown augment %augment $+ .
inc %i
}
}
; Location
var %armor_location = $readini($dbfile(equipment.db), %armor_name, EquipLocation)
if (%armor_location !isin head.body.hands.legs.feet) log_issue Moderate Armor %armor_name specifies an invalid equipment slot.
continue
:error
log_issue Critical Checking armor %armor_name failed: $error
reseterror
}
if (%issues_total == 0) echo -a 12Checked $calc(%current_armor - 1) armor pieces and found no issues. Yay!
else echo -a 12Checked $calc(%current_armor - 1) armor pieces and found %issues_total $+ $iif(%issues_total == 1, issue, issues) $+ .
}
armor_get_attributes {
; Retrieves an armor piece's attributes (HP, TP, STR, DEF, INT, SPD).
; $1 : new_chr
; $2 : The armor piece
; Output to %hp, %tp, %str, %def, %int, %spd : The attributes.
; We ignore the check if the value contains $char
set %hp $readini($dbfile(equipment.db), $2, Str)
if (!$validate_expression($readini($dbfile(equipment.db), n, $2, Str))) set %hp 0
set %tp $readini($dbfile(equipment.db), $2, Str)
if (!$validate_expression($readini($dbfile(equipment.db), n, $2, Str))) set %tp 0
set %str $readini($dbfile(equipment.db), $2, Str)
if (!$validate_expression($readini($dbfile(equipment.db), n, $2, Str))) set %str 0
set %def $readini($dbfile(equipment.db), $2, Def)
if (!$validate_expression($readini($dbfile(equipment.db), n, $2, Def))) set %def 0
set %int $readini($dbfile(equipment.db), $2, Int)
if (!$validate_expression($readini($dbfile(equipment.db), n, $2, Int))) set %int 0
set %spd $readini($dbfile(equipment.db), $2, Spd)
if (!$validate_expression($readini($dbfile(equipment.db), n, $2, Spd))) set %spd 0
}
log_issue {
; Records an issue message to the window @issues.
; $1 : The severity of the issue: 'Minor', 'Moderate', 'Major' or 'Critical'.
; 'Minor': Something might be missing, but it shouldn't have any significant consequences.
; 'Moderate': Something that will impact players, or that can be exploited.
; 'Major': Something that could potentially have serious side effects, or create a security hole.
; 'Critical': Something that could hang, freeze or crash the bot, or worse.
; $2-: A user-friendly description of the problem.
if ($isid) return
inc %issues_total
if ($1 == Minor ) { aline -p 8 @issues [Minor] $2- }
if ($1 == Moderate) { aline -p 7 @issues [Moderate] $2- }
if ($1 == Major ) { aline -p 4 @issues [Major] $2- | inc %issues_major }
if ($1 == Critical) { aline -p 5 @issues [Critical] $2- | inc %issues_major }
}
noop return
|
src/main/antlr4/io/proleap/cobol/Cobol85.g4 | stawi/cobol85parser | 0 | 6582 | <filename>src/main/antlr4/io/proleap/cobol/Cobol85.g4
/*
* Copyright (C) 2017, <NAME> <<EMAIL>>
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
/*
* COBOL 85 Grammar for ANTLR4
*
* This is a COBOL 85 grammar, which is part of the COBOL parser at
* https://github.com/uwol/cobol85parser.
*
* The grammar passes the NIST test suite and has successfully been applied to
* numerous COBOL files from banking and insurance. To be used in conjunction
* with the provided preprocessor, which executes COPY and REPLACE statements.
*/
grammar Cobol85;
startRule : compilationUnit EOF;
compilationUnit
: programUnit+
;
programUnit
: identificationDivision environmentDivision? dataDivision? procedureDivision? programUnit* endProgramStatement?
;
endProgramStatement
: END PROGRAM programName DOT_FS
;
// --- identification division --------------------------------------------------------------------
identificationDivision
: (IDENTIFICATION | ID) DIVISION DOT_FS programIdParagraph identificationDivisionBody*
;
identificationDivisionBody
: authorParagraph | installationParagraph | dateWrittenParagraph | dateCompiledParagraph | securityParagraph | remarksParagraph
;
// - program id paragraph ----------------------------------
programIdParagraph
: PROGRAM_ID DOT_FS programName (IS? (COMMON | INITIAL | LIBRARY | DEFINITION | RECURSIVE) PROGRAM?)? DOT_FS? commentEntry?
;
// - author paragraph ----------------------------------
authorParagraph
: AUTHOR DOT_FS commentEntry?
;
// - installation paragraph ----------------------------------
installationParagraph
: INSTALLATION DOT_FS commentEntry?
;
// - date written paragraph ----------------------------------
dateWrittenParagraph
: DATE_WRITTEN DOT_FS commentEntry?
;
// - date compiled paragraph ----------------------------------
dateCompiledParagraph
: DATE_COMPILED DOT_FS commentEntry?
;
// - security paragraph ----------------------------------
securityParagraph
: SECURITY DOT_FS commentEntry?
;
// - remarks paragraph ----------------------------------
remarksParagraph
: REMARKS DOT_FS commentEntry? END_REMARKS? DOT_FS?
;
// --- environment division --------------------------------------------------------------------
environmentDivision
: ENVIRONMENT DIVISION DOT_FS environmentDivisionBody*
;
environmentDivisionBody
: configurationSection | specialNamesParagraph | inputOutputSection
;
// -- configuration section ----------------------------------
configurationSection
: CONFIGURATION SECTION DOT_FS configurationSectionParagraph*
;
// - configuration section paragraph ----------------------------------
configurationSectionParagraph
: sourceComputerParagraph | objectComputerParagraph | specialNamesParagraph
// strictly, specialNamesParagraph does not belong into configurationSectionParagraph, but IBM-COBOL allows this
;
// - source computer paragraph ----------------------------------
sourceComputerParagraph
: SOURCE_COMPUTER DOT_FS (computerName (WITH? DEBUGGING MODE)? DOT_FS)?
;
// - object computer paragraph ----------------------------------
objectComputerParagraph
: OBJECT_COMPUTER DOT_FS (computerName objectComputerClause* DOT_FS)?
;
objectComputerClause
: memorySizeClause | diskSizeClause | collatingSequenceClause | segmentLimitClause | characterSetClause
;
memorySizeClause
: MEMORY SIZE? (integerLiteral | cobolWord) (WORDS | CHARACTERS | MODULES)?
;
diskSizeClause
: DISK SIZE? IS? (integerLiteral | cobolWord) (WORDS | MODULES)?
;
collatingSequenceClause
: PROGRAM? COLLATING? SEQUENCE (IS? alphabetName+) collatingSequenceClauseAlphanumeric? collatingSequenceClauseNational?
;
collatingSequenceClauseAlphanumeric
: FOR? ALPHANUMERIC IS? alphabetName
;
collatingSequenceClauseNational
: FOR? NATIONAL IS? alphabetName
;
segmentLimitClause
: SEGMENT_LIMIT IS? integerLiteral
;
characterSetClause
: CHARACTER SET DOT_FS
;
// - special names paragraph ----------------------------------
specialNamesParagraph
: SPECIAL_NAMES DOT_FS (specialNameClause+ DOT_FS)?
;
specialNameClause
: channelClause | odtClause | alphabetClause | classClause | currencySignClause | decimalPointClause | symbolicCharactersClause | environmentSwitchNameClause | defaultDisplaySignClause | defaultComputationalSignClause | reserveNetworkClause
;
alphabetClause
: alphabetClauseFormat1 | alphabetClauseFormat2
;
alphabetClauseFormat1
: ALPHABET alphabetName (FOR ALPHANUMERIC)? IS? (EBCDIC | ASCII | STANDARD_1 | STANDARD_2 | NATIVE | cobolWord | alphabetLiterals+)
;
alphabetLiterals
: literal (alphabetThrough | alphabetAlso+)?
;
alphabetThrough
: (THROUGH | THRU) literal
;
alphabetAlso
: ALSO literal+
;
alphabetClauseFormat2
: ALPHABET alphabetName FOR? NATIONAL IS? (NATIVE | CCSVERSION literal)
;
channelClause
: CHANNEL integerLiteral IS? mnemonicName
;
classClause
: CLASS className (FOR? (ALPHANUMERIC | NATIONAL))? IS? classClauseThrough+
;
classClauseThrough
: classClauseFrom ((THROUGH | THRU) classClauseTo)?
;
classClauseFrom
: identifier | literal
;
classClauseTo
: identifier | literal
;
currencySignClause
: CURRENCY SIGN? IS? literal (WITH? PICTURE SYMBOL literal)?
;
decimalPointClause
: DECIMAL_POINT IS? COMMA
;
defaultComputationalSignClause
: DEFAULT (COMPUTATIONAL | COMP)? (SIGN IS?)? (LEADING | TRAILING)? (SEPARATE CHARACTER?)
;
defaultDisplaySignClause
: DEFAULT_DISPLAY (SIGN IS?)? (LEADING | TRAILING) (SEPARATE CHARACTER?)?
;
environmentSwitchNameClause
: environmentName IS? mnemonicName environmentSwitchNameSpecialNamesStatusPhrase? | environmentSwitchNameSpecialNamesStatusPhrase
;
environmentSwitchNameSpecialNamesStatusPhrase
: ON STATUS? IS? condition (OFF STATUS? IS? condition)? | OFF STATUS? IS? condition (ON STATUS? IS? condition)?
;
odtClause
: ODT IS? mnemonicName
;
reserveNetworkClause
: RESERVE WORDS? LIST? IS? NETWORK CAPABLE?
;
symbolicCharactersClause
: SYMBOLIC CHARACTERS? (FOR? (ALPHANUMERIC | NATIONAL))? symbolicCharacters+ (IN alphabetName)?
;
symbolicCharacters
: symbolicCharacter+ (IS | ARE)? integerLiteral+
;
// -- input output section ----------------------------------
inputOutputSection
: INPUT_OUTPUT SECTION DOT_FS inputOutputSectionParagraph*
;
// - input output section paragraph ----------------------------------
inputOutputSectionParagraph
: fileControlParagraph | ioControlParagraph
;
// - file control paragraph ----------------------------------
fileControlParagraph
: FILE_CONTROL? (DOT_FS? fileControlEntry)* DOT_FS
;
fileControlEntry
: selectClause fileControlClause*
;
selectClause
: SELECT OPTIONAL? fileName
;
fileControlClause
: assignClause | reserveClause | organizationClause | paddingCharacterClause | recordDelimiterClause | accessModeClause | recordKeyClause | alternateRecordKeyClause | fileStatusClause | passwordClause | relativeKeyClause
;
assignClause
: ASSIGN TO? (DISK | DISPLAY | KEYBOARD | PORT | PRINTER | READER | REMOTE | TAPE | VIRTUAL | (DYNAMIC | EXTERNAL)? assignmentName | literal)
;
reserveClause
: RESERVE (NO | integerLiteral) ALTERNATE? (AREA | AREAS)?
;
organizationClause
: (ORGANIZATION IS?)? (LINE | RECORD BINARY | RECORD | BINARY)? (SEQUENTIAL | RELATIVE | INDEXED)
;
paddingCharacterClause
: PADDING CHARACTER? IS? (qualifiedDataName | literal)
;
recordDelimiterClause
: RECORD DELIMITER IS? (STANDARD_1 | IMPLICIT | assignmentName)
;
accessModeClause
: ACCESS MODE? IS? (SEQUENTIAL | RANDOM | DYNAMIC | EXCLUSIVE)
;
recordKeyClause
: RECORD KEY? IS? qualifiedDataName passwordClause? (WITH? DUPLICATES)?
;
alternateRecordKeyClause
: ALTERNATE RECORD KEY? IS? qualifiedDataName passwordClause? (WITH? DUPLICATES)?
;
passwordClause
: PASSWORD IS? dataName
;
fileStatusClause
: FILE? STATUS IS? qualifiedDataName qualifiedDataName?
;
relativeKeyClause
: RELATIVE KEY? IS? qualifiedDataName
;
// - io control paragraph ----------------------------------
ioControlParagraph
: I_O_CONTROL DOT_FS (fileName DOT_FS)? (ioControlClause* DOT_FS)?
;
ioControlClause
: rerunClause | sameClause | multipleFileClause | commitmentControlClause
;
rerunClause
: RERUN (ON (assignmentName | fileName))? EVERY (rerunEveryRecords | rerunEveryOf | rerunEveryClock)
;
rerunEveryRecords
: integerLiteral RECORDS
;
rerunEveryOf
: END? OF? (REEL | UNIT) OF fileName
;
rerunEveryClock
: integerLiteral CLOCK_UNITS?
;
sameClause
: SAME (RECORD | SORT | SORT_MERGE)? AREA? FOR? fileName+
;
multipleFileClause
: MULTIPLE FILE TAPE? CONTAINS? multipleFilePosition+
;
multipleFilePosition
: fileName (POSITION integerLiteral)?
;
commitmentControlClause
: COMMITMENT CONTROL FOR? fileName
;
// --- data division --------------------------------------------------------------------
dataDivision
: DATA DIVISION DOT_FS dataDivisionSection*
;
dataDivisionSection
: fileSection | dataBaseSection | workingStorageSection | linkageSection | communicationSection | localStorageSection | screenSection | reportSection | programLibrarySection
;
// -- file section ----------------------------------
fileSection
: FILE SECTION DOT_FS fileDescriptionEntry*
;
fileDescriptionEntry
: (FD | SD) fileName (DOT_FS? fileDescriptionEntryClause)* DOT_FS dataDescriptionEntry*
;
fileDescriptionEntryClause
: externalClause | globalClause | blockContainsClause | recordContainsClause | labelRecordsClause | valueOfClause | dataRecordsClause | linageClause | codeSetClause | reportClause | recordingModeClause
;
externalClause
: IS? EXTERNAL
;
globalClause
: IS? GLOBAL
;
blockContainsClause
: BLOCK CONTAINS? integerLiteral blockContainsTo? (RECORDS | CHARACTERS)?
;
blockContainsTo
: TO integerLiteral
;
recordContainsClause
: RECORD (recordContainsClauseFormat1 | recordContainsClauseFormat2 | recordContainsClauseFormat3)
;
recordContainsClauseFormat1
: CONTAINS? integerLiteral CHARACTERS?
;
recordContainsClauseFormat2
: IS? VARYING IN? SIZE? (FROM? integerLiteral recordContainsTo? CHARACTERS?)? (DEPENDING ON? qualifiedDataName)?
;
recordContainsClauseFormat3
: CONTAINS? integerLiteral recordContainsTo CHARACTERS?
;
recordContainsTo
: TO integerLiteral
;
labelRecordsClause
: LABEL (RECORD IS? | RECORDS ARE?) (OMITTED | STANDARD | dataName+)
;
valueOfClause
: VALUE OF valuePair+
;
valuePair
: systemName IS? (qualifiedDataName | literal)
;
dataRecordsClause
: DATA (RECORD IS? | RECORDS ARE?) dataName+
;
linageClause
: LINAGE IS? (dataName | integerLiteral) LINES? linageAt*
;
linageAt
: linageFootingAt | linageLinesAtTop | linageLinesAtBottom
;
linageFootingAt
: WITH? FOOTING AT? (dataName | integerLiteral)
;
linageLinesAtTop
: LINES? AT? TOP (dataName | integerLiteral)
;
linageLinesAtBottom
: LINES? AT? BOTTOM (dataName | integerLiteral)
;
recordingModeClause
: RECORDING MODE? IS? modeStatement
;
modeStatement
: cobolWord
;
codeSetClause
: CODE_SET IS? alphabetName
;
reportClause
: (REPORT IS? | REPORTS ARE?) reportName+
;
// -- data base section ----------------------------------
dataBaseSection
: DATA_BASE SECTION DOT_FS dataBaseSectionEntry*
;
dataBaseSectionEntry
: integerLiteral literal INVOKE literal
;
// -- working storage section ----------------------------------
workingStorageSection
: WORKING_STORAGE SECTION DOT_FS dataDescriptionEntry*
;
// -- linkage section ----------------------------------
linkageSection
: LINKAGE SECTION DOT_FS dataDescriptionEntry*
;
// -- communication section ----------------------------------
communicationSection
: COMMUNICATION SECTION DOT_FS (communicationDescriptionEntry | dataDescriptionEntry)*
;
communicationDescriptionEntry
: communicationDescriptionEntryFormat1 | communicationDescriptionEntryFormat2 | communicationDescriptionEntryFormat3
;
communicationDescriptionEntryFormat1
: CD cdName FOR? INITIAL? INPUT ((symbolicQueueClause | symbolicSubQueueClause | messageDateClause | messageTimeClause | symbolicSourceClause | textLengthClause | endKeyClause | statusKeyClause | messageCountClause) | dataDescName)* DOT_FS
;
communicationDescriptionEntryFormat2
: CD cdName FOR? OUTPUT (destinationCountClause | textLengthClause | statusKeyClause | destinationTableClause | errorKeyClause | symbolicDestinationClause)* DOT_FS
;
communicationDescriptionEntryFormat3
: CD cdName FOR? INITIAL I_O ((messageDateClause | messageTimeClause | symbolicTerminalClause | textLengthClause | endKeyClause | statusKeyClause) | dataDescName)* DOT_FS
;
destinationCountClause
: DESTINATION COUNT IS? dataDescName
;
destinationTableClause
: DESTINATION TABLE OCCURS integerLiteral TIMES (INDEXED BY indexName+)?
;
endKeyClause
: END KEY IS? dataDescName
;
errorKeyClause
: ERROR KEY IS? dataDescName
;
messageCountClause
: MESSAGE? COUNT IS? dataDescName
;
messageDateClause
: MESSAGE DATE IS? dataDescName
;
messageTimeClause
: MESSAGE TIME IS? dataDescName
;
statusKeyClause
: STATUS KEY IS? dataDescName
;
symbolicDestinationClause
: SYMBOLIC? DESTINATION IS? dataDescName
;
symbolicQueueClause
: SYMBOLIC? QUEUE IS? dataDescName
;
symbolicSourceClause
: SYMBOLIC? SOURCE IS? dataDescName
;
symbolicTerminalClause
: SYMBOLIC? TERMINAL IS? dataDescName
;
symbolicSubQueueClause
: SYMBOLIC? (SUB_QUEUE_1 | SUB_QUEUE_2 | SUB_QUEUE_3) IS? dataDescName
;
textLengthClause
: TEXT LENGTH IS? dataDescName
;
// -- local storage section ----------------------------------
localStorageSection
: LOCAL_STORAGE SECTION DOT_FS (LD localName DOT_FS)? dataDescriptionEntry*
;
// -- screen section ----------------------------------
screenSection
: SCREEN SECTION DOT_FS screenDescriptionEntry*
;
screenDescriptionEntry
: INTEGERLITERAL (FILLER | screenName)? (screenDescriptionBlankClause | screenDescriptionBellClause | screenDescriptionBlinkClause | screenDescriptionEraseClause | screenDescriptionLightClause | screenDescriptionGridClause | screenDescriptionReverseVideoClause | screenDescriptionUnderlineClause | screenDescriptionSizeClause | screenDescriptionLineClause | screenDescriptionColumnClause | screenDescriptionForegroundColorClause | screenDescriptionBackgroundColorClause | screenDescriptionControlClause | screenDescriptionValueClause | screenDescriptionPictureClause | (screenDescriptionFromClause | screenDescriptionUsingClause) | screenDescriptionUsageClause | screenDescriptionBlankWhenZeroClause | screenDescriptionJustifiedClause | screenDescriptionSignClause | screenDescriptionAutoClause | screenDescriptionSecureClause | screenDescriptionRequiredClause | screenDescriptionPromptClause | screenDescriptionFullClause | screenDescriptionZeroFillClause)* DOT_FS
;
screenDescriptionBlankClause
: BLANK (SCREEN | LINE)
;
screenDescriptionBellClause
: BELL | BEEP
;
screenDescriptionBlinkClause
: BLINK
;
screenDescriptionEraseClause
: ERASE (EOL | EOS)
;
screenDescriptionLightClause
: HIGHLIGHT | LOWLIGHT
;
screenDescriptionGridClause
: GRID | LEFTLINE | OVERLINE
;
screenDescriptionReverseVideoClause
: REVERSE_VIDEO
;
screenDescriptionUnderlineClause
: UNDERLINE
;
screenDescriptionSizeClause
: SIZE IS? (identifier | integerLiteral)
;
screenDescriptionLineClause
: LINE (NUMBER? IS? (PLUS | PLUSCHAR | MINUSCHAR))? (identifier | integerLiteral)
;
screenDescriptionColumnClause
: (COLUMN | COL) (NUMBER? IS? (PLUS | PLUSCHAR | MINUSCHAR))? (identifier | integerLiteral)
;
screenDescriptionForegroundColorClause
: (FOREGROUND_COLOR | FOREGROUND_COLOUR) IS? (identifier | integerLiteral)
;
screenDescriptionBackgroundColorClause
: (BACKGROUND_COLOR | BACKGROUND_COLOUR) IS? (identifier | integerLiteral)
;
screenDescriptionControlClause
: CONTROL IS? identifier
;
screenDescriptionValueClause
: (VALUE IS?) literal
;
screenDescriptionPictureClause
: (PICTURE | PIC) IS? pictureString
;
screenDescriptionFromClause
: FROM (identifier | literal) screenDescriptionToClause?
;
screenDescriptionToClause
: TO identifier
;
screenDescriptionUsingClause
: USING identifier
;
screenDescriptionUsageClause
: (USAGE IS?) (DISPLAY | DISPLAY_1)
;
screenDescriptionBlankWhenZeroClause
: BLANK WHEN? ZERO
;
screenDescriptionJustifiedClause
: (JUSTIFIED | JUST) RIGHT?
;
screenDescriptionSignClause
: (SIGN IS?)? (LEADING | TRAILING) (SEPARATE CHARACTER?)?
;
screenDescriptionAutoClause
: AUTO | AUTO_SKIP
;
screenDescriptionSecureClause
: SECURE | NO_ECHO
;
screenDescriptionRequiredClause
: REQUIRED | EMPTY_CHECK
;
screenDescriptionPromptClause
: PROMPT CHARACTER? IS? (identifier | literal) screenDescriptionPromptOccursClause?
;
screenDescriptionPromptOccursClause
: OCCURS integerLiteral TIMES?
;
screenDescriptionFullClause
: FULL | LENGTH_CHECK
;
screenDescriptionZeroFillClause
: ZERO_FILL
;
// -- report section ----------------------------------
reportSection
: REPORT SECTION DOT_FS reportDescription*
;
reportDescription
: reportDescriptionEntry reportGroupDescriptionEntry+
;
reportDescriptionEntry
: RD reportName reportDescriptionGlobalClause? (reportDescriptionPageLimitClause reportDescriptionHeadingClause? reportDescriptionFirstDetailClause? reportDescriptionLastDetailClause? reportDescriptionFootingClause?)? DOT_FS
;
reportDescriptionGlobalClause
: IS? GLOBAL
;
reportDescriptionPageLimitClause
: PAGE (LIMIT IS? | LIMITS ARE?)? integerLiteral (LINE | LINES)?
;
reportDescriptionHeadingClause
: HEADING integerLiteral
;
reportDescriptionFirstDetailClause
: FIRST DETAIL integerLiteral
;
reportDescriptionLastDetailClause
: LAST DETAIL integerLiteral
;
reportDescriptionFootingClause
: FOOTING integerLiteral
;
reportGroupDescriptionEntry
: reportGroupDescriptionEntryFormat1 | reportGroupDescriptionEntryFormat2 | reportGroupDescriptionEntryFormat3
;
reportGroupDescriptionEntryFormat1
: integerLiteral dataName reportGroupLineNumberClause? reportGroupNextGroupClause? reportGroupTypeClause reportGroupUsageClause? DOT_FS
;
reportGroupDescriptionEntryFormat2
: integerLiteral dataName? reportGroupLineNumberClause? reportGroupUsageClause DOT_FS
;
reportGroupDescriptionEntryFormat3
: integerLiteral dataName? (reportGroupPictureClause | reportGroupUsageClause | reportGroupSignClause | reportGroupJustifiedClause | reportGroupBlankWhenZeroClause | reportGroupLineNumberClause | reportGroupColumnNumberClause | (reportGroupSourceClause | reportGroupValueClause | reportGroupSumClause | reportGroupResetClause) | reportGroupIndicateClause)* DOT_FS
;
reportGroupBlankWhenZeroClause
: BLANK WHEN? ZERO
;
reportGroupColumnNumberClause
: COLUMN NUMBER? IS? integerLiteral
;
reportGroupIndicateClause
: GROUP INDICATE?
;
reportGroupJustifiedClause
: (JUSTIFIED | JUST) RIGHT?
;
reportGroupLineNumberClause
: LINE? NUMBER? IS? (reportGroupLineNumberNextPage | reportGroupLineNumberPlus)
;
reportGroupLineNumberNextPage
: integerLiteral (ON? NEXT PAGE)?
;
reportGroupLineNumberPlus
: PLUS integerLiteral
;
reportGroupNextGroupClause
: NEXT GROUP IS? (integerLiteral | reportGroupNextGroupNextPage | reportGroupNextGroupPlus)
;
reportGroupNextGroupPlus
: PLUS integerLiteral
;
reportGroupNextGroupNextPage
: NEXT PAGE
;
reportGroupPictureClause
: (PICTURE | PIC) IS? pictureString
;
reportGroupResetClause
: RESET ON? (FINAL | dataName)
;
reportGroupSignClause
: SIGN IS? (LEADING | TRAILING) SEPARATE CHARACTER?
;
reportGroupSourceClause
: SOURCE IS? identifier
;
reportGroupSumClause
: SUM identifier (COMMACHAR? identifier)* (UPON dataName (COMMACHAR? dataName)*)?
;
reportGroupTypeClause
: TYPE IS? (reportGroupTypeReportHeading | reportGroupTypePageHeading | reportGroupTypeControlHeading | reportGroupTypeDetail | reportGroupTypeControlFooting | reportGroupTypePageFooting | reportGroupTypeReportFooting)
;
reportGroupTypeReportHeading
: REPORT HEADING | RH
;
reportGroupTypePageHeading
: PAGE HEADING | PH
;
reportGroupTypeControlHeading
: (CONTROL HEADING | CH) (FINAL | dataName)
;
reportGroupTypeDetail
: DETAIL | DE
;
reportGroupTypeControlFooting
: (CONTROL FOOTING | CF) (FINAL | dataName)
;
reportGroupUsageClause
: (USAGE IS?)? (DISPLAY | DISPLAY_1)
;
reportGroupTypePageFooting
: PAGE FOOTING | PF
;
reportGroupTypeReportFooting
: REPORT FOOTING | RF
;
reportGroupValueClause
: VALUE IS? literal
;
// -- program library section ----------------------------------
programLibrarySection
: PROGRAM_LIBRARY SECTION DOT_FS libraryDescriptionEntry*
;
libraryDescriptionEntry
: libraryDescriptionEntryFormat1 | libraryDescriptionEntryFormat2
;
libraryDescriptionEntryFormat1
: LD libraryName EXPORT libraryAttributeClauseFormat1? libraryEntryProcedureClauseFormat1?
;
libraryDescriptionEntryFormat2
: LB libraryName IMPORT libraryIsGlobalClause? libraryIsCommonClause? (libraryAttributeClauseFormat2 | libraryEntryProcedureClauseFormat2)*
;
libraryAttributeClauseFormat1
: ATTRIBUTE (SHARING IS? (DONTCARE | PRIVATE | SHAREDBYRUNUNIT | SHAREDBYALL))?
;
libraryAttributeClauseFormat2
: ATTRIBUTE libraryAttributeFunction? (LIBACCESS IS? (BYFUNCTION | BYTITLE))? libraryAttributeParameter? libraryAttributeTitle?
;
libraryAttributeFunction
: FUNCTIONNAME IS literal
;
libraryAttributeParameter
: LIBPARAMETER IS? literal
;
libraryAttributeTitle
: TITLE IS? literal
;
libraryEntryProcedureClauseFormat1
: ENTRY_PROCEDURE programName libraryEntryProcedureForClause?
;
libraryEntryProcedureClauseFormat2
: ENTRY_PROCEDURE programName libraryEntryProcedureForClause? libraryEntryProcedureWithClause? libraryEntryProcedureUsingClause? libraryEntryProcedureGivingClause?
;
libraryEntryProcedureForClause
: FOR literal
;
libraryEntryProcedureGivingClause
: GIVING dataName
;
libraryEntryProcedureUsingClause
: USING libraryEntryProcedureUsingName+
;
libraryEntryProcedureUsingName
: dataName | fileName
;
libraryEntryProcedureWithClause
: WITH libraryEntryProcedureWithName+
;
libraryEntryProcedureWithName
: localName | fileName
;
libraryIsCommonClause
: IS? COMMON
;
libraryIsGlobalClause
: IS? GLOBAL
;
// data description entry ----------------------------------
dataDescriptionEntry
: dataDescriptionEntryFormat1 | dataDescriptionEntryFormat2 | dataDescriptionEntryFormat3 | dataDescriptionEntryExecSql
;
dataDescriptionEntryFormat1
: (INTEGERLITERAL | LEVEL_NUMBER_77) (FILLER | dataName)? (dataRedefinesClause | dataIntegerStringClause | dataExternalClause | dataGlobalClause | dataTypeDefClause | dataThreadLocalClause | dataPictureClause | dataCommonOwnLocalClause | dataTypeClause | dataUsingClause | dataUsageClause | dataValueClause | dataReceivedByClause | dataOccursClause | dataSignClause | dataSynchronizedClause | dataJustifiedClause | dataBlankWhenZeroClause | dataWithLowerBoundsClause | dataAlignedClause | dataRecordAreaClause)* DOT_FS
;
dataDescriptionEntryFormat2
: LEVEL_NUMBER_66 dataName dataRenamesClause DOT_FS
;
dataDescriptionEntryFormat3
: LEVEL_NUMBER_88 conditionName dataValueClause DOT_FS
;
dataDescriptionEntryExecSql
: EXECSQLLINE+ DOT_FS?
;
dataAlignedClause
: ALIGNED
;
dataBlankWhenZeroClause
: BLANK WHEN? (ZERO | ZEROS | ZEROES)
;
dataCommonOwnLocalClause
: COMMON | OWN | LOCAL
;
dataExternalClause
: IS? EXTERNAL (BY literal)?
;
dataGlobalClause
: IS? GLOBAL
;
dataIntegerStringClause
: INTEGER | STRING
;
dataJustifiedClause
: (JUSTIFIED | JUST) RIGHT?
;
dataOccursClause
: OCCURS integerLiteral dataOccursTo? TIMES? (DEPENDING ON? qualifiedDataName)? dataOccursSort* (INDEXED BY? LOCAL? indexName+)?
;
dataOccursTo
: TO integerLiteral
;
dataOccursSort
: (ASCENDING | DESCENDING) KEY? IS? qualifiedDataName+
;
dataPictureClause
: (PICTURE | PIC) IS? pictureString
;
pictureString
: (pictureChars+ pictureCardinality?)+
;
pictureChars
: DOLLARCHAR | IDENTIFIER | NUMERICLITERAL | SLASHCHAR | COMMACHAR | DOT | COLONCHAR | ASTERISKCHAR | DOUBLEASTERISKCHAR | LPARENCHAR | RPARENCHAR | PLUSCHAR | MINUSCHAR | LESSTHANCHAR | MORETHANCHAR | integerLiteral
;
pictureCardinality
: LPARENCHAR integerLiteral RPARENCHAR
;
dataReceivedByClause
: RECEIVED? BY? (CONTENT | REFERENCE | REF)
;
dataRecordAreaClause
: RECORD AREA
;
dataRedefinesClause
: REDEFINES dataName
;
dataRenamesClause
: RENAMES qualifiedDataName ((THROUGH | THRU) qualifiedDataName)?
;
dataSignClause
: (SIGN IS?)? (LEADING | TRAILING) (SEPARATE CHARACTER?)?
;
dataSynchronizedClause
: (SYNCHRONIZED | SYNC) (LEFT | RIGHT)?
;
dataThreadLocalClause
: IS? THREAD_LOCAL
;
dataTypeClause
: TYPE IS? (SHORT_DATE | LONG_DATE | NUMERIC_DATE | NUMERIC_TIME | LONG_TIME | (CLOB | BLOB | DBCLOB) LPARENCHAR integerLiteral RPARENCHAR)
;
dataTypeDefClause
: IS? TYPEDEF
;
dataUsageClause
: (USAGE IS?)? (BINARY (TRUNCATED | EXTENDED)? | BIT | COMP | COMP_1 | COMP_2 | COMP_3 | COMP_4 | COMP_5 | COMPUTATIONAL | COMPUTATIONAL_1 | COMPUTATIONAL_2 | COMPUTATIONAL_3 | COMPUTATIONAL_4 | COMPUTATIONAL_5 | CONTROL_POINT | DATE | DISPLAY | DISPLAY_1 | DOUBLE | EVENT | FUNCTION_POINTER | INDEX | KANJI | LOCK | NATIONAL | PACKED_DECIMAL | POINTER | PROCEDURE_POINTER | REAL | SQL | TASK)
;
dataUsingClause
: USING (LANGUAGE | CONVENTION) OF? (cobolWord | dataName)
;
dataValueClause
: ((VALUE | VALUES) (IS | ARE)?)? dataValueInterval (COMMACHAR? dataValueInterval)*
;
dataValueInterval
: dataValueIntervalFrom dataValueIntervalTo?
;
dataValueIntervalFrom
: literal | cobolWord
;
dataValueIntervalTo
: (THROUGH | THRU) literal
;
dataWithLowerBoundsClause
: WITH? LOWER BOUNDS
;
// --- procedure division --------------------------------------------------------------------
procedureDivision
: PROCEDURE DIVISION procedureDivisionUsingClause? procedureDivisionGivingClause? DOT_FS procedureDeclaratives? procedureDivisionBody
;
procedureDivisionUsingClause
: (USING | CHAINING) procedureDivisionUsingParameter+
;
procedureDivisionGivingClause
: (GIVING | RETURNING) dataName
;
procedureDivisionUsingParameter
: procedureDivisionByReferencePhrase | procedureDivisionByValuePhrase
;
procedureDivisionByReferencePhrase
: (BY? REFERENCE)? procedureDivisionByReference+
;
procedureDivisionByReference
: (OPTIONAL? (identifier | fileName)) | ANY
;
procedureDivisionByValuePhrase
: BY? VALUE procedureDivisionByValue+
;
procedureDivisionByValue
: identifier | literal | ANY
;
procedureDeclaratives
: DECLARATIVES DOT_FS procedureDeclarative+ END DECLARATIVES DOT_FS
;
procedureDeclarative
: procedureSectionHeader DOT_FS useStatement DOT_FS paragraphs
;
procedureSectionHeader
: sectionName SECTION integerLiteral?
;
procedureDivisionBody
: paragraphs procedureSection*
;
// -- procedure section ----------------------------------
procedureSection
: procedureSectionHeader DOT_FS paragraphs
;
paragraphs
: sentence* paragraph*
;
paragraph
: paragraphName DOT_FS? (alteredGoTo | sentence*)
;
sentence
: statement* DOT_FS
;
statement
: acceptStatement | addStatement | alterStatement | callStatement | cancelStatement | closeStatement | computeStatement | continueStatement | deleteStatement | disableStatement | displayStatement | divideStatement | enableStatement | entryStatement | evaluateStatement | exhibitStatement | execCicsStatement | execSqlStatement | execSqlImsStatement | exitStatement | generateStatement | gobackStatement | goToStatement | ifStatement | initializeStatement | initiateStatement | inspectStatement | mergeStatement | moveStatement | multiplyStatement | openStatement | performStatement | purgeStatement | readStatement | receiveStatement | releaseStatement | returnStatement | rewriteStatement | searchStatement | sendStatement | setStatement | sortStatement | startStatement | stopStatement | stringStatement | subtractStatement | terminateStatement | unstringStatement | writeStatement
;
// accept statement
acceptStatement
: ACCEPT identifier (acceptFromDateStatement | acceptFromEscapeKeyStatement | acceptFromMnemonicStatement | acceptMessageCountStatement)? onExceptionClause? notOnExceptionClause? END_ACCEPT?
;
acceptFromDateStatement
: FROM (DATE YYYYMMDD? | DAY YYYYDDD? | DAY_OF_WEEK | TIME | TIMER | TODAYS_DATE MMDDYYYY? | TODAYS_NAME | YEAR | YYYYMMDD | YYYYDDD)
;
acceptFromMnemonicStatement
: FROM mnemonicName
;
acceptFromEscapeKeyStatement
: FROM ESCAPE KEY
;
acceptMessageCountStatement
: MESSAGE? COUNT
;
// add statement
addStatement
: ADD (addToStatement | addToGivingStatement | addCorrespondingStatement) onSizeErrorPhrase? notOnSizeErrorPhrase? END_ADD?
;
addToStatement
: addFrom+ TO addTo+
;
addToGivingStatement
: addFrom+ (TO addToGiving+)? GIVING addGiving+
;
addCorrespondingStatement
: (CORRESPONDING | CORR) identifier TO addTo
;
addFrom
: identifier | literal
;
addTo
: identifier ROUNDED?
;
addToGiving
: identifier | literal
;
addGiving
: identifier ROUNDED?
;
// altered go to statement
alteredGoTo
: GO TO? DOT_FS
;
// alter statement
alterStatement
: ALTER alterProceedTo+
;
alterProceedTo
: procedureName TO (PROCEED TO)? procedureName
;
// call statement
callStatement
: CALL (identifier | literal) callUsingPhrase? callGivingPhrase? onOverflowPhrase? onExceptionClause? notOnExceptionClause? END_CALL?
;
callUsingPhrase
: USING callUsingParameter+
;
callUsingParameter
: callByReferencePhrase | callByValuePhrase | callByContentPhrase
;
callByReferencePhrase
: (BY? REFERENCE)? callByReference+
;
callByReference
: ((ADDRESS OF | INTEGER | STRING)? identifier | literal | fileName) | OMITTED
;
callByValuePhrase
: BY? VALUE callByValue+
;
callByValue
: (ADDRESS OF | LENGTH OF?)? (identifier | literal)
;
callByContentPhrase
: BY? CONTENT callByContent+
;
callByContent
: (ADDRESS OF | LENGTH OF?)? identifier | literal | OMITTED
;
callGivingPhrase
: (GIVING | RETURNING) identifier
;
// cancel statement
cancelStatement
: CANCEL cancelCall+
;
cancelCall
: libraryName (BYTITLE | BYFUNCTION) | identifier | literal
;
// close statement
closeStatement
: CLOSE closeFile+
;
closeFile
: fileName (closeReelUnitStatement | closeRelativeStatement | closePortFileIOStatement)?
;
closeReelUnitStatement
: (REEL | UNIT) (FOR? REMOVAL)? (WITH? (NO REWIND | LOCK))?
;
closeRelativeStatement
: WITH? (NO REWIND | LOCK)
;
closePortFileIOStatement
: (WITH? NO WAIT | WITH WAIT) (USING closePortFileIOUsing+)?
;
closePortFileIOUsing
: closePortFileIOUsingCloseDisposition | closePortFileIOUsingAssociatedData | closePortFileIOUsingAssociatedDataLength
;
closePortFileIOUsingCloseDisposition
: CLOSE_DISPOSITION OF? (ABORT | ORDERLY)
;
closePortFileIOUsingAssociatedData
: ASSOCIATED_DATA (identifier | integerLiteral)
;
closePortFileIOUsingAssociatedDataLength
: ASSOCIATED_DATA_LENGTH OF? (identifier | integerLiteral)
;
// compute statement
computeStatement
: COMPUTE computeStore+ (EQUALCHAR | EQUAL) arithmeticExpression onSizeErrorPhrase? notOnSizeErrorPhrase? END_COMPUTE?
;
computeStore
: identifier ROUNDED?
;
// continue statement
continueStatement
: CONTINUE
;
// delete statement
deleteStatement
: DELETE fileName RECORD? invalidKeyPhrase? notInvalidKeyPhrase? END_DELETE?
;
// disable statement
disableStatement
: DISABLE (INPUT TERMINAL? | I_O TERMINAL | OUTPUT) cdName WITH? KEY (identifier | literal)
;
// display statement
displayStatement
: DISPLAY displayOperand+ displayAt? displayUpon? displayWith?
;
displayOperand
: identifier | literal
;
displayAt
: AT (identifier | literal)
;
displayUpon
: UPON (mnemonicName | environmentName)
;
displayWith
: WITH? NO ADVANCING
;
// divide statement
divideStatement
: DIVIDE (identifier | literal) (divideIntoStatement | divideIntoGivingStatement | divideByGivingStatement) divideRemainder? onSizeErrorPhrase? notOnSizeErrorPhrase? END_DIVIDE?
;
divideIntoStatement
: INTO divideInto+
;
divideIntoGivingStatement
: INTO (identifier | literal) divideGivingPhrase?
;
divideByGivingStatement
: BY (identifier | literal) divideGivingPhrase?
;
divideGivingPhrase
: GIVING divideGiving+
;
divideInto
: identifier ROUNDED?
;
divideGiving
: identifier ROUNDED?
;
divideRemainder
: REMAINDER identifier
;
// enable statement
enableStatement
: ENABLE (INPUT TERMINAL? | I_O TERMINAL | OUTPUT) cdName WITH? KEY (literal | identifier)
;
// entry statement
entryStatement
: ENTRY literal (USING identifier+)?
;
// evaluate statement
evaluateStatement
: EVALUATE evaluateSelect evaluateAlsoSelect* evaluateWhenPhrase+ evaluateWhenOther? END_EVALUATE?
;
evaluateSelect
: identifier | literal | arithmeticExpression | condition
;
evaluateAlsoSelect
: ALSO evaluateSelect
;
evaluateWhenPhrase
: evaluateWhen+ statement*
;
evaluateWhen
: WHEN evaluateCondition evaluateAlsoCondition*
;
evaluateCondition
: ANY | NOT? evaluateValue evaluateThrough? | condition | booleanLiteral
;
evaluateThrough
: (THROUGH | THRU) evaluateValue
;
evaluateAlsoCondition
: ALSO evaluateCondition
;
evaluateWhenOther
: WHEN OTHER statement*
;
evaluateValue
: identifier | literal | arithmeticExpression
;
// exec cics statement
execCicsStatement
: EXECCICSLINE+
;
// exec sql statement
execSqlStatement
: EXECSQLLINE+
;
// exec sql ims statement
execSqlImsStatement
: EXECSQLIMSLINE+
;
// exhibit statement
exhibitStatement
: EXHIBIT NAMED? CHANGED? exhibitOperand+
;
exhibitOperand
: identifier | literal
;
// exit statement
exitStatement
: EXIT PROGRAM?
;
// generate statement
generateStatement
: GENERATE reportName
;
// goback statement
gobackStatement
: GOBACK
;
// goto statement
goToStatement
: GO TO? (goToStatementSimple | goToDependingOnStatement)
;
goToStatementSimple
: procedureName
;
goToDependingOnStatement
: MORE_LABELS | procedureName+ (DEPENDING ON? identifier)?
;
// if statement
ifStatement
: IF condition ifThen ifElse? END_IF?
;
ifThen
: THEN? (NEXT SENTENCE | statement*)
;
ifElse
: ELSE (NEXT SENTENCE | statement*)
;
// initialize statement
initializeStatement
: INITIALIZE identifier+ initializeReplacingPhrase?
;
initializeReplacingPhrase
: REPLACING initializeReplacingBy+
;
initializeReplacingBy
: (ALPHABETIC | ALPHANUMERIC | ALPHANUMERIC_EDITED | NATIONAL | NATIONAL_EDITED | NUMERIC | NUMERIC_EDITED | DBCS | EGCS) DATA? BY (identifier | literal)
;
// initiate statement
initiateStatement
: INITIATE reportName+
;
// inspect statement
inspectStatement
: INSPECT identifier (inspectTallyingPhrase | inspectReplacingPhrase | inspectTallyingReplacingPhrase | inspectConvertingPhrase)
;
inspectTallyingPhrase
: TALLYING inspectFor+
;
inspectReplacingPhrase
: REPLACING (inspectReplacingCharacters | inspectReplacingAllLeadings)+
;
inspectTallyingReplacingPhrase
: TALLYING inspectFor+ inspectReplacingPhrase+
;
inspectConvertingPhrase
: CONVERTING (identifier | literal) inspectTo inspectBeforeAfter*
;
inspectFor
: identifier FOR (inspectCharacters | inspectAllLeadings)+
;
inspectCharacters
: CHARACTERS inspectBeforeAfter*
;
inspectReplacingCharacters
: CHARACTERS inspectBy inspectBeforeAfter*
;
inspectAllLeadings
: (ALL | LEADING) inspectAllLeading+
;
inspectReplacingAllLeadings
: (ALL | LEADING | FIRST) inspectReplacingAllLeading+
;
inspectAllLeading
: (identifier | literal) inspectBeforeAfter*
;
inspectReplacingAllLeading
: (identifier | literal) inspectBy inspectBeforeAfter*
;
inspectBy
: BY (identifier | literal)
;
inspectTo
: TO (identifier | literal)
;
inspectBeforeAfter
: (BEFORE | AFTER) INITIAL? (identifier | literal)
;
// merge statement
mergeStatement
: MERGE fileName mergeOnKeyClause+ mergeCollatingSequencePhrase? mergeUsing* mergeOutputProcedurePhrase? mergeGivingPhrase*
;
mergeOnKeyClause
: ON? (ASCENDING | DESCENDING) KEY? qualifiedDataName+
;
mergeCollatingSequencePhrase
: COLLATING? SEQUENCE IS? alphabetName+ mergeCollatingAlphanumeric? mergeCollatingNational?
;
mergeCollatingAlphanumeric
: FOR? ALPHANUMERIC IS alphabetName
;
mergeCollatingNational
: FOR? NATIONAL IS? alphabetName
;
mergeUsing
: USING fileName+
;
mergeOutputProcedurePhrase
: OUTPUT PROCEDURE IS? procedureName mergeOutputThrough?
;
mergeOutputThrough
: (THROUGH | THRU) procedureName
;
mergeGivingPhrase
: GIVING mergeGiving+
;
mergeGiving
: fileName (LOCK | SAVE | NO REWIND | CRUNCH | RELEASE | WITH REMOVE CRUNCH)?
;
// move statement
moveStatement
: MOVE ALL? (moveToStatement | moveCorrespondingToStatement)
;
moveToStatement
: moveToSendingArea TO identifier+
;
moveToSendingArea
: identifier | literal
;
moveCorrespondingToStatement
: (CORRESPONDING | CORR) moveCorrespondingToSendingArea TO identifier+
;
moveCorrespondingToSendingArea
: identifier
;
// multiply statement
multiplyStatement
: MULTIPLY (identifier | literal) BY (multiplyRegular | multiplyGiving) onSizeErrorPhrase? notOnSizeErrorPhrase? END_MULTIPLY?
;
multiplyRegular
: multiplyRegularOperand+
;
multiplyRegularOperand
: identifier ROUNDED?
;
multiplyGiving
: multiplyGivingOperand GIVING multiplyGivingResult+
;
multiplyGivingOperand
: identifier | literal
;
multiplyGivingResult
: identifier ROUNDED?
;
// open statement
openStatement
: OPEN (openInputStatement | openOutputStatement | openIOStatement | openExtendStatement)+
;
openInputStatement
: INPUT openInput+
;
openInput
: fileName (REVERSED | WITH? NO REWIND)?
;
openOutputStatement
: OUTPUT openOutput+
;
openOutput
: fileName (WITH? NO REWIND)?
;
openIOStatement
: I_O fileName+
;
openExtendStatement
: EXTEND fileName+
;
// perform statement
performStatement
: PERFORM (performInlineStatement | performProcedureStatement)
;
performInlineStatement
: performType? statement* END_PERFORM
;
performProcedureStatement
: procedureName ((THROUGH | THRU) procedureName)? performType?
;
performType
: performTimes | performUntil | performVarying
;
performTimes
: (identifier | integerLiteral) TIMES
;
performUntil
: performTestClause? UNTIL condition
;
performVarying
: performTestClause performVaryingClause | performVaryingClause performTestClause?
;
performVaryingClause
: VARYING performVaryingPhrase performAfter*
;
performVaryingPhrase
: (identifier | literal) performFrom performBy performUntil
;
performAfter
: AFTER performVaryingPhrase
;
performFrom
: FROM (identifier | literal | arithmeticExpression)
;
performBy
: BY (identifier | literal | arithmeticExpression)
;
performTestClause
: WITH? TEST (BEFORE | AFTER)
;
// purge statement
purgeStatement
: PURGE cdName+
;
// read statement
readStatement
: READ fileName NEXT? RECORD? readInto? readWith? readKey? invalidKeyPhrase? notInvalidKeyPhrase? atEndPhrase? notAtEndPhrase? END_READ?
;
readInto
: INTO identifier
;
readWith
: WITH? ((KEPT | NO) LOCK | WAIT)
;
readKey
: KEY IS? qualifiedDataName
;
// receive statement
receiveStatement
: RECEIVE (receiveFromStatement | receiveIntoStatement) onExceptionClause? notOnExceptionClause? END_RECEIVE?
;
receiveFromStatement
: dataName FROM receiveFrom (receiveBefore | receiveWith | receiveThread | receiveSize | receiveStatus)*
;
receiveFrom
: THREAD dataName | LAST THREAD | ANY THREAD
;
receiveIntoStatement
: cdName (MESSAGE | SEGMENT) INTO? identifier receiveNoData? receiveWithData?
;
receiveNoData
: NO DATA statement*
;
receiveWithData
: WITH DATA statement*
;
receiveBefore
: BEFORE TIME? (numericLiteral | identifier)
;
receiveWith
: WITH? NO WAIT
;
receiveThread
: THREAD IN? dataName
;
receiveSize
: SIZE IN? (numericLiteral | identifier)
;
receiveStatus
: STATUS IN? (identifier)
;
// release statement
releaseStatement
: RELEASE recordName (FROM qualifiedDataName)?
;
// return statement
returnStatement
: RETURN fileName RECORD? returnInto? atEndPhrase notAtEndPhrase? END_RETURN?
;
returnInto
: INTO qualifiedDataName
;
// rewrite statement
rewriteStatement
: REWRITE recordName rewriteFrom? invalidKeyPhrase? notInvalidKeyPhrase? END_REWRITE?
;
rewriteFrom
: FROM identifier
;
// search statement
searchStatement
: SEARCH ALL? qualifiedDataName searchVarying? atEndPhrase? searchWhen+ END_SEARCH?
;
searchVarying
: VARYING qualifiedDataName
;
searchWhen
: WHEN condition (NEXT SENTENCE | statement*)
;
// send statement
sendStatement
: SEND (sendStatementSync | sendStatementAsync) onExceptionClause? notOnExceptionClause?
;
sendStatementSync
: (identifier | literal) sendFromPhrase? sendWithPhrase? sendReplacingPhrase? sendAdvancingPhrase?
;
sendStatementAsync
: TO (TOP | BOTTOM) identifier
;
sendFromPhrase
: FROM identifier
;
sendWithPhrase
: WITH (EGI | EMI | ESI | identifier)
;
sendReplacingPhrase
: REPLACING LINE?
;
sendAdvancingPhrase
: (BEFORE | AFTER) ADVANCING? (sendAdvancingPage | sendAdvancingLines | sendAdvancingMnemonic)
;
sendAdvancingPage
: PAGE
;
sendAdvancingLines
: (identifier | literal) (LINE | LINES)?
;
sendAdvancingMnemonic
: mnemonicName
;
// set statement
setStatement
: SET (setToStatement+ | setUpDownByStatement)
;
setToStatement
: setTo+ TO setToValue+
;
setUpDownByStatement
: setTo+ (UP BY | DOWN BY) setByValue
;
setTo
: identifier
;
setToValue
: ON | OFF | ENTRY (identifier | literal) | identifier | literal
;
setByValue
: identifier | literal
;
// sort statement
sortStatement
: SORT fileName sortOnKeyClause+ sortDuplicatesPhrase? sortCollatingSequencePhrase? sortInputProcedurePhrase? sortUsing* sortOutputProcedurePhrase? sortGivingPhrase*
;
sortOnKeyClause
: ON? (ASCENDING | DESCENDING) KEY? qualifiedDataName+
;
sortDuplicatesPhrase
: WITH? DUPLICATES IN? ORDER?
;
sortCollatingSequencePhrase
: COLLATING? SEQUENCE IS? alphabetName+ sortCollatingAlphanumeric? sortCollatingNational?
;
sortCollatingAlphanumeric
: FOR? ALPHANUMERIC IS alphabetName
;
sortCollatingNational
: FOR? NATIONAL IS? alphabetName
;
sortInputProcedurePhrase
: INPUT PROCEDURE IS? procedureName sortInputThrough?
;
sortInputThrough
: (THROUGH | THRU) procedureName
;
sortUsing
: USING fileName+
;
sortOutputProcedurePhrase
: OUTPUT PROCEDURE IS? procedureName sortOutputThrough?
;
sortOutputThrough
: (THROUGH | THRU) procedureName
;
sortGivingPhrase
: GIVING sortGiving+
;
sortGiving
: fileName (LOCK | SAVE | NO REWIND | CRUNCH | RELEASE | WITH REMOVE CRUNCH)?
;
// start statement
startStatement
: START fileName startKey? invalidKeyPhrase? notInvalidKeyPhrase? END_START?
;
startKey
: KEY IS? (EQUAL TO? | EQUALCHAR | GREATER THAN? | MORETHANCHAR | NOT LESS THAN? | NOT LESSTHANCHAR | GREATER THAN? OR EQUAL TO? | MORETHANOREQUAL) qualifiedDataName
;
// stop statement
stopStatement
: STOP (RUN | literal | stopStatementGiving)
;
stopStatementGiving
: RUN (GIVING | RETURNING) (identifier | integerLiteral)
;
// string statement
stringStatement
: STRING stringSendingPhrase+ stringIntoPhrase stringWithPointerPhrase? onOverflowPhrase? notOnOverflowPhrase? END_STRING?
;
stringSendingPhrase
: stringSending (COMMACHAR? stringSending)* (stringDelimitedByPhrase | stringForPhrase)
;
stringSending
: identifier | literal
;
stringDelimitedByPhrase
: DELIMITED BY? (SIZE | identifier | literal)
;
stringForPhrase
: FOR (identifier | literal)
;
stringIntoPhrase
: INTO identifier
;
stringWithPointerPhrase
: WITH? POINTER qualifiedDataName
;
// subtract statement
subtractStatement
: SUBTRACT (subtractFromStatement | subtractFromGivingStatement | subtractCorrespondingStatement) onSizeErrorPhrase? notOnSizeErrorPhrase? END_SUBTRACT?
;
subtractFromStatement
: subtractSubtrahend+ FROM subtractMinuend+
;
subtractFromGivingStatement
: subtractSubtrahend+ FROM subtractMinuendGiving GIVING subtractGiving+
;
subtractCorrespondingStatement
: (CORRESPONDING | CORR) qualifiedDataName FROM subtractMinuendCorresponding
;
subtractSubtrahend
: identifier | literal
;
subtractMinuend
: identifier ROUNDED?
;
subtractMinuendGiving
: identifier | literal
;
subtractGiving
: identifier ROUNDED?
;
subtractMinuendCorresponding
: qualifiedDataName ROUNDED?
;
// terminate statement
terminateStatement
: TERMINATE reportName
;
// unstring statement
unstringStatement
: UNSTRING unstringSendingPhrase unstringIntoPhrase unstringWithPointerPhrase? unstringTallyingPhrase? onOverflowPhrase? notOnOverflowPhrase? END_UNSTRING?
;
unstringSendingPhrase
: identifier (unstringDelimitedByPhrase unstringOrAllPhrase*)?
;
unstringDelimitedByPhrase
: DELIMITED BY? ALL? (identifier | literal)
;
unstringOrAllPhrase
: OR ALL? (identifier | literal)
;
unstringIntoPhrase
: INTO unstringInto+
;
unstringInto
: identifier unstringDelimiterIn? unstringCountIn?
;
unstringDelimiterIn
: DELIMITER IN? identifier
;
unstringCountIn
: COUNT IN? identifier
;
unstringWithPointerPhrase
: WITH? POINTER qualifiedDataName
;
unstringTallyingPhrase
: TALLYING IN? qualifiedDataName
;
// use statement
useStatement
: USE (useAfterClause | useDebugClause)
;
useAfterClause
: GLOBAL? AFTER STANDARD? (EXCEPTION | ERROR) PROCEDURE ON? useAfterOn
;
useAfterOn
: INPUT | OUTPUT | I_O | EXTEND | fileName+
;
useDebugClause
: FOR? DEBUGGING ON? useDebugOn+
;
useDebugOn
: ALL PROCEDURES | ALL REFERENCES? OF? identifier | procedureName | fileName
;
// write statement
writeStatement
: WRITE recordName writeFromPhrase? writeAdvancingPhrase? writeAtEndOfPagePhrase? writeNotAtEndOfPagePhrase? invalidKeyPhrase? notInvalidKeyPhrase? END_WRITE?
;
writeFromPhrase
: FROM (identifier | literal)
;
writeAdvancingPhrase
: (BEFORE | AFTER) ADVANCING? (writeAdvancingPage | writeAdvancingLines | writeAdvancingMnemonic)
;
writeAdvancingPage
: PAGE
;
writeAdvancingLines
: (identifier | literal) (LINE | LINES)?
;
writeAdvancingMnemonic
: mnemonicName
;
writeAtEndOfPagePhrase
: AT? (END_OF_PAGE | EOP) statement*
;
writeNotAtEndOfPagePhrase
: NOT AT? (END_OF_PAGE | EOP) statement*
;
// statement phrases ----------------------------------
atEndPhrase
: AT? END statement*
;
notAtEndPhrase
: NOT AT? END statement*
;
invalidKeyPhrase
: INVALID KEY? statement*
;
notInvalidKeyPhrase
: NOT INVALID KEY? statement*
;
onOverflowPhrase
: ON? OVERFLOW statement*
;
notOnOverflowPhrase
: NOT ON? OVERFLOW statement*
;
onSizeErrorPhrase
: ON? SIZE ERROR statement*
;
notOnSizeErrorPhrase
: NOT ON? SIZE ERROR statement*
;
// statement clauses ----------------------------------
onExceptionClause
: ON? EXCEPTION statement*
;
notOnExceptionClause
: NOT ON? EXCEPTION statement*
;
// arithmetic expression ----------------------------------
arithmeticExpression
: multDivs plusMinus*
;
plusMinus
: (PLUSCHAR | MINUSCHAR) multDivs
;
multDivs
: powers multDiv*
;
multDiv
: (ASTERISKCHAR | SLASHCHAR) powers
;
powers
: (PLUSCHAR | MINUSCHAR)? basis power*
;
power
: DOUBLEASTERISKCHAR basis
;
basis
: LPARENCHAR arithmeticExpression RPARENCHAR | identifier | literal
;
// condition ----------------------------------
condition
: combinableCondition andOrCondition*
;
andOrCondition
: (AND | OR) (combinableCondition | abbreviation+)
;
combinableCondition
: NOT? simpleCondition
;
simpleCondition
: LPARENCHAR condition RPARENCHAR | relationCondition | classCondition | conditionNameReference
;
classCondition
: identifier IS? NOT? (NUMERIC | ALPHABETIC | ALPHABETIC_LOWER | ALPHABETIC_UPPER | DBCS | KANJI | className)
;
conditionNameReference
: conditionName (inData* inFile? conditionNameSubscriptReference* | inMnemonic*)
;
conditionNameSubscriptReference
: LPARENCHAR subscript (COMMACHAR? subscript)* RPARENCHAR
;
// relation ----------------------------------
relationCondition
: relationSignCondition | relationArithmeticComparison | relationCombinedComparison
;
relationSignCondition
: arithmeticExpression IS? NOT? (POSITIVE | NEGATIVE | ZERO)
;
relationArithmeticComparison
: arithmeticExpression relationalOperator arithmeticExpression
;
relationCombinedComparison
: arithmeticExpression relationalOperator LPARENCHAR relationCombinedCondition RPARENCHAR
;
relationCombinedCondition
: arithmeticExpression ((AND | OR) arithmeticExpression)+
;
relationalOperator
: (IS | ARE)? (NOT? (GREATER THAN? | MORETHANCHAR | LESS THAN? | LESSTHANCHAR | EQUAL TO? | EQUALCHAR) | NOTEQUALCHAR | GREATER THAN? OR EQUAL TO? | MORETHANOREQUAL | LESS THAN? OR EQUAL TO? | LESSTHANOREQUAL)
;
abbreviation
: NOT? relationalOperator? (arithmeticExpression | LPARENCHAR arithmeticExpression abbreviation RPARENCHAR)
;
// identifier ----------------------------------
identifier
: qualifiedDataName | tableCall | functionCall | specialRegister
;
tableCall
: qualifiedDataName (LPARENCHAR subscript (COMMACHAR? subscript)* RPARENCHAR)* referenceModifier?
;
functionCall
: FUNCTION functionName (LPARENCHAR argument (COMMACHAR? argument)* RPARENCHAR)* referenceModifier?
;
referenceModifier
: LPARENCHAR characterPosition COLONCHAR length? RPARENCHAR
;
characterPosition
: arithmeticExpression
;
length
: arithmeticExpression
;
subscript
: ALL | integerLiteral | qualifiedDataName integerLiteral? | indexName integerLiteral? | arithmeticExpression
;
argument
: literal | identifier | qualifiedDataName integerLiteral? | indexName integerLiteral? | arithmeticExpression
;
// qualified data name ----------------------------------
qualifiedDataName
: qualifiedDataNameFormat1 | qualifiedDataNameFormat2 | qualifiedDataNameFormat3 | qualifiedDataNameFormat4
;
qualifiedDataNameFormat1
: (dataName | conditionName) (qualifiedInData+ inFile? | inFile)?
;
qualifiedDataNameFormat2
: paragraphName inSection
;
qualifiedDataNameFormat3
: textName inLibrary
;
qualifiedDataNameFormat4
: LINAGE_COUNTER inFile
;
qualifiedInData
: inData | inTable
;
// in ----------------------------------
inData
: (IN | OF) dataName
;
inFile
: (IN | OF) fileName
;
inMnemonic
: (IN | OF) mnemonicName
;
inSection
: (IN | OF) sectionName
;
inLibrary
: (IN | OF) libraryName
;
inTable
: (IN | OF) tableCall
;
// names ----------------------------------
alphabetName
: cobolWord
;
assignmentName
: systemName
;
basisName
: programName
;
cdName
: cobolWord
;
className
: cobolWord
;
computerName
: systemName
;
conditionName
: cobolWord
;
dataName
: cobolWord
;
dataDescName
: FILLER | CURSOR | dataName
;
environmentName
: systemName
;
fileName
: cobolWord
;
functionName
: INTEGER | LENGTH | RANDOM | SUM | WHEN_COMPILED | cobolWord
;
indexName
: cobolWord
;
languageName
: systemName
;
libraryName
: cobolWord
;
localName
: cobolWord
;
mnemonicName
: cobolWord
;
paragraphName
: cobolWord | integerLiteral
;
procedureName
: paragraphName inSection? | sectionName
;
programName
: NONNUMERICLITERAL | cobolWord
;
recordName
: qualifiedDataName
;
reportName
: qualifiedDataName
;
routineName
: cobolWord
;
screenName
: cobolWord
;
sectionName
: cobolWord | integerLiteral
;
systemName
: cobolWord
;
symbolicCharacter
: cobolWord
;
textName
: cobolWord
;
// literal ----------------------------------
cobolWord
: IDENTIFIER
| ABORT | AS | ASCII | ASSOCIATED_DATA | ASSOCIATED_DATA_LENGTH | ATTRIBUTE | AUTO | AUTO_SKIP
| BACKGROUND_COLOR | BACKGROUND_COLOUR | BEEP | BELL | BINARY | BIT | BLINK | BLOB | BOUNDS
| CAPABLE | CCSVERSION | CHANGED | CHANNEL | CLOB | CLOSE_DISPOSITION | COBOL | COMMITMENT | CONTROL_POINT | CONVENTION | CRUNCH | CURSOR
| DBCLOB | DEFAULT | DEFAULT_DISPLAY | DEFINITION | DFHRESP | DFHVALUE | DISK | DONTCARE | DOUBLE
| EBCDIC | EMPTY_CHECK | ENTER | ENTRY_PROCEDURE | EOL | EOS | ERASE | ESCAPE | EVENT | EXCLUSIVE | EXPORT | EXTENDED
| FOREGROUND_COLOR | FOREGROUND_COLOUR | FULL | FUNCTIONNAME | FUNCTION_POINTER
| GRID
| HIGHLIGHT
| IMPLICIT | IMPORT | INTEGER
| KEPT | KEYBOARD
| LANGUAGE | LB | LD | LEFTLINE | LENGTH_CHECK | LIBACCESS | LIBPARAMETER | LIBRARY | LIST | LOCAL | LONG_DATE | LONG_TIME | LOWER | LOWLIGHT
| MMDDYYYY
| NAMED | NATIONAL | NATIONAL_EDITED | NETWORK | NO_ECHO | NUMERIC_DATE | NUMERIC_TIME
| ODT | ORDERLY | OVERLINE | OWN
| PASSWORD | PORT | PRINTER | PRIVATE | PROCESS | PROGRAM | PROMPT
| READER | REAL | RECEIVED | RECURSIVE | REF | REMOTE | REMOVE | REQUIRED | REVERSE_VIDEO
| SAVE | SECURE | SHARED | SHAREDBYALL | SHAREDBYRUNUNIT | SHARING | SHORT_DATE | SQL | SYMBOL
| TASK | THREAD | THREAD_LOCAL | TIMER | TODAYS_DATE | TODAYS_NAME | TRUNCATED | TYPEDEF
| UNDERLINE
| VIRTUAL
| WAIT
| YEAR | YYYYMMDD | YYYYDDD
| ZERO_FILL
;
literal
: NONNUMERICLITERAL | figurativeConstant | numericLiteral | booleanLiteral | cicsDfhRespLiteral | cicsDfhValueLiteral
;
booleanLiteral
: TRUE | FALSE
;
numericLiteral
: NUMERICLITERAL | ZERO | integerLiteral
;
integerLiteral
: INTEGERLITERAL | LEVEL_NUMBER_66 | LEVEL_NUMBER_77 | LEVEL_NUMBER_88
;
cicsDfhRespLiteral
: DFHRESP LPARENCHAR (cobolWord | literal) RPARENCHAR
;
cicsDfhValueLiteral
: DFHVALUE LPARENCHAR (cobolWord | literal) RPARENCHAR
;
// keywords ----------------------------------
figurativeConstant
: ALL literal | HIGH_VALUE | HIGH_VALUES | LOW_VALUE | LOW_VALUES | NULL | NULLS | QUOTE | QUOTES | SPACE | SPACES | ZERO | ZEROS | ZEROES
;
specialRegister
: ADDRESS OF identifier
| DATE | DAY | DAY_OF_WEEK | DEBUG_CONTENTS | DEBUG_ITEM | DEBUG_LINE | DEBUG_NAME | DEBUG_SUB_1 | DEBUG_SUB_2 | DEBUG_SUB_3
| LENGTH OF? identifier | LINAGE_COUNTER | LINE_COUNTER
| PAGE_COUNTER
| RETURN_CODE
| SHIFT_IN | SHIFT_OUT | SORT_CONTROL | SORT_CORE_SIZE | SORT_FILE_SIZE | SORT_MESSAGE | SORT_MODE_SIZE | SORT_RETURN
| TALLY | TIME
| WHEN_COMPILED
;
// comment entry
commentEntry
: COMMENTENTRYLINE+
;
// lexer rules --------------------------------------------------------------------------------
// keywords
ABORT : A B O R T;
ACCEPT : A C C E P T;
ACCESS : A C C E S S;
ADD : A D D;
ADDRESS : A D D R E S S;
ADVANCING : A D V A N C I N G;
AFTER : A F T E R;
ALIGNED : A L I G N E D;
ALL : A L L;
ALPHABET : A L P H A B E T;
ALPHABETIC : A L P H A B E T I C;
ALPHABETIC_LOWER : A L P H A B E T I C MINUSCHAR L O W E R;
ALPHABETIC_UPPER : A L P H A B E T I C MINUSCHAR U P P E R;
ALPHANUMERIC : A L P H A N U M E R I C;
ALPHANUMERIC_EDITED : A L P H A N U M E R I C MINUSCHAR E D I T E D;
ALSO : A L S O;
ALTER : A L T E R;
ALTERNATE : A L T E R N A T E;
AND : A N D;
ANY : A N Y;
ARE : A R E;
AREA : A R E A;
AREAS : A R E A S;
AS : A S;
ASCENDING : A S C E N D I N G;
ASCII : A S C I I;
ASSIGN : A S S I G N;
ASSOCIATED_DATA : A S S O C I A T E D MINUSCHAR D A T A;
ASSOCIATED_DATA_LENGTH : A S S O C I A T E D MINUSCHAR D A T A MINUSCHAR L E N G T H;
AT : A T;
ATTRIBUTE : A T T R I B U T E;
AUTHOR : <NAME>;
AUTO : A U T O;
AUTO_SKIP : A U T O MINUSCHAR S K I P;
BACKGROUND_COLOR : B A C K G R O U N D MINUSCHAR C O L O R;
BACKGROUND_COLOUR : B A C K G R O U N D MINUSCHAR C O L O U R;
BASIS : B A S I S;
BEEP : B E E P;
BEFORE : B E F O R E;
BEGINNING : B E G I N N I N G;
BELL : B E L L;
BINARY : B I N A R Y;
BIT : B I T;
BLANK : B L A N K;
BLINK : B L I N K;
BLOB : B L O B;
BLOCK : B L O C K;
BOUNDS : B O U N D S;
BOTTOM : B O T T O M;
BY : B Y;
BYFUNCTION : B Y F U N C T I O N;
BYTITLE : B Y T I T L E;
CALL : C A L L;
CANCEL : C A N C E L;
CAPABLE : C A P A B L E;
CCSVERSION : C C S V E R S I O N;
CD : C D;
CF : C F;
CH : C H;
CHAINING : C H A I N I N G;
CHANGED : C H A N G E D;
CHANNEL : C H A N N E L;
CHARACTER : C H A R A C T E R;
CHARACTERS : C H A R A C T E R S;
CLASS : C L A S S;
CLASS_ID : C L A S S MINUSCHAR I D;
CLOB : C L O B;
CLOCK_UNITS : C L O C K MINUSCHAR U N I T S;
CLOSE : C L O S E;
CLOSE_DISPOSITION : C L O S E MINUSCHAR D I S P O S I T I O N;
COBOL : C O B O L;
CODE : C O D E;
CODE_SET : C O D E MINUSCHAR S E T;
COLLATING : C O L L A T I N G;
COL : C O L;
COLUMN : C O L U M N;
COM_REG : C O M MINUSCHAR R E G;
COMMA : C O M M A;
COMMITMENT : C O M M I T M E N T;
COMMON : C O M M O N;
COMMUNICATION : C O M M U N I C A T I O N;
COMP : C O M P;
COMP_1 : C O M P MINUSCHAR '1';
COMP_2 : C O M P MINUSCHAR '2';
COMP_3 : C O M P MINUSCHAR '3';
COMP_4 : C O M P MINUSCHAR '4';
COMP_5 : C O M P MINUSCHAR '5';
COMPUTATIONAL : C O M P U T A T I O N A L;
COMPUTATIONAL_1 : C O M P U T A T I O N A L MINUSCHAR '1';
COMPUTATIONAL_2 : C O M P U T A T I O N A L MINUSCHAR '2';
COMPUTATIONAL_3 : C O M P U T A T I O N A L MINUSCHAR '3';
COMPUTATIONAL_4 : C O M P U T A T I O N A L MINUSCHAR '4';
COMPUTATIONAL_5 : C O M P U T A T I O N A L MINUSCHAR '5';
COMPUTE : C O M P U T E;
CONFIGURATION : C O N F I G U R A T I O N;
CONTAINS : C O N T A I N S;
CONTENT : C O N T E N T;
CONTINUE : C O N T I N U E;
CONTROL : C O N T R O L;
CONTROL_POINT : C O N T R O L MINUSCHAR P O I N T;
CONTROLS : C O N T R O L S;
CONVENTION : C O N V E N T I O N;
CONVERTING : C O N V E R T I N G;
COPY : C O P Y;
CORR : C O R R;
CORRESPONDING : C O R R E S P O N D I N G;
COUNT : C O U N T;
CRUNCH : C R U N C H;
CURRENCY : C U R R E N C Y;
CURSOR : C U R S O R;
DATA : D A T A;
DATA_BASE : D A T A MINUSCHAR B A S E;
DATE : D A T E;
DATE_COMPILED : D A T E MINUSCHAR C O M P I L E D;
DATE_WRITTEN : D A T E MINUSCHAR W R I T T E N;
DAY : D A Y;
DAY_OF_WEEK : D A Y MINUSCHAR O F MINUSCHAR W E E K;
DBCS : D B C S;
DBCLOB : D B C L O B;
DE : D E;
DEBUG_CONTENTS : D E B U G MINUSCHAR C O N T E N T S;
DEBUG_ITEM : D E B U G MINUSCHAR I T E M;
DEBUG_LINE : D E B U G MINUSCHAR L I N E;
DEBUG_NAME : D E B U G MINUSCHAR N A M E;
DEBUG_SUB_1 : D E B U G MINUSCHAR S U B MINUSCHAR '1';
DEBUG_SUB_2 : D E B U G MINUSCHAR S U B MINUSCHAR '2';
DEBUG_SUB_3 : D E B U G MINUSCHAR S U B MINUSCHAR '3';
DEBUGGING : D E B U G G I N G;
DECIMAL_POINT : D E C I M A L MINUSCHAR P O I N T;
DECLARATIVES : D E C L A R A T I V E S;
DEFAULT : D E F A U L T;
DEFAULT_DISPLAY : D E F A U L T MINUSCHAR D I S P L A Y;
DEFINITION : D E F I N I T I O N;
DELETE : D E L E T E;
DELIMITED : D E L I M I T E D;
DELIMITER : D E L I M I T E R;
DEPENDING : D E P E N D I N G;
DESCENDING : D E S C E N D I N G;
DESTINATION : D E S T I N A T I O N;
DETAIL : D E T A I L;
DFHRESP : D F H R E S P;
DFHVALUE : D F H V A L U E;
DISABLE : D I S A B L E;
DISK : D I S K;
DISPLAY : D I S P L A Y;
DISPLAY_1 : D I S P L A Y MINUSCHAR '1';
DIVIDE : D I V I D E;
DIVISION : D I V I S I O N;
DONTCARE : D O N T C A R E;
DOUBLE : D O U B L E;
DOWN : D O W N;
DUPLICATES : D U P L I C A T E S;
DYNAMIC : D Y N A M I C;
EBCDIC : E B C D I C;
EGCS : E G C S; // E X T E N S I O N
EGI : E G I;
ELSE : E L S E;
EMI : E M I;
EMPTY_CHECK : E M P T Y MINUSCHAR C H E C K;
ENABLE : E N A B L E;
END : E N D;
END_ACCEPT : E N D MINUSCHAR A C C E P T;
END_ADD : E N D MINUSCHAR A D D;
END_CALL : E N D MINUSCHAR C A L L;
END_COMPUTE : E N D MINUSCHAR C O M P U T E;
END_DELETE : E N D MINUSCHAR D E L E T E;
END_DIVIDE : E N D MINUSCHAR D I V I D E;
END_EVALUATE : E N D MINUSCHAR E V A L U A T E;
END_IF : E N D MINUSCHAR I F;
END_MULTIPLY : E N D MINUSCHAR M U L T I P L Y;
END_OF_PAGE : E N D MINUSCHAR O F MINUSCHAR P A G E;
END_PERFORM : E N D MINUSCHAR P E R F O R M;
END_READ : E N D MINUSCHAR R E A D;
END_RECEIVE : E N D MINUSCHAR R E C E I V E;
END_REMARKS : E N D MINUSCHAR R E M A R K S;
END_RETURN : E N D MINUSCHAR R E T U R N;
END_REWRITE : E N D MINUSCHAR R E W R I T E;
END_SEARCH : E N D MINUSCHAR S E A R C H;
END_START : E N D MINUSCHAR S T A R T;
END_STRING : E N D MINUSCHAR S T R I N G;
END_SUBTRACT : E N D MINUSCHAR S U B T R A C T;
END_UNSTRING : E N D MINUSCHAR U N S T R I N G;
END_WRITE : E N D MINUSCHAR W R I T E;
ENDING : E N D I N F;
ENTER : E N T E R;
ENTRY : E N T R Y;
ENTRY_PROCEDURE : E N T R Y MINUSCHAR P R O C E D U R E;
ENVIRONMENT : E N V I R O N M E N T;
EOP : E O P;
EQUAL : E Q U A L;
ERASE : E R A S E;
ERROR : E R R O R;
EOL : E O L;
EOS : E O S;
ESCAPE : E S C A P E;
ESI : E S I;
EVALUATE : E V A L U A T E;
EVENT : E V E N T;
EVERY : E V E R Y;
EXCEPTION : E X C E P T I O N;
EXCLUSIVE : E X C L U S I V E;
EXHIBIT : E X H I B I T;
EXIT : E X I T;
EXPORT : E X P O R T;
EXTEND : E X T E N D;
EXTENDED : E X T E N D E D;
EXTERNAL : E X T E R N A L;
FALSE : F A L S E;
FD : F D;
FILE : F I L E;
FILE_CONTROL : F I L E MINUSCHAR C O N T R O L;
FILLER : F I L L E R;
FINAL : F I N A L;
FIRST : F I R S T;
FOOTING : F O O T I N G;
FOR : F O R;
FOREGROUND_COLOR : F O R E G R O U N D MINUSCHAR C O L O R;
FOREGROUND_COLOUR : F O R E G R O U N D MINUSCHAR C O L O U R;
FROM : F R O M;
FULL : F U L L;
FUNCTION : F U N C T I O N;
FUNCTIONNAME : F U N C T I O N N A M E;
FUNCTION_POINTER : F U N C T I O N MINUSCHAR P O I N T E R;
GENERATE : G E N E R A T E;
GOBACK : G O B A C K;
GIVING : G I V I N G;
GLOBAL : G L O B A L;
GO : G O;
GREATER : G R E A T E R;
GRID : G R I D;
GROUP : G R O U P;
HEADING : H E A D I N G;
HIGHLIGHT : H I G H L I G H T;
HIGH_VALUE : H I G H MINUSCHAR V A L U E;
HIGH_VALUES : H I G H MINUSCHAR V A L U E S;
I_O : I MINUSCHAR O;
I_O_CONTROL : I MINUSCHAR O MINUSCHAR C O N T R O L;
ID : I D;
IDENTIFICATION : I D E N T I F I C A T I O N;
IF : I F;
IMPLICIT : I M P L I C I T;
IMPORT : I M P O R T;
IN : I N;
INDEX : I N D E X;
INDEXED : I N D E X E D;
INDICATE : I N D I C A T E;
INITIAL : I N I T I A L;
INITIALIZE : I N I T I A L I Z E;
INITIATE : I N I T I A T E;
INPUT : I N P U T;
INPUT_OUTPUT : I N P U T MINUSCHAR O U T P U T;
INSPECT : I N S P E C T;
INSTALLATION : I N S T A L L A T I O N;
INTEGER : I N T E G E R;
INTO : I N T O;
INVALID : I N V A L I D;
INVOKE : I N V O K E;
IS : I S;
JUST : J U S T;
JUSTIFIED : J U S T I F I E D;
KANJI : K A N J I;
KEPT : K E P T;
KEY : K E Y;
KEYBOARD : K E Y B O A R D;
LABEL : L A B E L;
LANGUAGE : L A N G U A G E;
LAST : L A S T;
LB : L B;
LD : L D;
LEADING : L E A D I N G;
LEFT : L E F T;
LEFTLINE : L E F T L I N E;
LENGTH : L E N G T H;
LENGTH_CHECK : L E N G T H MINUSCHAR C H E C K;
LESS : L E S S;
LIBACCESS : L I B A C C E S S;
LIBPARAMETER : L I B P A R A M E T E R;
LIBRARY : L I B R A R Y;
LIMIT : L I M I T;
LIMITS : L I M I T S;
LINAGE : L I N A G E;
LINAGE_COUNTER : L I N A G E MINUSCHAR C O U N T E R;
LINE : L I N E;
LINES : L I N E S;
LINE_COUNTER : L I N E MINUSCHAR C O U N T E R;
LINKAGE : L I N K A G E;
LIST : L I S T;
LOCAL : L O C A L;
LOCAL_STORAGE : L O C A L MINUSCHAR S T O R A G E;
LOCK : L O C K;
LONG_DATE : L O N G MINUSCHAR D A T E;
LONG_TIME : L O N G MINUSCHAR T I M E;
LOWER : L O W E R;
LOWLIGHT : L O W L I G H T;
LOW_VALUE : L O W MINUSCHAR V A L U E;
LOW_VALUES : L O W MINUSCHAR V A L U E S;
MEMORY : M E M O R Y;
MERGE : M E R G E;
MESSAGE : M E S S A G E;
MMDDYYYY : M M D D Y Y Y Y;
MODE : M O D E;
MODULES : M O D U L E S;
MORE_LABELS : M O R E MINUSCHAR L A B E L S;
MOVE : M O V E;
MULTIPLE : M U L T I P L E;
MULTIPLY : M U L T I P L Y;
NAMED : N A M E D;
NATIONAL : N A T I O N A L;
NATIONAL_EDITED : N A T I O N A L MINUSCHAR E D I T E D;
NATIVE : N A T I V E;
NEGATIVE : N E G A T I V E;
NETWORK : N E T W O R K;
NEXT : N E X T;
NO : N O;
NO_ECHO : N O MINUSCHAR E C H O;
NOT : N O T;
NULL : N U L L;
NULLS : N U L L S;
NUMBER : N U M B E R;
NUMERIC : N U M E R I C;
NUMERIC_DATE : N U M E R I C MINUSCHAR D A T E;
NUMERIC_EDITED : N U M E R I C MINUSCHAR E D I T E D;
NUMERIC_TIME : N U M E R I C MINUSCHAR T I M E;
OBJECT_COMPUTER : O B J E C T MINUSCHAR C O M P U T E R;
OCCURS : O C C U R S;
ODT : O D T;
OF : O F;
OFF : O F F;
OMITTED : O M I T T E D;
ON : O N;
OPEN : O P E N;
OPTIONAL : O P T I O N A L;
OR : O R;
ORDER : O R D E R;
ORDERLY : O R D E R L Y;
ORGANIZATION : O R G A N I Z A T I O N;
OTHER : O T H E R;
OUTPUT : O U T P U T;
OVERFLOW : O V E R F L O W;
OVERLINE : O V E R L I N E;
OWN : O W N;
PACKED_DECIMAL : P A C K E D MINUSCHAR D E C I M A L;
PADDING : P A D D I N G;
PAGE : P A G E;
PAGE_COUNTER : P A G E MINUSCHAR C O U N T E R;
PASSWORD : P A S S <NAME> D;
PERFORM : P E R F O R M;
PF : P F;
PH : P H;
PIC : P I C;
PICTURE : P I C T U R E;
PLUS : P L U S;
POINTER : P O I N T E R;
POSITION : P O S I T I O N;
POSITIVE : P O S I T I V E;
PORT : P O R T;
PRINTER : P R I N T E R;
PRINTING : P R I N T I N G;
PRIVATE : P R I V A T E;
PROCEDURE : P R O C E D U R E;
PROCEDURE_POINTER : P R O C E D U R E MINUSCHAR P O I N T E R;
PROCEDURES : P R O C E D U R E S;
PROCEED : P R O C E E D;
PROCESS : P R O C E S S;
PROGRAM : P R O G R A M;
PROGRAM_ID : P R O G R A M MINUSCHAR I D;
PROGRAM_LIBRARY : P R O G R A M MINUSCHAR L I B R A R Y;
PROMPT : P R O M P T;
PURGE : P U R G E;
QUEUE : Q U E U E;
QUOTE : Q U O T E;
QUOTES : Q U O T E S;
RANDOM : R A N D O M;
READER : R E A D E R;
REMOTE : R E M O T E;
RD : R D;
REAL : R E A L;
READ : R E A D;
RECEIVE : R E C E I V E;
RECEIVED : R E C E I V E D;
RECORD : R E C O R D;
RECORDING : R E C O R D I N G;
RECORDS : R E C O R D S;
RECURSIVE : R E C U R S I V E;
REDEFINES : R E D E F I N E S;
REEL : R E E L;
REF : R E F;
REFERENCE : R E F E R E N C E;
REFERENCES : R E F E R E N C E S;
RELATIVE : R E L A T I V E;
RELEASE : R E L E A S E;
REMAINDER : R E M A I N D E R;
REMARKS : R E M A R K S;
REMOVAL : R E M O V A L;
REMOVE : R E M O V E;
RENAMES : R E N A M E S;
REPLACE : R E P L A C E;
REPLACING : R E P L A C I N G;
REPORT : R E P O R T;
REPORTING : R E P O R T I N G;
REPORTS : R E P O R T S;
REQUIRED : R E Q U I R E D;
RERUN : R E R U N;
RESERVE : R E S E R V E;
REVERSE_VIDEO : R E S E R V E MINUSCHAR V I D E O;
RESET : R E S E T;
RETURN : R E T U R N;
RETURN_CODE : R E T U R N MINUSCHAR C O D E;
RETURNING: R E T U R N I N G;
REVERSED : R E V E R S E D;
REWIND : R E W I N D;
REWRITE : R E W R I T E;
RF : R F;
RH : R H;
RIGHT : R I G H T;
ROUNDED : R O U N D E D;
RUN : R U N;
SAME : S A M E;
SAVE : S A V E;
SCREEN : S C R E E N;
SD : S D;
SEARCH : S E A R C H;
SECTION : S E C T I O N;
SECURE : S E C U R E;
SECURITY : S E C U R I T Y;
SEGMENT : S E G M E N T;
SEGMENT_LIMIT : S E G M E N T MINUSCHAR L I M I T;
SELECT : S E L E C T;
SEND : S E N D;
SENTENCE : S E N T E N C E;
SEPARATE : S E P A R A T E;
SEQUENCE : S E Q U E N C E;
SEQUENTIAL : S E Q U E N T I A L;
SET : S E T;
SHARED : S H A R E D;
SHAREDBYALL : S H A R E D B Y A L L;
SHAREDBYRUNUNIT : S H A R E D B Y R U N U N I T;
SHARING : S H A R I N G;
SHIFT_IN : S H I F T MINUSCHAR I N;
SHIFT_OUT : S H I F T MINUSCHAR O U T;
SHORT_DATE : S H O R T MINUSCHAR D A T E;
SIGN : S I G N;
SIZE : S I Z E;
SORT : S O R T;
SORT_CONTROL : S O R T MINUSCHAR C O N T R O L;
SORT_CORE_SIZE : S O R T MINUSCHAR C O R E MINUSCHAR S I Z E;
SORT_FILE_SIZE : S O R T MINUSCHAR F I L E MINUSCHAR S I Z E;
SORT_MERGE : S O R T MINUSCHAR M E R G E;
SORT_MESSAGE : S O R T MINUSCHAR M E S S A G E;
SORT_MODE_SIZE : S O R T MINUSCHAR M O D E MINUSCHAR S I Z E;
SORT_RETURN : S O R T MINUSCHAR R E T U R N;
SOURCE : S O U R C E;
SOURCE_COMPUTER : S O U R C E MINUSCHAR C O M P U T E R;
SPACE : S P A C E;
SPACES : S P A C E S;
SPECIAL_NAMES : S P E C I A L MINUSCHAR N A M E S;
SQL : S Q L;
STANDARD : S T A N D A R D;
STANDARD_1 : S T A N D A R D MINUSCHAR '1';
STANDARD_2 : S T A N D A R D MINUSCHAR '2';
START : S T A R T;
STATUS : S T A T U S;
STOP : S T O P;
STRING : S T R I N G;
SUB_QUEUE_1 : S U B MINUSCHAR Q U E U E MINUSCHAR '1';
SUB_QUEUE_2 : S U B MINUSCHAR Q U E U E MINUSCHAR '2';
SUB_QUEUE_3 : S U B MINUSCHAR Q U E U E MINUSCHAR '3';
SUBTRACT : S U B T R A C T;
SUM : S U M;
SUPPRESS : S U P P R E S S;
SYMBOL : S Y M B O L;
SYMBOLIC : S Y M B O L I C;
SYNC : S Y N C;
SYNCHRONIZED : S Y N C H R O N I Z E D;
TABLE : T A B L E;
TALLY : T A L L Y;
TALLYING : T A L L Y I N G;
TASK : T A S K;
TAPE : T A P E;
TERMINAL : T E R M I N A L;
TERMINATE : T E R M I N A T E;
TEST : T E S T;
TEXT : T E X T;
THAN : T H A N;
THEN : T H E N;
THREAD : T H R E A D;
THREAD_LOCAL : T H R E A D MINUSCHAR L O C A L;
THROUGH : T H R O U G H;
THRU : T H R U;
TIME : T I M E;
TIMER : T I M E R;
TIMES : T I M E S;
TITLE : T I T L E;
TO : T O;
TODAYS_DATE : T O D A Y S MINUSCHAR D A T E;
TODAYS_NAME : T O D A Y S MINUSCHAR N A M E;
TOP : T O P;
TRAILING : T R A I L I N G;
TRUE : T R U E;
TRUNCATED : T R U N C A T E D;
TYPE : T Y P E;
TYPEDEF : T Y P E D E F;
UNDERLINE : U N D E R L I N E;
UNIT : U N I T;
UNSTRING : U N S T R I N G;
UNTIL : U N T I L;
UP : U P;
UPON : U P O N;
USAGE : U S A G E;
USE : U S E;
USING : U S I N G;
VALUE : V A L U E;
VALUES : V A L U E S;
VARYING : V A R Y I N G;
VIRTUAL : V I R T U A L;
WAIT : W A I T;
WHEN : W H E N;
WHEN_COMPILED : W H E N MINUSCHAR C O M P I L E D;
WITH : W I T H;
WORDS : W O R D S;
WORKING_STORAGE : W O R K I N G MINUSCHAR S T O R A G E;
WRITE : W R I T E;
YEAR : Y E A R;
YYYYMMDD : Y Y Y Y M M D D;
YYYYDDD : Y Y Y Y D D D;
ZERO : Z E R O;
ZERO_FILL : Z E R O MINUSCHAR F I L L;
ZEROS : Z E R O S;
ZEROES : Z E R O E S;
// symbols
AMPCHAR : '&';
ASTERISKCHAR : '*';
DOUBLEASTERISKCHAR : '**';
COLONCHAR : ':';
COMMACHAR : ',';
COMMENTENTRYTAG : '*>CE';
COMMENTTAG : '*>';
DOLLARCHAR : '$';
DOUBLEQUOTE : '"';
// period full stop
DOT_FS : '.' ('\r' | '\n' | '\f' | '\t' | ' ')+ | '.' EOF;
DOT : '.';
EQUALCHAR : '=';
EXECCICSTAG : '*>EXECCICS';
EXECSQLTAG : '*>EXECSQL';
EXECSQLIMSTAG : '*>EXECSQLIMS';
LESSTHANCHAR : '<';
LESSTHANOREQUAL : '<=';
LPARENCHAR : '(';
MINUSCHAR : '-';
MORETHANCHAR : '>';
MORETHANOREQUAL : '>=';
NOTEQUALCHAR : '<>';
PLUSCHAR : '+';
SINGLEQUOTE : '\'';
RPARENCHAR : ')';
SLASHCHAR : '/';
// literals
NONNUMERICLITERAL : STRINGLITERAL | DBCSLITERAL | HEXNUMBER | NULLTERMINATED;
fragment HEXNUMBER :
X '"' [0-9A-F]+ '"'
| X '\'' [0-9A-F]+ '\''
;
fragment NULLTERMINATED :
Z '"' (~["\n\r] | '""' | '\'')* '"'
| Z '\'' (~['\n\r] | '\'\'' | '"')* '\''
;
fragment STRINGLITERAL :
'"' (~["\n\r] | '""' | '\'')* '"'
| '\'' (~['\n\r] | '\'\'' | '"')* '\''
;
fragment DBCSLITERAL :
[GN] '"' (~["\n\r] | '""' | '\'')* '"'
| [GN] '\'' (~['\n\r] | '\'\'' | '"')* '\''
;
LEVEL_NUMBER_66 : '66';
LEVEL_NUMBER_77 : '77';
LEVEL_NUMBER_88 : '88';
INTEGERLITERAL : (PLUSCHAR | MINUSCHAR)? [0-9]+;
NUMERICLITERAL : (PLUSCHAR | MINUSCHAR)? [0-9]* (DOT | COMMACHAR) [0-9]+ (('e' | 'E') (PLUSCHAR | MINUSCHAR)? [0-9]+)?;
IDENTIFIER : [a-zA-Z0-9]+ ([-_]+ [a-zA-Z0-9]+)*;
// whitespace, line breaks, comments, ...
NEWLINE : '\r'? '\n' -> channel(HIDDEN);
EXECCICSLINE : EXECCICSTAG WS ~('\n' | '\r' | '}')* ('\n' | '\r' | '}');
EXECSQLIMSLINE : EXECSQLIMSTAG WS ~('\n' | '\r' | '}')* ('\n' | '\r' | '}');
EXECSQLLINE : EXECSQLTAG WS ~('\n' | '\r' | '}')* ('\n' | '\r' | '}');
COMMENTENTRYLINE : COMMENTENTRYTAG WS ~('\n' | '\r')*;
COMMENTLINE : COMMENTTAG WS ~('\n' | '\r')* -> channel(HIDDEN);
WS : [ \t\f;]+ -> channel(HIDDEN);
SEPARATOR : ', ' -> channel(HIDDEN);
// case insensitive chars
fragment A:('a'|'A');
fragment B:('b'|'B');
fragment C:('c'|'C');
fragment D:('d'|'D');
fragment E:('e'|'E');
fragment F:('f'|'F');
fragment G:('g'|'G');
fragment H:('h'|'H');
fragment I:('i'|'I');
fragment J:('j'|'J');
fragment K:('k'|'K');
fragment L:('l'|'L');
fragment M:('m'|'M');
fragment N:('n'|'N');
fragment O:('o'|'O');
fragment P:('p'|'P');
fragment Q:('q'|'Q');
fragment R:('r'|'R');
fragment S:('s'|'S');
fragment T:('t'|'T');
fragment U:('u'|'U');
fragment V:('v'|'V');
fragment W:('w'|'W');
fragment X:('x'|'X');
fragment Y:('y'|'Y');
fragment Z:('z'|'Z');
|
year_2/btp/lab2/Matrices.g4 | honchardev/KPI | 0 | 826 | <filename>year_2/btp/lab2/Matrices.g4<gh_stars>0
grammar Matrices;
/*
* Grammar for expression (V1 ^* V2) * A^1
* where:
* V1, V2 - vectors.
* A - matrix.
* ^* - multiplying two vectors.
* * - multiplying matrices/vectors.
* ^1 - matrix inversion.
*/
/*
* PARSER RULES
*/
root :
input EOF # RootRule
;
input :
assignment # GoToSetVar
| expression # Calculate
;
assignment :
VAR EQUAL input # SetVariable
;
expression :
brack # GoToBrackets
| matrmult # GoToMatrixMult
| vecmult # GoToVectorMult
| inv # GoToInverse
;
brack :
LB vecmult RB # GoToVectorMult2
| LB expression RB # Brackets
;
matrmult :
brack MULT inv # MatrixMult
;
vecmult :
atom VECTMULT atom # VectorMult
;
inv :
atom (INV)? # Inverse
;
atom :
VECTOR # Vector
| MATRIX # Matrix
| VAR # Variable
| brack # GoToBrackets2
;
/*
* LEXER RULES
*/
// Data types.
NUMBER : '-'?([0-9]+ | [0-9]+'.'[0-9]+) ;
VECTOR : '['NUMBER(','NUMBER)*']' ;
MATRIX : '['VECTOR(';'VECTOR)*']' ;
// Variables.
VAR : [A-Z][0-9]+ ;
// Math operators.
MULT : '*' ;
VECTMULT : '^*' ;
INV : '^1' ;
// Different characters.
EQUAL : '=';
LB : '(' ;
RB : ')' ;
// To skip.
WHITESPACE : [ \n\t\r]+ -> skip;
|
programs/oeis/231/A231103.asm | neoneye/loda | 22 | 176162 | ; A231103: Number of n X 3 0..3 arrays x(i,j) with each element horizontally or antidiagonally next to at least one element with value (x(i,j)+1) mod 4, no adjacent elements equal, and upper left element zero.
; 0,2,8,42,208,1042,5208,26042,130208,651042,3255208,16276042,81380208,406901042,2034505208,10172526042,50862630208,254313151042,1271565755208,6357828776042,31789143880208,158945719401042,794728597005208,3973642985026042,19868214925130208,99341074625651042,496705373128255208,2483526865641276042,12417634328206380208,62088171641031901042,310440858205159505208,1552204291025797526042,7761021455128987630208,38805107275644938151042,194025536378224690755208,970127681891123453776042,4850638409455617268880208,24253192047278086344401042,121265960236390431722005208,606329801181952158610026042,3031649005909760793050130208,15158245029548803965250651042,75791225147744019826253255208,378956125738720099131266276042,1894780628693600495656331380208,9473903143468002478281656901042,47369515717340012391408284505208,236847578586700061957041422526042,1184237892933500309785207112630208,5921189464667501548926035563151042,29605947323337507744630177815755208,148029736616687538723150889078776042,740148683083437693615754445393880208
mov $1,5
pow $1,$0
add $1,1
div $1,3
mov $0,$1
|
power.asm | SkyRocketToys/Recoil_Hub_Power | 9 | 22060 | ; -----------------------------------------------------------------------------
; Recoil Gun Base Station Power control chip
; (c) 2017 HotGen Ltd.
; Written for the TR4P151AF chip
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; Note about options on the TR4P151AF
; Security: is unlock (can be locked i think)
; WDT: is disabled (can be enabled i think)
; RTCEN: is disabled (unused)
; PA3: is PA3 (unused pin, probably best with this schematic)
; XT32ENB: disabled (must be disabled with this schematic)
; EXT_OSC: disabled (must be disabled with this schematic)
; ADJ: IO (PB0 must be I/O - non-default option)
; IADJ: is 0
; MCK: is 8 MHz (if this changes then the timing constants e.g. Tim2_Speed needs to change)
; OSC: is 14.33 kHz (green mode unused)
; IR: disabled (must be disabled since PA1 is an input)
; -----------------------------------------------------------------------------
; *****************************************************************************
; Notes about assembly language
; jc = jump if less than
; jnc = jump if greater or equal
; *****************************************************************************
; -----------------------------------------------------------------------------
; PINOUT
; 1. VCC
; 2. PB1 = USR (active high input)
; 3. PB0 = PWR (active high output)
; 4. PA3 = unused
;
; 5. PA2 = LED (active low output)
; 6. PA1 = PWR_CTRL_RX (active low input) (was active high)
; 7. PA0 = PWR_CTRL_TX (active high output)
; 8. GND
;
; GPIO
; PA0 = PWR_CTRL_TX/LED3 = output tx
; PA1 = PWR_CTRL_RX/LED2 = input rx (low when button pressed on board)
; PA2 = LED = output high (on or flashing)
; PA3 = unused = input pull high
; PB0 = PWR = output high
; PB1 = USR = input pull low (high when button pressed on board)
;
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; Behaviour of inputs
;
; PWR_CTRL_1 signal = (input from cpu) - CPU should raise this to turn the power off, then lower it when it is done.
; USR = press this button for a small amount of time in order to trigger power off
;
; -----------------------------------------------------------------------------
; Behaviour of outputs
;
; PWR = On power on, turn this on.
; On power off turn this off (after the LED sequence).
; LED = on power on, turn on after a short delay
; on power off, flash a few times and turn off
; PWR_CTRL_2 signal = (output to cpu) - we raise this to warn the CPU of imminent power off
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; Defines
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; Include Block
; -----------------------------------------------------------------------------
#include "power.inc"
; -----------------------------------------------------------------------------
; Hardware register values
; -----------------------------------------------------------------------------
WDT_KICK equ 5 ; Value to kick the watchdog with
; -----------------------------------------------------------------------------
; User defined "registers" (SRAM variables)
; -----------------------------------------------------------------------------
#define Optimal_MAH_PCH ; System MAH + PCH Optimal (Optimal MAH and PCH)
VARRM = {
; -------------------------------------
; System variables
A_SRT ; Save the A register during an interrupt
g_timer0 ; Counts up every 0.1ms
g_timer1 ; Counts up every 1.6ms
g_timer2 ; Counts up every 25.6ms
g_timer3 ; Counts up every 409.6ms
ButtonCnt0 ; How many samples 1.6ms of the button have been off?
ButtonCnt1 ; How many samples 1.6ms of the button have been on?
ButtonOn ; Is the button on (1) or off (0)?
ButtonPress ; Has the button been pressed?
ButtonInit ; Are we in the initial phase (where the button might be on)?
PowerOff ; Power off the device (if non-zero)
led_pwm ; How bright the LED should be (15=full)
off_timer0 ; Counts up every 1.6ms
off_timer1 ; Counts up every 25.6ms
off_phase0 ; Counts up every 307.2ms (phases: LED 0=off 1=on 2=off 3=on 4=off 5=on 6=poweroff)
off_phase1 ;
cpu_last_rx ; The last value (0 or BIT_RX) of the input pin
rxb_timer0 ; Counts up every 0.1ms
rxb_timer1 ; Counts up every 1.6ms
rxb_timer2 ; Counts up every 25.6ms
rxb_timer3 ; Counts up every 409.6ms
rxb_bits ; The input payload
rxb_count ; How many payload bits have been received
rxb_cmd ; A received command (or 0=none)
rxb_err0 ; How many errors have I received?
rxb_err1 ; How many errors have I received?
pwr_ack ; Non zero if the CPU has acknowledged the power out (but it still wants 8 seconds to power down)
led_pwm_base ; For supporting flash effects
led_flash0 ; Flash effects for LED
led_flash1 ; Flash effects for LED
led_flash2 ; Flash effects for LED
led_flash3 ; Flash effects for LED
; Second bank of RAM
led_timer0 ; Counts up every 1.6ms
led_timer1 ; Counts up every 25.6ms
led_timer2 ; Counts up every 409.6ms
led_glow ; 1 for boot glow
led_glow2 ; 1 for held button glow
ButtonOn0 ; Counts up every 1.6ms
ButtonOn1 ; Counts up every 25.6ms
ButtonOn2 ; Counts up every 409.6ms
g_pwd_reset ; 1 when we are sending password reset command to Atheros chip
g_pwd_time0 ; Counts up every 1.6ms
g_pwd_time1 ; Counts up every 25.6ms
g_pwd_pulse ; Counts up every pulse
}
; -----------------------------------------------------------------------------
; General Parameters for the program
VINT_MAH equ 00 ; The SRAM bank we want to use inside the interrupt [Mind you, Optima overrides this]
Tim2_Speed equ 256-100 ; 100uS = 10kHz
PORT_PWR equ data_pb
PIN_PWR equ 0
BIT_PWR equ 1 << PIN_PWR
PORT_USR equ data_pb
PIN_USR equ 1
BIT_USR equ 1 << PIN_USR
PORT_LED equ data_pa
PIN_LED equ 2
BIT_LED equ 1 << PIN_LED
PORT_RX equ data_pa
PIN_RX equ 1
BIT_RX equ 1 << PIN_RX
XOR_RX equ BIT_RX ; Either BIT_RX for inverted or 0 for normal
PORT_TX equ data_pa
PIN_TX equ 0
BIT_TX equ 1 << PIN_TX
; Timing parameters
TIMEOUT_FAST equ 24 ; Timeout if CPU acknowledges me
TIMEOUT_SLOW equ 30 ; Timeout if CPU does not acknowledge
TIMEOUT_PHASE equ 192 ; Timeout in 1.6ms units between phases (~300ms)
TIMEOUT_RX equ 64 ; Timeout in 1.6ms units for CPU RX to cause power down
SAT_HIGH equ 15 ; Timeout in 1.6ms units for button press to transition to high
SAT_LOW equ 15 ; Timeout in 1.6ms units for button press to transition to low
TIMEOUT_PASSWORD equ 3072 ; Timeout in 1.6ms units for the keypress (~5s)
TIMEOUT_GLOW equ 1280 ; Timeout in 1.6ms units for the keypress (~2s)
TIME_PWD_HIGH equ 62 ; Timeout in 1.6ms units for the password pulse
TIME_PWD_LOW equ TIME_PWD_HIGH
TIME_PWD_ALL equ TIME_PWD_HIGH+TIME_PWD_LOW
NUM_PWD_PULSES equ 8 ; Enough pulses for the CPU to see it (1.6s)
; Timing for the rx protocol
TIME_STEP equ 500 ; Time in 0.1ms units (50ms base tick)
TIME_SLOP equ 200 ; Allow 20ms slop each way (10% slop on 4 unit periods)
TIME_ONE_MIN equ TIME_STEP*1-TIME_SLOP ;
TIME_ONE_MAX equ TIME_STEP*1+TIME_SLOP ;
TIME_TWO_MIN equ TIME_STEP*2-TIME_SLOP ;
TIME_TWO_MAX equ TIME_STEP*2+TIME_SLOP ;
TIME_FOUR_MIN equ TIME_STEP*4-TIME_SLOP ;
TIME_FOUR_MAX equ TIME_STEP*4+TIME_SLOP ;
TIME_IDLE_MIN equ TIME_STEP*6 ; Not used; assumed to be 16*16*16 = 409.6ms
; Commands for the other side to send
CMD_NULL equ 0 ; Bits 0x001EA on the wire
CMD_REBOOTING equ 1 ; Bits 0x003D6 on the wire
CMD_BOOTED equ 2 ; Bits 0x003D2 on the wire
CMD_ACK_POWER equ 3 ; Bits 0x007A6 on the wire
CMD_ERROR_1 equ 8 ; Bits 0x003CA on the wire
CMD_ERROR_2 equ 10 ; Bits 0x00792 on the wire
CMD_ERROR_3 equ 11 ; Bits 0x00F26 on the wire
CMD_POWER_OFF equ 13 ; Bits 0x00F36 on the wire
; -----------------------------------------------------------------------------
; PROGRAM Entry points
; -----------------------------------------------------------------------------
; (0) Entry point for program start
org 0
ldpch PGMSRT
jmp PGMSRT
nop
nop
; (4) Entry point for wakeup
ldpch WakeUp
jmp WakeUp
nop
nop
; (8) Entry point for interrupt start (Timer1, Timer2, RTC)
ldpch INT_Start
jmp INT_Start
; -----------------------------------------------------------------------------
; Main Interrupt routine for Timer1, Timer2, RTC
; Hardware will store the following registers and restore them on RETI
; MAH = Memory address high
; PCH = Program counter high
; PCL = Program counter low
; CZ = Carry and Zero flags of the status register
; ENINT = ENINT flag of the SYS0 register
; Cannot call subroutines; must preserve other registers (e.g. A)
; -----------------------------------------------------------------------------
INT_Start:
ldmah #VINT_MAH ; (Optima will do this anyway)
ld (A_SRT),A ; Preserve the A register over the interrupt
; Despatch the interrupt
; Is this interrupt from the real time clock? (once per second)
ld a,(RTC)
and A,#1000B;RTCFG/F38K/RTCS1/RTCS0
jz RTC_Acked
; This interrupt is from the real time clock (not important)
clr #3,(RTC) ; Clear the real time clock overflow flag
RTC_Acked:
; Is this interrupt from Timer1? (should not happen)
ld A,(STATUS);TM2IFG/TM1IFG/CF/ZF
and A,#0100B
jz Timer1_Acked
clr #2,(STATUS) ; Clear the timer1 interrupt flag
Timer1_Acked:
; Is this interrupt from Timer2?
ld a,(STATUS)
and A,#1000B
jz Timer2_Acked
; Timer 2 interrupt
clr #3,(STATUS) ; Clear the timer2 interrupt flag
inc (g_timer0)
adr (g_timer1)
adr (g_timer2)
adr (g_timer3)
; Support fake PWM on the LED
ld A,(g_timer0)
cmp A,(led_pwm)
jc PwmLedOn ; jump on less
set #PIN_LED,(PORT_LED) ; Turn off the LED
jmp PwmLedDone
PwmLedOn:
clr #PIN_LED,(PORT_LED)
PwmLedDone:
; Look at the rx bits
inc (rxb_timer0)
adr (rxb_timer1)
adr (rxb_timer2)
jc RxOverflow ; We have overflowed (409.6ms) so this is idle
; Look at the bits
ld a,(PORT_RX)
and a,#BIT_RX
cmp A,(cpu_last_rx)
jz RxNotChanged
; A transition has occurred
ld (cpu_last_rx),A
; Compare with IDLE time
ld A,(rxb_timer3)
jnz RxReset
; Compare with TIME_ONE_MIN
ld A,(rxb_timer0)
cmp A,#TIME_ONE_MIN.n0
ld A,(rxb_timer1)
sbc A,#TIME_ONE_MIN.n1
ld A,(rxb_timer2)
sbc A,#TIME_ONE_MIN.n2
jc RxError
; Compare with TIME_ONE_MAX
ld A,(rxb_timer0)
cmp A,#TIME_ONE_MAX.n0
ld A,(rxb_timer1)
sbc A,#TIME_ONE_MAX.n1
ld A,(rxb_timer2)
sbc A,#TIME_ONE_MAX.n2
jc RxOne
; Compare with TIME_TWO_MIN
ld A,(rxb_timer0)
cmp A,#TIME_TWO_MIN.n0
ld A,(rxb_timer1)
sbc A,#TIME_TWO_MIN.n1
ld A,(rxb_timer2)
sbc A,#TIME_TWO_MIN.n2
jc RxError
; Compare with TIME_TWO_MAX
ld A,(rxb_timer0)
cmp A,#TIME_TWO_MAX.n0
ld A,(rxb_timer1)
sbc A,#TIME_TWO_MAX.n1
ld A,(rxb_timer2)
sbc A,#TIME_TWO_MAX.n2
jc RxTwo
; Compare with TIME_FOUR_MIN
ld A,(rxb_timer0)
cmp A,#TIME_FOUR_MIN.n0
ld A,(rxb_timer1)
sbc A,#TIME_FOUR_MIN.n1
ld A,(rxb_timer2)
sbc A,#TIME_FOUR_MIN.n2
jc RxError
; Compare with TIME_FOUR_MAX
ld A,(rxb_timer0)
cmp A,#TIME_FOUR_MAX.n0
ld A,(rxb_timer1)
sbc A,#TIME_FOUR_MAX.n1
ld A,(rxb_timer2)
sbc A,#TIME_FOUR_MAX.n2
jc RxFour
jmp RxOverflow
RxChanged:
ld a,#0
ld (rxb_timer0),a
ld (rxb_timer1),a
ld (rxb_timer2),a
ld (rxb_timer3),a
RxNotChanged:
Timer2_Acked:
ld a,(A_SRT) ; Restore the A register
reti
; Flag as a long transition, no packet
RxOverflow:
ld a,#1
ld (rxb_timer3),a
ld a,#0
ld (rxb_bits),A
ld (rxb_count),A
ld a,(PORT_RX)
and a,#BIT_RX
ld (cpu_last_rx),A
jmp RxNotChanged
RxError:
; For debugging - count errors
inc (rxb_err0)
adr (rxb_err1)
RxReset:
ld a,#0
ld (rxb_bits),A
ld (rxb_count),A
jmp RxChanged
; Receive a zero payload bit (one time unit pulse)
RxOne:
inc (rxb_count)
clr c
rrc (rxb_bits)
jmp RxChanged
; Receive a one payload bit (two time unit pulse)
RxTwo:
inc (rxb_count)
set c
rrc (rxb_bits)
jmp RxChanged
; Receive an end of packet pulse (four time unit pulse)
RxFour:
ld A,(rxb_count)
cmp A,#4
jnz RxError
; We have received a command!
ld A,(rxb_bits)
ld (rxb_cmd),A
jmp RxReset
; -----------------------------------------------------------------------------
; MAIN PROGRAM entry point
PGMSRT:
ld A,#0
ld (SYS0),A ; Disable interrupts
ld (USER1),A ; This nybble could be used by user code (and is)
ld (USER2),A ; This nybble could be used by user code (but isn't)
; Initialise input/output (power on but no LED)
call PODY_IO_Init
; Delay loop (uses SRAM before it is cleared)
; Should be 11*0xD0000/2 = about 0.585 seconds
ldmah #0
ld A,#0
ld (20H),A
ld (21H),A
ld (22H),A
ld (23H),A
ld A,#0DH ; Short delay
ld (24H),A ; 20 bit timer 0xD0000
DELAY1:
ld A,#WDT_KICK
ld (WDT),A ; Kick the watchdog
ld A,(20H)
clr C
adc A,#2
ld (20H),A
adr (21H)
adr (22H)
adr (23H)
adr (24H)
jnc DELAY1
; Initialise input/output again
call PODY_IO_Init
; Clear Banks 0..3 of SRAM
ldmah #3
call Clear_SRAM_INIT
ldmah #2
call Clear_SRAM_INIT
ldmah #1
call Clear_SRAM_INIT
ldmah #0
call Clear_SRAM_INIT
; Setup timer2 interrupt every 100uS
ldmah #0
call Timer2_Init
; Turn on the LED
ld A,#4 ; Low for booting
call Led_SetSolid
clr #PIN_LED,(PORT_LED)
ld A,#1
ld (led_glow),A
; Initialise the button variables
ld a,#SAT_HIGH
ld (ButtonCnt1),A
ld a,#0
ld (ButtonCnt0),A
ld (ButtonPress),A
ld (PowerOff),A
ld a,#1
ld (ButtonOn),A
ld (ButtonInit),A
; -----------------------------------------------------------------------------
; Where wakeup code would return to
WakeUp:
nop
nop
; We want the RTC interrupt to be every 1s instead of 125ms to avoid disruption
set #1,(RTC)
set #0,(RTC)
; -----------------------------------------------------------------------------
; Main loop
MAIN_LOOP:
; Kick the watchdog
nop
nop
ld a,#WDT_KICK
ld (WDT),a
set #1,(SYS0) ; Enable interrupts
nop ; paranoid
; Check the output direction
ld a,#0101b ;
ld (IOC_PA),a ; Port A direction (0=input/1=output)
ld a,#0001b
ld (IOC_PB),a ; Port B dir (0=input/1=output)
; Throttle the main loop to 1.6ms
ld a,(g_timer1)
Wait_irq:
cmp a,(g_timer1)
jz Wait_irq
; Make the LED glow/flash
call Led_Flash
; Check for commands from CPU (even when powering off)
ld a,(rxb_cmd)
cmp a,#CMD_ACK_POWER
jz CmdAckPower
; Check for commands from CPU (only when not powering off)
ld A,(PowerOff)
jnz NoCmd
ld a,(rxb_cmd)
jz NoCmd
cmp a,#CMD_REBOOTING
jz CmdRebooting
cmp a,#CMD_BOOTED
jz CmdBooted
; cmp a,#CMD_ACK_POWER
; jz CmdAckPower
cmp a,#CMD_ERROR_1
jz CmdError1
cmp a,#CMD_ERROR_2
jz CmdError2
cmp a,#CMD_ERROR_3
jz CmdError3
cmp a,#CMD_POWER_OFF
jz CmdPowerOff
jmp DoneCmd
CmdRebooting:
ld A,#4
ld (led_pwm_base),A
ld A,#1
ld (led_glow),A
ld A,#0101b
ld (led_flash0),a
ld (led_flash1),a
ld (led_flash2),a
ld (led_flash3),a
jmp DoneCmd
CmdBooted:
ld A,#15
call Led_SetSolid
jmp DoneCmd
CmdAckPower:
ld a,#1
ld (pwr_ack),A
ld a,#0
ld (off_phase0),A
ld (off_phase1),A
ld A,#4
call Led_SetSolid
jmp DoneCmd
CmdError1:
ld A,#10
ld (led_pwm_base),A
ld A,#0
ld (led_glow),A
ld A,#1110b
ld (led_flash0),a
ld A,#1111b
ld (led_flash1),a
ld (led_flash2),a
ld (led_flash3),a
jmp DoneCmd
CmdError2:
ld A,#10
ld (led_pwm_base),A
ld A,#0
ld (led_glow),A
ld A,#1010b
ld (led_flash0),a
ld A,#1111b
ld (led_flash1),a
ld (led_flash2),a
ld (led_flash3),a
jmp DoneCmd
CmdError3:
ld A,#10
ld (led_pwm_base),A
ld A,#0
ld (led_glow),A
ld A,#1010b
ld (led_flash0),a
ld A,#1110b
ld (led_flash1),a
ld A,#1111b
ld (led_flash2),a
ld (led_flash3),a
jmp DoneCmd
CmdPowerOff:
ld A,#0
ld (rxb_cmd),A
jmp StartPowerOff
; We have processed the command
DoneCmd:
ld A,#0
ld (rxb_cmd),A
NoCmd:
; Check for input from user and debounce it (25ms required)
ld a,(PORT_USR)
and a,#BIT_USR
jz Main_UsrLow
; Usr pin is high, hence pressed. Debounce this.
ld a,#0
ld (ButtonCnt0),a
ld a,(ButtonCnt1)
cmp a,#SAT_HIGH
jz Saturated1
inc (ButtonCnt1)
jmp NotSaturated
Main_UsrLow:
; Usr pin is low, hence released. Debounce this.
ld a,#0
ld (ButtonCnt1),a
ld a,(ButtonCnt0)
cmp a,#SAT_LOW
jz Saturated0
inc (ButtonCnt0)
jmp NotSaturated
Saturated0:
ld a,#0
ld (ButtonOn),a
ld (ButtonInit),A
jmp NotSaturated
Saturated1:
ld a,#1
ld (ButtonOn),a
NotSaturated:
; Have we pressed the button?
ld a,(ButtonInit)
jnz StillInit
ld A,(ButtonOn)
jz StillOff
ld a,#1
ld (ButtonPress),a
; How low are we holding the button?
inc (ButtonOn0)
adr (ButtonOn1)
adr (ButtonOn2)
; Are we holding the button long enough to reset the password?
ld a,(ButtonOn0)
cmp a,#TIMEOUT_PASSWORD.n0
ld a,(ButtonOn1)
sbc a,#TIMEOUT_PASSWORD.n1
ld a,(ButtonOn2)
sbc a,#TIMEOUT_PASSWORD.n2
jnc ResetPassword
; Are we holding the button long enough to start glowing?
ld a,(ButtonOn0)
cmp a,#TIMEOUT_GLOW.n0
ld a,(ButtonOn1)
sbc a,#TIMEOUT_GLOW.n1
ld a,(ButtonOn2)
sbc a,#TIMEOUT_GLOW.n2
jc StillInit
; Start glowing
ld a,#1
ld (led_glow2),a
jmp StillInit
; This is called repeatedly when the user holds the button down for more than 5 seconds
ResetPassword:
ld a,#1
ld (g_pwd_reset),a
ld a,#0
ld (g_pwd_pulse),A
ld (g_pwd_time0),A ; Wait until user releases button before telling CPU
ld (g_pwd_time1),A
ld a,#14 ; safely high number (will increment to 15 which is within a nybble)
ld (ButtonOn2),A ; don't overflow to zero, but keep it higher than TIMEOUT_PASSWORD.n2
jmp StillInit
StillOff:
; Reset the button hold counter
ld a,#0
ld (ButtonOn0),a
ld (ButtonOn1),a
ld (ButtonOn2),a
StillInit:
; Check for sending pulses to the CPU
ld A,(PowerOff)
jnz NoPwdResetPulse
ld A,(g_pwd_reset)
jz NoPwdResetPulse
inc (g_pwd_time0)
adr (g_pwd_time1)
ld A,(g_pwd_time0)
cmp a,#TIME_PWD_ALL.n0
ld A,(g_pwd_time1)
sbc a,#TIME_PWD_ALL.n1
jc NotPwdOver
; The password pulse has ticked
clr #PIN_TX,(PORT_TX) ;
ld a,#0
ld (g_pwd_time0),A
ld (g_pwd_time1),A
inc (g_pwd_pulse)
ld A,(g_pwd_pulse)
cmp a,#NUM_PWD_PULSES
jc NoPwdResetPulse
; We have sent enough pulses
ld a,#0
ld (g_pwd_pulse),A
ld (g_pwd_reset),A
ld (g_pwd_time0),A
ld (g_pwd_time1),A
; Go into rebooting state
ld A,#1
ld (led_glow),A
NotPwdOver:
ld A,(g_pwd_time0)
cmp a,#TIME_PWD_HIGH.n0
ld A,(g_pwd_time1)
sbc a,#TIME_PWD_HIGH.n1
jc NotPwdHigh
set #PIN_TX,(PORT_TX) ; Tell the CPU to reset password
jmp NoPwdResetPulse
NotPwdHigh:
clr #PIN_TX,(PORT_TX) ;
NoPwdResetPulse:
; Have we released the button after a press?
ld A,(ButtonOn)
jnz StillOn
ld A,(ButtonPress)
jz StillOn
; We have pressed and released the button: was it turn off or password reset?
ld a,(led_glow2)
jz NotGlow2
; Cancel the led glowing but dont turn off
ld a,#0
ld (led_glow2),a
ld (ButtonPress),A
jmp PowerStillOn
NotGlow2:
; Trigger the off sequence (if it is not already triggered)
ld A,(PowerOff)
jnz StillOn
; Start the sequence
StartPowerOff:
ld a,#1
ld (PowerOff),A
ld a,#0
ld (off_timer0),a
ld (off_timer1),a
ld (off_phase0),a
ld (off_phase1),a
ld (pwr_ack),A
ld (g_pwd_reset),A
set #PIN_TX,(PORT_TX) ; Tell the CPU we are switching off
StillOn:
; Perform power off sequence
ld A,(PowerOff)
jz PowerStillOn
inc (off_timer0)
adr (off_timer1)
ld a,(off_timer1)
cmp a,#TIMEOUT_PHASE.n1
jnz PowerSamePhase
; Increase the phase every 300 ms
ld a,#0
ld (off_timer1),a
ld (off_timer0),a ; Unneeded
inc (off_phase0)
adr (off_phase1)
ld a,(pwr_ack)
jz PowerWaitCpu
; Fast timeout
ld a,(off_phase0)
cmp a,#TIMEOUT_FAST.n0
ld a,(off_phase1)
sbc a,#TIMEOUT_FAST.n1
jnc PowerNowOff ; We are in the turn off phase
jmp PowerSamePhase
; We are in shut down phase and CPU has not acknowledged yet
PowerWaitCpu:
ld a,(off_phase0)
cmp a,#TIMEOUT_SLOW.n0
ld a,(off_phase1)
sbc a,#TIMEOUT_SLOW.n1
jnc PowerNowOff ; We are in the turn off phase
PowerSamePhase:
; Set the visible LED on or off
ld a,(off_phase0)
and a,#1
jz PowerOffLed
; Turn on the LED
ld A,(pwr_ack)
jnz PowerOnAck
ld A,#8
call Led_SetSolid
jmp PowerStillOn
PowerOnAck:
ld A,#4
call Led_SetSolid
jmp PowerStillOn
PowerOffLed:
ld A,#0
call Led_SetSolid
PowerStillOn:
jmp MAIN_LOOP
; -----------------------------------------------------------------------------
; Turn off the power to the CPU
PowerNowOff:
; set #PIN_TX,(PORT_TX)
; clr #PIN_RX,(PORT_RX)
; set #PIN_LED,(PORT_LED)
ld a,#1111b ;
ld (data_pa),a ; Port A data (0=low/1=high)
; clr #PIN_PWR,(PORT_PWR)
; clr #PIN_USR,(PORT_USR)
ld a,#0000b
ld (data_pb),a ; Port B data (0=low/1=high)
; Wait 200ms - on real hardware during this time I would lose my own power
ld a,(g_timer2)
clr c
adc a,#8
Wait2_irq:
cmp a,(g_timer2)
jnz Wait2_irq
clr #1,(SYS0) ; Clear ENINT and disable interrupts
nop
nop
halt
HaltEnd:
jmp HaltEnd
; -----------------------------------------------------------------------------
PODY_IO_Init:
; PIN A0 LED3 (active high) = output low
; PIN A1 LED2 (active high) = input pull low
; PIN A2 LED (active low) = output high
; PIN A3 (unused) = input pull high
ld a,#0101b ;
ld (IOC_PA),a ; Port A direction (0=input/1=output)
; clr #PIN_TX,(PORT_TX)
; clr #PIN_RX,(PORT_RX)
; set #PIN_LED,(PORT_LED)
ld a,#1110b
ld (data_pa),a ; Port A data (0=low/1=high)
ld a,#0000b
ld exio(pawk),a ; Port A wakeup - none
ld a,#1010b
ld exio(papu),a ; Port A pull up 100kOhm resistor
ld a,#0000b
ld exio(papl),a ; Port A pull down 100kOhm resistor
; Pin B0 PWR (active high) = output high
; Pin B1 USR (active high) = input pull low (wake)
; Pin B2 (unused) = input pull low
; Pin B3 (unused) = input pull low
ld a,#0001b
ld (IOC_PB),a ; Port B dir (0=input/1=output)
; set #PIN_PWR,(PORT_PWR)
; clr #PIN_USR,(PORT_USR)
ld a,#0001b
ld (data_pb),a ; Port B data (0=low/1=high)
ld a,#0010b
ld exio(pbwk),a ; Port B wakeup
ld a,#0000b
ld exio(pbpu),a ; Port B pull up 100kOhm resistor
ld a,#1110b
ld exio(pbpl),a ; Port B pull down 100kOhm resistor
rets
; -----------------------------------------------------------------------------
; Clear a single bank (32 nybbles) of SRAM
Clear_SRAM_INIT:
ld A,#00H
ld (20H),A
ld (21H),A
ld (22H),A
ld (23H),A
ld (24H),A
ld (25H),A
ld (26H),A
ld (27H),A
ld (28H),A
ld (29H),A
ld (2AH),A
ld (2BH),A
ld (2CH),A
ld (2DH),A
ld (2EH),A
ld (2FH),A
ld (30H),A
ld (31H),A
ld (32H),A
ld (33H),A
ld (34H),A
ld (35H),A
ld (36H),A
ld (37H),A
ld (38H),A
ld (39H),A
ld (3AH),A
ld (3BH),A
ld (3CH),A
ld (3DH),A
ld (3EH),A
ld (3FH),A
rets
; -----------------------------------------------------------------------------
; Set up timer 2 for 100uS interrupt (10kHz) +/- 2%
; High speed oscillator HRCOSC = 32Mhz
; CPU clock FMCK = /4 = 8Mhz
; Scaler2 = Div8 = 1MHz
; Timer2 = 0x9C = 10kHz
Timer2_Init:
ld a,#0
ld (TMCTL),A;3:TM2EN,2:TM1EN,1:TM1SCK,0:TM1ALD
nop
set #3,(TMCTL)
set #3,(SYS0) ;3:TM2SK,2:TM1SK,1:ENINI,0:PWM0
clr #1,(SYS0) ; Clear ENINI (disable interrupts)
nop ; Safety measure from clearing global interrupts
clr #0,(SYS0) ; Clear PWM0 mode
nop
; Set Timer2 Autoload enabled and scalar to div8 (i.e. 1Mhz)
ld a,#1101b
ld (SCALER2),A ;div2-div1-div0. 8M/8=1. auto download
; timing = (256 - time val/(time clock)) so 0xCE is 50uS
ld A,#Tim2_Speed.N0 ; Low nybble
ld (TIM2),A
ld A,#Tim2_Speed.N1 ; High nybble
ld (TIM2),A
; set #1,(SYS0) ; Set ENINI
nop
Timr2_Init_End:
rets
; -----------------------------------------------------------------------------
; Input: A = the LED value
Led_SetSolid:
ld (led_pwm_base),A
ld A,#0
ld (led_glow),A
ld (led_glow2),A
ld A,#1111b
ld (led_flash0),A
ld (led_flash1),A
ld (led_flash2),A
ld (led_flash3),A
rets
; -----------------------------------------------------------------------------
; Flash the LED according to the flash characteristics
Led_Flash:
; Keep track of time
inc (led_timer0) ; Every 1.6ms
adr (led_timer1) ; Every 25.6ms
adr (led_timer2) ; Every 409.6ms
ld A,(g_pwd_reset)
jnz LF_Password
ld A,(led_glow2)
jnz LF_Glow2
ld A,(led_glow)
jnz LF_Glow
ld A,(led_timer1)
cmp A,#8 ; ~200ms
jnz LF_Done
; Every so often, flash the LED
ld A,#0
ld (led_timer0),A
ld (led_timer1),A
clr c
rrc (led_flash3)
rrc (led_flash2)
rrc (led_flash1)
rrc (led_flash0)
jc LF_On
; We are in the off phase of a flash
ld a,#0
ld (led_pwm),A
rets
LF_On:
; We are in the on phase of a flash
ld A,(led_flash3) ; Rotate the bit back in there
or A,#8
ld (led_flash3),A
ld A,(led_pwm_base)
ld (led_pwm),A
LF_Done:
rets
; Glow on bootup (0 to 15 to 0 PWM)
LF_Glow:
ld a,(led_timer2)
and a,#1
jnz LF_GlowDown
ld a,(led_timer1)
ld (led_pwm),A
rets
LF_GlowDown:
ld a,(led_timer1)
xor a,#15
ld (led_pwm),A
rets
; Glow on button held (15 to 8 to 15 PWM)
LF_Glow2:
ld a,(led_timer1)
and a,#8
jz LF_Glow2Down
ld a,(led_timer1)
ld (led_pwm),A
rets
LF_Glow2Down:
ld a,(led_timer1)
xor a,#15
ld (led_pwm),A
rets
; Throb on password reset being sent
LF_Password:
ld a,(led_timer2)
and a,#1
jz LF_PwdOff
ld a,(led_timer1)
and a,#8
jz LF_PwdDown
ld a,(led_timer1)
ld (led_pwm),A
rets
LF_PwdDown:
ld a,(led_timer1)
xor a,#15
ld (led_pwm),A
rets
LF_PwdOff:
ld a,(g_pwd_pulse)
ld (led_pwm),A
rets
|
uBLL/bll_2nd_stage.asm | 42Bastian/new_bll | 4 | 176704 | <filename>uBLL/bll_2nd_stage.asm
***************
* Mini COMLynx Loader (not size optimized)
* 2nd stage
****************
include <includes/hardware.inc>
Baudrate EQU 62500
;;; ROM sets this address
screen0 equ $2000
run $100-1
Start::
dc.b size ; needed for 1st stage
ldx #12-1
.sloop
ldy SUZY_addr,x
lda SUZY_data,x
sta $fc00,y
dex
bpl .sloop
ldx #7-1
.mloop
ldy MIKEY_addr,x
lda MIKEY_data,x
sta $fd00,y
dex
bpl .mloop
wait:
jsr read_byte
cmp #0x81
bne wait
jsr read_byte
cmp #'P'
bne wait
load_len equ $0
load_ptr equ $2
load_len2 equ $4
load_ptr2 equ $6
Loader::
ldy #4
.loop0 jsr read_byte
sta load_len-1,y
sta load_len2-1,y ; mirror for call
dey
bne .loop0 ; get destination and length
tax ; lowbyte of length
.loop1 inx
bne .1
inc load_len+1
bne .1
jmp (load_ptr)
.1 jsr read_byte
sta (load_ptr2),y
sta $fdb0
iny
bne .loop1
inc load_ptr2+1
bra .loop1
read_byte
bit $fd8c
bvc read_byte
lda $fd8d
rts
;;;------------------------------
;; Writing low-byte in SUZY space clears highbyte!
_SDONEACK EQU SDONEACK-$fd00
_CPUSLEEP EQU CPUSLEEP-$fd00
MIKEY_addr
dc.b $10,$11,$8c,_CPUSLEEP,_SDONEACK,$b3,$a0
MIKEY_data
dc.b 125000/Baudrate-1,%11000,%11101,0,0,$0f,0
_SCBNEXT EQU SCBNEXT-$fc00
_SPRGO EQU SPRGO-$fc00
SUZY_addr
db _SPRGO,_SCBNEXT+1,_SCBNEXT,$09,$08,$04,$06,$28,$2a,$83,$92,$90
SUZY_data
db 1,>plot_SCB,<plot_SCB,$20,$00,$00,$00,$7f,$7f,$f3,$00
plot_SCB:
next:
db $01 ;0
dc.b SPRCTL1_LITERAL| SPRCTL1_DEPTH_SIZE_RELOAD ;1
dc.b 0 ;2
dc.w 0 ;3
dc.w plot_data ;5
plot_x dc.w 80-21 ;7
plot_y dc.w 51-3 ;9
dc.w $100 ;11
dc.w $200 ;13
plot_color: ;15
db 3
plot_data:
;; "NEW_BLL"
ibytes "new_bll.spr"
End:
size set End-Start
echo "Size:%dsize "
|
lib/am335x_sdk/ti/csl/src/ip/tsc/V0/csl_tsc.asm | brandonbraun653/Apollo | 2 | 3220 | ; *****************************************************************************
; * Copyright (c) Texas Instruments Inc 2008, 2009
; *
; * Use of this software is controlled by the terms and conditions found
; * in the license agreement under which this software has been supplied
; * provided
; *****************************************************************************
;
; * @file csl_tsc.asm
; *
; * @brief Assembly file for functional layer of TSC CSL
; *
; * \par
; * ============================================================================
; * @n (C) Copyright 2008, 2009, Texas Instruments, Inc.
; * @n Use of this software is controlled by the terms and conditions found
; * @n in the license agreement under which this software has been supplied.
; * ===========================================================================
; * \par
.global _CSL_tscEnable
.global CSL_tscEnable
.sect ".text:cslsys_section:tsc"
_CSL_tscEnable:
BNOP B3, 4 ;
MVC A4, TSCL ; Initiate CPU Timer by writing to TSCL
.global _CSL_tscRead
.global CSL_tscRead
.sect ".text:cslsys_section:tsc"
_CSL_tscRead:
BNOP B3, 2 ; Branch Return Pointer
MVC TSCL, B0 ; Read TSCL
MVC TSCH, B1 ; Read TSCH
|| MV B0, A4
MV B1, A5
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_23_1333.asm | ljhsiun2/medusa | 9 | 165893 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r8
push %r9
push %rcx
push %rdx
lea addresses_D_ht+0x118f, %rdx
nop
nop
nop
nop
and $17363, %r13
vmovups (%rdx), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %r14
nop
nop
nop
nop
and $58822, %r8
lea addresses_A_ht+0x1162f, %rcx
nop
nop
sub $57724, %r9
mov (%rcx), %r11
nop
nop
nop
nop
nop
add %r9, %r9
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %rbx
push %rcx
push %rdi
// Store
mov $0xe47890000000909, %r13
nop
nop
nop
nop
nop
add $24452, %rdi
mov $0x5152535455565758, %rbx
movq %rbx, %xmm0
vmovups %ymm0, (%r13)
nop
nop
nop
nop
add %r13, %r13
// Load
lea addresses_RW+0x1e8af, %rdi
nop
nop
nop
nop
nop
sub %r10, %r10
movups (%rdi), %xmm3
vpextrq $0, %xmm3, %r14
nop
nop
nop
nop
sub $7829, %r10
// Load
lea addresses_WT+0x14a0f, %r13
nop
nop
nop
inc %rbx
mov (%r13), %r14
inc %rbx
// Faulty Load
lea addresses_normal+0x1a0f, %rbx
nop
nop
dec %rdi
mov (%rbx), %r14
lea oracles, %r10
and $0xff, %r14
shlq $12, %r14
mov (%r10,%r14,1), %r14
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'34': 23}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
oeis/195/A195971.asm | neoneye/loda-programs | 11 | 91000 | <filename>oeis/195/A195971.asm
; A195971: Number of n X 1 0..4 arrays with each element x equal to the number its horizontal and vertical neighbors equal to 2,0,1,3,4 for x=0,1,2,3,4.
; Submitted by <NAME>
; 0,1,3,4,5,9,16,25,39,64,105,169,272,441,715,1156,1869,3025,4896,7921,12815,20736,33553,54289,87840,142129,229971,372100,602069,974169,1576240,2550409,4126647,6677056,10803705,17480761,28284464,45765225,74049691,119814916,193864605,313679521,507544128,821223649,1328767775,2149991424,3478759201,5628750625,9107509824,14736260449,23843770275,38580030724,62423800997,101003831721,163427632720,264431464441,427859097159,692290561600,1120149658761,1812440220361,2932589879120,4745030099481,7677619978603
mov $1,1
mov $2,1
mov $4,-1
lpb $0
sub $0,1
sub $3,$4
mov $4,$2
mov $2,$3
add $2,$1
mov $1,$3
add $5,$4
mov $3,$5
lpe
mov $0,$3
|
src/cstandio.ads | lkujaw/felix | 0 | 9359 | <reponame>lkujaw/felix
------------------------------------------------------------------------------
-- Copyright (c) 2021, <NAME>.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the "Software")
-- to deal in the Software without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and sell copies of the Software, and to permit persons to whom the
-- Software is furnished to do so.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
--
-- SPDX-License-Identifier: MIT-0
--
-- File: cstandio.ads (Ada Package Specification)
-- Language: Ada (1987) [1]
-- Author: <NAME>
-- Description: C Standard Input/Output (stdio.h) interface for Ada
--
-- References:
-- [1] Programming languages - Ada, ISO/IEC 8652:1987, 15 Jun. 1987.
------------------------------------------------------------------------------
with System;
package C_Standard_IO is
pragma Preelaborate;
POSIX_Error : exception;
Usage_Error : exception;
Error : exception;
type File_T is limited private;
type File_Mode_T is (Read, Write, Read_Write);
function File_Mode (File : in File_T) return File_Mode_T;
function Is_Readable (File : in File_T) return Boolean;
function Is_Writable (File : in File_T) return Boolean;
function Standard_Input return File_T;
function Standard_Output return File_T;
function Standard_Error return File_T;
procedure Open_File (File : in out File_T;
With_Name : in String;
With_Mode : in File_Mode_T);
procedure Open_Null (File : in out File_T);
procedure Close_File (File : in out File_T);
procedure Put (File : in File_T;
Item : in Character);
procedure Put (Item : in Character);
procedure Put (File : in File_T;
Item : in String);
procedure Put (Item : in String);
procedure Put_Line (File : in File_T;
Item : in String);
procedure Put_Line (Item : in String);
-- IMAGE FUNCTIONS -------------------------------------------------------
function Address_Image (Value : in System.Address;
Format : in String := "") return String;
function Integer_Image (Value : in Integer;
Format : in String := "") return String;
function Long_Integer_Image (Value : in Long_Integer;
Format : in String := "") return String;
function Long_Float_Image (Value : in Long_Float;
Format : in String := "") return String;
function Long_Long_Float_Image (Value : in Long_Long_Float;
Format : in String := "") return String;
private -- C_Standard_IO ---------------------------------------------------
type File_T is
record
Address : System.Address := System.Null_Address;
Mode : File_Mode_T;
end record;
pragma Pack (File_T);
end C_Standard_IO;
|
sources/md/markdown-inline_parsers-autolinks.ads | reznikmm/markdown | 0 | 27220 | <filename>sources/md/markdown-inline_parsers-autolinks.ads
-- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
private
package Markdown.Inline_Parsers.Autolinks is
procedure Find
(Text : Plain_Texts.Plain_Text;
Cursor : Position;
State : in out Optional_Inline_State);
end Markdown.Inline_Parsers.Autolinks;
|
thirdparty/adasdl/thin/adasdl/AdaSDL_framebuff/sdltests/testbitmap.adb | Lucretia/old_nehe_ada95 | 0 | 16942 | <reponame>Lucretia/old_nehe_ada95
-- ----------------------------------------------------------------- --
-- --
-- This 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 software 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. --
-- --
-- ----------------------------------------------------------------- --
-- ----------------------------------------------------------------- --
-- This is a translation, to the Ada programming language, of the --
-- original C test files written by <NAME> - www.libsdl.org --
-- translation made by <NAME> - www.adapower.net/~avargas --
-- ----------------------------------------------------------------- --
with Interfaces.C;
with Ada.Command_Line;
with Ada.Characters.Handling;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.OS_Lib;
with SDL.Types; use SDL.Types;
with SDL.Video;
with SDL.Events;
with SDL.Error;
with SDL.Quit;
with SDL_Framebuffer;
with Picture_xbm; use Picture_xbm;
procedure TestBitmap is
package C renames Interfaces.C;
use type C.int;
package CL renames Ada.Command_Line;
package CH renames Ada.Characters.Handling;
package V renames SDL.Video;
use type V.Surface_ptr;
use type V.Surface_Flags;
package Ev renames SDL.Events;
package Er renames SDL.Error;
package Fb renames SDL_Framebuffer;
Screen_Width : constant := 640;
Screen_Height : constant := 480;
package Uint8_IO is new Modular_IO (Uint8);
-- ===============================================
function LoadXBM (screen : V.Surface_ptr;
w, h : C.int;
bits : Fb.Framebuffer_8bPointer) return V.Surface_ptr
is
ww : C.int := w;
hh : C.int := h;
The_Bits : Fb.Framebuffer_8bPointer := bits;
bitmap : V.Surface_ptr;
line : Fb.Framebuffer_8bPointer;
begin
-- Allocate the bitmap
bitmap := V.CreateRGBSurface (
V.SWSURFACE, w, h, 1, 0, 0, 0, 0);
if bitmap = null then
Put_Line ("Couldn't allocate bitmap: " & Er.Get_Error);
return null;
end if;
-- Copy the pixels
line := Fb.Get_Framebuffer (bitmap);
ww := (ww + 7) / 8;
while hh > 0 loop
hh := hh - 1;
Copy_Array (The_Bits, line, Natural (ww));
-- X11 Bitmap images have the bits reversed
declare
i : C.int;
buf : Fb.Framebuffer_8bPointer;
byte : Uint8;
use Interfaces;
begin
buf := line;
i := 0;
while i < ww loop
byte := buf.all;
buf.all := 0;
for j in reverse 0 .. 7 loop
buf.all := buf.all
or Shift_Left (
byte and 16#01#,
j);
byte := Shift_Right (byte, 1);
end loop;
i := i + 1;
buf := Increment (buf, 1);
end loop;
end;
line := Fb.Next_Line_Unchecked (bitmap, line);
The_Bits := Increment (The_Bits, Natural (ww));
end loop;
return bitmap;
end LoadXBM;
-- ===============================================
screen : V.Surface_ptr;
bitmap : V.Surface_ptr;
video_bpp : Uint8;
videoflags : V.Surface_Flags;
buffer : Fb.Framebuffer_8bPointer;
done : Boolean;
event : Ev.Event;
argc : Integer := CL.Argument_Count;
PollEvent_Result : C.int;
begin
-- Initialize SDL
if SDL.Init (SDL.INIT_VIDEO) < 0 then
Put_Line ("Couldn't initialize SDL: " & Er.Get_Error);
GNAT.OS_Lib.OS_Exit (1);
end if;
SDL.Quit.atexit (SDL.SDL_Quit'Access);
video_bpp := 0;
videoflags := V.SWSURFACE;
while argc > 0 loop
if (argc > 1) and then
(CL.Argument (argc - 1) = "-bpp") and then
CH.Is_Digit (CL.Argument (argc) (1)) then
declare
last : Positive;
begin
Uint8_IO.Get (CL.Argument (argc), video_bpp, last);
end;
argc := argc - 2;
elsif CL.Argument (argc) = "-hw" then
videoflags := videoflags or V.HWSURFACE;
argc := argc - 1;
elsif CL.Argument (argc) = "-warp" then
videoflags := videoflags or V.HWPALETTE;
argc := argc -1;
elsif CL.Argument (argc) = "-fullscreen" then
videoflags := videoflags or V.FULLSCREEN;
argc := argc - 1;
else
Put_Line ("Usage: " & CL.Command_Name &
"[-bpp N] [-hw] [-warp] [-fullscreen]");
GNAT.OS_Lib.OS_Exit (1);
end if;
end loop;
-- Set video mode
screen := V.SetVideoMode (Screen_Width, Screen_Height,
C.int (video_bpp), videoflags);
if screen = null then
Put_Line ("Couldn't set " & Integer'Image (Screen_Width) &
"x" & Integer'Image (Screen_Height) &
" video mode: " & Er.Get_Error);
GNAT.OS_Lib.OS_Exit (2);
end if;
-- Set the surface pixels and refresh
if V.LockSurface (screen) < 0 then
Put_Line ("Couldn't lock the display surface: " & Er.Get_Error);
GNAT.OS_Lib.OS_Exit (2);
end if;
buffer := Fb.Get_Framebuffer (screen);
for i in 0 .. screen.h - 1 loop
Fb.Paint_Line_Unchecked (screen, buffer, i * 255 / screen.h);
buffer := Fb.Next_Line_Unchecked (screen, buffer);
end loop;
V.UnlockSurface (screen);
V.UpdateRect (screen, 0, 0, 0, 0);
-- Load the bitmap
bitmap := LoadXBM (screen, picture_width, picture_height,
Fb.Framebuffer_8bPointer'(picture_bits(0)'Access));
if bitmap = null then
GNAT.OS_Lib.OS_Exit (1);
end if;
-- Wait for a keystroke
done := False;
while not done loop
loop
Ev.PollEventVP (PollEvent_Result, event);
exit when PollEvent_Result = 0;
case event.the_type is
when Ev.MOUSEBUTTONDOWN =>
declare
dst : V.Rect;
begin
dst.x := Sint16 (C.int (event.button.x) - bitmap.w / 2);
dst.y := Sint16 (C.int (event.button.y) - bitmap.h / 2);
dst.w := Uint16 (bitmap.w);
dst.h := Uint16 (bitmap.h);
V.BlitSurface (bitmap, null, screen, dst);
V.Update_Rect (screen, dst);
end;
when Ev.KEYDOWN => done := True;
when Ev.QUIT => done := True;
when others => null;
end case;
end loop;
end loop;
V.FreeSurface (bitmap);
GNAT.OS_Lib.OS_Exit (0);
end TestBitmap;
|
Exercises/One.agda | UoG-Agda/Agda101 | 0 | 17383 | open import Data.Nat using (ℕ; zero; suc; _+_)
open import Relation.Binary.PropositionalEquality
open ≡-Reasoning
open import Data.Nat.Properties using (+-assoc; +-comm)
module Exercises.One where
_*_ : ℕ → ℕ → ℕ
zero * y = zero
suc x * y = y + (x * y)
-- Prove that multiplication is commutative
*-idʳ : ∀ x → x * 0 ≡ 0
*-idʳ zero = refl
*-idʳ (suc x) = *-idʳ x
*-suc : ∀ x y → x + (x * y) ≡ (x * suc y)
*-suc zero y = refl
*-suc (suc x) y
rewrite sym (+-assoc x y (x * y)) | +-comm x y |
+-assoc y x (x * y) | *-suc x y = refl
*-comm : ∀ x y → x * y ≡ y * x
*-comm zero y rewrite *-idʳ y = refl
*-comm (suc x) y rewrite *-comm x y | *-suc y x = refl
-- Prove that if x + x ≡ y + y then x ≡ y (taken from CodeWars)
suc-injective : ∀ x y → suc x ≡ suc y → x ≡ y
suc-injective zero zero p = refl
suc-injective (suc x) (suc .x) refl = refl
xxyy : ∀ x y → x + x ≡ y + y → x ≡ y
xxyy zero zero refl = refl
xxyy (suc x) (suc y) p rewrite +-comm x (suc x) | +-comm y (suc y) =
cong suc (xxyy x y (suc-injective _ _ (suc-injective _ _ p)))
|
src/main/antlr4/LexBasic.g4 | BITPlan/com.bitplan.antlr | 0 | 7525 | lexer grammar LexBasic;
/*
* Lexer rules
*//// ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF/// / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD/// / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD/// / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD/// / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD/// / %xD0000-DFFFD / %xE1000-EFFFD
UCSCHAR
: '\u00A0' .. '\uD7FF'
| '\uF900' .. '\uFDCF'
| '\uFDF0' .. '\uFFEF'
;
/// iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD
IPRIVATE
: '\uE000' .. '\uF8FF'
;
D0
: '0'
;
D1
: '1'
;
D2
: '2'
;
D3
: '3'
;
D4
: '4'
;
D5
: '5'
;
D6
: '6'
;
D7
: '7'
;
D8
: '8'
;
D9
: '9'
;
A
: [aA]
;
B
: [bB]
;
C
: [cC]
;
D
: [dD]
;
E
: [eE]
;
F
: [fF]
;
G
: [gG]
;
H
: [hH]
;
I
: [iI]
;
J
: [jJ]
;
K
: [kK]
;
L
: [lL]
;
M
: [mM]
;
N
: [nN]
;
O
: [oO]
;
P
: [pP]
;
Q
: [qQ]
;
R
: [rR]
;
S
: [sS]
;
T
: [tT]
;
U
: [uU]
;
V
: [vV]
;
W
: [wW]
;
X
: [xX]
;
Y
: [yY]
;
Z
: [zZ]
;
COL2
: '::'
;
COL
: ':'
;
DOT
: '.'
;
PERCENT
: '%'
;
HYPHEN
: '-'
;
TILDE
: '~'
;
USCORE
: '_'
;
EXCL
: '!'
;
DOLLAR
: '$'
;
AMP
: '&'
;
SQUOTE
: '\''
;
OPAREN
: '('
;
CPAREN
: ')'
;
STAR
: '*'
;
PLUS
: '+'
;
COMMA
: ','
;
SCOL
: ';'
;
EQUALS
: '='
;
FSLASH2
: '//'
;
FSLASH
: '/'
;
QMARK
: '?'
;
HASH
: '#'
;
OBRACK
: '['
;
CBRACK
: ']'
;
AT
: '@'
;
|
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_fx/_bitfx_18.asm | teknoplop/z88dk | 0 | 88067 |
SECTION code_clib
SECTION code_sound_bit
PUBLIC _bitfx_18
INCLUDE "clib_target_cfg.asm"
_bitfx_18:
; steam engine
ld hl,0
coff2:
push af
xor __sound_bit_toggle
and (hl)
ld b,a
pop af
xor b
INCLUDE "sound/bit/z80/output_bit_device_2.inc"
ld b,(hl)
cdly:
djnz cdly
inc hl
bit 7,l
jr z, coff2
ret
|
tools-src/gnu/gcc/gcc/ada/5zosinte.adb | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 21308 | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ I N T E R F A C E --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1997-2001 Free Software Foundation --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 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. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the VxWorks version.
-- This package encapsulates all direct interfaces to OS services
-- that are needed by children of System.
pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during
-- tasking operations. It causes infinite loops and other problems.
with Interfaces.C; use Interfaces.C;
with System.VxWorks;
-- used for Wind_TCB_Ptr
with Unchecked_Conversion;
package body System.OS_Interface is
use System.VxWorks;
-- Option flags for taskSpawn
VX_UNBREAKABLE : constant := 16#0002#;
VX_FP_TASK : constant := 16#0008#;
VX_FP_PRIVATE_ENV : constant := 16#0080#;
VX_NO_STACK_FILL : constant := 16#0100#;
function taskSpawn
(name : System.Address; -- Pointer to task name
priority : int;
options : int;
stacksize : size_t;
start_routine : Thread_Body;
arg1 : System.Address;
arg2 : int := 0;
arg3 : int := 0;
arg4 : int := 0;
arg5 : int := 0;
arg6 : int := 0;
arg7 : int := 0;
arg8 : int := 0;
arg9 : int := 0;
arg10 : int := 0) return pthread_t;
pragma Import (C, taskSpawn, "taskSpawn");
procedure taskDelete (tid : pthread_t);
pragma Import (C, taskDelete, "taskDelete");
-- These are the POSIX scheduling priorities. These are enabled
-- when the global variable posixPriorityNumbering is 1.
POSIX_SCHED_FIFO_LOW_PRI : constant := 0;
POSIX_SCHED_FIFO_HIGH_PRI : constant := 255;
POSIX_SCHED_RR_LOW_PRI : constant := 0;
POSIX_SCHED_RR_HIGH_PRI : constant := 255;
-- These are the VxWorks native (default) scheduling priorities.
-- These are used when the global variable posixPriorityNumbering
-- is 0.
SCHED_FIFO_LOW_PRI : constant := 255;
SCHED_FIFO_HIGH_PRI : constant := 0;
SCHED_RR_LOW_PRI : constant := 255;
SCHED_RR_HIGH_PRI : constant := 0;
-- Global variable to enable POSIX priority numbering.
-- By default, it is 0 and VxWorks native priority numbering
-- is used.
posixPriorityNumbering : int;
pragma Import (C, posixPriorityNumbering, "posixPriorityNumbering");
-- VxWorks will let you set round-robin scheduling globally
-- for all tasks, but not for individual tasks. Attempting
-- to set the scheduling policy for a specific task (using
-- sched_setscheduler) to something other than what the system
-- is currently using will fail. If you wish to change the
-- scheduling policy, then use the following function to set
-- it globally for all tasks. When ticks is 0, time slicing
-- (round-robin scheduling) is disabled.
function kernelTimeSlice (ticks : int) return int;
pragma Import (C, kernelTimeSlice, "kernelTimeSlice");
function taskPriorityGet
(tid : pthread_t;
pPriority : access int)
return int;
pragma Import (C, taskPriorityGet, "taskPriorityGet");
function taskPrioritySet
(tid : pthread_t;
newPriority : int)
return int;
pragma Import (C, taskPrioritySet, "taskPrioritySet");
function To_Wind_TCB_Ptr is
new Unchecked_Conversion (pthread_t, Wind_TCB_Ptr);
-- Error codes (errno). The lower level 16 bits are the
-- error code, with the upper 16 bits representing the
-- module number in which the error occurred. By convention,
-- the module number is 0 for UNIX errors. VxWorks reserves
-- module numbers 1-500, with the remaining module numbers
-- being available for user applications.
M_objLib : constant := 61 * 2**16;
-- semTake() failure with ticks = NO_WAIT
S_objLib_OBJ_UNAVAILABLE : constant := M_objLib + 2;
-- semTake() timeout with ticks > NO_WAIT
S_objLib_OBJ_TIMEOUT : constant := M_objLib + 4;
-- We use two different kinds of VxWorks semaphores: mutex
-- and binary semaphores. A null (0) ID is returned when
-- a semaphore cannot be created. Binary semaphores and common
-- operations are declared in the spec of this package,
-- as they are used to implement hardware interrupt handling
function semMCreate
(options : int) return SEM_ID;
pragma Import (C, semMCreate, "semMCreate");
function taskLock return int;
pragma Import (C, taskLock, "taskLock");
function taskUnlock return int;
pragma Import (C, taskUnlock, "taskUnlock");
-------------------------------------------------------
-- Convenience routines to convert between VxWorks --
-- priority and POSIX priority. --
-------------------------------------------------------
function To_Vxworks_Priority (Priority : in int) return int;
pragma Inline (To_Vxworks_Priority);
function To_Posix_Priority (Priority : in int) return int;
pragma Inline (To_Posix_Priority);
function To_Vxworks_Priority (Priority : in int) return int is
begin
return SCHED_FIFO_LOW_PRI - Priority;
end To_Vxworks_Priority;
function To_Posix_Priority (Priority : in int) return int is
begin
return SCHED_FIFO_LOW_PRI - Priority;
end To_Posix_Priority;
----------------------------------------
-- Implementation of POSIX routines --
----------------------------------------
-----------------------------------------
-- Nonstandard Thread Initialization --
-----------------------------------------
procedure pthread_init is
begin
Keys_Created := 0;
Time_Slice := -1;
end pthread_init;
---------------------------
-- POSIX.1c Section 3 --
---------------------------
function sigwait
(set : access sigset_t;
sig : access Signal) return int
is
Result : Interfaces.C.int;
function sigwaitinfo
(set : access sigset_t; sigvalue : System.Address) return int;
pragma Import (C, sigwaitinfo, "sigwaitinfo");
begin
Result := sigwaitinfo (set, System.Null_Address);
if Result /= -1 then
sig.all := Signal (Result);
return 0;
else
sig.all := 0;
return errno;
end if;
end sigwait;
----------------------------
-- POSIX.1c Section 11 --
----------------------------
function pthread_mutexattr_init
(attr : access pthread_mutexattr_t) return int is
begin
-- Let's take advantage of VxWorks priority inversion
-- protection.
--
-- ??? - Do we want to also specify SEM_DELETE_SAFE???
attr.Flags := int (SEM_Q_PRIORITY + SEM_INVERSION_SAFE);
-- Initialize the ceiling priority to the maximim priority.
-- We will use POSIX priorities since these routines are
-- emulating POSIX routines.
attr.Prio_Ceiling := POSIX_SCHED_FIFO_HIGH_PRI;
attr.Protocol := PTHREAD_PRIO_INHERIT;
return 0;
end pthread_mutexattr_init;
function pthread_mutexattr_destroy
(attr : access pthread_mutexattr_t) return int is
begin
attr.Flags := 0;
attr.Prio_Ceiling := POSIX_SCHED_FIFO_HIGH_PRI;
attr.Protocol := PTHREAD_PRIO_INHERIT;
return 0;
end pthread_mutexattr_destroy;
function pthread_mutex_init
(mutex : access pthread_mutex_t;
attr : access pthread_mutexattr_t) return int
is
Result : int := 0;
begin
-- A mutex should initially be created full and the task
-- protected from deletion while holding the semaphore.
mutex.Mutex := semMCreate (attr.Flags);
mutex.Prio_Ceiling := attr.Prio_Ceiling;
mutex.Protocol := attr.Protocol;
if mutex.Mutex = 0 then
Result := errno;
end if;
return Result;
end pthread_mutex_init;
function pthread_mutex_destroy
(mutex : access pthread_mutex_t) return int
is
Result : STATUS;
begin
Result := semDelete (mutex.Mutex);
if Result /= 0 then
Result := errno;
end if;
mutex.Mutex := 0; -- Ensure the mutex is properly cleaned.
mutex.Prio_Ceiling := POSIX_SCHED_FIFO_HIGH_PRI;
mutex.Protocol := PTHREAD_PRIO_INHERIT;
return Result;
end pthread_mutex_destroy;
function pthread_mutex_lock
(mutex : access pthread_mutex_t) return int
is
Result : int;
WTCB_Ptr : Wind_TCB_Ptr;
begin
WTCB_Ptr := To_Wind_TCB_Ptr (taskIdSelf);
if WTCB_Ptr = null then
return errno;
end if;
-- Check the current inherited priority in the WIND_TCB
-- against the mutex ceiling priority and return EINVAL
-- upon a ceiling violation.
--
-- We always convert the VxWorks priority to POSIX priority
-- in case the current priority ordering has changed (see
-- posixPriorityNumbering). The mutex ceiling priority is
-- maintained as POSIX compatible.
if mutex.Protocol = PTHREAD_PRIO_PROTECT and then
To_Posix_Priority (WTCB_Ptr.Priority) > mutex.Prio_Ceiling
then
return EINVAL;
end if;
Result := semTake (mutex.Mutex, WAIT_FOREVER);
if Result /= 0 then
Result := errno;
end if;
return Result;
end pthread_mutex_lock;
function pthread_mutex_unlock
(mutex : access pthread_mutex_t) return int
is
Result : int;
begin
Result := semGive (mutex.Mutex);
if Result /= 0 then
Result := errno;
end if;
return Result;
end pthread_mutex_unlock;
function pthread_condattr_init
(attr : access pthread_condattr_t) return int is
begin
attr.Flags := SEM_Q_PRIORITY;
return 0;
end pthread_condattr_init;
function pthread_condattr_destroy
(attr : access pthread_condattr_t) return int is
begin
attr.Flags := 0;
return 0;
end pthread_condattr_destroy;
function pthread_cond_init
(cond : access pthread_cond_t;
attr : access pthread_condattr_t) return int
is
Result : int := 0;
begin
-- Condition variables should be initially created
-- empty.
cond.Sem := semBCreate (attr.Flags, SEM_EMPTY);
cond.Waiting := 0;
if cond.Sem = 0 then
Result := errno;
end if;
return Result;
end pthread_cond_init;
function pthread_cond_destroy (cond : access pthread_cond_t) return int is
Result : int;
begin
Result := semDelete (cond.Sem);
if Result /= 0 then
Result := errno;
end if;
return Result;
end pthread_cond_destroy;
function pthread_cond_signal
(cond : access pthread_cond_t) return int
is
Result : int := 0;
Status : int;
begin
-- Disable task scheduling.
Status := taskLock;
-- Iff someone is currently waiting on the condition variable
-- then release the semaphore; we don't want to leave the
-- semaphore in the full state because the next guy to do
-- a condition wait operation would not block.
if cond.Waiting > 0 then
Result := semGive (cond.Sem);
-- One less thread waiting on the CV.
cond.Waiting := cond.Waiting - 1;
if Result /= 0 then
Result := errno;
end if;
end if;
-- Reenable task scheduling.
Status := taskUnlock;
return Result;
end pthread_cond_signal;
function pthread_cond_wait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t) return int
is
Result : int;
Status : int;
begin
-- Disable task scheduling.
Status := taskLock;
-- Release the mutex as required by POSIX.
Result := semGive (mutex.Mutex);
-- Indicate that there is another thread waiting on the CV.
cond.Waiting := cond.Waiting + 1;
-- Perform a blocking operation to take the CV semaphore.
-- Note that a blocking operation in VxWorks will reenable
-- task scheduling. When we are no longer blocked and control
-- is returned, task scheduling will again be disabled.
Result := semTake (cond.Sem, WAIT_FOREVER);
if Result /= 0 then
cond.Waiting := cond.Waiting - 1;
Result := EINVAL;
end if;
-- Take the mutex as required by POSIX.
Status := semTake (mutex.Mutex, WAIT_FOREVER);
if Status /= 0 then
Result := EINVAL;
end if;
-- Reenable task scheduling.
Status := taskUnlock;
return Result;
end pthread_cond_wait;
function pthread_cond_timedwait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t;
abstime : access timespec) return int
is
Result : int;
Status : int;
Ticks : int;
TS : aliased timespec;
begin
Status := clock_gettime (CLOCK_REALTIME, TS'Unchecked_Access);
-- Calculate the number of clock ticks for the timeout.
Ticks := To_Clock_Ticks (To_Duration (abstime.all) - To_Duration (TS));
if Ticks <= 0 then
-- It is not worth the time to try to perform a semTake,
-- because we know it will always fail. A semTake with
-- ticks = 0 (NO_WAIT) will not block and therefore not
-- allow another task to give the semaphore. And if we've
-- designed pthread_cond_signal correctly, the semaphore
-- should never be left in a full state.
--
-- Make sure we give up the CPU.
Status := taskDelay (0);
return ETIMEDOUT;
end if;
-- Disable task scheduling.
Status := taskLock;
-- Release the mutex as required by POSIX.
Result := semGive (mutex.Mutex);
-- Indicate that there is another thread waiting on the CV.
cond.Waiting := cond.Waiting + 1;
-- Perform a blocking operation to take the CV semaphore.
-- Note that a blocking operation in VxWorks will reenable
-- task scheduling. When we are no longer blocked and control
-- is returned, task scheduling will again be disabled.
Result := semTake (cond.Sem, Ticks);
if Result /= 0 then
if errno = S_objLib_OBJ_TIMEOUT then
Result := ETIMEDOUT;
else
Result := EINVAL;
end if;
cond.Waiting := cond.Waiting - 1;
end if;
-- Take the mutex as required by POSIX.
Status := semTake (mutex.Mutex, WAIT_FOREVER);
if Status /= 0 then
Result := EINVAL;
end if;
-- Reenable task scheduling.
Status := taskUnlock;
return Result;
end pthread_cond_timedwait;
----------------------------
-- POSIX.1c Section 13 --
----------------------------
function pthread_mutexattr_setprotocol
(attr : access pthread_mutexattr_t;
protocol : int) return int is
begin
if protocol < PTHREAD_PRIO_NONE
or protocol > PTHREAD_PRIO_PROTECT
then
return EINVAL;
end if;
attr.Protocol := protocol;
return 0;
end pthread_mutexattr_setprotocol;
function pthread_mutexattr_setprioceiling
(attr : access pthread_mutexattr_t;
prioceiling : int) return int is
begin
-- Our interface to the rest of the world is meant
-- to be POSIX compliant; keep the priority in POSIX
-- format.
attr.Prio_Ceiling := prioceiling;
return 0;
end pthread_mutexattr_setprioceiling;
function pthread_setschedparam
(thread : pthread_t;
policy : int;
param : access struct_sched_param) return int
is
Result : int;
begin
-- Convert the POSIX priority to VxWorks native
-- priority.
Result := taskPrioritySet (thread,
To_Vxworks_Priority (param.sched_priority));
return 0;
end pthread_setschedparam;
function sched_yield return int is
begin
return taskDelay (0);
end sched_yield;
function pthread_sched_rr_set_interval (usecs : int) return int is
Result : int := 0;
D_Slice : Duration;
begin
-- Check to see if round-robin scheduling (time slicing)
-- is enabled. If the time slice is the default value (-1)
-- or any negative number, we will leave the kernel time
-- slice unchanged. If the time slice is 0, we disable
-- kernel time slicing by setting it to 0. Otherwise, we
-- set the kernel time slice to the specified value converted
-- to clock ticks.
Time_Slice := usecs;
if Time_Slice > 0 then
D_Slice := Duration (Time_Slice) / Duration (1_000_000.0);
Result := kernelTimeSlice (To_Clock_Ticks (D_Slice));
else
if Time_Slice = 0 then
Result := kernelTimeSlice (0);
end if;
end if;
return Result;
end pthread_sched_rr_set_interval;
function pthread_attr_init (attr : access pthread_attr_t) return int is
begin
attr.Stacksize := 100000; -- What else can I do?
attr.Detachstate := PTHREAD_CREATE_DETACHED;
attr.Priority := POSIX_SCHED_FIFO_LOW_PRI;
attr.Taskname := System.Null_Address;
return 0;
end pthread_attr_init;
function pthread_attr_destroy (attr : access pthread_attr_t) return int is
begin
attr.Stacksize := 0;
attr.Detachstate := 0;
attr.Priority := POSIX_SCHED_FIFO_LOW_PRI;
attr.Taskname := System.Null_Address;
return 0;
end pthread_attr_destroy;
function pthread_attr_setdetachstate
(attr : access pthread_attr_t;
detachstate : int) return int is
begin
attr.Detachstate := detachstate;
return 0;
end pthread_attr_setdetachstate;
function pthread_attr_setstacksize
(attr : access pthread_attr_t;
stacksize : size_t) return int is
begin
attr.Stacksize := stacksize;
return 0;
end pthread_attr_setstacksize;
-- In VxWorks tasks, we can set the task name. This
-- makes it really convenient for debugging.
function pthread_attr_setname_np
(attr : access pthread_attr_t;
name : System.Address) return int is
begin
attr.Taskname := name;
return 0;
end pthread_attr_setname_np;
function pthread_create
(thread : access pthread_t;
attr : access pthread_attr_t;
start_routine : Thread_Body;
arg : System.Address) return int is
begin
thread.all := taskSpawn (attr.Taskname,
To_Vxworks_Priority (attr.Priority), VX_FP_TASK, attr.Stacksize,
start_routine, arg);
if thread.all = -1 then
return -1;
else
return 0;
end if;
end pthread_create;
function pthread_detach (thread : pthread_t) return int is
begin
return 0;
end pthread_detach;
procedure pthread_exit (status : System.Address) is
begin
taskDelete (0);
end pthread_exit;
function pthread_self return pthread_t is
begin
return taskIdSelf;
end pthread_self;
function pthread_equal (t1 : pthread_t; t2 : pthread_t) return int is
begin
if t1 = t2 then
return 1;
else
return 0;
end if;
end pthread_equal;
function pthread_setspecific
(key : pthread_key_t;
value : System.Address) return int
is
Result : int;
begin
if Integer (key) not in Key_Storage'Range then
return EINVAL;
end if;
Key_Storage (Integer (key)) := value;
Result := taskVarAdd (taskIdSelf, Key_Storage (Integer (key))'Access);
-- We should be able to directly set the key with the following:
-- Key_Storage (key) := value;
-- but we'll be safe and use taskVarSet.
-- ??? Come back and revisit this.
Result := taskVarSet (taskIdSelf,
Key_Storage (Integer (key))'Access, value);
return Result;
end pthread_setspecific;
function pthread_getspecific (key : pthread_key_t) return System.Address is
begin
return Key_Storage (Integer (key));
end pthread_getspecific;
function pthread_key_create
(key : access pthread_key_t;
destructor : destructor_pointer) return int is
begin
Keys_Created := Keys_Created + 1;
if Keys_Created not in Key_Storage'Range then
return ENOMEM;
end if;
key.all := pthread_key_t (Keys_Created);
return 0;
end pthread_key_create;
-----------------
-- To_Duration --
-----------------
function To_Duration (TS : timespec) return Duration is
begin
return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9;
end To_Duration;
-----------------
-- To_Timespec --
-----------------
function To_Timespec (D : Duration) return timespec is
S : time_t;
F : Duration;
begin
S := time_t (Long_Long_Integer (D));
F := D - Duration (S);
-- If F has negative value due to a round-up, adjust for positive F
-- value.
if F < 0.0 then
S := S - 1;
F := F + 1.0;
end if;
return timespec' (ts_sec => S,
ts_nsec => long (Long_Long_Integer (F * 10#1#E9)));
end To_Timespec;
--------------------
-- To_Clock_Ticks --
--------------------
-- ??? - For now, we'll always get the system clock rate
-- since it is allowed to be changed during run-time in
-- VxWorks. A better method would be to provide an operation
-- to set it that so we can always know its value.
--
-- Another thing we should probably allow for is a resultant
-- tick count greater than int'Last. This should probably
-- be a procedure with two output parameters, one in the
-- range 0 .. int'Last, and another representing the overflow
-- count.
function To_Clock_Ticks (D : Duration) return int is
Ticks : Long_Long_Integer;
Rate_Duration : Duration;
Ticks_Duration : Duration;
begin
-- Ensure that the duration can be converted to ticks
-- at the current clock tick rate without overflowing.
Rate_Duration := Duration (sysClkRateGet);
if D > (Duration'Last / Rate_Duration) then
Ticks := Long_Long_Integer (int'Last);
else
-- We always want to round up to the nearest clock tick.
Ticks_Duration := D * Rate_Duration;
Ticks := Long_Long_Integer (Ticks_Duration);
if Ticks_Duration > Duration (Ticks) then
Ticks := Ticks + 1;
end if;
if Ticks > Long_Long_Integer (int'Last) then
Ticks := Long_Long_Integer (int'Last);
end if;
end if;
return int (Ticks);
end To_Clock_Ticks;
end System.OS_Interface;
|
Driver/Video/VGAlike/VGA16/vga16Admin.asm | mgroeber9110/pcgeos | 3 | 16314 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GlobalPC 1998 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: VGA16 Video Driver
FILE: vga16Admin.asm
AUTHOR: <NAME>
ROUTINES:
Name Description
---- -----------
VidScreenOn turn on video
VidScreenOff turn off video
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/92 initial version
FR 09/97 update for 16 bit devices
DESCRIPTION:
This file contains routines to implement some of the administrative
parts of the driver.
$Id: vga16Admin.asm,v 1.2$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidSegment Misc
if NT_DRIVER
idata segment
vddHandle word 0 ; used by NT driver
idata ends
DllName DB "GEOSVDD.DLL",0
InitFunc DB "VDDRegisterInit",0
DispFunc DB "VDDDispatch",0
yScreenSizeStr char "yScreenSize", 0
screenSizeCategoryStr char "ui", 0
InitVideoDLL proc near
push ds, es
push ax, si, di, bx, dx
;
; Find out how big they want the screen to be by checking the .ini file
;
segmov ds, cs, cx
mov si, offset screenSizeCategoryStr
mov dx, offset yScreenSizeStr
call InitFileReadInteger
jnc afterY
mov ax, 480 ; default to height of 480
; mov ax, 200
afterY:
push ax ; screen height
mov ax, cs
mov ds, ax
mov es, ax
;
; Register the dll
;
; Load ioctlvdd.dll
mov si, offset DllName ; ds:si = dll name
mov di, offset InitFunc ; es:di = init routine
mov bx, offset DispFunc ; ds:bx = dispatch routine
RegisterModule
mov si, dgroup
mov ds, si
mov ds:[vddHandle], ax
pop cx ; screen size
mov bx, 113 ; VDD_FUNC_SET_BPP
mov cx, 16 ; 4 bits per pixel
DispatchCall
mov dx, 800
mov cx, 600
mov bx, 108 ; VDD_CREATE_WINDOW ; create window
DispatchCall
;
; Clear video memory
;
mov cx, 65536 / 2
mov ax, 0xA000
mov es, ax
clr ax, di
rep stosw
pop ax, si, di, bx, dx
pop ds, es
ret
InitVideoDLL endp
endif ; WINNT
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidScreenOff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Disable video output, for a screen saver
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Disable the video output
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 12/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if NT_DRIVER
VidScreenOff proc far
ret
VidScreenOff endp
else
VidScreenOff proc far
.enter
; first see if the screen is already blank
dec ss:videoEnabled ; is it enabled
js tooFar ; oops, called it to often
jne done ; someone still wants it off
; now do the disable thing.
mov ah, ALT_SELECT ; choose BIOS function number
mov bl, VIDEO_SCREEN_ON_OFF ; choose sub-function number
mov al, VGA_DISABLE_VIDEO ; disable it this time
int VIDEO_BIOS
done:
.leave
ret
; decremented too far, get back to zero
tooFar:
mov ss:videoEnabled, 0
jmp done
VidScreenOff endp
endif ; NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidScreenOn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enable video output, for a screen saver
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Disable the video output
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 12/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if NT_DRIVER
VidScreenOn proc far
ret
VidScreenOn endp
else ; NT_DRIVER
VidScreenOn proc far
.enter
; first see if the screen is already enabled
inc ss:videoEnabled ; check for turn on
cmp ss:videoEnabled, 1 ; is it enabled
jg done ; yes, don't do it again
mov ss:videoEnabled, 1 ; no, make sure it;s one
; enable video signal on card
mov ah, ALT_SELECT ; choose BIOS function number
mov bl, VIDEO_SCREEN_ON_OFF ; choose sub-function number
mov al, VGA_ENABLE_VIDEO ; disable video signal
int VIDEO_BIOS
done:
.leave
ret
VidScreenOn endp
endif ; NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 640x480 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestVGA16 proc near
mov ax, VD_VESA_640x480_16
call VidTestVESA
ret
VidTestVGA16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestSVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 800x600 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestSVGA16 proc near
mov ax, VD_VESA_800x600_16
call VidTestVESA
ret
VidTestSVGA16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestUVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 1024x768 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestUVGA16 proc near
mov ax, VD_VESA_1Kx768_16
call VidTestVESA
ret
VidTestUVGA16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestHVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 1280x1024 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestHVGA16 proc near
mov ax, VD_VESA_1280x1K_16
call VidTestVESA
ret
VidTestHVGA16 endp
VidTestVESA_640x350_16 proc near
mov ax, VD_VESA_640x350_16
call VidTestVESA
ret
VidTestVESA_640x350_16 endp
VidTestVESA_640x400_16 proc near
mov ax, VD_VESA_640x400_16
call VidTestVESA
ret
VidTestVESA_640x400_16 endp
VidTestVESA_720x400_16 proc near
mov ax, VD_VESA_720x400_16
call VidTestVESA
ret
VidTestVESA_720x400_16 endp
VidTestVESA_800x480_16 proc near
mov ax, VD_VESA_800x480_16
call VidTestVESA
ret
VidTestVESA_800x480_16 endp
VidTestVESA_832x624_16 proc near
mov ax, VD_VESA_832x624_16
call VidTestVESA
ret
VidTestVESA_832x624_16 endp
VidTestVESA_1024_600_16 proc near
mov ax, VD_VESA_1024_600_16
call VidTestVESA
ret
VidTestVESA_1024_600_16 endp
VidTestVESA_1152x864_16 proc near
mov ax, VD_VESA_1152x864_16
call VidTestVESA
ret
VidTestVESA_1152x864_16 endp
VidTestVESA_1280x600_16 proc near
mov ax, VD_VESA_1280x600_16
call VidTestVESA
ret
VidTestVESA_1280x600_16 endp
VidTestVESA_1280x720_16 proc near
mov ax, VD_VESA_1280x720_16
call VidTestVESA
ret
VidTestVESA_1280x720_16 endp
VidTestVESA_1280x768_16 proc near
mov ax, VD_VESA_1280x768_16
call VidTestVESA
ret
VidTestVESA_1280x768_16 endp
VidTestVESA_1280x800_16 proc near
mov ax, VD_VESA_1280x800_16
call VidTestVESA
ret
VidTestVESA_1280x800_16 endp
VidTestVESA_1280x854_16 proc near
mov ax, VD_VESA_1280x854_16
call VidTestVESA
ret
VidTestVESA_1280x854_16 endp
VidTestVESA_1280x960_16 proc near
mov ax, VD_VESA_1280x960_16
call VidTestVESA
ret
VidTestVESA_1280x960_16 endp
VidTestVESA_1360_768_16 proc near
mov ax, VD_VESA_1360_768_16
call VidTestVESA
ret
VidTestVESA_1360_768_16 endp
VidTestVESA_1366_768_16 proc near
mov ax, VD_VESA_1366_768_16
call VidTestVESA
ret
VidTestVESA_1366_768_16 endp
VidTestVESA_1400_1050_16 proc near
mov ax, VD_VESA_1400_1050_16
call VidTestVESA
ret
VidTestVESA_1400_1050_16 endp
VidTestVESA_1440_900_16 proc near
mov ax, VD_VESA_1440_900_16
call VidTestVESA
ret
VidTestVESA_1440_900_16 endp
VidTestVESA_1600_900_16 proc near
mov ax, VD_VESA_1600_900_16
call VidTestVESA
ret
VidTestVESA_1600_900_16 endp
VidTestVESA_1600_1024_16 proc near
mov ax, VD_VESA_1600_1024_16
call VidTestVESA
ret
VidTestVESA_1600_1024_16 endp
VidTestVESA_1600_1200_16 proc near
mov ax, VD_VESA_1600_1200_16
call VidTestVESA
ret
VidTestVESA_1600_1200_16 endp
VidTestVESA_1680_1050_16 proc near
mov ax, VD_VESA_1680_1050_16
call VidTestVESA
ret
VidTestVESA_1680_1050_16 endp
VidTestVESA_1920_1024_16 proc near
mov ax, VD_VESA_1920_1024_16
call VidTestVESA
ret
VidTestVESA_1920_1024_16 endp
VidTestVESA_1920_1080_16 proc near
mov ax, VD_VESA_1920_1080_16
call VidTestVESA
ret
VidTestVESA_1920_1080_16 endp
VidTestVESA_1920_1200_16 proc near
mov ax, VD_VESA_1920_1200_16
call VidTestVESA
ret
VidTestVESA_1920_1200_16 endp
VidTestVESA_1920_1440_16 proc near
mov ax, VD_VESA_1920_1440_16
call VidTestVESA
ret
VidTestVESA_1920_1440_16 endp
VidTestVESA_2048_1536_16 proc near
mov ax, VD_VESA_2048_1536_16
call VidTestVESA
ret
VidTestVESA_2048_1536_16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestVESA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for VESA compatible board
CALLED BY: INTERNAL
VidTestDevice
PASS: ax - device index to check for
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call VESA inquiry functins
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestVESA proc near
uses di, bx, cx
.enter
push es
if NT_DRIVER
; Be lazy and only return true for the
; mode we know we support.
mov bx, DP_NOT_PRESENT
cmp ax, VM_800x600_16
jne done
mov bx, DP_PRESENT
done:
mov ax, bx
else ; NT_DRIVER
; save away the mode number
mov ss:[vesaMode], ax ; save it
; allocate fixed block to get vesa info
;CheckHack <(size VESAInfoBlock) eq (size VESAModeInfo)>
mov ax, size VESAInfoBlock + size VESAModeInfo
mov cx, ALLOC_FIXED
call MemAlloc
; use extended BIOS function 0x4f - 0 to determine if this
; is a VESA compatible board, then check the table of
; supported modes to determine if the 640x480x256-color mode
; is supported.
mov es, ax
clr di ; es:di -> VESAInfoBlock
mov ah, VESA_BIOS_EXT ; use VESA bios extensions
mov al, VESA_GET_SVGA_INFO ; basic info call
int VIDEO_BIOS ; make bios call
; if al = VESA_BIOS_EXT, then there is a VESA compatible board
; there...actually, we need to check for the VESA signature too
cmp ax, VESA_BIOS_EXT ; is this a VESA board ?
jne notPresent ; no, exit
cmp {word} es:[di].VIB_sig, 'VE' ; gimme a VE
jne notPresent
cmp {word} es:[di].VIB_sig[2], 'SA' ; gimme a SA
jne notPresent
; OK, there is a VESA board out there. Check the mode table
; for the correct mode.
les di, es:[di].VIB_modes ; get pointer to mode info
checkLoop:
cmp es:[di], 0xffff ; at mode table terminator?
je notPresent
mov ax, es:[di]
push ax
push bx
push es
push di
; OK, the mode is supported in the BIOS. Now check to see if
; it is supported by the current card/monitor setup. To do
; this, we need to call the GetModeInfo function.
call MemDerefES
mov di, size VESAInfoBlock ; es:di -> VESAModeInfo
mov cx, ax ; cx = mode number
mov ah, VESA_BIOS_EXT ; BIOS mode number
mov al, VESA_GET_MODE_INFO ; get info about mode
int VIDEO_BIOS ; get mode info
; now see if the current hardware is cool.
test es:[di].VMI_modeAttr, mask VMA_SUPPORTED
jz checkNext
; check for right color
mov al, es:[di].VMI_bitsPerPixel
cmp al, 16
jne checkNext
; check for resolution
mov bx, ss:[vesaMode]
mov ax, cs:[vesaWidth][bx]
cmp ax, es:[di].VMI_Xres
jne checkNext
mov ax, cs:[vesaHeight][bx]
cmp ax, es:[di].VMI_Yres
jne checkNext
; Hit, found matching mode
pop di
pop es
pop bx
pop ax
mov ss:[vesaMode], ax ; remember the VESA mode
; passed the acid test. Use it.
mov ax, DP_PRESENT ; yep, it's there
jmp done
checkNext::
pop di
pop es
pop bx
pop ax
inc di
inc di
jmp checkLoop
done:
; free allocated memory block
pop es
call MemFree
endif ; not NT_DRIVER
.leave
ret
notPresent::
mov ax, DP_NOT_PRESENT ;
jmp done
VidTestVESA endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidSetVESA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set VESA 64K-color modes
CALLED BY: INTERNAL
VidSetDevice
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call VESA set mode function
KNOWN BUGS/SIDE EFFECTS/IDEAS:
assumes that VidTestVESA has been called and passed.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ALLOW_BIG_MOUSE_POINTER
screenCategory char "screen0",0
bigPointerKey char "bigMousePointer",0
tvModeKey char "tvMode",0
endif ; ALLOW_BIG_MOUSE_POINTER
VidSetVESA proc near
uses ax,bx,cx,dx,ds,si,es
.enter
if ALLOW_BIG_MOUSE_POINTER
; default cursor size is big for 640x480, small for other modes
; can override using screen0::bigMousePointer = true/false.
mov cx, cs
mov dx, offset bigPointerKey
mov ds, cx
mov si, offset screenCategory
call InitFileReadBoolean
jc defaultCursor
tst al
jz afterCursor
mov ss:[cursorSize], CUR_SIZE * 2
jmp afterCursor
defaultCursor:
cmp ss:[vesaMode], VM_640x480_16
jne afterCursor
mov ss:[cursorSize], CUR_SIZE * 2
afterCursor:
endif ; ALLOW_BIG_MOUSE_POINTER
; just use the BIOS extension
if not NT_DRIVER
mov ah, VESA_BIOS_EXT
mov al, VESA_SET_MODE
mov bx, ss:[vesaMode] ; mode number, clear memory
int VIDEO_BIOS
segmov es, ss, di ; es -> dgroup
lea di, ss:[vesaInfo] ; es:di -> info block
mov ah, VESA_BIOS_EXT ; use VESA bios extensions
mov al, VESA_GET_SVGA_INFO ; basic info call
int VIDEO_BIOS ; make bios call
lea di, ss:[modeInfo] ; es:di -> info block
mov ah, VESA_BIOS_EXT ; use VESA bios extensions
mov al, VESA_GET_MODE_INFO ; get info about mode
mov cx, bx ; cx = mode number
int VIDEO_BIOS ; make bios call
else
;; I should just create driver calls for the above ints, but
;; I can't do that at the moment so I'll just stuff values.
;; -- ron
;; NT_DRIVER
call InitVideoDLL
cmp ss:[vesaMode], VM_640x480_16
jne 800$
mov ss:[modeInfo].VMI_modeAttr, VESAModeAttr <0,1,1,0,0,1>
mov ss:[modeInfo].VMI_winAAttr, VESAWinAttr <0,1,1,1>
mov ss:[modeInfo].VMI_winBAttr, VESAWinAttr <0,0,0,0>
mov ss:[modeInfo].VMI_winGran, 64
mov ss:[modeInfo].VMI_winSize, 64
mov ss:[modeInfo].VMI_winASeg, 0xa000
mov ss:[modeInfo].VMI_winBSeg, 0
clrdw ss:[modeInfo].VMI_winFunc
mov ss:[modeInfo].VMI_scanSize, 640 * 2
mov ss:[modeInfo].VMI_Xres, 640
mov ss:[modeInfo].VMI_Yres, 480
mov ss:[modeInfo].VMI_Xcharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_Ycharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_nplanes, 1
mov ss:[modeInfo].VMI_bitsPerPixel, 16
mov ss:[modeInfo].VMI_nbanks, 16;
mov ss:[modeInfo].VMI_memModel, VMM_PACKED
mov ss:[modeInfo].VMI_backSize, 64 ; in K
mov bx, VM_640x480_16
jmp setDriverTable
800$:
mov ss:[modeInfo].VMI_modeAttr, VESAModeAttr <0,1,1,0,0,1>
mov ss:[modeInfo].VMI_winAAttr, VESAWinAttr <0,1,1,1>
mov ss:[modeInfo].VMI_winBAttr, VESAWinAttr <0,0,0,0>
mov ss:[modeInfo].VMI_winGran, 64
mov ss:[modeInfo].VMI_winSize, 64
mov ss:[modeInfo].VMI_winASeg, 0xa000
mov ss:[modeInfo].VMI_winBSeg, 0
clrdw ss:[modeInfo].VMI_winFunc
mov ss:[modeInfo].VMI_scanSize, 800 * 2
mov ss:[modeInfo].VMI_Xres, 800
mov ss:[modeInfo].VMI_Yres, 600
mov ss:[modeInfo].VMI_Xcharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_Ycharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_nplanes, 1
mov ss:[modeInfo].VMI_bitsPerPixel, 16
mov ss:[modeInfo].VMI_nbanks, 16;
mov ss:[modeInfo].VMI_memModel, VMM_PACKED
mov ss:[modeInfo].VMI_backSize, 64 ; in K
mov bx, VM_800x600_16
setDriverTable:
endif
; since we may be using this driver to support a number of
; other resolutions at 8bits/pixel, copy the information
; that we gleaned from the mode info call and stuff the
; appropriate fields into our own DeviceInfo structure.
sub bx, 0x110 ; get number start at 0
shl bx, 1 ; bx = word table index
mov ax, ss:[modeInfo].VMI_Yres
mov ss:[DriverTable].VDI_pageH, ax
mov ax, ss:[modeInfo].VMI_Xres
mov ss:[DriverTable].VDI_pageW, ax
mov cl, VGA24_DISPLAY_TYPE
mov bx, 72
cmp ax, 640
jbe applyRes
mov cl, SVGA24_DISPLAY_TYPE
mov bx, 80
cmp ax, 800
jbe applyRes
mov bx, 102
cmp ax, 1024
jbe applyRes
mov bx, 136
applyRes:
mov ss:[DriverTable].VDI_vRes, bx
mov ss:[DriverTable].VDI_hRes, bx
mov ss:[DriverTable].VDI_displayType, cl
mov ax, ss:[modeInfo].VMI_scanSize ; bytes per scan line
mov ss:[DriverTable].VDI_bpScan, ax
if NT_DRIVER
mov cx, cs
mov dx, offset tvModeKey
mov ds, cx
mov si, offset screenCategory
call InitFileReadBoolean
jc notTV
tst al
jz notTV
mov ss:[DriverTable].VDI_displayType, TV24_DISPLAY_TYPE
notTV:
endif
; initialize some things about the memory windows.
; first determine the window that we write to
mov al, ss:[modeInfo].VMI_winAAttr
mov ah, ss:[modeInfo].VMI_winBAttr
test ah, mask VWA_SUPPORTED or mask VWA_WRITEABLE
jz winAWrite
jnp winAWrite ; if two not set...
mov bl, VW_WINDOW_B ; bl = write window
mov cx, ss:[modeInfo].VMI_winBSeg ; cx = write win addr
tryWinARead:
test al, mask VWA_SUPPORTED or mask VWA_READABLE
jz winBRead
jnp winBRead
mov bh, VW_WINDOW_A
mov dx, ss:[modeInfo].VMI_winASeg
storeRWWin:
mov {word} ss:[writeWindow], bx ; save results
mov ss:[writeSegment], cx
mov ss:[readSegment], dx
; calculate the last offset in the window
mov bx, ss:[modeInfo].VMI_winSize
mov ax, bx
xchg al, ah ; *256
shl ax, 1 ; *512
shl ax, 1 ; *1024
dec ax ; last offset
mov ss:[curWinEnd], ax ; last offset in 64K
; calculate the window bump when going to the next window.
; It's the size divided by the granularity
mov ax, bx ; ax = winSize
mov bx, ss:[modeInfo].VMI_winGran ; bx = granularity
div bl ; al = #to bump
mov ss:[nextWinInc], ax ; set increment
.leave
ret
; window B doesn't exist or is not writeable. Use window A
; and try window B for reading.
winAWrite:
mov bl, VW_WINDOW_A
mov cx, ss:[modeInfo].VMI_winASeg
test ah, mask VWA_SUPPORTED or mask VWA_READABLE
jz tryWinARead
jnp tryWinARead
winBRead:
mov bh, VW_WINDOW_B
mov dx, ss:[modeInfo].VMI_winBSeg
jmp storeRWWin
VidSetVESA endp
vesaHeight label word
word 480 ; VD_VESA_640x480_16
word 600 ; VD_VESA_800x600_16
ifndef PRODUCT_WIN_DEMO
word 350 ; VD_VESA_640x350_16
word 400 ; VD_VESA_640x400_16
word 400 ; VD_VESA_720x400_16
word 480 ; VD_VESA_800x480_16
word 624 ; VD_VESA_832x624_16
word 600 ; VD_VESA_1024_600_16
word 768 ; VD_VESA_1Kx768_16
word 864 ; VD_VESA_1152x864_16
word 600 ; VD_VESA_1280x600_16
word 720 ; VD_VESA_1280x720_16
word 768 ; VD_VESA_1280x768_16
word 800 ; VD_VESA_1280x800_16
word 854 ; VD_VESA_1280x854_16
word 960 ; VD_VESA_1280x960_16
word 1024 ; VD_VESA_1280x1K_16
word 768 ; VD_VESA_1360_768_16
word 768 ; VD_VESA_1366_768_16
word 1050 ; VD_VESA_1400_1050_16
word 900 ; VD_VESA_1440_900_16
word 900 ; VD_VESA_1600_900_16
word 1024 ; VD_VESA_1600_1024_16
word 1200 ; VD_VESA_1600_1200_16
word 1050 ; VD_VESA_1680_1050_16
word 1024 ; VD_VESA_1920_1024_16
word 1080 ; VD_VESA_1920_1080_16
word 1200 ; VD_VESA_1920_1200_16
word 1440 ; VD_VESA_1920_1440_16
word 1536 ; VD_VESA_2048_1536_16
endif
vesaWidth label word
word 640 ; VD_VESA_640x480_16
word 800 ; VD_VESA_800x600_16
ifndef PRODUCT_WIN_DEMO
word 640 ; VD_VESA_640x350_16
word 640 ; VD_VESA_640x400_16
word 720 ; VD_VESA_720x400_16
word 800 ; VD_VESA_800x480_16
word 832 ; VD_VESA_832x624_16
word 1024 ; VD_VESA_1024_600_16
word 1024 ; VD_VESA_1Kx768_16
word 1152 ; VD_VESA_1152x864_16
word 1280 ; VD_VESA_1280x600_16
word 1280 ; VD_VESA_1280x720_16
word 1280 ; VD_VESA_1280x768_16
word 1280 ; VD_VESA_1280x800_16
word 1280 ; VD_VESA_1280x854_16
word 1280 ; VD_VESA_1280x960_16
word 1280 ; VD_VESA_1280x1K_16
word 1360 ; VD_VESA_1360_768_16
word 1366 ; VD_VESA_1366_768_16
word 1400 ; VD_VESA_1400_1050_16
word 1440 ; VD_VESA_1440_900_16
word 1600 ; VD_VESA_1600_900_16
word 1600 ; VD_VESA_1600_1024_16
word 1600 ; VD_VESA_1600_1200_16
word 1680 ; VD_VESA_1680_1050_16
word 1920 ; VD_VESA_1920_1024_16
word 1920 ; VD_VESA_1920_1080_16
word 1920 ; VD_VESA_1920_1200_16
word 1920 ; VD_VESA_1920_1440_16
word 2048 ; VD_VESA_2048_1536_16
endif
VidEnds Misc
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c7/c74305b.ada | best08618/asylo | 7 | 5384 | -- C74305B.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT A DEFERRED CONSTANT CAN BE USED AS A DEFAULT
-- INITIALIZATION FOR A PARAMETER OR AS A DEFAULT INITIA-
-- LIZATION FOR A COMPONENT (GENERIC CASE).
-- EG 12/20/83
WITH REPORT;
PROCEDURE C74305B IS
USE REPORT;
PACKAGE PK IS
TYPE TD IS PRIVATE;
CD : CONSTANT TD;
DD : CONSTANT TD;
GENERIC
TYPE T1 IS PRIVATE;
C1 : T1;
WITH PROCEDURE P2 (A1 : T1 := C1; A2 : TD := CD);
PROCEDURE P1 (A1 : TD := CD);
PRIVATE
TYPE TD IS NEW INTEGER;
CD : CONSTANT TD := 2;
DD : CONSTANT TD := 3;
END PK;
USE PK;
PACKAGE BODY PK IS
PROCEDURE P1 (A1 : TD := CD) IS
BEGIN
IF ( A1 /= 2 ) THEN
FAILED ("WRONG ACTUAL PARAMETER RECEIVED (1)");
END IF;
P2;
END P1;
PROCEDURE P3 (X : TD := DD; Y : TD := DD) IS
BEGIN
IF ( X /= 2 ) THEN
FAILED ("WRONG ACTUAL PARAMETER RECEIVED (2)");
END IF;
IF ( Y /= 2 ) THEN
FAILED ("WRONG ACTUAL PARAMETER RECEIVED (3)");
END IF;
END P3;
PROCEDURE P4 IS NEW P1 (TD,CD,P3);
BEGIN
TEST ("C74305B","CHECK THAT A DEFERRED CONSTANT CAN BE " &
"USED AS A DEFAULT INITIALIZATION FOR A " &
"PARAMETER OR AS A DEFAULT INITIALIZATION " &
"FOR A COMPONENT (GENERIC CASE)");
P4;
END PK;
PROCEDURE P5 (X : TD := DD; Y : TD := DD) IS
BEGIN
IF ( X /= CD ) THEN
FAILED ("WRONG ACTUAL PARAMETER RECEIVED (4)");
END IF;
IF ( Y /= CD ) THEN
FAILED ("WRONG ACTUAL PARAMETER RECEIVED (5)");
END IF;
END P5;
PROCEDURE P6 IS NEW P1 (TD,CD,P5);
BEGIN
P6;
RESULT;
END C74305B;
|
programs/oeis/044/A044790.asm | jmorken/loda | 1 | 242270 | ; A044790: Numbers n such that string 7,7 occurs in the base 10 representation of n but not of n+1.
; 77,177,277,377,477,577,677,779,877,977,1077,1177,1277,1377,1477,1577,1677,1779,1877,1977,2077,2177,2277,2377,2477,2577,2677,2779,2877,2977,3077,3177,3277,3377,3477,3577,3677,3779,3877
mov $1,2
mov $4,$0
add $0,3
mod $0,10
lpb $0
trn $0,9
mul $1,$3
lpe
add $1,77
mov $2,$4
mul $2,100
add $1,$2
|
test/interaction/MetaNameSuggestion.agda | cruhland/agda | 1,989 | 12871 | -- Andreas, 2016-09-12
--
-- Underscores should also get meaningful names
-- (not just metas from omitted hidden arguments)
-- {-# OPTIONS -v tc.meta.name:100 #-}
postulate
F : (A : Set) → Set
G : {B : Set} → Set
test1 : Set
test1 = F _
-- name of this meta should be _A_0
test2 : Set
test2 = G
-- creates meta _B_1
test3 : Set
test3 = G {_}
-- name of this meta should be _B_2
|
session_02/01-arraysum/arraysum.asm | DigiOhhh/LabArchitettura2-2017-2018 | 1 | 95211 | <reponame>DigiOhhh/LabArchitettura2-2017-2018
.data
A: .space 52
h: .space 4
.text
.globl main
main:
la $s1, h # $t0 = &h
la $s2, A # $t1 = A
lw $t0, 0($s1) # $t0 = h
lw $t1, 32($s2) # $t1 = A[8]
add $t0, $t1, $t0 # $t0 = $t1 + $t0
sw $t0, 48($s2) # A[12] = $t0 |
src/Categories/Object/Product/Limit.agda | laMudri/agda-categories | 0 | 11136 | <reponame>laMudri/agda-categories<gh_stars>0
{-# OPTIONS --without-K --safe #-}
open import Categories.Category.Core
module Categories.Object.Product.Limit {o ℓ e} (C : Category o ℓ e) where
open import Level
open import Data.Nat.Base using (ℕ)
open import Data.Fin.Base using (Fin)
open import Data.Fin.Patterns
open import Categories.Category.Lift
open import Categories.Category.Finite.Fin
open import Categories.Category.Finite.Fin.Construction.Discrete
open import Categories.Object.Product C
open import Categories.Diagram.Limit
open import Categories.Functor.Core
import Categories.Category.Construction.Cones as Co
import Categories.Morphism.Reasoning as MR
private
module C = Category C
open C
open MR C
open HomReasoning
module _ {o′ ℓ′ e′} {F : Functor (liftC o′ ℓ′ e′ (Discrete 2)) C} where
private
module F = Functor F
open F
limit⇒product : Limit F → Product (F₀ (lift 0F)) (F₀ (lift 1F))
limit⇒product L = record
{ A×B = apex
; π₁ = proj (lift 0F)
; π₂ = proj (lift 1F)
; ⟨_,_⟩ = λ f g → rep record
{ apex = record
{ ψ = λ { (lift 0F) → f
; (lift 1F) → g }
; commute = λ { {lift 0F} {lift 0F} (lift 0F) → elimˡ identity
; {lift 1F} {lift 1F} (lift 0F) → elimˡ identity }
}
}
; project₁ = commute
; project₂ = commute
; unique = λ {_} {h} eq eq′ → terminal.!-unique record
{ arr = h
; commute = λ { {lift 0F} → eq
; {lift 1F} → eq′ }
}
}
where open Limit L
module _ o′ ℓ′ e′ A B where
open Equiv
product⇒limit-F : Functor (liftC o′ ℓ′ e′ (Discrete 2)) C
product⇒limit-F = record
{ F₀ = λ { (lift 0F) → A
; (lift 1F) → B }
; F₁ = λ { {lift 0F} {lift 0F} _ → C.id
; {lift 1F} {lift 1F} _ → C.id }
; identity = λ { {lift 0F} → refl
; {lift 1F} → refl }
; homomorphism = λ { {lift 0F} {lift 0F} {lift 0F} → sym identity²
; {lift 1F} {lift 1F} {lift 1F} → sym identity² }
; F-resp-≈ = λ { {lift 0F} {lift 0F} _ → refl
; {lift 1F} {lift 1F} _ → refl }
}
module _ o′ ℓ′ e′ {A B} (p : Product A B) where
open Product p
private
F = product⇒limit-F o′ ℓ′ e′ A B
open Functor F
product⇒limit : Limit F
product⇒limit = record
{ terminal = record
{ ⊤ = record
{ N = A×B
; apex = record
{ ψ = λ { (lift 0F) → π₁
; (lift 1F) → π₂ }
; commute = λ { {lift 0F} {lift 0F} (lift 0F) → identityˡ
; {lift 1F} {lift 1F} (lift 0F) → identityˡ }
}
}
; ! = λ {K} →
let open Co.Cone F K
in record
{ arr = ⟨ ψ (lift 0F) , ψ (lift 1F) ⟩
; commute = λ { {lift 0F} → project₁
; {lift 1F} → project₂ }
}
; !-unique = λ {K} f →
let module K = Co.Cone F K
module f = Co.Cone⇒ F f
in begin
⟨ K.ψ (lift 0F) , K.ψ (lift 1F) ⟩ ≈˘⟨ ⟨⟩-cong₂ f.commute f.commute ⟩
⟨ π₁ ∘ f.arr , π₂ ∘ f.arr ⟩ ≈⟨ g-η ⟩
f.arr ∎
}
}
|
test_1defprom.asm | acastrauss/compiler_project | 0 | 241794 |
main:
PUSH %14
MOV %15,%14
SUBS %15,$8,%15
MOV $5,-4(%14)
MOV $5,-8(%14)
@main_body:
MOV -4(%14),%13
JMP @main_exit
@main_exit:
MOV %14,%15
POP %14
RET |
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1484.asm | ljhsiun2/medusa | 9 | 25296 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %rdx
push %rsi
lea addresses_A_ht+0x122e, %r10
and %r14, %r14
mov $0x6162636465666768, %rdx
movq %rdx, %xmm3
and $0xffffffffffffffc0, %r10
vmovntdq %ymm3, (%r10)
nop
nop
nop
nop
sub $25778, %r14
lea addresses_UC_ht+0x18656, %r10
add $55713, %r14
mov $0x6162636465666768, %r12
movq %r12, (%r10)
nop
nop
xor %rsi, %rsi
pop %rsi
pop %rdx
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r9
push %rbp
push %rcx
push %rdx
push %rsi
// Faulty Load
lea addresses_A+0x8c56, %rdx
nop
nop
sub $61071, %r11
mov (%rdx), %rcx
lea oracles, %r11
and $0xff, %rcx
shlq $12, %rcx
mov (%r11,%rcx,1), %rcx
pop %rsi
pop %rdx
pop %rcx
pop %rbp
pop %r9
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
programs/oeis/076/A076507.asm | neoneye/loda | 22 | 10703 | <filename>programs/oeis/076/A076507.asm
; A076507: Three people (P1, P2, P3) are in a circle and are saying Hello to each other. They start with P2 saying "Hello, Hello". Thereafter Pn says "Hello" for n times the total number of Hello's so far.
; 2,6,8,32,144,192,768,3456,4608,18432,82944,110592,442368,1990656,2654208,10616832,47775744,63700992,254803968,1146617856,1528823808,6115295232,27518828544,36691771392,146767085568,660451885056
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
trn $0,1
seq $0,76508 ; Expansion of 2*x*(1+4*x+8*x^2)/(1-24*x^3).
mov $2,$3
mul $2,$0
add $1,$2
mov $4,$0
lpe
min $5,1
mul $5,$4
sub $1,$5
mov $0,$1
|
alloy4fun_models/trainstlt/models/4/Hz9mYKfP7vGCQFAGY.als | Kaixi26/org.alloytools.alloy | 0 | 2582 | <filename>alloy4fun_models/trainstlt/models/4/Hz9mYKfP7vGCQFAGY.als<gh_stars>0
open main
pred idHz9mYKfP7vGCQFAGY_prop5 {
always all t: Train | no t.pos & Exit implies t.pos' in t.pos + t.pos.prox
}
pred __repair { idHz9mYKfP7vGCQFAGY_prop5 }
check __repair { idHz9mYKfP7vGCQFAGY_prop5 <=> prop5o } |
specs/ada/common/tkmrpc-response-cfg-tkm_version-convert.ads | DrenfongWong/tkm-rpc | 0 | 24583 | with Ada.Unchecked_Conversion;
package Tkmrpc.Response.Cfg.Tkm_Version.Convert is
function To_Response is new Ada.Unchecked_Conversion (
Source => Tkm_Version.Response_Type,
Target => Response.Data_Type);
function From_Response is new Ada.Unchecked_Conversion (
Source => Response.Data_Type,
Target => Tkm_Version.Response_Type);
end Tkmrpc.Response.Cfg.Tkm_Version.Convert;
|
src/main/fragment/mos6502-common/vwum1=pwuc1_derefidx_vbuxx_plus_vbuaa.asm | jbrandwood/kickc | 2 | 241658 | clc
adc {c1},x
sta {m1}
lda {c1}+1,x
adc #0
sta {m1}+1 |
regtests/servlet-requests-tests.adb | My-Colaborations/ada-servlet | 6 | 21172 | <reponame>My-Colaborations/ada-servlet
-----------------------------------------------------------------------
-- servlet-requests-tests - Unit tests for requests
-- Copyright (C) 2012, 2013, 2015, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
with Util.Log.Loggers;
with Servlet.Requests.Mockup;
with Servlet.Responses.Mockup;
package body Servlet.Requests.Tests is
-- The logger
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Servlet.Requests.Tests");
package Caller is new Util.Test_Caller (Test, "Requests");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Servlet.Requests.Split_Header",
Test_Split_Header'Access);
Caller.Add_Test (Suite, "Test Servlet.Requests.Accept_Locales",
Test_Accept_Locales'Access);
Caller.Add_Test (Suite, "Test Servlet.Requests.Set_Attribute",
Test_Set_Attribute'Access);
Caller.Add_Test (Suite, "Test Servlet.Requests.Get_Header",
Test_Headers'Access);
end Add_Tests;
-- ------------------------------
-- Test the Split_Header procedure.
-- ------------------------------
procedure Test_Split_Header (T : in out Test) is
procedure Process_Text (Item : in String;
Quality : in Quality_Type);
Count : Natural := 0;
procedure Process_Text (Item : in String;
Quality : in Quality_Type) is
begin
T.Assert (Item = "text/plain" or Item = "text/html" or Item = "text/x-dvi"
or Item = "text/x-c", "Invalid item: " & Item);
T.Assert (Quality = 0.5 or Quality = 0.8 or Quality = 1.0,
"Invalid quality");
if Item = "text/plain" then
T.Assert (Quality = 0.5, "Invalid quality for " & Item);
elsif Item = "text/x-dvi" or Item = "text/html" then
T.Assert (Quality = 0.8, "Invalid quality for " & Item);
else
T.Assert (Quality = 1.0, "Invalid quality for " & Item);
end if;
Count := Count + 1;
end Process_Text;
begin
Split_Header ("text/plain; q=0.5, text/html,text/x-dvi; q=0.8, text/x-c",
Process_Text'Access);
Util.Tests.Assert_Equals (T, 4, Count, "Invalid number of items");
end Test_Split_Header;
-- ------------------------------
-- Test the Accept_Locales procedure.
-- ------------------------------
procedure Test_Accept_Locales (T : in out Test) is
procedure Process_Locale (Locale : in Util.Locales.Locale;
Quality : in Quality_Type);
Req : Servlet.Requests.Mockup.Request;
Count : Natural := 0;
procedure Process_Locale (Locale : in Util.Locales.Locale;
Quality : in Quality_Type) is
pragma Unreferenced (Quality);
Lang : constant String := Util.Locales.Get_Language (Locale);
begin
Log.Info ("Found locale: {0}", Util.Locales.To_String (Locale));
T.Assert (Lang = "da" or Lang = "en_GB" or Lang = "en",
"Invalid lang: " & Lang);
Count := Count + 1;
end Process_Locale;
begin
Req.Accept_Locales (Process_Locale'Access);
Util.Tests.Assert_Equals (T, 1, Count, "Invalid number of calls");
Count := 0;
Req.Set_Header ("Accept-Language", "da, en-gb;q=0.8, en;q=0.7");
Req.Accept_Locales (Process_Locale'Access);
Util.Tests.Assert_Equals (T, 3, Count, "Invalid number of calls");
end Test_Accept_Locales;
-- ------------------------------
-- Test the Set_Attribute procedure.
-- ------------------------------
procedure Test_Set_Attribute (T : in out Test) is
use Util.Beans.Objects;
Req : Servlet.Requests.Mockup.Request;
begin
Req.Set_Attribute ("page", Util.Beans.Objects.To_Object (Integer (1)));
Util.Tests.Assert_Equals (T, 1, Util.Beans.Objects.To_Integer (Req.Get_Attribute ("page")),
"Invalid page attribute");
Req.Remove_Attribute ("page");
T.Assert (Util.Beans.Objects.Is_Null (Req.Get_Attribute ("page")),
"Attribute page is not null");
Req.Set_Attribute ("page", Util.Beans.Objects.To_Object (Integer (1)));
Req.Set_Attribute ("page", Util.Beans.Objects.Null_Object);
T.Assert (Util.Beans.Objects.Is_Null (Req.Get_Attribute ("page")),
"Attribute page is not null");
end Test_Set_Attribute;
-- ------------------------------
-- Test the getting, inserting headers.
-- ------------------------------
procedure Test_Headers (T : in out Test) is
Req : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
D : Ada.Calendar.Time;
V : Integer;
begin
Req.Set_Header ("Content-Type", "text/plain");
Req.Set_Header ("Count", "23");
Req.Set_Header ("If-Modified-Since", "Tue, 09 Jan 2018 22:55:08 GMT");
Util.Tests.Assert_Equals (T, "text/plain", Req.Get_Header ("Content-Type"),
"Invalid date header: Content-Type");
D := Req.Get_Date_Header ("If-Modified-Since");
-- Check the integer header conversion.
V := Req.Get_Int_Header ("Count");
Util.Tests.Assert_Equals (T, 23, V, "Invalid integer header: Count");
T.Assert (not Req.Is_Ajax_Request, "Is_Ajax_Request must be false");
Req.Set_Header ("X-Requested-With", "none");
T.Assert (Req.Is_Ajax_Request, "Is_Ajax_Request must be true");
-- Header tests on the response.
Reply.Set_Header ("Count", "230");
Reply.Set_Int_Header ("Count-Len", 44);
Reply.Add_Int_Header ("Length", 123);
Reply.Set_Date_Header ("Date", D);
Reply.Add_Date_Header ("Second-Date", D);
-- Check the integer header conversion.
Util.Tests.Assert_Equals (T, "230", Reply.Get_Header ("Count"),
"Invalid response integer header: Count");
Util.Tests.Assert_Equals (T, "44", Reply.Get_Header ("Count-Len"),
"Invalid response integer header: Count-Len");
Util.Tests.Assert_Equals (T, "123", Reply.Get_Header ("Length"),
"Invalid response integer header: Length");
Util.Tests.Assert_Equals (T, "Tue, 09 Jan 2018 22:55:08 GMT", Reply.Get_Header ("Date"),
"Invalid response date header: Date");
Util.Tests.Assert_Equals (T, "Tue, 09 Jan 2018 22:55:08 GMT",
Reply.Get_Header ("Second-Date"),
"Invalid response date header: Date");
Reply.Set_Content_Length (123);
Util.Tests.Assert_Equals (T, "123", Reply.Get_Header ("Content-Length"));
Reply.Set_Content_Length (456);
Util.Tests.Assert_Equals (T, "456", Reply.Get_Header ("Content-Length"));
Reply.Send_Redirect (Location => "https://somewhere.com");
Util.Tests.Assert_Equals (T, "https://somewhere.com", Reply.Get_Header ("Location"));
end Test_Headers;
end Servlet.Requests.Tests;
|
src/game.asm | hundredrabbits/Donsol | 113 | 93353 |
;;
show@game: ;
LDA #$01
STA reqdraw_game
STA reqdraw_cursor
STA view@game ; set view
JSR restart@game ; restart
RTS
;;
restart@game: ;
JSR init@deck ; deck
JSR shuffle@deck
JSR reset@player ; player
JSR enter@room
LDA #$0D
CLC
ADC difficulty@player ; reflect difficulty
JSR show@dialog ; dialog:difficulty
RTS
;;
interpolateStats@game: ;
LDA spui@game ;
CMP sp@player ; sprite x
BEQ @skip
BCC @incShield
DEC spui@game ; when less
JMP @redrawShield
@incShield: ;
INC spui@game
@redrawShield: ;
LDA redraws@game ; request redraw
ORA REQ_SP
STA redraws@game
RTS
@skip: ;
LDA hpui@game ; interpolate health
CMP hp@player ; sprite x
BEQ @done
BCC @incHealth
DEC hpui@game
JMP @redrawHealth
@incHealth: ;
INC hpui@game
@redrawHealth: ;
LDA redraws@game ; request redraw
ORA REQ_HP
STA redraws@game
@done: ;
RTS
;;
redrawScreen@game: ;
; remove flag
LDA #$00
STA reqdraw_game
;
JSR stop@renderer
JSR load@game
JSR loadInterface@game
JSR loadAttributes@game
JSR start@renderer
RTI
;;
load@game: ;
BIT PPUSTATUS ; reset latch
LDA #$20
STA PPUADDR
LDA #$00
STA PPUADDR
LDX #$00
LDY #$00
@loop: ;
LDA #$00 ; sprite id
STA PPUDATA
INY
CPY #$00
BNE @loop
INX
CPX #$04
BNE @loop
RTS
;;
loadInterface@game: ;
BIT PPUSTATUS ; read PPU status to reset the high/low latch
LDA #$21 ; HP H
STA PPUADDR ; write the high byte
LDA #$03
STA PPUADDR ; write the low byte
LDA #$12
STA PPUDATA
LDA #$1A ; HP P
STA PPUDATA
LDA #$21 ; SP S
STA PPUADDR ; write the high byte
LDA #$0A
STA PPUADDR ; write the low byte
LDA #$1D
STA PPUDATA
LDA #$1A ; SP P
STA PPUDATA
LDA #$21 ; XP X
STA PPUADDR ; write the high byte
LDA #$11
STA PPUADDR ; write the low byte
LDA #$22
STA PPUDATA
LDA #$1A ; XP P
STA PPUDATA
RTS
;;
loadAttributes@game: ;
BIT PPUSTATUS
LDA #$23
STA PPUADDR
LDA #$C0
STA PPUADDR
LDX #$00
@loop: ;
LDA attributes@game, x
STA PPUDATA
INX
CPX #$40
BNE @loop
RTS
;;
redrawCursor@game: ;
; remove flag
LDA #$00
STA reqdraw_cursor
; setup
LDA #$B0
STA $0200 ; (part1)set tile.y pos
LDA #$13
STA $0201 ; (part1)set tile.id
LDA #$00
STA $0202 ; (part1)set tile.attribute[off]
;
LDX cursor@game
LDA selections@game, x
STA $0203 ; set tile.x pos
JSR sprites@renderer
@done: ;
RTI
;; redraw
redrawHealth@game: ;
; remove flag
LDA redraws@game
EOR REQ_HP
STA redraws@game
;
LDY hpui@game
BIT PPUSTATUS ; read PPU status to reset the high/low latch
; pos
LDA #$21
STA PPUADDR ; write the high byte
LDA #$07
STA PPUADDR ; write the low byte
; digits
LDA number_high, y
STA PPUDATA
LDA number_low, y
STA PPUDATA
; progress bar
LDA healthbarpos, y ; regA has sprite offset
TAY ; regY has sprite offset
LDX #$00
@loop: ;
LDA #$20
STA PPUADDR ; write the high byte
LDA healthbaroffset, x
STA PPUADDR ; write the low byte
LDA progressbar, y ; regA has sprite id
STA PPUDATA
INY
INX
CPX #$06
BNE @loop
; sickness
LDA #$21
STA PPUADDR ; write the high byte
LDA #$05
STA PPUADDR ; write the low byte
LDA sickness@player
CMP #$01
BNE @false
; sickness icon
LDA #$3F
STA PPUDATA
JMP @done
@false: ;
LDA #$00
STA PPUDATA
@done: ;
JSR fix@renderer
RTI
;; shield value
redrawShield@game: ;
; remove flag
LDA redraws@game
EOR REQ_SP
STA redraws@game
;
LDY spui@game
BIT PPUSTATUS ; read PPU status to reset the high/low latch
; pos
LDA #$21
STA PPUADDR ; write the high byte
LDA #$0E
STA PPUADDR ; write the low byte
; digit 1
LDA number_high, y
STA PPUDATA
LDA number_low, y
STA PPUDATA
;
LDA shieldbarpos, y ; regA has sprite offset
TAY ; regY has sprite offset
LDX #$00
@loop: ;
LDA #$20
STA PPUADDR ; write the high byte
LDA shieldbaroffset, x
STA PPUADDR ; write the low byte
LDA progressbar, y ; regA has sprite id
STA PPUDATA
INY
INX
CPX #$06
BNE @loop
; durability
LDA #$21
STA PPUADDR ; write the high byte
LDA #$0C
STA PPUADDR ; write the low byte
LDX dp@player
LDA card_glyphs, x
STA PPUDATA
JSR fix@renderer
RTI
;; experience value
redrawExperience@game: ;
; remove flag
LDA redraws@game
EOR REQ_XP
STA redraws@game
;
LDY xp@player
BIT PPUSTATUS ; read PPU status to reset the high/low latch
; pos
LDA #$21
STA PPUADDR ; write the high byte
LDA #$15
STA PPUADDR ; write the low byte
; load xp in y
LDA number_high, y ; digit 1
STA PPUDATA
LDA number_low, y ; digit 2
STA PPUDATA
; progress bar
LDA experiencebarpos, y ; regA has sprite offset
TAY ; regY has sprite offset
LDX #$00
@loop: ;
LDA #$20
STA PPUADDR ; write the high byte
LDA experiencebaroffset, x
STA PPUADDR ; write the low byte
LDA progressbar, y ; regA has sprite id
STA PPUDATA
INY
INX
CPX #$06
BNE @loop
JSR fix@renderer
RTI
;;
redrawRun@game: ;
; remove flag
LDA redraws@game
EOR REQ_RUN
STA redraws@game
;
JSR stop@renderer
LDA length@deck ; don't display the run butto on first hand
CMP #$31 ; deck is $36 - 4(first hand)
BEQ @hide
JSR loadRun@player ; load canRun in regA
CMP #$01
BNE @hide
LDA length@deck ; Can't run the last room
CMP #$00
BEQ @hide
@show: ; RUN: $1c,$1f,$18
BIT PPUSTATUS ; read PPU status to reset the high/low latch
LDA #$21
STA PPUADDR ; write the high byte
LDA #$18
STA PPUADDR ; write the low byte
LDA #$6D ; Button(B)
STA PPUDATA
LDA #$00 ; Blank
STA PPUDATA
LDA #$1C ; R
STA PPUDATA
LDA #$1F ; U
STA PPUDATA
LDA #$18 ; N
STA PPUDATA
JSR start@renderer
RTI
@hide: ;
BIT PPUSTATUS ; read PPU status to reset the high/low latch
LDA #$21
STA PPUADDR ; write the high byte
LDA #$18
STA PPUADDR ; write the low byte
LDA #$00 ; R
STA PPUDATA
STA PPUDATA
STA PPUDATA
STA PPUDATA
STA PPUDATA
JSR start@renderer
RTI
;;
redrawName@game: ;
;remove trigger
LDA #$00
STA reqdraw_name
;
BIT PPUSTATUS
LDA #$21
STA PPUADDR
LDA #$43
STA PPUADDR
LDX #$00
@loop: ;
LDY #$01 ; load card id
; load card name
LDY cursor@game
LDA card1@room, y
TAY
LDA card_names_offset_lb,y
STA lb@temp
LDA card_names_offset_hb,y
STA hb@temp
TYA
STX id@temp
CLC
ADC id@temp
TAY
LDA (lb@temp), y ; load value at 16-bit address from (lb@temp + hb@temp) + y
; draw sprite
STA PPUDATA
INX
CPX #$10
BNE @loop
JSR fix@renderer
RTI
;; to merge into a single routine
redrawCard1@game: ;
; remove flag
LDA redraws@game
EOR REQ_CARD1
STA redraws@game
;
JSR stop@renderer
LDX #$00
@loop: ;
LDA card1pos_high, x
STA PPUADDR ; write the high byte
LDA card1pos_low, x
STA PPUADDR ; write the low byte
LDA card1@buffers, x
STA PPUDATA ; set tile.x pos
INX
CPX #$36
BNE @loop
JSR start@renderer
RTI
;;
redrawCard2@game: ;
; remove flag
LDA redraws@game
EOR REQ_CARD2
STA redraws@game
;
JSR stop@renderer
LDX #$00
@loop: ;
LDA card1pos_high, x
STA PPUADDR ; write the high byte
LDA card2pos_low, x
STA PPUADDR ; write the low byte
LDA card2@buffers, x
STA PPUDATA
INX
CPX #$36
BNE @loop
JSR start@renderer
RTI
;;
redrawCard3@game: ;
; remove flag
LDA redraws@game
EOR REQ_CARD3
STA redraws@game
;
LDX #$00
JSR stop@renderer
@loop: ;
LDA card3pos_high, x
STA PPUADDR ; write the high byte
LDA card3pos_low, x
STA PPUADDR ; write the low byte
LDA card3@buffers, x
STA PPUDATA
INX
CPX #$36
BNE @loop
JSR start@renderer
RTI
;;
redrawCard4@game: ;
; remove flag
LDA redraws@game
EOR REQ_CARD4
STA redraws@game
;
JSR stop@renderer
LDX #$00
@loop: ;
LDA card3pos_high, x
STA PPUADDR ; write the high byte
LDA card4pos_low, x
STA PPUADDR ; write the low byte
LDA card4@buffers, x
STA PPUDATA
INX
CPX #$36
BNE @loop
JSR start@renderer
RTI
;;
animateTimer@game: ; when timer reaches 0, set auto@room flag to 1
LDA timer@room
CMP #$00
BEQ @skip
; check timer is done
CMP #$01
BEQ @run
DEC timer@room
RTS
@run: ;
LDA #$01
STA auto@room
@skip: ;
RTS |
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2279.asm | ljhsiun2/medusa | 9 | 22169 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0xb2cb, %rsi
lea addresses_A_ht+0x51ea, %rdi
nop
nop
cmp $20006, %rbp
mov $114, %rcx
rep movsq
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_UC_ht+0xfa22, %rsi
lea addresses_D_ht+0xeb82, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
add %rax, %rax
mov $92, %rcx
rep movsq
nop
nop
nop
xor $34806, %rsi
lea addresses_WC_ht+0x83a, %rsi
lea addresses_UC_ht+0x14d22, %rdi
nop
inc %r12
mov $107, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_A_ht+0x1c882, %rcx
nop
nop
nop
nop
nop
sub $63793, %r10
mov (%rcx), %r12d
nop
nop
nop
nop
sub %rbp, %rbp
lea addresses_UC_ht+0x2f22, %rax
nop
nop
nop
nop
nop
cmp $27430, %r10
movb $0x61, (%rax)
nop
and $555, %rdi
lea addresses_WC_ht+0x3a22, %r10
nop
nop
sub $60954, %rax
and $0xffffffffffffffc0, %r10
vmovntdqa (%r10), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %r12
and %rbp, %rbp
lea addresses_WC_ht+0xd622, %rsi
lea addresses_D_ht+0x19a22, %rdi
nop
nop
nop
and $43149, %rbp
mov $28, %rcx
rep movsw
xor %rsi, %rsi
lea addresses_D_ht+0x1b5c2, %r12
nop
nop
nop
dec %rsi
mov (%r12), %ecx
nop
nop
nop
nop
nop
add $42336, %rsi
lea addresses_UC_ht+0x18a22, %rsi
lea addresses_D_ht+0x1222, %rdi
nop
nop
nop
nop
cmp $38091, %rbp
mov $23, %rcx
rep movsb
nop
nop
add %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r8
push %r9
push %rbp
push %rdi
// Store
mov $0xb22, %r8
nop
add %rdi, %rdi
movb $0x51, (%r8)
nop
nop
and $50162, %r9
// Load
lea addresses_PSE+0xc222, %rdi
xor $4418, %r11
mov (%rdi), %r15d
nop
nop
add %r15, %r15
// Store
lea addresses_RW+0x1ac22, %rbp
nop
cmp %rdi, %rdi
movl $0x51525354, (%rbp)
nop
nop
nop
inc %r11
// Store
lea addresses_A+0x1c82, %r11
nop
nop
nop
and $50283, %r13
mov $0x5152535455565758, %r9
movq %r9, (%r11)
nop
nop
nop
dec %r15
// Faulty Load
lea addresses_normal+0xba22, %rdi
nop
nop
cmp %r8, %r8
movups (%rdi), %xmm4
vpextrq $1, %xmm4, %r9
lea oracles, %r13
and $0xff, %r9
shlq $12, %r9
mov (%r13,%r9,1), %r9
pop %rdi
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'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
*/
|
externals/mpir-3.0.0/mpn/x86_64w/skylake/rshift.asm | JaminChan/eos_win | 12 | 3224 | <reponame>JaminChan/eos_win<filename>externals/mpir-3.0.0/mpn/x86_64w/skylake/rshift.asm<gh_stars>10-100
; PROLOGUE(mpn_rshift)
; Version 1.0.4.
;
; Copyright 2008 <NAME>
;
; Windows Conversion Copyright 2008 <NAME>
;
; This file is part of the MPIR Library.
; The MPIR Library is free software; you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as published
; by the Free Software Foundation; either version 2.1 of the License, or (at
; your option) any later version.
; The MPIR Library is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
; License for more details.
; You should have received a copy of the GNU Lesser General Public License
; along with the MPIR Library; see the file COPYING.LIB. If not, write
; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
; Boston, MA 02110-1301, USA.
;
; mp_limb_t mpn_rshift(mp_ptr, mp_ptr, mp_size_t, mp_uint)
; rax rdi rsi rdx rcx
; rax rcx rdx r8 r9d
%include "yasm_mac.inc"
CPU SSE4.2
BITS 64
LEAF_PROC mpn_rshift
mov r10, rcx
mov ecx, r9d
cmp r8, 2
ja .3
jz .2
.1: mov rdx, [rdx]
mov rax, rdx
shr rdx, cl
neg rcx
shl rax, cl
mov [r10], rdx
ret
.2: mov r8, [rdx]
mov r9, [rdx+8]
mov rax, r8
mov r11, r9
shr r8, cl
shr r9, cl
neg rcx
shl r11, cl
shl rax, cl
or r8, r11
mov [r10], r8
mov [r10+8], r9
ret
.3: mov r11, rdx
mov rdx, r8
mov eax, 64
lea r9, [r11+8]
sub rax, rcx
and r9, -16
movq xmm0, rcx
movq xmm1, rax
movdqa xmm5, [r9]
movdqa xmm3, xmm5
psllq xmm5, xmm1
movq rax, xmm5
cmp r11, r9
lea r11, [r11+rdx*8-40]
je .4
movq xmm2, [r9-8]
movq xmm4, xmm2
psllq xmm2, xmm1
psrlq xmm4, xmm0
por xmm4, xmm5
movq [r10], xmm4
lea r10, [r10+8]
dec rdx
movq rax, xmm2
.4: lea r10, [r10+rdx*8-40]
psrlq xmm3, xmm0
mov r8d, 5
sub r8, rdx
jnc .6
xalign 16
.5: movdqa xmm2, [r11+r8*8+16]
movdqa xmm4, xmm2
psllq xmm2, xmm1
shufpd xmm5, xmm2, 1
por xmm3, xmm5
movq [r10+r8*8], xmm3
movhpd [r10+r8*8+8], xmm3
psrlq xmm4, xmm0
movdqa xmm5, [r11+r8*8+32]
movdqa xmm3, xmm5
psllq xmm5, xmm1
shufpd xmm2, xmm5, 1
psrlq xmm3, xmm0
por xmm4, xmm2
movq [r10+r8*8+16], xmm4
movhpd [r10+r8*8+24], xmm4
add r8, 4
jnc .5
.6: cmp r8, 2
ja .10
jz .9
jp .8
.7: movdqa xmm2, [r11+r8*8+16]
movdqa xmm4, xmm2
psllq xmm2, xmm1
shufpd xmm5, xmm2, 1
por xmm3, xmm5
movq [r10+r8*8], xmm3
movhpd [r10+r8*8+8], xmm3
psrlq xmm4, xmm0
movq xmm5, [r11+r8*8+32]
movq xmm3, xmm5
psllq xmm5, xmm1
shufpd xmm2, xmm5, 1
psrlq xmm3, xmm0
por xmm4, xmm2
movq [r10+r8*8+16], xmm4
movhpd [r10+r8*8+24], xmm4
psrldq xmm5, 8
por xmm3, xmm5
movq [r10+r8*8+32], xmm3
ret
xalign 16
.8: movdqa xmm2, [r11+r8*8+16]
movdqa xmm4, xmm2
psllq xmm2, xmm1
shufpd xmm5, xmm2, 1
por xmm3, xmm5
movq [r10+r8*8], xmm3
movhpd [r10+r8*8+8], xmm3
psrlq xmm4, xmm0
psrldq xmm2, 8
por xmm4, xmm2
movq [r10+r8*8+16], xmm4
movhpd [r10+r8*8+24], xmm4
ret
xalign 16
.9: movq xmm2, [r11+r8*8+16]
movq xmm4, xmm2
psllq xmm2, xmm1
shufpd xmm5, xmm2, 1
por xmm3, xmm5
movq [r10+r8*8], xmm3
movhpd [r10+r8*8+8], xmm3
psrlq xmm4, xmm0
psrldq xmm2, 8
por xmm4, xmm2
movq [r10+r8*8+16], xmm4
ret
xalign 16
.10:psrldq xmm5, 8
por xmm3, xmm5
movq [r10+r8*8], xmm3
movhpd [r10+r8*8+8], xmm3
ret
end
|
programs/oeis/245/A245135.asm | karttu/loda | 0 | 167587 | ; A245135: Number of length 5 0..n arrays least squares fitting to a zero slope straight line, with a single point taken as having zero slope
; 8,39,112,275,552,1029,1728,2781,4200,6171,8688,11999,16072,21225,27392,34969,43848,54511,66800,81291,97768,116909,138432,163125,190632,221859,256368,295191,337800,385361,437248,494769,557192,625975,700272,781699,869288,964821,1067200,1178381,1297128,1425579,1562352,1709775,1866312,2034489,2212608,2403401,2605000,2820351,3047408,3289339,3543912,3814525,4098752,4400229,4716328,5050931,5401200,5771271,6158088,6566049,6991872,7440225,7907592,8398919,8910448,9447411,10005800,10591141,11199168,11835709,12496232,13186875,13902832,14650559,15424968,16232841,17068800,17939961,18840648,19778319,20746992,21754475,22794472,23875149,24989888,26147221,27340200,28577731,29852528,31173879,32534152,33943025,35392512,36892689,38435208,40030551,41670000,43364451,45104808,46902389,48747712,50652525,52606952,54623179,56690928,58822831,61008200,63260121,65567488,67943849,70377672,72882975,75447792,78086619,80787048,83564061,86404800,89324741,92310568,95378259,98514032,101734375,105025032,108403009,111853568,115394241,119009800,122718311,126504048,130385619,134346792,138406725,142548672,146792349,151120488,155553371,160073200,164700831,169417928,174245929,179165952,184200025,189328712,194574639,199917808,205381451,210945000,216632301,222422208,228339189,234361512,240514275,246775152,253169879,259675528,266318481,273075200,279972721,286986888,294145399,301423472,308849475,316397992,324098069,331923648,339904461,348013800,356282091,364681968,373244559,381941832,390805625,399807232,408979209,418292168,427779391,437410800,447220411,457177448,467316669,477606592,488082725,498712872,509533299,520511088,531683271,543016200,554547681,566243328,578141729,590207752,602480775,614924912,627580339,640410408,653456101,666680000,680123901,693749608,707599739,721635312,735899775,750353352,765040329,779920128,795037881,810352200,825909071
add $0,2
mov $2,$0
add $2,$0
cal $0,212578 ; Number of (w,x,y,z) with all terms in {1,...,n} and |w-x| = 2*|x-y| - |y-z|.
mul $0,$2
mov $1,$0
sub $1,16
div $1,2
add $1,8
|
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2640.asm | ljhsiun2/medusa | 9 | 86344 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2640.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x5c37, %rsi
lea addresses_UC_ht+0x1421f, %rdi
nop
nop
nop
nop
nop
and $45714, %r13
mov $95, %rcx
rep movsb
nop
nop
nop
xor $60196, %rcx
lea addresses_normal_ht+0x195a7, %r10
nop
nop
nop
nop
dec %rbp
mov (%r10), %rax
nop
nop
nop
sub %r13, %r13
lea addresses_A_ht+0x339f, %rax
nop
nop
nop
nop
sub $62549, %rcx
mov $0x6162636465666768, %r10
movq %r10, (%rax)
nop
nop
sub %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r9
push %rax
push %rbp
push %rdx
// Store
lea addresses_PSE+0x1461f, %r11
sub $53273, %r9
mov $0x5152535455565758, %rbp
movq %rbp, (%r11)
nop
nop
add $55965, %r11
// Load
mov $0x50dcb5000000061f, %r11
nop
dec %r10
mov (%r11), %edx
nop
and %r9, %r9
// Faulty Load
lea addresses_PSE+0x1461f, %rax
clflush (%rax)
cmp %r10, %r10
mov (%rax), %rbp
lea oracles, %r10
and $0xff, %rbp
shlq $12, %rbp
mov (%r10,%rbp,1), %rbp
pop %rdx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_NC', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c83027c.ada | best08618/asylo | 7 | 24826 | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c83027c.ada
-- C83027C.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT A DECLARATION WITHIN THE DISCRIMINANT PART OF A
-- PRIVATE TYPE DECLARATION, AN INCOMPLETE TYPE DECLARATION, AND A
-- GENERIC FORMAL TYPE DECLARATION HIDES AN OUTER DECLARATION OF A
-- HOMOGRAPH. ALSO, CHECK THAT THE OUTER DECLARATION IS DIRECTLY
-- VISIBLE IN BOTH DECLARATIVE REGIONS BEFORE THE DECLARATION OF THE
-- INNER HOMOGRAPH AND THE OUTER DECLARATION IS VISIBLE BY SELECTION
-- AFTER THE INNER HOMOGRAPH DECLARATION.
-- HISTORY:
-- BCB 09/06/88 CREATED ORIGINAL TEST.
WITH REPORT; USE REPORT;
PROCEDURE C83027C IS
GENERIC
TYPE T IS PRIVATE;
X : T;
FUNCTION GEN_FUN RETURN T;
FUNCTION GEN_FUN RETURN T IS
BEGIN
RETURN X;
END GEN_FUN;
BEGIN
TEST ("C83027C", "CHECK THAT A DECLARATION IN THE DISCRIMINANT " &
"PART OF A PRIVATE TYPE DECLARATION, AN " &
"INCOMPLETE TYPE DECLARATION, AND A GENERIC " &
"FORMAL TYPE DECLARATION HIDES AN OUTER " &
"DECLARATION OF A HOMOGRAPH");
ONE:
DECLARE
A : INTEGER := IDENT_INT(2);
D : INTEGER := IDENT_INT(2);
G : INTEGER := IDENT_INT(2);
H : INTEGER := G;
TYPE REC (Z : INTEGER) IS RECORD
NULL;
END RECORD;
GENERIC
TYPE INNER3 (G : INTEGER) IS PRIVATE;
PACKAGE P_ONE IS
TYPE INNER (X : INTEGER := A;
A : INTEGER := IDENT_INT(3);
C : INTEGER := ONE.A) IS PRIVATE;
TYPE INNER2 (Y : INTEGER := D;
D : INTEGER := IDENT_INT(3);
F : INTEGER := ONE.D);
TYPE INNER2 (Y : INTEGER := D;
D : INTEGER := IDENT_INT(3);
F : INTEGER := ONE.D) IS RECORD
E : INTEGER := D;
END RECORD;
PRIVATE
TYPE INNER (X : INTEGER := A;
A : INTEGER := IDENT_INT(3);
C : INTEGER := ONE.A) IS RECORD
B : INTEGER := A;
END RECORD;
END P_ONE;
PACKAGE BODY P_ONE IS
RECVAR : INNER;
RECVAR2 : INNER2;
RECVAR3 : INNER3(3);
BEGIN
IF RECVAR.A /= IDENT_INT(3) THEN
FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 1");
END IF;
IF A /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 2");
END IF;
IF RECVAR.B /= IDENT_INT(3) THEN
FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 3");
END IF;
IF RECVAR.C /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 4");
END IF;
IF RECVAR.X /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 5");
END IF;
IF RECVAR2.D /= IDENT_INT(3) THEN
FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 6");
END IF;
IF D /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 7");
END IF;
IF RECVAR2.E /= IDENT_INT(3) THEN
FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 8");
END IF;
IF RECVAR2.F /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 9");
END IF;
IF RECVAR2.Y /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 10");
END IF;
IF RECVAR3.G /= IDENT_INT(3) THEN
FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 11");
END IF;
IF G /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 12");
END IF;
IF H /= IDENT_INT(2) THEN
FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 13");
END IF;
END P_ONE;
PACKAGE NEW_P_ONE IS NEW P_ONE (REC);
BEGIN -- ONE
NULL;
END ONE;
RESULT;
END C83027C;
|
oeis/034/A034084.asm | neoneye/loda-programs | 11 | 174062 | ; A034084: Decimal part of n-th root of a(n) starts with digit 7.
; Submitted by <NAME>
; 3,5,9,15,25,42,70,119,202,343,583,991,1684,2863,4867,8273,14064,23908,40643,69092,117457,199676,339449,577063,981007,1667712,2835110,4819686,8193466,13928892,23679116,40254498,68432646,116335497
add $0,2
mov $1,17
pow $1,$0
mov $2,10
pow $2,$0
div $1,$2
mov $0,$1
add $0,1
|
agda/Bound/Lower/Order.agda | bgbianchi/sorting | 6 | 10611 | <reponame>bgbianchi/sorting<filename>agda/Bound/Lower/Order.agda
module Bound.Lower.Order {A : Set}(_≤_ : A → A → Set) where
open import Bound.Lower A
data LeB : Bound → Bound → Set where
lebx : {b : Bound}
→ LeB bot b
lexy : {a b : A}
→ a ≤ b
→ LeB (val a) (val b)
|
test/Succeed/Issue2327.agda | cruhland/agda | 1,989 | 3941 |
data Unit : Set where
unit : Unit
mutual
data D : Unit → Set where
c : (x : Unit) → F x x → D x
F : Unit → Unit → Set
F unit x = D x
Works : (x : Unit) → D x → Set₁
Works .x (c x p) with x
Works .x (c x p) | _ = Set
Fails : (x : Unit) → D x → Set₁
Fails y = Fails′ y
where
Fails′ : (x : Unit) → D x → Set₁
Fails′ .x (c x p) with x
Fails′ .x (c x p) | _ = Set
|
programs/oeis/139/A139545.asm | jmorken/loda | 1 | 9025 | <reponame>jmorken/loda<filename>programs/oeis/139/A139545.asm
; A139545: Binomial transform of [1, 0, 0, 4, 0, 0, 7, 0, 0, 10, ...].
; 1,1,1,5,17,41,88,190,421,935,2051,4445,9562,20476,43681,92837,196613,415073,873820,1835002,3844765,8039075,16777223,34952549,72701278,150994936,313174681,648719009,1342177289,2773833065,5726623072
mov $2,$0
add $2,1
mov $13,$0
lpb $2
mov $0,$13
sub $2,1
sub $0,$2
mov $9,$0
mov $11,2
lpb $11
mov $0,$9
sub $11,1
add $0,$11
sub $0,1
mov $5,$0
mov $7,2
lpb $7
mov $0,$5
sub $7,1
add $0,$7
mov $4,$0
cal $0,130707 ; a(n+3) = 3*(a(n+2) - a(n+1)) + 2*a(n).
mul $4,$0
mov $3,$4
mov $8,$7
lpb $8
mov $6,$3
sub $8,1
lpe
lpe
lpb $5
mov $5,0
sub $6,$3
lpe
mov $3,$6
mov $12,$11
lpb $12
mov $10,$3
sub $12,1
lpe
lpe
lpb $9
mov $9,0
sub $10,$3
lpe
mov $3,$10
div $3,2
add $1,$3
lpe
|
src/compilemon.adb | alvaromb/Compilemon | 1 | 22098 | -- COMPILEMON.adb
-- Programa per compilar el compilador
with Ada.Text_IO,
Ada.Command_Line,
Decls.D_Taula_De_Noms,
Decls.Dgenerals,
Decls.Dtdesc,
Pk_Usintactica_Tokens,
Pk_Ulexica_Io,
U_Lexica,
Pk_Usintactica,
Decls.D_Atribut,
Semantica,
Decls.Dtnode,
Semantica.Ctipus,
Semantica.Declsc3a,
Semantica.Gci,
Semantica.Assemblador;
use Ada.Text_IO,
Ada.Command_Line,
Decls.D_Taula_De_Noms,
Decls.Dgenerals,
Decls.Dtdesc,
Pk_Usintactica_Tokens,
Pk_Ulexica_Io,
U_Lexica,
Pk_Usintactica,
Decls.D_Atribut,
Semantica,
Decls.Dtnode,
Semantica.Ctipus,
Semantica.Declsc3a,
Semantica.Gci,
Semantica.Assemblador;
procedure Compilemon is
begin
Open_Input(Argument(1));
Inicia_analisi(Argument(1));
yyparse;
--Comprovacio de tipus
Ct_Programa(Arbre);
if not esem then
-- Generacio de codi intermedi
Inicia_Generacio(Argument(1));
Gci_Programa(Arbre);
-- Generacio de codi assemblador
Genera_Assemblador(Argument(1));
end if;
Close_Input;
exception
when Syntax_Error =>
Put_Line("ERROR CompiLEMON: Error a la linea "
&yy_line_number'img&
" i columna "&yy_begin_column'img);
end compilemon;
|
Exams/Specimen_Mini_Test_Alloy/Group_III-1.als | pemesteves/MFES_2021 | 0 | 782 | <filename>Exams/Specimen_Mini_Test_Alloy/Group_III-1.als
sig Tree { root: lone Node }
sig Node {
left, right : lone Node,
value: one Int,
}
fun parent[n: Node]: Node {
left.n + right.n
}
pred wellFormedTree {
// b)
all n: Node | some n.left + n.right => n.^left != n.^right
// c)
all disj n1, n2: Node | parent[n2] = n1 => (not n1 in n2.^(left + right))
// d)
all n: Node | not n = Tree.root => (one n1: Node | parent[n] = n1) else parent[n] = none
// e)
all n: Node | (one n.left implies n.left.value < n.value) and (one n.right implies n.value < n.right.value)
// f)
all disj n1, n2: Node | n1.value != n2.value
// g)
all n: Node |
let leftNum = #(n.left.*(left+right)) |
let rightNum = #(n.right.*(left+right)) |
leftNum > rightNum implies leftNum - rightNum <= 1 else rightNum - leftNum <= 1
}
check wellFormedTree {}
fact {wellFormedTree}
run {} for 4 but 1 Tree |
middleware/src/filesystem/filesystem-fat.adb | rocher/Ada_Drivers_Library | 192 | 8046 | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- This packages provide a low level driver for the FAT file system
-- architecture. It is recommended to _not_ use this interface directly but to
-- access the file system using the File_IO package. For more info, see the
-- file system chapter of the documentation.
with Ada.Unchecked_Conversion;
with Filesystem.FAT.Directories;
with Filesystem.FAT.Files;
package body Filesystem.FAT is
The_File_Handles :
array (1 .. MAX_FILE_HANDLES) of aliased FAT_File_Handle;
Last_File_Handle : Natural := 0;
The_Dir_Handles :
array (1 .. MAX_DIR_HANDLES) of aliased FAT_Directory_Handle;
Last_Dir_Handle : Natural := 0;
function Find_Free_Dir_Handle return FAT_Directory_Handle_Access;
function Find_Free_File_Handle return FAT_File_Handle_Access;
procedure Initialize_FS
(FS : in out FAT_Filesystem;
Status : out Status_Code);
--------------------------
-- Find_Free_Dir_Handle --
--------------------------
function Find_Free_Dir_Handle return FAT_Directory_Handle_Access
is
Found : Boolean := False;
begin
for J in Last_Dir_Handle + 1 .. The_Dir_Handles'Last loop
if The_Dir_Handles (J).Is_Free then
The_Dir_Handles (J).Is_Free := False;
Last_Dir_Handle := J;
Found := True;
exit;
end if;
end loop;
if not Found then
for J in The_Dir_Handles'First .. Last_Dir_Handle loop
if The_Dir_Handles (J).Is_Free then
The_Dir_Handles (J).Is_Free := False;
Last_Dir_Handle := J;
Found := True;
exit;
end if;
end loop;
end if;
if not Found then
return null;
else
return The_Dir_Handles (Last_Dir_Handle)'Access;
end if;
end Find_Free_Dir_Handle;
---------------------------
-- Find_Free_File_Handle --
---------------------------
function Find_Free_File_Handle return FAT_File_Handle_Access
is
begin
for J in Last_File_Handle + 1 .. The_File_Handles'Last loop
if The_File_Handles (J).Is_Free then
The_File_Handles (J).Is_Free := False;
Last_File_Handle := J;
return The_File_Handles (Last_File_Handle)'Access;
end if;
end loop;
for J in The_File_Handles'First .. Last_File_Handle loop
if The_File_Handles (J).Is_Free then
The_File_Handles (J).Is_Free := False;
Last_File_Handle := J;
return The_File_Handles (Last_File_Handle)'Access;
end if;
end loop;
return null;
end Find_Free_File_Handle;
---------
-- "-" --
---------
function "-" (Name : FAT_Name) return String
is
begin
return Name.Name (1 .. Name.Len);
end "-";
---------
-- "-" --
---------
function "-" (Name : String) return FAT_Name
is
Ret : FAT_Name;
begin
for J in Name'Range loop
if Name (J) = '/' then
raise Constraint_Error;
end if;
end loop;
Ret.Len := Name'Length;
Ret.Name (1 .. Name'Length) := Name;
return Ret;
end "-";
---------
-- "=" --
---------
overriding function "=" (Name1, Name2 : FAT_Name) return Boolean
is
function To_Upper (C : Character) return Character
is (if C in 'a' .. 'z'
then Character'Val
(Character'Pos (C) - Character'Pos ('a') + Character'Pos ('A'))
else C);
begin
if Name1.Len /= Name2.Len then
return False;
end if;
for J in 1 .. Name1.Len loop
if To_Upper (Name1.Name (J)) /= To_Upper (Name2.Name (J)) then
return False;
end if;
end loop;
return True;
end "=";
-------------
-- Is_Root --
-------------
function Is_Root (Path : String) return Boolean
is
begin
return Path'Length = 0 or else
(Path'Length = 1 and then Path (Path'First) = '/');
end Is_Root;
--------------
-- Basename --
--------------
function Basename (Path : String) return String
is
Last : Natural := Path'Last;
begin
if Path'Length = 0 then
return "";
end if;
if Path (Last) = '/' then
Last := Last - 1;
end if;
for J in reverse 1 .. Last loop
if Path (J) = '/' then
return Path (J + 1 .. Last);
end if;
end loop;
return Path (Path'First .. Last);
end Basename;
------------
-- Parent --
------------
function Parent (Path : String) return String
is
Last : Natural;
begin
if Path'Length = 0 then
return "";
end if;
Last := (if Path (Path'Last) = '/' then Path'Last - 1 else Path'Last);
for J in reverse Path'First .. Last loop
if Path (J) = '/' then
return Path (Path'First .. J);
end if;
end loop;
return "";
end Parent;
---------------
-- Normalize --
---------------
function Normalize (Path : String;
Ensure_Dir : Boolean := False) return String
is
Idx : Integer;
Prev : Natural;
Token : FAT_Name;
Last : Natural;
Ret : String := Path;
begin
if Ret'Length = 0 then
return "/";
end if;
-- Preserve initial '/'
if Ret (Ret'First) = '/' then
Idx := Ret'First + 1;
else
Idx := Ret'First;
end if;
Last := Ret'Last;
-- Below: Idx always points to the first character of a path element.
while Idx <= Last loop
Token.Len := 0;
for J in Idx .. Last loop
exit when Ret (J) = '/';
Token.Len := Token.Len + 1;
Token.Name (Token.Len) := Ret (J);
end loop;
if -Token = "." then
-- Skip
if Idx + 2 > Last then
-- Ret ends with just a '.'
-- remove it:
Last := Last - 1;
else
Ret (Idx .. Last - 2) := Ret (Idx + 2 .. Last);
Last := Last - 2;
end if;
elsif -Token = ".." then
if Idx - 1 <= Ret'First then
-- We have "/../<subdirs>", or "../<subdirs>".
-- invalid but we keep as-is
Idx := Idx + 3;
else
Prev := 0;
-- Find the parent directory separator
for J in reverse Ret'First .. Idx - 2 loop
if Ret (J) = '/' then
Prev := J + 1;
exit;
else
Prev := J;
end if;
end loop;
Ret (Prev .. Last + Prev - Idx - 3) := Ret (Idx + 3 .. Last);
Last := Last + Prev - Idx - 3;
Idx := Prev;
end if;
elsif Token.Len = 0 then
-- We have two consecutive slashes
Ret (Idx .. Last - 1) := Ret (Idx + 1 .. Last);
Last := Last - 1;
else
Idx := Idx + Token.Len + 1;
end if;
end loop;
if Last = 0 then
if Ensure_Dir then
return "/";
else
return "";
end if;
else
if Ret (Ret'First) /= '/' then
if Ensure_Dir and then Ret (Last) /= '/' then
return "/" & Ret (Ret'First .. Last) & "/";
else
return "/" & Ret (Ret'First .. Last);
end if;
else
if Ensure_Dir and then Ret (Last) /= '/' then
return Ret (Ret'First .. Last) & "/";
else
return Ret (Ret'First .. Last);
end if;
end if;
end if;
end Normalize;
----------
-- Trim --
----------
function Trim (S : String) return String
is
begin
for J in reverse S'Range loop
if S (J) /= ' ' then
return S (S'First .. J);
end if;
end loop;
return "";
end Trim;
----------
-- Open --
----------
function Open
(Controller : HAL.Block_Drivers.Any_Block_Driver;
LBA : Block_Number;
FS : in out FAT_Filesystem) return Status_Code
is
Status : Status_Code;
begin
FS.Initialized := True;
FS.Controller := Controller;
FS.LBA := LBA;
Initialize_FS (FS, Status);
if Status /= OK then
FS.Initialized := False;
return Status;
end if;
return OK;
end Open;
-------------------
-- Initialize_FS --
-------------------
procedure Initialize_FS
(FS : in out FAT_Filesystem;
Status : out Status_Code)
is
subtype Disk_Parameter_Block is Block (0 .. 91);
function To_Disk_Parameter is new Ada.Unchecked_Conversion
(Disk_Parameter_Block, FAT_Disk_Parameter);
subtype FSInfo_Block is Block (0 .. 11);
function To_FSInfo is new Ada.Unchecked_Conversion
(FSInfo_Block, FAT_FS_Info);
begin
FS.Window_Block := 16#FFFF_FFFF#;
Status := FS.Ensure_Block (0);
if Status /= OK then
return;
end if;
if FS.Window (510 .. 511) /= (16#55#, 16#AA#) then
Status := No_Filesystem;
return;
end if;
FS.Disk_Parameters :=
To_Disk_Parameter (FS.Window (0 .. 91));
if FS.Version = FAT32 then
Status :=
FS.Ensure_Block (Block_Offset (FS.FSInfo_Block_Number));
if Status /= OK then
return;
end if;
-- Check the generic FAT block signature
if FS.Window (510 .. 511) /= (16#55#, 16#AA#) then
Status := No_Filesystem;
return;
end if;
FS.FSInfo :=
To_FSInfo (FS.Window (16#1E4# .. 16#1EF#));
FS.FSInfo_Changed := False;
end if;
declare
FAT_Size_In_Block : constant Unsigned_32 :=
FS.FAT_Table_Size_In_Blocks *
Unsigned_32 (FS.Number_Of_FATs);
Root_Dir_Size : Block_Offset;
begin
FS.FAT_Addr := Block_Offset (FS.Reserved_Blocks);
FS.Data_Area := FS.FAT_Addr + Block_Offset (FAT_Size_In_Block);
if FS.Version = FAT16 then
-- Add space for the root directory
FS.Root_Dir_Area := FS.Data_Area;
Root_Dir_Size :=
(Block_Offset (FS.FAT16_Root_Dir_Num_Entries) * 32 +
Block_Offset (FS.Block_Size) - 1) /
Block_Offset (FS.Block_Size);
-- Align on clusters
Root_Dir_Size :=
((Root_Dir_Size + FS.Blocks_Per_Cluster - 1) /
FS.Blocks_Per_Cluster) *
FS.Blocks_Per_Cluster;
FS.Data_Area := FS.Data_Area + Root_Dir_Size;
end if;
FS.Num_Clusters :=
Cluster_Type
((FS.Total_Number_Of_Blocks - Unsigned_32 (FS.Data_Area)) /
Unsigned_32 (FS.Blocks_Per_Cluster));
end;
FS.Root_Entry := Directories.Root_Entry (FS);
end Initialize_FS;
-----------
-- Close --
-----------
overriding procedure Close (FS : in out FAT_Filesystem)
is
begin
for J in The_File_Handles'Range loop
if not The_File_Handles (J).Is_Free
and then The_File_Handles (J).FS = FS'Unchecked_Access
then
The_File_Handles (J).Close;
end if;
end loop;
for J in The_Dir_Handles'Range loop
if not The_Dir_Handles (J).Is_Free
and then The_Dir_Handles (J).FS = FS'Unchecked_Access
then
The_Dir_Handles (J).Close;
end if;
end loop;
if FS.FSInfo_Changed then
FS.Write_FSInfo;
FS.FSInfo_Changed := False;
end if;
FS.Initialized := False;
end Close;
------------------
-- Ensure_Block --
------------------
function Ensure_Block
(FS : in out FAT_Filesystem;
Block : Block_Offset) return Status_Code
is
begin
if Block = FS.Window_Block then
return OK;
end if;
if not FS.Controller.Read
(FS.LBA + Block, FS.Window)
then
FS.Window_Block := 16#FFFF_FFFF#;
return Disk_Error;
end if;
FS.Window_Block := Block;
return OK;
end Ensure_Block;
----------------
-- Root_Entry --
----------------
overriding function Root_Node
(FS : in out FAT_Filesystem;
As : String;
Handle : out Any_Node_Handle)
return Status_Code
is
begin
FS.Root_Entry.L_Name := -As;
Handle := FS.Root_Entry'Unchecked_Access;
return OK;
end Root_Node;
----------
-- Open --
----------
overriding function Open
(FS : in out FAT_Filesystem;
Path : String;
Handle : out Any_Directory_Handle) return Status_Code
is
begin
return FAT_Open (FS, Path, FAT_Directory_Handle_Access (Handle));
end Open;
--------------
-- FAT_Open --
--------------
function FAT_Open
(FS : in out FAT_Filesystem;
Path : String;
Handle : out FAT_Directory_Handle_Access) return Status_Code
is
E : aliased FAT_Node;
Full : constant String := Normalize (Path);
Status : Status_Code;
begin
if not Is_Root (Full) then
Status := Directories.Find (FS, Full, E);
if Status /= OK then
return Status;
end if;
else
E := FS.Root_Entry;
end if;
Status := OK;
return E.FAT_Open (Handle);
end FAT_Open;
----------
-- Open --
----------
function FAT_Open
(D_Entry : FAT_Node;
Handle : out FAT_Directory_Handle_Access) return Status_Code
is
begin
Handle := null;
if not Is_Subdirectory (D_Entry) then
return No_Such_File;
end if;
Handle := Find_Free_Dir_Handle;
if Handle = null then
return Too_Many_Open_Files;
end if;
Handle.FS := D_Entry.FS;
Handle.Current_Index := 0;
if D_Entry.Is_Root then
if D_Entry.FS.Version = FAT16 then
Handle.Start_Cluster := 0;
Handle.Current_Block := D_Entry.FS.Root_Dir_Area;
else
Handle.Start_Cluster := D_Entry.FS.Root_Dir_Cluster;
Handle.Current_Block :=
D_Entry.FS.Cluster_To_Block (D_Entry.FS.Root_Dir_Cluster);
end if;
else
Handle.Start_Cluster := D_Entry.Start_Cluster;
Handle.Current_Block :=
D_Entry.FS.Cluster_To_Block (D_Entry.Start_Cluster);
end if;
Handle.Current_Cluster := Handle.Start_Cluster;
return OK;
end FAT_Open;
-----------
-- Reset --
-----------
overriding procedure Reset (Dir : in out FAT_Directory_Handle)
is
begin
Dir.Current_Block := Cluster_To_Block (Dir.FS.all, Dir.Start_Cluster);
Dir.Current_Cluster := Dir.Start_Cluster;
Dir.Current_Index := 0;
end Reset;
----------
-- Read --
----------
overriding function Read
(Dir : in out FAT_Directory_Handle;
Handle : out Any_Node_Handle) return Status_Code
is
Node : FAT_Node;
Status : Status_Code;
begin
Status := Directories.Read (Dir, Node);
Dir.Current_Node := Node;
Handle := Dir.Current_Node'Unchecked_Access;
return Status;
end Read;
-----------
-- Close --
-----------
overriding procedure Close (Dir : in out FAT_Directory_Handle)
is
begin
Dir.FS := null;
Dir.Current_Index := 0;
Dir.Start_Cluster := 0;
Dir.Current_Cluster := 0;
Dir.Current_Block := 0;
Dir.Is_Free := True;
end Close;
-----------------
-- Create_File --
-----------------
overriding
function Create_File (This : in out FAT_Filesystem;
Path : String)
return Status_Code
is
Parent_E : FAT_Node;
Node : FAT_Node;
Ret : Status_Code;
begin
if Directories.Find (This, Parent (Path), Parent_E) /= OK then
return No_Such_File;
end if;
Ret := Directories.Create_File_Node (Parent_E, -Basename (Path), Node);
return Ret;
end Create_File;
------------
-- Unlink --
------------
overriding
function Unlink (This : in out FAT_Filesystem;
Path : String)
return Status_Code
is
Parent_E : FAT_Node;
Node : FAT_Node;
begin
if Is_Root (Path) then
return No_Such_File;
end if;
if Directories.Find (This, Parent (Path), Parent_E) /= OK then
return No_Such_File;
end if;
if Directories.Find (Parent_E, -Basename (Path), Node) /= OK then
return No_Such_File;
end if;
return Directories.Delete_Entry (Dir => Parent_E,
Ent => Node);
end Unlink;
----------------------
-- Remove_Directory --
----------------------
overriding
function Remove_Directory (This : in out FAT_Filesystem;
Path : String)
return Status_Code
is
E : aliased FAT_Node;
Full : constant String := Normalize (Path);
Status : Status_Code;
begin
if not Is_Root (Full) then
Status := Directories.Find (This, Full, E);
if Status /= OK then
return Status;
end if;
else
return Invalid_Parameter;
end if;
return Directories.Delete_Subdir (E, False);
end Remove_Directory;
----------
-- Open --
----------
overriding function Open
(FS : in out FAT_Filesystem;
Path : String;
Mode : File_Mode;
Handle : out Any_File_Handle) return Status_Code
is
Parent_E : FAT_Node;
begin
Handle := null;
if Is_Root (Path) then
return No_Such_File;
end if;
if Directories.Find (FS, Parent (Path), Parent_E) /= OK then
return No_Such_File;
end if;
return Open (Parent => Parent_E,
Name => Basename (Path),
Mode => Mode,
Handle => Handle);
end Open;
----------
-- Open --
----------
overriding function Open
(Parent : FAT_Node;
Name : String;
Mode : File_Mode;
Handle : out Any_File_Handle) return Status_Code
is
FAT_Handle : FAT_File_Handle_Access;
Ret : Status_Code;
begin
FAT_Handle := Find_Free_File_Handle;
if FAT_Handle = null then
return Too_Many_Open_Files;
end if;
Ret := Files.Open (Parent, -Name, Mode, FAT_Handle);
Handle := Any_File_Handle (FAT_Handle);
return Ret;
end Open;
----------
-- Size --
----------
overriding function Size (File : FAT_File_Handle) return File_Size
is
begin
return File_Size (File.D_Entry.Size);
end Size;
----------
-- Mode --
----------
overriding function Mode (File : FAT_File_Handle) return File_Mode
is
begin
return File.Mode;
end Mode;
----------
-- Read --
----------
overriding function Read
(File : in out FAT_File_Handle;
Addr : System.Address;
Length : in out File_Size) return Status_Code
is
L : FAT_File_Size := FAT_File_Size (Length);
Ret : Status_Code;
begin
Ret := Files.Read (File, Addr, L);
Length := File_Size (L);
return Ret;
end Read;
-- ----------
-- -- Read --
-- ----------
--
-- procedure Generic_Read
-- (Handle : File_Handle;
-- Value : out T)
-- is
-- Ret : File_Size with Unreferenced;
-- begin
-- Ret := Files.Read (Handle, Value'Address, T'Size / 8);
-- end Generic_Read;
------------
-- Offset --
------------
overriding function Offset
(File : FAT_File_Handle) return File_Size
is (File_Size (File.File_Index));
----------------
-- File_Write --
----------------
overriding function Write
(File : in out FAT_File_Handle;
Addr : System.Address;
Length : File_Size) return Status_Code
is
begin
return Files.Write (File, Addr, FAT_File_Size (Length));
end Write;
----------------
-- File_Flush --
----------------
overriding function Flush
(File : in out FAT_File_Handle) return Status_Code
is
begin
return Files.Flush (File);
end Flush;
---------------
-- File_Seek --
---------------
overriding function Seek
(File : in out FAT_File_Handle;
Origin : Seek_Mode;
Amount : in out File_Size) return Status_Code
is
Num : FAT_File_Size := FAT_File_Size (Amount);
Ret : Status_Code;
begin
Ret := Files.Seek (File, Num, Origin);
Amount := File_Size (Num);
return Ret;
end Seek;
----------------
-- File_Close --
----------------
overriding procedure Close (File : in out FAT_File_Handle)
is
begin
Files.Close (File);
File.Is_Free := True;
end Close;
-------------
-- Get_FAT --
-------------
function Get_FAT
(FS : in out FAT_Filesystem;
Cluster : Cluster_Type) return Cluster_Type
is
Idx : Natural;
Block_Num : Block_Offset;
subtype B4 is Block (1 .. 4);
subtype B2 is Block (1 .. 2);
function To_Cluster is new Ada.Unchecked_Conversion
(B4, Cluster_Type);
function To_U16 is new Ada.Unchecked_Conversion
(B2, Unsigned_16);
begin
if Cluster < 2 or else Cluster > FS.Num_Clusters + 2 then
return 1;
end if;
if FS.Version = FAT32 then
Block_Num :=
FS.FAT_Addr +
Block_Offset (Cluster) * 4 / Block_Offset (FS.Block_Size);
else
Block_Num :=
FS.FAT_Addr +
Block_Offset (Cluster) * 2 / Block_Offset (FS.Block_Size);
end if;
if Block_Num /= FS.FAT_Block then
FS.FAT_Block := Block_Num;
if not FS.Controller.Read
(FS.LBA + FS.FAT_Block,
FS.FAT_Window)
then
FS.FAT_Block := 16#FFFF_FFFF#;
return INVALID_CLUSTER;
end if;
end if;
if FS.Version = FAT32 then
Idx :=
Natural (FAT_File_Size ((Cluster) * 4) mod FS.Block_Size);
return To_Cluster (FS.FAT_Window (Idx .. Idx + 3)) and 16#0FFF_FFFF#;
else
Idx :=
Natural (FAT_File_Size ((Cluster) * 2) mod FS.Block_Size);
return Cluster_Type (To_U16 (FS.FAT_Window (Idx .. Idx + 1)));
end if;
end Get_FAT;
-------------
-- Set_FAT --
-------------
function Set_FAT
(FS : in out FAT_Filesystem;
Cluster : Cluster_Type;
Value : Cluster_Type) return Status_Code
is
Idx : Natural;
Block_Num : Block_Offset;
Dead : Boolean with Unreferenced;
subtype B4 is Block (1 .. 4);
function From_Cluster is new Ada.Unchecked_Conversion
(Cluster_Type, B4);
begin
if Cluster < Valid_Cluster'First or else Cluster > FS.Num_Clusters then
return Internal_Error;
end if;
Block_Num :=
FS.FAT_Addr +
Block_Offset (Cluster) * 4 / Block_Offset (FS.Block_Size);
if Block_Num /= FS.FAT_Block then
FS.FAT_Block := Block_Num;
if not FS.Controller.Read (FS.LBA + FS.FAT_Block, FS.FAT_Window) then
FS.FAT_Block := 16#FFFF_FFFF#;
return Disk_Error;
end if;
end if;
Idx := Natural (FAT_File_Size (Cluster * 4) mod FS.Block_Size);
FS.FAT_Window (Idx .. Idx + 3) := From_Cluster (Value);
if not FS.Controller.Write (FS.LBA + FS.FAT_Block, FS.FAT_Window) then
return Disk_Error;
end if;
return OK;
end Set_FAT;
------------------
-- Write_FSInfo --
------------------
procedure Write_FSInfo
(FS : in out FAT_Filesystem)
is
subtype FSInfo_Block is Block (0 .. 11);
function From_FSInfo is new Ada.Unchecked_Conversion
(FAT_FS_Info, FSInfo_Block);
Status : Status_Code;
FAT_Begin_LBA : constant Block_Offset :=
Block_Offset (FS.FSInfo_Block_Number);
Ret : Status_Code with Unreferenced;
begin
Status := FS.Ensure_Block (FAT_Begin_LBA);
if Status /= OK then
return;
end if;
-- again, check the generic FAT block signature
if FS.Window (510 .. 511) /= (16#55#, 16#AA#) then
return;
end if;
-- good. now we got the entire FSinfo in our window.
-- modify that part of the window and writeback.
FS.Window (16#1E4# .. 16#1EF#) := From_FSInfo (FS.FSInfo);
Ret := FS.Write_Window;
end Write_FSInfo;
----------------------
-- Get_Free_Cluster --
----------------------
function Get_Free_Cluster
(FS : in out FAT_Filesystem;
Previous : Cluster_Type := INVALID_CLUSTER) return Cluster_Type
is
Candidate : Cluster_Type := Previous;
begin
-- First check for a cluster that is just after the previous one
-- allocated for the entry
if Candidate in Valid_Cluster'Range
and then Candidate < FS.Num_Clusters
then
Candidate := Candidate + 1;
if FS.Is_Free_Cluster (FS.Get_FAT (Candidate)) then
return Candidate;
end if;
end if;
-- Next check the most recently allocated cluster
Candidate := FS.Most_Recently_Allocated_Cluster + 1;
if Candidate not in Valid_Cluster'Range then
Candidate := Valid_Cluster'First;
end if;
while Candidate in Valid_Cluster'Range
and then Candidate < FS.Num_Clusters
loop
if FS.Is_Free_Cluster (FS.Get_FAT (Candidate)) then
return Candidate;
end if;
Candidate := Candidate + 1;
end loop;
Candidate := Valid_Cluster'First;
while Candidate <= FS.Most_Recently_Allocated_Cluster loop
if FS.Is_Free_Cluster (FS.Get_FAT (Candidate)) then
return Candidate;
end if;
Candidate := Candidate + 1;
end loop;
return INVALID_CLUSTER;
end Get_Free_Cluster;
-----------------
-- New_Cluster --
-----------------
function New_Cluster
(FS : in out FAT_Filesystem) return Cluster_Type
is
begin
return FS.New_Cluster (INVALID_CLUSTER);
end New_Cluster;
-----------------
-- New_Cluster --
-----------------
function New_Cluster
(FS : in out FAT_Filesystem;
Previous : Cluster_Type) return Cluster_Type
is
Ret : Cluster_Type;
begin
pragma Assert
(FS.Version = FAT32,
"FS write only supported on FAT32 for now");
Ret := FS.Get_Free_Cluster (Previous);
if Ret = INVALID_CLUSTER then
return Ret;
end if;
if Previous /= INVALID_CLUSTER then
if FS.Set_FAT (Previous, Ret) /= OK then
return INVALID_CLUSTER;
end if;
end if;
if FS.Set_FAT (Ret, LAST_CLUSTER_VALUE) /= OK then
return INVALID_CLUSTER;
end if;
FS.FSInfo.Free_Clusters := FS.FSInfo.Free_Clusters - 1;
FS.FSInfo.Last_Allocated_Cluster := Ret;
FS.FSInfo_Changed := True;
return Ret;
end New_Cluster;
------------------
-- Write_Window --
------------------
function Write_Window
(FS : in out FAT_Filesystem) return Status_Code
is
begin
if FS.Controller.Write (FS.LBA + FS.Window_Block, FS.Window) then
return OK;
else
return Disk_Error;
end if;
end Write_Window;
-----------
-- Close --
-----------
overriding procedure Close (E : in out FAT_Node) is
begin
null;
end Close;
----------
-- Size --
----------
overriding function Size (E : FAT_Node) return File_Size
is (File_Size (E.Size));
end Filesystem.FAT;
|
Transynther/x86/_processed/AVXALIGN/_st_sm_/i9-9900K_12_0xca_notsx.log_21829_1529.asm | ljhsiun2/medusa | 9 | 98825 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x12aaa, %rsi
lea addresses_A_ht+0xfd2a, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
cmp $58032, %r10
mov $18, %rcx
rep movsq
nop
nop
nop
cmp %rax, %rax
lea addresses_WC_ht+0x1ab0e, %rbx
nop
xor $14605, %rdx
movb $0x61, (%rbx)
nop
inc %rax
lea addresses_WC_ht+0x11a32, %rcx
xor $25219, %r10
mov $0x6162636465666768, %rax
movq %rax, %xmm2
and $0xffffffffffffffc0, %rcx
vmovaps %ymm2, (%rcx)
nop
nop
nop
xor %rcx, %rcx
lea addresses_D_ht+0x361e, %rsi
lea addresses_A_ht+0xe744, %rdi
add $54387, %rbx
mov $9, %rcx
rep movsq
and $8501, %rbx
lea addresses_WC_ht+0xd92a, %rdi
nop
cmp %r10, %r10
mov $0x6162636465666768, %rax
movq %rax, %xmm1
movups %xmm1, (%rdi)
nop
xor $34270, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %rax
push %rbp
push %rdi
push %rdx
push %rsi
// Load
lea addresses_PSE+0xe72a, %rsi
nop
nop
nop
xor $22289, %rax
mov (%rsi), %di
nop
nop
nop
nop
mfence
// Load
lea addresses_WC+0xe61e, %r15
nop
nop
xor $46793, %rbp
mov (%r15), %r14d
nop
cmp $27916, %r15
// Store
lea addresses_A+0xd92a, %rdx
clflush (%rdx)
add %rdi, %rdi
movb $0x51, (%rdx)
nop
nop
add $20733, %rbp
// Faulty Load
lea addresses_A+0xd92a, %rsi
nop
nop
nop
and %rax, %rax
mov (%rsi), %bp
lea oracles, %rax
and $0xff, %rbp
shlq $12, %rbp
mov (%rax,%rbp,1), %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rbp
pop %rax
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': True, 'AVXalign': True, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'51': 21829}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
|
roots.asm | dannyvc95/asm-algorithms | 0 | 26146 | ; roots.asm
segment .text
global _roots
_roots:
enter 0,0
xor EAX,EAX
fld qword[EBP+8]
fadd ST0
fld qword[EBP+8]
fld qword[EBP+24]
fmulp ST1
fadd ST0
fadd st0
fchs
fld qword[EBP+16]
fld qword[EBP+16]
fmulp ST1
faddp ST1
ftst
fstsw AX
sahf
jb no_real_roots
fsqrt
fld qword[EBP+16]
fchs
fadd ST1
fdiv ST2
mov EAX,dword[EBP+32]
fstp qword[EAX]
fchs
fld qword[EBP+16]
fchs
faddp ST1
fdivrp ST1
mov EAX,dword[EBP+36]
fstp qword[EAX]
mov EAX,1
jmp short done
no_real_roots:
fchs
fsqrt
fld qword[EBP+16]
fchs
fadd ST1
fdiv ST2
mov EAX,dword[EBP+32]
fstp qword[EAX]
fchs
fld qword[EBP+16]
fchs
faddp ST1
fdivrp ST1
mov EAX,dword[EBP+36]
fstp qword[EAX]
sub EAX,EAX
done:
leave
ret
|
programs/oeis/052/A052612.asm | jmorken/loda | 1 | 86609 | ; A052612: E.g.f. x*(2+x)/(1-x^2).
; 0,2,2,12,24,240,720,10080,40320,725760,3628800,79833600,479001600,12454041600,87178291200,2615348736000,20922789888000,711374856192000,6402373705728000
mov $2,$0
mov $1,$0
cal $1,142
gcd $2,2
div $1,$2
mul $1,2
|
programs/oeis/091/A091056.asm | jmorken/loda | 1 | 102671 | ; A091056: Expansion of x^2/((1-x)*(1+2*x)*(1-6*x)).
; 0,0,1,5,33,193,1169,6993,42001,251921,1511697,9069841,54419729,326517009,1959104785,11754623249,70527750417,423166480657,2538998927633,15233993478417,91403961045265,548423765922065,3290542596231441
mov $4,$0
mov $5,$0
lpb $5
mov $0,$4
sub $5,1
sub $0,$5
mov $2,0
mov $3,0
mov $6,2
lpb $0
sub $0,1
mov $7,$3
mov $3,$2
mul $3,3
add $6,$7
mul $6,4
mov $2,$6
lpe
mov $7,$3
div $7,24
add $1,$7
lpe
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/rep_clause4.adb | best08618/asylo | 7 | 17164 | -- { dg-do run }
procedure Rep_Clause4 is
type U32 is mod 2 ** 32;
type Key is record
Value : U32;
Valid : Boolean;
end record;
type Key_Buffer is record
Current, Latch : Key;
end record;
type Block is record
Keys : Key_Buffer;
Stamp : U32;
end record;
for Block use record
Keys at 0 range 0 .. 103;
Stamp at 13 range 0 .. 31;
end record;
My_Block : Block;
My_Stamp : constant := 16#01234567#;
begin
My_Block.Stamp := My_Stamp;
My_Block.Keys.Latch := My_Block.Keys.Current;
if My_Block.Stamp /= My_Stamp then
raise Program_Error;
end if;
end;
|
Irvine/Examples/ch07/32 bit/Bmult.asm | alieonsido/ASM_TESTING | 0 | 8074 | <filename>Irvine/Examples/ch07/32 bit/Bmult.asm
; Binary Multiplication (BMult.asm)
; This program demonstrates binary multiplication using SHL.
; It multiplies intval by 36, using SHL instructions.
INCLUDE Irvine32.inc
.data
intval DWORD 123
.code
main PROC
mov eax,intval
mov ebx,eax
shl eax,5 ; multiply by 32
shl ebx,2 ; multiply by 4
add eax,ebx ; sum the products
call DumpRegs
exit
main ENDP
END main |
tests/natools-s_expressions-interpreter_tests.adb | faelys/natools | 0 | 10176 | <filename>tests/natools-s_expressions-interpreter_tests.adb
------------------------------------------------------------------------------
-- Copyright (c) 2014, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Caches;
with Natools.S_Expressions.Test_Tools;
package body Natools.S_Expressions.Interpreter_Tests is
function Test_Interpreter return Test_Interpreters.Interpreter;
function Invalid_Commands return Caches.Reference;
------------------------
-- Helper Subprograms --
------------------------
function Invalid_Commands return Caches.Reference is
Cache : Caches.Reference;
Short : constant Atom := To_Atom ("not-cmd");
Long : constant Atom := To_Atom ("not-a-command");
begin
Cache.Append_Atom (Short);
Cache.Open_List;
Cache.Append_Atom (Short);
Cache.Append_Atom (To_Atom ("arg"));
Cache.Close_List;
Cache.Append_Atom (Long);
Cache.Open_List;
Cache.Append_Atom (Long);
Cache.Open_List;
Cache.Close_List;
Cache.Close_List;
return Cache;
end Invalid_Commands;
function Test_Interpreter return Test_Interpreters.Interpreter is
Template : Recorder;
begin
return Inter : Test_Interpreters.Interpreter do
Inter.Add ("cmd", Template);
Inter.Add ("command", Template);
end return;
end Test_Interpreter;
----------------------
-- Recorder Command --
----------------------
overriding procedure Execute
(Self : in Recorder;
State : in out Printers.Printer'Class;
Context : in Boolean;
Name : in Atom)
is
pragma Unreferenced (Self);
begin
if Context then
State.Append_Atom (Name);
end if;
end Execute;
overriding procedure Execute
(Self : in Recorder;
State : in out Printers.Printer'Class;
Context : in Boolean;
Cmd : in out Lockable.Descriptor'Class)
is
pragma Unreferenced (Self);
begin
if not Context then
return;
end if;
declare
Buffer : aliased Test_Tools.Memory_Stream;
Serializer : Printers.Canonical (Buffer'Access);
begin
Printers.Transfer (Cmd, Serializer);
State.Open_List;
State.Append_Atom (Buffer.Get_Data);
State.Close_List;
end;
end Execute;
--------------------
-- Raiser Command --
--------------------
overriding procedure Execute
(Self : in Raiser;
State : in out Printers.Printer'Class;
Context : in Boolean;
Name : in Atom)
is
pragma Unreferenced (Self, State, Context, Name);
begin
raise Special_Exception;
end Execute;
overriding procedure Execute
(Self : in Raiser;
State : in out Printers.Printer'Class;
Context : in Boolean;
Cmd : in out Lockable.Descriptor'Class)
is
pragma Unreferenced (Self, State, Context, Cmd);
begin
raise Special_Exception;
end Execute;
-------------------------
-- Complete Test Suite --
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Test_Basic_Usage (Report);
Test_Unknown_Commands (Report);
Test_Premanent_Fallback (Report);
Test_Local_Fallback (Report);
Test_Exception_Fallback (Report);
Test_Inspection (Report);
end All_Tests;
----------------------
-- Individual Tests --
----------------------
procedure Test_Basic_Usage (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Basic usage");
begin
declare
Inter : constant Test_Interpreters.Interpreter := Test_Interpreter;
Buffer : aliased Test_Tools.Memory_Stream;
Printer : Printers.Canonical (Buffer'Access);
Input : Caches.Reference;
Cursor : Caches.Cursor;
begin
Input.Append_Atom (To_Atom ("cmd"));
Input.Open_List;
Input.Append_Atom (To_Atom ("cmd"));
Input.Append_Atom (To_Atom ("foo"));
Input.Append_Atom (To_Atom ("bar"));
Input.Close_List;
Input.Append_Atom (To_Atom ("command"));
Input.Open_List;
Input.Open_List;
Input.Append_Atom (To_Atom ("comment"));
Input.Close_List;
Input.Close_List;
Input.Open_List;
Input.Append_Atom (To_Atom ("command"));
Input.Open_List;
Input.Close_List;
Input.Close_List;
Cursor := Input.First;
Buffer.Set_Expected (To_Atom
("3:cmd(15:3:cmd3:foo3:bar)7:command(11:7:command())"));
Inter.Execute (Cursor, Printer, True);
Buffer.Check_Stream (Test);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Test_Basic_Usage;
procedure Test_Exception_Fallback (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Local fallback raising an exception");
begin
declare
Inter : constant Test_Interpreters.Interpreter := Test_Interpreter;
Buffer : aliased Test_Tools.Memory_Stream;
Printer : Printers.Canonical (Buffer'Access);
Input : Caches.Reference;
Cursor : Caches.Cursor;
Fallback : Raiser;
begin
Input.Append_Atom (To_Atom ("cmd"));
Input.Open_List;
Input.Append_Atom (To_Atom ("unknown"));
Input.Append_Atom (To_Atom ("argument"));
Input.Close_List;
Input.Close_List;
Input.Open_List;
Input.Append_Atom (To_Atom ("command"));
Input.Close_List;
Cursor := Input.First;
Buffer.Set_Expected (To_Atom ("3:cmd"));
begin
Inter.Execute (Fallback, Cursor, Printer, True);
Test.Fail ("No exception raised");
exception
when Special_Exception => null;
when Error : others =>
Test.Fail ("Wrong exception raised:");
Test.Report_Exception (Error, NT.Fail);
end;
Buffer.Check_Stream (Test);
Test_Tools.Next_And_Check (Test, Cursor, To_Atom ("argument"), 1);
Test_Tools.Next_And_Check (Test, Cursor, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Cursor, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Cursor, To_Atom ("command"), 1);
Test_Tools.Next_And_Check (Test, Cursor, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Cursor, Events.End_Of_Input, 0);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Test_Exception_Fallback;
procedure Test_Inspection (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Inspection");
begin
declare
Inter : Test_Interpreters.Interpreter;
begin
if not Inter.Is_Empty then
Test.Fail ("Default interpreter is not empty");
end if;
if Inter.Has_Command (To_Atom ("cmd")) then
Test.Fail ("Default interpreter has command ""cmd""");
end if;
Inter := Test_Interpreter;
if Inter.Is_Empty then
Test.Fail ("Test interpreter is empty");
end if;
if not Inter.Has_Command (To_Atom ("cmd")) then
Test.Fail ("Test interpreter has not command ""cmd""");
end if;
if Inter.Has_Command (To_Atom ("not-a-cmd")) then
Test.Fail ("Test interpreter has command ""not-a-cmd""");
end if;
end;
exception
when Error : others => Test.Report_Exception (Error);
end Test_Inspection;
procedure Test_Local_Fallback (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Local fallback");
begin
declare
Inter : constant Test_Interpreters.Interpreter := Test_Interpreter;
Buffer : aliased Test_Tools.Memory_Stream;
Printer : Printers.Canonical (Buffer'Access);
Input : Caches.Reference := Invalid_Commands;
Cursor : Caches.Cursor := Input.First;
Fallback : Recorder;
begin
Input.Append_Atom (To_Atom ("cmd"));
Buffer.Set_Expected (To_Atom
("7:not-cmd(14:7:not-cmd3:arg)13:not-a-command"
& "(18:13:not-a-command())3:cmd"));
Inter.Execute (Fallback, Cursor, Printer, True);
Buffer.Check_Stream (Test);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Test_Local_Fallback;
procedure Test_Premanent_Fallback (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Permanent fallback");
begin
declare
Inter : constant Test_Interpreters.Interpreter
:= Test_Interpreters.Build
((Test_Interpreters.Item ("cmd", Recorder'(null record)),
Test_Interpreters.Item ("command", Recorder'(null record))),
Fallback => "cmd");
Buffer : aliased Test_Tools.Memory_Stream;
Printer : Printers.Canonical (Buffer'Access);
Input : constant Caches.Reference := Invalid_Commands;
Cursor : Caches.Cursor := Input.First;
begin
Buffer.Set_Expected (To_Atom
("7:not-cmd(14:7:not-cmd3:arg)13:not-a-command"
& "(18:13:not-a-command())"));
Inter.Execute (Cursor, Printer, True);
Buffer.Check_Stream (Test);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Test_Premanent_Fallback;
procedure Test_Unknown_Commands (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Unknown commands");
begin
declare
Inter : Test_Interpreters.Interpreter := Test_Interpreter;
Buffer : aliased Test_Tools.Memory_Stream;
Printer : Printers.Canonical (Buffer'Access);
Input : constant Caches.Reference := Invalid_Commands;
Cursor : Caches.Cursor := Input.First;
begin
Inter.Set_Fallback (To_Atom ("cmd"));
Inter.Reset_Fallback;
begin
Inter.Execute (Cursor, Printer, True);
Test.Fail ("No exception raised after not-cmd");
exception
when Test_Interpreters.Command_Not_Found => null;
when Error : others =>
Test.Fail ("Unexpected exception raised after not-cmd");
Test.Report_Exception (Error, NT.Fail);
end;
Test_Tools.Next_And_Check (Test, Cursor, Events.Open_List, 1);
begin
Inter.Execute (Cursor, Printer, True);
Test.Fail ("No exception raised after (not-cmd)");
exception
when Test_Interpreters.Command_Not_Found => null;
when Error : others =>
Test.Fail ("Unexpected exception raised after (not-cmd)");
Test.Report_Exception (Error, NT.Fail);
end;
Test_Tools.Next_And_Check (Test, Cursor, To_Atom ("arg"), 1);
Test_Tools.Next_And_Check (Test, Cursor, Events.Close_List, 0);
Test_Tools.Next_And_Check
(Test, Cursor, To_Atom ("not-a-command"), 0);
begin
Inter.Execute (Cursor, Printer, True);
Test.Fail ("No exception raised after not-a-command");
exception
when Test_Interpreters.Command_Not_Found => null;
when Error : others =>
Test.Fail ("Unexpected exception raised after not-a-command");
Test.Report_Exception (Error, NT.Fail);
end;
Test_Tools.Next_And_Check (Test, Cursor, Events.Open_List, 1);
begin
Inter.Execute (Cursor, Printer, True);
Test.Fail ("No exception raised after not-a-command");
exception
when Test_Interpreters.Command_Not_Found => null;
when Error : others =>
Test.Fail ("Unexpected exception raised after not-a-command");
Test.Report_Exception (Error, NT.Fail);
end;
Test_Tools.Next_And_Check (Test, Cursor, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Cursor, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Cursor, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Cursor, Events.End_Of_Input, 0);
Buffer.Check_Stream (Test);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Test_Unknown_Commands;
end Natools.S_Expressions.Interpreter_Tests;
|
src/my_soft/spectrum/sped/sped54en/sped54en.asm | chipsi007/zesarux | 0 | 4873 | ; SPED - SPectrum Ensamblador Desensamblador / SuPer Ensamblador Desensamblador
; Copyright (C) 1995 <NAME>
;
; This file is part of ZEsarUX.
;
; SPED is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
ORG 49152
OUTPUT sped.bin
;
;SPED54 , , ~,
; (C) <NAME>
;VERSION 1.3 EN
; V 1.0 (01/04/1995) - Preliminary version - <NAME>
; V 1.1/SPED52 (11/07/1997) - Full working version - <NAME>
; V 1.1 EN/SPED52 (17/08/2018) - English version - TIM GILBERTS
; V 1.2 SPED53 (04/09/2018) - Bug fixed version - <NAME>
; V 1.2 EN/SPED53 (10/09/2018) - Bug fixed version - <NAME>
; V 1.3 EN/SPED54 (13/09/2018) - Bug fixed version - <NAME>
;
;
;License: GNU GPL
;
FLAGS1 EQU 23582
FLAGS2 EQU 23583
OP11 EQU 23584
OP12 EQU 23585
OP13 EQU 23586
OP21 EQU 23587
OP22 EQU 23588
OP23 EQU 23589
AMAOP1 EQU 23590
AMAOP2 EQU 23591
FLAGS3 EQU 23592
FLAGS4 EQU 23593
CALL COPPAG
LD SP,23552
JP INICIO
BUFORI EQU 65333
BUFDEB EQU 65130
ABUF DEFS 34
CABOBJ DEFS 34
BUFEDI DEFS 32
CX DEFB 0
CY DEFB 0
TEXINI DEFW 23755
FINTEX DEFW 23755
PUNETI DEFW 0
FINNDX DEFW 0
DIRDBI DEFW 49152
LINEA DEFW 1
LINP DEFW 0
LINU DEFW 0
DIRBLO DEFW 0
LONGBL DEFW 0
PUNDIR DEFW 16384
PUNORG DEFW 49152
DIRUP DEFW 0
DIREDI DEFW 0
DIRENT DEFW 50000
PUNDES DEFW 49152
ERROR DEFB 0
AOPE DEFB 0
APASO DEFB 0
AERRS DEFW 0
ETINUM DEFW 0
BYTES DEFW 0
ALINEA DEFW 0
ADIREC DEFW 0
ASIGDI DEFW 0
ANEMO DEFW 0
ADIOP1 DEFW 0
ADIOP2 DEFW 0
AVAL1 DEFW 0
AVAL2 DEFW 0
ADIS DEFB 0
ADES DEFB 0
APREXY DEFB 0
DPREF DEFB 0
DDIRIN DEFW 0
DRETOR DEFW 0
DREGR DEFB 0
DBYBRK DEFS 3
DLONG DEFB 0
DMEMO DEFW 0
CABFUE DEFB 3
DEFM "NOT-NAMED."
LONG0 DEFW 0
DEFS 5
DIA DEFB 0
MES DEFB 0
ANYO DEFB 0
LONG1 DEFW 0
LONG2 DEFW 0
RESERV DEFB 255,255,255,255
DEFB 255,255,255,255,255
PUNTEX DEFW LONG0
LINCUR DEFW 0
ULTLIN DEFW 0
TEMP01 DEFW 0
TEMP02 DEFW 0
TEMP03 DEFW 0
OLDFL2 DEFB 0
DTIPIN DEFB 0
DNXTPC DEFW 0
BUFETI DEFS 32
LNETIN DEFW 0
BUFCAD DEFS 32
LNCAIN DEFW 0
EJEINI
INICI0 CALL COPPAG
LD SP,23552
CALL PONREG
CALL SLDIR
CALL NOBUF
CALL PONPRI
LD A,(OLDFL2)
AND %00001100
LD (FLAGS2),A
XOR A
CALL PONTEX
JP MENU
COPPAG LD HL,RUTPAG
LD DE,23296
LD BC,256
LDIR
RET
PONREG LD HL,49152
LD DE,23755
LD BC,32768-23755
LD A,16
EX AF,AF'
LD A,19
RET
PONPRI LD HL,PRINT
LD (23739),HL
CALL CLS
LD (IY-28),4
LD (IY-48),1
SET 3,(IY+48)
RES 1,(IY-17)
LD HL,DERR8
LD (23613),HL
LD HL,64000
LD (23651),HL
LD (23653),HL
RES 4,(IY-17)
JP PONBOR
NOBUF LD (IY-27),32
RET
INICIO CALL PONPRI
CALL NOBUF
CALL APUN
CALL PRIMES
DEFM "Welcome to @"
CALL PRSPED
CALL PRIMES
DEFM ",#"
DEFM "Assembler/Monitor"
DEFM "/Disassembler#"
DEFM "for Spectrum 128K"
DEFM " / ZX Next.#@"
CALL PRCPYR
LD A,13
RST 16
CALL INFECH
JP MENU
FIN LD A,(FLAGS2)
LD (OLDFL2),A
CALL PRIMES
DEFM "Return Address:@"
LD HL,INICI0
CALL PRNUME
LD HL,32767
LD (23730),HL
CALL PONREG
LD (PUNETI),HL
LD (FINNDX),HL
EX AF,AF'
EX DE,HL
CALL SLDIR
JP 4535
PRIMES POP HL
PRIME1 LD A,(HL)
INC HL
CP "#"
JR Z,PRIME3
CP "@"
JR Z,PRIME4
PRIME2 PUSH HL
RST 16
POP HL
JR PRIME1
PRIME3 LD A,13
JR PRIME2
PRIME4 JP (HL)
CLS LD A,2
CALL 5633
LD HL,16384
LD DE,16385
LD BC,6143
LD (HL),0
LDIR
INC HL
INC DE
LD BC,767
LD A,4
LD (HL),A
LD (23693),A
LD (23624),A
LDIR
LD (23682),BC
RET
PRINT RES 5,(IY-17)
BIT 0,(IY-28)
JR Z,PRINT1
CP 24
JR C,PRINT0
LD A,23
PRINT0 LD (23683),A
RES 0,(IY-28)
SET 1,(IY-28)
RET
PRINT1 BIT 1,(IY-28)
JR Z,PRINT2
LD (23682),A
RES 1,(IY-28)
RET
PRINT2 CP 8
JR NZ,PRINT3
DEC (IY+72)
RET P
LD (IY+72),31
DEC (IY+73)
RET P
LD (IY+73),0
RET
PRINT3 CP 13
JR NZ,PRINT4
CMPL23 LD (IY+72),0
LD A,(23683)
CP 23
JP Z,SCROLL
INC (IY+73)
RET
PRINT4 CP 22
JR NZ,PRINT5
SET 0,(IY-28)
RET
PRINT5 CP 23
JR NZ,PRINT6
SET 1,(IY-28)
RET
PRINT6 LD L,A
LD H,0
ADD HL,HL
ADD HL,HL
ADD HL,HL
LD DE,15360
ADD HL,DE
LD A,(23683)
LD D,A
RRCA
RRCA
RRCA
AND 224
OR (IY+72)
LD E,A
LD A,D
AND 24
OR 64
LD D,A
LD B,8
PRINT7 LD A,(HL)
SLA A
OR (HL)
LD (DE),A
INC D
INC HL
DJNZ PRINT7
LD A,(23682)
INC A
LD (23682),A
CP 32
RET NZ
JR CMPL23
SCROLL CALL SITEMY
JR NZ,SCROL1
CALL ESPTEC
CP 199
JR NZ,SCROL1
SET 5,(IY-17)
SCROL1 JP 3582
SITEMY LD A,254
IN A,(254)
AND 1
RET
EDIVA0 LD A,13
RST 16
EDIVAC CALL LIMBUF
EDITAR XOR A
LD (CX),A
LD A,(23683)
LD (CY),A
EDITA1 LD (IY+7),0
EDIT11 CALL PONCUR
CALL PRIEST
EDITA2 LD (IY-50),0
EDIT22 LD A,(23560)
EDIT23 OR A
JR Z,EDIT22
CP 13
JP Z,ED13
CP 8
JR Z,ED8
CP 9
JR Z,ED9
CP 10
JP Z,EDITA3
CP 11
JP Z,EDITA3
CP 6
JR Z,ED6
CP 14
JR Z,ED14
CP 7
JP Z,ED7
CP 175
JR Z,ED175
CP 12
JP Z,ED12
CP 32
JR C,EDITA2
CP 128
JP NC,EDITA3
EX AF,AF'
LD A,(CX)
CP 31
JR Z,EDITA2
EX AF,AF'
CALL BORCUR
LD HL,(CX)
INC L
LD (CX),HL
DEC L
LD (23682),HL
LD H,0
LD DE,BUFEDI
ADD HL,DE
PUSH AF
PUSH HL
RST 16
POP HL
POP AF
BIT 2,(IY-28)
JP NZ,EDITA4
LD (HL),A
JR EDITA1
ED8 LD A,(CX)
OR A
JR Z,EDITA2
CALL BORCUR
DEC A
LD (CX),A
JP EDITA1
ED9 LD A,(CX)
CP 31
JP Z,EDITA2
CALL BORCUR
INC A
LD (CX),A
JP EDITA1
ED6 LD A,(23658)
XOR 8
LD (23658),A
JP EDITA1
ED14 LD A,(23617)
XOR 1
LD (23617),A
CALL PRIEST
JP EDIT11
ED175 LD A,(FLAGS1)
XOR 4
LD (FLAGS1),A
JP EDITA1
ED13 CALL BORCUR
LD HL,(CX)
LD (23682),HL
LD A,13
RST 16
LD HL,BUFEDI
OR A
RET
ED12 LD A,(CX)
OR A
JP Z,EDITA2
CALL BORCUR
LD L,A
DEC A
LD (CX),A
LD H,0
LD DE,BUFEDI
ADD HL,DE
LD D,H
LD E,L
DEC DE
PUSH HL
LD HL,BUFEDI+30
OR A
SBC HL,DE
LD B,H
LD C,L
POP HL
LD A,B
OR C
JR Z,ED120
LDIR
ED120 LD A,32
LD (DE),A
JR EDIT44
EDITA3 RES 0,(IY+7)
BIT 3,(IY-28)
JP Z,EDITA2
CALL BORCUR
PUSH AF
CALL PRIEST
POP AF
SCF
RET
EDITA4 EX AF,AF'
LD A,(CX)
CP 31
JR NZ,EDIT40
EX AF,AF'
LD (HL),A
JP EDITA1
EDIT40 EX AF,AF'
EX DE,HL
LD HL,BUFEDI+31
OR A
SBC HL,DE
LD B,H
LD C,L
LD HL,BUFEDI+30
LD DE,BUFEDI+31
LDDR
LD (DE),A
LD A,13
LD (BUFEDI+31),A
EDIT44 CALL PRILIN
EDIT43 JP EDITA1
ED7 BIT 3,(IY-28)
JP Z,EDITA2
CALL BORCUR
LD A,(CX)
CP 7
JR NC,ED70
LD A,7
JR ED79
ED70 LD A,12
ED79 LD (CX),A
JR EDIT43
PRILIN LD HL,(CX)
LD L,0
LD (23682),HL
LD HL,BUFEDI
LD B,31
PRILI1 LD A,(HL)
PUSH BC
PUSH HL
RST 16
POP HL
POP BC
INC HL
DJNZ PRILI1
RET
BORCUR PUSH AF
LD C,4
CALL PRICUR
POP AF
RET
PONCUR LD C,132
PRICUR LD HL,(CY)
LD H,0
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
LD A,H
OR 88
LD H,A
LD A,(CX)
OR L
LD L,A
LD (HL),C
RET
PRIEST BIT 3,(IY-28)
RET Z
LD HL,5898
LD (23682),HL
BIT 3,(IY+48)
JR Z,PRIES1
CALL PRIMES
DEFM "CAP @"
JR PRIES2
PRIES1 CALL PRIMES
DEFM "low @"
PRIES2 BIT 2,(IY-28)
JR Z,PRIES3
CALL PRIMES
DEFM "INS @"
JR PRIES4
PRIES3 CALL PRIMES
DEFM "OVR @"
PRIES4 BIT 0,(IY+7)
JR Z,PRIES5
CALL PRIMES
DEFM "EXT@"
RET
PRIES5 CALL PRIMES
DEFM " @"
RET
VAL0 RET Z
CP ")"
RET Z
CP ","
RET Z
CP 255
RET
VAL RES 4,(IY-28)
LD BC,0
LD A,(HL)
CP 32
CALL VAL0
JR Z,VALNO
CP 13
JR Z,VALNO
VAL1 LD A,(HL)
CP 13
CALL VAL0
JR Z,VALSI
CP 32
JR Z,VALSI
JR C,VALNO
CP 128
JR NC,VALNO
CP "+"
JR NZ,VAL2
INC HL
VAL2 CP "-"
JR Z,VALRES
CALL VALNUM
JR C,VALNO
PUSH HL
LD H,B
LD L,C
ADD HL,DE
VAL3 LD B,H
LD C,L
POP HL
LD A,(HL)
CP "+"
JR Z,VAL1
CP "-"
JR Z,VAL1
CP 13
CALL VAL0
JR Z,VALSI
CP 32
JR NZ,VALNO
VALSI LD D,B
LD E,C
OR A
RET
VALNO LD D,B
LD E,C
SCF
RET
VALRES INC HL
CALL VALNUM
JR C,VALNO
PUSH HL
LD H,B
LD L,C
OR A
SBC HL,DE
JR VAL3
VALNUM PUSH BC
LD A,(HL)
CP "$"
JR NZ,VALN10
LD DE,(PUNDIR)
JR VALFI0
VALN10 CP "!"
JR NZ,VALNU1
LD DE,(PUNDES)
JR VALFI0
VALNU1 CP "#"
JR Z,VALHEX
CP "%"
JR Z,VALBIN
CP 34
JR NZ,VALNU2
INC HL
LD E,(HL)
INC HL
LD A,(HL)
CP 34
JR NZ,VALFIE
LD D,0
JR VALFI0
VALNU2 CP 48
JR C,VALFIE
CP 58
JR C,VALDEC
CALL ESETIQ
JR NC,VALETI
JR VALFIE
VALFI0 INC HL
VALFIN POP BC
OR A
RET
VALFIE POP BC
SCF
RET
VALBIN LD DE,0
VALBI1 INC HL
LD A,(HL)
SUB 48
JR C,VALFIN
CP 2
JR NC,VALFIN
PUSH HL
LD H,D
LD L,E
ADD HL,HL
LD E,A
LD D,0
ADD HL,DE
EX DE,HL
POP HL
JR VALBI1
VALDEC LD DE,0
DEC HL
VALDE1 INC HL
LD A,(HL)
SUB 48
JR C,VALFIN
CP 10
JR NC,VALFIN
PUSH HL
LD H,D
LD L,E
ADD HL,HL
LD D,H
LD E,L
ADD HL,HL
ADD HL,HL
ADD HL,DE
LD E,A
LD D,0
ADD HL,DE
EX DE,HL
POP HL
JR VALDE1
VALHEX LD DE,0
VALHE1 INC HL
LD A,(HL)
SUB 48
JR C,VALFIN
CP 23
JR NC,VALFIN
CP 10
JR C,VALHE2
SUB 17
JR C,VALFIN
ADD A,10
VALHE2 PUSH HL
LD H,D
LD L,E
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
LD E,A
LD D,0
ADD HL,DE
EX DE,HL
POP HL
JR VALHE1
VALETI CALL CALETI
JP NC,VALFIN
SET 4,(IY-28)
JP VALFIE
INFECH CALL PRIMES
DEFM "Enter Date"
DEFM "(DD/MM/YYYY):@"
CALL EDIVA0
CALL VAL
LD A,E
LD (DIA),A
INC HL
CALL VAL
LD A,E
LD (MES),A
INC HL
CALL VAL
LD H,D
LD L,E
LD DE,1980
OR A
SBC HL,DE
LD A,L
LD (ANYO),A
RET
MENU LD SP,23552
RES 3,(IY-28)
CALL PRIMES
DEFM "#Command>#@"
CALL EDIVAC
LD A,(BUFEDI+1)
CP ","
JR Z,MENU1
CP 32
JR Z,MENU1
MENERR CALL MENER0
JR MENU
MENER0 CALL PRIMES
DEFM "Invalid Command!"
DEFM "#@"
RET
MENU1 LD A,13
RST 16
LD DE,BUFEDI
LD A,(DE)
LD HL,BUFEDI+2
LD BC,28
LDIR
LD C,A
LD HL,TAMENU
MENU2 LD A,(HL)
INC HL
CP 255
JR Z,MENERR
CP C
JR Z,MENU3
INC HL
INC HL
JR MENU2
MENU3 LD E,(HL)
INC HL
LD H,(HL)
LD L,E
CALL MEJPHL
JR MENU
MEJPHL JP (HL)
TAMENU DEFM "A"
DEFW AINICI
DEFM "B"
DEFW FIN
DEFM "C"
DEFW CALCUL
DEFM "D"
DEFW DINICI
DEFM "E"
DEFW EDICIO
DEFM "F"
DEFW INFECH
DEFM "G"
DEFW GOTEXT
DEFM "H"
DEFW HLPMNU
DEFM "I"
DEFW INFORM
DEFM "L"
DEFW LOAFUE
DEFM "N"
DEFW NUETEX
DEFM "O"
DEFW SALOBJ
DEFM "S"
DEFW SALFUE
DEFM "T"
DEFW VERTAB
DEFM "Z"
DEFW ZAP
DEFB 255
HLPMNU XOR A
JP HELP
PRSPED CALL PRIMES
DEFM "SPED 1.3 EN@"
RET
PRCPYR CALL PRIMES
DEFM "# , "
DEFM " , ~,#"
DEFB 127
DEFM " CESAR"
DEFM " HERNANDEZ BANO#"
DEFM "(04/1995,07/1997,"
DEFM "09/2018)"
DEFM "#English version"
DEFM " by <NAME>s@"
RET
PRNUME PUSH HL
LD A,32
RST 16
POP HL
JR PRNUM
PRNUAE PUSH AF
LD A,32
RST 16
POP AF
PRNUMA LD L,A
LD H,0
PRNUM LD E,200
CALL PRNU1
RET
PRNU1 PUSH DE
PUSH HL
LD BC,55536
CALL 6442
JP 6704
PRNUM0 LD E,32
CALL PRNU1
RET
PRNU16 BIT 4,(IY-18)
JR NZ,PRHE16
LD E,48
CALL PRNU1
RET
PNUM16 BIT 4,(IY-18)
JR NZ,PRHE16
JR PRNUM
PNUM8 BIT 4,(IY-18)
JR Z,PRNUMA
PRHE8S PUSH AF
LD A,"#"
RST 16
POP AF
JR PRHEX8
PRHE16 PUSH HL
LD A,"#"
RST 16
POP HL
PUSH HL
LD A,H
CALL PRHEX8
POP HL
LD A,L
PRHEX8 PUSH AF
AND %11110000
RRCA
RRCA
RRCA
RRCA
CALL PRHE81
POP AF
AND %1111
PRHE81 ADD A,48
CP 58
JR C,PRHE82
ADD A,7
PRHE82 RST 16
RET
CALCUL LD HL,BUFEDI
CALL VAL
EX DE,HL
CALCU1 JP NC,PRNUM
BIT 4,(IY-28)
JR NZ,CALCU2
CALL PRIMES
DEFM "Syntax "
DEFM "Error!#@"
RET
CALCU2 LD A,3
JP APRERR
VERTAB LD HL,(PUNETI)
LD DE,49152
OR A
SBC HL,DE
RET Z
EX DE,HL
VERTA1 PUSH HL
VERTA2 CALL ELDAHL
INC HL
CP 255
JR Z,VERTA3
PUSH HL
RST 16
POP HL
JR VERTA2
VERTA3 LD A,32
RST 16
POP HL
PUSH HL
LD BC,7
ADD HL,BC
CALL ELDAHL
LD E,A
INC HL
CALL ELDAHL
LD D,A
INC HL
CALL ELDAHL
LD C,A
INC HL
CALL ELDAHL
LD B,A
PUSH BC
EX DE,HL
CALL PRNUM
LD A,13
RST 16
POP BC
POP HL
OR A
SBC HL,BC
RET Z
BIT 5,(IY-17)
RET NZ
LD H,B
LD L,C
JR VERTA1
NUMTEX LD A,(IY-27)
AND %00001100
RRCA
RRCA
RET
GOTEXT LD HL,BUFEDI
CALL VAL
CALL PONLI1
LD A,D
OR A
JR NZ,PRERRB
CALL NUMTEX
CP E
JR C,PRERRB
LD A,E
CALL PONTEX
JP PRBLAC
PRERRB CALL PRIMES
DEFM "Text block"
DEFM " invalid!#@"
RET
NUETEX CALL NUMTEX
CP 2
JR NZ,NUETE2
CALL PRIMES
DEFM "No more"
DEFM " blocks!#@"
RET
NUETE2 INC A
RLCA
RLCA
LD B,A
LD A,(IY-27)
AND %11110011
OR B
LD (IY-27),A
RET
SALOBJ LD HL,BUFEDI
LD DE,CABOBJ
PUSH DE
LD A,3
LD (DE),A
INC DE
LD BC,10
LDIR
CALL CALLON
EX DE,HL
LD (HL),E
INC HL
LD (HL),D
INC HL
LD (HL),C
INC HL
LD (HL),B
POP IX
PUSH DE
XOR A
LD DE,17
SCF
CALL SAVRA1
CALL PAUSGR
LD A,20
LD (NUMPAG+1),A
POP DE
LD IX,(PUNORG)
LD A,255
SCF
CALL SAVE
EI
CALL ACTPAG
JP PONBOR
SAVRA1 CALL 1222
EI
PONBOR PUSH AF
XOR A
OUT (254),A
POP AF
RET
PAUSGR LD B,20
PAUSG1 HALT
DJNZ PAUSG1
RET
CALLON LD HL,(PUNDES)
LD BC,(PUNORG)
OR A
SBC HL,BC
RET
ZAP CALL PRIMES
DEFM "Sure?@"
CALL EDIVA0
LD A,(BUFEDI)
CP "Y"
RET NZ
CALL PONLI1
ZAP2 LD A,(FLAGS2)
AND %11110000
LD (FLAGS2),A
JP ZRTEX
PRESAV CALL SITEMY
JR NZ,PRESAF
PUSH IX
PUSH DE
CALL PRIMES
DEFM "Pause mode. DELET"
DEFM "E to ignore#"
DEFM "block#@"
POP DE
POP IX
CALL ESPTEC
CP 12
JR NZ,PRESAF
CALL PRIMES
DEFM "Block ignored.#@"
RET
PRESAF LD A,255
JP SAVE
SALFUE CALL ZRTEX0
LD HL,BUFEDI
LD DE,CABFUE
PUSH DE
INC DE
LD BC,10
LDIR
POP HL
PUSH HL
XOR A
LD B,17
SALFU1 XOR (HL)
INC HL
DJNZ SALFU1
LD (HL),A
POP IX
LD DE,34
XOR A
CALL SAVRA1
CALL PAUSGR
LD IX,23755
LD DE,(LONG0)
CALL PRESAV
EI
LD HL,LONG1
LD A,22
PUSH AF
PUSH HL
SALFU2 CALL PAUSGR
POP HL
LD DE,RESERV
LD A,D
CP H
JR NZ,SALFU3
LD A,E
CP L
JR Z,SALFU0
SALFU3 LD A,(HL)
INC HL
OR (HL)
DEC HL
JR Z,SALFU0
POP AF
LD (NUMPAG+1),A
INC A
PUSH AF
LD E,(HL)
INC HL
LD D,(HL)
INC HL
PUSH HL
LD IX,49152
CALL PRESAV
EI
JR SALFU2
SALFU0 CALL ZRTEX0
CALL PONBOR
JP MENU
PRBLAC CALL PRIMES
DEFM "#Text block in "
DEFM "use:@"
CALL BACT
CALL PRNUAE
LD A,13
RST 16
RET
INFORM CALL PRSPED
CALL PRIMES
DEFM "#Todays Date: @"
LD HL,CABFUE+18
CALL PRFECH
LD A,13
RST 16
LD HL,CABFUE+1
CALL PRNOMB
CALL PRBLAC
CALL PRIMES
DEFM "Total blocks"
DEFM " in use:@"
CALL BTXTUS
INC A
CALL PRNUAE
CALL PRLBL
LD A,"0"
RST 16
LD DE,(LONG0)
LD HL,41781
CALL PRRES
CALL BTXTUS
OR A
JR Z,INFOR2
LD B,A
LD C,"1"
LD HL,LONG1
INFOR1 PUSH HL
PUSH BC
CALL PRLBL
POP BC
LD A,C
INC C
PUSH BC
RST 16
POP BC
POP HL
LD E,(HL)
INC HL
LD D,(HL)
INC HL
PUSH HL
PUSH BC
LD HL,16384
CALL PRRES
POP BC
POP HL
DJNZ INFOR1
INFOR2 LD A,13
RST 16
LD A,13
RST 16
INFOR3 CALL PRTAB
CALL PRDEB
LD A,13
RST 16
CALL PRCOD
CALL PRINEN
LD A,13
RST 16
RET
BOPRED LD HL,0
LD (23682),HL
LD B,64
BOPRE1 PUSH BC
LD A,32
RST 16
POP BC
DJNZ BOPRE1
LD (IY+73),0
RET
PRINEN CALL PRIMES
DEFM "Start:@"
LD HL,(PUNORG)
CALL PRNUME
CALL PRIMES
DEFM ", Execute:@"
LD HL,(DIRENT)
JR PRCOD3
PRCOD CALL PRIMES
DEFM "Object Code:@"
CALL CALLON
PRCOD1 CALL PRNUBY
PRCOD2 LD A,13
RST 16
RET
PRCOD3 CALL PRNUME
JR PRCOD2
PRTAB CALL PRIMES
DEFM "Symbol"
DEFM " table:@"
LD BC,49152
LD HL,(FINNDX)
OR A
SBC HL,BC
JR PRCOD1
PRDEB CALL BTXTUS
CP 2
RET Z
CALL PRIMES
DEFM "Debug"
DEFM " Table:@"
LD HL,(DIRDBI)
LD DE,49152
OR A
SBC HL,DE
JR PRCOD1
PRFECH PUSH HL
LD L,(HL)
LD H,0
CALL PRNUM
LD A,"/"
RST 16
POP HL
INC HL
PUSH HL
LD L,(HL)
LD H,0
CALL PRNUM
LD A,"/"
RST 16
POP HL
INC HL
LD L,(HL)
LD H,0
LD DE,1980
ADD HL,DE
CALL PRNUM
JR PRCOD2
PRNUBY CALL PRNUME
CALL PRIMES
DEFM " bytes@"
RET
BACT LD A,(FLAGS2)
AND 3
RET
PRRES PUSH DE
PUSH HL
LD A,":"
RST 16
POP HL
CALL PRNUME
LD A,"-"
RST 16
POP HL
JP PRNUM
PRLBL CALL PRIMES
DEFM "#Free in"
DEFM " block @"
RET
BTXTUS LD A,(FLAGS2)
RRCA
RRCA
AND 3
RET
PRNOMB PUSH HL
CALL PRIMES
DEFM "Source code"
DEFM " name: @"
POP HL
PRNOM0 LD B,10
PRNOM1 LD A,(HL)
INC HL
PUSH BC
PUSH HL
RST 16
POP HL
POP BC
DJNZ PRNOM1
RET
ZRTXTS LD HL,0
LD (LONG0),HL
LD (LONG1),HL
LD (LONG2),HL
ZRDBI LD HL,49152
LD (DIRDBI),HL
RET
LOAFUE LD A,(FLAGS2)
AND %11111100
LD (FLAGS2),A
CALL ZRTXTS
LD IX,CABOBJ
LD DE,34
CALL LOAD
LD HL,CABOBJ+1
CALL PRNOMB
CALL PRIMES
DEFM "#Last "
DEFM "build date:@"
LD HL,CABOBJ+18
CALL PRFECH
LD IX,23755
LD DE,(CABOBJ+11)
CALL LOAD2
LD HL,CABOBJ+21
LD BC,512
LOAFU1 LD E,(HL)
INC HL
LD D,(HL)
INC HL
LD A,D
OR E
JR Z,LOAFIN
INC C
LD A,(FLAGS2)
AND %11111100
OR C
LD (FLAGS2),A
CALL ACTPAG
PUSH HL
PUSH BC
LD IX,49152
CALL LOAD2
POP BC
POP HL
DJNZ LOAFU1
LOAFIN LD A,(FLAGS2)
AND %11110000
RLC C
RLC C
OR C
LD (FLAGS2),A
LD HL,CABOBJ+1
LD DE,CABFUE+1
LD BC,12
LDIR
LD HL,CABOBJ+21
LD DE,LONG1
LD BC,13
LDIR
CALL PONBOR
XOR A
JP PONTEX
LOAD2 LD A,255
SCF
CALL LOAD0
EI
JR NC,LOAERR
RET
LOAD XOR A
SCF
INC D
EX AF,AF'
DEC D
DI
CALL 1378
EI
RET C
LOAERR CALL PRIMES
DEFM "#Load ERROR! "
DEFM "(Rewind Tape?)@"
CALL PONBOR
CALL ZAP2
JP MENU
ACTPAG CALL PAGTEX
LD (NUMPAG+1),A
RET
PAGTEX LD A,(FLAGS2)
AND 3
JR NZ,PAGTE1
LD A,16
RET
PAGTE1 ADD A,21
RET
SLDIR LD (NUMPAG+1),A
PUSH AF
CALL ILDAHL
LD LX,A
POP AF
EX AF,AF'
LD (NUMPAG+1),A
EX AF,AF'
PUSH AF
LD A,LX
EX DE,HL
CALL ILDHLA
POP AF
EX DE,HL
INC HL
INC DE
DEC BC
PUSH AF
LD A,B
OR C
JR Z,SLDIR0
POP AF
JR SLDIR
SLDIR0 POP AF
JP ACTPAG
PRNUL0 LD HL,262
LD (23682),HL
PRNULI LD HL,(LINCUR)
JP PRNUM0
PRMEMO LD HL,283
LD (23682),HL
LD HL,0
LD DE,(FINTEX)
OR A
SBC HL,DE
JP PRNUM0
PRNUTE LD HL,31
LD (23682),HL
CALL BACT
JP PRNUMA
CADILI EX DE,HL
LD BC,1
LD HL,(TEXINI)
LD IX,(FINTEX)
CALL CADIL5
RET C
JP CDIL0
CADIL4 LD IX,(FINTEX)
CADIL5 LD A,HX
CP H
JR NZ,CADIL6
LD A,LX
CP L
JR NZ,CADIL6
SCF
RET
CADIL6 OR A
RET
PRLIN RES 4,(IY-27)
LD BC,(DIREDI)
LD A,B
OR C
JR Z,PRLI00
LD H,B
LD L,C
JR PRLIN0
PRLI00 CALL CADILI
JR NC,PRLIN0
SET 4,(IY-27)
RET
PRLIN0 LD C,0
PRLIN1 CALL ILDAHL
INC HL
CP 13
JR Z,PRLIFI
BIT 7,A
JR NZ,PRLIN2
PRLI11 INC C
PUSH BC
PUSH HL
CALL PRCAR
POP HL
POP BC
LD A,C
CP 32
JR NZ,PRLIN1
PUSH HL
LD HL,(TEMP01)
DEC HL
LD (TEMP01),HL
DEC C
POP HL
JR PRLIN1
PRLIN2 PUSH AF
LD A,C
CP 7
JR NC,PRLIN3
LD B,7
JR PRLIN4
PRLIN3 CP 12
JR NC,PRLI33
LD B,12
PRLIN4 LD A,C
CP B
JR Z,PRLIN5
INC C
PUSH BC
PUSH HL
LD A,32
CALL PRCAR
POP HL
POP BC
JR PRLIN4
PRLI33 LD B,C
INC B
JR PRLIN4
PRLIN5 POP AF
RES 7,A
JR PRLI11
PRLIFI LD A,C
CP 32
JR Z,PRLIF0
INC C
PUSH BC
PUSH HL
LD A,32
CALL PRCAR
POP HL
POP BC
JR PRLIFI
PRLIF0 BIT 5,(IY-28)
RET Z
LD HL,(TEMP01)
DEC HL
LD (TEMP01),HL
LD A,13
JP PRCAR
PRCAR JP 16
PONLIB PUSH AF
LD HL,BUFEDI
LD (TEMP01),HL
LD HL,PONCAR
LD (PRCAR+1),HL
LD HL,(LINCUR)
SET 5,(IY-28)
CALL PRLIN
RES 5,(IY-28)
LD HL,16
LD (PRCAR+1),HL
CALL PONCUR
CALL PRIEST
POP AF
JP EDIT23
PONCAR LD HL,(TEMP01)
LD (HL),A
INC HL
LD (TEMP01),HL
RET
PRPAG LD HL,512
LD (23682),HL
LD HL,(DIRUP)
LD A,H
OR L
JR NZ,PRP_00
LD HL,(LINEA)
CALL CADILI
LD (DIRUP),HL
JR C,PRPAG0
PRP_00 CALL PRLIN0
LD BC,(LINEA)
PRPAG2 LD A,(23683)
CP 23
JR Z,PRPAG9
LD DE,(FINTEX)
CALL CODEHL
JR Z,PRPAG0
PRPAG3 PUSH BC
CALL PRLIN0
POP BC
INC BC
JR PRPAG2
PRPAG9 LD DE,(FINTEX)
CALL CODEHL
JR Z,PRPAG0
PRPAG8 LD BC,65535
PRPAG0 LD (ULTLIN),BC
PRPA00 LD A,(23683)
CP 23
RET Z
LD B,32
PRPA01 PUSH BC
LD A,32
RST 16
POP BC
DJNZ PRPA01
JR PRPA00
PREDIC LD A,32
CALL PONCOL
LD HL,23264
LD DE,23265
LD BC,31
LD (HL),32
LDIR
LD HL,0
LD (23682),HL
CALL PRIMES
DEFM "Current text:"
DEFM " @"
LD HL,CABFUE+1
CALL PRNOM0
PREDI2 CALL PRIMES
DEFM "#Line: "
DEFM " Free Memory:@"
JP PRIEST
BORLIN CALL CADILI
RET C
BORLI0 PUSH HL
CALL DIFIL0
POP DE
RET C
SBC HL,DE
LD B,H
LD C,L
EX DE,HL
JP BORMEM
INSLIN CALL CADILI
INSLI0 LD BC,0
PUSH HL
LD HL,BUFEDI
INSL00 LD A,(HL)
INC HL
INC BC
CP 13
JR NZ,INSL00
POP HL
PUSH HL
PUSH BC
CALL CREMEM
LD HL,BUFEDI
POP BC
POP DE
CALL PAGTEX
EX AF,AF'
LD A,17
JP SLDIR
DIFILI CALL CADILI
RET C
DIFIL0 LD BC,(FINTEX)
LD A,B
CP H
JR NZ,DIFIL1
LD A,C
CP L
JR NZ,DIFIL1
SCF
RET
DIFIL1 CALL ILDAHL
INC HL
CP 13
JR NZ,DIFIL1
OR A
RET
LINNU0 CALL LINNU9
JP INSLI0
LINNUE CALL LINNU9
JP INSLIN
LINNU9 LD A,13
LD (BUFEDI),A
RET
CONVLI LD HL,BUFEDI+31
LD B,31
CONVL0 DEC HL
LD A,(HL)
CP 32
JR NZ,CONVL1
DJNZ CONVL0
JR CONVL2
CONVL1 INC HL
CONVL2 LD (HL),13
LD HL,BUFEDI
LD DE,BUFEDI
XOR A
PUSH AF
LD A,(HL)
CP ";"
JR NZ,CONVL3
POP AF
RET
CONVL3 LD A,(HL)
CP 13
JR Z,CONVFI
CP 32
JR Z,CONVL4
LDI
JR CONVL3
CONVL4 POP AF
CP 2
JR NZ,CONVL5
PUSH AF
LDI
JR CONVL3
CONVL5 INC A
PUSH AF
CONVL6 LD A,(HL)
INC HL
CP 32
JR Z,CONVL6
DEC HL
SET 7,A
LD (HL),A
JR CONVL3
CONVFI POP AF
LDI
RET
EDICIO CALL CLS
SET 3,(IY-28)
LD HL,(LINEA)
LD (LINCUR),HL
LD HL,512
LD (CX),HL
CALL ZRDBI
CALL ZRLIN
LD (DIRUP),HL
LD (DIREDI),HL
LD (LNETIN),HL
LD (LNCAIN),HL
EDICI0 CALL PREDIC
CALL PRMEMO
CALL PRNUTE
EDICI1 CALL PRPAG
EDICI2 CALL PRNUL0
EDICI3 CALL PONCUR
LD (IY-50),0
EDICI4 LD A,(23560)
EDIC44 OR A
JR Z,EDICI4
CP 8
JR Z,EDIC8
CP 9
JP Z,EDIC9
CP 10
JP Z,EDIC10
CP 11
JP Z,EDIC11
CP 14
JR Z,EDIC14
CP 175
JR Z,EDICIN
CP 184
JP Z,EDICI1
CP 199
JP Z,EDCSQ
CP 128
JP NC,EDICSP
CALL PONLIB
EDIC45 JP C,EDICES
CALL ACTLIN
LD HL,(LINCUR)
INC HL
LD (LINCUR),HL
LD HL,(DIREDI)
CALL DIFIL0
LD (DIREDI),HL
CALL LINNU0
XOR A
LD (CX),A
LD A,(CY)
CP 22
JR NZ,EDIC46
CALL POSILI
JR EDIC47
EDIC46 CALL BORCUR
INC A
LD (CY),A
EDIC47 CALL PRPAG
CALL PRNUL0
CALL LIMBUF
CALL EDITA1
JR EDIC45
EDIC8 LD A,(CX)
OR A
JR Z,EDICI3
CALL BORCUR
DEC A
EDIC88 LD (CX),A
JP EDICI2
EDICIN LD A,(FLAGS1)
XOR 4
LD (FLAGS1),A
RES 0,(IY+7)
JR EDI_14
EDIC14 LD A,(23617)
XOR 1
LD (23617),A
EDI_14 CALL PRIEST
JP EDICI3
EDIC9 LD A,(CX)
CP 31
JP Z,EDICI3
CALL BORCUR
INC A
JR EDIC88
EDIC11 LD A,(CY)
CP 2
JR Z,EDI111
CALL BORCUR
DEC A
LD (CY),A
LD HL,(LINCUR)
DEC HL
LD (LINCUR),HL
JP EDICI2
EDI111 LD HL,(LINEA)
LD A,H
OR A
JR NZ,EDI112
LD A,L
CP 1
JP Z,EDICI3
EDI112 DEC HL
LD (LINEA),HL
LD (LINCUR),HL
CALL BORCUR
LD BC,(TEXINI)
LD HL,(DIRUP)
DEC HL
EDI113 LD A,H
CP B
JR NZ,EDI114
LD A,L
CP C
JR Z,EDI115
EDI114 DEC HL
CALL ILDAHL
CP 13
JR NZ,EDI113
INC HL
EDI115 LD (DIRUP),HL
JP EDICI1
EDIC10 LD HL,(ULTLIN)
LD A,H
CP 255
JR NZ,EDI100
LD HL,(LINCUR)
INC HL
LD (LINCUR),HL
LD A,(CY)
CP 22
JR Z,EDI101
EDI103 CALL BORCUR
INC A
LD (CY),A
JP EDICI2
EDI101 CALL POSILI
JP EDICI1
EDI100 LD DE,(LINCUR)
CALL CODEHL
JP Z,EDICI2
EDI102 LD HL,(LINCUR)
INC HL
LD (LINCUR),HL
LD A,(CY)
JR EDI103
EDICSP RES 0,(IY+7)
CALL BORCUR
PUSH AF
CALL PRIEST
POP BC
JR EDICE0
EDICES LD HL,0
LD (DIREDI),HL
CP 184
JP Z,EDICI1
PUSH AF
CALL ACTLIN
POP BC
LD HL,0
LD (DIREDI),HL
EDICE0 LD HL,TAEDIC
EDICE1 LD A,(HL)
INC HL
CP 255
JP Z,EDICI3
CP B
JR Z,EDICE2
INC HL
INC HL
JR EDICE1
EDICE2 LD C,(HL)
INC HL
LD B,(HL)
LD HL,(LINCUR)
PUSH BC
RET
TAEDIC DEFB 199
DEFW EDCSQ
DEFB 11
DEFW EDIC11
DEFB 10
DEFW EDIC10
DEFB 172
DEFW EDCSI
DEFB 205
DEFW EDCSD
DEFB 173
DEFW EDCEP
DEFB 194
DEFW EDCEU
DEFB 196
DEFW EDCEB
DEFB 224
DEFW EDCEC
DEFB 225
DEFW EDCEV
DEFB 185
DEFW EDCEX
DEFB 227
DEFW EDCEA
DEFB 178
DEFW EDCEQ
DEFB 192
DEFW EDCEL
DEFB 228
DEFW EDCED
DEFB 180
DEFW EDCEE
DEFB 176
DEFW EDCEJ
DEFB 188
DEFW EDCEF
DEFB 189
DEFW EDCEG
DEFB 166
DEFW EDCEN
DEFB 177
DEFW EDCEK
DEFB 187
DEFW HLPEDI
DEFB 255
ACTLIN CALL CONVLI
LD HL,(DIREDI)
LD A,H
OR L
JR NZ,ACTLI0
LD HL,(LINCUR)
CALL CADILI
LD (DIREDI),HL
ACTLI0 PUSH HL
CALL BORLI0
POP HL
JP INSLI0
HLPEDI LD A,1
CALL HELP
JP EDICIO
EDCSQ LD HL,(FINTEX)
LD BC,(TEXINI)
OR A
SBC HL,BC
LD B,H
LD C,L
LD HL,(PUNTEX)
LD (HL),C
INC HL
LD (HL),B
CALL CLS
JP MENU
EDCSI CALL LINNUE
EDCSI0 JP EDICI1
EDCSD PUSH HL
CALL ZRLIN
POP HL
CALL BORLIN
CALL CMPFIN
JR EDCSI0
EDCEP LD (LINP),HL
LD HL,0
LD (LINU),HL
RES 6,(IY-27)
JP EDICI3
EDCEU LD DE,(LINP)
PUSH HL
OR A
SBC HL,DE
POP HL
JR NC,EDCEU1
EX DE,HL
LD (LINP),DE
EDCEU1 LD (LINU),HL
JP EDICI3
EDCEE LD HL,1
LD (LNETIN),HL
JR EDCED1
EDCEJ LD HL,(LNETIN)
LD A,H
OR L
JP Z,EDICI3
INC HL
LD (LNETIN),HL
JR EDCED0
EDCED LD HL,(LINCUR)
LD (LNETIN),HL
EDCED1 CALL BOPRED
CALL PONNEG
CALL PRIMES
DEFM "Search for"
DEFM " Symbol?:@"
CALL EDVA0C
PUSH HL
LD A,32
LD BC,31
CPIR
DEC HL
LD (HL),255
POP HL
LD DE,BUFETI
LD BC,31
LDIR
EDCED0 LD HL,(LNETIN)
PUSH HL
CALL CADILI
POP BC
JP C,EDICI0
LD DE,BUFETI
EDCED2 PUSH DE
PUSH HL
PUSH BC
CALL CMPETI
POP BC
POP HL
POP DE
JR Z,EDCEDF
PUSH BC
CALL DIFIL0
POP BC
JR C,EDCED3
INC BC
JR EDCED2
EDCED3 CALL BOPRED
CALL PRIMES
DEFM "Symbol not found@"
CALL ZRLNET
JP PRBLN0
EDCEDF LD (DIRUP),HL
LD (LINCUR),BC
LD (LINEA),BC
LD (LNETIN),BC
CALL ZRCY
JP EDICI0
EDCEG LD HL,1
LD (LNCAIN),HL
JR EDCEF1
EDCEN LD HL,(LNCAIN)
LD A,H
OR L
JP Z,EDICI3
INC HL
LD (LNCAIN),HL
JR EDCEF0
EDCEF LD HL,(LINCUR)
LD (LNCAIN),HL
EDCEF1 CALL BOPRED
CALL PONNEG
CALL PRIMES
DEFM "Text to find?:@"
CALL EDVA0C
PUSH HL
LD HL,BUFEDI+31
EDCE_1 DEC HL
LD A,(HL)
CP 32
JR Z,EDCE_1
INC HL
LD (HL),255
POP HL
LD DE,BUFCAD
LD BC,31
LDIR
EDCEF0 LD HL,(LNCAIN)
PUSH HL
CALL CADILI
POP BC
JP C,EDICI0
PUSH HL
LD DE,BUFCAD
LD IX,(FINTEX)
EDCEF2 PUSH DE
PUSH HL
PUSH BC
PUSH IX
CALL CMPCAD
POP IX
POP BC
POP HL
POP DE
JR Z,EDCEFF
CALL ILDAHL
INC HL
CP 13
JR NZ,EDCEF2
CALL CADIL5
JR C,EDCEF3
INC SP
INC SP
PUSH HL
INC BC
JR EDCEF2
EDCEF3 POP HL
CALL BOPRED
CALL PRIMES
DEFM "Text not found@"
CALL ZRLNCA
JP PRBLN0
EDCEFF POP HL
LD (DIRUP),HL
LD (LINCUR),BC
LD (LINEA),BC
LD (LNCAIN),BC
CALL ZRCY
JP EDICI0
CMPETI CALL ILDAHL
CP 13
JR Z,CMPETF
CP 128
JR NC,CMPETF
LD C,A
LD A,(DE)
CP 255
RET Z
CP C
RET NZ
INC HL
INC DE
JR CMPETI
CMPETF LD A,(DE)
CP 255
RET
CMPCAD CALL ILDAHL
RES 7,A
CP 13
JR Z,CMPETF
LD C,A
LD A,(DE)
CP 255
RET Z
CP C
RET NZ
INC HL
INC DE
JR CMPCAD
EDCEL CALL BOPRED
CALL PONNEG
CALL PRIMES
DEFM "Goto line?:@"
CALL EDVA0C
CALL VAL
LD H,D
LD L,E
LD A,H
OR L
JP Z,EDICI0
CALL CADILI
JR NC,EDCEL0
CALL ZRDRUP
DEC BC
JR EDCEL1
EDCEL0 LD (DIRUP),HL
EDCEL1 LD (LINCUR),BC
LD (LINEA),BC
CALL ZRCY
JP EDICI0
EDCEC CALL COMBLO
JP Z,PRBLNO
SET 6,(IY-27)
CALL CALLGB
CALL CPYBUF
JP EDICI3
EDCEB CALL COMBLO
JP Z,PRBLNO
CALL CALLGB
EDCEB0 CALL ZRCUR
LD HL,(DIRBLO)
LD BC,(LONGBL)
CALL BORMEM
CALL ZRLIN
CALL CMPFIN
CALL ZRDRUP
CALL ZRCY
JP EDICI0
EDCEX CALL COMBLO
JP Z,PRBLNO
SET 6,(IY-27)
CALL CALLGB
CALL CPYBUF
JR EDCEB0
EDCEQ LD HL,(LINEA)
LD A,H
OR A
JR NZ,EDCEQ0
LD A,L
CP 1
JP Z,EDICI3
EDCEQ0 PUSH HL
POP IX
LD HL,(DIRUP)
LD DE,(TEXINI)
DEC HL
LD B,21
EDCEQ1 CALL CODEHL
JR NZ,EDCEQ2
DEC IX
EDCEQQ LD (LINCUR),IX
LD (LINEA),IX
LD (DIRUP),HL
CALL ZRCY
JP EDICI0
EDCEQ2 DEC HL
CALL ILDAHL
CP 13
JR NZ,EDCEQ1
DEC IX
DJNZ EDCEQ1
INC HL
JR EDCEQQ
CODEHL LD A,D
CP H
RET NZ
LD A,E
CP L
RET
EDCEA LD IX,(LINEA)
LD HL,(DIRUP)
LD DE,(FINTEX)
LD B,21
EDCEA1 CALL CODEHL
JR NZ,EDCEA2
EDCEAB DEC IX
LD (LINCUR),IX
LD (LINEA),IX
CALL ZRDRUP
EDCEAA CALL ZRCY
JP EDICI0
EDCEA2 INC IX
EDCEA3 CALL DIFIL1
DJNZ EDCEA1
CALL CODEHL
JR Z,EDCEAB
LD (LINCUR),IX
LD (LINEA),IX
LD (DIRUP),HL
JR EDCEAA
EDCEV CALL CADILI
BIT 6,(IY-27)
JR Z,PRBFNO
LD BC,(LONGBL)
PUSH HL
CALL CREMEM
LD HL,49152
POP DE
LD BC,(LONGBL)
CALL PAGTEX
EX AF,AF'
LD A,19
CALL SLDIR
JP EDICI0
PRBLNO CALL BOPRED
CALL PRIMES
DEFM "No block"
DEFM " defined@"
PRBLN0 CALL ESPTEC
JP EDICI0
PRBFNO CALL BOPRED
CALL PRIMES
DEFM "No block in"
DEFM " buffer@"
JR PRBLN0
EDCEK CALL BOPRED
CALL PONNEG
CALL PRIMES
DEFM "Calculate "
DEFM " expression?:@"
CALL EDVA0C
CALL BOPRED
CALL CALCUL
CALL ESPTEC
JP EDICI0
ESPTEC LD (IY-50),0
ESPTE1 LD A,(23560)
OR A
JR Z,ESPTE1
RET
COMBLO LD HL,(LINP)
LD A,H
OR L
RET Z
LD HL,(LINU)
LD A,H
OR L
RET
POSILI LD HL,(LINEA)
INC HL
LD (LINEA),HL
LD HL,(DIRUP)
PUSH AF
CALL DIFIL0
POP AF
LD (DIRUP),HL
RET
LIMBUF LD HL,BUFEDI
LD DE,BUFEDI+1
LD BC,31
LD (HL),32
LDIR
LD (HL),13
RET
BORMEM PUSH HL
ADD HL,BC
EX DE,HL
LD HL,(FINTEX)
PUSH HL
OR A
SBC HL,BC
LD (FINTEX),HL
POP HL
OR A
SBC HL,DE
LD B,H
LD C,L
EX DE,HL
PUSH HL
PUSH BC
CALL PRMEMO
POP BC
POP HL
POP DE
LD A,B
OR C
RET Z
JP ILDIR
CREMEM PUSH HL
LD HL,(FINTEX)
PUSH HL
POP IX
ADD HL,BC
LD (FINTEX),HL
EX DE,HL
DEC DE
POP BC
PUSH IX
POP HL
OR A
SBC HL,BC
LD B,H
LD C,L
PUSH IX
PUSH BC
PUSH DE
CALL PRMEMO
POP DE
POP BC
POP HL
DEC HL
LD A,B
OR C
RET Z
JP ILDDR
ZRLIN LD HL,0
LD (LINP),HL
LD (LINU),HL
RET
CMPFIN LD HL,(LINCUR)
CALL CADILI
RET NC
LD HL,(FINTEX)
LD A,13
CALL ILDHLA
INC HL
LD (FINTEX),HL
JP PRMEMO
ZRCUR LD HL,(LINP)
LD (LINCUR),HL
LD (LINEA),HL
RET
CPYBUF LD HL,(DIRBLO)
LD BC,(LONGBL)
LD DE,49152
LD (PUNETI),DE
LD (FINNDX),DE
LD A,19
EX AF,AF'
CALL PAGTEX
JP SLDIR
ZRDRUP LD HL,0
LD (DIRUP),HL
RET
PONTEX LD B,A
LD A,(IY-27)
AND %11111100
OR B
LD (IY-27),A
LD A,B
CALL ACTPAG
LD A,B
PONPNT OR A
JR NZ,PONPN1
LD HL,LONG0
LD DE,23755
JR PONPN0
PONPN1 CP 1
JR NZ,PONPN2
LD HL,LONG1
JR PONPN3
PONPN2 LD HL,LONG2
PONPN3 LD DE,49152
PONPN0 LD (PUNTEX),HL
LD (TEXINI),DE
LD (ADIREC),DE
LD A,(HL)
INC HL
LD H,(HL)
LD L,A
ADD HL,DE
LD (FINTEX),HL
RET
ZRTEX CALL ZRTXTS
ZRTEX0 XOR A
JP PONTEX
PONNEG LD A,4
PONCOL LD HL,22528
LD DE,22529
LD BC,63
LD (HL),A
LDIR
RET
ZRCY LD A,2
LD (CY),A
RET
CALLGB LD HL,(LINU)
CALL DIFILI
PUSH HL
LD HL,(LINP)
CALL CADILI
LD (DIRBLO),HL
EX DE,HL
POP HL
OR A
SBC HL,DE
LD (LONGBL),HL
RET
ZRLNET LD HL,0
LD (LNETIN),HL
RET
ZRLNCA LD HL,0
LD (LNCAIN),HL
RET
EDVA0C RES 3,(IY-28)
LD A,(CY)
PUSH AF
CALL EDIVA0
SET 3,(IY-28)
POP AF
LD (CY),A
RET
PONLI1 LD HL,1
LD (LINEA),HL
RET
INIETI RES 6,(IY-27)
XOR A
LD HL,49152
CALL ELDHLA
INC HL
LD A,255
CALL ELDHLA
LD HL,49152+9
LD A,11
CALL ELDHLA
INC HL
LD A,192
CALL ELDHLA
INC HL
LD A,254
CALL ELDHLA
INC HL
LD A,255
CALL ELDHLA
LD HL,49152+9+11
LD A,11
CALL ELDHLA
INC HL
LD A,192
CALL ELDHLA
INC HL
LD (PUNETI),HL
RET
CPLABE LD A,(DE)
CALL ESETIQ
JR C,CPLABF
LD C,A
CALL ELDAHL
CP 255
JR NZ,CPLAB1
LD A,1
OR A
RET
CPLAB1 LD B,A
LD A,C
CP B
RET NZ
INC HL
INC DE
JR CPLABE
CPLABF LD C,A
CALL ELDAHL
CP 255
JR NZ,CPLAF1
XOR A
RET
CPLAF1 SCF
RET
CRENDX LD DE,(PUNETI)
LD HL,49152
CREND2 EX DE,HL
LD A,E
CALL ELDHLA
INC HL
LD A,D
CALL ELDHLA
INC HL
EX DE,HL
PUSH HL
LD BC,9
ADD HL,BC
CALL ELDAHL
LD C,A
INC HL
CALL ELDAHL
LD B,A
POP HL
OR A
SBC HL,BC
JR Z,CRENDF
LD H,B
LD L,C
JR CREND2
CRENDF LD (FINNDX),DE
RET
PONETI EX DE,HL
LD HL,49152
PUSH HL
PONET2 PUSH HL
LD BC,9
ADD HL,BC
CALL ELDAHL
LD C,A
INC HL
CALL ELDAHL
LD B,A
POP HL
PUSH HL
PUSH BC
PUSH DE
CALL CPLABE
POP DE
POP BC
POP HL
JR Z,PONETF
JR C,PONET8
INC SP
INC SP
PUSH HL
LD H,B
LD L,C
JR PONET2
PONETF POP HL
SCF
RET
PONET8 PUSH HL
CALL INSETI
POP DE
LD A,E
CALL ELDHLA
INC HL
LD A,D
CALL ELDHLA
LD BC,10
OR A
SBC HL,BC
EX DE,HL
POP HL
LD BC,9
ADD HL,BC
LD A,E
CALL ELDHLA
INC HL
LD A,D
CALL ELDHLA
OR A
RET
INSETI LD HL,(PUNETI)
PUSH HL
INSET1 LD A,(DE)
CP 13
JR Z,INSETF
CP 128
JR NC,INSETF
CALL ELDHLA
INC HL
INC DE
JR INSET1
INSETF LD A,255
CALL ELDHLA
POP HL
LD BC,7
ADD HL,BC
LD A,LX
CALL ELDHLA
INC HL
LD A,HX
CALL ELDHLA
INC HL
INC HL
INC HL
LD (PUNETI),HL
DEC HL
DEC HL
RET
CALETI PUSH HL
POP IX
LD HL,(FINNDX)
PUSH HL
LD DE,49152
OR A
SBC HL,DE
POP HL
JR NZ,CALET1
SCF
PUSH AF
JP CALETF
CALET1 LD DE,(PUNETI)
OR A
SBC HL,DE
CALET2 EX DE,HL
SRL D
RR E
DEC DE
LD BC,0
CALET3 LD H,D
LD L,E
PUSH HL
OR A
SBC HL,BC
POP HL
JR C,CALETR
ADD HL,BC
SRL H
RR L
PUSH HL
PUSH BC
PUSH DE
CALL CALERE
POP DE
POP BC
JR Z,CALESI
POP HL
JR C,CALET4
LD B,H
LD C,L
INC BC
JR CALET3
CALET4 LD D,H
LD E,L
DEC DE
JR CALET3
CALETR PUSH AF
JR CALETF
CALESI POP DE
OR A
PUSH AF
LD BC,7
ADD HL,BC
CALL ELDAHL
LD E,A
INC HL
CALL ELDAHL
LD D,A
CALETF LD A,(IX+0)
CALL ESETIQ
JR C,CALEF2
INC IX
JR CALETF
CALEF2 PUSH IX
POP HL
POP AF
RET
CALERE ADD HL,HL
LD DE,(PUNETI)
ADD HL,DE
CALL ELDAHL
LD C,A
INC HL
CALL ELDAHL
LD H,A
LD L,C
PUSH HL
PUSH IX
POP DE
CALL CPLABE
POP HL
RET
ESETIQ CP 48
RET C
CP 128
JR NC,ESETIF
CP 65
RET NC
CP 58
ESETIF CCF
RET
APUN LD HL,49152
LD (PUNETI),HL
LD (FINNDX),HL
LD (DIRDBI),HL
APUN2 LD HL,49152
LD (PUNDES),HL
LD (PUNDIR),HL
LD (PUNORG),HL
LD (DIRENT),HL
RET
ACOPLI LD HL,(ADIREC)
LD DE,ABUF
ACOPL1 CALL ILDAHL
INC HL
CP 13
JR Z,ACOPFI
CP 128
JR C,ACOPL2
LD B,A
LD A,255
LD (DE),A
INC DE
LD A,B
SUB 128
ACOPL2 LD (DE),A
INC DE
JR ACOPL1
ACOPFI LD (DE),A
INC DE
LD A,255
LD (DE),A
RET
APRLIN LD HL,(ALINEA)
CALL PRNUM
LD A,13
RST 16
LD HL,(ADIREC)
JP PRLIN0
APROBJ LD HL,(PUNDES)
PUSH HL
CALL PRNUM
LD A,":"
RST 16
LD DE,(BYTES)
LD HL,4
OR A
SBC HL,DE
POP HL
JR NC,APROB1
LD DE,4
APROB1 LD A,D
OR E
JR Z,APROBF
PUSH DE
PUSH HL
LD A,32
RST 16
POP HL
CALL OLDAHL
PUSH HL
CALL PRNUMA
POP HL
POP DE
INC HL
DEC DE
JR APROB1
APROBF LD A,13
RST 16
RET
ASILIS BIT 7,(IY-27)
RET Z
BIT 7,(IY-28)
RET
ACOMA LD A,(HL)
CP 34
JR NZ,ACOMA1
LD A,B
CPL
LD B,A
JR ACOM11
ACOMA1 CP ","
JR NZ,ACOM10
LD A,B
OR A
RET Z
JR ACOM11
ACOM10 CP 13
JR Z,ACOMA2
ACOM11 SCF
RET
ACOMA2 OR A
RET
ASIOP1 LD A,(HL)
CP 255
RET Z
CP 13
JR Z,ACOMA2
SCF
RET
ACOMP LD A,(DE)
CP (HL)
RET NZ
INC HL
INC DE
CP 255
RET Z
JR ACOMP
APOMAS LD HL,OP11
CALL CADIL5
JR NC,APOMA1
LD (IY-20),C
RET
APOMA1 LD (IY-19),C
RET
PONINS BIT 1,(IY-18)
JR Z,PONBYT
EX AF,AF'
LD A,(BYTES)
INC A
LD (BYTES),A
LD A,(ADES)
PUSH AF
LD A,(IX+2)
CP 203
JR NZ,PONIN1
POP AF
JR PONIN2
PONIN1 POP AF
EX AF,AF'
PONIN2 CALL PONBYT
EX AF,AF'
PONBYT BIT 7,(IY-28)
JR Z,PONBY1
CALL OLDHLA
PONBY1 INC HL
RET
AMIOP OR A
JR NZ,AMIOP1
LD A,(IX+0)
OR A
JR NZ,AMIOP0
LD A,(IX+1)
OR A
JR NZ,AMIOP0
LD A,(IX+2)
OR A
JR NZ,AMIOP0
AMIO00 LD A,1
OR A
RET
AMIOP0 XOR A
RET
AMIOP1 PUSH DE
PUSH HL
LD L,(IX+0)
LD H,(IX+1)
LD E,(IX+2)
LD D,A
AMIOP2 RR E
RR H
RR L
PUSH AF
DEC D
JR Z,AMIOP3
POP AF
JR AMIOP2
AMIOP3 POP AF
POP HL
POP DE
JR C,AMIO00
JR AMIOP0
AFINBU LD A,(DE)
INC DE
CP 255
JR NZ,AFINBU
RET
ACPSTR LD C,0
ACPST1 LD A,(DE)
OR A
JR Z,AMIO00
PUSH HL
CALL ACOMP
POP HL
RET Z
INC C
CALL AFINBU
JR ACPST1
ASOLO CP 11
JR Z,ASOL2
JR C,ASOL1
CP 13
JR Z,ASOL2
JR C,ASOL1
CP 24
JR Z,ASOL2
CP 22
RET NC
CP 14
RET Z
CP 18
RET Z
ASOL2 SCF
RET
ASOL1 OR A
RET
ADATIP CP 9
JR NC,ADATI1
CP 3
JR Z,ADATI1
CP 4
JR Z,ADATI1
JR ADATI2
ADATI1 SCF
RET
ADATI2 OR A
RET
ADAMAS CP 22
RET NC
CP 12
CCF
RET
APOPRE PUSH AF
LD A,(APREXY)
OR A
JR Z,APOPR0
CALL PONBYT
LD A,(BYTES)
INC A
LD (BYTES),A
APOPR0 LD A,(IX+2)
OR A
JR Z,APOPR1
CALL PONBYT
LD A,(BYTES)
INC A
LD (BYTES),A
POP AF
RET
APOPR1 POP AF
RET
AMA18 LD A,(IX+2)
CP 203
JR Z,AMA180
CP 237
RET Z
LD A,B
CP 192
RET NC
CP 128
CCF
RET
AMA180 SCF
RET
AMEZC PUSH BC
CALL ADAMAS
JR NC,AMEZC0
RLC C
JR AMEZC1
AMEZC0 CP 22
JR Z,AMEZC9
CP 23
JR Z,AMEZC9
AMEZ00 CALL AMA18
JR C,AMEZC2
AMEZC1 RLC C
RLC C
RLC C
AMEZC2 LD A,C
ADD A,B
POP BC
RET
AMEZC9 BIT 1,(IY-25)
JR Z,AMEZ00
LD C,3
JR AMEZ00
ASI8B CP 1
RET Z
CP 5
RET Z
CP 8
RET
ADADIS EX AF,AF'
LD A,B
CP 8
JR NZ,ADADI1
LD HL,(ADIS)
ADADI1 EX AF,AF'
RET
AINNUM PUSH BC
CALL ADADIS
PUSH HL
LD HL,(PUNDES)
CALL APOPRE
LD B,(IX+3)
CALL AMEZC
CALL PONINS
POP DE
LD A,E
CALL PONBYT
POP AF
CALL ASI8B
JR Z,AINNU2
LD A,D
CALL PONBYT
LD A,(BYTES)
ADD A,3
JR AINNU3
AINNU2 LD A,(BYTES)
ADD A,2
AINNU3 LD (BYTES),A
JP ANXTLI
ADOSMA LD A,(IY-20)
RLCA
RLCA
RLCA
ADD A,(IY-19)
ADD A,(IX+3)
LD HL,(PUNDES)
CALL APOPRE
CALL PONINS
LD A,(BYTES)
INC A
LD (BYTES),A
JP ANXTLI
AOPSOL OR A
JR Z,AOPSO1
LD HL,(AVAL1)
LD A,(IX+0)
LD C,(IY-20)
JR AOPSO2
AOPSO1 LD HL,(AVAL2)
LD A,(IX+1)
LD C,(IY-19)
AOPSO2 CALL ADATIP
JR C,AOPSO3
LD B,A
LD C,0
JP AINNUM
AOPSO3 LD HL,(PUNDES)
CALL APOPRE
LD B,(IX+3)
CALL AMEZC
CALL PONINS
LD A,(BYTES)
INC A
LD (BYTES),A
JP ANXTLI
ABUSOL LD DE,ATASO2
CALL ACPSTR
JP NZ,ABUSO1
LD L,C
LD H,0
ADD HL,HL
LD DE,ATASOL
ADD HL,DE
LD A,(HL)
INC HL
LD E,(HL)
LD D,0
PUSH IX
POP HL
ADD HL,DE
OR (HL)
LD (HL),A
JP ABUSIG
ABUSO1 PUSH HL
LD HL,ASTRDM
LD DE,(ANEMO)
CALL ACOMP
POP HL
JP Z,ABUSIG
JP ABUNUM
ANUOP1 LD HL,(ADIOP1)
ANUCAL PUSH IX
CALL VAL
POP IX
CCF
RET C
BIT 4,(IY-28)
JR Z,ANUCA2
BIT 7,(IY-28)
JR NZ,ANUCA2
LD (IX+0),207
XOR A
RET
ANUCA2 LD A,1
OR A
RET
APONUM CALL APONU0
JP ABUSIG
APONU0 LD HL,OP11
CALL CADIL5
JR NC,APONU1
LD HL,AVAL1
JR APONU2
APONU1 LD HL,AVAL2
APONU2 LD (HL),E
INC HL
LD (HL),D
RET
ANU8BI LD A,D
OR A
RET Z
CP 255
RET NZ
ANU800 LD A,E
CP 128
JR C,ANU8B1
ANU8B0 XOR A
RET
ANU8B1 LD A,1
OR A
RET
ANUDIS LD A,D
OR A
JR NZ,ANUDI1
LD A,E
OR A
JP M,ANU8B1
JR ANU8B0
ANUDI1 CP 255
JR NZ,ANU8B1
JR ANU800
AERNUM BIT 4,(IY-28)
JR Z,AERNU1
LD A,3
JP ANONE1
AERNU1 LD A,2
JP ANONE1
ABUNUM LD A,(HL)
CP "("
JR NZ,ABUNU2
INC HL
CALL ANUCAL
JR NZ,ABUNU0
LD (IX+0),48
JP ABUSIG
ABUNU0 JR NC,AERNUM
LD A,(HL)
CP ")"
JR NZ,AERNUM
SET 5,(IX+0)
CALL ANU8BI
JR NZ,ABUNU1
SET 4,(IX+0)
ABUNU1 JP APONUM
ABUNU2 CALL ANUCAL
JP Z,ABUSIG
JR NC,AERNUM
LD A,(HL)
CP ")"
JR Z,AERNUM
CALL APONU0
SET 6,(IX+0)
CALL ANU8BI
JR NZ,ABUNU3
SET 0,(IX+0)
LD A,E
CP 8
JR NC,ABUN21
SET 2,(IX+0)
LD C,E
CALL APOMAS
LD A,C
OR A
JR NZ,ABUNU3
ABUN21 RRCA
JR C,ABUNU3
RRCA
JR C,ABUNU3
RRCA
JR C,ABUNU3
CP 8
JR NC,ABUNU3
SET 3,(IX+0)
LD C,A
CALL APOMAS
ABUNU3 LD HL,(PUNDIR)
INC HL
INC HL
OR A
PUSH DE
EX DE,HL
SBC HL,DE
LD A,L
LD (ADIS),A
EX DE,HL
CALL ANUDIS
POP DE
JP NZ,ABUSIG
SET 7,(IX+0)
JP ABUSIG
ASIQUI PUSH HL
LD A,C
OR A
JR Z,ASIQU2
INC HL
LD (HL),255
ASIQU2 POP DE
RET
APOHL LD A,C
OR A
JR NZ,APOHL1
LD BC,2
LD HL,ASTRHL
JR APOHL2
APOHL1 DEC A
ADD A,A
LD L,A
LD H,0
LD BC,ASTRH
ADD HL,BC
LD BC,1
APOHL2 LDIR
RET
AFIN0 CALL PRCOD
CALL PRINEN
AFIN XOR A
JP PONTEX
ALEVAL LD A,(HL)
CP ","
JR NZ,ALEVA1
INC HL
ALEVA1 LD A,(HL)
CP 255
JR NZ,ALEVA2
INC HL
LD A,(HL)
CP 255
JR Z,ALEVFI
ALEVA2 CALL ANUCAL
JR Z,ALEVSI
RET NC
ALEVSI LD A,1
OR A
SCF
RET
ALEVFI XOR A
RET
APONDP BIT 5,(IY-27)
RET Z
BIT 7,(IY-28)
RET NZ
LD A,D
OR E
RET Z
CALL BTXTUS
CP 2
RET Z
LD HL,(ADIREC)
CALL BACT
OR A
JR Z,APOND1
LD DE,49152
OR A
SBC HL,DE
APOND1 EX DE,HL
LD A,23
LD (NUMPAG+1),A
LD HL,(DIRDBI)
LD A,C
CALL PONBYM
LD A,B
CALL PONBYM
LD A,E
CALL PONBYM
LD A,D
CALL PONBYM
LD (DIRDBI),HL
JP ACTPAG
PONBYM CALL ILDHLA
INC HL
RET
PRPASE CALL PRIMES
DEFM "#Pass @"
LD A,(IY-28)
RLCA
AND 1
INC A
JP PRNUMA
PRPAER CALL PRPASE
CALL PRIMES
DEFM ", Errors @"
LD HL,(AERRS)
CALL PRNUM
LD A,13
RST 16
RET
AINICI CALL PRSPED
CALL PRCPYR
RES 7,(IY-28)
RES 5,(IY-27)
CALL APUN
CALL INIETI
LD HL,0
LD (AERRS),HL
AINIC0 RES 7,(IY-27)
XOR A
CALL PONTEX
CALL PRPASE
LD A,13
RST 16
AINIC2 LD HL,1
LD (ALINEA),HL
CALL PRIMES
DEFM "#Text"
DEFM " block @"
CALL BACT
CALL PRNUMA
LD A,13
RST 16
ABUC XOR A
LD (ERROR),A
LD (AOPE),A
LD (APREXY),A
LD H,A
LD L,A
LD (OP11),HL
LD (OP13),HL
LD (OP22),HL
LD (BYTES),HL
LD A,(IY-18)
AND %11111100
LD (IY-18),A
RES 6,(IY-28)
BIT 1,(IY-17)
JR NZ,ABUC21
LD HL,(ADIREC)
CALL CADIL4
JR NC,ABUC2
CALL NUMTEX
LD B,A
CALL BACT
CP B
JR Z,ABUC1
INC A
CALL PONTEX
JR AINIC2
ABUC1 CALL PRPAER
BIT 7,(IY-28)
JP NZ,AFIN0
LD HL,(AERRS)
LD A,H
OR L
JP NZ,AFIN
SET 7,(IY-28)
CALL CRENDX
CALL PRTAB
CALL PRDEB
CALL APUN2
JP AINIC0
ABUC2 CALL ACOPLI
LD (ASIGDI),HL
ABUC21 LD HL,ABUF
LD A,(HL)
CP ";"
JP Z,ANXTLI
CP 13
JP Z,ANXTLI
CP 255
JR Z,ANOETI
SET 6,(IY-28)
LD HL,(PUNDIR)
LD (ETINUM),HL
LD HL,ABUF
ABUC3 INC HL
LD A,(HL)
CP 13
JP Z,ANXTLI
CP 255
JR Z,ANOETI
JR ABUC3
ANOETI INC HL
LD (ANEMO),HL
ANOET0 CALL ASIOP1
INC HL
JR C,ANOET0
JR NZ,ANOOPE
LD A,1
LD (AOPE),A
LD (ADIOP1),HL
LD B,0
ANOET1 CALL ACOMA
INC HL
JR C,ANOET1
JR NZ,ANOOPE
LD A,2
LD (AOPE),A
LD (ADIOP2),HL
DEC HL
LD (HL),255
INC HL
ANOET2 CALL ASIOP1
INC HL
JR C,ANOET2
ANOOPE DEC HL
LD (HL),255
LD A,(AOPE)
OR A
JP Z,ABUNEM
LD IX,OP11
LD (APASO),A
LD HL,(ADIOP1)
ABUOPE LD DE,ASTRSP
PUSH HL
CALL ACOMP
POP HL
JR NZ,ABUOP1
SET 4,(IX+1)
SET 3,(IX+1)
ABUOP0 LD C,3
CALL APOMAS
JP ABUSIG
ABUOP1 LD DE,ASTRX
CALL ACPSTR
JR NZ,ABUO15
LD A,221
LD (APREXY),A
PUSH HL
CALL ASIQUI
CALL APOHL
POP HL
JR ABUO19
ABUO15 LD DE,ASTRY
CALL ACPSTR
JR NZ,ABUO16
LD A,253
LD (APREXY),A
PUSH HL
CALL ASIQUI
CALL APOHL
POP HL
JR ABUO19
ABUO16 LD A,(HL)
CP "("
JR NZ,ABUO19
PUSH HL
INC HL
LD A,(HL)
CP "I"
JR NZ,ABUO18
INC HL
LD A,(HL)
CP "X"
JR Z,ABUO17
CP "Y"
JR NZ,ABUO18
LD C,253
JR ABO170
ABUO17 LD C,221
ABO170 INC HL
LD A,(HL)
CP "+"
JR Z,ABO171
CP "-"
JR Z,ABO171
CP ")"
JR NZ,ABUO18
LD A,C
LD (APREXY),A
POP DE
JR ABO173
ABO171 LD A,C
LD (APREXY),A
CALL ANUCAL
POP BC
JR Z,ABO172
JP NC,AERNUM
CALL ANUDIS
JP NZ,AERDES
ABO172 LD A,(HL)
CP ")"
JP NZ,AERNUM
INC HL
LD A,(HL)
CP 255
JP NZ,AERNUM
LD A,E
LD (ADES),A
SET 1,(IY-18)
LD D,B
LD E,C
ABO173 PUSH DE
LD HL,ASTRH2
LD BC,5
LDIR
ABUO18 POP HL
ABUO19 LD DE,ASTRAF
PUSH HL
CALL ACOMP
POP HL
JR NZ,ABUOP2
SET 0,(IX+2)
SET 5,(IX+1)
JP ABUOP0
ABUOP2 LD DE,ASTR8B
CALL ACPSTR
JR NZ,ABUOP3
PUSH HL
CALL APOMAS
POP HL
SET 1,(IX+1)
LD A,C
CP 1
JR NZ,ABUO21
SET 5,(IX+2)
SET 6,(IX+2)
ABUO21 CP 6
JR NC,ABUOP7
JR ABUSIG
ABUOP3 LD DE,ASTR16
CALL ACPSTR
JR NZ,ABUOP4
PUSH HL
CALL APOMAS
POP HL
SET 3,(IX+1)
SET 5,(IX+1)
LD A,C
OR A
JR NZ,ABUOP7
JR ABUSIG
ABUOP4 LD DE,ASTRCO
CALL ACPSTR
JR NZ,ABUOP5
CALL APOMAS
SET 6,(IX+2)
LD A,C
CP 4
JR NC,ABUSIG
SET 5,(IX+2)
JR ABUSIG
ABUOP5 LD DE,ASTRBC
CALL ACPSTR
JR NZ,ABUOP6
CALL APOMAS
SET 1,(IX+2)
JR ABUSIG
ABUOP6 LD DE,ASTRIR
CALL ACPSTR
JR NZ,ABUOP7
CALL APOMAS
SET 0,(IX+1)
JR ABUSIG
ABUOP7 JP ABUSOL
ABUSIG LD IX,OP21
LD HL,(ADIOP2)
LD A,(APASO)
DEC A
LD (APASO),A
JP NZ,ABUOPE
ABUNEM LD HL,(ANEMO)
LD DE,ATABLA
ABUNE1 LD A,(DE)
CP 255
JP Z,ABUPSE
PUSH HL
CALL ACOMP
JR Z,ABUNE2
CALL AFINBU
LD A,(DE)
INC DE
LD L,A
LD H,0
ADD HL,HL
ADD HL,HL
ADD HL,DE
EX DE,HL
POP HL
JR ABUNE1
ABUNE2 POP HL
LD A,(DE)
LD B,A
INC DE
ABUNE3 LD IX,OP11
LD A,(DE)
CALL AMIOP
JR NZ,ABUNE4
INC DE
INC DE
INC DE
INC DE
ABUNE0 DJNZ ABUNE3
JP AEROPE
ABUNE4 LD IX,OP21
INC DE
LD A,(DE)
CALL AMIOP
JR NZ,ABUNE5
INC DE
INC DE
INC DE
JR ABUNE0
ABUNE5 DEC DE
PUSH DE
POP IX
LD A,(DE)
OR A
JP Z,ANOMAS
CALL ASOLO
JR NC,ANSOL1
INC DE
LD A,(DE)
OR A
JR Z,ANOMAS
CALL ASOLO
JR C,ANOMAS
XOR A
JP AOPSOL
ANSOL1 INC DE
LD A,(DE)
CALL ASOLO
JR NC,ANSOL2
LD A,1
JP AOPSOL
ANSOL2 DEC DE
LD A,(DE)
CALL ADATIP
JR NC,ANMA1
INC DE
LD A,(DE)
OR A
JR Z,ANOOP2
CALL ADATIP
JP C,ADOSMA
LD HL,(AVAL2)
LD A,(DE)
LD B,A
DEC DE
LD A,(DE)
LD C,(IY-20)
JP AINNUM
ANOOP2 DEC DE
LD A,(DE)
LD C,(IY-20)
LD HL,(PUNDES)
CALL APOPRE
LD B,(IX+3)
CALL AMEZC
CALL PONINS
LD A,(BYTES)
INC A
LD (BYTES),A
JR ANXTLI
ANMA1 LD HL,(AVAL1)
LD C,(IY-19)
LD A,(DE)
LD B,A
INC DE
LD A,(DE)
OR A
JP NZ,AINNUM
DEC DE
LD A,(DE)
LD C,0
JP AINNUM
ANOMAS PUSH IX
POP DE
INC DE
INC DE
LD HL,(PUNDES)
CALL APOPRE
INC DE
LD A,(DE)
CALL PONBYT
LD A,(BYTES)
INC A
LD (BYTES),A
ANXTLI CALL ASILIS
JR Z,ANXTL2
BIT 1,(IY-17)
JR NZ,ANXTL2
CALL APRLIN
ANXTL2 LD A,(ERROR)
OR A
JR Z,ANXTL5
BIT 1,(IY-17)
JR NZ,ANXTL4
BIT 7,(IY-28)
JR Z,ANXTL3
BIT 7,(IY-27)
JR NZ,ANXTL4
ANXTL3 PUSH AF
CALL APRLIN
POP AF
ANXTL4 CALL APRERR
LD HL,(AERRS)
INC HL
LD (AERRS),HL
CALL ESPTEC
CP 199
RET Z
JR ANXT00
ANXTL5 BIT 6,(IY-28)
JR Z,ANXTL6
BIT 7,(IY-28)
JR NZ,ANXTL6
LD HL,ABUF
LD IX,(ETINUM)
CALL PONETI
JR NC,ANXTL6
LD A,8
LD (ERROR),A
JR ANXTL3
ANXTL6 CALL ASILIS
JR Z,ANXT00
CALL APROBJ
ANXT00 LD DE,(BYTES)
LD HL,(PUNDES)
LD B,H
LD C,L
ADD HL,DE
LD (PUNDES),HL
LD HL,(PUNDIR)
ADD HL,DE
LD (PUNDIR),HL
CALL APONDP
LD HL,(ASIGDI)
LD (ADIREC),HL
LD HL,(ALINEA)
INC HL
LD (ALINEA),HL
BIT 1,(IY-17)
RET NZ
BIT 5,(IY-17)
RET NZ
JP ABUC
ABUSCO LD A,(HL)
CP ","
RET Z
CP 255
RET Z
INC HL
JR ABUSCO
ADEFBE POP AF
POP BC
POP AF
LD A,5
JP ANONE1
ADEFE2 POP AF
JP AERNUM
ADEFB LD HL,(ADIOP1)
LD BC,(PUNDES)
XOR A
ADEFB1 PUSH AF
PUSH BC
CALL ALEVAL
PUSH AF
BIT 4,(IY-28)
JR Z,ADEB11
CALL ABUSCO
JR ADEFB2
ADEB11 CALL ANU8BI
JR NZ,ADEFBE
ADEFB2 POP AF
POP BC
JR Z,ADEFBF
JP NC,ADEFE2
PUSH HL
LD H,B
LD L,C
LD A,E
CALL PONBYT
LD B,H
LD C,L
POP HL
POP AF
INC A
JR ADEFB1
ADEFBF POP AF
JR ADEFW0
ADEFW LD HL,(ADIOP1)
LD BC,(PUNDES)
XOR A
ADEFW1 PUSH AF
PUSH BC
CALL ALEVAL
PUSH AF
BIT 4,(IY-28)
JR Z,ADEW11
CALL ABUSCO
ADEW11 POP AF
POP BC
JR Z,ADEFWF
JP NC,ADEFE2
PUSH HL
LD H,B
LD L,C
LD A,E
CALL PONBYT
LD A,D
CALL PONBYT
LD B,H
LD C,L
POP HL
POP AF
INC A
INC A
JR ADEFW1
ADEFWF POP AF
ADEFW0 JR ADEFM2
ADEFM LD DE,(ADIOP1)
LD A,(DE)
CP 34
JP NZ,AERCOM
LD HL,(PUNDES)
LD C,0
ADEFM1 INC DE
LD A,(DE)
CP 255
JP Z,AERCOM
CP 34
JR Z,ADEFMF
CALL PONBYT
INC C
JR ADEFM1
ADEFMF LD A,C
ADEFM2 LD (BYTES),A
JR AEQU1
AEQU CALL ANUOP1
JP NC,AERNUM
AEQU0 LD (ETINUM),DE
AEQU1 JP ANXTLI
ADEFS CALL ANUOP1
JP NC,AERNUM
LD (BYTES),DE
JR AEQU1
AENT CALL ANUOP1
JP NC,AERNUM
LD (PUNDIR),DE
LD (DIRENT),DE
JR AEQU0
ALSTM SET 7,(IY-27)
JR AEQU1
ALSTN RES 7,(IY-27)
JR AEQU1
AORG CALL ANUOP1
JP NC,AERNUM
LD (PUNORG),DE
LD (PUNDES),DE
JR AEQU1
ADPRM SET 5,(IY-27)
JR AEQU1
ADPRN RES 5,(IY-27)
JR AEQU1
ABUPSE LD DE,ATAPSE
ABUPS1 CALL ACPSTR
JR NZ,ANONEM
LD L,C
LD H,0
ADD HL,HL
LD DE,ATAPS1
ADD HL,DE
LD A,(HL)
INC HL
LD H,(HL)
LD L,A
JP (HL)
ANONEM LD A,7
ANONE1 LD (ERROR),A
JP ANXTLI
AEROPE LD A,1
JR ANONE1
AERCOM LD A,4
JR ANONE1
AERDES LD A,6
JR ANONE1
APRERR LD HL,STRERR
DEC A
CALL DPRCAD
LD A,13
RST 16
RET
STRERR DEFM "Invalid operand"
DEFM "/ out of range"
DEFB 255
DEFM "Num. Syntax Err"
DEFB 255
DEFM "Undefined Symbol"
DEFB 255
DEFM "Missing Quotes"
DEFB 255
DEFM "DEFB out of range"
DEFB 255
DEFM "Range too big"
DEFB 255
DEFM "Unknown mnemonic"
DEFB 255
DEFM "Symbol exists"
DEFB 255
DINCBY LD A,(BYTES)
INC A
LD (BYTES),A
RET
DNUMOP CP 9
JR NZ,DNUMO0
DNUM00 LD A,1
RET
DNUMO0 CP 18
JR Z,DNUM00
DNUMO1 CP 12
JR NC,DNUMO2
DNUM11 LD A,7
RET
DNUMO2 CP 15
JR NC,DNUMO3
DNUM21 LD A,3
RET
DNUMO3 CP 23
JR NC,DNUM11
JR DNUM21
DDAMAS EX AF,AF'
LD A,(IX+2)
CP 203
JR NZ,DDAMA2
DDAMA1 LD A,%11111000
RET
DDAMA2 CP 237
JR Z,DDAMA6
LD A,(IX+3)
CP 192
JR NC,DDAMA6
CP 64
JR C,DDAMA6
LD A,%11111000
RET
DDAMA6 EX AF,AF'
DDAM61 PUSH AF
CALL DNUMOP
CPL
RLCA
RLCA
RLCA
EX AF,AF'
POP AF
CALL ADAMAS
JR NC,DDAM62
EX AF,AF'
RLCA
RET
DDAM62 EX AF,AF'
RET
DIN2BY LD A,(BYTES+1)
INC A
LD (BYTES+1),A
RET
DLEEOP CALL ADATIP
JR C,DLEEO1
PUSH AF
CALL DIN2BY
POP AF
CALL ASI8B
JR Z,DLEEOC
CALL DIN2BY
DLEEOC SCF
RET
DLEEO1 CALL ASOLO
RET C
CALL DDAMAS
OR A
RET
DPNOAS PUSH HL
LD (DDIRIN),HL
SET 0,(IY-17)
CALL DPRAF0
POP HL
RET
DPRASM RES 0,(IY-17)
LD (DDIRIN),HL
BIT 6,(IY-18)
JR Z,DPRAS0
PUSH HL
LD HL,(DIRDBI)
LD DE,49152
CALL CODEHL
POP HL
JR Z,DPRAS0
LD A,23
LD (NUMPAG+1),A
PUSH HL
CALL DBUDPR
POP HL
JR C,DPRAS0
PUSH DE
EX DE,HL
LD DE,16384
OR A
SBC HL,DE
POP HL
JR NC,DPRAS1
LD DE,49152
ADD HL,DE
LD A,22
JR DPRAS2
DPRAS1 LD A,16
DPRAS2 LD (NUMPAG+1),A
CALL PRLIN0
CALL ACTPAG
JR DPRASF
DPRAS0 OR A
JR DPRAF1
DPRASF LD HL,(DDIRIN)
DPRAF0 SCF
DPRAF1 PUSH AF
LD A,1
LD (BYTES),A
DEC A
LD (BYTES+1),A
LD (DPREF),A
LD (APREXY),A
RES 7,(IY-18)
CALL OLDAHL
CP 118
JP Z,DPASHT
CP 221
JR Z,DPAS0
CP 253
JR NZ,DPAS1
DPAS0 LD (APREXY),A
INC HL
CALL DINCBY
CALL OLDAHL
DPAS1 CP 237
JR Z,DPAS2
CP 203
JR NZ,DPAS3
DPAS2 LD (DPREF),A
CP 203
JR NZ,DPAS21
LD A,(APREXY)
OR A
JR Z,DPAS21
INC HL
CALL OLDAHL
LD (ADES),A
SET 7,(IY-18)
DPAS21 INC HL
CALL DINCBY
DPAS3 CALL OLDAHL
LD C,A
INC HL
CALL OLDAHL
LD E,A
INC HL
CALL OLDAHL
LD D,A
LD (AVAL1),DE
DEC HL
DEC HL
;AQUI: C=CODIGO DE INSTRUCCION
; HL=DIRECC. DE INSTRUCC.
LD DE,ATABLA
DPASBU PUSH DE
LD A,(DE)
CP 255
JP Z,DPASBF
CALL AFINBU
LD A,(DE)
LD B,A
INC DE
PUSH DE
POP IX
LD A,(DPREF)
LD E,A
DPASB1 XOR A
LD (BYTES+1),A
LD A,(IX+2)
CP E
JR NZ,DPASB0
LD A,(IX+0)
OR A
JR NZ,DPASB2
DPAB11 LD A,255
JR DCOMP
DPASB2 CALL DLEEOP
LD (AMAOP1),A
PUSH AF
LD A,(IX+1)
OR A
JR NZ,DPASB3
POP AF
JR NC,DCOMP
JR DPAB11
DPASB3 CALL DLEEOP
LD (AMAOP2),A
JR NC,DPASB4
POP AF
JR C,DPAB11
JR DCOMP
DPASB4 LD D,A
POP AF
JR C,DPASB5
LD (IY-20),%11000111
LD (IY-19),%11111000
LD A,%11000000
JR DCOMP
DPASB5 LD A,D
DCOMP AND C
CP (IX+3)
JR Z,DPASF1
DPASB0 INC IX
INC IX
INC IX
INC IX
DJNZ DPASB1
POP DE
PUSH IX
POP DE
JR DPASBU
DPASHT LD DE,DHALT
JR DPASF2
DPASF1 POP DE
JR DPRAF2
DPASBF POP DE
LD DE,DNOP
DPASF2 LD IX,DNOP2
DPRAF2 LD A,(APREXY)
OR A
JR Z,DPRA27
LD A,C
AND %11000111
CP %01000110
JR NZ,DPRA21
DPRA20 SET 7,(IY-18)
JR DPRA27
DPRA21 LD A,C
AND %11111000
CP %01110000
JR Z,DPRA20
LD A,(IX+0)
CP 10
JR NZ,DPRA27
PUSH DE
LD E,(IY-20)
CALL DDANUM
POP DE
CP 6
JR Z,DPRA20
DPRA27 BIT 0,(IY-17)
JR NZ,DPRA28
CALL OLDAHL
CP 205
JR NZ,DPRA28
POP AF
PUSH AF
EX AF,AF'
PUSH HL
PUSH DE
LD DE,DVUELV
INC HL
CALL OLDAHL
CP E
JR NZ,DPA271
INC HL
CALL OLDAHL
CP D
JR NZ,DPA271
EX AF,AF'
PUSH AF
JR NC,DPA270
DEC (IY+73)
DPA270 LD (IY+72),6
LD A,"."
RST 16
LD (IY+72),0
POP AF
JR NC,DPA271
INC (IY+73)
DPA271 POP DE
POP HL
DPRA28 POP AF
JR C,DPRAF3
PUSH BC
PUSH HL
PUSH IX
PUSH DE
LD HL,(DDIRIN)
CALL PRNU16
LD A,":"
RST 16
LD (IY+72),7
POP HL
CALL DPR255
LD (IY+72),12
POP IX
POP HL
POP BC
LD A,(IX+0)
OR A
JR Z,DPRA29
LD E,(IY-20)
CALL DPRAF4
LD A,(IX+1)
OR A
JR Z,DPRA29
PUSH AF
PUSH HL
PUSH BC
LD A,","
RST 16
POP BC
POP HL
POP AF
LD E,(IY-19)
CALL DPRAF4
DPRA29 LD A,13
RST 16
DPRAF3 LD HL,(BYTES)
LD A,(APREXY)
OR A
JR Z,DPRA31
BIT 7,(IY-18)
JR Z,DPRA31
INC L
DPRA31 LD A,L
ADD A,H
RET
DPRAF4 PUSH IX
PUSH HL
PUSH BC
CALL DPROPE
POP BC
POP HL
POP IX
RET
DPROPE PUSH BC
PUSH HL
PUSH DE
PUSH AF
LD L,A
LD H,0
ADD HL,HL
LD DE,DTAOPE-2
ADD HL,DE
LD A,(HL)
INC HL
LD H,(HL)
LD L,A
PUSH HL
POP IX
POP AF
POP DE
POP HL
POP BC
JP (IX)
D1OP LD A,(AVAL1)
JP PNUM8
D3OP CALL DDANUM
JP PNUM8
D4OP LD A,E
CPL
AND C
JP PNUM8
D5OP LD A,"("
RST 16
CALL D1OP
DPRPAC LD A,")"
RST 16
RET
D6OP LD A,"("
RST 16
CALL D7OP
JR DPRPAC
D7OP LD HL,(AVAL1)
JP PNUM16
D8OP LD A,(AVAL1)
CALL D8B16B
INC HL
INC HL
ADD HL,BC
JP PNUM16
D9OP CALL DDANUM
LD HL,ASTRIR
JP DPRCAD
D10OP CALL DDANUM
CP 6
JP Z,DPRHPA
PUSH AF
LD HL,ASTR8B
CALL DPRCAD
POP AF
CP 4
JR Z,D10OP1
CP 5
RET NZ
D10OP1 LD A,(APREXY)
OR A
RET Z
BIT 7,(IY-18)
RET NZ
CP 221
JR NZ,D10OP2
LD A,"X"
JR D10OP0
D10OP2 LD A,"Y"
D10OP0 RST 16
RET
D11OP LD A,"A"
RST 16
RET
D12OP CALL DDANUM
CP 3
JR NZ,D14OP0
D13OP LD HL,ASTRSP
JP DPR255
D14OP CALL DDANUM
D14OP0 CP 2
JR Z,DPRHL
CP 3
JR NZ,D14OP1
LD HL,ASTRAF
JP DPR255
D14OP1 LD HL,ASTR16
JP DPRCAD
D15OP LD HL,ASTRDE
JP DPR255
DPRHL LD A,(APREXY)
OR A
JR NZ,DPRHL1
LD HL,ASTRHL
JR DPRHL0
DPRHL1 CP 221
JR NZ,DPRHL2
LD HL,ASTRX
JR DPRHL0
DPRHL2 LD HL,ASTRY
DPRHL0 JP DPR255
D17OP LD HL,ASTRAF
JP DPR255
D18OP CALL DDANUM
LD HL,ASTRBC
JP DPRCAD
D19OP LD A,"("
RST 16
CALL DPRHL
JP DPRPAC
D20OP LD HL,ASTSPP
JP DPR255
D21OP LD HL,ASTC
JP DPR255
D22OP CALL DDANUM
LD HL,ASTRCO
JP DPRCAD
D24OP LD HL,ASTAFC
JP DPR255
DTAOPE DEFW D1OP,D1OP,D3OP,D4OP
DEFW D5OP,D6OP,D7OP,D8OP
DEFW D9OP,D10OP,D11OP
DEFW D12OP,D13OP,D14OP
DEFW D15OP,DPRHL,D17OP
DEFW D18OP,D19OP,D20OP
DEFW D21OP,D22OP,D22OP
DEFW D24OP
DDANUM LD A,E
CPL
AND C
DDANU1 RRC E
RET NC
RRCA
JR DDANU1
DPRCAD OR A
JP Z,DPR255
LD C,A
DPRCA1 LD A,(HL)
INC HL
CP 255
JR NZ,DPRCA1
DEC C
JR NZ,DPRCA1
JP DPR255
DPRDES BIT 7,A
JR Z,DPRDE1
NEG
PUSH AF
LD A,"-"
JR DPRDE2
DPRDE1 PUSH AF
LD A,"+"
DPRDE2 RST 16
POP AF
JP PNUM8
DPRHPA LD A,"("
RST 16
CALL DPRHL
LD A,(APREXY)
OR A
JR Z,DPRHP0
LD A,(DPREF)
CP 203
JR Z,DPRHP1
LD HL,(AVAL1)
LD A,H
LD (AVAL1),A
LD A,L
JR DPRHP2
DPRHP1 LD A,(ADES)
DPRHP2 CALL DPRDES
DPRHP0 JP DPRPAC
DREPAN CALL DPANRE
RET Z
DREPA1 CALL ILDIR
JP ACTPAG
DGUPAN CALL DPANRE
RET Z
EX DE,HL
JR DREPA1
DPANRE LD HL,49152
LD DE,16384
LD BC,6912
LD A,(FLAGS3)
RRCA
RRCA
AND 3
RET Z
CP 1
JR NZ,DPANR1
LD (FINNDX),HL
LD A,19
JR DPANR2
DPANR1 CALL BTXTUS
CP 2
RET Z
LD (DIRDBI),HL
LD A,23
DPANR2 LD (NUMPAG+1),A
OR A
RET
DREBUF LD HL,BUFDEB
LD DE,BUFORI
LD BC,203
RET
DDEBGU CALL DREBUF
EX DE,HL
LD HL,23552
LDIR
RET
DAJUR0 LD A,(DREGR)
PUSH AF
INC A
AND 127
LD C,A
POP AF
AND 128
OR C
LD (DREGR),A
RET
DAJURR LD A,R
PUSH AF
SUB C
AND 127
LD C,A
POP AF
AND 128
OR C
LD R,A
RET
DPUSRE PUSH AF
PUSH BC
PUSH DE
PUSH HL
EXX
EX AF,AF'
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IY
PUSH IX
LD C,42
CALL DAJURR
LD A,R
LD (DREGR),A
LD HL,10072
EXX
LD IY,23610
CALL DREBUF
LD HL,23552
LDIR
CALL DREBUF
LD DE,23552
LDIR
LD A,I
JP PO,DPUSR1
SET 2,(IY-17)
JR DPUSR2
DPUSR1 RES 2,(IY-17)
DPUSR2 EI
LD HL,(DRETOR)
JP (HL)
DPOPRE LD A,(DREGR)
LD R,A
LD C,34
CALL DAJURR
POP IX
POP IY
POP HL
POP DE
POP BC
POP AF
EXX
EX AF,AF'
POP HL
POP DE
POP BC
POP AF
JP DPOPR1
DVUEL1 LD SP,23552
PUSH HL
LD HL,DVUEL2
LD (DRETOR),HL
POP HL
JP DPUSRE
DVUEL2 LD HL,BUFORI+41
BIT 4,(HL)
JR Z,DVUE20
RES 4,(HL)
CALL DGUPAN
CALL CLS
CALL PRIMES
DEFM "BASIC error @"
LD A,(BUFORI+58)
CALL PRNUMA
CALL PRIMES
DEFM "#Ajust register "
DEFM " PC and SP !@"
CALL ESPTEC
JP DINI10
DVUE20 BIT 3,(IY-17)
JR Z,DVUEL3
RES 3,(IY-17)
LD DE,(DNXTPC)
CALL DPONPC
JR DVUEL4
DVUEL3 CALL DNOBRK
DVUEL4 JP DINIC1
DNOBRK LD HL,(DREGSP)
CALL OLDAHL
LD E,A
INC HL
CALL OLDAHL
LD D,A
DEC DE
DEC DE
DEC DE
LD (DMEMO),DE
LD A,D
CALL OLDHLA
DEC HL
LD A,E
CALL OLDHLA
LD HL,DBYBRK
LD BC,3
LD A,20
EX AF,AF'
LD A,17
JP SLDIR
DPR255 LD A,(HL)
INC HL
CP 255
RET Z
CP "#"
JR NZ,DPR25_
LD A,13
DPR25_ PUSH HL
RST 16
POP HL
JR DPR255
DPR2ES LD A,32
RST 16
DPR2E1 LD A,32
RST 16
RET
DPRSPP LD A,":"
RST 16
JR DPR2E1
DPRMEM PUSH HL
CALL PRNU16
CALL DPRSPP
POP HL
PUSH HL
LD B,6
DPRME1 CALL OLDAHL
PUSH HL
PUSH BC
CALL PRHEX8
POP BC
PUSH BC
BIT 5,(IY-18)
JR Z,DPRM11
LD A,B
CP 1
JR Z,DPRM11
LD A,32
RST 16
DPRM11 POP BC
POP HL
INC HL
DJNZ DPRME1
CALL DPR2ES
POP HL
LD B,6
DPRME2 CALL OLDAHL
PUSH BC
PUSH HL
CALL DPRASC
POP HL
POP BC
INC HL
DJNZ DPRME2
BIT 5,(IY-18)
RET NZ
LD A,13
RST 16
RET
DPRASC RES 7,A
CP 32
JR NC,DPRAC1
LD A,"."
DPRAC1 RST 16
RET
DPONPC LD HL,(DREGSP)
LD A,E
CALL OLDHLA
INC HL
LD A,D
JP OLDHLA
DDARPC LD HL,(DREGSP)
CALL OLDAHL
LD E,A
INC HL
CALL OLDAHL
LD D,A
RET
DBUDPR PUSH HL
POP IX
LD HL,(DIRDBI)
LD DE,49152
OR A
SBC HL,DE
EX DE,HL
SRL D
RR E
SRL D
RR E
DEC DE
LD BC,0
DBUDP1 LD H,D
LD L,E
PUSH HL
OR A
SBC HL,BC
POP HL
RET C
ADD HL,BC
SRL H
RR L
PUSH HL
PUSH BC
CALL DBUDRE
POP BC
JR Z,DBUDSI
POP HL
JR C,DBUDP2
LD B,H
LD C,L
INC BC
LD A,B
OR C
JR Z,DBUDER
JR DBUDP1
DBUDP2 LD D,H
LD E,L
LD A,D
OR E
JR Z,DBUDER
DEC DE
JR DBUDP1
DBUDSI POP DE
CALL ILDAHL
LD E,A
INC HL
CALL ILDAHL
LD D,A
OR A
RET
DBUDER SCF
RET
DBUDRE ADD HL,HL
ADD HL,HL
LD BC,49152
ADD HL,BC
CALL ILDAHL
LD C,A
INC HL
CALL ILDAHL
LD B,A
INC HL
PUSH HL
PUSH IX
POP HL
OR A
SBC HL,BC
POP HL
RET
DPRREG PUSH AF
LD A,32
RST 16
POP AF
PUSH AF
ADD A,A
LD E,A
LD D,0
LD HL,DTAREG
ADD HL,DE
LD A,(HL)
INC HL
LD H,(HL)
LD L,A
CALL DPR255
POP AF
CP 3
JR C,DPRRE1
CP 7
JR NC,DPRRE1
LD A,"'"
RST 16
RET
DPRRE1 LD A,32
RST 16
RET
DPRAF PUSH HL
CALL PRHE16
CALL DPR2ES
POP BC
LD HL,DTAFLG
LD B,8
DPRFL1 RLC C
JR NC,DPRFL2
LD A,(HL)
JR DPRFL3
DPRFL2 LD A,32
DPRFL3 PUSH BC
PUSH HL
RST 16
POP HL
POP BC
INC HL
DJNZ DPRFL1
LD A,13
RST 16
RET
DTAFLG DEFM "SZxHxVNC"
DINICI LD SP,23552
LD A,(IY-18)
AND %11110011
LD (IY-18),A
RES 3,(IY-17)
LD HL,65534
LD (DREGSP),HL
LD DE,(PUNORG)
LD (DMEMO),DE
CALL DPONPC
CALL DDEBGU
CALL 3435
LD HL,DINIC1
LD (DRETOR),HL
JP DPUSRE
DINIC1 CALL DGUPAN
DINI10 CALL CLS
SET 3,(IY+48)
RES 5,(IY-18)
LD HL,DSTRME
CALL DPR255
LD HL,(DMEMO)
PUSH HL
CALL DPRMEM
POP HL
PUSH HL
CALL DPRASM
LD (DLONG),A
LD B,3
DINIC2 POP HL
LD E,A
LD D,0
ADD HL,DE
PUSH HL
PUSH BC
CALL DPRASM
POP BC
DJNZ DINIC2
POP HL
LD A,13
RST 16
LD A,10
CALL DPRREG
LD HL,(23550)
CALL DPRAF
LD A,32
RST 16
LD HL,ASTRSP
CALL DPR255
LD A,32
RST 16
LD HL,(DREGSP)
INC HL
INC HL
PUSH HL
CALL PRNU16
CALL DPRSPP
POP HL
LD B,3
DINI21 PUSH BC
PUSH HL
CALL DDARE1
CALL PRNU16
CALL DPR2ES
POP HL
INC HL
INC HL
POP BC
DJNZ DINI21
CALL DPNXPC
CALL PRIMES
DEFM " PC @"
CALL DDARPC
EX DE,HL
LD (PUNDIR),HL
PUSH HL
CALL PRNU16
CALL PRIMES
DEFM "->@"
LD HL,(DNXTPC)
CALL PRNU16
LD A,13
RST 16
POP HL
CALL DPRASM
LD A,13
RST 16
LD B,9
LD A,1
LD HL,23552-20
DINIC3 PUSH BC
PUSH AF
PUSH HL
CALL DPRREG
POP HL
LD E,(HL)
INC HL
LD D,(HL)
INC HL
POP AF
CP 6
PUSH AF
PUSH HL
EX DE,HL
JR NZ,DINIC4
CALL DPRAF
JR DINIC5
DINIC4 CALL DPRMEM
DINIC5 POP HL
POP AF
POP BC
INC A
DJNZ DINIC3
LD A,13
RST 16
LD A,32
RST 16
CALL PRSPED
LD (IY+72),11
CALL PRIMES
DEFM "I=@"
LD A,"0"
BIT 2,(IY-17)
JR Z,DINIC6
INC A
DINIC6 RST 16
CALL PRIMES
DEFM " P->@"
LD A,(IY-18)
RRCA
RRCA
CPL
AND 3
CP 3
JR Z,DINIC7
ADD A,22
DINIC7 ADD A,45
RST 16
CALL PRIMES
DEFM " VD=@"
LD A,"0"
BIT 6,(IY-18)
JR Z,DINIC8
INC A
DINIC8 RST 16
CALL PRIMES
DEFM " R @"
LD A,(DREGR)
CALL PRHE8S
DEDIT CALL PRIMES
DEFB 22,22,0
DEFM ">@"
DEDIT1 LD HL,(23682)
LD (CX),HL
CALL PONCUR
DEDIT2 LD (IY-50),0
DEDIT3 LD A,(23560)
OR A
JR Z,DEDIT3
CALL BORCUR
PUSH AF
CALL DPRASC
POP AF
LD C,A
LD HL,DTATEC
DBUSTE LD A,(HL)
INC HL
CP 255
JR Z,DMENER
CP C
JR Z,DBUST1
INC HL
INC HL
JR DBUSTE
DMENER CALL MENER0
CALL ESPTEC
JP DINI10
DBUST1 LD A,(HL)
INC HL
LD H,(HL)
LD L,A
CALL MEJPHL
JP DINI10
DFIN CALL CLS
JP MENU
DHEXA LD A,(FLAGS3)
XOR 16
LD (FLAGS3),A
RET
DCO13 LD HL,(DMEMO)
INC HL
DCO13_ LD (DMEMO),HL
RET
DCO7 LD HL,(DMEMO)
DEC HL
JR DCO13_
DCO8 LD HL,(DMEMO)
LD DE,8
DCO8_ OR A
SBC HL,DE
JR DCO13_
DCO9 LD HL,(DMEMO)
LD DE,8
DCO9_ ADD HL,DE
JR DCO13_
DCO10 LD HL,(DMEMO)
LD DE,(DLONG)
LD D,0
JR DCO9_
DCOMEM CALL DCALC
JR DCO13_
DCOCAL CALL DCALC
CALL CALCU1
JP ESPTEC
DCOINS LD A,":"
RST 16
LD A,13
RST 16
LD HL,(DMEMO)
DCOIN1 PUSH HL
CALL PRNU16
CALL DPRSPP
CALL EDIVA0
LD HL,BUFEDI
CALL VAL
POP HL
LD A,(BUFEDI)
CP 32
RET Z
LD A,E
CALL OLDHLA
INC HL
JR DCOIN1
DCOLIS CALL CLS
LD HL,(DMEMO)
SET 5,(IY-18)
DCOLI1 LD B,16
DCOLI2 PUSH HL
PUSH BC
CALL DPRMEM
POP BC
POP HL
LD DE,6
ADD HL,DE
DJNZ DCOLI2
CALL ESPTEC
CP 199
RET Z
JR DCOLI1
DCOASM CALL CLS
LD HL,(DMEMO)
DCOAS1 LD B,16
DCOAS2 PUSH HL
PUSH BC
CALL DPRASM
POP BC
POP HL
LD E,A
LD D,0
ADD HL,DE
DJNZ DCOAS2
CALL ESPTEC
CP 199
RET Z
JR DCOAS1
DCOMAS RES 3,(IY-17)
DCOMA0 POP BC
BIT 2,(IY-17)
JR NZ,DCOMA1
DI
DCOMA1 CALL DREPAN
CALL DDEBGU
CALL DREBUF
EX DE,HL
LD DE,23552
LDIR
JP DPOPRE
DCOCOM LD DE,(DMEMO)
JP DPONPC
DCOBRK LD HL,(DMEMO)
DCOBR1 LD DE,DBYBRK
LD BC,3
LD A,17
EX AF,AF'
LD A,20
PUSH HL
CALL SLDIR
POP HL
DCOBR2 PUSH HL
LD DE,23296
OR A
SBC HL,DE
POP HL
JR NC,DCOBR3
CALL PRIMES
DEFM "#Invalid "
DEFM " Breakpoint!@"
CALL ESPTEC
SCF
RET
DCOBR3 LD DE,DVUELV
LD A,205
CALL OLDHLA
INC HL
LD A,E
CALL OLDHLA
INC HL
LD A,D
CALL OLDHLA
OR A
RET
DCALC LD A,":"
RST 16
CALL EDIVA0
LD HL,BUFEDI
CALL VAL
EX DE,HL
RET
DCOSHD LD A,(IY-18)
XOR %01000000
LD (IY-18),A
RET
DCOPAN CALL DREPAN
JP ESPTEC
DCOSHS CALL DCALC
LD A,L
AND 3
CP 3
RET Z
RLCA
RLCA
LD L,A
LD A,(IY-18)
AND %11110011
OR L
LD (IY-18),A
RET
DCOSHT CALL DDARPC
EX DE,HL
CALL DPNOAS
LD E,A
LD D,0
ADD HL,DE
CALL DCOBR1
RET C
JP DCOMAS
DCO11 LD HL,(DMEMO)
PUSH HL
LD DE,10
OR A
SBC HL,DE
DCO110 CALL DPNOAS
LD E,A
LD D,0
ADD HL,DE
POP DE
PUSH DE
PUSH HL
OR A
SBC HL,DE
POP HL
JR C,DCO110
POP BC
LD E,A
LD D,0
JP DCO8_
DCOREG LD A,":"
RST 16
CALL EDIVA0
LD HL,BUFEDI
INC HL
INC HL
LD A,(HL)
CP "'"
PUSH AF
LD (HL),255
JR NZ,DCORE1
INC HL
DCORE1 INC HL
CALL VAL
PUSH DE
LD HL,DTAREG
LD B,7
DCORE2 LD E,(HL)
INC HL
LD D,(HL)
INC HL
PUSH HL
EX DE,HL
LD DE,BUFEDI
CALL ACOMP
POP HL
JR Z,DCORE3
DJNZ DCORE2
CALL DCORNO
POP DE
POP AF
RET
DCORE3 POP DE
POP AF
LD A,B
JR NZ,DCORE4
CP 5
JR NC,DCORNO
DCOR31 LD HL,23550-20
JR DCORE0
DCORE4 CP 7
JR NZ,DCORE5
JP DPONPC
DCORE5 CP 5
JR NC,DCOR31
LD HL,23550-12
DCORE0 LD A,7
SUB B
ADD A,A
LD C,A
LD B,0
ADD HL,BC
LD (HL),E
INC HL
LD (HL),D
RET
DCORNO CALL PRIMES
DEFM "Register not"
DEFM " found!@"
JP ESPTEC
DCOENS CALL DCOENP
LD HL,(PUNDES)
PUSH HL
LD HL,(DMEMO)
LD (PUNDES),HL
LD (PUNDIR),HL
DCOEN1 LD HL,(PUNDES)
CALL PRNU16
CALL DCOENP
CALL EDIVAC
LD HL,BUFEDI
LD A,(HL)
CP 32
JR Z,DCOENF
PUSH HL
LD A,32
LD BC,30
CPIR
DEC HL
LD (HL),255
LD HL,BUFEDI+30
DCOEN2 LD A,(HL)
CP 255
JR Z,DCOEN4
CP 32
JR NZ,DCOEN3
DEC HL
JR DCOEN2
DCOEN3 INC HL
DCOEN4 LD (HL),13
INC HL
LD (HL),255
LD HL,ABUF
LD (HL),255
INC HL
EX DE,HL
POP HL
LD BC,30
LDIR
SET 7,(IY-28)
RES 7,(IY-27)
SET 1,(IY-17)
CALL ABUC
RES 1,(IY-17)
JR DCOEN1
DCOENF POP HL
LD (PUNDES),HL
RET
DCOENP LD A,":"
RST 16
LD A,13
RST 16
RET
DDARET LD HL,(DREGSP)
INC HL
INC HL
DDARE1 CALL OLDAHL
LD E,A
INC HL
CALL OLDAHL
LD H,A
LD L,E
RET
DPNXPC RES 3,(IY-17)
XOR A
LD (DTIPIN),A
CALL DDARPC
EX DE,HL
PUSH HL
CALL DPNOAS
LD E,A
LD D,0
ADD HL,DE
LD (DNXTPC),HL
POP HL
CALL OLDAHL
INC HL
CP 195
JR NZ,DPNXP1
DPNXP0 CALL DDARE1
DPNFIN LD (DNXTPC),HL
RET
DPNX00 LD A,1
LD (DTIPIN),A
JR DPNXP0
DPNXP1 CP 205
JR Z,DPNX00
CP 24
JR NZ,DPNXP2
DPNX10 CALL DDADIR
JR DPNFIN
DPNXP2 CP 201
JR NZ,DPNX21
DPNX20 CALL DDARET
LD A,3
DPN200 LD (DTIPIN),A
JR DPNFIN
DPNX21 LD B,A
AND %11100111
CP 32
JR NZ,DPNXP3
LD A,B
AND %00011000
CALL DDACOR
JR Z,DPNX10
DPNX22 INC HL
JR DPNFIN
DPNXP3 LD A,B
AND %11000111
CP 194
JR NZ,DPNXP4
LD A,B
AND %00111000
CALL DDACOR
JR Z,DPNXP0
DPNX30 INC HL
JR DPNX22
DPNXP4 CP 196
JR NZ,DPNXP5
LD A,B
AND %00111000
CALL DDACOR
JR Z,DPNX00
JR DPNX30
DPNXP5 CP 199
JR NZ,DPNX50
LD A,B
AND %00111000
LD L,A
LD H,0
LD A,2
JR DPN200
DPNX50 CP 192
JR NZ,DPNXP6
LD A,B
AND %00111000
CALL DDACOR
JR Z,DPNX20
JR DPNFIN
DPNXP6 LD A,B
CP 16
JR NZ,DPNX60
PUSH HL
LD HL,23549
LD A,(HL)
POP HL
CP 1
JR Z,DPNX22
JR DPNX10
DPNX60 CP 233
JR NZ,DPNXP7
LD HL,23544
JP DPNXP0
DPNXP7 CP 221
JR NZ,DPNXP8
CALL OLDAHL
CP 233
JR NZ,DPNXP9
LD HL,23532
JP DPNXP0
DPNXP8 CP 253
JR NZ,DPNXP9
CALL OLDAHL
CP 233
JR NZ,DPNXP9
LD HL,23534
JP DPNXP0
DPNXP9 CP 237
JR NZ,DPNXSI
CALL OLDAHL
AND %11000111
CP 69
JR NZ,DPNXSI
INC HL
JP DPNX20
DPNXSI SET 3,(IY-17)
RET
DCOPAS BIT 3,(IY-17)
JR NZ,DCOPSI
CALL DAJUR0
CALL DDARPC
EX DE,HL
CALL OLDAHL
CP 237
JR Z,DCOPA1
CP 221
JR Z,DCOPA1
CP 253
JR NZ,DCOPA2
DCOPA1 CALL DAJUR0
DCOPFI LD DE,(DNXTPC)
LD (DMEMO),DE
JP DPONPC
DCOPA2 CP 16
JR NZ,DCOPA3
LD HL,23549
DEC (HL)
JR DCOPFI
DCOPA3 LD A,(DTIPIN)
OR A
JR Z,DCOPFI
CP 3
JR Z,DCOPA4
CP 2
JR Z,DCOP30
INC HL
INC HL
DCOP30 INC HL
CALL DICALL
JR DCOPFI
DCOPA4 LD HL,(DREGSP)
INC HL
INC HL
LD (DREGSP),HL
JR DCOPFI
DCOPSI CALL DDARPC
PUSH DE
LD HL,(DNXTPC)
LD (DMEMO),HL
OR A
SBC HL,DE
LD B,H
LD C,L
LD DE,DBYSAL
CALL DPONPC
POP HL
LD A,17
EX AF,AF'
LD A,20
CALL SLDIR
EX DE,HL
CALL DCOBR2
JP DCOMA0
DICALL EX DE,HL
LD HL,(DREGSP)
PUSH HL
LD A,E
CALL OLDHLA
INC HL
LD A,D
CALL OLDHLA
POP HL
DEC HL
DEC HL
LD (DREGSP),HL
RET
DDADIR CALL OLDAHL
INC HL
CALL D8B16B
ADD HL,BC
RET
D8B16B LD C,A
LD B,0
CP 128
RET C
LD B,255
RET
HLPDES LD A,2
HELP PUSH AF
CALL CLS
CALL PRIMES
DEFM "HELP ON@"
POP AF
LD HL,STRHLP
CALL DPRCAD
CALL ESPTEC
JP CLS
DDACOR RRCA
RRCA
RRCA
DDACON LD C,A
SRL A
LD E,A
LD D,0
PUSH HL
LD HL,DTACON
ADD HL,DE
LD B,(HL)
LD HL,23550
CALL OLDAHL
POP HL
RLCA
DDACO1 RRCA
DJNZ DDACO1
AND 1
LD B,A
LD A,C
AND 1
XOR B
RET
DTACON DEFB 7,1,3,8
DTAREG DEFW DSTRPC,ASTRX
DEFW ASTRY,ASTRHL
DEFW ASTRDE,ASTR16
DEFW ASTRAF,ASTRHL
DEFW ASTRDE,ASTR16
DEFW ASTRAF
DTATEC DEFB 199
DEFW DFIN
DEFB 35
DEFW DHEXA
DEFB 13
DEFW DCO13
DEFB 7
DEFW DCO7
DEFB 8
DEFW DCO8
DEFB 9
DEFW DCO9
DEFB 10
DEFW DCO10
DEFB 11
DEFW DCO11
DEFB "$"
DEFW DCOASM
DEFB "+"
DEFW DCOMAS
DEFB ":"
DEFW DCOPAS
DEFB ","
DEFW DCOCOM
DEFB "C"
DEFW DCOCAL
DEFB "E"
DEFW DCOENS
DEFB "H"
DEFW HLPDES
DEFB "I"
DEFW DCOINS
DEFB "L"
DEFW DCOLIS
DEFB "M"
DEFW DCOMEM
DEFB "R"
DEFW DCOREG
DEFB "S"
DEFW DCOPAN
DEFB "W"
DEFW DCOBRK
DEFB ">"
DEFW DCOSHT
DEFB 195
DEFW DCOSHS
DEFB 205
DEFW DCOSHD
DEFB 255
ASTR8B DEFB "B",255,"C",255
DEFB "D",255,"E",255
ASTRH DEFB "H",255,"L",255
ASTRH2 DEFM "(HL)"
DEFB 255,"A",255,0
ASTR16 DEFB "B","C",255
ASTRDE DEFB "D","E",255
ASTRHL DEFB "H","L",255,0
ASTRAF DEFB "A","F",255
ASTRSP DEFB "S","P",255
ASTRCO DEFB "N","Z",255,"Z",255
DEFB "N","C",255,"C",255
DEFB "P","O",255,"P","E"
DEFB 255,"P",255,"M",255
DEFB 0
ASTRBC DEFM "(BC)"
DEFB 255
DEFM "(DE)"
DEFB 255,0
ASTRIR DEFB "I",255,"R",255,0
ASTRX DEFB "I","X",255,"H","X"
DEFB 255,"L","X",255,0
ASTRY DEFB "I","Y",255,"H","Y"
DEFB 255,"L","Y",255,0
DSTRPC DEFB "P","C",255
DSTRME DEFB 32,"M","E"," ",255
ATASOL DEFB 4,1,64,1,128,1
DEFB 4,2,8,2,16,2,128,2
ATASO2 DEFB "A",255,"D","E",255
DEFB "H","L",255
DEFM "(HL)"
DEFB 255
ASTSPP DEFM "(SP)"
DEFB 255
ASTC DEFB "(","C",")",255
ASTAFC DEFB "A","F","'",255,0
DNOP DEFM "NOP*"
DEFB 255
DNOP2 DEFB 0
DHALT DEFM "HALT"
DEFB 255
ATAPSE DEFM "EQU"
DEFB 255
DEFM "DEFS"
DEFB 255
ASTRDM DEFM "DEFM"
DEFB 255
DEFM "DEFW"
DEFB 255
DEFM "DEFB"
DEFB 255
DEFM "ENT"
DEFB 255
DEFM "LST+"
DEFB 255
DEFM "LST-"
DEFB 255
DEFM "ORG"
DEFB 255
DEFM "DPR+"
DEFB 255
DEFM "DPR-"
DEFB 255,0
ATAPS1 DEFW AEQU,ADEFS,ADEFM
DEFW ADEFW,ADEFB,AENT
DEFW ALSTM,ALSTN,AORG
DEFW ADPRM,ADPRN
ATABLA DEFM "LD"
DEFB 255,14
DEFB 10,10,0,64
DEFB 12,7,0,1
DEFB 10,1,0,6
DEFB 16,6,0,42
DEFB 6,16,0,34
DEFB 11,18,0,10
DEFB 18,11,0,2
DEFB 11,6,0,58
DEFB 6,11,0,50
DEFB 12,6,237,75
DEFB 6,12,237,67
DEFB 11,9,237,87
DEFB 9,11,237,71
DEFB 13,16,0,249
DEFM "INC"
DEFB 255,2
DEFB 10,0,0,4
DEFB 12,0,0,3
DEFM "DEC"
DEFB 255,2
DEFB 10,0,0,5
DEFB 12,0,0,11
DEFM "JR"
DEFB 255,2
DEFB 8,0,0,24
DEFB 22,8,0,32
DEFM "DJNZ"
DEFB 255,1
DEFB 8,0,0,16
DEFM "JP"
DEFB 255,3
DEFB 7,0,0,195
DEFB 23,7,0,194
DEFB 19,0,0,233
DEFM "CALL"
DEFB 255,2
DEFB 7,0,0,205
DEFB 23,7,0,196
DEFM "RET"
DEFB 255,2
DEFB 0,0,0,201
DEFB 23,0,0,192
DEFM "PUSH"
DEFB 255,1
DEFB 14,0,0,197
DEFM "POP"
DEFB 255,1
DEFB 14,0,0,193
DEFM "RST"
DEFB 255,1
DEFB 4,0,0,199
DEFM "ADD"
DEFB 255,3
DEFB 11,10,0,128
DEFB 11,1,0,198
DEFB 16,12,0,9
DEFM "ADC"
DEFB 255,3
DEFB 11,10,0,136
DEFB 11,1,0,206
DEFB 16,12,237,74
DEFM "SUB"
DEFB 255,2
DEFB 10,0,0,144
DEFB 1,0,0,214
DEFM "SBC"
DEFB 255,3
DEFB 11,10,0,152
DEFB 11,1,0,222
DEFB 16,12,237,66
DEFM "CP"
DEFB 255,2
DEFB 10,0,0,184
DEFB 1,0,0,254
DEFM "AND"
DEFB 255,2
DEFB 10,0,0,160
DEFB 1,0,0,230
DEFM "XOR"
DEFB 255,2
DEFB 10,0,0,168
DEFB 1,0,0,238
DEFM "OR"
DEFB 255,2
DEFB 10,0,0,176
DEFB 1,0,0,246
DEFM "RLCA"
DEFB 255,1
DEFB 0,0,0,7
DEFM "RRCA"
DEFB 255,1
DEFB 0,0,0,15
DEFM "RLA"
DEFB 255,1
DEFB 0,0,0,23
DEFM "RRA"
DEFB 255,1
DEFB 0,0,0,31
DEFM "SCF"
DEFB 255,1
DEFB 0,0,0,55
DEFM "CCF"
DEFB 255,1
DEFB 0,0,0,63
DEFM "RLC"
DEFB 255,1
DEFB 10,0,203,0
DEFM "RRC"
DEFB 255,1
DEFB 10,0,203,8
DEFM "RL"
DEFB 255,1
DEFB 10,0,203,16
DEFM "RR"
DEFB 255,1
DEFB 10,0,203,24
DEFM "SLA"
DEFB 255,1
DEFB 10,0,203,32
DEFM "SRA"
DEFB 255,1
DEFB 10,0,203,40
DEFM "SRL"
DEFB 255,1
DEFB 10,0,203,56
DEFM "BIT"
DEFB 255,1
DEFB 3,10,203,64
DEFM "RES"
DEFB 255,1
DEFB 3,10,203,128
DEFM "SET"
DEFB 255,1
DEFB 3,10,203,192
DEFM "LDIR"
DEFB 255,1
DEFB 0,0,237,176
DEFM "LDDR"
DEFB 255,1
DEFB 0,0,237,184
DEFM "LDI"
DEFB 255,1
DEFB 0,0,237,160
DEFM "LDD"
DEFB 255,1
DEFB 0,0,237,168
DEFM "CPIR"
DEFB 255,1
DEFB 0,0,237,177
DEFM "CPDR"
DEFB 255,1
DEFB 0,0,237,185
DEFM "CPI"
DEFB 255,1
DEFB 0,0,237,161
DEFM "CPD"
DEFB 255,1
DEFB 0,0,237,169
DEFM "EXX"
DEFB 255,1
DEFB 0,0,0,217
DEFM "EX"
DEFB 255,3
DEFB 17,24,0,8
DEFB 15,16,0,235
DEFB 20,16,0,227
DEFM "IN"
DEFB 255,2
DEFB 11,5,0,219
DEFB 10,21,237,64
DEFM "OUT"
DEFB 255,2
DEFB 5,11,0,211
DEFB 21,10,237,65
DEFM "INI"
DEFB 255,1
DEFB 0,0,237,162
DEFM "OUTI"
DEFB 255,1
DEFB 0,0,237,163
DEFM "IND"
DEFB 255,1
DEFB 0,0,237,170
DEFM "OUTD"
DEFB 255,1
DEFB 0,0,237,171
DEFM "INIR"
DEFB 255,1
DEFB 0,0,237,178
DEFM "OTIR"
DEFB 255,1
DEFB 0,0,237,179
DEFM "INDR"
DEFB 255,1
DEFB 0,0,237,186
DEFM "OTDR"
DEFB 255,1
DEFB 0,0,237,187
DEFM "RRD"
DEFB 255,1
DEFB 0,0,237,103
DEFM "RLD"
DEFB 255,1
DEFB 0,0,237,111
DEFM "IM0"
DEFB 255,1
DEFB 0,0,237,70
DEFM "IM1"
DEFB 255,1
DEFB 0,0,237,86
DEFM "IM2"
DEFB 255,1
DEFB 0,0,237,94
DEFM "DAA"
DEFB 255,1
DEFB 0,0,0,39
DEFM "CPL"
DEFB 255,1
DEFB 0,0,0,47
DEFM "NEG"
DEFB 255,1
DEFB 0,0,237,68
DEFM "EI"
DEFB 255,1
DEFB 0,0,0,251
DEFM "DI"
DEFB 255,1
DEFB 0,0,0,243
DEFM "HALT"
DEFB 255,1
DEFB 0,0,0,118
DEFM "RETN"
DEFB 255,1
DEFB 0,0,237,69
DEFM "RETI"
DEFB 255,1
DEFB 0,0,237,77
DEFM "RETE"
DEFB 255,1
DEFB 0,0,237,85
DEFM "SLL"
DEFB 255,1
DEFB 10,0,203,48
DEFM "NOP"
DEFB 255,1
DEFB 0,0,0,0
DEFB 255
EJECUT CALL COPPAG
LD HL,INICI0
PUSH HL
LD HL,EJEINI
LD D,H
LD E,L
LD BC,16384
LD A,17
EX AF,AF'
LD A,20
LD (PAGNOR+1),A
CALL SLDIR
LD A,17
LD (PAGNOR+1),A
JP ILDAHL
STRHLP DEFM " COMMAND LINE OPT"
DEFM "S#####"
DEFM " A Assemble# B Go"
DEFM "to Basic# C Calcu"
DEFM "late Expression#"
DEFM " D Go to Monitor/"
DEFM "Disassembler#"
DEFM " E Go to Editor#"
DEFM " F Modify Date#"
DEFM " G n Set Tex"
DEFM "t Block in use# I"
DEFM " General Informac"
DEFM "ion# L Load Sourc"
DEFM "e Code# N New blo"
DEFM "ck of Text#"
DEFM " O Save Object Co"
DEFM "de# S Save Source"
DEFM " Code# "
DEFM "T Show Symbol Tab"
DEFM "le# Z DELETE"
DEFM " Source Code!!!"
DEFB 255
DEFM " EDITOR#EXTENDED "
DEFM "mode:# A Page Dow"
DEFM "n# B Delete Block"
DEFM "# C Copy Block"
DEFM "# D Symbol Search"
DEFM "# E - from start#"
DEFM " F Search Text# G"
DEFM " - from start#"
DEFM " I Insert Mode on"
DEFM "/off# J Next Symb"
DEFM "ol# K Calculate E"
DEFM "xpression# L Goto"
DEFM " Line# "
DEFM "N Find Next Text#"
DEFM " P Mark Block Sta"
DEFM "rt# Q PAge up# U "
DEFM "End of Block# V "
DEFM "Paste Block# X C"
DEFM "ut Block# Z R"
DEFM "estore Line#Norma"
DEFM "l mode:# SS+D Del"
DEFM "ete Line# SS+I In"
DEFM "sert line# SS+Q "
DEFM "Exit Editor "
DEFB 255
DEFM " MONITOR/DISSASM#"
DEFM "# C Calculate Exp"
DEFM "ression# $ Disass"
DEFM "emble#SS+D Read "
DEFM "debug data yes/no"
DEFM "# E Assemble i"
DEFM "nstruction# I Ins"
DEFM "ert bytes#SS+K Ex"
DEFM "ecute# L"
DEFM " List in Hex and "
DEFM "ASCII# M Change M"
DEFM "emory Pointer#SS+"
DEFM "N Set PC with ME#"
DEFM "SS+Q Exit to Comm"
DEFM "and# R Modify Re"
DEFM "gister (RR=XXXX)#"
DEFM " S Show Screen#SS"
DEFM "+S Configure "
DEFM "screen#(0"
DEFM "0:None 1:Symbol "
DEFM "2:Debug)#SS+T Bre"
DEFM "akpoint after ins"
DEFM "truc.# W Set B"
DEFM "reakpoint#SS+Z Si"
DEFM "ngle Step#SS+3 Nu"
DEFM "mbers Hex/Decimal"
DEFM "##EDIT/ENTER ME"
DEFM "-+1 Byte#Cursor L"
DEFM "eft/Right ME-+8 B"
DEFM "ytes#Cursor Up/Do"
DEFM "wn. ME-+1 Instruc"
DEFM "."
DEFB 255
|
test/interaction/Issue1020.agda | shlevy/agda | 1,989 | 2698 | <filename>test/interaction/Issue1020.agda
-- Andreas, 2014-01-10, reported by fredrik.forsberg
record ⊤ : Set where
record Σ (A : Set) (B : A → Set) : Set where
syntax Σ A (λ x → B) = Σ[ x ∈ A ] B
test : Set
test = {! Σ[ x ∈ ⊤ ] ?!}
-- Fredrik's report:
-- Using the darcs version of Agda from today 10 January,
-- if I load the file and give (or refine) in the hole, I end up with
--
-- test = Σ ⊤ (λ x → {!!})
--
-- i.e. Agda has translated away the syntax Σ[ x ∈ ⊤ ] {!!} for me.
-- I would of course expect
--
-- test = Σ[ x ∈ ⊤ ] {!!}
--
-- instead, and I think this used to be the behaviour? (Using the Σ from
-- the standard library, this is more annoying, as one gets
--
-- test = Σ-syntax ⊤ (λ x → {!!})
--
-- as a result.)
--
-- This might be related to issue 994?
-- Expected test case behavior:
--
-- Bad (at the time of report:
--
-- (agda2-give-action 0 "Σ ⊤ (λ x → ?)")
--
-- Good:
--
-- (agda2-give-action 0 'no-paren)
|
programs/oeis/131/A131735.asm | karttu/loda | 1 | 15928 | ; A131735: Hexaperiodic 0, 0, 1, 1, 1, 1.
; 0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1
mov $1,$0
div $1,2
pow $1,2
mod $1,3
|
libtool/src/gmp-6.1.2/mpn/sparc64/gcd_1.asm | kroggen/aergo | 278 | 165480 | dnl SPARC64 mpn_gcd_1.
dnl Based on the K7 gcd_1.asm, by <NAME>. Rehacked for SPARC by Torbjörn
dnl Granlund.
dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/bit (approx)
C UltraSPARC 1&2: 5.1
C UltraSPARC 3: 5.0
C UltraSPARC T1: 11.4
C UltraSPARC T3: 10
C UltraSPARC T4: 6
C Numbers measured with: speed -CD -s32-64 -t32 mpn_gcd_1
C ctz_table[n] is the number of trailing zeros on n, or MAXSHIFT if n==0.
deflit(MAXSHIFT, 7)
deflit(MASK, eval((m4_lshift(1,MAXSHIFT))-1))
RODATA
TYPE(ctz_table,object)
ctz_table:
.byte MAXSHIFT
forloop(i,1,MASK,
` .byte m4_count_trailing_zeros(i)
')
SIZE(ctz_table,.-ctz_table)
C Threshold of when to call bmod when U is one limb. Should be about
C (time_in_cycles(bmod_1,1) + call_overhead) / (cycles/bit).
define(`BMOD_THRES_LOG2', 14)
C INPUT PARAMETERS
define(`up', `%i0')
define(`n', `%i1')
define(`v0', `%i2')
ASM_START()
REGISTER(%g2,#scratch)
REGISTER(%g3,#scratch)
PROLOGUE(mpn_gcd_1)
save %sp, -192, %sp
ldx [up+0], %g1 C U low limb
mov -1, %i4
or v0, %g1, %g2 C x | y
L(twos):
inc %i4
andcc %g2, 1, %g0
bz,a %xcc, L(twos)
srlx %g2, 1, %g2
L(divide_strip_y):
andcc v0, 1, %g0
bz,a %xcc, L(divide_strip_y)
srlx v0, 1, v0
cmp n, 1 C if n > 1 we need
bnz %xcc, L(bmod) C to call bmod_1
nop
C Both U and V are single limbs, reduce with bmod if u0 >> v0.
srlx %g1, BMOD_THRES_LOG2, %g2
cmp %g2, v0
bleu %xcc, L(noreduce)
mov %g1, %o0
L(bmod):
mov up, %o0
mov n, %o1
mov v0, %o2
call mpn_modexact_1c_odd
mov 0, %o3
L(noreduce):
LEA64(ctz_table, i5, g4)
cmp %o0, 0
bnz %xcc, L(mid)
and %o0, MASK, %g3 C
return %i7+8
sllx %o2, %o4, %o0 C CAUTION: v0 alias for o2
ALIGN(16)
L(top): movcc %xcc, %l4, v0 C v = min(u,v)
movcc %xcc, %l2, %o0 C u = |v - u]
L(mid): ldub [%i5+%g3], %g5 C
brz,a,pn %g3, L(shift_alot) C
srlx %o0, MAXSHIFT, %o0
srlx %o0, %g5, %l4 C new u, odd
subcc v0, %l4, %l2 C v - u, set flags for branch and movcc
sub %l4, v0, %o0 C u - v
bnz,pt %xcc, L(top) C
and %l2, MASK, %g3 C extract low MAXSHIFT bits from (v-u)
return %i7+8
sllx %o2, %o4, %o0 C CAUTION: v0 alias for o2
L(shift_alot):
b L(mid)
and %o0, MASK, %g3 C
EPILOGUE()
|
Applications/Google-Chrome/properties/properties.applescript | looking-for-a-job/applescript-examples | 1 | 1190 | <reponame>looking-for-a-job/applescript-examples
#!/usr/bin.osascript
tell application "Google Chrome"
properties
end tell
|
source/amf/dd/amf-internals-tables-dg_metamodel.adb | svn2github/matreshka | 24 | 18628 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.DG_Metamodel is
--------------
-- MM_DG_DG --
--------------
function MM_DG_DG return AMF.Internals.CMOF_Element is
begin
return Base + 98;
end MM_DG_DG;
----------------------
-- MC_DG_Close_Path --
----------------------
function MC_DG_Close_Path return AMF.Internals.CMOF_Element is
begin
return Base + 314;
end MC_DG_Close_Path;
--------------------------
-- MC_DG_Cubic_Curve_To --
--------------------------
function MC_DG_Cubic_Curve_To return AMF.Internals.CMOF_Element is
begin
return Base + 288;
end MC_DG_Cubic_Curve_To;
-----------------------------
-- MC_DG_Elliptical_Arc_To --
-----------------------------
function MC_DG_Elliptical_Arc_To return AMF.Internals.CMOF_Element is
begin
return Base + 302;
end MC_DG_Elliptical_Arc_To;
-------------------------
-- MC_DG_Gradient_Stop --
-------------------------
function MC_DG_Gradient_Stop return AMF.Internals.CMOF_Element is
begin
return Base + 127;
end MC_DG_Gradient_Stop;
-------------------
-- MC_DG_Line_To --
-------------------
function MC_DG_Line_To return AMF.Internals.CMOF_Element is
begin
return Base + 284;
end MC_DG_Line_To;
------------------
-- MC_DG_Matrix --
------------------
function MC_DG_Matrix return AMF.Internals.CMOF_Element is
begin
return Base + 262;
end MC_DG_Matrix;
-------------------
-- MC_DG_Move_To --
-------------------
function MC_DG_Move_To return AMF.Internals.CMOF_Element is
begin
return Base + 280;
end MC_DG_Move_To;
------------------------
-- MC_DG_Path_Command --
------------------------
function MC_DG_Path_Command return AMF.Internals.CMOF_Element is
begin
return Base + 276;
end MC_DG_Path_Command;
------------------------------
-- MC_DG_Quadratic_Curve_To --
------------------------------
function MC_DG_Quadratic_Curve_To return AMF.Internals.CMOF_Element is
begin
return Base + 296;
end MC_DG_Quadratic_Curve_To;
------------------
-- MC_DG_Rotate --
------------------
function MC_DG_Rotate return AMF.Internals.CMOF_Element is
begin
return Base + 204;
end MC_DG_Rotate;
-----------------
-- MC_DG_Scale --
-----------------
function MC_DG_Scale return AMF.Internals.CMOF_Element is
begin
return Base + 195;
end MC_DG_Scale;
----------------
-- MC_DG_Skew --
----------------
function MC_DG_Skew return AMF.Internals.CMOF_Element is
begin
return Base + 212;
end MC_DG_Skew;
---------------------
-- MC_DG_Transform --
---------------------
function MC_DG_Transform return AMF.Internals.CMOF_Element is
begin
return Base + 187;
end MC_DG_Transform;
---------------------
-- MC_DG_Translate --
---------------------
function MC_DG_Translate return AMF.Internals.CMOF_Element is
begin
return Base + 189;
end MC_DG_Translate;
------------------
-- MC_DG_Canvas --
------------------
function MC_DG_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_DG_Canvas;
------------------
-- MC_DG_Circle --
------------------
function MC_DG_Circle return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MC_DG_Circle;
---------------------
-- MC_DG_Clip_Path --
---------------------
function MC_DG_Clip_Path return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MC_DG_Clip_Path;
-------------------
-- MC_DG_Ellipse --
-------------------
function MC_DG_Ellipse return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MC_DG_Ellipse;
----------------
-- MC_DG_Fill --
----------------
function MC_DG_Fill return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MC_DG_Fill;
--------------------
-- MC_DG_Gradient --
--------------------
function MC_DG_Gradient return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MC_DG_Gradient;
-----------------------------
-- MC_DG_Graphical_Element --
-----------------------------
function MC_DG_Graphical_Element return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MC_DG_Graphical_Element;
-----------------
-- MC_DG_Group --
-----------------
function MC_DG_Group return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MC_DG_Group;
-----------------
-- MC_DG_Image --
-----------------
function MC_DG_Image return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MC_DG_Image;
----------------
-- MC_DG_Line --
----------------
function MC_DG_Line return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MC_DG_Line;
---------------------------
-- MC_DG_Linear_Gradient --
---------------------------
function MC_DG_Linear_Gradient return AMF.Internals.CMOF_Element is
begin
return Base + 11;
end MC_DG_Linear_Gradient;
--------------------------
-- MC_DG_Marked_Element --
--------------------------
function MC_DG_Marked_Element return AMF.Internals.CMOF_Element is
begin
return Base + 12;
end MC_DG_Marked_Element;
------------------
-- MC_DG_Marker --
------------------
function MC_DG_Marker return AMF.Internals.CMOF_Element is
begin
return Base + 13;
end MC_DG_Marker;
----------------
-- MC_DG_Path --
----------------
function MC_DG_Path return AMF.Internals.CMOF_Element is
begin
return Base + 14;
end MC_DG_Path;
-------------------
-- MC_DG_Pattern --
-------------------
function MC_DG_Pattern return AMF.Internals.CMOF_Element is
begin
return Base + 15;
end MC_DG_Pattern;
-------------------
-- MC_DG_Polygon --
-------------------
function MC_DG_Polygon return AMF.Internals.CMOF_Element is
begin
return Base + 16;
end MC_DG_Polygon;
--------------------
-- MC_DG_Polyline --
--------------------
function MC_DG_Polyline return AMF.Internals.CMOF_Element is
begin
return Base + 17;
end MC_DG_Polyline;
---------------------------
-- MC_DG_Radial_Gradient --
---------------------------
function MC_DG_Radial_Gradient return AMF.Internals.CMOF_Element is
begin
return Base + 18;
end MC_DG_Radial_Gradient;
---------------------
-- MC_DG_Rectangle --
---------------------
function MC_DG_Rectangle return AMF.Internals.CMOF_Element is
begin
return Base + 19;
end MC_DG_Rectangle;
-----------------
-- MC_DG_Style --
-----------------
function MC_DG_Style return AMF.Internals.CMOF_Element is
begin
return Base + 20;
end MC_DG_Style;
----------------
-- MC_DG_Text --
----------------
function MC_DG_Text return AMF.Internals.CMOF_Element is
begin
return Base + 21;
end MC_DG_Text;
-----------------------------------
-- MP_DG_Canvas_Background_Color --
-----------------------------------
function MP_DG_Canvas_Background_Color return AMF.Internals.CMOF_Element is
begin
return Base + 28;
end MP_DG_Canvas_Background_Color;
-------------------------------------------
-- MP_DG_Canvas_Background_Fill_A_Canvas --
-------------------------------------------
function MP_DG_Canvas_Background_Fill_A_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 29;
end MP_DG_Canvas_Background_Fill_A_Canvas;
--------------------------------------------
-- MP_DG_Canvas_Packaged_Fill_Fill_Canvas --
--------------------------------------------
function MP_DG_Canvas_Packaged_Fill_Fill_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 22;
end MP_DG_Canvas_Packaged_Fill_Fill_Canvas;
------------------------------------------------
-- MP_DG_Canvas_Packaged_Marker_Marker_Canvas --
------------------------------------------------
function MP_DG_Canvas_Packaged_Marker_Marker_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 23;
end MP_DG_Canvas_Packaged_Marker_Marker_Canvas;
------------------------------------------
-- MP_DG_Canvas_Packaged_Style_A_Canvas --
------------------------------------------
function MP_DG_Canvas_Packaged_Style_A_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 24;
end MP_DG_Canvas_Packaged_Style_A_Canvas;
-------------------------
-- MP_DG_Circle_Center --
-------------------------
function MP_DG_Circle_Center return AMF.Internals.CMOF_Element is
begin
return Base + 30;
end MP_DG_Circle_Center;
-------------------------
-- MP_DG_Circle_Radius --
-------------------------
function MP_DG_Circle_Radius return AMF.Internals.CMOF_Element is
begin
return Base + 31;
end MP_DG_Circle_Radius;
-----------------------------------------------------------------
-- MP_DG_Clip_Path_Clipped_Element_Graphical_Element_Clip_Path --
-----------------------------------------------------------------
function MP_DG_Clip_Path_Clipped_Element_Graphical_Element_Clip_Path return AMF.Internals.CMOF_Element is
begin
return Base + 32;
end MP_DG_Clip_Path_Clipped_Element_Graphical_Element_Clip_Path;
--------------------------
-- MP_DG_Ellipse_Center --
--------------------------
function MP_DG_Ellipse_Center return AMF.Internals.CMOF_Element is
begin
return Base + 33;
end MP_DG_Ellipse_Center;
-------------------------
-- MP_DG_Ellipse_Radii --
-------------------------
function MP_DG_Ellipse_Radii return AMF.Internals.CMOF_Element is
begin
return Base + 34;
end MP_DG_Ellipse_Radii;
--------------------------------------------
-- MP_DG_Fill_Canvas_Canvas_Packaged_Fill --
--------------------------------------------
function MP_DG_Fill_Canvas_Canvas_Packaged_Fill return AMF.Internals.CMOF_Element is
begin
return Base + 35;
end MP_DG_Fill_Canvas_Canvas_Packaged_Fill;
--------------------------
-- MP_DG_Fill_Transform --
--------------------------
function MP_DG_Fill_Transform return AMF.Internals.CMOF_Element is
begin
return Base + 36;
end MP_DG_Fill_Transform;
-------------------------
-- MP_DG_Gradient_Stop --
-------------------------
function MP_DG_Gradient_Stop return AMF.Internals.CMOF_Element is
begin
return Base + 37;
end MP_DG_Gradient_Stop;
-----------------------------------------------------------------
-- MP_DG_Graphical_Element_Clip_Path_Clip_Path_Clipped_Element --
-----------------------------------------------------------------
function MP_DG_Graphical_Element_Clip_Path_Clip_Path_Clipped_Element return AMF.Internals.CMOF_Element is
begin
return Base + 38;
end MP_DG_Graphical_Element_Clip_Path_Clip_Path_Clipped_Element;
------------------------------------------------
-- MP_DG_Graphical_Element_Group_Group_Member --
------------------------------------------------
function MP_DG_Graphical_Element_Group_Group_Member return AMF.Internals.CMOF_Element is
begin
return Base + 39;
end MP_DG_Graphical_Element_Group_Group_Member;
----------------------------------------------------------
-- MP_DG_Graphical_Element_Local_Style_A_Styled_Element --
----------------------------------------------------------
function MP_DG_Graphical_Element_Local_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 25;
end MP_DG_Graphical_Element_Local_Style_A_Styled_Element;
-----------------------------------------------------------
-- MP_DG_Graphical_Element_Shared_Style_A_Styled_Element --
-----------------------------------------------------------
function MP_DG_Graphical_Element_Shared_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 26;
end MP_DG_Graphical_Element_Shared_Style_A_Styled_Element;
---------------------------------------
-- MP_DG_Graphical_Element_Transform --
---------------------------------------
function MP_DG_Graphical_Element_Transform return AMF.Internals.CMOF_Element is
begin
return Base + 40;
end MP_DG_Graphical_Element_Transform;
------------------------------------------------
-- MP_DG_Group_Member_Graphical_Element_Group --
------------------------------------------------
function MP_DG_Group_Member_Graphical_Element_Group return AMF.Internals.CMOF_Element is
begin
return Base + 27;
end MP_DG_Group_Member_Graphical_Element_Group;
------------------------
-- MP_DG_Image_Bounds --
------------------------
function MP_DG_Image_Bounds return AMF.Internals.CMOF_Element is
begin
return Base + 41;
end MP_DG_Image_Bounds;
-------------------------------------------
-- MP_DG_Image_Is_Aspect_Ratio_Preserved --
-------------------------------------------
function MP_DG_Image_Is_Aspect_Ratio_Preserved return AMF.Internals.CMOF_Element is
begin
return Base + 42;
end MP_DG_Image_Is_Aspect_Ratio_Preserved;
------------------------
-- MP_DG_Image_Source --
------------------------
function MP_DG_Image_Source return AMF.Internals.CMOF_Element is
begin
return Base + 43;
end MP_DG_Image_Source;
--------------------
-- MP_DG_Line_End --
--------------------
function MP_DG_Line_End return AMF.Internals.CMOF_Element is
begin
return Base + 44;
end MP_DG_Line_End;
----------------------
-- MP_DG_Line_Start --
----------------------
function MP_DG_Line_Start return AMF.Internals.CMOF_Element is
begin
return Base + 45;
end MP_DG_Line_Start;
------------------------------
-- MP_DG_Linear_Gradient_X1 --
------------------------------
function MP_DG_Linear_Gradient_X1 return AMF.Internals.CMOF_Element is
begin
return Base + 46;
end MP_DG_Linear_Gradient_X1;
------------------------------
-- MP_DG_Linear_Gradient_X2 --
------------------------------
function MP_DG_Linear_Gradient_X2 return AMF.Internals.CMOF_Element is
begin
return Base + 47;
end MP_DG_Linear_Gradient_X2;
------------------------------
-- MP_DG_Linear_Gradient_Y1 --
------------------------------
function MP_DG_Linear_Gradient_Y1 return AMF.Internals.CMOF_Element is
begin
return Base + 48;
end MP_DG_Linear_Gradient_Y1;
------------------------------
-- MP_DG_Linear_Gradient_Y2 --
------------------------------
function MP_DG_Linear_Gradient_Y2 return AMF.Internals.CMOF_Element is
begin
return Base + 49;
end MP_DG_Linear_Gradient_Y2;
------------------------------------------------------
-- MP_DG_Marked_Element_End_Marker_A_Marked_Element --
------------------------------------------------------
function MP_DG_Marked_Element_End_Marker_A_Marked_Element return AMF.Internals.CMOF_Element is
begin
return Base + 50;
end MP_DG_Marked_Element_End_Marker_A_Marked_Element;
------------------------------------------------------
-- MP_DG_Marked_Element_Mid_Marker_A_Marked_Element --
------------------------------------------------------
function MP_DG_Marked_Element_Mid_Marker_A_Marked_Element return AMF.Internals.CMOF_Element is
begin
return Base + 51;
end MP_DG_Marked_Element_Mid_Marker_A_Marked_Element;
--------------------------------------------------------
-- MP_DG_Marked_Element_Start_Marker_A_Marked_Element --
--------------------------------------------------------
function MP_DG_Marked_Element_Start_Marker_A_Marked_Element return AMF.Internals.CMOF_Element is
begin
return Base + 52;
end MP_DG_Marked_Element_Start_Marker_A_Marked_Element;
------------------------------------------------
-- MP_DG_Marker_Canvas_Canvas_Packaged_Marker --
------------------------------------------------
function MP_DG_Marker_Canvas_Canvas_Packaged_Marker return AMF.Internals.CMOF_Element is
begin
return Base + 53;
end MP_DG_Marker_Canvas_Canvas_Packaged_Marker;
----------------------------
-- MP_DG_Marker_Reference --
----------------------------
function MP_DG_Marker_Reference return AMF.Internals.CMOF_Element is
begin
return Base + 54;
end MP_DG_Marker_Reference;
-----------------------
-- MP_DG_Marker_Size --
-----------------------
function MP_DG_Marker_Size return AMF.Internals.CMOF_Element is
begin
return Base + 55;
end MP_DG_Marker_Size;
------------------------
-- MP_DG_Path_Command --
------------------------
function MP_DG_Path_Command return AMF.Internals.CMOF_Element is
begin
return Base + 56;
end MP_DG_Path_Command;
--------------------------
-- MP_DG_Pattern_Bounds --
--------------------------
function MP_DG_Pattern_Bounds return AMF.Internals.CMOF_Element is
begin
return Base + 57;
end MP_DG_Pattern_Bounds;
----------------------------------
-- MP_DG_Pattern_Tile_A_Pattern --
----------------------------------
function MP_DG_Pattern_Tile_A_Pattern return AMF.Internals.CMOF_Element is
begin
return Base + 58;
end MP_DG_Pattern_Tile_A_Pattern;
-------------------------
-- MP_DG_Polygon_Point --
-------------------------
function MP_DG_Polygon_Point return AMF.Internals.CMOF_Element is
begin
return Base + 59;
end MP_DG_Polygon_Point;
--------------------------
-- MP_DG_Polyline_Point --
--------------------------
function MP_DG_Polyline_Point return AMF.Internals.CMOF_Element is
begin
return Base + 60;
end MP_DG_Polyline_Point;
------------------------------------
-- MP_DG_Radial_Gradient_Center_X --
------------------------------------
function MP_DG_Radial_Gradient_Center_X return AMF.Internals.CMOF_Element is
begin
return Base + 61;
end MP_DG_Radial_Gradient_Center_X;
------------------------------------
-- MP_DG_Radial_Gradient_Center_Y --
------------------------------------
function MP_DG_Radial_Gradient_Center_Y return AMF.Internals.CMOF_Element is
begin
return Base + 62;
end MP_DG_Radial_Gradient_Center_Y;
-----------------------------------
-- MP_DG_Radial_Gradient_Focus_X --
-----------------------------------
function MP_DG_Radial_Gradient_Focus_X return AMF.Internals.CMOF_Element is
begin
return Base + 63;
end MP_DG_Radial_Gradient_Focus_X;
-----------------------------------
-- MP_DG_Radial_Gradient_Focus_Y --
-----------------------------------
function MP_DG_Radial_Gradient_Focus_Y return AMF.Internals.CMOF_Element is
begin
return Base + 64;
end MP_DG_Radial_Gradient_Focus_Y;
----------------------------------
-- MP_DG_Radial_Gradient_Radius --
----------------------------------
function MP_DG_Radial_Gradient_Radius return AMF.Internals.CMOF_Element is
begin
return Base + 65;
end MP_DG_Radial_Gradient_Radius;
----------------------------
-- MP_DG_Rectangle_Bounds --
----------------------------
function MP_DG_Rectangle_Bounds return AMF.Internals.CMOF_Element is
begin
return Base + 66;
end MP_DG_Rectangle_Bounds;
-----------------------------------
-- MP_DG_Rectangle_Corner_Radius --
-----------------------------------
function MP_DG_Rectangle_Corner_Radius return AMF.Internals.CMOF_Element is
begin
return Base + 67;
end MP_DG_Rectangle_Corner_Radius;
------------------------------
-- MP_DG_Style_Fill_A_Style --
------------------------------
function MP_DG_Style_Fill_A_Style return AMF.Internals.CMOF_Element is
begin
return Base + 68;
end MP_DG_Style_Fill_A_Style;
----------------------------
-- MP_DG_Style_Fill_Color --
----------------------------
function MP_DG_Style_Fill_Color return AMF.Internals.CMOF_Element is
begin
return Base + 69;
end MP_DG_Style_Fill_Color;
------------------------------
-- MP_DG_Style_Fill_Opacity --
------------------------------
function MP_DG_Style_Fill_Opacity return AMF.Internals.CMOF_Element is
begin
return Base + 70;
end MP_DG_Style_Fill_Opacity;
---------------------------
-- MP_DG_Style_Font_Bold --
---------------------------
function MP_DG_Style_Font_Bold return AMF.Internals.CMOF_Element is
begin
return Base + 71;
end MP_DG_Style_Font_Bold;
----------------------------
-- MP_DG_Style_Font_Color --
----------------------------
function MP_DG_Style_Font_Color return AMF.Internals.CMOF_Element is
begin
return Base + 72;
end MP_DG_Style_Font_Color;
-----------------------------
-- MP_DG_Style_Font_Italic --
-----------------------------
function MP_DG_Style_Font_Italic return AMF.Internals.CMOF_Element is
begin
return Base + 73;
end MP_DG_Style_Font_Italic;
---------------------------
-- MP_DG_Style_Font_Name --
---------------------------
function MP_DG_Style_Font_Name return AMF.Internals.CMOF_Element is
begin
return Base + 74;
end MP_DG_Style_Font_Name;
---------------------------
-- MP_DG_Style_Font_Size --
---------------------------
function MP_DG_Style_Font_Size return AMF.Internals.CMOF_Element is
begin
return Base + 75;
end MP_DG_Style_Font_Size;
-------------------------------------
-- MP_DG_Style_Font_Strike_Through --
-------------------------------------
function MP_DG_Style_Font_Strike_Through return AMF.Internals.CMOF_Element is
begin
return Base + 76;
end MP_DG_Style_Font_Strike_Through;
--------------------------------
-- MP_DG_Style_Font_Underline --
--------------------------------
function MP_DG_Style_Font_Underline return AMF.Internals.CMOF_Element is
begin
return Base + 77;
end MP_DG_Style_Font_Underline;
------------------------------
-- MP_DG_Style_Stroke_Color --
------------------------------
function MP_DG_Style_Stroke_Color return AMF.Internals.CMOF_Element is
begin
return Base + 78;
end MP_DG_Style_Stroke_Color;
------------------------------------
-- MP_DG_Style_Stroke_Dash_Length --
------------------------------------
function MP_DG_Style_Stroke_Dash_Length return AMF.Internals.CMOF_Element is
begin
return Base + 79;
end MP_DG_Style_Stroke_Dash_Length;
--------------------------------
-- MP_DG_Style_Stroke_Opacity --
--------------------------------
function MP_DG_Style_Stroke_Opacity return AMF.Internals.CMOF_Element is
begin
return Base + 80;
end MP_DG_Style_Stroke_Opacity;
------------------------------
-- MP_DG_Style_Stroke_Width --
------------------------------
function MP_DG_Style_Stroke_Width return AMF.Internals.CMOF_Element is
begin
return Base + 81;
end MP_DG_Style_Stroke_Width;
--------------------------
-- MP_DG_Text_Alignment --
--------------------------
function MP_DG_Text_Alignment return AMF.Internals.CMOF_Element is
begin
return Base + 82;
end MP_DG_Text_Alignment;
-----------------------
-- MP_DG_Text_Bounds --
-----------------------
function MP_DG_Text_Bounds return AMF.Internals.CMOF_Element is
begin
return Base + 83;
end MP_DG_Text_Bounds;
---------------------
-- MP_DG_Text_Data --
---------------------
function MP_DG_Text_Data return AMF.Internals.CMOF_Element is
begin
return Base + 84;
end MP_DG_Text_Data;
--------------------------------------
-- MP_DG_Cubic_Curve_To_End_Control --
--------------------------------------
function MP_DG_Cubic_Curve_To_End_Control return AMF.Internals.CMOF_Element is
begin
return Base + 294;
end MP_DG_Cubic_Curve_To_End_Control;
--------------------------------
-- MP_DG_Cubic_Curve_To_Point --
--------------------------------
function MP_DG_Cubic_Curve_To_Point return AMF.Internals.CMOF_Element is
begin
return Base + 290;
end MP_DG_Cubic_Curve_To_Point;
----------------------------------------
-- MP_DG_Cubic_Curve_To_Start_Control --
----------------------------------------
function MP_DG_Cubic_Curve_To_Start_Control return AMF.Internals.CMOF_Element is
begin
return Base + 292;
end MP_DG_Cubic_Curve_To_Start_Control;
------------------------------------------
-- MP_DG_Elliptical_Arc_To_Is_Large_Arc --
------------------------------------------
function MP_DG_Elliptical_Arc_To_Is_Large_Arc return AMF.Internals.CMOF_Element is
begin
return Base + 310;
end MP_DG_Elliptical_Arc_To_Is_Large_Arc;
--------------------------------------
-- MP_DG_Elliptical_Arc_To_Is_Sweep --
--------------------------------------
function MP_DG_Elliptical_Arc_To_Is_Sweep return AMF.Internals.CMOF_Element is
begin
return Base + 312;
end MP_DG_Elliptical_Arc_To_Is_Sweep;
-----------------------------------
-- MP_DG_Elliptical_Arc_To_Point --
-----------------------------------
function MP_DG_Elliptical_Arc_To_Point return AMF.Internals.CMOF_Element is
begin
return Base + 304;
end MP_DG_Elliptical_Arc_To_Point;
-----------------------------------
-- MP_DG_Elliptical_Arc_To_Radii --
-----------------------------------
function MP_DG_Elliptical_Arc_To_Radii return AMF.Internals.CMOF_Element is
begin
return Base + 306;
end MP_DG_Elliptical_Arc_To_Radii;
--------------------------------------
-- MP_DG_Elliptical_Arc_To_Rotation --
--------------------------------------
function MP_DG_Elliptical_Arc_To_Rotation return AMF.Internals.CMOF_Element is
begin
return Base + 308;
end MP_DG_Elliptical_Arc_To_Rotation;
-------------------------------
-- MP_DG_Gradient_Stop_Color --
-------------------------------
function MP_DG_Gradient_Stop_Color return AMF.Internals.CMOF_Element is
begin
return Base + 135;
end MP_DG_Gradient_Stop_Color;
--------------------------------
-- MP_DG_Gradient_Stop_Offset --
--------------------------------
function MP_DG_Gradient_Stop_Offset return AMF.Internals.CMOF_Element is
begin
return Base + 137;
end MP_DG_Gradient_Stop_Offset;
---------------------------------
-- MP_DG_Gradient_Stop_Opacity --
---------------------------------
function MP_DG_Gradient_Stop_Opacity return AMF.Internals.CMOF_Element is
begin
return Base + 139;
end MP_DG_Gradient_Stop_Opacity;
-------------------------
-- MP_DG_Line_To_Point --
-------------------------
function MP_DG_Line_To_Point return AMF.Internals.CMOF_Element is
begin
return Base + 286;
end MP_DG_Line_To_Point;
--------------------
-- MP_DG_Matrix_A --
--------------------
function MP_DG_Matrix_A return AMF.Internals.CMOF_Element is
begin
return Base + 264;
end MP_DG_Matrix_A;
--------------------
-- MP_DG_Matrix_B --
--------------------
function MP_DG_Matrix_B return AMF.Internals.CMOF_Element is
begin
return Base + 266;
end MP_DG_Matrix_B;
--------------------
-- MP_DG_Matrix_C --
--------------------
function MP_DG_Matrix_C return AMF.Internals.CMOF_Element is
begin
return Base + 268;
end MP_DG_Matrix_C;
--------------------
-- MP_DG_Matrix_D --
--------------------
function MP_DG_Matrix_D return AMF.Internals.CMOF_Element is
begin
return Base + 270;
end MP_DG_Matrix_D;
--------------------
-- MP_DG_Matrix_E --
--------------------
function MP_DG_Matrix_E return AMF.Internals.CMOF_Element is
begin
return Base + 272;
end MP_DG_Matrix_E;
--------------------
-- MP_DG_Matrix_F --
--------------------
function MP_DG_Matrix_F return AMF.Internals.CMOF_Element is
begin
return Base + 274;
end MP_DG_Matrix_F;
-------------------------
-- MP_DG_Move_To_Point --
-------------------------
function MP_DG_Move_To_Point return AMF.Internals.CMOF_Element is
begin
return Base + 282;
end MP_DG_Move_To_Point;
------------------------------------
-- MP_DG_Path_Command_Is_Relative --
------------------------------------
function MP_DG_Path_Command_Is_Relative return AMF.Internals.CMOF_Element is
begin
return Base + 278;
end MP_DG_Path_Command_Is_Relative;
--------------------------------------
-- MP_DG_Quadratic_Curve_To_Control --
--------------------------------------
function MP_DG_Quadratic_Curve_To_Control return AMF.Internals.CMOF_Element is
begin
return Base + 300;
end MP_DG_Quadratic_Curve_To_Control;
------------------------------------
-- MP_DG_Quadratic_Curve_To_Point --
------------------------------------
function MP_DG_Quadratic_Curve_To_Point return AMF.Internals.CMOF_Element is
begin
return Base + 298;
end MP_DG_Quadratic_Curve_To_Point;
------------------------
-- MP_DG_Rotate_Angle --
------------------------
function MP_DG_Rotate_Angle return AMF.Internals.CMOF_Element is
begin
return Base + 206;
end MP_DG_Rotate_Angle;
-------------------------
-- MP_DG_Rotate_Center --
-------------------------
function MP_DG_Rotate_Center return AMF.Internals.CMOF_Element is
begin
return Base + 208;
end MP_DG_Rotate_Center;
--------------------------
-- MP_DG_Scale_Factor_X --
--------------------------
function MP_DG_Scale_Factor_X return AMF.Internals.CMOF_Element is
begin
return Base + 200;
end MP_DG_Scale_Factor_X;
--------------------------
-- MP_DG_Scale_Factor_Y --
--------------------------
function MP_DG_Scale_Factor_Y return AMF.Internals.CMOF_Element is
begin
return Base + 202;
end MP_DG_Scale_Factor_Y;
------------------------
-- MP_DG_Skew_Angle_X --
------------------------
function MP_DG_Skew_Angle_X return AMF.Internals.CMOF_Element is
begin
return Base + 214;
end MP_DG_Skew_Angle_X;
------------------------
-- MP_DG_Skew_Angle_Y --
------------------------
function MP_DG_Skew_Angle_Y return AMF.Internals.CMOF_Element is
begin
return Base + 216;
end MP_DG_Skew_Angle_Y;
-----------------------------
-- MP_DG_Translate_Delta_X --
-----------------------------
function MP_DG_Translate_Delta_X return AMF.Internals.CMOF_Element is
begin
return Base + 191;
end MP_DG_Translate_Delta_X;
-----------------------------
-- MP_DG_Translate_Delta_Y --
-----------------------------
function MP_DG_Translate_Delta_Y return AMF.Internals.CMOF_Element is
begin
return Base + 193;
end MP_DG_Translate_Delta_Y;
----------------------------------
-- MP_DG_A_Pattern_Pattern_Tile --
----------------------------------
function MP_DG_A_Pattern_Pattern_Tile return AMF.Internals.CMOF_Element is
begin
return Base + 319;
end MP_DG_A_Pattern_Pattern_Tile;
------------------------------------------
-- MP_DG_A_Canvas_Canvas_Packaged_Style --
------------------------------------------
function MP_DG_A_Canvas_Canvas_Packaged_Style return AMF.Internals.CMOF_Element is
begin
return Base + 320;
end MP_DG_A_Canvas_Canvas_Packaged_Style;
--------------------------------------------------------
-- MP_DG_A_Marked_Element_Marked_Element_Start_Marker --
--------------------------------------------------------
function MP_DG_A_Marked_Element_Marked_Element_Start_Marker return AMF.Internals.CMOF_Element is
begin
return Base + 210;
end MP_DG_A_Marked_Element_Marked_Element_Start_Marker;
------------------------------------------------------
-- MP_DG_A_Marked_Element_Marked_Element_End_Marker --
------------------------------------------------------
function MP_DG_A_Marked_Element_Marked_Element_End_Marker return AMF.Internals.CMOF_Element is
begin
return Base + 211;
end MP_DG_A_Marked_Element_Marked_Element_End_Marker;
------------------------------------------------------
-- MP_DG_A_Marked_Element_Marked_Element_Mid_Marker --
------------------------------------------------------
function MP_DG_A_Marked_Element_Marked_Element_Mid_Marker return AMF.Internals.CMOF_Element is
begin
return Base + 218;
end MP_DG_A_Marked_Element_Marked_Element_Mid_Marker;
----------------------------------------------------------
-- MP_DG_A_Styled_Element_Graphical_Element_Local_Style --
----------------------------------------------------------
function MP_DG_A_Styled_Element_Graphical_Element_Local_Style return AMF.Internals.CMOF_Element is
begin
return Base + 261;
end MP_DG_A_Styled_Element_Graphical_Element_Local_Style;
------------------------------
-- MP_DG_A_Style_Style_Fill --
------------------------------
function MP_DG_A_Style_Style_Fill return AMF.Internals.CMOF_Element is
begin
return Base + 316;
end MP_DG_A_Style_Style_Fill;
-----------------------------------------------------------
-- MP_DG_A_Styled_Element_Graphical_Element_Shared_Style --
-----------------------------------------------------------
function MP_DG_A_Styled_Element_Graphical_Element_Shared_Style return AMF.Internals.CMOF_Element is
begin
return Base + 317;
end MP_DG_A_Styled_Element_Graphical_Element_Shared_Style;
-------------------------------------------
-- MP_DG_A_Canvas_Canvas_Background_Fill --
-------------------------------------------
function MP_DG_A_Canvas_Canvas_Background_Fill return AMF.Internals.CMOF_Element is
begin
return Base + 318;
end MP_DG_A_Canvas_Canvas_Background_Fill;
--------------------------------
-- MA_DG_Pattern_Tile_Pattern --
--------------------------------
function MA_DG_Pattern_Tile_Pattern return AMF.Internals.CMOF_Element is
begin
return Base + 85;
end MA_DG_Pattern_Tile_Pattern;
----------------------------------------
-- MA_DG_Canvas_Packaged_Style_Canvas --
----------------------------------------
function MA_DG_Canvas_Packaged_Style_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 86;
end MA_DG_Canvas_Packaged_Style_Canvas;
------------------------------------------------------
-- MA_DG_Marked_Element_Start_Marker_Marked_Element --
------------------------------------------------------
function MA_DG_Marked_Element_Start_Marker_Marked_Element return AMF.Internals.CMOF_Element is
begin
return Base + 87;
end MA_DG_Marked_Element_Start_Marker_Marked_Element;
----------------------------------------------------
-- MA_DG_Marked_Element_End_Marker_Marked_Element --
----------------------------------------------------
function MA_DG_Marked_Element_End_Marker_Marked_Element return AMF.Internals.CMOF_Element is
begin
return Base + 88;
end MA_DG_Marked_Element_End_Marker_Marked_Element;
------------------------------
-- MA_DG_Group_Member_Group --
------------------------------
function MA_DG_Group_Member_Group return AMF.Internals.CMOF_Element is
begin
return Base + 89;
end MA_DG_Group_Member_Group;
----------------------------------------------------
-- MA_DG_Marked_Element_Mid_Marker_Marked_Element --
----------------------------------------------------
function MA_DG_Marked_Element_Mid_Marker_Marked_Element return AMF.Internals.CMOF_Element is
begin
return Base + 90;
end MA_DG_Marked_Element_Mid_Marker_Marked_Element;
-----------------------------------------
-- MA_DG_Canvas_Packaged_Marker_Canvas --
-----------------------------------------
function MA_DG_Canvas_Packaged_Marker_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 91;
end MA_DG_Canvas_Packaged_Marker_Canvas;
-------------------------------------------------------
-- MA_DG_Graphical_Element_Clip_Path_Clipped_Element --
-------------------------------------------------------
function MA_DG_Graphical_Element_Clip_Path_Clipped_Element return AMF.Internals.CMOF_Element is
begin
return Base + 92;
end MA_DG_Graphical_Element_Clip_Path_Clipped_Element;
--------------------------------------------------------
-- MA_DG_Graphical_Element_Local_Style_Styled_Element --
--------------------------------------------------------
function MA_DG_Graphical_Element_Local_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 93;
end MA_DG_Graphical_Element_Local_Style_Styled_Element;
---------------------------------------
-- MA_DG_Canvas_Packaged_Fill_Canvas --
---------------------------------------
function MA_DG_Canvas_Packaged_Fill_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 94;
end MA_DG_Canvas_Packaged_Fill_Canvas;
----------------------------
-- MA_DG_Style_Fill_Style --
----------------------------
function MA_DG_Style_Fill_Style return AMF.Internals.CMOF_Element is
begin
return Base + 95;
end MA_DG_Style_Fill_Style;
---------------------------------------------------------
-- MA_DG_Graphical_Element_Shared_Style_Styled_Element --
---------------------------------------------------------
function MA_DG_Graphical_Element_Shared_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 96;
end MA_DG_Graphical_Element_Shared_Style_Styled_Element;
-----------------------------------------
-- MA_DG_Canvas_Background_Fill_Canvas --
-----------------------------------------
function MA_DG_Canvas_Background_Fill_Canvas return AMF.Internals.CMOF_Element is
begin
return Base + 97;
end MA_DG_Canvas_Background_Fill_Canvas;
-----------
-- MB_DG --
-----------
function MB_DG return AMF.Internals.AMF_Element is
begin
return Base;
end MB_DG;
-----------
-- MB_DG --
-----------
function ML_DG return AMF.Internals.AMF_Element is
begin
return Base + 322;
end ML_DG;
end AMF.Internals.Tables.DG_Metamodel;
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_1239.asm | ljhsiun2/medusa | 9 | 14557 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x16e7f, %r11
nop
sub %r15, %r15
mov $0x6162636465666768, %rdx
movq %rdx, (%r11)
nop
nop
nop
nop
nop
cmp $21351, %rbp
lea addresses_D_ht+0x1b82f, %r14
nop
nop
nop
nop
dec %r13
movw $0x6162, (%r14)
nop
nop
nop
nop
xor %r11, %r11
lea addresses_WC_ht+0x17bbb, %r11
nop
nop
nop
nop
dec %r13
and $0xffffffffffffffc0, %r11
movntdqa (%r11), %xmm1
vpextrq $0, %xmm1, %rbp
add %r14, %r14
lea addresses_normal_ht+0x9f21, %rsi
lea addresses_A_ht+0xa7cd, %rdi
nop
nop
nop
nop
add $22078, %r15
mov $40, %rcx
rep movsw
nop
nop
cmp $30481, %r15
lea addresses_D_ht+0x5fff, %rdi
nop
nop
xor $37368, %r14
movl $0x61626364, (%rdi)
nop
nop
nop
nop
sub %r11, %r11
lea addresses_A_ht+0x148ff, %rsi
lea addresses_A_ht+0x136df, %rdi
nop
nop
nop
nop
cmp $4940, %rdx
mov $75, %rcx
rep movsw
nop
nop
nop
nop
nop
sub %r14, %r14
lea addresses_UC_ht+0x13e5f, %rdx
sub $10912, %r13
movw $0x6162, (%rdx)
nop
nop
nop
nop
add $20820, %r8
lea addresses_D_ht+0x7f9f, %rsi
lea addresses_normal_ht+0x98df, %rdi
nop
nop
nop
add $11844, %r13
mov $57, %rcx
rep movsl
nop
nop
nop
nop
inc %r8
lea addresses_normal_ht+0xfa5f, %r11
sub $9178, %r8
movl $0x61626364, (%r11)
nop
nop
add %r15, %r15
lea addresses_normal_ht+0x10f9f, %r11
nop
nop
nop
dec %r15
movb (%r11), %r13b
nop
add $11193, %rbp
lea addresses_normal_ht+0x1d45f, %rsi
lea addresses_WT_ht+0x3c1f, %rdi
xor %r13, %r13
mov $2, %rcx
rep movsw
nop
nop
nop
and $56128, %rcx
lea addresses_D_ht+0x17f9f, %rsi
lea addresses_D_ht+0xe2bf, %rdi
nop
dec %r8
mov $31, %rcx
rep movsl
nop
nop
nop
dec %r8
lea addresses_A_ht+0xf9f, %rdi
nop
nop
lfence
movw $0x6162, (%rdi)
nop
nop
nop
dec %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r9
push %rax
push %rcx
push %rsi
// Load
lea addresses_D+0x1cb9f, %rcx
clflush (%rcx)
nop
add %rsi, %rsi
mov (%rcx), %r10w
nop
nop
nop
nop
nop
add $50720, %r14
// Store
lea addresses_A+0x1037f, %r10
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov $0x5152535455565758, %rcx
movq %rcx, (%r10)
and $10326, %rsi
// Store
lea addresses_D+0x11c03, %rsi
nop
nop
nop
sub %r11, %r11
mov $0x5152535455565758, %r9
movq %r9, %xmm0
movaps %xmm0, (%rsi)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
// Faulty Load
lea addresses_US+0x1679f, %r9
nop
dec %rax
mov (%r9), %r14d
lea oracles, %r11
and $0xff, %r14
shlq $12, %r14
mov (%r11,%r14,1), %r14
pop %rsi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': True, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': True, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'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
*/
|
programs/oeis/017/A017555.asm | neoneye/loda | 22 | 7176 | <filename>programs/oeis/017/A017555.asm
; A017555: (12n+2)^11.
; 2048,4049565169664,3670344486987776,238572050223552512,4882812500000000000,52036560683837093888,364375289404334925824,1903193578437064103936,8007313507497959524352,28531167061100000000000
mul $0,12
add $0,2
pow $0,11
|
models/tests/test40.als | transclosure/Amalgam | 4 | 339 | <filename>models/tests/test40.als
module tests/test // Bugpost by <EMAIL>
open util/ordering[State] as ord
------------- The State signature -----------------------
sig State {
nextState: State, // each State has one successor
linearNext : lone State,
A : Obj -> Obj,
B : Obj -> Obj
}
sig Obj {}
fact TraceConstraints {
all s : State | s.linearNext = next[s]
State in ord/first.*nextState
all s : State - ord/last |
s.nextState = s.linearNext
}
------------- The LTL until operator ---------------------
fun intervalStates[stInitial, stFinal : State]:set State {
stInitial = stFinal
=>
stInitial
else
( stFinal in stInitial.^linearNext )
=>
stInitial.*linearNext & stFinal.^(~linearNext)
else
stInitial.*linearNext +
( stFinal.^(~linearNext) & stInitial.*nextState )
}
pred Until(st: State, X: State -> Obj -> Obj,
Y: State ->Obj -> Obj, o1, o2 : Obj )
{
some st1 : st.*nextState | {
o2 in st1.Y[o1]
( all st' : intervalStates[st, st1] | o2 in st'.X[o1] )
}
}
------------- Simulations -------------------------------
pred show() {}
run show for 5 expect 1
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_sync.asm | Toysoft/z88dk | 0 | 242361 | <reponame>Toysoft/z88dk
; unsigned char esx_f_sync(unsigned char handle)
SECTION code_esxdos
PUBLIC esx_f_sync
EXTERN asm_esx_f_sync
defc esx_f_sync = asm_esx_f_sync
|
src/STLC/Type.agda | johnyob/agda-types | 0 | 7212 | module STLC.Type where
open import Data.Fin using (Fin)
open import Data.Fin.Substitution
open import Data.Fin.Substitution.Lemmas using (TermLemmas)
open import Data.Nat using (ℕ; _+_)
open import Relation.Binary.Construct.Closure.ReflexiveTransitive
using (Star; ε; _◅_)
open import Data.Vec using (Vec; []; _∷_; lookup)
open import Relation.Binary.PropositionalEquality as Eq
using (refl; _≡_; sym; cong₂)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; step-≡; _∎)
-- --------------------------------------------------------------------
-- Types
-- --------------------------------------------------------------------
-- Recall that STLC types are defined as:
-- τ ::= α | τ -> τ
-- where α denotes a type variable.
infix 9 `_
infixr 7 _⇒_
data Type (n : ℕ) : Set where
`_ : Fin n -> Type n
_⇒_ : Type n -> Type n -> Type n
-- --------------------------------------------------------------------
module Substitution where
-- This sub module defines application of the subtitution
module Application₀ { T : ℕ -> Set } ( l : Lift T Type ) where
open Lift l hiding (var)
-- Application of substitution to type
infixl 8 _/_
_/_ : ∀ { m n : ℕ } -> Type m -> Sub T m n -> Type n
` x / ρ = lift (lookup ρ x)
(τ₁ ⇒ τ₂) / ρ = (τ₁ / ρ) ⇒ (τ₂ / ρ)
open Application (record { _/_ = _/_ }) using (_/✶_)
-- The application of sequences of substitutions is defined
-- by (_/✶_). We use this to prove some generic lemmas on
-- the lifting of sets
⇒-/✶-lift : ∀ k { m n τ₁ τ₂ } (ρs : Subs T m n) ->
(τ₁ ⇒ τ₂) /✶ ρs ↑✶ k ≡ (τ₁ /✶ ρs ↑✶ k) ⇒ (τ₂ /✶ ρs ↑✶ k)
⇒-/✶-lift k ε = refl
⇒-/✶-lift k (ρ ◅ ρs) = cong₂ _/_ (⇒-/✶-lift k ρs) refl
t = record
{var = `_
; app = Application₀._/_
}
open TermSubst t public hiding (var)
infix 8 _[/_]
-- Shorthand for single-variable type substitutions
_[/_] : ∀ { n } → Type (1 + n) → Type n → Type n
τ₁ [/ τ₂ ] = τ₁ / sub τ₂
module Lemmas where
module Lemmas₀ { T₁ T₂ } { l₁ : Lift T₁ Type} { l₂ : Lift T₂ Type } where
open Substitution
open Lifted l₁ using () renaming (_↑✶_ to _↑✶₁_; _/✶_ to _/✶₁_)
open Lifted l₂ using () renaming (_↑✶_ to _↑✶₂_; _/✶_ to _/✶₂_)
/✶-↑✶ : ∀ {m n} (ρs₁ : Subs T₁ m n) (ρs₂ : Subs T₂ m n)
-> (∀ k x -> ` x /✶₁ ρs₁ ↑✶₁ k ≡ ` x /✶₂ ρs₂ ↑✶₂ k)
-> ∀ k τ -> τ /✶₁ ρs₁ ↑✶₁ k ≡ τ /✶₂ ρs₂ ↑✶₂ k
/✶-↑✶ ρs₁ ρs₂ hyp k (` x) = hyp k x
/✶-↑✶ ρs₁ ρs₂ hyp k (τ₁ ⇒ τ₂) =
begin
(τ₁ ⇒ τ₂) /✶₁ ρs₁ ↑✶₁ k
≡⟨ Application₀.⇒-/✶-lift _ k ρs₁ ⟩
(τ₁ /✶₁ ρs₁ ↑✶₁ k) ⇒ (τ₂ /✶₁ ρs₁ ↑✶₁ k)
≡⟨ cong₂ (_⇒_) (/✶-↑✶ ρs₁ ρs₂ hyp k τ₁) (/✶-↑✶ ρs₁ ρs₂ hyp k τ₂) ⟩
(τ₁ /✶₂ ρs₂ ↑✶₂ k) ⇒ (τ₂ /✶₂ ρs₂ ↑✶₂ k)
≡⟨ sym (Application₀.⇒-/✶-lift _ k ρs₂) ⟩
(τ₁ ⇒ τ₂) /✶₂ ρs₂ ↑✶₂ k
∎
t : TermLemmas Type
t = record
{ termSubst = Substitution.t
; app-var = refl
; /✶-↑✶ = Lemmas₀./✶-↑✶
}
open TermLemmas t public hiding (var)
module Operators where
infixr 7 _⇒ⁿ_
-- n-ary function type
_⇒ⁿ_ : ∀ { n k } -> Vec (Type n) k -> Type n -> Type n
[] ⇒ⁿ τ = τ
(τ ∷ τs) ⇒ⁿ σ = τ ⇒ (τs ⇒ⁿ σ)
|
alloy4fun_models/trashltl/models/8/yYpBj7fogxbDSy5Mu.als | Kaixi26/org.alloytools.alloy | 0 | 4172 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idyYpBj7fogxbDSy5Mu_prop9 {
no Protected + Trash
}
pred __repair { idyYpBj7fogxbDSy5Mu_prop9 }
check __repair { idyYpBj7fogxbDSy5Mu_prop9 <=> prop9o } |
src/xpath_utils.ads | cyberpython/xpath_utils | 0 | 20253 | -- Copyright 2017 <NAME>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
with System;
with Ada.Strings.Unbounded;
package XPATH_UTILS is
Empty_String_C : constant Ada.Strings.Unbounded.Unbounded_String :=
Ada.Strings.Unbounded.To_Unbounded_String("");
type Context_T is private;
------------------------------------------------------------------------------
-- procedure Initialize
--
-- Initializes the package
-- Should be called only by the main thread and only once prior to any other
-- calls to any of the routines in this package.
--
-- **IMPORTANT**:
-- Internally initializes the libxml2 parser for
-- multi-threaded use by calling xmlInitParser().
-- If another library that initializes the libxml2 parser
-- or libxml2 calls are directly used for the same purpose,
-- do not call this procedure.
--
procedure Initialize;
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- procedure Finalize
--
-- Finalizes the package
-- Should be called only by the main thread and only once after all
-- calls to any of the routines in this package.
--
-- **IMPORTANT**:
-- Internally calls libxml2's xmlCleanupParser() function.
-- If another library that initializes the libxml2 parser or direct libxml2
-- calls are used for the same purpose, do not call this procedure.
--
procedure Finalize;
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- procedure Parse_File
--
-- Loads the specified file and constructs a DOM representation of its
-- contents.
-- If the 'Silent' parameter is set to False then the XML parser will output
-- parsing errors to the standard error stream (stderr).
--
procedure Parse_File(Filename : in Ada.Strings.Unbounded.Unbounded_String;
Context : out Context_T;
Success : out Boolean;
Silent : in Boolean := True);
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- procedure Get_Value
--
-- Retrieves the value of the node / attribute selected by the specified XPath
-- expression.
-- Returns an empty string if no node/attribute matched the XPath expression.
--
procedure Get_Value(XPath_Expression : in Ada.Strings.Unbounded.Unbounded_String;
Context : in Context_T;
Value : out Ada.Strings.Unbounded.Unbounded_String);
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- procedure Free_Resources
--
-- Deallocates the resources used to store the DOM and
-- the context for the XPath queries.
--
procedure Free_Resources(Context : in Context_T);
------------------------------------------------------------------------------
private
type Context_T is
record
Xml_Doc : System.Address;
XPath_Ctx : System.Address;
end record;
end XPATH_UTILS; |
oeis/347/A347266.asm | neoneye/loda-programs | 11 | 89245 | ; A347266: a(n) is the number whose binary representation is the concatenation of terms in the n-th row of A237048.
; Submitted by <NAME>
; 1,1,3,2,3,5,6,4,7,9,12,10,12,9,29,16,24,22,24,17,57,36,48,40,50,36,57,65,96,92,96,64,114,72,101,161,192,144,228,136,192,178,192,129,473,288,384,320,388,304,456,258,384,353,801,520,912,576,768,676,768,576,922,512,801,1409,1536,1032,1824,1232,1536,1284,1536,1152,1890,1032,1553,2817,3072,2176,3656,2304,3072,2608,3204,2304,3648,2050,3072,2953,6209,4128,7296,4608,6408,5120,6144,4672,7316,4384
add $0,1
mov $1,1
mov $2,$0
lpb $0
add $4,1
min $0,$4
mul $1,2
mov $3,$2
dif $3,$0
cmp $3,$2
sub $2,$4
mov $0,$2
cmp $3,0
mul $3,2
add $1,$3
lpe
mov $0,$1
div $0,2
|
0x3e_TODO.asm | SpeedStepper/XchgRaxRax | 53 | 169475 | ;
; $Id: 0x3e_TODO.asm,v 1.1.1.1 2016/03/27 08:40:13 raptor Exp $
;
; 0x3e explanation - from xchg rax,rax by <EMAIL>
; Copyright (c) 2016 <NAME> <<EMAIL>>
;
; TODO: THIS EXPLANATION IS INCOMPLETE
;
; This snippet is roughly equivalent to the following C
; code:
;
; #include <stdio.h>
; int number_of_ones(unsigned int x)
; {
; int total_ones = 0;
; while (x != 0) {
; x = x & (x-1);
; total_ones++;
; }
; return total_ones;
; }
; main()
; {
; int in, out;
; for (in = 0; in < 30; in++) {
; out = number_of_ones(in ^ (in>>1)) & 3;
; printf("in:\t%d\t\tout:\t%d\n", in, out);
; }
; }
;
; Example run:
; $ ./0x3e_helper
; in: 0 out: 0
; in: 1 out: 1
; in: 2 out: 2
; in: 3 out: 1
; in: 4 out: 2
; in: 5 out: 3
; in: 6 out: 2
; in: 7 out: 1
; in: 8 out: 2
; in: 9 out: 3
; [...]
; in: 25 out: 3
; in: 26 out: 0
; in: 27 out: 3
; in: 28 out: 2
; in: 29 out: 3
;
; Once again, its ultimate purpose is not clear to me.
;
; NOTE. @AlexAltea points out that this snippet computes the
; direction of the lines in the (Heighway) Dragon Curve (!).
;
BITS 64
SECTION .text
global main
main:
mov rdx,rax ;
shr rdx,1 ;
xor rax,rdx ;
popcnt rax,rax ;
and rax,0x3 ; rax = number_of_ones(rax ^ (rax>>1)) & 3
|
oeis/314/A314826.asm | neoneye/loda-programs | 11 | 105253 | ; A314826: Coordination sequence Gal.6.129.5 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by <NAME>
; 1,5,9,14,18,22,26,30,34,39,43,48,53,57,62,66,70,74,78,82,87,91,96,101,105,110,114,118,122,126,130,135,139,144,149,153,158,162,166,170,174,178,183,187,192,197,201,206,210,214
mov $1,$0
seq $1,314165 ; Coordination sequence Gal.5.307.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
mov $2,$0
mul $0,6
sub $0,1
mod $0,$1
add $0,1
mul $2,4
add $0,$2
|
Binary_search.asm | AdityaSatnalika/Microprocessor | 1 | 2955 | .model small
.stack
.data
arr db 01h,02h,03h,04h,05h,06h,07h,08h
len db 07h
key db 07h
.code
mov ax,@data
mov ds,ax
mov ch, len
mov cl,00h
l1:
cmp ch,cl
jl notfound
mov ax,0000h
add al,ch
add al,cl
sar al,1
mov si,ax
mov bh, [si]
mov bl,key
cmp bh,bl
je found
jg lesser
jl bigger
bigger:
mov cl,al
jmp l1
lesser:
mov ch,al
jmp l1
found:
mov ax,si
hlt
notfound:
mov ax, 0F0Fh
hlt
|
oeis/145/A145126.asm | neoneye/loda-programs | 11 | 241407 | <reponame>neoneye/loda-programs
; A145126: a(n) = 1 + (6 + (11 + (6 + n)*n)*n)*n/24.
; 1,2,6,16,36,71,127,211,331,496,716,1002,1366,1821,2381,3061,3877,4846,5986,7316,8856,10627,12651,14951,17551,20476,23752,27406,31466,35961,40921,46377,52361,58906,66046,73816,82252,91391,101271,111931,123411,135752,148996,163186,178366,194581,211877,230301,249901,270726,292826,316252,341056,367291,395011,424271,455127,487636,521856,557846,595666,635377,677041,720721,766481,814386,864502,916896,971636,1028791,1088431,1150627,1215451,1282976,1353276,1426426,1502502,1581581,1663741,1749061,1837621
add $0,3
bin $0,4
add $0,1
|
programs/oeis/014/A014799.asm | jmorken/loda | 1 | 103208 | <reponame>jmorken/loda
; A014799: Squares of odd pentagonal pyramidal numbers.
; 1,5625,164025,1399489,6765201,23532201,66015625,159138225,342731169,676572121,1246160601,2169230625,3603000625,5752160649,8877596841,13305853201,19439330625,27767223225,38877191929,53467775361,72361538001,96518955625,127053038025,165244689009,212558803681,270661103001,341435705625,427003437025,529740875889,652300137801,797629396201,968994140625,1169999172225,1404611336569,1677182993721,1992476225601,2355687780625,2772474755625,3248981015049,3791864347441,4408324359201,5106131105625,5893654459225,6779894215329,7774510934961,8887857525001,10131011555625,11515808315025,13054874601409,14761663252281,16650488411001,18736561530625,21036028115025,23566005197289,26344619555401,29391046665201,32725550390625,36369523411225,40345528386969,44677339860321,49389986895601,54509796455625,60064437515625,66082965914449,72595869943041,79635116670201,87234199005625,95428183500225,104253758883729,113749285339561,123954844517001,134912290280625,146665300197025,159259427758809,172742155345881,187162947924001,202573307480625,219026828198025,236579252363689,255288527018001,275214861339201,296420784765625,318971205855225,342933471882369,368377429171921,395375484170601,424002665255625,454336685280625,486458004858849,520449896383641,556398508786201,594392933030625,634525268346225,676890689197129,721587512989161,768717268514001,818384765130625,870698162684025,925769042161209,983712477084481,1044647105642001,1108695203555625,1175982757686025,1246639540375089,1320799184525601,1398599259418201,1480181347265625,1565691120504225,1655278419822769,1749097332928521,1847306274050601,1950068064180625,2057550012050625,2169923995848249,2287366545669241,2410058926707201,2538187223180625,2671942422997225,2811520503155529,2957122515883761,3108954675516001,3267228446105625,3432160629776025,3603973455808609,3782894670468081,3969157627565001,4163001379755625,4364670770579025,4574416527231489,4792495354078201,5019170026902201,5254709487890625,5499388941358225,5753489950208169,6017300533130121,6291115262535601,6575235363230625,6869968811825625,7175630436882649,7492542019799841,7821032396433201,8161437559455625,8514100761453225,8879372618758929
mov $1,1
mov $3,$0
mul $3,2
lpb $0
sub $0,1
mov $2,$3
add $2,$1
mul $2,2
mov $4,$2
lpe
mul $1,$4
sub $1,1
pow $1,2
mul $1,$4
pow $1,2
div $1,32
mul $1,8
add $1,1
|
programs/oeis/017/A017390.asm | neoneye/loda | 22 | 98453 | <gh_stars>10-100
; A017390: a(n) = (11*n)^2.
; 0,121,484,1089,1936,3025,4356,5929,7744,9801,12100,14641,17424,20449,23716,27225,30976,34969,39204,43681,48400,53361,58564,64009,69696,75625,81796,88209,94864,101761,108900,116281,123904,131769,139876,148225,156816,165649,174724,184041,193600,203401,213444,223729,234256,245025,256036,267289,278784,290521,302500,314721,327184,339889,352836,366025,379456,393129,407044,421201,435600,450241,465124,480249,495616,511225,527076,543169,559504,576081,592900,609961,627264,644809,662596,680625,698896,717409,736164,755161,774400,793881,813604,833569,853776,874225,894916,915849,937024,958441,980100,1002001,1024144,1046529,1069156,1092025,1115136,1138489,1162084,1185921
pow $0,2
mul $0,121
|
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccixp_dread.asm | meesokim/z88dk | 0 | 25108 | <filename>libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccixp_dread.asm<gh_stars>0
SECTION code_fp_math48
PUBLIC cm48_sdccixp_dread1, cm48_sdccixp_dread2
EXTERN cm48_sdccixp_dload
cm48_sdccixp_dread2:
; sdcc float primitive
; Read two sdcc floats from the stack
;
; Covert from sdcc float format to math48 format.
;
; enter : stack = sdcc_float right, sdcc_float left, ret1, ret0
;
; exit : AC'= double left (math48)
; AC = double right (math48)
;
; uses : af, bc, de, hl, bc', de', hl'
ld hl,8
add hl,sp
call cm48_sdccixp_dload
cm48_sdccixp_dread1:
ld hl,4
add hl,sp
jp cm48_sdccixp_dload
; AC = right
; AC'= left
|
data/baseStats_original/aipom.asm | adhi-thirumala/EvoYellow | 16 | 169145 | <filename>data/baseStats_original/aipom.asm
AipomBaseStats::
dw DEX_AIPOM ; pokedex id
db 50 ; base hp
db 70 ; base attack
db 55 ; base defense
db 85 ; base speed
db 50 ; base special
db NORMAL ; species type 1
db NORMAL ; species type 2
db 49 ; catch rate, hold nugget
db 94 ; base exp yield
INCBIN "pic/ymon/aipom.pic",0,1 ; 55, sprite dimensions
dw AipomPicFront
dw AipomPicBack
; attacks known at lvl 0
db SCRATCH
db TAIL_WHIP
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 1,5,6,8
tmlearn 9,10,16
tmlearn 17,18,19,20,24
tmlearn 25,28,31,32
tmlearn 34,35,39,40
tmlearn 44,48
tmlearn 50,54
db Bank(AipomPicFront) ; padding
|
c2000/C2000Ware_1_00_06_00/libraries/math/CLAmath/c28/source/CLAexp.asm | ramok/Themis_ForHPSDR | 0 | 5043 | <filename>c2000/C2000Ware_1_00_06_00/libraries/math/CLAmath/c28/source/CLAexp.asm
;;#############################################################################
;; FILE: CLAexp.asm
;;
;; DESCRIPTION: CLA Exponent function
;;
;; Group: C2000
;; Target Family: C28x+CLA
;;
;;#############################################################################
;; $TI Release: CLA Math Library 4.02.02.00 $
;; $Release Date: Oct 18, 2018 $
;; $Copyright: Copyright (C) 2018 Texas Instruments Incorporated -
;; http://www.ti.com/ ALL RIGHTS RESERVED $
;;#############################################################################
.cdecls C,LIST,"CLAmath.h"
.include "CLAeabi.asm"
;;----------------------------------------------------------------------------
;; Description:
;; Step(1): Calculate absolute of x
;;
;; Step(2): Identify the integer and mantissa of the input
;;
;; Step(3): Obtain the e^integer(x) from the table
;;
;; Step(4): Calculate the value of e^(mantissa)by using the
;; polynomial approx = 1 + x*(1+x*0.5(1+(x/3)(1+x/4(1+x/5*(1+x/6*(1+x/7))))))
;;
;; Step(5): The value of e^x is the product of results from (3)&(4)
;;
;;
;; Benchmark: Cycles = 41
;; Instructions = 41
;;
;; Scratchpad Usage: (Local Function Scratchpad Pointer (SP))
;;
;; |_______|<- exponent temporary variable (SP+2)
;; |_______|<- MR3 (SP+0)
;;
;;----------------------------------------------------------------------------
.def _CLAexp
.sect "Cla1Prog:_CLAexp"
.align 2
.def __cla_CLAexp_sp
__cla_CLAexp_sp .usect ".scratchpad:Cla1Prog:_CLAexp",4,0,1
_CLAexp:
.asmfunc
.asg __cla_CLAexp_sp + 0, _save_MR3
.asg __cla_CLAexp_sp + 2, _exp_tmp
; Context Save
MMOV32 @_save_MR3, MR3
; The input argument fVal is refered to as X
; save input argument on scratchpad
MMOV32 @_exp_tmp,MR0
; Step 1
MMOV32 MR3,MR0 ; Load argument into MR3
MABSF32 MR3,MR3 ; LOAD |X| TO MR3
; Step 2
MF32TOI32 MR0,MR3 ; MR0 = INTEGER(X)
MFRACF32 MR1,MR3 ; MR1 = MANTISSA(X)
; Step 3
MADD32 MR2,MR0,MR0
MMOV16 MAR1,MR2,#_CLAExpTable
; Step 3
MMOV32 MR2,@_CLAINV7 ; MR2 = 1/7
MMPYF32 MR3,MR2,MR1 ; MR3 = Xm/7
|| MMOV32 MR2,@_CLAINV1 ; MR2 = 1
MADDF32 MR3,MR3,MR2 ; MR3 =(1+Xm/7)
MMOV32 MR2,@_CLAINV6 ; MR2 = 1/6
|| MMPYF32 MR3,MR1,MR3 ; MR3 = Xm(1+Xm/7)
MMPYF32 MR3,MR3,MR2 ; MR3 = Xm(1+Xm/7)/6
|| MMOV32 MR2,@_CLAINV1 ; MR2 = 1
MADDF32 MR3,MR3,MR2 ; MR3 = 1+(Xm/6)*(1+Xm/7)
|| MMOV32 MR0,*MAR1 ; MR0 = e^(INTEGER(X))
MMOV32 MR2,@_CLAINV5 ; MR2 = .2
|| MMPYF32 MR3,MR1,MR3 ; MR3 = Xm(1+Xm/6*(1+Xm/7))
MMPYF32 MR3,MR3,MR2 ; MR3 = Xm(1+Xm/6*(1+Xm/7))/5
|| MMOV32 MR2,@_CLAINV1 ; MR2 = 1
MADDF32 MR3,MR3,MR2 ; MR3 = 1+(Xm/5)*(1+Xm/6*(1+Xm/7))
MMOV32 MR2,@_CLAINV4 ; MR2 = .25
|| MMPYF32 MR3,MR1,MR3 ; MR3 = Xm(1+Xm/5*(1+Xm/6*(1+Xm/7)))
MMPYF32 MR3,MR3,MR2 ; MR3 = Xm(1+Xm/5*(1+Xm/6*(1+Xm/7)))/4
|| MMOV32 MR2,@_CLAINV1 ; MR2 = 1
MADDF32 MR3,MR3,MR2 ; MR3 = 1+(Xm/4)*(1+Xm/5*(1+Xm/6*(1+Xm/7)))
MMOV32 MR2,@_CLAINV3 ; MR2 = .3333333
|| MMPYF32 MR3,MR1,MR3 ; MR3 = Xm(1+(Xm/4)*(1+Xm/5)*(1+Xm/6*(1+Xm/7)))
MMPYF32 MR3,MR3,MR2 ; MR3 = Xm(1+(Xm/4)*(1+Xm/5)*(1+Xm/6*(1+Xm/7)))*0.333333
|| MMOV32 MR2,@_CLAINV1 ; MR2 = 1
MADDF32 MR3,MR3,MR2 ; MR3 = 1+(Xm/3)*(1+(Xm/4)*(1+Xm/5*(1+Xm/6*(1+Xm/7))))
MMOV32 MR2,@_CLAINV2 ; MR2 = .5
|| MMPYF32 MR3,MR1,MR3 ; MR3 = Xm(1+(Xm/3)*(1+(Xm/4)*(1+Xm/5*(1+Xm/6*(1+Xm/7)))))
MMPYF32 MR3,MR3,MR2 ; MR3 = Xm(1+(Xm/3)*(1+(Xm/4)*(1+Xm/5*(1+Xm/6*(1+Xm/7)))))*0.5
|| MMOV32 MR2,@_CLAINV1 ; MR2 = 1
MADDF32 MR3,MR3,MR2 ; MR3 = 1+(1+(Xm/3)*(1+(Xm/4)*(1+Xm/5*(1+Xm/6*(1+Xm/7)))))Xm/2
MMPYF32 MR3,MR3,MR1 ; MR3 = Xm(1+(1+(Xm/3)*(1+(Xm/4)*(1+Xm/5*(1+Xm/6*(1+Xm/7)))))Xm/2)
|| MMOV32 MR2,@_CLAINV1 ; MR2 = 1
MADDF32 MR3,MR3,MR2 ; MR3 = e^(MANTISSA)= 1+Xm(1+(1+(Xm/3)*(1+(Xm/4)*(1+Xm/5*(1+Xm/6)*(1+Xm/7))))Xm/2)
; Step 4
MMPYF32 MR3,MR3,MR0 ; MR3 = e^(MANTISSA) x e^(INTEGER(X))
MMOV32 MR1,MR3,UNC
; Calculation of e^-x
MEINVF32 MR2,MR1 ; MR2 = Ye = Estimate(1/Den)
MMPYF32 MR3,MR2,MR1 ; MR3 = Ye*Den
MSUBF32 MR3,#2.0,MR3 ; MR3 = 2.0 - Ye*Den
MMPYF32 MR2,MR2,MR3 ; MR2 = Ye = Ye*(2.0 - Ye*Den)
MMPYF32 MR3,MR2,MR1 ; MR3 = Ye*Den
MSUBF32 MR3,#2.0,MR3 ; MR3 = 2.0 - Ye*Den
MMPYF32 MR2,MR2,MR3 ; MR2 = Ye = Ye*(2.0 - Ye*Den)
|| MMOV32 MR0,@_exp_tmp ; MR2 = X (set/clear NF,ZF)
; Context Restore and Final Operations
MRCNDD UNC
MMOV32 MR1,MR2,LT ; update e^X with inverse value
MMOV32 MR0,MR1 ; Store result in MR0
MMOV32 MR3,@_save_MR3
.unasg _save_MR3
.unasg _exp_tmp
.endasmfunc
;; End of File
|
Task/Sieve-of-Eratosthenes/Ada/sieve-of-eratosthenes.ada | LaudateCorpus1/RosettaCodeData | 1 | 16457 | with Ada.Text_IO, Ada.Command_Line;
procedure Eratos is
Last: Positive := Positive'Value(Ada.Command_Line.Argument(1));
Prime: array(1 .. Last) of Boolean := (1 => False, others => True);
Base: Positive := 2;
Cnt: Positive;
begin
loop
exit when Base * Base > Last;
if Prime(Base) then
Cnt := Base + Base;
loop
exit when Cnt > Last;
Prime(Cnt) := False;
Cnt := Cnt + Base;
end loop;
end if;
Base := Base + 1;
end loop;
Ada.Text_IO.Put("Primes less or equal" & Positive'Image(Last) &" are:");
for Number in Prime'Range loop
if Prime(Number) then
Ada.Text_IO.Put(Positive'Image(Number));
end if;
end loop;
end Eratos;
|
Coalg/M.agda | DDOtten/M-types | 0 | 5097 | <reponame>DDOtten/M-types<gh_stars>0
{-# OPTIONS --without-K #-}
open import M-types.Base
module M-types.Coalg.M {ℓ : Level} (A : Ty ℓ) (B : A → Ty ℓ) where
open import M-types.Coalg.Core A B
open import M-types.Coalg.Bisim A B
IsFinM : ∏[ M ∈ Coalg ] ∏[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
Ty (ℓ-suc ℓ)
IsFinM M coiter = ∏[ X ∈ Coalg ] ∏[ f ∈ CoalgMor X M ] f ≡ coiter X
FinM : Ty (ℓ-suc ℓ)
FinM = ∑[ M ∈ Coalg ] ∑[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
IsFinM M coiter
IsCohM : ∏[ M ∈ Coalg ] ∏[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
Ty (ℓ-suc ℓ)
IsCohM M coiter =
∏[ X ∈ Coalg ] ∏[ f₀ ∈ CoalgMor X M ] ∏[ f₁ ∈ CoalgMor X M ]
∑[ p ∈ fun f₀ ≡ fun f₁ ] ∏[ x ∈ ty X ]
ap (λ f → obs M (f x)) p · ≡-apply (com f₁) x ≡
≡-apply (com f₀) x · ap (λ f → P-Fun f (obs X x)) p
CohM : Ty (ℓ-suc ℓ)
CohM = ∑[ M ∈ Coalg ] ∑[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
IsCohM M coiter
IsBareM : ∏[ M ∈ Coalg ] ∏[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
Ty (ℓ-suc ℓ)
IsBareM M coiter =
∏[ X ∈ Coalg ] ∏[ f₀ ∈ CoalgMor X M ] ∏[ f₁ ∈ CoalgMor X M ]
(fun f₀ ≡ fun f₁)
BareM : Ty (ℓ-suc ℓ)
BareM = ∑[ M ∈ Coalg ] ∑[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
IsBareM M coiter
IsTyBisimM : ∏[ M ∈ Coalg ] ∏[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
Ty (ℓ-suc ℓ)
IsTyBisimM M coiter =
∏[ ∼ ∈ TyBisim M ] SpanRelMor (spanRel {M} ∼) ≡-spanRel
TyBisimM : Ty (ℓ-suc ℓ)
TyBisimM = ∑[ M ∈ Coalg ] ∑[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
IsTyBisimM M coiter
IsFunBisimM : ∏[ M ∈ Coalg ] ∏[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
Ty (ℓ-suc ℓ)
IsFunBisimM M coiter =
∏[ ∼ ∈ FunBisim M ] DepRelMor (depRel {M} ∼) ≡-depRel
FunBisimM : Ty (ℓ-suc ℓ)
FunBisimM = ∑[ M ∈ Coalg ] ∑[ coiter ∈ (∏[ X ∈ Coalg ] CoalgMor X M) ]
IsFunBisimM M coiter
FinM→CohM : {M : Coalg} {coiter : ∏[ X ∈ Coalg ] CoalgMor X M} →
IsFinM M coiter → IsCohM M coiter
FinM→CohM {M} {coiter} isFin = λ X → λ f₀ → λ f₁ →
coh (isFin X f₀ · isFin X f₁ ⁻¹)
where
coh : {X : Coalg} {f₀ f₁ : CoalgMor X M} →
(f₀ ≡ f₁) → (
∑[ p ∈ fun f₀ ≡ fun f₁ ] ∏[ x ∈ ty X ]
ap (λ f → obs M (f x)) p · ≡-apply (com f₁) x ≡
≡-apply (com f₀) x · ap (λ f → P-Fun f (obs X x)) p
)
coh {X} {f} {f} refl =
(
refl ,
λ x →
·-neutr₀ ( ≡-apply (com f) x) ·
·-neutr₁ ( ≡-apply (com f) x) ⁻¹
)
CohM→FinM : {M : Coalg} {coiter : ∏[ X ∈ Coalg ] CoalgMor X M} →
IsCohM M coiter → IsFinM M coiter
CohM→FinM {M} {coiter} isCoh = λ X → λ f →
fin (isCoh X f (coiter X))
where
fin : {X : Coalg} {f : CoalgMor X M} →
(
∑[ p ∈ fun f ≡ fun (coiter X) ] ∏[ x ∈ ty X ]
ap (λ f → obs M (f x)) p · ≡-apply (com (coiter X)) x ≡
≡-apply (com f) x · ap (λ f → P-Fun f (obs X x)) p
) → (f ≡ coiter X)
fin {X} {f} (refl , coh) =
≡-pair (
refl ,
(hom₀ (≡-apply , funext-axiom) (com f)) ⁻¹ ·
ap funext (funext (λ x →
(·-neutr₁ (≡-apply (com f) x)) ⁻¹ ·
(coh x) ⁻¹ ·
(·-neutr₀ (≡-apply (com (coiter X)) x))
)) ·
(hom₀ (≡-apply , funext-axiom) (com (coiter X)))
)
CohM→BareM : {M : Coalg} {coiter : ∏[ X ∈ Coalg ] CoalgMor X M} →
IsCohM M coiter → IsBareM M coiter
CohM→BareM {M} {coiter} isCoh = λ X → λ f₀ → λ f₁ → pr₀ (isCoh X f₀ f₁)
BareM→TyBisimM : {M : Coalg} {coiter : ∏[ X ∈ Coalg ] CoalgMor X M} →
IsBareM M coiter → IsTyBisimM M coiter
BareM→TyBisimM {M} {coiter} isBare = λ ∼ →
(
fun (ρ₀ ∼) ,
refl ,
isBare (ty ∼) (ρ₀ ∼) (ρ₁ ∼)
)
TyBisimM→BareM : {M : Coalg} {coiter : ∏[ X ∈ Coalg ] CoalgMor X M} →
IsTyBisimM M coiter → IsBareM M coiter
TyBisimM→BareM {M} {coiter} isTyBisim = λ X → λ f₀ → λ f₁ →
funext (λ x →
(≡-apply (com₀ (isTyBisim (X , f₀ , f₁))) x) ⁻¹ ·
(≡-apply (com₁ (isTyBisim (X , f₀ , f₁))) x)
)
TyBisimM→FunBisimM : {M : Coalg} {coiter : ∏[ X ∈ Coalg ] CoalgMor X M} →
IsTyBisimM M coiter → IsFunBisimM M coiter
TyBisimM→FunBisimM {M} {coiter} isTyBisim = λ ∼ → let
f : DepRelMor (depRel {M} ∼) (SpanRel→DepRel (DepRel→SpanRel (depRel {M} ∼)))
f = DepRel→DepRel-mor (depRel {M} ∼)
g : DepRelMor (SpanRel→DepRel (DepRel→SpanRel (depRel {M} ∼))) (SpanRel→DepRel ≡-spanRel)
g = SpanRelMor→DepRelMor (isTyBisim (FunBisim→TyBisim {M} ∼))
h : DepRelMor (SpanRel→DepRel ≡-spanRel) ≡-depRel
h = ≡-SpanRel→DepRel-mor
in
h ∘-depRel (g ∘-depRel f)
FunBisimM→TyBisimM : {M : Coalg} {coiter : ∏[ X ∈ Coalg ] CoalgMor X M} →
IsFunBisimM M coiter → IsTyBisimM M coiter
FunBisimM→TyBisimM {M} {coiter} isFunBisim = λ ∼ → let
f : SpanRelMor (spanRel {M} ∼) (DepRel→SpanRel (SpanRel→DepRel (spanRel {M} ∼)))
f = SpanRel→SpanRel-mor (spanRel {M} ∼)
g : SpanRelMor (DepRel→SpanRel (SpanRel→DepRel (spanRel {M} ∼))) (DepRel→SpanRel ≡-depRel)
g = DepRelMor→SpanRelMor (isFunBisim (TyBisim→FunBisim {M} ∼))
h : SpanRelMor (DepRel→SpanRel ≡-depRel) ≡-spanRel
h = ≡-DepRel→SpanRel-mor
in
-- h ∘-spanRel (g ∘-spanRel f)
_∘-spanRel_ {ℓ} {ty M} {spanRel {M} ∼} {DepRel→SpanRel ≡-depRel} {≡-spanRel}
h
(_∘-spanRel_ {ℓ} {ty M} {spanRel {M} ∼} {DepRel→SpanRel (SpanRel→DepRel (spanRel {M} ∼))} {DepRel→SpanRel ≡-depRel} g f)
|
programs/oeis/187/A187263.asm | jmorken/loda | 1 | 27314 | <reponame>jmorken/loda<filename>programs/oeis/187/A187263.asm
; A187263: Number of nonempty subsets of {1, 2, ..., n} with <=2 pairwise coprime elements.
; 1,3,6,9,14,17,24,29,36,41,52,57,70,77,86,95,112,119,138,147,160,171,194,203,224,237,256,269,298,307,338,355,376,393,418,431,468,487,512,529,570,583,626,647,672,695,742,759,802,823,856,881,934,953,994,1019,1056,1085,1144,1161,1222,1253,1290,1323,1372,1393,1460,1493,1538,1563,1634,1659,1732,1769,1810,1847,1908,1933,2012,2045,2100,2141,2224,2249,2314,2357,2414,2455,2544,2569,2642,2687,2748,2795,2868,2901,2998,3041,3102,3143,3244,3277,3380,3429,3478,3531,3638,3675,3784,3825,3898,3947,4060,4097,4186,4243,4316,4375,4472,4505,4616,4677,4758,4819,4920,4957,5084,5149,5234,5283,5414,5455,5564,5631,5704,5769,5906,5951,6090,6139,6232,6303,6424,6473,6586,6659,6744,6817,6966,7007,7158,7231,7328,7389,7510,7559,7716,7795,7900,7965,8098,8153,8316,8397,8478,8561,8728,8777,8934,8999,9108,9193,9366,9423,9544,9625,9742,9831,10010,10059,10240,10313,10434,10523,10668,10729,10890,10983,11092,11165,11356,11421,11614,11711,11808,11893,12090,12151,12350,12431,12564,12665,12834,12899,13060,13163,13296,13393,13574,13623,13834,13939,14080,14187,14356,14429,14610,14719,14864,14945,15138,15211,15434,15531,15652,15765,15992,16065,16294,16383,16504,16617,16850,16923,17108,17225,17382,17479,17718,17783,18024,18135,18298,18419,18588,18669,18886,19007,19172,19273
mov $6,$0
mov $8,$0
add $8,1
lpb $8
clr $0,6
mov $0,$6
sub $8,1
sub $0,$8
cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
add $0,1
add $2,$0
add $2,14
mov $1,$2
sub $1,15
mul $1,8
add $1,8
add $7,$1
lpe
mov $1,$7
sub $1,16
div $1,8
add $1,1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.