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 |
|---|---|---|---|---|
test/Succeed/fol-theorems/Definition12.agda | asr/apia | 10 | 4511 | ------------------------------------------------------------------------------
-- Testing the translation of definitions
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module Definition12 where
infixl 9 _·_
infix 7 _≡_
postulate
D : Set
_≡_ : D → D → Set
true if : D
_·_ : D → D → D
postulate if-true : ∀ d₁ {d₂} → if · true · d₁ · d₂ ≡ d₁
{-# ATP axiom if-true #-}
if_then_else_ : D → D → D → D
if b then d₁ else d₂ = if · b · d₁ · d₂
{-# ATP definition if_then_else_ #-}
-- We test the translation of a definition with holes.
postulate foo : ∀ d₁ d₂ → (if true then d₁ else d₂) ≡ d₁
{-# ATP prove foo #-}
|
cat/cat.asm | jhunt/opus-asm | 1 | 19905 | <gh_stars>1-10
;; vim:ft=nasm
;; cat - Read from standard input, write to standard output
global _start
section .text
_start:
;; argc is at RSP
;; argv stretches from RSP+8
;; to RSP+8 + (8 * argc)
mov r13, [rsp]
cmp r13, 1
je read1 ;; no arguments, use stdin
xor r12, r12
.next:
inc r12
cmp r13, r12
je .done
;; open(path, O_RDONLY)
mov rax, 2
mov rdi, [rsp+8+8*r12]
mov rsi, 0 ;; O_RDONLY
syscall
cmp rax, 0
jl .failed
mov [fd], rax
call read1
jmp .next
.failed:
;; exit(1)
mov rax, 60
mov rdi, 2
syscall
.done:
;; exit(0)
mov rax, 60
mov rdi, 2
syscall
read1:
.again:
;; read(fd, buf, len)
mov rax, 0
mov rdi, [fd]
mov rsi, buf
mov rdx, len
syscall
cmp rax, 0
je .done ;; RAX = 0 means nothing to reade
jl .failed ;; RAX < 0 means an error
.write:
;; write(1, buf, ...)
mov rdx, rax
mov rax, 1 ; has to be last, since return value of
; read(...) call was in RAX, which we need
; to pass to write(...) via RDX.
mov rdi, 1
;; NB: RSI is unchanged from the read(...) call
syscall
jmp .again
.done:
ret
.failed:
;; exit(1)
mov rax, 60
mov rdi, 1
syscall
section .data
fd dd 0
section .bss
len equ 8192
buf resb $len
|
oeis/130/A130569.asm | neoneye/loda-programs | 11 | 93534 | <filename>oeis/130/A130569.asm<gh_stars>10-100
; A130569: Numbers of the form k*2^m + 1 for k odd, m >=1, that are not Proth numbers (A080075) (2^m <= k).
; 7,11,15,19,21,23,27,29,31,35,37,39,43,45,47,51,53,55,59,61,63,67,69,71,73,75,77,79,83,85,87,89,91,93,95,99,101,103,105,107,109,111,115,117,119,121,123,125,127,131,133,135,137,139,141,143,147,149,151,153,155
mov $2,$0
lpb $0
mov $0,$2
mov $1,$2
add $1,1
add $3,1
div $0,$3
sub $0,$3
sub $0,2
mul $3,2
add $0,$3
add $1,$0
lpe
mul $1,2
mov $0,$1
add $0,7
|
src/my_package.adb | thierr26/gnatdoc_test | 0 | 1148 | <filename>src/my_package.adb
package body My_Package is
----------------------------------------------------------------------------
function My_Function (A : Arr) return Boolean
is (for all Z in A'Range => A(Z) = A(A'First));
----------------------------------------------------------------------------
not overriding
function Create return My_Implementation is
begin
return (others => <>);
end Create;
----------------------------------------------------------------------------
overriding
function My_Primitive (Obj : in out My_Implementation) return Count is
Ret : Count;
begin
if Obj.K = 0 then
Ret := Obj.Prev_Prev_Term;
elsif Obj.K = 1 then
Ret := Obj.Prev_Term;
elsif Count'Last - Obj.Prev_Term < Obj.Prev_Prev_Term then
raise My_Package_Range_Error with "Cannot compute "
& Count'Image (Obj.K + 1) & "th Fibonacci number";
else
Ret := Obj.Prev_Prev_Term + Obj.Prev_Term;
Obj.Prev_Prev_Term := Obj.Prev_Term;
Obj.Prev_Term := Ret;
end if;
Obj.K := Obj.K + 1;
return Ret;
end My_Primitive;
----------------------------------------------------------------------------
end My_Package;
|
Mockingbird/Problems/Chapter09.agda | splintah/combinatory-logic | 1 | 17271 | <filename>Mockingbird/Problems/Chapter09.agda
open import Mockingbird.Forest using (Forest)
-- To Mock a Mockingbird
module Mockingbird.Problems.Chapter09 {b ℓ} (forest : Forest {b} {ℓ}) where
open import Data.Product using (_,_; proj₁; proj₂; ∃-syntax)
open import Function using (_$_)
open import Level using (_⊔_)
open import Relation.Nullary using (¬_)
open import Mockingbird.Forest.Birds forest
open Forest forest
module _ ⦃ _ : HasComposition ⦄ ⦃ _ : HasMockingbird ⦄ where
problem₁ : ∀ A → ∃[ B ] A IsFondOf B
problem₁ A =
let C = A ∘ M
isFond : A IsFondOf (C ∙ C)
isFond = sym $ begin
C ∙ C ≈⟨ isComposition A M C ⟩
A ∙ (M ∙ C) ≈⟨ congˡ (isMockingbird C) ⟩
A ∙ (C ∙ C) ∎
in (C ∙ C , isFond)
module _ ⦃ _ : HasComposition ⦄ ⦃ _ : HasMockingbird ⦄ where
problem₂ : ∃[ E ] IsEgocentric E
problem₂ =
let (E , isFond) = problem₁ M
isEgocentric : IsEgocentric E
isEgocentric = begin
E ∙ E ≈˘⟨ isMockingbird E ⟩
M ∙ E ≈⟨ isFond ⟩
E ∎
in (E , isEgocentric)
module _ ⦃ _ : HasComposition ⦄ (hasAgreeable : ∃[ A ] IsAgreeable A) where
A = proj₁ hasAgreeable
isAgreeable = proj₂ hasAgreeable
problem₃ : ∀ B → ∃[ C ] B IsFondOf C
problem₃ B =
let D = B ∘ A
(x , Ax≈Dx) = isAgreeable D
isFond : B IsFondOf (A ∙ x)
isFond = begin
B ∙ (A ∙ x) ≈˘⟨ isComposition B A x ⟩
D ∙ x ≈˘⟨ Ax≈Dx ⟩
A ∙ x ∎
in (A ∙ x , isFond)
-- Bonus question of Problem 3.
C₂→HasAgreeable : ⦃ _ : HasMockingbird ⦄ → ∃[ A ] IsAgreeable A
C₂→HasAgreeable = (M , λ B → (B , isMockingbird B))
module _ ⦃ _ : HasComposition ⦄ (A B C : Bird) (Cx≈A[Bx] : IsComposition A B C) where
problem₄ : IsAgreeable C → IsAgreeable A
problem₄ C-isAgreeable D =
let E = D ∘ B
(x , Cx≈Ex) = C-isAgreeable E
agree : Agree A D (B ∙ x)
agree = begin
A ∙ (B ∙ x) ≈˘⟨ Cx≈A[Bx] x ⟩
C ∙ x ≈⟨ Cx≈Ex ⟩
E ∙ x ≈⟨ isComposition D B x ⟩
D ∙ (B ∙ x) ∎
in (B ∙ x , agree)
module _ ⦃ _ : HasComposition ⦄ where
problem₅ : ∀ A B C → ∃[ D ] (∀ x → D ∙ x ≈ A ∙ (B ∙ (C ∙ x)))
problem₅ A B C =
let E = B ∘ C
D = A ∘ E
in (D , λ x → trans (isComposition A E x) $ congˡ (isComposition B C x))
module _ ⦃ _ : HasComposition ⦄ ⦃ _ : HasMockingbird ⦄ where
problem₆ : ∀ A B → Compatible A B
problem₆ A B =
let C = A ∘ B
(y , Cy≈y) = problem₁ C
x = B ∙ y
in (x , y , trans (sym (isComposition A B y)) Cy≈y , refl)
problem₇ : ∀ A → ∃[ B ] A IsFondOf B → IsHappy A
problem₇ A (B , AB≈B) = (B , B , AB≈B , AB≈B)
-- problem₇ : ∀ A → IsNormal A → IsHappy A
module _ ⦃ _ : HasComposition ⦄ where
problem₈ : ∃[ H ] IsHappy H → ∃[ N ] IsNormal N
problem₈ (H , x , y , Hx≈y , Hy≈x) =
let N = H ∘ H
isFond : N IsFondOf x
isFond = begin
N ∙ x ≈⟨ isComposition H H x ⟩
H ∙ (H ∙ x) ≈⟨ congˡ Hx≈y ⟩
H ∙ y ≈⟨ Hy≈x ⟩
x ∎
in (N , x , isFond)
module _ ⦃ _ : HasComposition ⦄ ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasKestrel ⦄ where
problem₉ : ∃[ A ] IsHopelesslyEgocentric A
problem₉ =
let (A , KA≈A) = problem₁ K
isHopelesslyEgocentric : IsHopelesslyEgocentric A
isHopelesslyEgocentric x = begin
A ∙ x ≈˘⟨ congʳ KA≈A ⟩
(K ∙ A) ∙ x ≈⟨ isKestrel A x ⟩
A ∎
in (A , isHopelesslyEgocentric)
problem₁₀ : ∀ x y → x IsFixatedOn y → x IsFondOf y
problem₁₀ x y xz≈y = xz≈y y
problem₁₁ : ∀ K → IsKestrel K → IsEgocentric K → IsHopelesslyEgocentric K
problem₁₁ K isKestrel KK≈K x = begin
K ∙ x ≈˘⟨ congʳ KK≈K ⟩
(K ∙ K) ∙ x ≈⟨ isKestrel K x ⟩
K ∎
problem₁₂ : ⦃ _ : HasKestrel ⦄ → ∀ x → IsEgocentric (K ∙ x) → K IsFondOf x
problem₁₂ x [Kx][Kx]≈Kx = begin
K ∙ x ≈˘⟨ [Kx][Kx]≈Kx ⟩
(K ∙ x) ∙ (K ∙ x) ≈⟨ isKestrel x (K ∙ x) ⟩
x ∎
problem₁₃ : ∀ A x y → IsHopelesslyEgocentric A → A ∙ x ≈ A ∙ y
problem₁₃ A x y Az≈A = begin
A ∙ x ≈⟨ Az≈A x ⟩
A ≈˘⟨ Az≈A y ⟩
A ∙ y ∎
problem₁₄ : ∀ A x y → IsHopelesslyEgocentric A → (A ∙ x) ∙ y ≈ A
problem₁₄ A x y Az≈A = begin
(A ∙ x) ∙ y ≈⟨ congʳ (Az≈A x) ⟩
A ∙ y ≈⟨ Az≈A y ⟩
A ∎
problem₁₅ : ∀ A x → IsHopelesslyEgocentric A → IsHopelesslyEgocentric (A ∙ x)
problem₁₅ A x Az≈A y = begin
(A ∙ x) ∙ y ≈⟨ congʳ (Az≈A x) ⟩
A ∙ y ≈⟨ Az≈A y ⟩
A ≈˘⟨ Az≈A x ⟩
A ∙ x ∎
problem₁₆ : ∀ K → IsKestrel K → ∀ x y → K ∙ x ≈ K ∙ y → x ≈ y
problem₁₆ K isKestrel x y Kx≈Ky = begin
x ≈˘⟨ isKestrel x K ⟩
-- NOTE: for the right-most kestrel, we can choose any bird. (Since we know
-- only of three birds to exist here, the only option is a combination of
-- {K, x, y}).
(K ∙ x) ∙ K ≈⟨ congʳ Kx≈Ky ⟩
(K ∙ y) ∙ K ≈⟨ isKestrel y K ⟩
y ∎
problem₁₇ : ∀ A x y → A IsFixatedOn x → A IsFixatedOn y → x ≈ y
problem₁₇ A x y Az≈x Az≈y = begin
x ≈˘⟨ Az≈x A ⟩
-- NOTE: for the right-most A, we can choose any bird. (In this case a
-- combination of {A, B, C}).
A ∙ A ≈⟨ Az≈y A ⟩
y ∎
problem₁₈ : ⦃ _ : HasKestrel ⦄ → ∀ x → K IsFondOf K ∙ x → K IsFondOf x
problem₁₈ x K[Kx]≈Kx = begin
K ∙ x ≈˘⟨ isKestrel (K ∙ x) x ⟩
-- NOTE: for the right-most x, we can choose any bird.
(K ∙ (K ∙ x)) ∙ x ≈⟨ congʳ K[Kx]≈Kx ⟩
(K ∙ x) ∙ x ≈⟨ isKestrel x x ⟩
x ∎
-- In the circumstances of Problem 19, the only bird in the forest is the
-- kestrel.
problem₁₉ : ∀ K → IsKestrel K → IsEgocentric K → ∀ x → x ≈ K
problem₁₉ K isKestrel KK≈K x = begin
x ≈⟨ lemma x x ⟩
K ∙ x ≈˘⟨ congʳ KK≈K ⟩
(K ∙ K) ∙ x ≈⟨ isKestrel K x ⟩
K ∎
where
lemma : ∀ y z → y ≈ K ∙ z
lemma y z = begin
y ≈˘⟨ isKestrel y z ⟩
(K ∙ y) ∙ z ≈˘⟨ congʳ (congʳ KK≈K) ⟩
((K ∙ K) ∙ y) ∙ z ≈⟨ congʳ (isKestrel K y) ⟩
K ∙ z ∎
module _ ⦃ _ : HasIdentity ⦄ where
problem₂₀ : IsAgreeable I → ∀ A → ∃[ B ] A IsFondOf B
problem₂₀ isAgreeable A =
let (B , IB≈AB) = isAgreeable A
isFond : A IsFondOf B
isFond = begin
A ∙ B ≈˘⟨ IB≈AB ⟩
I ∙ B ≈⟨ isIdentity B ⟩
B ∎
in (B , isFond)
problem₂₁ : (∀ A → ∃[ B ] A IsFondOf B) → IsAgreeable I
problem₂₁ isFond A =
let (B , AB≈B) = isFond A
agree : I ∙ B ≈ A ∙ B
agree = begin
I ∙ B ≈⟨ isIdentity B ⟩
B ≈˘⟨ AB≈B ⟩
A ∙ B ∎
in (B , agree)
problem₂₂-1 : (∀ A B → Compatible A B) → ∀ A → IsNormal A
problem₂₂-1 compatible A =
let (x , y , Ix≈y , Ay≈x) = compatible I A
isFond : A IsFondOf y
isFond = begin
A ∙ y ≈⟨ Ay≈x ⟩
x ≈˘⟨ isIdentity x ⟩
I ∙ x ≈⟨ Ix≈y ⟩
y ∎
in (y , isFond)
problem₂₂-2 : (∀ A B → Compatible A B) → IsAgreeable I
problem₂₂-2 compatible A =
let (x , y , Ix≈y , Ay≈x) = compatible I A
agree : Agree I A y
agree = begin
I ∙ y ≈⟨ isIdentity y ⟩
y ≈˘⟨ Ix≈y ⟩
I ∙ x ≈⟨ isIdentity x ⟩
x ≈˘⟨ Ay≈x ⟩
A ∙ y ∎
in (y , agree)
problem₂₃ : IsHopelesslyEgocentric I → ∀ x → I ≈ x
problem₂₃ isHopelesslyEgocentric x = begin
I ≈˘⟨ isHopelesslyEgocentric x ⟩
I ∙ x ≈⟨ isIdentity x ⟩
x ∎
module _ ⦃ _ : HasLark ⦄ ⦃ _ : HasIdentity ⦄ where
problem₂₄ : HasMockingbird
problem₂₄ = record
{ M = L ∙ I
; isMockingbird = λ x → begin
(L ∙ I) ∙ x ≈⟨ isLark I x ⟩
I ∙ (x ∙ x) ≈⟨ isIdentity (x ∙ x) ⟩
x ∙ x ∎
}
module _ ⦃ _ : HasLark ⦄ where
problem₂₅ : ∀ x → IsNormal x
problem₂₅ x =
let isFond : x IsFondOf (L ∙ x) ∙ (L ∙ x)
isFond = begin
x ∙ ((L ∙ x) ∙ (L ∙ x)) ≈˘⟨ isLark x (L ∙ x) ⟩
(L ∙ x) ∙ (L ∙ x) ∎
in ((L ∙ x) ∙ (L ∙ x) , isFond)
problem₂₆ : IsHopelesslyEgocentric L → ∀ x → x IsFondOf L
problem₂₆ isHopelesslyEgocentric x = begin
x ∙ L ≈˘⟨ congˡ $ isHopelesslyEgocentric L ⟩
x ∙ (L ∙ L) ≈˘⟨ isLark x L ⟩
(L ∙ x) ∙ L ≈⟨ congʳ $ isHopelesslyEgocentric x ⟩
L ∙ L ≈⟨ isHopelesslyEgocentric L ⟩
L ∎
module _ ⦃ _ : HasLark ⦄ ⦃ _ : HasKestrel ⦄ where
problem₂₇ : L ≉ K → ¬ L IsFondOf K
problem₂₇ L≉K isFond =
let K-fondOf-KK : K IsFondOf K ∙ K
K-fondOf-KK = begin
K ∙ (K ∙ K) ≈˘⟨ congʳ isFond ⟩
(L ∙ K) ∙ (K ∙ K) ≈⟨ isLark K (K ∙ K) ⟩
K ∙ ((K ∙ K) ∙ (K ∙ K)) ≈⟨ congˡ $ isKestrel K (K ∙ K) ⟩
K ∙ K ∎
isEgocentric : IsEgocentric K
isEgocentric = problem₁₈ K K-fondOf-KK
L≈K : L ≈ K
L≈K = problem₁₉ K isKestrel isEgocentric L
in L≉K L≈K
problem₂₈ : K IsFondOf L → ∀ x → x IsFondOf L
problem₂₈ KL≈L =
let isHopelesslyEgocentric : IsHopelesslyEgocentric L
isHopelesslyEgocentric y = begin
L ∙ y ≈˘⟨ congʳ KL≈L ⟩
(K ∙ L) ∙ y ≈⟨ isKestrel L y ⟩
L ∎
in problem₂₆ isHopelesslyEgocentric
module _ ⦃ _ : HasLark ⦄ where
problem₂₉ : ∃[ x ] IsEgocentric x
problem₂₉ =
let (y , [LL]y≈y) = problem₂₅ (L ∙ L)
isEgocentric : IsEgocentric (y ∙ y)
isEgocentric = begin
(y ∙ y) ∙ (y ∙ y) ≈˘⟨ isLark (y ∙ y) y ⟩
(L ∙ (y ∙ y)) ∙ y ≈˘⟨ congʳ (isLark L y) ⟩
((L ∙ L) ∙ y) ∙ y ≈⟨ congʳ [LL]y≈y ⟩
y ∙ y ∎
-- The expression of yy in terms of L and brackets.
_ : y ∙ y ≈ ((L ∙ (L ∙ L)) ∙ (L ∙ (L ∙ L))) ∙ ((L ∙ (L ∙ L)) ∙ (L ∙ (L ∙ L)))
_ = refl
in (y ∙ y , isEgocentric)
|
formula/BaserowFormula.g4 | ashishdhngr/baserow | 1 | 1230 | <reponame>ashishdhngr/baserow
parser grammar BaserowFormula;
options { tokenVocab=BaserowFormulaLexer; }
// ANTLR's starting point when parsing a given string. Can be read as
// "Parse a string that fits the 'expr' grammar definition followed by the end of the
// file"
root
: expr EOF
;
// The core recursive grammar definition for the Baserow Formula language. Given a
// string ANTLR will work down through the rules separated by |s and seeing if the
// string matches any (matching the first one that fits).
// Notice that expr is defined by referencing itself letting users construct complex
// arbitrarily nested expressions.
// The CAPITAL_LETTER_VARIABLES are tokens defined in the BaserowFormulaLexer.g4 file.
// The '# StringLiteral' postfixes label separate rules into the same "labels".
// When the code gen then runs the resulting Visitor will have a visitLabel
// method which will be called for any nodes that result from any rule with that label.
// This lets us group multiple different rules into logical useful groups that we want
// to visit later on in the actual code.
// Also note that the order of the rules controls expression execution precedence.
// So because the SLASH binary op is in it's own rule it means a 1+1/2 will result in
// 1/2 being executed before 1+expr.
expr
:
SINGLEQ_STRING_LITERAL # StringLiteral
| DOUBLEQ_STRING_LITERAL # StringLiteral
| INTEGER_LITERAL # IntegerLiteral
| NUMERIC_LITERAL # DecimalLiteral
| (TRUE | FALSE) # BooleanLiteral
| ws_or_comment expr # LeftWhitespaceOrComments
| expr ws_or_comment # RightWhitespaceOrComments
| OPEN_PAREN expr CLOSE_PAREN # Brackets
| expr op=(SLASH | STAR) expr # BinaryOp
| expr op=(PLUS | MINUS) expr # BinaryOp
| expr op=(GT | LT | GTE | LTE) expr # BinaryOp
| expr op=(EQUAL | BANG_EQUAL) expr # BinaryOp
| FIELD OPEN_PAREN field_reference CLOSE_PAREN # FieldReference
// FIELDBYID has been depricated and should not be used, it is only included here
// for backwards compatability.
| FIELDBYID OPEN_PAREN INTEGER_LITERAL CLOSE_PAREN # FieldByIdReference
| LOOKUP OPEN_PAREN field_reference COMMA WHITESPACE? field_reference CLOSE_PAREN # LookupFieldReference
| func_name OPEN_PAREN (expr (COMMA expr)*)? CLOSE_PAREN # FunctionCall
;
ws_or_comment
: BLOCK_COMMENT
| LINE_COMMENT
| WHITESPACE
;
func_name
: identifier
;
field_reference
: SINGLEQ_STRING_LITERAL
| DOUBLEQ_STRING_LITERAL
;
identifier
: IDENTIFIER
| IDENTIFIER_UNICODE
;
|
Control/Monad/Levels/Zipping.agda | oisdk/agda-playground | 6 | 7516 | {-# OPTIONS --cubical --safe #-}
module Control.Monad.Levels.Zipping where
open import Prelude
open import Control.Monad.Levels.Definition
open import Control.Monad.Levels.Eliminators
open import Data.Bag
open import Path.Reasoning
open import Cubical.Foundations.HLevels using (isOfHLevelΠ)
zip₂-alg : Levels-ϕ[ A ](⟅ A ⟆ → (Levels A → Levels A) → Levels A)
[ zip₂-alg ]-set = isOfHLevelΠ 2 λ _ → isOfHLevelΠ 2 λ _ → trunc
[ zip₂-alg ] y ∷ ys ⟨ _ ⟩ x xs = (x ∪ y) ∷ xs ys
[ zip₂-alg ][] x xs = x ∷ xs []
[ zip₂-alg ]-trail i x xs = ∪-idʳ x i ∷ xs []
zip₂-alg-id : Levels-ψ[ xs ⦂ A ]≡ ((zip₂-alg ↓ xs) [] id ⊜ xs)
⟦ zip₂-alg-id ⟧≡ x ∷ xs ⟨ Pxs ⟩ = refl
⟦ zip₂-alg-id ⟧≡[] = trail
zip-alg : Levels-ϕ[ A ] (Levels A → Levels A)
[ zip-alg ]-set = isOfHLevelΠ 2 λ _ → trunc
[ zip-alg ] x ∷ _ ⟨ k ⟩ ys = (zip₂-alg ↓ ys) x k
[ zip-alg ][] ys = ys
[ zip-alg ]-trail = funExt (zip₂-alg-id ⇓≡_)
zip : Levels A → Levels A → Levels A
zip xs = zip-alg ↓ xs
zip-idʳ : Levels-ψ[ xs ⦂ A ]≡ zip xs [] ⊜ xs
⟦ zip-idʳ ⟧≡ x ∷ xs ⟨ Pxs ⟩ = cong (x ∷_) Pxs
⟦ zip-idʳ ⟧≡[] = refl
mutual
zip₂-comm : (x : ⟅ A ⟆) (xs : Levels A) (pxs : ∀ ys → zip xs ys ≡ zip ys xs) → Levels-ψ[ ys ⦂ A ]≡ (zip (x ∷ xs) ys ⊜ zip ys (x ∷ xs))
⟦ zip₂-comm x xs pxs ⟧≡[] = zip-idʳ ⇓≡ (x ∷ xs)
⟦ zip₂-comm x xs pxs ⟧≡ y ∷ ys ⟨ Pys ⟩ = cong₂ _∷_ (∪-comm x y) (pxs ys)
zip-comm : Levels-ψ[ xs ⦂ A ] (∀ ys → zip xs ys ≡ zip ys xs)
∥ zip-comm ∥-prop = isOfHLevelΠ 1 λ _ → trunc _ _
∥ zip-comm ∥[] ys = sym (zip-idʳ ⇓≡ ys)
∥ zip-comm ∥ x ∷ xs ⟨ Pxs ⟩ ys = zip₂-comm x xs Pxs ⇓≡ ys
zip₃-assoc : (x : ⟅ A ⟆) (xs : Levels A) (pxs : ∀ ys zs → zip (zip xs ys) zs ≡ zip xs (zip ys zs)) →
(y : ⟅ A ⟆) (ys : Levels A) →
Levels-ψ[ zs ⦂ A ]≡ (zip (zip (x ∷ xs) (y ∷ ys)) zs ⊜ zip (x ∷ xs) (zip (y ∷ ys) zs))
⟦ zip₃-assoc x xs pxs y ys ⟧≡[] = (zip-idʳ ⇓≡ (zip (x ∷ xs) (y ∷ ys))) ; cong (zip (x ∷ xs)) (sym (zip-idʳ ⇓≡ (y ∷ ys)))
⟦ zip₃-assoc x xs pxs y ys ⟧≡ z ∷ zs ⟨ _ ⟩ = cong₂ _∷_ (∪-assoc x y z) (pxs ys zs)
zip₂-assoc : (x : ⟅ A ⟆) (xs : Levels A) (pxs : ∀ ys zs → zip (zip xs ys) zs ≡ zip xs (zip ys zs)) →
Levels-ψ[ ys ⦂ A ] (∀ zs → zip (zip (x ∷ xs) ys) zs ≡ zip (x ∷ xs) (zip ys zs))
∥ zip₂-assoc x xs pxs ∥-prop = isOfHLevelΠ 1 λ _ → trunc _ _
∥ zip₂-assoc x xs pxs ∥[] zs = cong (λ xs → zip xs zs) (zip-idʳ ⇓≡ (x ∷ xs))
∥ zip₂-assoc x xs pxs ∥ y ∷ ys ⟨ _ ⟩ zs = zip₃-assoc x xs pxs y ys ⇓≡ zs
zip-assoc : Levels-ψ[ xs ⦂ A ] (∀ ys zs → zip (zip xs ys) zs ≡ zip xs (zip ys zs))
∥ zip-assoc ∥-prop = isOfHLevelΠ 1 λ _ → isOfHLevelΠ 1 λ _ → trunc _ _
∥ zip-assoc ∥ x ∷ xs ⟨ Pxs ⟩ ys zs = ∥ zip₂-assoc x xs Pxs ∥⇓ ys zs
∥ zip-assoc ∥[] _ _ = refl
open import Algebra
module _ {a} {A : Type a} where
levels-cmon : CommutativeMonoid a
Monoid.𝑆 (CommutativeMonoid.monoid levels-cmon) = Levels A
Monoid._∙_ (CommutativeMonoid.monoid levels-cmon) = zip
Monoid.ε (CommutativeMonoid.monoid levels-cmon) = []
Monoid.assoc (CommutativeMonoid.monoid levels-cmon) = ∥ zip-assoc ∥⇓
Monoid.ε∙ (CommutativeMonoid.monoid levels-cmon) _ = refl
Monoid.∙ε (CommutativeMonoid.monoid levels-cmon) xs = zip-idʳ ⇓≡ xs
CommutativeMonoid.comm levels-cmon = ∥ zip-comm ∥⇓
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt38_pkg.adb | best08618/asylo | 7 | 1644 | package body Opt38_Pkg is
procedure Proc (I : Integer);
pragma Inline (Proc);
procedure Proc (I : Integer) is
procedure Inner;
pragma No_Inline (Inner);
procedure Inner is
begin
if I /= 110 then
raise Program_Error;
end if;
end;
begin
if I > 0 then
Inner;
end if;
end;
procedure Test (I : Integer) is
begin
if I > -1 then
Proc (I);
else
Proc (I + 111);
end if;
end;
end Opt38_Pkg;
|
roomloading.asm | Catobat/z3randomizer | 0 | 12446 | <reponame>Catobat/z3randomizer
LoadRoomHook:
JSL.l IndoorTileTransitionCounter
.noStats
JSL Dungeon_LoadRoom
REP #$10 ; 16 bit XY
LDX $A0 ; Room ID
LDA.l RoomCallbackTable, X
SEP #$10 ; 8 bit XY
JSL UseImplicitRegIndexedLongJumpTable
; Callback routines:
dl NoCallback ; 00
dl IcePalaceBombosSE ; 01
dl IcePalaceBombosSW ; 02
dl IcePalaceBombosNE ; 03
dl CastleEastEntrance ; 04
dl CastleWestEntrance ; 05
NoCallback:
RTL
!RL_TILE = 2
!RL_LINE = 128
macro setTilePointer(roomX, roomY, quadX, quadY)
; Left-to-right math. Should be equivalent to 0x7e2000+(roomX*2)+(roomY*128)+(quadX*64)+(quadY*4096)
LDX.w #<quadY>*32+<roomY>*2+<quadX>*32+<roomX>*2
endmacro
macro writeTile()
STA.l $7E2000,x
INX #2
endmacro
macro writeTileAt(roomX, roomY, quadX, quadY)
STA.l <quadY>*32+<roomY>*2+<quadX>*32+<roomX>*2+$7E2000
endmacro
!BOMBOS_BORDER = #$08D0
!BOMBOS_ICON_1 = #$0CCA
!BOMBOS_ICON_2 = #$0CCB
!BOMBOS_ICON_3 = #$0CDA
!BOMBOS_ICON_4 = #$0CDB
macro DrawBombosPlatform(roomX, roomY, quadX, quadY)
REP #$30 ; 16 AXY
%setTilePointer(<roomX>, <roomY>, <quadX>, <quadY>)
LDA.w !BOMBOS_BORDER
%writeTile()
%writeTile()
%writeTile()
%writeTile()
%setTilePointer(<roomX>, <roomY>+1, <quadX>, <quadY>)
%writeTile()
LDA.w !BOMBOS_ICON_1 : %writeTile()
LDA.w !BOMBOS_ICON_2 : %writeTile()
LDA.w !BOMBOS_BORDER : %writeTile()
%setTilePointer(<roomX>, <roomY>+2, <quadX>, <quadY>)
%writeTile()
LDA.w !BOMBOS_ICON_3 : %writeTile()
LDA.w !BOMBOS_ICON_4 : %writeTile()
LDA.w !BOMBOS_BORDER : %writeTile()
%setTilePointer(<roomX>, <roomY>+3, <quadX>, <quadY>)
%writeTile()
%writeTile()
%writeTile()
%writeTile()
SEP #$30 ; 8 AXY
endMacro
IcePalaceBombosSE:
LDA AllowSwordlessMedallionUse : BNE + : RTL : +
%DrawBombosPlatform(14, 18, 1, 1)
RTL
IcePalaceBombosSW:
LDA AllowSwordlessMedallionUse : BNE + : RTL : +
%DrawBombosPlatform(14, 18, 0, 1)
RTL
IcePalaceBombosNE:
LDA AllowSwordlessMedallionUse : BNE + : RTL : +
%DrawBombosPlatform(14, 18, 1, 0)
RTL
CastleEastEntrance:
LDA $7EF3C5 : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1)
LDA.l BlockCastleDoorsInRain : BNE + : RTL : +
REP #$20 ; 16 A
LDA.w #$08e1 ; square peg
%writeTileAt(11,21,0,1)
%writeTileAt(11,26,0,1)
%writeTileAt(20,21,0,1)
%writeTileAt(20,26,0,1)
INC ;horizontal rail
%writeTileAt(12,21,0,1)
%writeTileAt(13,21,0,1)
%writeTileAt(14,21,0,1)
%writeTileAt(15,21,0,1)
%writeTileAt(16,21,0,1)
%writeTileAt(17,21,0,1)
%writeTileAt(18,21,0,1)
%writeTileAt(19,21,0,1)
INC ;vertical rail
%writeTileAt(11,22,0,1)
%writeTileAt(11,23,0,1)
%writeTileAt(11,24,0,1)
%writeTileAt(11,25,0,1)
%writeTileAt(20,22,0,1)
%writeTileAt(20,23,0,1)
%writeTileAt(20,24,0,1)
%writeTileAt(20,25,0,1)
SEP #$20 ; 8 A
RTL
CastleWestEntrance:
LDA $7EF3C5 : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1)
LDA.l BlockCastleDoorsInRain : BNE + : RTL : +
REP #$20 ; 16 A
LDA.w #$08e1 ; square peg
%writeTileAt(11,21,1,1)
%writeTileAt(11,26,1,1)
%writeTileAt(20,21,1,1)
%writeTileAt(20,26,1,1)
INC ;horizontal rail
%writeTileAt(12,21,1,1)
%writeTileAt(13,21,1,1)
%writeTileAt(14,21,1,1)
%writeTileAt(15,21,1,1)
%writeTileAt(16,21,1,1)
%writeTileAt(17,21,1,1)
%writeTileAt(18,21,1,1)
%writeTileAt(19,21,1,1)
INC ;vertical rail
%writeTileAt(11,22,1,1)
%writeTileAt(11,23,1,1)
%writeTileAt(11,24,1,1)
%writeTileAt(11,25,1,1)
%writeTileAt(20,22,1,1)
%writeTileAt(20,23,1,1)
%writeTileAt(20,24,1,1)
%writeTileAt(20,25,1,1)
SEP #$20 ; 8 A
RTL
RoomCallbackTable:
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $01, $00 ; 00x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 01x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 02x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 03x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 04x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 05x
db $05, $00, $04, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 06x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $02, $00 ; 07x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 08x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 09x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0Ax
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0Bx
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0Cx
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $03, $00 ; 0Dx
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0Ex
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0Fx
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0Fx
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 10x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 11x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 12x |
programs/oeis/122/A122606.asm | karttu/loda | 0 | 349 | ; A122606: n^(n+1) mod 7.
; 0,1,1,4,2,1,6,0,1,2,5,1,5,1,0,1,4,1,4,4,6,0,1,1,3,2,6,1,0,1,2,2,1,2,6,0,1,4,6,4,3,1,0,1,1,4,2,1,6,0,1,2,5,1,5,1,0,1,4,1,4,4,6,0,1,1,3,2,6,1,0,1,2,2,1,2,6,0,1,4,6,4,3,1,0,1,1,4,2,1,6,0,1,2,5,1,5,1,0,1,4,1,4,4,6
mov $1,$0
mov $2,$0
lpb $0,1
sub $0,1
mul $1,$2
mod $1,7
lpe
|
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_1411.asm | ljhsiun2/medusa | 9 | 242733 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_1411.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xe20d, %rdx
sub $21021, %rdi
movl $0x61626364, (%rdx)
nop
nop
nop
nop
cmp $54084, %r9
lea addresses_normal_ht+0x4585, %rsi
lea addresses_A_ht+0x1244d, %rdi
nop
nop
nop
nop
nop
and $36321, %r9
mov $48, %rcx
rep movsl
nop
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_normal_ht+0x1d835, %rsi
lea addresses_A_ht+0x492c, %rdi
nop
xor $38329, %r9
mov $15, %rcx
rep movsq
and $60152, %rbp
lea addresses_normal_ht+0xea8d, %rbp
nop
nop
nop
cmp $58228, %r11
movb $0x61, (%rbp)
nop
nop
nop
sub $8750, %rdx
lea addresses_normal_ht+0x1960d, %r11
nop
nop
nop
nop
cmp $52172, %r9
vmovups (%r11), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %rsi
add $54946, %rcx
lea addresses_WC_ht+0x1160d, %r11
nop
nop
add %rcx, %rcx
mov (%r11), %rsi
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0x10c9e, %rdi
nop
nop
inc %r9
movw $0x6162, (%rdi)
nop
nop
nop
inc %rdx
lea addresses_WT_ht+0x1950d, %rsi
lea addresses_A_ht+0x15d8d, %rdi
clflush (%rsi)
nop
nop
xor %r14, %r14
mov $73, %rcx
rep movsq
nop
nop
nop
xor $33917, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rcx
push %rdx
// Load
lea addresses_WC+0x1465d, %r13
nop
cmp $26866, %r11
movups (%r13), %xmm3
vpextrq $1, %xmm3, %rcx
nop
nop
nop
nop
nop
dec %r11
// Faulty Load
lea addresses_RW+0x1d60d, %r9
dec %r11
movb (%r9), %r13b
lea oracles, %r8
and $0xff, %r13
shlq $12, %r13
mov (%r8,%r13,1), %r13
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
plugins/mvtools/src/asm/Variance.asm | darcyg/vapoursynth-plugins | 0 | 17370 | %include "include/x86inc.asm"
SECTION_TEXT
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro VAR4x4 0
movd m0, [srcpq] ; first line
movd m1, [srcpq + strideq] ; second line
movd m4, [srcpq + strideq * 2] ; third line
movd m5, [srcpq + stride3q] ; fourth line
psadbw m0, m7
psadbw m1, m6
psadbw m4, m7
psadbw m5, m6
paddw m0, m4
paddw m1, m5
paddw m0, m1
%endmacro
INIT_XMM
cglobal Luma4x4_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR4x4
movd eax, m0
RET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro VAR8x4 0
movq m0, [srcpq] ; first line
movq m1, [srcpq + strideq] ; second line
movq m4, [srcpq + strideq * 2] ; third line
movq m5, [srcpq + stride3q] ; fourth line
psadbw m0, m7
psadbw m1, m6
psadbw m4, m7
psadbw m5, m6
paddw m0, m4
paddw m1, m5
paddw m0, m1
%endmacro
INIT_XMM
cglobal Luma8x4_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR8x4
movd eax, m0
RET
; mm7 and mm6 must be times 8 db mean
; mm0 will be the var
; mm0..mm7 are used
%macro VAR8x8 0
movq m0, [srcpq] ; first line
movq m1, [srcpq + strideq] ; second line
movq m4, [srcpq + strideq * 2] ; third line
movq m5, [srcpq + stride3q] ; fourth line
psadbw m0, m7
psadbw m1, m6
psadbw m4, m7
psadbw m5, m6
paddw m0, m4
paddw m1, m5
lea srcpq, [srcpq + strideq * 4] ;
movq m2, [srcpq] ; fifth line
movq m3, [srcpq + strideq] ; sixth line
movq m4, [srcpq + strideq * 2] ; seventh line
movq m5, [srcpq + stride3q] ; eighth line
psadbw m2, m7
psadbw m3, m6
psadbw m4, m7
psadbw m5, m6
paddw m0, m2
paddw m1, m3
paddw m0, m4
paddw m1, m5
paddw m0, m1
%endmacro
INIT_XMM
cglobal Luma8x8_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR8x8
movd eax, m0
RET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro VAR16x2 0
movdqu m0, [srcpq]
movdqu m1, [srcpq + strideq]
psadbw m0, m6
psadbw m1, m7
paddd m0, m1
movdqa m1, m0
psrldq m1, 8
paddd m0, m1
%endmacro
INIT_XMM
cglobal Luma16x2_sse2, 2, 2, 8, srcp, stride
pxor m6, m6
pxor m7, m7
VAR16x2
movd eax, m0
RET
%macro VAR16x4 0
movdqu m2, [srcpq]
movdqu m3, [srcpq + strideq]
movdqu m4, [srcpq + strideq * 2]
movdqu m5, [srcpq + stride3q]
psadbw m2, m6
psadbw m3, m7
psadbw m4, m6
psadbw m5, m7
lea srcpq, [srcpq + strideq * 4]
paddd m0, m2
paddd m1, m3
paddd m0, m4
paddd m1, m5
%endmacro
%macro VAR16x8 0
pxor m0, m0
pxor m1, m1
VAR16x4
VAR16x4
paddd m0, m1
movdqa m1, m0
psrldq m1, 8
paddd m0, m1
%endmacro
INIT_XMM
cglobal Luma16x8_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR16x8
movd eax, m0
RET
%macro VAR16x16 0
pxor m0, m0
pxor m1, m1
VAR16x4
VAR16x4
VAR16x4
VAR16x4
paddd m0, m1
movdqa m1, m0
psrldq m1, 8
paddd m0, m1
%endmacro
INIT_XMM
cglobal Luma16x16_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR16x16
movd eax, m0
RET
%macro VAR16x32 0
pxor m0, m0
pxor m1, m1
VAR16x4
VAR16x4
VAR16x4
VAR16x4
VAR16x4
VAR16x4
VAR16x4
VAR16x4
paddd m0, m1
movdqa m1, m0
psrldq m1, 8
paddd m0, m1
%endmacro
INIT_XMM
cglobal Luma16x32_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR16x32
movd eax, m0
RET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro VAR32x2 0
movdqu m2, [srcpq]
movdqu m3, [srcpq + 16]
movdqu m4, [srcpq + strideq]
movdqu m5, [srcpq + strideq + 16]
psadbw m2, m6
psadbw m3, m7
psadbw m4, m6
psadbw m5, m7
lea srcpq, [srcpq + strideq * 2]
paddd m0, m2
paddd m1, m3
paddd m0, m4
paddd m1, m5
%endmacro
%macro VAR32x16 0
pxor m0, m0
pxor m1, m1
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
paddd m0, m1
movdqa m1, m0
psrldq m1, 8
paddd m0, m1
%endmacro
INIT_XMM
cglobal Luma32x16_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR32x16
movd eax, m0
RET
%macro VAR32x32 0
pxor m0, m0
pxor m1, m1
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
VAR32x2
paddd m0, m1
movdqa m1, m0
psrldq m1, 8
paddd m0, m1
%endmacro
INIT_XMM
cglobal Luma32x32_sse2, 2, 3, 8, srcp, stride, stride3
lea stride3q, [strideq * 3]
pxor m6, m6
pxor m7, m7
VAR32x32
movd eax, m0
RET
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_41.asm | ljhsiun2/medusa | 9 | 89246 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x6e80, %rsi
lea addresses_D_ht+0x1b144, %rdi
clflush (%rsi)
nop
nop
sub %r13, %r13
mov $106, %rcx
rep movsb
nop
mfence
lea addresses_A_ht+0x12d40, %r14
nop
cmp %r10, %r10
mov $0x6162636465666768, %rdi
movq %rdi, (%r14)
nop
nop
nop
nop
cmp %r10, %r10
lea addresses_D_ht+0xb640, %rcx
nop
nop
nop
nop
xor %rdi, %rdi
mov $0x6162636465666768, %r13
movq %r13, %xmm0
vmovups %ymm0, (%rcx)
nop
nop
nop
nop
nop
and $45485, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r9
push %rax
push %rbx
push %rdi
push %rsi
// Faulty Load
lea addresses_A+0x6940, %r12
nop
nop
nop
xor $41028, %r9
mov (%r12), %si
lea oracles, %rax
and $0xff, %rsi
shlq $12, %rsi
mov (%rax,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': True, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}}
{'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
*/
|
tiles_top.ids.asm | zorchenhimer/nes-parallax | 2 | 24328 | : .word 448
:
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 47, 48, 49, 50, 51, 52, 53, 54, 0, 0, 0, 0, 0, 0, 0, 55, 56, 46, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 67, 68, 69, 43, 43, 43, 70, 71, 72, 54, 0, 0, 0, 0, 24, 73, 74, 75, 76, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 83, 84, 85, 43, 86, 87, 88, 89, 90, 91, 0, 0, 24, 92, 93, 94, 95, 96, 97, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 106, 107, 79, 108, 79, 79, 109, 110, 43, 111, 0, 0, 112, 113, 114, 115, 116, 117, 118, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 130, 131, 132, 133, 134, 79, 79, 135, 136, 137, 46, 0, 138, 139, 140, 141, 142, 143, 144, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 157, 43, 158, 43, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 79, 173, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 187, 188, 189, 190, 191, 192, 39, 193, 79, 194, 79, 195, 196, 197, 198, 79, 199, 200, 201, 202, 203, 204, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 211, 212, 213, 214, 215, 39, 216, 79, 79, 79, 217, 218, 219, 220, 221, 222, 223, 39, 39, 39, 224, 225, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 232, 233, 79, 234, 39, 39, 235, 236, 237, 238, 39, 239, 240, 241, 39, 39, 39, 39, 39, 39, 39, 242, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 243, 244, 245, 246, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 248, 249, 0, 0, 0, 0, 0, 0
: .word 448
:
.byte 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 16, 17, 18, 19, 20, 21, 22, 23, 0, 0, 0, 0, 24, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, 42, 43, 44, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 57, 58, 39, 59, 60, 0, 0, 0, 0, 0, 61, 62, 63, 64, 65, 66, 46, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 78, 79, 80, 81, 79, 82, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 84, 99, 100, 101, 79, 102, 0, 0, 0, 103, 104, 105, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 120, 121, 122, 123, 79, 79, 124, 125, 54, 126, 127, 128, 129, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 146, 147, 148, 149, 150, 79, 79, 151, 152, 153, 154, 155, 156, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174, 175, 79, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 205, 79, 79, 206, 39, 39, 39, 39, 207, 39, 39, 39, 208, 209, 210, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 227, 228, 229, 39, 39, 39, 39, 39, 39, 39, 39, 230, 79, 231, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
target/analysis/Func00401DD0.asm | katahiromz/DecodersTatami | 3 | 88614 | proc Func00401DD0@4 Label_00401DD0
attrs [[cdecl]][[stdcall]]
# call_from : 004014C0
# call_to : 00401BF0 00401C20 00401C80 00402660 00402850 00402894
# jump_to : 00401DE3 00401DF0 00401E4D 00401E58 00401E80 00401E98 00401EA7 00401EF0 00401F20 00401F31 00401F60 00401F80 00401FAC 00401FC0 00401FCC 00401FF0 00401FF5 00402010 00402045 0040204F 00402090 004020B0 004020F1 004020F8 00402130 00402132 00402140 00402157 00402170 004021B0 004021CF 004021EB
Label_00401DD0:
00401DD0: 55 : push ebp
00401DD1: 89 E5 : mov ebp, esp
00401DD3: 57 : push edi
00401DD4: 56 : push esi
00401DD5: 53 : push ebx
00401DD6: 83 EC 3C : sub esp, 0x3c
00401DD9: 8B 35 9C 53 40 00 : mov esi, [0x40539c]
00401DDF: 85 F6 : test esi, esi
00401DE1: 74 0D : jz Label_00401DF0
Label_00401DE3:
00401DE3: 8D 65 F4 : lea esp, [ebp-0xc] # jump_from : 00401E37 00401E77 00401F68 00401FFB
00401DE6: 5B : pop ebx
00401DE7: 5E : pop esi
00401DE8: 5F : pop edi
00401DE9: 5D : pop ebp
00401DEA: C3 : ret
Label_00401DF0:
00401DF0: BF 01 00 00 00 : mov edi, 0x1 # jump_from : 00401DE1
00401DF5: 89 3D 9C 53 40 00 : mov [0x40539c], edi
00401DFB: E8 60 08 00 00 : call Func00402660@4
00401E00: 8D 04 80 : lea eax, [eax+eax*4]
00401E03: 8D 04 85 1B 00 00 00 : lea eax, [eax*4+0x1b]
00401E0A: C1 E8 04 : shr eax, 0x4
00401E0D: C1 E0 04 : shl eax, 0x4
00401E10: E8 3B 0A 00 00 : call Func00402850@4
00401E15: 29 C4 : sub esp, eax
00401E17: 8D 44 24 1F : lea eax, [esp+0x1f]
00401E1B: 83 E0 F0 : and eax, 0xfffffff0
00401E1E: A3 A4 53 40 00 : mov [0x4053a4], eax
00401E23: 31 C0 : xor eax, eax
00401E25: A3 A0 53 40 00 : mov [0x4053a0], eax
00401E2A: B8 70 45 40 00 : mov eax, 0x404570
00401E2F: 2D 70 45 40 00 : sub eax, 0x404570
00401E34: 83 F8 07 : cmp eax, 0x7
00401E37: 7E AA : jle Label_00401DE3
00401E39: 83 F8 0B : cmp eax, 0xb
00401E3C: 8B 15 70 45 40 00 : mov edx, [0x404570]
00401E42: 0F 8F A8 00 00 00 : jg Label_00401EF0
00401E48: BB 70 45 40 00 : mov ebx, 0x404570
Label_00401E4D:
00401E4D: 85 D2 : test edx, edx # jump_from : 00401F16
00401E4F: 0F 85 A0 01 00 00 : jnz Label_00401FF5
00401E55: 8B 43 04 : mov eax, [ebx+0x4]
Label_00401E58:
00401E58: 85 C0 : test eax, eax # jump_from : 0040204A
00401E5A: 0F 85 95 01 00 00 : jnz Label_00401FF5
00401E60: 8B 43 08 : mov eax, [ebx+0x8]
00401E63: 83 F8 01 : cmp eax, 0x1
00401E66: 0F 85 E3 01 00 00 : jnz Label_0040204F
00401E6C: 83 C3 0C : add ebx, 0xc
00401E6F: 81 FB 70 45 40 00 : cmp ebx, 0x404570
00401E75: 72 30 : jb Label_00401EA7
00401E77: E9 67 FF FF FF : jmp Label_00401DE3
Label_00401E80:
00401E80: 8B 45 D4 : mov eax, [ebp-0x2c] # jump_from : 00401ECD
00401E83: 29 C2 : sub edx, eax
00401E85: 8B 07 : mov eax, [edi]
00401E87: 01 C2 : add edx, eax
00401E89: 89 F8 : mov eax, edi
00401E8B: 89 55 D4 : mov [ebp-0x2c], edx
00401E8E: E8 ED FD FF FF : call Func00401C80@4
00401E93: 8B 55 D4 : mov edx, [ebp-0x2c]
00401E96: 89 17 : mov [edi], edx
Label_00401E98:
00401E98: 83 C3 0C : add ebx, 0xc # jump_from : 00401FE3
00401E9B: 81 FB 70 45 40 00 : cmp ebx, 0x404570
00401EA1: 0F 83 B9 00 00 00 : jae Label_00401F60
Label_00401EA7:
00401EA7: 8B 03 : mov eax, [ebx] # jump_from : 00401E75 00401F51
00401EA9: 8B 4B 04 : mov ecx, [ebx+0x4]
00401EAC: 8D 90 00 00 40 00 : lea edx, [eax+0x400000]
00401EB2: 89 55 D4 : mov [ebp-0x2c], edx
00401EB5: 8B 90 00 00 40 00 : mov edx, [eax+0x400000]
00401EBB: 8D B9 00 00 40 00 : lea edi, [ecx+0x400000]
00401EC1: 0F B6 43 08 : movzx eax, byte [ebx+0x8]
00401EC5: 83 F8 10 : cmp eax, 0x10
00401EC8: 74 56 : jz Label_00401F20
00401ECA: 83 F8 20 : cmp eax, 0x20
00401ECD: 74 B1 : jz Label_00401E80
00401ECF: 83 F8 08 : cmp eax, 0x8
00401ED2: 0F 84 E8 00 00 00 : jz Label_00401FC0
00401ED8: 89 44 24 04 : mov [esp+0x4], eax
00401EDC: C7 04 24 34 42 40 00 : mov dword [esp], 0x404234
00401EE3: E8 38 FD FF FF : call Func00401C20@4
00401EE8: 8D B4 26 00 00 00 00 : lea esi, [esi]
00401EEF: 90 : nop
Label_00401EF0:
00401EF0: 85 D2 : test edx, edx # jump_from : 00401E42
00401EF2: 0F 85 F8 00 00 00 : jnz Label_00401FF0
00401EF8: A1 74 45 40 00 : mov eax, [0x404574]
00401EFD: 89 C1 : mov ecx, eax
00401EFF: 0B 0D 78 45 40 00 : or ecx, [0x404578]
00401F05: 0F 85 3A 01 00 00 : jnz Label_00402045
00401F0B: 8B 15 7C 45 40 00 : mov edx, [0x40457c]
00401F11: BB 7C 45 40 00 : mov ebx, 0x40457c
00401F16: E9 32 FF FF FF : jmp Label_00401E4D
Label_00401F20:
00401F20: 0F B7 81 00 00 40 00 : movzx eax, word [ecx+0x400000] # jump_from : 00401EC8
00401F27: F6 C4 80 : test ah, 0x80
00401F2A: 74 05 : jz Label_00401F31
00401F2C: 0D 00 00 FF FF : or eax, 0xffff0000
Label_00401F31:
00401F31: 8B 4D D4 : mov ecx, [ebp-0x2c] # jump_from : 00401F2A
00401F34: 83 C3 0C : add ebx, 0xc
00401F37: 29 C8 : sub eax, ecx
00401F39: 01 D0 : add eax, edx
00401F3B: 89 45 D4 : mov [ebp-0x2c], eax
00401F3E: 89 F8 : mov eax, edi
00401F40: E8 3B FD FF FF : call Func00401C80@4
00401F45: 8B 45 D4 : mov eax, [ebp-0x2c]
00401F48: 81 FB 70 45 40 00 : cmp ebx, 0x404570
00401F4E: 66 89 07 : mov [edi], ax
00401F51: 0F 82 50 FF FF FF : jb Label_00401EA7
00401F57: 8D B4 26 00 00 00 00 : lea esi, [esi]
00401F5E: 66 90 : nop
Label_00401F60:
00401F60: 8B 1D A0 53 40 00 : mov ebx, [0x4053a0] # jump_from : 00401EA1 00402040
00401F66: 85 DB : test ebx, ebx
00401F68: 0F 8E 75 FE FF FF : jle Label_00401DE3
00401F6E: 8B 1D 98 61 40 00 : mov ebx, [0x406198]
00401F74: 8D 7D E4 : lea edi, [ebp-0x1c]
00401F77: 8D B4 26 00 00 00 00 : lea esi, [esi]
00401F7E: 66 90 : nop
Label_00401F80:
00401F80: 8B 15 A4 53 40 00 : mov edx, [0x4053a4] # jump_from : 00401FB3
00401F86: 8D 04 B6 : lea eax, [esi+esi*4]
00401F89: 8D 04 82 : lea eax, [edx+eax*4]
00401F8C: 8B 10 : mov edx, [eax]
00401F8E: 85 D2 : test edx, edx
00401F90: 74 1A : jz Label_00401FAC
00401F92: 89 7C 24 0C : mov [esp+0xc], edi
00401F96: 89 54 24 08 : mov [esp+0x8], edx
00401F9A: 8B 50 08 : mov edx, [eax+0x8]
00401F9D: 89 54 24 04 : mov [esp+0x4], edx
00401FA1: 8B 40 04 : mov eax, [eax+0x4]
00401FA4: 89 04 24 : mov [esp], eax
00401FA7: FF D3 : call ebx
00401FA9: 83 EC 10 : sub esp, 0x10
Label_00401FAC:
00401FAC: 46 : inc esi # jump_from : 00401F90
00401FAD: 3B 35 A0 53 40 00 : cmp esi, [0x4053a0]
00401FB3: 7C CB : jl Label_00401F80
00401FB5: 8D 65 F4 : lea esp, [ebp-0xc]
00401FB8: 5B : pop ebx
00401FB9: 5E : pop esi
00401FBA: 5F : pop edi
00401FBB: 5D : pop ebp
00401FBC: C3 : ret
Label_00401FC0:
00401FC0: 0F B6 07 : movzx eax, byte [edi] # jump_from : 00401ED2
00401FC3: 84 C0 : test al, al
00401FC5: 79 05 : jns Label_00401FCC
00401FC7: 0D 00 FF FF FF : or eax, 0xffffff00
Label_00401FCC:
00401FCC: 8B 4D D4 : mov ecx, [ebp-0x2c] # jump_from : 00401FC5
00401FCF: 29 C8 : sub eax, ecx
00401FD1: 01 D0 : add eax, edx
00401FD3: 89 45 D4 : mov [ebp-0x2c], eax
00401FD6: 89 F8 : mov eax, edi
00401FD8: E8 A3 FC FF FF : call Func00401C80@4
00401FDD: 0F B6 45 D4 : movzx eax, byte [ebp-0x2c]
00401FE1: 88 07 : mov [edi], al
00401FE3: E9 B0 FE FF FF : jmp Label_00401E98
Label_00401FF0:
00401FF0: BB 70 45 40 00 : mov ebx, 0x404570 # jump_from : 00401EF2
Label_00401FF5:
00401FF5: 81 FB 70 45 40 00 : cmp ebx, 0x404570 # jump_from : 00401E4F 00401E5A
00401FFB: 0F 83 E2 FD FF FF : jae Label_00401DE3
00402001: 8D B4 26 00 00 00 00 : lea esi, [esi]
00402008: 8D B4 26 00 00 00 00 : lea esi, [esi]
0040200F: 90 : nop
Label_00402010:
00402010: 8B 7B 04 : mov edi, [ebx+0x4] # jump_from : 0040203E
00402013: 83 C3 08 : add ebx, 0x8
00402016: 8B 53 F8 : mov edx, [ebx-0x8]
00402019: 8B 8F 00 00 40 00 : mov ecx, [edi+0x400000]
0040201F: 8D 87 00 00 40 00 : lea eax, [edi+0x400000]
00402025: 01 CA : add edx, ecx
00402027: 89 55 D4 : mov [ebp-0x2c], edx
0040202A: E8 51 FC FF FF : call Func00401C80@4
0040202F: 8B 55 D4 : mov edx, [ebp-0x2c]
00402032: 81 FB 70 45 40 00 : cmp ebx, 0x404570
00402038: 89 97 00 00 40 00 : mov [edi+0x400000], edx
0040203E: 72 D0 : jb Label_00402010
00402040: E9 1B FF FF FF : jmp Label_00401F60
Label_00402045:
00402045: BB 70 45 40 00 : mov ebx, 0x404570 # jump_from : 00401F05
0040204A: E9 09 FE FF FF : jmp Label_00401E58
Label_0040204F:
0040204F: 89 44 24 04 : mov [esp+0x4], eax # jump_from : 00401E66
00402053: C7 04 24 00 42 40 00 : mov dword [esp], 0x404200
0040205A: E8 C1 FB FF FF : call Func00401C20@4
0040205F: 90 : nop
00402060: 53 : push ebx
00402061: 83 EC 18 : sub esp, 0x18
00402064: 8B 5C 24 20 : mov ebx, [esp+0x20]
00402068: 8B 03 : mov eax, [ebx]
0040206A: 8B 00 : mov eax, [eax]
0040206C: 3D 91 00 00 C0 : cmp eax, 0xc0000091
00402071: 76 3D : jbe Label_004020B0
00402073: 3D 94 00 00 C0 : cmp eax, 0xc0000094
00402078: 0F 84 C2 00 00 00 : jz Label_00402140
0040207E: 3D 96 00 00 C0 : cmp eax, 0xc0000096
00402083: 74 73 : jz Label_004020F8
00402085: 3D 93 00 00 C0 : cmp eax, 0xc0000093
0040208A: 0F 84 E0 00 00 00 : jz Label_00402170
Label_00402090:
00402090: A1 AC 53 40 00 : mov eax, [0x4053ac] # jump_from : 004020DF 004020F6 00402115 00402159
00402095: 85 C0 : test eax, eax
00402097: 0F 84 93 00 00 00 : jz Label_00402130
0040209D: 89 5C 24 20 : mov [esp+0x20], ebx
004020A1: 83 C4 18 : add esp, 0x18
004020A4: 5B : pop ebx
004020A5: FF E0 : jmp eax
Label_004020B0:
004020B0: 3D 8D 00 00 C0 : cmp eax, 0xc000008d # jump_from : 00402071
004020B5: 0F 83 B5 00 00 00 : jae Label_00402170
004020BB: 3D 05 00 00 C0 : cmp eax, 0xc0000005
004020C0: 75 2F : jnz Label_004020F1
004020C2: C7 04 24 0B 00 00 00 : mov dword [esp], 0xb
004020C9: 31 C0 : xor eax, eax
004020CB: 89 44 24 04 : mov [esp+0x4], eax
004020CF: E8 C0 07 00 00 : call msvcrt.dll!signal@4
004020D4: 83 F8 01 : cmp eax, 0x1
004020D7: 0F 84 0E 01 00 00 : jz Label_004021EB
004020DD: 85 C0 : test eax, eax
004020DF: 74 AF : jz Label_00402090
004020E1: C7 04 24 0B 00 00 00 : mov dword [esp], 0xb
004020E8: FF D0 : call eax
004020EA: B8 FF FF FF FF : mov eax, 0xffffffff
004020EF: EB 41 : jmp Label_00402132
Label_004020F1:
004020F1: 3D 1D 00 00 C0 : cmp eax, 0xc000001d # jump_from : 004020C0
004020F6: 75 98 : jnz Label_00402090
Label_004020F8:
004020F8: C7 04 24 04 00 00 00 : mov dword [esp], 0x4 # jump_from : 00402083
004020FF: 31 C0 : xor eax, eax
00402101: 89 44 24 04 : mov [esp+0x4], eax
00402105: E8 8A 07 00 00 : call msvcrt.dll!signal@4
0040210A: 83 F8 01 : cmp eax, 0x1
0040210D: 0F 84 BC 00 00 00 : jz Label_004021CF
00402113: 85 C0 : test eax, eax
00402115: 0F 84 75 FF FF FF : jz Label_00402090
0040211B: C7 04 24 04 00 00 00 : mov dword [esp], 0x4
00402122: FF D0 : call eax
00402124: B8 FF FF FF FF : mov eax, 0xffffffff
00402129: EB 07 : jmp Label_00402132
Label_00402130:
00402130: 31 C0 : xor eax, eax # jump_from : 00402097
Label_00402132:
00402132: 83 C4 18 : add esp, 0x18 # jump_from : 004020EF 00402129 0040216D 004021A6 004021CA 004021E6 00402202
00402135: 5B : pop ebx
00402136: C2 04 00 : ret 0x4
Label_00402140:
00402140: C7 04 24 08 00 00 00 : mov dword [esp], 0x8 # jump_from : 00402078
00402147: 31 C0 : xor eax, eax
00402149: 89 44 24 04 : mov [esp+0x4], eax
0040214D: E8 42 07 00 00 : call msvcrt.dll!signal@4
00402152: 83 F8 01 : cmp eax, 0x1
00402155: 74 59 : jz Label_004021B0
Label_00402157:
00402157: 85 C0 : test eax, eax # jump_from : 00402185
00402159: 0F 84 31 FF FF FF : jz Label_00402090
0040215F: C7 04 24 08 00 00 00 : mov dword [esp], 0x8
00402166: FF D0 : call eax
00402168: B8 FF FF FF FF : mov eax, 0xffffffff
0040216D: EB C3 : jmp Label_00402132
Label_00402170:
00402170: C7 04 24 08 00 00 00 : mov dword [esp], 0x8 # jump_from : 0040208A 004020B5
00402177: 31 C0 : xor eax, eax
00402179: 89 44 24 04 : mov [esp+0x4], eax
0040217D: E8 12 07 00 00 : call msvcrt.dll!signal@4
00402182: 83 F8 01 : cmp eax, 0x1
00402185: 75 D0 : jnz Label_00402157
00402187: C7 04 24 08 00 00 00 : mov dword [esp], 0x8
0040218E: BA 01 00 00 00 : mov edx, 0x1
00402193: 89 54 24 04 : mov [esp+0x4], edx
00402197: E8 F8 06 00 00 : call msvcrt.dll!signal@4
0040219C: E8 4F FA FF FF : call Func00401BF0@4
004021A1: B8 FF FF FF FF : mov eax, 0xffffffff
004021A6: EB 8A : jmp Label_00402132
Label_004021B0:
004021B0: C7 04 24 08 00 00 00 : mov dword [esp], 0x8 # jump_from : 00402155
004021B7: B9 01 00 00 00 : mov ecx, 0x1
004021BC: 89 4C 24 04 : mov [esp+0x4], ecx
004021C0: E8 CF 06 00 00 : call msvcrt.dll!signal@4
004021C5: B8 FF FF FF FF : mov eax, 0xffffffff
004021CA: E9 63 FF FF FF : jmp Label_00402132
Label_004021CF:
004021CF: C7 44 24 04 01 00 00 00 : mov dword [esp+0x4], 0x1 # jump_from : 0040210D
004021D7: C7 04 24 04 00 00 00 : mov dword [esp], 0x4
004021DE: E8 B1 06 00 00 : call msvcrt.dll!signal@4
004021E3: 83 C8 FF : or eax, 0xffffffff
004021E6: E9 47 FF FF FF : jmp Label_00402132
Label_004021EB:
004021EB: C7 44 24 04 01 00 00 00 : mov dword [esp+0x4], 0x1 # jump_from : 004020D7
004021F3: C7 04 24 0B 00 00 00 : mov dword [esp], 0xb
004021FA: E8 95 06 00 00 : call msvcrt.dll!signal@4
004021FF: 83 C8 FF : or eax, 0xffffffff
00402202: E9 2B FF FF FF : jmp Label_00402132
end proc
|
programs/oeis/283/A283968.asm | karttu/loda | 0 | 89780 | <gh_stars>0
; A283968: a(n) = a(n-1) + 1 + floor(n*(3 + sqrt(5))/2), a(0) = 1.
; 1,2,3,5,7,9,12,15,19,23,27,32,37,42,48,54,61,68,75,83,91,100,109,118,128,138,148,159,170,182,194,206,219,232,245,259,273,288,303,318,334,350,367,384,401,419,437,455,474,493,513,533,553,574,595,617,639,661,684,707,730,754,778,803,828,853,879,905,931,958,985,1013,1041,1069,1098,1127,1157,1187,1217,1248,1279,1310,1342,1374,1407,1440,1473,1507,1541,1575,1610,1645,1681,1717,1753,1790,1827,1865,1903,1941,1980,2019,2058,2098,2138,2179,2220,2261,2303,2345,2388,2431,2474,2518,2562,2606,2651,2696,2742,2788,2834,2881,2928,2975,3023,3071,3120,3169,3218,3268,3318,3369,3420,3471,3523,3575,3627,3680,3733,3787,3841,3895,3950,4005,4061,4117,4173,4230,4287,4344,4402,4460,4519,4578,4637,4697,4757,4817,4878,4939,5001,5063,5125,5188,5251,5315,5379,5443,5508,5573,5638,5704,5770,5837,5904,5971,6039,6107,6175,6244,6313,6383,6453,6523,6594,6665,6737,6809,6881,6954,7027,7100,7174,7248,7323,7398,7473,7549,7625,7702,7779,7856,7934,8012,8090,8169,8248,8328,8408,8488,8569,8650,8731,8813,8895,8978,9061,9144,9228,9312,9397,9482,9567,9653,9739,9825,9912,9999,10087,10175,10263,10352,10441,10530,10620,10710,10801,10892,10983,11075,11167,11260,11353,11446,11540,11634,11728,11823,11918,12014
mov $2,$0
add $2,1
mov $4,$0
lpb $2,1
mov $0,$4
sub $2,1
sub $0,$2
mov $3,$0
cal $3,60144 ; a(n) = floor(n/(1+tau)), or equivalently floor(n/(tau)^2), where tau is the golden ratio (A001622).
mov $0,$3
add $0,1
add $1,$0
lpe
|
data/jpred4/jp_batch_1613899824__5o_dC5V/jp_batch_1613899824__5o_dC5V.als | jonriege/predict-protein-structure | 0 | 3049 | <filename>data/jpred4/jp_batch_1613899824__5o_dC5V/jp_batch_1613899824__5o_dC5V.als
SILENT_MODE
BLOCK_FILE jp_batch_1613899824__5o_dC5V.concise.blc
MAX_NSEQ 103
MAX_INPUT_LEN 105
OUTPUT_FILE jp_batch_1613899824__5o_dC5V.concise.ps
PORTRAIT
POINTSIZE 8
IDENT_WIDTH 12
X_OFFSET 2
Y_OFFSET 2
DEFINE_FONT 0 Helvetica DEFAULT
DEFINE_FONT 1 Helvetica REL 0.75
DEFINE_FONT 7 Helvetica REL 0.6
DEFINE_FONT 3 Helvetica-Bold DEFAULT
DEFINE_FONT 4 Times-Bold DEFAULT
DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT
#
DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose
DEFINE_COLOUR 4 1 1 0 # Yellow
DEFINE_COLOUR 5 1 0 0 # Red
DEFINE_COLOUR 7 1 0 1 # Purple
DEFINE_COLOUR 8 0 0 1 # Blue
DEFINE_COLOUR 9 0 1 0 # Green
DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue
DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green
DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix)
DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand)
NUMBER_INT 10
SETUP
#
# Highlight specific residues.
# Avoid highlighting Lupas 'C' predictions by
# limiting the highlighting to the alignments
Scol_CHARS C 1 1 199 92 4
Ccol_CHARS H ALL 5
Ccol_CHARS P ALL 8
SURROUND_CHARS LIV ALL
#
# Replace known structure types with whitespace
SUB_CHARS 1 93 199 102 H SPACE
SUB_CHARS 1 93 199 102 E SPACE
SUB_CHARS 1 93 199 102 - SPACE
STRAND 5 96 18
COLOUR_TEXT_REGION 5 96 18 96 51
STRAND 24 96 30
COLOUR_TEXT_REGION 24 96 30 96 51
STRAND 49 96 60
COLOUR_TEXT_REGION 49 96 60 96 51
STRAND 69 96 74
COLOUR_TEXT_REGION 69 96 74 96 51
STRAND 121 96 126
COLOUR_TEXT_REGION 121 96 126 96 51
STRAND 139 96 140
COLOUR_TEXT_REGION 139 96 140 96 51
STRAND 157 96 159
COLOUR_TEXT_REGION 157 96 159 96 51
STRAND 162 96 167
COLOUR_TEXT_REGION 162 96 167 96 51
STRAND 178 96 190
COLOUR_TEXT_REGION 178 96 190 96 51
HELIX 38 96 43
COLOUR_TEXT_REGION 38 96 43 96 50
HELIX 86 96 89
COLOUR_TEXT_REGION 86 96 89 96 50
STRAND 5 101 18
COLOUR_TEXT_REGION 5 101 18 101 51
STRAND 24 101 31
COLOUR_TEXT_REGION 24 101 31 101 51
STRAND 49 101 60
COLOUR_TEXT_REGION 49 101 60 101 51
STRAND 69 101 74
COLOUR_TEXT_REGION 69 101 74 101 51
STRAND 121 101 126
COLOUR_TEXT_REGION 121 101 126 101 51
STRAND 139 101 141
COLOUR_TEXT_REGION 139 101 141 101 51
STRAND 158 101 159
COLOUR_TEXT_REGION 158 101 159 101 51
STRAND 162 101 167
COLOUR_TEXT_REGION 162 101 167 101 51
STRAND 178 101 189
COLOUR_TEXT_REGION 178 101 189 101 51
HELIX 39 101 43
COLOUR_TEXT_REGION 39 101 43 101 50
HELIX 86 101 89
COLOUR_TEXT_REGION 86 101 89 101 50
STRAND 6 102 16
COLOUR_TEXT_REGION 6 102 16 102 51
STRAND 50 102 61
COLOUR_TEXT_REGION 50 102 61 102 51
STRAND 69 102 74
COLOUR_TEXT_REGION 69 102 74 102 51
STRAND 121 102 126
COLOUR_TEXT_REGION 121 102 126 102 51
STRAND 157 102 159
COLOUR_TEXT_REGION 157 102 159 102 51
STRAND 161 102 167
COLOUR_TEXT_REGION 161 102 167 102 51
STRAND 178 102 190
COLOUR_TEXT_REGION 178 102 190 102 51
HELIX 37 102 44
COLOUR_TEXT_REGION 37 102 44 102 50
HELIX 86 102 89
COLOUR_TEXT_REGION 86 102 89 102 50
|
handlers.adb | cborao/Ada-P4-chat | 0 | 6082 | <reponame>cborao/Ada-P4-chat
--PRÁCTICA 4: <NAME> (Handlers.adb)
with Ada.Text_IO;
with Chat_Messages;
with Chat_Procedures;
with Ada.Strings.Unbounded;
package body Handlers is
package ATI renames Ada.Text_IO;
package CM renames Chat_Messages;
package CP renames Chat_Procedures;
package ASU renames Ada.Strings.Unbounded;
procedure Client_Handler(From: in LLU.End_Point_Type;
To: in LLU.End_Point_Type;
P_Buffer: access LLU.Buffer_Type) is
Mess: CM.Message_Type;
Nick: ASU.Unbounded_String;
Comment: ASU.Unbounded_String;
begin
Mess := CM.Message_Type'Input(P_Buffer);
Nick := ASU.Unbounded_String'Input(P_Buffer);
Comment := ASU.Unbounded_String'Input(P_Buffer);
ATI.New_Line;
ATI.Put_Line(ASU.To_String(Nick) & ": " & ASU.To_String(Comment));
LLU.Reset(P_Buffer.all);
ATI.Put(">> ");
end Client_Handler;
procedure Server_Handler (From: in LLU.End_Point_Type;
To: in LLU.End_Point_Type;
P_Buffer: access LLU.Buffer_Type) is
Mess: CM.Message_Type;
Buffer_Out: aliased LLU.Buffer_Type(1024);
begin
Mess := CM.Message_Type'Input (P_Buffer);
case Mess is
when CM.Init =>
CP.Case_Init(P_Buffer,Buffer_Out'Access);
when CM.Writer =>
CP.Case_Writer(P_Buffer,Buffer_Out'Access);
when CM.Logout =>
CP.Case_Logout(P_Buffer,Buffer_Out'Access);
when others =>
ATI.Put_Line("Unknown message type");
end case;
LLU.Reset (P_Buffer.all);
end Server_Handler;
end Handlers;
|
source/amf/uml/amf-internals-uml_classifiers.ads | svn2github/matreshka | 24 | 30292 | <reponame>svn2github/matreshka
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Packageable_Elements;
with AMF.UML.Classifiers.Collections;
package AMF.Internals.UML_Classifiers is
type UML_Classifier_Proxy is
abstract new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy
and AMF.UML.Classifiers.UML_Classifier
with null record;
overriding function All_Parents
(Self : not null access constant UML_Classifier_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Operation Classifier::allParents.
--
-- The query allParents() gives all of the direct and indirect ancestors
-- of a generalized Classifier.
overriding function Parents
(Self : not null access constant UML_Classifier_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Operation Classifier::parents.
--
-- The query parents() gives all of the immediate ancestors of a
-- generalized Classifier.
overriding procedure Set_Is_Abstract
(Self : not null access UML_Classifier_Proxy;
To : Boolean);
-- Setter of Classifier::isAbstract.
--
-- If true, the Classifier does not provide a complete declaration and can
-- typically not be instantiated. An abstract classifier is intended to be
-- used by other classifiers e.g. as the target of general
-- metarelationships or generalization relationships.
end AMF.Internals.UML_Classifiers;
|
oeis/142/A142509.asm | neoneye/loda-programs | 11 | 170275 | ; A142509: Primes congruent to 3 mod 52.
; Submitted by <NAME>
; 3,107,211,263,367,419,523,887,991,1303,1459,1511,1667,1823,1979,2083,2239,2447,2551,2707,3019,3331,3539,3643,3851,4007,4111,4423,4787,4943,5099,5827,5879,6451,6607,6659,6763,6971,7127,7283,7699,7907,8011,8167,8219,8999,9103,9311,9467,9623,9883,10039,10091,10247,10559,10663,11027,11131,11287,11443,11807,12119,12379,12743,12899,13003,13159,13367,13523,13627,13679,14251,14303,14407,14563,14771,15031,15083,15187,15551,16487,16747,16903,17579,17683,17839,17891,18047,18307,18671,19087,19139,19763
mov $2,36
mul $2,$0
mov $4,2
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,52
lpe
mov $0,$4
add $0,1
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1945.asm | ljhsiun2/medusa | 9 | 92436 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xb528, %rsi
lea addresses_A_ht+0x5b98, %rdi
clflush (%rsi)
dec %rdx
mov $74, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $43294, %r12
lea addresses_D_ht+0x18b62, %r8
xor %rax, %rax
mov $0x6162636465666768, %rdx
movq %rdx, %xmm7
movups %xmm7, (%r8)
nop
nop
nop
nop
sub $40965, %rax
lea addresses_A_ht+0x6178, %rsi
lea addresses_A_ht+0x11d98, %rdi
nop
sub %r12, %r12
mov $86, %rcx
rep movsl
nop
nop
xor $59555, %rsi
lea addresses_UC_ht+0x18198, %rcx
cmp %rdi, %rdi
mov (%rcx), %edx
nop
nop
nop
and %r8, %r8
lea addresses_UC_ht+0x1598, %rsi
nop
nop
dec %r8
movups (%rsi), %xmm0
vpextrq $0, %xmm0, %rcx
nop
nop
nop
nop
cmp $30977, %r12
lea addresses_D_ht+0x131d8, %rsi
nop
nop
nop
nop
cmp %rdx, %rdx
movb $0x61, (%rsi)
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0xa838, %rsi
lea addresses_WT_ht+0x15788, %rdi
nop
nop
nop
nop
nop
and $34796, %r9
mov $65, %rcx
rep movsl
nop
nop
sub $58566, %rdi
lea addresses_WC_ht+0x16198, %rdi
lfence
mov (%rdi), %rdx
nop
nop
nop
sub %rdi, %rdi
lea addresses_WC_ht+0x5358, %rsi
lea addresses_WT_ht+0x7a86, %rdi
nop
add $57463, %rdx
mov $42, %rcx
rep movsw
nop
nop
xor $62261, %rdi
lea addresses_WT_ht+0x18218, %rdi
nop
dec %r12
mov (%rdi), %eax
sub %rdi, %rdi
lea addresses_WC_ht+0x2e08, %rsi
lea addresses_WT_ht+0x1ef38, %rdi
nop
inc %rax
mov $53, %rcx
rep movsw
nop
nop
xor %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %rbx
push %rcx
push %rsi
// Store
lea addresses_PSE+0xd078, %rbx
nop
nop
nop
nop
nop
cmp %r11, %r11
movb $0x51, (%rbx)
nop
nop
cmp $22064, %rcx
// Store
lea addresses_A+0x1386b, %rsi
nop
nop
dec %r15
mov $0x5152535455565758, %r12
movq %r12, %xmm6
vmovups %ymm6, (%rsi)
nop
nop
nop
xor $30863, %rcx
// Store
mov $0x6b25890000000798, %rsi
nop
nop
nop
nop
nop
xor %r15, %r15
mov $0x5152535455565758, %r11
movq %r11, (%rsi)
nop
nop
nop
nop
cmp %r14, %r14
// Faulty Load
lea addresses_WT+0x18d98, %rbx
nop
nop
nop
sub %r14, %r14
mov (%rbx), %si
lea oracles, %r12
and $0xff, %rsi
shlq $12, %rsi
mov (%r12,%rsi,1), %rsi
pop %rsi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 8, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': 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
*/
|
out/CommMonoid/Signature.agda | JoeyEremondi/agda-soas | 39 | 2429 | {-
This second-order signature was created from the following second-order syntax description:
syntax CommMonoid | CM
type
* : 0-ary
term
unit : * | ε
add : * * -> * | _⊕_ l20
theory
(εU⊕ᴸ) a |> add (unit, a) = a
(εU⊕ᴿ) a |> add (a, unit) = a
(⊕A) a b c |> add (add(a, b), c) = add (a, add(b, c))
(⊕C) a b |> add(a, b) = add(b, a)
-}
module CommMonoid.Signature where
open import SOAS.Context
open import SOAS.Common
open import SOAS.Syntax.Signature *T public
open import SOAS.Syntax.Build *T public
-- Operator symbols
data CMₒ : Set where
unitₒ addₒ : CMₒ
-- Term signature
CM:Sig : Signature CMₒ
CM:Sig = sig λ
{ unitₒ → ⟼₀ *
; addₒ → (⊢₀ *) , (⊢₀ *) ⟼₂ *
}
open Signature CM:Sig public
|
oeis/341/A341629.asm | neoneye/loda-programs | 11 | 84047 | ; A341629: Characteristic function of A055932: a(n) = 1 if n is a number all of whose prime divisors are consecutive primes starting at 2, otherwise 0.
; Submitted by <NAME>
; 1,1,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0
add $0,1
mov $1,1
mov $2,1
lpb $0
add $2,1
lpb $3
mov $4,$0
mod $4,$2
add $2,1
cmp $4,0
cmp $4,0
sub $3,$4
lpe
lpb $0
dif $0,$2
lpe
add $3,1
lpe
div $1,$0
mov $0,$1
|
EngineHacks/CoreSupport/SaveData/Src/MSaFuncs.asm | MokhaLeee/FE16re-Proto | 5 | 89517 | .cpu arm7tdmi
.eabi_attribute 20, 1 @ Tag_ABI_FP_denormal
.eabi_attribute 21, 1 @ Tag_ABI_FP_exceptions
.eabi_attribute 23, 3 @ Tag_ABI_FP_number_model
.eabi_attribute 24, 1 @ Tag_ABI_align8_needed
.eabi_attribute 25, 1 @ Tag_ABI_align8_preserved
.eabi_attribute 26, 1 @ Tag_ABI_enum_size
.eabi_attribute 30, 4 @ Tag_ABI_optimization_goals
.eabi_attribute 34, 0 @ Tag_CPU_unaligned_access
.eabi_attribute 18, 4 @ Tag_ABI_PCS_wchar_t
.file "MSaFuncs.c"
@ GNU C17 (devkitARM release 56) version 11.1.0 (arm-none-eabi)
@ compiled by GNU C version 10.3.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.18-GMP
@ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
@ options passed: -mcpu=arm7tdmi -mthumb -mthumb-interwork -mtune=arm7tdmi -mlong-calls -march=armv4t -Os -ffreestanding
.text
.align 1
.global MSa_SaveChapterState
.arch armv4t
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_SaveChapterState, %function
MSa_SaveChapterState:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, r5, r6, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:8: gChapterData._u00 = GetGameClock();
ldr r3, .L2 @ tmp117,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:10: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:7: void MSa_SaveChapterState(void* target, unsigned size) {
movs r5, r1 @ size, tmp122
movs r4, r0 @ target, tmp121
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:8: gChapterData._u00 = GetGameClock();
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:8: gChapterData._u00 = GetGameClock();
ldr r3, .L2+4 @ tmp118,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:9: WriteAndVerifySramFast(&gChapterData, target, size);
movs r2, r5 @, size
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:8: gChapterData._u00 = GetGameClock();
str r0, [r3] @ tmp123, gChapterData._u00
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:9: WriteAndVerifySramFast(&gChapterData, target, size);
movs r1, r4 @, target
movs r0, r3 @, tmp118
ldr r3, .L2+8 @ tmp120,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:10: }
pop {r4, r5, r6}
pop {r0}
bx r0
.L3:
.align 2
.L2:
.word GetGameClock
.word gChapterData
.word WriteAndVerifySramFast
.size MSa_SaveChapterState, .-MSa_SaveChapterState
.align 1
.global MSa_LoadChapterState
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_LoadChapterState, %function
MSa_LoadChapterState:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:13: gpReadSramFast(source, &gChapterData, size);
ldr r4, .L6 @ tmp117,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:15: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:12: void MSa_LoadChapterState(void* source, unsigned size) {
movs r2, r1 @ size, tmp122
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:13: gpReadSramFast(source, &gChapterData, size);
ldr r3, .L6+4 @ tmp118,
movs r1, r4 @, tmp117
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:14: SetGameClock(gChapterData._u00);
ldr r0, [r4] @, gChapterData._u00
ldr r3, .L6+8 @ tmp120,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:15: }
pop {r4}
pop {r0}
bx r0
.L7:
.align 2
.L6:
.word gChapterData
.word gpReadSramFast
.word SetGameClock
.size MSa_LoadChapterState, .-MSa_LoadChapterState
.align 1
.global MSa_SaveUnits
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_SaveUnits, %function
MSa_SaveUnits:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 104
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, r5, r6, lr} @
sub sp, sp, #104 @,,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:17: void MSa_SaveUnits(void* target, unsigned size) {
movs r4, r0 @ target, tmp135
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:19: LoadGeneralGameMetadata(&sgm);
ldr r3, .L15 @ tmp124,
add r0, sp, #4 @ tmp138,,
bl .L4 @
movs r5, #1 @ ivtmp.22,
.L10:
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:22: struct Unit* unit = GetUnit(i+1);
lsls r0, r5, #24 @ tmp125, ivtmp.22,
ldr r3, .L15+4 @ tmp127,
lsrs r0, r0, #24 @ tmp125, tmp125,
bl .L4 @
movs r6, r0 @ unit, tmp136
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:25: SaveUnit(unit, target + (0x24*i));
ldr r3, .L15+8 @ tmp128,
movs r1, r4 @, ivtmp.25
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:28: if (unit->pCharacterData)
ldr r3, [r6] @ _5, unit_16->pCharacterData
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:28: if (unit->pCharacterData)
cmp r3, #0 @ _5,
beq .L9 @,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:29: GGM_SetCharacterKnown(unit->pCharacterData->number, &sgm);
ldrb r0, [r3, #4] @ tmp130,
add r1, sp, #4 @ tmp139,,
ldr r3, .L15+12 @ tmp131,
bl .L4 @
.L9:
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:21: for (unsigned i = 0; i < 51; ++i) {
adds r5, r5, #1 @ ivtmp.22,
adds r4, r4, #36 @ ivtmp.25,
cmp r5, #52 @ ivtmp.22,
bne .L10 @,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:32: SaveGeneralGameMetadata(&sgm);
ldr r3, .L15+16 @ tmp133,
add r0, sp, #4 @ tmp140,,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:33: }
add sp, sp, #104 @,,
@ sp needed @
pop {r4, r5, r6}
pop {r0}
bx r0
.L16:
.align 2
.L15:
.word LoadGeneralGameMetadata
.word GetUnit
.word SaveUnit
.word GGM_SetCharacterKnown
.word SaveGeneralGameMetadata
.size MSa_SaveUnits, .-MSa_SaveUnits
.align 1
.global MSa_LoadUnits
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_LoadUnits, %function
MSa_LoadUnits:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, r5, r6, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:35: void MSa_LoadUnits(void* source, unsigned size) {
movs r4, r0 @ ivtmp.37, tmp124
movs r5, #1 @ ivtmp.34,
.L18:
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:37: LoadSavedUnit(source + (0x24*i), GetUnit(i+1));
lsls r0, r5, #24 @ tmp120, ivtmp.34,
ldr r3, .L20 @ tmp122,
lsrs r0, r0, #24 @ tmp120, tmp120,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:36: for (unsigned i = 0; i < 51; ++i)
adds r5, r5, #1 @ ivtmp.34,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:37: LoadSavedUnit(source + (0x24*i), GetUnit(i+1));
movs r1, r0 @ _5, tmp125
ldr r3, .L20+4 @ tmp123,
movs r0, r4 @, ivtmp.37
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:36: for (unsigned i = 0; i < 51; ++i)
adds r4, r4, #36 @ ivtmp.37,
cmp r5, #52 @ ivtmp.34,
bne .L18 @,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:38: }
@ sp needed @
pop {r4, r5, r6}
pop {r0}
bx r0
.L21:
.align 2
.L20:
.word GetUnit
.word LoadSavedUnit
.size MSa_LoadUnits, .-MSa_LoadUnits
.align 1
.global MSa_SaveBonusClaim
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_SaveBonusClaim, %function
MSa_SaveBonusClaim:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:40: void MSa_SaveBonusClaim(void* target, unsigned size) {
movs r2, r1 @ size, tmp118
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:42: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:41: WriteAndVerifySramFast((void*)(0x0203EDB4), target, size);
movs r1, r0 @, target
ldr r3, .L23 @ tmp116,
ldr r0, .L23+4 @,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:42: }
pop {r4}
pop {r0}
bx r0
.L24:
.align 2
.L23:
.word WriteAndVerifySramFast
.word 33811892
.size MSa_SaveBonusClaim, .-MSa_SaveBonusClaim
.align 1
.global MSa_LoadBonusClaim
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_LoadBonusClaim, %function
MSa_LoadBonusClaim:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:44: void MSa_LoadBonusClaim(void* source, unsigned size) {
movs r2, r1 @ size, tmp118
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:46: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:45: gpReadSramFast(source, (void*)(0x0203EDB4), size);
ldr r1, .L26 @,
ldr r3, .L26+4 @ tmp116,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:46: }
pop {r4}
pop {r0}
bx r0
.L27:
.align 2
.L26:
.word 33811892
.word gpReadSramFast
.size MSa_LoadBonusClaim, .-MSa_LoadBonusClaim
.align 1
.global MSa_SaveWMStuff
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_SaveWMStuff, %function
MSa_SaveWMStuff:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:49: SaveWMStuff(target, &gSomeWMEventRelatedStruct);
ldr r1, .L29 @ tmp115,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:50: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:49: SaveWMStuff(target, &gSomeWMEventRelatedStruct);
ldr r3, .L29+4 @ tmp116,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:50: }
pop {r4}
pop {r0}
bx r0
.L30:
.align 2
.L29:
.word gSomeWMEventRelatedStruct
.word SaveWMStuff
.size MSa_SaveWMStuff, .-MSa_SaveWMStuff
.align 1
.global MSa_LoadWMStuff
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_LoadWMStuff, %function
MSa_LoadWMStuff:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:53: LoadWMStuff(source, &gSomeWMEventRelatedStruct);
ldr r1, .L32 @ tmp115,
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:54: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:53: LoadWMStuff(source, &gSomeWMEventRelatedStruct);
ldr r3, .L32+4 @ tmp116,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:54: }
pop {r4}
pop {r0}
bx r0
.L33:
.align 2
.L32:
.word gSomeWMEventRelatedStruct
.word LoadWMStuff
.size MSa_LoadWMStuff, .-MSa_LoadWMStuff
.align 1
.global MSa_SaveDungeonState
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_SaveDungeonState, %function
MSa_SaveDungeonState:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:56: void MSa_SaveDungeonState(void* target, unsigned size) {
movs r2, r1 @ size, tmp118
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:58: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:57: WriteAndVerifySramFast((void*)(0x30017AC), target, size);
movs r1, r0 @, target
ldr r3, .L35 @ tmp116,
ldr r0, .L35+4 @,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:58: }
pop {r4}
pop {r0}
bx r0
.L36:
.align 2
.L35:
.word WriteAndVerifySramFast
.word 50337708
.size MSa_SaveDungeonState, .-MSa_SaveDungeonState
.align 1
.global MSa_LoadDungeonState
.syntax unified
.code 16
.thumb_func
.fpu softvfp
.type MSa_LoadDungeonState, %function
MSa_LoadDungeonState:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r4, lr} @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:60: void MSa_LoadDungeonState(void* source, unsigned size) {
movs r2, r1 @ size, tmp118
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:62: }
@ sp needed @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:61: gpReadSramFast(source, (void*)(0x30017AC), size);
ldr r1, .L38 @,
ldr r3, .L38+4 @ tmp116,
bl .L4 @
@ CoreSupport/ExpandedModularSave/Src/MSaFuncs.c:62: }
pop {r4}
pop {r0}
bx r0
.L39:
.align 2
.L38:
.word 50337708
.word gpReadSramFast
.size MSa_LoadDungeonState, .-MSa_LoadDungeonState
.ident "GCC: (devkitARM release 56) 11.1.0"
.code 16
.align 1
.L4:
bx r3
|
bb-runtimes/examples/monitor/p5566/mpc55xx.ads | JCGobbi/Nucleo-STM32G474RE | 0 | 14282 | <filename>bb-runtimes/examples/monitor/p5566/mpc55xx.ads
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ppc; use Ppc;
package Mpc55xx is
pragma Elaborate_Body;
function Get_Tcr is new Get_Spr (340);
procedure Set_Tcr is new Set_Spr (340);
function Get_Tsr is new Get_Spr (336);
function Get_Pir is new Get_Spr (286);
function Get_Pvr is new Get_Spr (287);
function Get_Svr is new Get_Spr (1023);
function Get_Mmucfg is new Get_Spr (1015);
function Get_Pid0 is new Get_Spr (48);
function Get_Pid1 is new Get_Spr (633);
function Get_Pid2 is new Get_Spr (634);
function Get_Tlb0cfg is new Get_Spr (688);
function Get_Tlb1cfg is new Get_Spr (689);
procedure Set_Mas0 is new Set_Spr (624);
function Get_Mas1 is new Get_Spr (625);
procedure Set_Mas1 is new Set_Spr (625);
function Get_Mas2 is new Get_Spr (626);
procedure Set_Mas2 is new Set_Spr (626);
function Get_Mas3 is new Get_Spr (627);
procedure Set_Mas3 is new Set_Spr (627);
function Get_Hid0 is new Get_Spr (1008);
function Get_Hid1 is new Get_Spr (1009);
function Get_L1csr0 is new Get_Spr (1010);
function Get_L1cfg0 is new Get_Spr (515);
-- System clock
Fsys : constant := 128_000_000;
end Mpc55xx;
|
libsrc/gfx/narrow/undrawr.asm | ahjelm/z88dk | 640 | 95929 | ; CALLER LINKAGE FOR FUNCTION POINTERS
; ----- void undrawr(int x2, int y2)
IF !__CPU_INTEL__ & !__CPU_GBZ80__
SECTION code_graphics
PUBLIC undrawr
PUBLIC _undrawr
EXTERN asm_undrawr
.undrawr
._undrawr
pop af ; ret addr
pop de ; y
pop hl ; x
push hl
push de
push af ; ret addr
jp asm_undrawr
ENDIF
|
libmem.asm | silentenemy/asmbrain | 6 | 85371 | <filename>libmem.asm
; --- BRAINF*CK CODE
add_symbol_to_memory: ; AL = symbol
push ebp
mov bp, [code_offset]
add ebp, code_start
mov byte [ebp], al
inc [code_offset]
pop ebp
ret
del_symbol_from_memory:
push ebp
dec [code_offset]
mov bp, [code_offset]
add ebp, code_start
mov byte [ebp], 0
pop ebp
ret
add_symbol: ; AL = symbol
cmp al, 0
jz .end
push cx
mov cx, [code_offset]
cmp cx, 00008FFFh
pop cx
je .end
push bx
call add_symbol_to_memory
mov bl, 0Fh
call write_char
pop bx
.end:
ret
del_symbol:
cmp [code_offset], 1
je .end
call del_symbol_from_memory
call clear_char
.end:
ret
get_symbol:
push ebp
mov bp, [code_offset]
add ebp, code_start
mov al, [ebp]
pop ebp
ret ; AL = symbol
; --- DATA CELLS
next_data_cell:
cmp [data_offset], 8FFFh
je .end
inc [data_offset]
.end:
ret
prev_data_cell:
cmp [data_offset], 0
je .end
dec [data_offset]
.end:
ret
get_data_cell:
push ebp
mov bp, [data_offset]
add ebp, data_start
mov al, [ebp]
pop ebp
ret ; AL = data
set_data_cell: ; AL = data
push ebp
mov bp, [data_offset]
add ebp, data_start
mov byte [ebp], al
pop ebp
ret
inc_data_cell:
push ebp
mov bp, [data_offset]
add ebp, data_start
inc byte [ebp]
pop ebp
ret
dec_data_cell:
push ebp
mov bp, [data_offset]
add ebp, data_start
dec byte [ebp]
pop ebp
ret
wipe_data_cells:
push ebp
push eax
mov ebp, data_start
movzx eax, [data_offset]
add eax, data_start
.start:
mov byte [ebp], 0
inc ebp
cmp ebp, eax
jl .start
pop eax
pop ebp
ret
|
deeperanddeeper.asm | robinfaury/LudumDare48_Deeper | 1 | 25278 | <gh_stars>1-10
include "gbhw.inc"
include "dma.inc"
include "cgbhw.inc"
SECTION "Vblank", ROM0[$0040]
jp DMA_ROUTINE
SECTION "LCDC", ROM0[$0048]
reti
SECTION "Timer", ROM0[$0050]
reti
SECTION "Serial", ROM0[$0058]
reti
SECTION "Joypad", ROM0[$0060]
reti
SECTION "ROM_entry_point", ROM0[$0100]
nop
jp code_begins
SECTION "rom header", ROM0[$0104]
NINTENDO_LOGO
DB " Deeper " ; Cart name - 15 characters / 15 bytes
DB $80 ; $143 - GBC support. $80 = both. $C0 = only gbc
DB 0,0 ; $144 - Licensee code (not important)
DB 0 ; $146 - SGB Support indicator
DB $1B ; $147 - Cart type / MBC type (0 => no mbc)
DB $08 ; $148 - ROM Size (0 => 32KB)
DB $04 ; $149 - RAM Size (0 => 0KB RAM on cartridge)
DB 1 ; $14a - Destination code
DB $33 ; $14b - Old licensee code
DB 0 ; $14c - Mask ROM version
DB 0 ; $14d - Complement check (important) rgbds-fixed
DW 0 ; $14e - Checksum (not important)
include "ibmpc1.inc"
include "memory.asm"
Sprite01 EQU _RAM
Sprite02 EQU Sprite01+4
Sprite03 EQU Sprite02+4
Sprite04 EQU Sprite03+4
Sprite05 EQU Sprite04+4
Sprite06 EQU Sprite05+4
Sprite07 EQU Sprite06+4
Sprite08 EQU Sprite07+4
Sprite09 EQU Sprite08+4
Sprite10 EQU Sprite09+4
Sprite11 EQU Sprite10+4
Sprite12 EQU Sprite11+4
Sprite13 EQU Sprite12+4
Sprite14 EQU Sprite13+4
Sprite15 EQU Sprite14+4
Sprite16 EQU Sprite15+4
Sprite17 EQU Sprite16+4
Sprite18 EQU Sprite17+4
Sprite19 EQU Sprite18+4
Sprite20 EQU Sprite19+4
Sprite21 EQU Sprite20+4
Sprite22 EQU Sprite21+4
Sprite23 EQU Sprite22+4
Sprite24 EQU Sprite23+4
Sprite25 EQU Sprite24+4
Sprite26 EQU Sprite25+4
Sprite27 EQU Sprite26+4
Sprite28 EQU Sprite27+4
Sprite29 EQU Sprite28+4
Sprite30 EQU Sprite29+4
Sprite31 EQU Sprite30+4
Sprite32 EQU Sprite31+4
Sprite33 EQU Sprite32+4
Sprite34 EQU Sprite33+4
Sprite35 EQU Sprite34+4
Sprite36 EQU Sprite35+4
Sprite37 EQU Sprite36+4
Sprite38 EQU Sprite37+4
Sprite39 EQU Sprite38+4
Sprite40 EQU Sprite39+4
CurrentLevel EQU Sprite40+4
CurrentBank EQU CurrentLevel+1
FreeRAM EQU CurrentBank+1
; \brief multiply hl by 32. reset a
MultiplyBy32:
ld a, 0
sla a
sla l
adc a, 0
sla a
sla l
adc a, 0
sla a
sla l
adc a, 0
sla a
sla l
adc a, 0
sla a
sla l
adc a, 0
ld h, a
ret
; \Brief Bank switch
; \Param a : the bank id
switch_bank:
ld [$2000], a
ld [CurrentBank], a
ret
; \Brief If the current bank is different than the current lvl. Load the new lvl
check_lvl:
ld a, [CurrentBank]
ld b, a
ld a, [CurrentLevel]
cp b
jr z, .end_next_lvl
.next_lvl:
call switch_bank
cp 2
jr z, .bank_2
cp 3
jr z, .bank_3
jr .end_next_lvl
.bank_2
call SetupLvl_Bank2
jr .end_next_lvl
.bank_3
call SetupLvl_Bank3
.end_next_lvl
ret
; \Brief Stop the LCD for VRAM write
LCD_Stop:
ld a, [rLCDC]
and LCDCF_ON
ret z
.vblank
ldh a, [rLY]
cp 145
jr nz, .vblank
.stop
ld a, [rLCDC]
xor LCDCF_ON
ld [rLCDC], a
ret
; \Brief Restart the LCD
LCD_Start:
ld a, [rLCDC]
or LCDCF_ON
ld [rLCDC], a
ret
; \Brief Get button press.
PoolEvent:
ld a, JOYPAD_BUTTONS
ld [rJOYPAD], a
ld a, [rJOYPAD]
ld a, [rJOYPAD]
cpl
and $0f
swap a
ld b, a
ld a, JOYPAD_ARROWS
ld [rJOYPAD], a
ld a, [rJOYPAD]
ld a, [rJOYPAD]
ld a, [rJOYPAD]
ld a, [rJOYPAD]
ld a, [rJOYPAD]
ld a, [rJOYPAD]
cpl
and $0f
or b
ld b, a
ld a, JOYPAD_BUTTONS|JOYPAD_ARROWS
ld [rJOYPAD], a
ld a, b
ret
code_begins:
di
ld SP, $FFFF
ld hl, BackgroundPalette
call SetupBackgroundPalette
ld hl, SpritePalette
call SetupSpritePalette
dma_Copy2HRAM
ld a, $00
ld hl, _RAM
ld bc, $28*$04+$01+$01
call mem_Set
ld a, $02
ld [CurrentLevel], a
call check_lvl
ld a, %00011011
ld [rBGP], a
ld [rOBP0], a
ld [rOBP1], a
ld a, IEF_VBLANK
ld [rIE], a
ei
ld a, [rLCDC]
or LCDCF_OBJON
or LCDCF_OBJ8
ld [rLCDC], a
.loop
halt
nop
call check_lvl
call PoolEvent
ld b, a
ld a, [CurrentLevel]
cp 2
jr z, .bank_2
cp 3
jr z, .bank_3
jr .bank_end
.bank_2
call RunGame_Bank2
jr .bank_end
.bank_3
call RunGame_Bank3
.bank_end
jp .loop
CreateColor: MACRO
DW ((\3>>3)<<10)+((\2>>3)<<5)+(\1>>3)
ENDM
BackgroundPalette:
; %10000000
CreateColor 7, 5, 5
CreateColor 20, 8, 5
CreateColor 32, 25, 25
CreateColor 0, 0, 0
; %10111000
CreateColor 15, 12, 13
CreateColor 45, 18, 12
CreateColor 72, 58, 57
CreateColor 0, 0, 0
; %10110000
CreateColor 0, 0, 0
CreateColor 25, 5, 5
CreateColor 31, 21, 10
CreateColor 35, 35, 40
; %10101000
CreateColor 0, 0, 0
CreateColor 136, 26, 30
CreateColor 172, 116, 56
CreateColor 193, 188, 113
; %10100000
CreateColor 19, 5, 17
CreateColor 10, 3, 15
CreateColor 27, 10, 9
CreateColor 27, 23, 7
; %10011000
CreateColor 52, 0, 54
CreateColor 58, 17, 141
CreateColor 204, 184, 87
CreateColor 206, 96, 51
; %10010000
CreateColor 9, 9, 9
CreateColor 33, 30, 29
CreateColor 0, 0, 0
CreateColor 0, 0, 0
; %10001000
CreateColor 51, 50, 51
CreateColor 184, 164, 163
CreateColor 0, 0, 0
CreateColor 0, 0, 0
SetupBackgroundPalette:
ld a, %10000000
ldh [rBCPS], a
ld bc, $4000|(rBCPD&$00FF)
.loop1
di
.loop2
ldh a, [rSTAT]
and STATF_BUSY
jr nz, .loop2
ld a, [hl+]
ld [$FF00+c], a
ei
dec b
jr nz, .loop1
ret
SpritePalette:
; %10000000 ; base
CreateColor 0, 0, 0
CreateColor 25, 25, 25
CreateColor 70, 32, 24
CreateColor 172, 172, 172
; %10111000 ; alien
CreateColor 0, 0, 0
CreateColor 206, 96, 51
CreateColor 52, 0, 54
CreateColor 194, 189, 114
; %10110000 ; stone
CreateColor 0, 0, 0
CreateColor 0, 0, 0
CreateColor 137, 26, 31
CreateColor 172, 116, 56
; %10101000 ; dirt
CreateColor 0, 0, 0
CreateColor 15, 12, 13
CreateColor 45, 18, 12
CreateColor 72, 58,57
; %10100000 ; metal
CreateColor 0, 0, 0
CreateColor 51, 51, 51
CreateColor 184, 164, 163
CreateColor 255, 255, 255
; %10011000
CreateColor 0, 0, 0
CreateColor 255, 255, 255
CreateColor 255, 255, 255
CreateColor 255, 255, 255
; %10010000
CreateColor 0, 0, 0
CreateColor 0, 0, 0
CreateColor 0, 0, 0
CreateColor 0, 0, 0
; %10001000
CreateColor 255, 255, 255
CreateColor 255, 255, 255
CreateColor 255, 255, 255
CreateColor 255, 255, 255
SetupSpritePalette:
ld a, %10000000
ldh [rOCPS], a
ld bc, $4000|(rOCPD&$00FF)
.loop1
di
.loop2
ldh a, [rSTAT]
and STATF_BUSY
jr nz, .loop2
ld a, [hl+]
ld [$FF00+c], a
ei
dec b
jr nz, .loop1
ret
include "bank2.asm"
include "bank3.asm" |
awa/src/awa-helpers-selectors.adb | twdroeger/ada-awa | 81 | 12008 | <reponame>twdroeger/ada-awa
-----------------------------------------------------------------------
-- awa-helpers -- Helpers for AWA applications
-- Copyright (C) 2011, 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 ADO.Queries.Loaders;
with ADO.Schemas;
with Util.Strings;
with Util.Log.Loggers;
with Util.Locales;
with ASF.Locales;
with AWA.Services.Contexts;
package body AWA.Helpers.Selectors is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Helpers.Selectors");
-- ------------------------------
-- Create a selector list from the definition of a discrete type such as an enum.
-- The select item has the enum value as value and the label is created by
-- localizing the string <b>Prefix</b>_<i>enum name</i>.
-- ------------------------------
function Create_From_Enum (Bundle : in Util.Properties.Bundles.Manager'Class)
return ASF.Models.Selects.Select_Item_List is
Result : ASF.Models.Selects.Select_Item_List;
begin
for I in T'Range loop
declare
Value : constant String := T'Image (I);
Name : constant String := Prefix & "_" & Value;
Label : constant String := Bundle.Get (Name, Name);
begin
Result.Append (ASF.Models.Selects.Create_Select_Item (Label, Value));
end;
end loop;
return Result;
end Create_From_Enum;
-- ------------------------------
-- Create a selector list by using a resource bundle and a create operation that looks for
-- messages in the bundle. The bundle name <b>Bundle</b> gives the name of the resource
-- bundled to load. The locale is determined by the ASF context passed in <b>Context</b>.
-- The <b>Create</b> function is in charge of creating and populating the select list.
-- ------------------------------
function Create_Selector_Bean (Bundle : in String;
Context : in ASF.Contexts.Faces.Faces_Context_Access := null;
Create : access function
(Bundle : in Util.Properties.Bundles.Manager'Class)
return ASF.Models.Selects.Select_Item_List)
return Util.Beans.Basic.Readonly_Bean_Access is
use ASF.Contexts.Faces;
Ctx : ASF.Contexts.Faces.Faces_Context_Access;
Manager : ASF.Locales.Bundle;
Result : ASF.Models.Selects.Select_Item_List_Access;
begin
if Context = null then
Ctx := ASF.Contexts.Faces.Current;
end if;
if Ctx /= null then
declare
Locale : constant Util.Locales.Locale := Ctx.Get_Locale;
App : constant Application_Access := Ctx.Get_Application;
begin
App.Load_Bundle (Name => Bundle,
Locale => Util.Locales.To_String (Locale),
Bundle => Manager);
end;
else
Log.Warn ("No context defined to localize the selector");
end if;
Result := new ASF.Models.Selects.Select_Item_List;
Result.all := Create (Manager);
return Result.all'Access;
end Create_Selector_Bean;
-- ------------------------------
-- Append the selector list from the SQL query. The query will be executed.
-- It should return rows with at least two columns. The first column is the
-- selector value and the second column is the selector label.
-- ------------------------------
procedure Append_From_Query (Into : in out ASF.Models.Selects.Select_Item_List;
Query : in out ADO.Statements.Query_Statement'Class) is
use ADO.Schemas;
function Get_Column (Id : in Natural;
Of_Type : in ADO.Schemas.Column_Type) return String;
Id_Type : ADO.Schemas.Column_Type := T_UNKNOWN;
Label_Type : ADO.Schemas.Column_Type := T_UNKNOWN;
function Get_Column (Id : in Natural;
Of_Type : in ADO.Schemas.Column_Type) return String is
begin
case Of_Type is
when T_UNKNOWN | T_CHAR | T_VARCHAR =>
return Query.Get_String (Id);
when T_INTEGER | T_TINYINT | T_SMALLINT | T_ENUM =>
return Util.Strings.Image (Query.Get_Integer (Id));
when T_LONG_INTEGER =>
return Util.Strings.Image (Long_Long_Integer (Query.Get_Int64 (Id)));
when others =>
return "";
end case;
end Get_Column;
begin
Query.Execute;
while Query.Has_Elements loop
if Id_Type = T_UNKNOWN then
Id_Type := Query.Get_Column_Type (0);
Label_Type := Query.Get_Column_Type (1);
end if;
declare
Id : constant String := Get_Column (0, Id_Type);
Label : constant String := Get_Column (1, Label_Type);
begin
Into.Append (ASF.Models.Selects.Create_Select_Item (Label => Label, Value => Id));
end;
Query.Next;
end loop;
end Append_From_Query;
-- ------------------------------
-- Create the selector list from the SQL query. The query will be executed.
-- It should return rows with at least two columns. The first column is the
-- selector value and the second column is the selector label.
-- ------------------------------
function Create_From_Query (Session : in ADO.Sessions.Session'Class;
Query : in ADO.Queries.Context'Class)
return ASF.Models.Selects.Select_Item_List is
Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query);
Result : ASF.Models.Selects.Select_Item_List;
begin
Append_From_Query (Result, Stmt);
return Result;
end Create_From_Query;
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
function Get_Value (From : in Select_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "list" then
return ASF.Models.Selects.To_Object (From.List);
else
return Util.Beans.Objects.Null_Object;
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- If the name cannot be found, the method should raise the No_Value
-- exception.
-- ------------------------------
procedure Set_Value (From : in out Select_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
use type AWA.Services.Contexts.Service_Context_Access;
use type ADO.Queries.Query_Definition_Access;
begin
if Name = "query" then
declare
Query_Name : constant String := Util.Beans.Objects.To_String (Value);
Ctx : constant AWA.Services.Contexts.Service_Context_Access
:= AWA.Services.Contexts.Current;
Query_Def : constant ADO.Queries.Query_Definition_Access
:= ADO.Queries.Loaders.Find_Query (Query_Name);
Query : ADO.Queries.Context;
begin
if Ctx = null or Query_Def = null then
return;
end if;
Query.Set_Query (Query_Def);
From.List := Create_From_Query (Session => AWA.Services.Contexts.Get_Session (Ctx),
Query => Query);
end;
end if;
end Set_Value;
-- ------------------------------
-- Create the select list bean instance.
-- ------------------------------
function Create_Select_List_Bean return Util.Beans.Basic.Readonly_Bean_Access is
Result : constant Select_List_Bean_Access := new Select_List_Bean;
begin
return Result.all'Access;
end Create_Select_List_Bean;
end AWA.Helpers.Selectors;
|
programs/oeis/049/A049644.asm | jmorken/loda | 1 | 24809 | <reponame>jmorken/loda<filename>programs/oeis/049/A049644.asm
; A049644: T(n,n), array T given by A049639.
; 0,0,3,3,5,5,9,9,13,13,21,21,25,25,37,37,45,45,57,57,65,65,85,85,93,93,117,117,129,129,145,145,161,161,193,193,205,205,241,241,257,257,281,281,301,301,345,345,361,361,401,401,425,425,461,461,485,485,541,541,557,557
div $0,2
mov $1,1
cal $0,49691 ; a(n)=T(n,n), array T as in A049687. Also a(n)=T(2n,2n), array T given by A049639.
add $0,2
mul $1,$0
sub $1,2
|
2-resources/__DATA-Structures/ds-traversal-multi-lang/agda/Fold.agda | eengineergz/Lambda | 0 | 4485 | <filename>2-resources/__DATA-Structures/ds-traversal-multi-lang/agda/Fold.agda
-- A solution for
-- https://github.com/josevalim/nested-data-structure-traversal
-- in Agda using fold. Basically it is identical to its Haskell sibling except
-- fancy unicode symbols. The `refl` proof at the end is pretty nice though.
--
-- Coded against agda-2.6.1.3 and agda-stdlib-1.5
module Fold where
open import Data.Nat using (ℕ; _+_)
open import Data.Bool using (Bool; true; false; if_then_else_)
open import Data.String using (String)
open import Data.List using (List; []; _∷_; map; foldl; reverse; length; zipWith; upTo)
open import Data.Product using (_×_; _,_; proj₂)
open import Function using (_∘_)
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
record Lesson : Set where
constructor lesson
field
name : String
record Chapter : Set where
constructor chapter
field
title : String
reset : Bool
lessons : List Lesson
record PosLesson : Set where
constructor pos_lesson
field
name : String
pos : ℕ
record PosChapter : Set where
constructor pos_chapter
field
title : String
reset : Bool
pos : ℕ
lessons : List PosLesson
input : List Chapter
input = chapter "Getting started" false
(lesson "Welcome" ∷ lesson "Installation" ∷ [])
∷ chapter "Basic operator" false
(lesson "Addition / Subtraction" ∷ lesson "Multiplication / Division" ∷ [])
∷ chapter "Advanced topics" true
(lesson "Mutability" ∷ lesson "Immutability" ∷ [])
∷ []
expected : List PosChapter
expected = pos_chapter "Getting started" false 1
(pos_lesson "Welcome" 1 ∷ pos_lesson "Installation" 2 ∷ [])
∷ pos_chapter "Basic operator" false 2
(pos_lesson "Addition / Subtraction" 3 ∷ pos_lesson "Multiplication / Division" 4 ∷ [])
∷ pos_chapter "Advanced topics" true 3
(pos_lesson "Mutability" 1 ∷ pos_lesson "Immutability" 2 ∷ [])
∷ []
solve : List Chapter → List PosChapter
solve i = (reverse ∘ proj₂ ∘ proj₂) (foldl go (1 , 1 , []) i)
where
go : ℕ × ℕ × List PosChapter → Chapter → ℕ × ℕ × List PosChapter
go (nc , nl , acc) (chapter title reset lessons) =
let n = length lessons
nl' = if reset then 1 else nl
ps = map (_+ nl') (upTo n)
plessons = zipWith (λ {(lesson name) p → pos_lesson name p}) lessons ps
in (nc + 1 , nl' + n , pos_chapter title reset nc plessons ∷ acc)
_ : solve input ≡ expected
_ = refl
|
alloy4fun_models/trainstlt/models/5/Jy7HyndXDqp94aHhw.als | Kaixi26/org.alloytools.alloy | 0 | 3418 | open main
pred idJy7HyndXDqp94aHhw_prop6 {
all t : Track | always t.signal != t.signal'
}
pred __repair { idJy7HyndXDqp94aHhw_prop6 }
check __repair { idJy7HyndXDqp94aHhw_prop6 <=> prop6o } |
ace/assembly/src/fmax.asm | ale-cci/Appunti | 0 | 94455 | SECTION data
PascalString db 11,"Test string"
CString db "Replaced xx",0,0,0,0,0
; String2: resb 100
; Mask: db 11110000b
SECTION code
..start:
mov ax, data
mov ds, ax
mov es, ax
call _main
mov ax, 4c00h ; Terminate iterrupt
int 21h
; Program description
_main:
mov bx, PascalString
xor cx, cx
mov cl, [bx]
push cx
inc bx
push bx
mov ax, CString
push ax
call _strcpy
add sp, 2*3
mov ax, CString
push ax ; Add param to stack
call _print_c
add sp, 2*1 ; Restore stack pointer value
.end_main:
ret
; Print C-Style string passed as first arg
_print_c:
push bp
mov bp, sp
mov si, [bp + 4]
xor bx, bx
mov ah, 0eh
.sprint:
lodsb ; Load byte to print to al
test al, al ; Break print fn if 0 is reached
jz .eprint
int 10h
jmp .sprint
.eprint:
pop bp
ret
; Print Pascal string
_print_p:
push bp
mov bp, sp
mov si, [bp+4]
mov cl, [si]
inc si
test cl, cl
jz .eprint_pascal
xor bx, bx ; Prepare print interrupt
mov ah, 0eh
.sprint_pascal:
lodsb
int 10h
loopz .sprint_pascal
.eprint_pascal:
pop bp
ret
|
Driver/Socket/EtherLink/etherAddrCtrl.asm | steakknife/pcgeos | 504 | 246900 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT:
MODULE:
FILE: loopbackAddrCtrl.asm
AUTHOR: <NAME>, Dec 5, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 12/ 5/94 Initial revision
DESCRIPTION:
LoopbackAddressControlClass code.
$Id: loopbackAddrCtrl.asm,v 1.2 95/01/09 01:42:47 weber Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LoopbackClassStructures segment resource
LoopbackAddrCtrlChildList GenControlChildInfo \
< offset LoopbackAddrCtrlBox,
0,
mask GCCF_IS_DIRECTLY_A_FEATURE or mask GCCF_ALWAYS_ADD>
LoopbackAddrCtrlFeaturesList GenControlFeaturesInfo \
< offset LoopbackAddrCtrlBox,
0,
1>
LoopbackClassStructures ends
LoopbackCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LACGenControlGetInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns GenCtrl information for LoopbackAddressControlClass
CALLED BY: MSG_GEN_CONTROL_GET_INFO
PASS: *ds:si = LoopbackAddressControlClass object
ds:di = LoopbackAddressControlClass instance data
ds:bx = LoopbackAddressControlClass object (same as *ds:si)
es = segment of LoopbackAddressControlClass
ax = message #
cx:dx = Buffer for GenControlInfo
RETURN: GenControlDupInfo field filled in
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 12/ 5/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LACGenControlGetInfo method dynamic LoopbackAddressControlClass,
MSG_GEN_CONTROL_GET_INFO
uses cx
.enter
;
; copy the data into the buffer
;
segmov ds, cs ; ds:si = source
mov si, offset LoopbackAddrCtrlInfo
mov es, cx
mov di, dx ; es:di = dest
mov cx, size GenControlBuildInfo
rep movsb
.leave
ret
LACGenControlGetInfo endm
LoopbackAddrCtrlInfo GenControlBuildInfo <
mask GCBF_NOT_REQUIRED_TO_BE_ON_SELF_LOAD_OPTIONS_LIST, ;GCBI_flags
0, ; GCBI_initFileKey
0, ; GCBI_gcnList
0, ; GCBI_gcnCount
0, ; GCBI_notificationList
0, ; GCBI_notificationCount
0, ; GCBI_controllerName
handle LoopbackAddrCtrlBox, ; GCBI_dupBlock
LoopbackAddrCtrlChildList, ; GCBI_childList
length LoopbackAddrCtrlChildList, ; GCBI_childCount
LoopbackAddrCtrlFeaturesList, ; GCBI_featuresList
length LoopbackAddrCtrlFeaturesList, ; GCBI_featuresCount
1, ; GCBI_features
0, ; GCBI_toolBlock
0, ; GCBI_toolList
0, ; GCBI_toolCount
0, ; GCBI_toolFeaturesList
0, ; GCBI_toolFeaturesCount
0, ; GCBI_toolFeatures
0, ; GCBI_helpContext
0 ; GCBI_reserve
>
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LoopbackInitialize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize instance data with our geode handle
CALLED BY: MSG_META_INITIALIZE
PASS: *ds:si = LoopbackAddressControlClass object
es = segment of LoopbackAddressControlClass
ax = message #
RETURN: nothing
DESTROYED: ax,cx,dx,bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 1/ 5/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LoopbackInitialize method dynamic LoopbackAddressControlClass,
MSG_META_INITIALIZE
mov ds:[di].SACI_geode, handle 0
mov di, offset LoopbackAddressControlClass
GOTO ObjCallSuperNoLock
LoopbackInitialize endm
LoopbackCode ends
|
Transynther/x86/_processed/P/_zr_/i7-7700_9_0xca_notsx.log_120_487.asm | ljhsiun2/medusa | 9 | 92354 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x11dcc, %r14
add $11579, %rdx
movb $0x61, (%r14)
nop
nop
xor $3794, %rdi
lea addresses_D_ht+0x13a6c, %r14
nop
nop
nop
nop
and $42367, %rdi
mov (%r14), %r12w
nop
nop
nop
nop
xor $23303, %rdx
lea addresses_WC_ht+0x1272c, %rbp
and $56031, %r13
mov (%rbp), %r14
nop
nop
nop
nop
nop
and %rbp, %rbp
lea addresses_normal_ht+0x10cac, %rbp
nop
nop
nop
nop
inc %r9
movb $0x61, (%rbp)
nop
nop
nop
nop
nop
sub %r9, %r9
lea addresses_A_ht+0xb32c, %rsi
lea addresses_normal_ht+0x344c, %rdi
nop
nop
inc %r12
mov $50, %rcx
rep movsb
nop
inc %rdx
lea addresses_normal_ht+0x8b38, %r12
nop
nop
sub $19498, %r13
movb (%r12), %cl
nop
nop
nop
nop
add $46384, %rdi
lea addresses_D_ht+0x11e6c, %rsi
lea addresses_A_ht+0xca6c, %rdi
nop
nop
nop
nop
nop
sub $33511, %r9
mov $65, %rcx
rep movsl
nop
nop
xor %rdi, %rdi
lea addresses_A_ht+0x3160, %rsi
lea addresses_WC_ht+0xe06c, %rdi
nop
nop
nop
nop
nop
sub $31983, %r12
mov $42, %rcx
rep movsq
nop
dec %rdx
lea addresses_normal_ht+0x14b6c, %rcx
nop
and $44630, %rdi
mov $0x6162636465666768, %r12
movq %r12, %xmm3
and $0xffffffffffffffc0, %rcx
vmovntdq %ymm3, (%rcx)
nop
nop
nop
nop
sub %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r8
push %r9
push %rbx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_UC+0xc6ec, %r9
and %r10, %r10
movl $0x51525354, (%r9)
and $29700, %r9
// Faulty Load
mov $0x26c, %rbx
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov (%rbx), %r9w
lea oracles, %rdi
and $0xff, %r9
shlq $12, %r9
mov (%rdi,%r9,1), %r9
pop %rsi
pop %rdx
pop %rdi
pop %rbx
pop %r9
pop %r8
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_P'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_P'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'00': 120}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
source/builds.adb | jquorning/CELLE | 0 | 10812 | <filename>source/builds.adb
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, not taking more than you give.
--
with Ada.Text_IO;
with Ada.Strings.Unbounded;
with Ada.Containers;
with Types;
with Reports;
with Options;
with Rules;
with Rule_Lists;
with Symbols.IO;
with Symbol_Sets;
with Errors;
with Configs;
with Actions;
with Action_Lists;
with Config_Lists;
with Prop_Links;
with Debugs;
package body Builds is
subtype Rule_Access is Rule_Lists.Rule_Access;
procedure Find_Rule_Precedences (Session : in out Sessions.Session_Type)
is
use Rules;
use Symbols;
begin
for Rule of Session.Rule loop
if Rule.Prec_Symbol = null then
for Symbol of Rule.RHS loop
exit when Rule.Prec_Symbol /= null;
if Symbol.Kind = Multi_Terminal then
for J in Symbol.Sub_Symbol.First_Index .. Symbol.Sub_Symbol.Last_Index loop
if Symbol.Sub_Symbol (J).Precedence >= 0 then
Rule.Prec_Symbol := Rule_Symbol_Access (Symbol.Sub_Symbol.Element (J));
exit;
end if;
end loop;
elsif Symbol.Precedence >= 0 then
Rule.Prec_Symbol := Symbol;
end if;
end loop;
end if;
end loop;
end Find_Rule_Precedences;
procedure Find_First_Sets (Session : in out Sessions.Session_Type)
is
use Rules;
use Symbols;
use Types;
Progress : Boolean;
begin
Symbols.Set_Lambda_False_And_Set_Firstset
(First => Natural (Session.Num_Terminal),
Last => Natural (Session.Num_Symbol - 1));
-- First compute all lambdas
loop
Progress := False;
for Rule of Session.Rule loop
if Rule.LHS.Lambda then
goto Continue;
end if;
for Symbol of Rule.RHS loop
pragma Assert (Symbol.Kind = Non_Terminal or Symbol.Lambda = False);
goto Continue;
end loop;
Rule.LHS.Lambda := True;
Progress := True;
<<Continue>>
null;
end loop;
exit when not Progress;
end loop;
-- Now compute all first sets
loop
declare
S1 : Rule_Symbol_Access;
S2 : Symbol_Access;
begin
Progress := False;
for Rule of Session.Rule loop
S1 := Rule.LHS;
for Symbol of Rule.RHS loop
S2 := Symbol_Access (Symbol);
if S2.Kind = Terminal then
if Symbol_Sets.Set_Add (S1.First_Set, S2.Index) then
Progress := True;
end if;
exit;
elsif S2.Kind = Multi_Terminal then
for J in S2.Sub_Symbol.First_Index .. S2.Sub_Symbol.Last_Index loop
if
Symbol_Sets.Set_Add (S1.First_Set,
S2.Sub_Symbol (J).Index)
then
Progress := True;
end if;
end loop;
exit;
elsif Symbol_Access (S1) = S2 then
exit when S1.Lambda = False;
else
if Symbol_Sets.Set_Union (S1.First_Set, S2.First_Set) then
Progress := True;
end if;
exit when S2.Lambda = False;
end if;
end loop;
end loop;
end;
exit when not Progress;
end loop;
end Find_First_Sets;
procedure Find_States
(Session : in out Sessions.Session_Type)
is
use Ada.Strings.Unbounded;
use Errors;
use Symbols;
use Rule_Lists.Lists;
Start_Symbol : Symbol_Access;
Dummy_First_State : States.State_Access;
begin
Config_Lists.Init;
-- Find the start symbol
if Session.Names.Start = "" then
Start_Symbol := Symbol_Access (Element (Session.Start_Rule).LHS);
else
Start_Symbol := Find (To_String (Session.Names.Start));
if Start_Symbol = null then
Errors.Parser_Error
(E014, Line => 0,
Argument_1 => To_String (Session.Names.Start),
Argument_2 => Name_Of (Symbol_Access (Element (Session.Start_Rule).LHS)));
Start_Symbol := Symbol_Access (Element (Session.Start_Rule).LHS);
end if;
end if;
-- Make sure the start symbol doesn't occur on the right-hand side of
-- any rule. Report an error if it does. (YACC would generate a new
-- start symbol in this case.)
for Rule of Session.Rule loop
for RHS_Symbol of Rule.RHS loop
-- FIX ME: Deal with multiterminals XXX
if Symbol_Access (RHS_Symbol) = Start_Symbol then
Errors.Parser_Error (E015, Line => 0,
Argument_1 => Name_Of (Start_Symbol));
end if;
end loop;
end loop;
-- The basis configuration set for the first state
-- is all rules which have the start symbol as their
-- left-hand side
declare
use type Rule_Access;
Rule : Rule_Access := Rule_Access (Start_Symbol.Rule);
begin
while Rule /= null loop
declare
Dummy : Boolean;
Config : Configs.Config_Access;
begin
Rule.LHS_Start := True;
Config := Config_Lists.Add_Basis (Rule, Dot => 0);
Dummy := Symbol_Sets.Set_Add (Config.Follow_Set, 0);
end;
Rule := Rule_Access (Rule.Next_LHS);
end loop;
end;
-- Compute the first state. All other states will be
-- computed automatically during the computation of the first one.
-- The returned pointer to the first state is not used.
Dummy_First_State := Get_State (Session);
Debugs.Debug (True, "Get_State first");
end Find_States;
procedure Find_Actions (Session : in out Sessions.Session_Type)
is
use Configs;
use States;
use Symbols;
use Rules;
use Actions;
use type Types.Symbol_Index;
Config : Config_Access;
Symbol : Symbol_Access;
begin
-- Add all of the reduce actions
-- A reduce action is added for each element of the followset of
-- a configuration which has its dot at the extreme right.
-- Loop over all states
for State of Session.Sorted loop
-- Loop over all configurations
Config := State.Config;
while Config /= null loop
-- Is dot at extreme right?
if Dot_Type (Config.Rule.RHS.Length) = Config.Dot then
for J in 0 .. Session.Num_Terminal - 1 loop
if Symbol_Sets.Set_Find (Config.Follow_Set, J) then
-- Add a reduce action to the state "stp" which will
-- reduce by the rule "cfp->rp" if the lookahead symbol
-- is "lemp->symbols[j]"
Action_Lists.Append (State.Action, Reduce,
Element_At (J),
State => null,
Rule => Config.Rule);
end if;
end loop;
end if;
Config := Config.Next;
end loop;
end loop;
-- Add the accepting token
Add_The_Accepting_Token (Session, Symbol);
-- Add to the first state (which is always the starting state of the
-- finite state machine) an action to ACCEPT if the lookahead is the
-- start nonterminal.
-- Action_Add (Extras.Sorted_At (Extras.Get_Extra, 0).Action,
Action_Lists.Append (Session.Sorted (0).Action,
C_Accept, Symbol,
State => null,
Rule => null);
-- Resolve conflicts
for State of Session.Sorted loop
declare
use Action_Lists.Action_DLLs;
-- Action : Action_Access;
-- Next_Action : Action_Access;
First_Action : Cursor;
Next_Action : Cursor;
begin
-- assert( stp->ap );
Action_Lists.Sort (State.Action);
-- Action := Action_Access (State.Action);
First_Action := State.Action.First;
while
First_Action /= No_Element and then
Next (First_Action) /= No_Element
loop
-- while not (Action /= null and then Action.Next /= null) loop
Next_Action := Next (First_Action);
while
not (Next_Action /= No_Element and then
Element (Next_Action).Symbol = Element (First_Action).Symbol)
loop
-- The two actions "ap" and "nap" have the same lookahead.
-- Figure out which one should be used
declare
First_Element : Action_Record := Element (First_Action);
Next_Element : Action_Record := Element (Next_Action);
begin
Session.Num_Conflict := Session.Num_Conflict +
Resolve_Conflict (First_Element, Next_Element);
Replace_Element (State.Action, First_Action, First_Element);
Replace_Element (State.Action, Next_Action, Next_Element);
end;
Next_Action := Next (Next_Action);
end loop;
First_Action := Next (First_Action);
end loop;
end;
end loop;
-- Report an error for each rule that can never be reduced.
for Rule of Session.Rule loop
Rule.Can_Reduce := False;
end loop;
for State of Session.Sorted loop
for Action of State.Action loop
-- declare
-- Action : Action_Access;
-- begin
-- Action := Action_Access (Extras.Sorted_At (Extras.Get_Extra,
-- Symbol_Index (I)).Action);
-- while Action /= null loop
if Action.Kind = Reduce then
Action.X.Rule.Can_Reduce := True;
end if;
-- Action := Action.Next;
-- end;
end loop;
end loop;
for Rule of Session.Rule loop
if not Rule.Can_Reduce then
Errors.Parser_Error (Errors.E301, Line => Rule.Rule_Line);
end if;
end loop;
end Find_Actions;
function Get_State (Session : in out Sessions.Session_Type)
return States.State_Access
is
use Configs;
use States;
-- use type Sessions.State_Index;
Config : Config_Access;
Basis : Config_Access;
State : State_Access;
begin
-- Extract the sorted basis of the new state. The basis was constructed
-- by prior calls to "Config_lists.Add_Basis".
Config_Lists.Sort_Basis;
Basis := Config_Lists.Basis;
-- Get a state with the same basis
State := States.Find (Basis);
if State /= null then
Debugs.Debug (True, "This is not a new state");
-- A state with the same basis already exists! Copy all the follow-set
-- propagation links from the state under construction into the
-- preexisting state, then return a pointer to the preexisting state
declare
X, Y : Config_Access;
begin
X := Basis;
Y := State.Basis;
while X /= null and Y /= null loop
Prop_Links.Copy (Y.Backward_PL, X.Backward_PL);
Prop_Links.Delete (X.Forward_PL);
X.Forward_PL.Clear;
X.Backward_PL.Clear;
X := X.Basis;
Y := Y.Basis;
end loop;
end;
Config := Config_Lists.Xreturn;
Config_Lists.Eat (Config);
else
Debugs.Debug (True, "This is a new state");
-- This really is a new state. Construct all the details
Config_Lists.Closure (Session); -- Compute the configuration closure
Config_Lists.Sort; -- Sort the configuration closure
Config := Config_Lists.Xreturn; -- Get a pointer to the config list
State := States.Create; -- A new state structure
-- MemoryCheck(stp);
State.Basis := Basis; -- Remember the configuration basis
State.Config := Config; -- Remember the configuration closure
-- XXX
-- State.State_Num := Natural (Session.N_State); -- Every state gets a sequence number
State.Number := State_Number (Session.Sorted.Length);
-- Every state gets a sequence number
-- Session.N_State := Session.N_State + 1;
State.Action.Clear; -- No actions, yet.
Debugs.Debug (True, "States.Insert");
States.Insert (State, State.Basis); -- Add to the state table
Build_Shifts (Session, State.all); -- Recursively compute successor states
end if;
return State;
end Get_State;
function Same_Symbol (Left, Right : in Symbols.Symbol_Access) return Boolean;
-- Return true when two symbols are the same.
function Same_Symbol (Left, Right : in Symbols.Symbol_Access) return Boolean
is
use Symbols;
use type Ada.Containers.Count_Type;
begin
if Left = Right then
return True;
end if;
if Left.Kind /= Multi_Terminal then
return False;
end if;
if Right.Kind /= Multi_Terminal then
return False;
end if;
if Left.Sub_Symbol.Length /= Right.Sub_Symbol.Length then
return False;
end if;
for Index in Left.Sub_Symbol.First_Index .. Left.Sub_Symbol.Last_Index loop
if Left.Sub_Symbol (Index) /= Right.Sub_Symbol (Index) then
return False;
end if;
end loop;
return True;
end Same_Symbol;
procedure Build_Shifts (Session : in out Sessions.Session_Type;
State : in out States.State_Record)
is
use type Rules.Dot_Type;
use Configs;
use Symbols;
use States;
Config : Config_Access; -- For looping thru the config closure of "stp"
B_Config : Config_Access; -- For the inner loop on config closure of "stp"
New_Config : Config_Access; --
Symbol : Symbol_Access; -- Symbol following the dot in configuration "cfp"
B_Symbol : Symbol_Access; -- Symbol following the dot in configuration "bcfp"
New_State : State_Access; -- A pointer to a successor state
begin
-- Each configuration becomes complete after it contibutes to a successor
-- state. Initially, all configurations are incomplete
Config := State.Config;
while Config /= null loop
Config.Status := Incomplete;
Config := Config.Next;
end loop;
-- Loop through all configurations of the state "stp"
Config := State.Config;
while Config /= null loop
-- Already used by inner loop
-- Can't shift this config
if
Config.Status = Incomplete and
Config.Dot < Config.Rule.RHS.Last_Index
then
Config_Lists.Reset; -- Reset the new config set
Symbol := Symbol_Access (Config.Rule.RHS.Element (Config.Dot));
-- Symbol after the dot
-- For every configuration in the state "stp" which has the symbol "sp"
-- following its dot, add the same configuration to the basis set under
-- construction but with the dot shifted one symbol to the right.
B_Config := Config;
while B_Config /= null loop
if
B_Config.Status = Incomplete and
B_Config.Dot < B_Config.Rule.RHS.Last_Index
then
-- Get symbol after dot
-- Must be same as for "cfp"
B_Symbol := Symbol_Access (B_Config.Rule.RHS.Element (B_Config.Dot));
if Same_Symbol (B_Symbol, Symbol) then
B_Config.Status := Complete; -- Mark this config as used
New_Config := Config_Lists.Add_Basis
(B_Config.Rule,
B_Config.Dot + 1);
Prop_Links.Append (New_Config.Backward_PL, B_Config);
end if;
end if;
B_Config := B_Config.Next;
end loop;
-- Get a pointer to the state described by the basis configuration set
-- constructed in the preceding loop
New_State := Get_State (Session);
-- The state "newstp" is reached from the state "stp" by a shift action
-- on the symbol "sp"
if Symbol.Kind = Multi_Terminal then
for Sub_Symbol of Symbol.Sub_Symbol loop
Action_Lists.Append (State.Action, Actions.Shift, Sub_Symbol,
State => New_State, Rule => null);
end loop;
else
Action_Lists.Append (State.Action, Actions.Shift, Symbol,
State => New_State, Rule => null);
end if;
end if;
Config := Config.Next;
end loop;
end Build_Shifts;
procedure Find_Links (Session : in out Sessions.Session_Type)
is
use Configs;
use States;
-- use type Sessions.State_Index;
Config : Config_Access;
Other : Config_Access;
begin
-- Housekeeping detail:
-- Add to every propagate link a pointer back to the state to
-- which the link is attached.
for State of Session.Sorted loop
Debugs.Debug (True, "Sessions.Sorted'Length: " & Session.Sorted.Length'Image);
Config := State.Config;
while Config /= null loop
Config.State := State;
Config := Config.Next;
end loop;
end loop;
-- Convert all backlinks into forward links. Only the forward
-- links are used in the follow-set computation.
for State of Session.Sorted loop
Config := State.Config;
while Config /= null loop
for Link of Config.Backward_PL loop
Other := Config_Access (Link);
Prop_Links.Append (Other.Forward_PL, Config);
end loop;
Config := Config.Next;
end loop;
end loop;
end Find_Links;
procedure Find_Follow_Sets (Session : in out Sessions.Session_Type)
is
use Configs;
-- use type Sessions.State_Index;
Config : Config_Access;
Progress : Boolean;
Change : Boolean;
begin
for State of Session.Sorted loop
Config := State.Config;
loop
exit when Config = null;
Config.Status := Incomplete;
Config := Config.Next;
end loop;
end loop;
loop
Progress := False;
for State of Session.Sorted loop
Config := State.Config;
loop
exit when Config = null;
if Config.Status = Complete then
goto Continue;
end if;
for Link of Config.Forward_PL loop
Change := Symbol_Sets.Set_Union (Link.Follow_Set,
Config.Follow_Set);
if Change then
Link.Status := Incomplete;
Progress := True;
end if;
end loop;
Config.Status := Complete;
<<Continue>>
Config := Config.Next;
end loop;
end loop;
exit when not Progress;
end loop;
end Find_Follow_Sets;
procedure Reprint_Of_Grammar
(Session : in out Sessions.Session_Type;
Base_Name : in String;
Token_Prefix : in String;
Terminal_Last : in Natural)
is
use Ada.Text_IO;
begin
-- if Options.RP_Flag then
-- Reports.Reprint (Session);
-- else
-- Initialize the size for all follow and first sets
Symbol_Sets.Set_Range (First => Types.Symbol_Index'First,
Last => Types.Symbol_Index (Terminal_Last + 1));
-- Find the precedence for every production rule (that has one)
Builds.Find_Rule_Precedences (Session);
if Options.Debug_Level > 0 then
Ada.Text_IO.Put_Line ("16 dump_symbols");
Symbols.IO.JQ_Dump_Symbols (Session, Mode => 1);
end if;
-- Compute the lambda-nonterminals and the first-sets for every
-- nonterminal
Builds.Find_First_Sets (Session);
if Options.Debug_Level > 0 then
Ada.Text_IO.Put_Line ("17 dump_symbols");
Symbols.IO.JQ_Dump_Symbols (Session, Mode => 1);
end if;
-- Ada.Text_IO.Put_Line ("17 dump_rules");
-- Debugs.JQ_Dump_Rules (Session, Mode => 1);
if Options.Debug_Level > 0 then
Ada.Text_IO.Put_Line ("17 dump_states");
Debugs.Put_States (Session, Mode => 1);
end if;
-- Compute all LR(0) states. Also record follow-set propagation
-- links so that the follow-set can be computed later
Put_Line ("### 2-5");
-- XXX
-- Session.N_State := 0;
Builds.Find_States (Session);
Put_Line ("### 2-5-2");
-- Debugs.Put_States (Session, Mode => 1);
Sessions.Create_Sorted_States (Session);
Put_Line ("2-5-2 dump_states");
Debugs.Put_States (Session, Mode => 1);
--
-- Tie up loose ends on the propagation links
--
Builds.Find_Links (Session);
Put_Line ("### 2-6");
--
-- Compute the follow set of every reducible configuration
--
Builds.Find_Follow_Sets (Session);
Put_Line ("### 2-7");
-- Put_Line ("2-7 dump_symbols");
-- Symbols.IO.JQ_Dump_Symbols (Session, Mode => 2);
-- Put_Line ("2-7 dump_rules");
-- Debugs.JQ_Dump_Rules (Session, Mode => 1);
Put_Line ("2-7 dump_states");
Debugs.Put_States (Session, Mode => 1);
--
-- Compute the action tables
--
Builds.Find_Actions (Session);
Put_Line ("### 2-8");
--
-- Compress the action tables
--
if not Options.Compress then
Reports.Compress_Tables (Session);
end if;
Put_Line ("### 2-9");
-- Reorder and renumber the states so that states with fewer choices
-- occur at the end. This is an optimization that helps make the
-- generated parser tables smaller.
if not Options.No_Resort then
Reports.Resort_States (Session);
end if;
Put_Line ("### 2-10");
-- Generate a report of the parser generated. (the "y.output" file)
if not Options.Be_Quiet then
Reports.Report_Output (Session);
end if;
-- Generate the source code for the parser
Reports.Report_Table
(Session,
Make_Headers => Options.Make_Headers,
Generate_SQL => Options.Generate_SQL,
User_Template_Name => Options.User_Template.all);
-- Produce a header file for use by the scanner. (This step is
-- omitted if the "-m" option is used because makeheaders will
-- generate the file for us.)
Reports.Report_Header
(Session,
Token_Prefix,
Base_Name, -- File_Makename (Session, ""),
"MODULE XXX",
Terminal_Last);
-- end if;
end Reprint_Of_Grammar;
procedure Add_The_Accepting_Token
(Session : in out Sessions.Session_Type;
Symbol : in out Symbols.Symbol_Access)
is
use Ada.Strings.Unbounded;
use Symbols;
use Rule_Lists.Lists;
begin
if Session.Names.Start = "" then
Symbol := Symbol_Access (Element (Session.Start_Rule).LHS);
else
Symbol := Find (To_String (Session.Names.Start));
if Symbol = null then
Symbol := Symbol_Access (Element (Session.Start_Rule).LHS);
end if;
end if;
end Add_The_Accepting_Token;
end Builds;
|
oeis/015/A015572.asm | neoneye/loda-programs | 11 | 27987 | <reponame>neoneye/loda-programs
; A015572: Expansion of x/(1 - 7*x - 12*x^2).
; Submitted by <NAME>(s2)
; 0,1,7,61,511,4309,36295,305773,2575951,21700933,182817943,1540136797,12974772895,109305051829,920832637543,7757489084749,65352415243759,550556775723301,4638126412988215,39073566199597117,329172480353038399,2773090156866434197,23361700862301500167,196808987918507711533,1658003325777171982735,13967731135462296417541,117670157857562138715607,991303878628482528019741,8351169044690123360725471,70353829856372653861315189,592690837530890057357911975,4993081820992702247841166093
mov $1,1
lpb $0
sub $0,1
mov $2,$3
mul $2,18
mul $3,6
add $3,$1
add $1,$2
lpe
mov $0,$3
|
src/vulkan-instances.ads | persan/a-vulkan | 0 | 23328 | private with System.Storage_Elements;
private with Ada.Finalization;
package Vulkan.Instances is
type InstanceCreateInfo is tagged limited private;
type AllocationCallbacks is tagged limited private;
type Instance (CreateInfo : not null access constant InstanceCreateInfo;
Allocator : not null access constant AllocationCallbacks) is tagged limited private;
private
type Instance (CreateInfo : not null access constant InstanceCreateInfo;
Allocator : not null access constant AllocationCallbacks) is new Ada.Finalization.Limited_Controlled with record
Store : aliased System.Storage_Elements.Storage_Array (1 .. 8);
end record;
type InstanceCreateInfo is new Ada.Finalization.Limited_Controlled with record
null;
end record;
type AllocationCallbacks is new Ada.Finalization.Limited_Controlled with record
null;
end record;
end Vulkan.Instances;
|
sys_prog/lab_8/lab8.asm | vimikeva/s | 0 | 92800 | <reponame>vimikeva/s<gh_stars>0
.386
scale macro p1
fld max_&p1
fsub min_&p1
fild max_crt_&p1
fdivp st(1), st(0)
fstp scale_&p1
endm
_data segment use16
min_x dq -3.2
max_x dq 3.2
max_crt_x dw 320
crt_x dw ?
scale_x dq ?
min_y dq -0.4
max_y dq 5.0
max_crt_y dw 200
crt_y dw ?
scale_y dq ?
step dq 0.001
tmp dw ?
color_axis db 2bh
color_plot db 3bh
value dd 1h
_data ends
_code segment use16
assume cs:_code, ds:_data
@main:
mov ax, _data
mov ds, ax
mov ax, 13h
int 10h
finit
scale x
scale y
call draw_axis
call draw_plot
mov ah, 8
int 21h
mov ax, 3
int 10h
mov ax, 4C00h
int 21h
func proc
fld st(0)
fmul st(0), st(0)
faddp st(1), st(0)
fld value
faddp st(1), st(0)
ret
func endp
draw_plot proc
mov al, color_plot
mov color_axis, al
fld min_x
@1:
fld st(0)
fld st(0)
call get_x
call func
call get_y
call draw_point
fld step
faddp st(1), st(0)
fcom max_x
fstsw ax
sahf
jna @1
ffree st(0)
ret
draw_plot endp
get_x proc
fsub min_x
fdiv scale_x
frndint
fistp crt_x
ret
get_x endp
get_y proc
fsub min_y
fdiv scale_y
frndint
fistp crt_y
mov ax, max_crt_y
sub ax, crt_y
mov crt_y, ax
ret
get_y endp
draw_point proc
mov ax, 0A000h
mov es, ax
mov si, crt_y
mov di, crt_x
cmp si, max_crt_y
jae @nd1
cmp di, max_crt_x
jae @nd1
mov ax, max_crt_x
mul si
add ax, di
mov bx, ax
mov al , color_axis
mov byte ptr es:[bx], al
@nd1:
ret
draw_point endp
draw_axis proc
fldz
call get_y
mov crt_x, 0
mov cx, max_crt_x
@x_c:
call draw_point
inc crt_x
loop @x_c
fld max_x
fsub min_x
frndint
fistp tmp
mov cx, tmp
fld min_x
frndint
dec crt_y
@lx:
fld st(0)
call get_x
call draw_point
fld1
faddp st(1), st(0)
loop @lx
ffree st(0)
fldz
call get_x
mov crt_y, 0
mov cx, max_crt_y
@y_c:
call draw_point
inc crt_y
loop @y_c
fld max_y
fsub min_y
frndint
fistp tmp
mov cx, tmp
fld min_y
frndint
dec crt_x
@ly:
fst st(1)
call get_y
call draw_point
fld1
faddp st(1), st(0)
fcom max_y
loop @ly
ffree st(0)
ret
draw_axis endp
_code ends
end @main
|
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca.log_21829_320.asm | ljhsiun2/medusa | 9 | 82507 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca.log_21829_320.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1eda1, %rbx
nop
nop
nop
add $49346, %r11
movl $0x61626364, (%rbx)
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_normal_ht+0xdfc1, %r15
nop
sub %r14, %r14
movb $0x61, (%r15)
nop
nop
nop
nop
cmp $35519, %rbx
lea addresses_UC_ht+0xccc1, %rdx
nop
nop
sub $10532, %r13
movl $0x61626364, (%rdx)
nop
and $29712, %rbx
lea addresses_D_ht+0x4701, %r10
nop
nop
nop
add %rdx, %rdx
mov (%r10), %r14w
nop
nop
nop
inc %r15
lea addresses_UC_ht+0x1c701, %rsi
lea addresses_D_ht+0x12fd1, %rdi
nop
nop
sub $31988, %r15
mov $44, %rcx
rep movsw
nop
nop
nop
cmp %r11, %r11
lea addresses_D_ht+0x70a1, %rsi
lea addresses_normal_ht+0xdb01, %rdi
nop
nop
nop
nop
xor $33784, %r13
mov $64, %rcx
rep movsl
nop
nop
nop
xor $62436, %rdx
lea addresses_D_ht+0x18207, %r13
nop
nop
sub %r15, %r15
mov $0x6162636465666768, %rdi
movq %rdi, (%r13)
nop
nop
nop
nop
add %r14, %r14
lea addresses_WT_ht+0x12ec1, %r11
sub %rdx, %rdx
movl $0x61626364, (%r11)
nop
nop
nop
nop
add $101, %r13
lea addresses_D_ht+0x1e2c1, %rsi
lea addresses_WC_ht+0x1a521, %rdi
clflush (%rsi)
nop
nop
nop
and $58930, %r10
mov $105, %rcx
rep movsq
nop
and $20169, %r10
lea addresses_A_ht+0x169c1, %rsi
lea addresses_normal_ht+0x7bd5, %rdi
nop
sub %r15, %r15
mov $80, %rcx
rep movsl
nop
nop
cmp %r13, %r13
lea addresses_WC_ht+0x143c1, %r15
nop
nop
nop
nop
nop
and $40578, %r14
mov $0x6162636465666768, %rcx
movq %rcx, (%r15)
nop
dec %rdx
lea addresses_A_ht+0x158d3, %r11
nop
nop
and $40614, %rdx
mov (%r11), %rbx
nop
nop
nop
nop
xor $16427, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdi
// Load
mov $0x7b3f60000000fc1, %r8
nop
nop
dec %rbx
mov (%r8), %ecx
// Exception!!!
mov (0), %rbx
nop
cmp %rbx, %rbx
// Faulty Load
lea addresses_UC+0x197c1, %rdi
nop
nop
nop
nop
nop
and %r14, %r14
vmovaps (%rdi), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %r9
lea oracles, %r14
and $0xff, %r9
shlq $12, %r9
mov (%r14,%r9,1), %r9
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': True, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 6}, 'dst': {'same': True, 'type': 'addresses_D_ht', 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': True, 'type': 'addresses_D_ht', 'same': True, 'AVXalign': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 1}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}, 'dst': {'same': True, 'type': 'addresses_normal_ht', 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'40': 8, '45': 15139, '00': 209, '46': 6468, '47': 5}
46 46 46 46 45 45 45 46 45 45 45 45 45 45 46 46 45 45 45 45 46 46 46 45 45 45 45 45 45 46 46 46 45 45 45 46 46 45 45 46 45 45 46 45 45 45 46 46 45 45 45 45 45 45 46 45 45 45 45 46 45 45 45 46 46 45 45 45 46 46 45 45 45 45 45 45 45 46 45 45 46 45 45 45 45 45 46 46 45 45 45 46 45 45 46 46 45 45 45 45 45 45 45 45 45 46 46 46 46 46 45 46 45 45 46 46 45 45 45 46 45 45 45 45 45 46 45 45 46 46 45 45 45 45 45 46 46 45 45 45 45 45 45 45 45 46 45 45 45 46 45 45 46 45 45 46 45 45 45 45 45 46 46 46 45 45 45 45 46 45 45 45 46 45 45 45 45 45 45 45 45 45 45 46 46 45 45 45 45 46 45 46 45 45 45 45 45 46 45 45 45 45 45 45 45 45 46 46 45 45 46 45 46 45 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 46 46 45 45 45 46 46 45 45 46 45 45 45 45 45 46 45 45 45 46 45 45 45 45 46 46 45 45 45 45 46 45 45 45 45 46 46 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 00 45 45 46 45 45 46 45 45 45 45 45 46 45 45 45 46 45 45 45 45 46 45 45 45 46 45 45 45 46 46 45 45 46 46 45 45 45 46 45 45 45 46 46 46 45 45 45 45 45 46 45 45 45 46 45 45 45 45 45 46 46 45 45 46 46 45 45 46 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 46 46 45 45 45 45 45 45 45 45 46 46 45 45 45 45 45 46 45 45 45 46 46 46 45 46 45 45 46 46 45 45 45 45 46 46 46 45 45 45 45 45 45 45 46 46 45 45 45 45 46 45 45 45 45 46 46 45 45 46 46 45 45 45 45 45 45 45 46 46 45 45 45 45 45 45 45 45 45 46 46 45 45 45 45 46 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 46 45 45 46 45 45 45 00 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 46 46 45 45 46 46 45 45 45 45 45 45 46 45 45 45 46 45 45 46 45 45 46 45 45 45 45 46 45 45 45 45 46 46 46 46 45 45 45 45 45 45 45 45 45 46 45 45 45 45 46 46 45 45 45 46 46 45 45 46 46 46 46 46 46 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 46 46 45 45 45 45 45 45 46 45 45 45 45 00 45 45 46 45 45 45 46 00 45 45 45 45 45 45 45 45 45 45 46 46 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 46 45 45 45 45 45 46 46 46 46 45 45 46 46 45 46 46 45 45 46 46 45 45 45 46 46 45 45 45 45 46 45 45 46 46 46 45 45 45 46 45 45 46 46 45 45 45 45 45 46 45 45 46 45 45 45 45 45 46 46 45 45 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 46 46 45 45 46 46 46 45 45 45 45 45 45 45 46 46 46 45 45 46 45 45 45 45 45 45 45 45 46 46 45 45 45 46 45 45 45 46 46 45 45 45 45 45 46 45 45 45 45 46 45 46 46 45 45 45 45 46 46 45 45 45 46 45 45 45 46 46 45 45 45 46 46 45 45 45 46 45 45 45 46 46 45 45 46 45 45 45 45 46 45 45 46 46 45 45 45 45 45 46 46 46 46 45 45 45 45 45 45 45 45 45 46 45 45 46 46 00 45 45 46 46 45 45 00 45 45 45 45 45 46 45 45 45 45 45 46 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 46 46 45 45 46 45 45 45 45 45 45 45 45 46 46 45 45 45 45 45 45 45 45 46 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 46 46 45 45 45 45 45 45 45 45 46 45 45 45 46 46 45 46 46 45 45 45 45 00 45 46 45 45 46 45 46 45 45 45 45 45 46 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 46 45
*/
|
programs/oeis/069/A069584.asm | neoneye/loda | 22 | 2423 | ; A069584: a(n) = n - largest perfect power <= n.
; 0,1,2,0,1,2,3,0,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,8,0,1,0,1,2,3,4,0,1,2,3,0,1,2,3,4,5,6,7,8,9,10,11,12,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
lpb $0
mov $2,$0
seq $2,132350 ; If n > 1 is a k-th power with k >= 2 then a(n) = 0, otherwise a(n) = 1.
sub $0,$2
pow $3,0
add $1,$3
lpe
mov $0,$1
|
programs/oeis/270/A270226.asm | neoneye/loda | 22 | 17928 | <reponame>neoneye/loda
; A270226: a(n) is the number of terms in the n-th block of consecutive integers of A136119.
; 1,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3
mov $2,$0
mov $4,2
lpb $4
sub $4,1
add $0,$4
sub $0,1
mov $3,$0
max $3,0
seq $3,1953 ; a(n) = floor((n + 1/2) * sqrt(2)).
mov $5,$4
mul $5,$3
add $1,$5
lpe
min $2,1
mul $2,$3
sub $1,$2
add $1,1
mov $0,$1
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0_notsx.log_21829_570.asm | ljhsiun2/medusa | 9 | 168911 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x43d0, %r9
nop
nop
nop
nop
nop
inc %rdx
mov $0x6162636465666768, %rbp
movq %rbp, (%r9)
dec %r14
lea addresses_D_ht+0xc380, %r11
nop
nop
nop
nop
xor %r14, %r14
mov (%r11), %r10w
nop
nop
nop
nop
cmp $56171, %r14
lea addresses_A_ht+0x143f0, %r10
nop
nop
cmp %r8, %r8
vmovups (%r10), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %r14
nop
nop
nop
inc %r9
lea addresses_WC_ht+0x4b50, %rsi
lea addresses_A_ht+0xd590, %rdi
xor $737, %r14
mov $106, %rcx
rep movsb
nop
nop
nop
nop
nop
add $39886, %r11
lea addresses_WT_ht+0x134a0, %rsi
lea addresses_A_ht+0x5fa0, %rdi
nop
nop
mfence
mov $44, %rcx
rep movsw
nop
nop
inc %rsi
lea addresses_UC_ht+0x4fd0, %rsi
nop
nop
sub $41247, %rdi
movl $0x61626364, (%rsi)
nop
nop
nop
nop
xor $26858, %r8
lea addresses_WT_ht+0x194fe, %rsi
lea addresses_A_ht+0x118d0, %rdi
nop
and %r10, %r10
mov $78, %rcx
rep movsb
nop
nop
nop
nop
xor $31643, %rdx
lea addresses_A_ht+0x11910, %rsi
lea addresses_WC_ht+0x4324, %rdi
nop
nop
nop
nop
xor %r8, %r8
mov $44, %rcx
rep movsq
and $18855, %r8
lea addresses_UC_ht+0x1b85c, %rbp
nop
cmp %rcx, %rcx
mov (%rbp), %esi
nop
inc %rcx
lea addresses_A_ht+0x131d0, %rdx
clflush (%rdx)
nop
nop
nop
sub %r9, %r9
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
vmovups %ymm3, (%rdx)
nop
nop
nop
add $9054, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r15
push %r8
push %rcx
push %rdi
push %rsi
// Store
lea addresses_D+0x16580, %r8
xor %r10, %r10
mov $0x5152535455565758, %r14
movq %r14, %xmm2
vmovntdq %ymm2, (%r8)
nop
nop
add %r10, %r10
// Store
lea addresses_PSE+0x1cf30, %r8
nop
nop
nop
nop
nop
and %r13, %r13
movw $0x5152, (%r8)
nop
nop
nop
nop
dec %r8
// Store
lea addresses_normal+0x12750, %rdi
nop
sub %r12, %r12
movb $0x51, (%rdi)
nop
nop
nop
nop
nop
inc %r14
// REPMOV
lea addresses_WT+0xfff4, %rsi
lea addresses_UC+0x1cfd0, %rdi
nop
nop
nop
nop
add %r13, %r13
mov $115, %rcx
rep movsl
nop
cmp %r8, %r8
// Store
lea addresses_WC+0xd168, %r15
nop
nop
nop
add %rdi, %rdi
mov $0x5152535455565758, %r13
movq %r13, %xmm4
vmovups %ymm4, (%r15)
nop
nop
nop
nop
dec %r12
// Store
lea addresses_WC+0x147d0, %rcx
nop
nop
nop
nop
nop
xor %rsi, %rsi
movb $0x51, (%rcx)
nop
nop
nop
add %r10, %r10
// Store
lea addresses_normal+0x1435c, %r10
nop
nop
nop
sub %r14, %r14
movw $0x5152, (%r10)
nop
nop
nop
and $21392, %rdi
// Store
lea addresses_PSE+0x2c0, %rcx
nop
nop
nop
nop
nop
and $22443, %r15
movl $0x51525354, (%rcx)
nop
nop
cmp $52732, %rdi
// Load
lea addresses_A+0x1a7d0, %r10
nop
nop
sub %r15, %r15
movups (%r10), %xmm4
vpextrq $0, %xmm4, %rcx
nop
nop
nop
nop
nop
cmp %rsi, %rsi
// Faulty Load
lea addresses_UC+0x1cfd0, %r14
add %rdi, %rdi
movb (%r14), %r10b
lea oracles, %rsi
and $0xff, %r10
shlq $12, %r10
mov (%rsi,%r10,1), %r10
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_WT', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC', 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}}
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 4}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 11}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': True}}
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
regtests/asf-converters-tests.adb | Letractively/ada-asf | 0 | 19477 | -----------------------------------------------------------------------
-- Faces Context Tests - Unit tests for ASF.Contexts.Faces
-- Copyright (C) 2010, 2011, 2012, 2013 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Calendar;
with Ada.Calendar.Formatting;
with Util.Beans.Objects.Time;
with Util.Test_Caller;
with ASF.Tests;
with ASF.Components.Html.Text;
with ASF.Converters.Dates;
package body ASF.Converters.Tests is
use Util.Tests;
use ASF.Converters.Dates;
package Caller is new Util.Test_Caller (Test, "Converters");
procedure Test_Date_Conversion (T : in out Test;
Date_Style : in Dates.Style_Type;
Time_Style : in Dates.Style_Type;
Expect : in String);
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
-- To document what is tested, register the test methods for each
-- operation that is tested.
Caller.Add_Test (Suite, "Test ASF.Converters.Dates.To_String (Date, Short)",
Test_Date_Short_Converter'Access);
Caller.Add_Test (Suite, "Test ASF.Converters.Dates.To_String (Date, Medium)",
Test_Date_Medium_Converter'Access);
Caller.Add_Test (Suite, "Test ASF.Converters.Dates.To_String (Date, Long)",
Test_Date_Long_Converter'Access);
Caller.Add_Test (Suite, "Test ASF.Converters.Dates.To_String (Date, Full)",
Test_Date_Full_Converter'Access);
Caller.Add_Test (Suite, "Test ASF.Converters.Dates.To_String (Time, Short)",
Test_Time_Short_Converter'Access);
Caller.Add_Test (Suite, "Test ASF.Converters.Dates.To_String (Time, Medium)",
Test_Time_Medium_Converter'Access);
Caller.Add_Test (Suite, "Test ASF.Converters.Dates.To_String (Time, Long)",
Test_Time_Long_Converter'Access);
end Add_Tests;
-- ------------------------------
-- Test getting an attribute from the faces context.
-- ------------------------------
procedure Test_Date_Conversion (T : in out Test;
Date_Style : in Dates.Style_Type;
Time_Style : in Dates.Style_Type;
Expect : in String) is
Ctx : aliased ASF.Contexts.Faces.Faces_Context;
UI : ASF.Components.Html.Text.UIOutput;
C : ASF.Converters.Dates.Date_Converter_Access;
D : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (2011, 11, 19,
3, 4, 5);
begin
T.Setup (Ctx);
ASF.Contexts.Faces.Set_Current (Ctx'Unchecked_Access, ASF.Tests.Get_Application.all'Access);
if Date_Style = Dates.DEFAULT then
C := ASF.Converters.Dates.Create_Date_Converter (Date => Date_Style,
Time => Time_Style,
Format => ASF.Converters.Dates.TIME,
Locale => "en",
Pattern => "");
elsif Time_Style = Dates.DEFAULT then
C := ASF.Converters.Dates.Create_Date_Converter (Date => Date_Style,
Time => Time_Style,
Format => ASF.Converters.Dates.DATE,
Locale => "en",
Pattern => "");
else
C := ASF.Converters.Dates.Create_Date_Converter (Date => Date_Style,
Time => Time_Style,
Format => ASF.Converters.Dates.BOTH,
Locale => "en",
Pattern => "");
end if;
UI.Set_Converter (C.all'Access);
declare
R : constant String := C.To_String (Ctx, UI, Util.Beans.Objects.Time.To_Object (D));
begin
Util.Tests.Assert_Equals (T, Expect, R, "Invalid date conversion");
end;
end Test_Date_Conversion;
-- ------------------------------
-- Test the date short converter.
-- ------------------------------
procedure Test_Date_Short_Converter (T : in out Test) is
begin
Test_Date_Conversion (T, ASF.Converters.Dates.SHORT, ASF.Converters.Dates.DEFAULT,
"19/11/2011");
end Test_Date_Short_Converter;
-- ------------------------------
-- Test the date medium converter.
-- ------------------------------
procedure Test_Date_Medium_Converter (T : in out Test) is
begin
Test_Date_Conversion (T, ASF.Converters.Dates.MEDIUM, ASF.Converters.Dates.DEFAULT,
"Nov 19, 2011");
end Test_Date_Medium_Converter;
-- ------------------------------
-- Test the date long converter.
-- ------------------------------
procedure Test_Date_Long_Converter (T : in out Test) is
begin
Test_Date_Conversion (T, ASF.Converters.Dates.LONG, ASF.Converters.Dates.DEFAULT,
"November 19, 2011");
end Test_Date_Long_Converter;
-- ------------------------------
-- Test the date full converter.
-- ------------------------------
procedure Test_Date_Full_Converter (T : in out Test) is
begin
Test_Date_Conversion (T, ASF.Converters.Dates.FULL, ASF.Converters.Dates.DEFAULT,
"Saturday, November 19, 2011");
end Test_Date_Full_Converter;
-- ------------------------------
-- Test the time short converter.
-- ------------------------------
procedure Test_Time_Short_Converter (T : in out Test) is
begin
Test_Date_Conversion (T, ASF.Converters.Dates.DEFAULT, ASF.Converters.Dates.SHORT,
"03:04");
end Test_Time_Short_Converter;
-- ------------------------------
-- Test the time short converter.
-- ------------------------------
procedure Test_Time_Medium_Converter (T : in out Test) is
begin
Test_Date_Conversion (T, ASF.Converters.Dates.DEFAULT, ASF.Converters.Dates.MEDIUM,
"03:04");
end Test_Time_Medium_Converter;
-- ------------------------------
-- Test the time long converter.
-- ------------------------------
procedure Test_Time_Long_Converter (T : in out Test) is
begin
Test_Date_Conversion (T, ASF.Converters.Dates.DEFAULT, ASF.Converters.Dates.LONG,
"03:04:05");
end Test_Time_Long_Converter;
end ASF.Converters.Tests;
|
programs/oeis/158/A158117.asm | neoneye/loda | 22 | 80173 | ; A158117: Triangle T(n, k) = 10^(k*(n-k)), read by rows.
; 1,1,1,1,10,1,1,100,100,1,1,1000,10000,1000,1,1,10000,1000000,1000000,10000,1,1,100000,100000000,1000000000,100000000,100000,1,1,1000000,10000000000,1000000000000,1000000000000,10000000000,1000000,1,1
seq $0,4247 ; Multiplication table read by antidiagonals: T(i,j) = ij (i>=0, j>=0).
mov $1,10
pow $1,$0
mov $0,$1
|
ga_lib/src/ga_draw.adb | rogermc2/GA_Ada | 3 | 3168 | <gh_stars>1-10
-- Based on libgasandbox.draw.h and draw.cpp
with Ada.Numerics;
with Ada.Numerics.Elementary_Functions;
with Ada.Text_IO; use Ada.Text_IO;
with GL;
with GL.Attributes;
with GL.Culling;
with GL.Objects.Buffers;
with GL.Objects.Vertex_Arrays;
with GL.Rasterization;
with GL.Toggles;
with GL.Types; use GL.Types;
with GL_Util;
with Maths;
with Utilities;
with Blade_Types;
with E3GA;
with E3GA_Utilities;
with GA_Maths;
-- with GA_Utilities;
with Geosphere;
with Multivectors;
with Shader_Manager;
package body GA_Draw is
Count : Integer := 0;
procedure Draw_Circle (Palet_Type : Palet.Colour_Palet;
Method : GA_Draw.Method_Type);
-- ------------------------------------------------------------------------
procedure Draw_Base (Render_Program : GL.Objects.Programs.Program;
Scale : Float) is
use GL.Objects.Buffers;
use GA_Maths.Float_Functions;
Vertex_Array : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
Vertex_Buffer : GL.Objects.Buffers.Buffer;
S_Scale : constant Single := Single (5.0 / Scale);
Z : float := 0.0;
Num_Steps : constant int := 32;
Rotor_Step : constant float :=
2.0 * Ada.Numerics.Pi / float (Num_Steps);
Fan : Singles.Vector3_Array (1 .. Num_Steps + 1);
begin
Vertex_Array.Initialize_Id;
Vertex_Array.Bind;
Vertex_Buffer.Initialize_Id;
Array_Buffer.Bind (Vertex_Buffer);
Fan (1) := (S_Scale, 0.0, -0.25);
for Count in 2 .. Num_Steps + 1 loop
Fan (Count) := (S_Scale * Single (Cos (Z)), S_Scale * Single (Sin (Z)), -0.25);
Z := Z + Rotor_Step;
end loop;
Utilities.Load_Vertex_Buffer (Array_Buffer, Fan, Static_Draw);
GL.Objects.Programs.Use_Program (Render_Program);
GL.Attributes.Enable_Vertex_Attrib_Array (0);
GL.Objects.Buffers.Array_Buffer.Bind (Vertex_Buffer);
GL.Attributes.Set_Vertex_Attrib_Pointer (0, 3, Single_Type, 0, 0);
GL.Objects.Vertex_Arrays.Draw_Arrays (Mode => Triangle_Fan,
First => 0,
Count => Num_Steps);
GL.Attributes.Disable_Vertex_Attrib_Array (0);
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Base.");
raise;
end Draw_Base;
-- ------------------------------------------------------------------------
-- Draw_Bivector corresponds to draw.draw_Bivector of draw.cpp
-- The parameter names correspond of those in draw.h!
procedure Draw_Bivector (Render_Program : GL.Objects.Programs.Program;
Base, Normal, Ortho_1, Ortho_2 : C3GA.Vector_E3;
Palet_Type : Palet.Colour_Palet;
Scale : float := 1.0;
Method : Method_Type :=
Draw_Bivector_Circle) is
use GA_Maths;
use Float_Functions;
use GL.Types.Singles;
-- Rotor_Step : float := 2.0 * Ada.Numerics.Pi / 64.0;
-- Cords : Float_3D := (0.0, 0.0, 0.0);
-- Translate : Vector3 := (0.0, 0.0, 0.0);
-- O2 : Multivectors.M_Vector := Ortho_2;
Model_Matrix : GL.Types.Singles.Matrix4 := Identity4;
Position_Norm : Float := C3GA.Norm_E2 (Base);
Normal_Norm : constant Float := C3GA.Norm_E2 (Normal);
Base_Coords : constant GA_Maths.Float_3D :=
C3GA.Get_Coords (Base);
Normal_Coords : constant GA_Maths.Float_3D :=
C3GA.Get_Coords (Normal);
Ortho_1_Coords : constant GA_Maths.Float_3D :=
C3GA.Get_Coords (Ortho_1);
Ortho_2_Coords : constant GA_Maths.Float_3D :=
C3GA.Get_Coords (Ortho_2);
Translation_Vector : Vector3 := (0.0, 0.0, 0.0);
MV_Normal : constant Multivectors.M_Vector
:= Multivectors.New_Vector
(Normal_Coords (1), Normal_Coords (2), Normal_Coords (3));
MV_Ortho_1 : constant Multivectors.M_Vector
:= Multivectors.New_Vector
(Ortho_1_Coords (1), Ortho_1_Coords (2), Ortho_1_Coords (3));
MV_Ortho_2 : constant Multivectors.M_Vector
:= Multivectors.New_Vector
(Ortho_2_Coords (1), Ortho_2_Coords (2), Ortho_2_Coords (3));
Rotation_Matrix : Matrix4 := Identity4;
Scaling_Matrix : Matrix4;
Translation_Matrix : Matrix4 := Identity4;
BV_Scale : Single := Single (Scale);
RT : Multivectors.Rotor;
begin
GL.Objects.Programs.Use_Program (Render_Program);
-- Set position
if Position_Norm > 0.0 then
Translation_Vector :=
(Single (Base_Coords (1)), Single (Base_Coords (2)),
Single (Base_Coords (3)));
Translation_Matrix := Maths.Translation_Matrix (Translation_Vector);
end if;
Shader_Manager.Set_Translation_Matrix (Translation_Matrix);
if Method /= Draw_Bivector_Parallelogram and then
Method /= Draw_Bivector_Parallelogram_No_Vectors then
-- Rotate e3 to normal direction
if Normal_Norm > 0.0 then
Rotation_Matrix := GA_Maths.Vector_Rotation_Matrix ((0.0, 0.0, 1.0), Normal);
end if;
RT := E3GA_Utilities.Rotor_Vector_To_Vector
(Multivectors.Basis_Vector (Blade_Types.E3_e3), MV_Normal);
GL_Util.Rotor_GL_Multiply (RT, Rotation_Matrix);
else -- Draw_Bivector_Parallelogram
Position_Norm :=
C3GA.Norm_E2 (C3GA.To_VectorE3GA
((Multivectors.Outer_Product (MV_Ortho_1,
MV_Ortho_2))));
BV_Scale := Single (Sqrt (Pi / Position_Norm)) * BV_Scale;
end if;
Shader_Manager.Set_Rotation_Matrix (Rotation_Matrix);
Scaling_Matrix := Maths.Scaling_Matrix ((BV_Scale, BV_Scale, BV_Scale));
Model_Matrix := Scaling_Matrix * Model_Matrix;
Shader_Manager.Set_Model_Matrix (Model_Matrix);
case Method is
when Draw_Bivector_Circle |
Draw_Bivector_Circle_Outline =>
Draw_Circle (Palet_Type, Method);
when others => null;
end case;
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Bivector.");
raise;
end Draw_Bivector;
-- ----------------------------------------------------------------------
-- procedure Draw_Bivector (Render_Program : GL.Objects.Programs.Program;
-- Base, Ortho_1, Ortho_2 : Multivectors.M_Vector;
-- Palet_Type : Palet.Colour_Palet;
-- Scale : float := 1.0;
-- Method : Method_Type := Draw_Bivector_Circle) is
-- use GA_Maths;
-- use GL.Types.Singles;
--
-- Vertex_Array_Object : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
-- -- Rotor_Step : float := 2.0 * Ada.Numerics.Pi / 64.0;
-- Scale_S : constant GL.Types.Single := GL.Types.Single (Scale);
-- Translate : Vector3 := (0.0, 0.0, 0.0);
-- -- O2 : Multivectors.M_Vector := Ortho_2;
-- -- Model_Matrix : GL.Types.Singles.Matrix4 := GL.Types.Singles.Identity4;
-- MVP_Matrix : Matrix4 := Singles.Identity4;
-- Scaled : GL.Types.Single;
-- E2_Norm : Float;
-- begin
-- GL.Objects.Programs.Use_Program (Render_Program);
-- Vertex_Array_Object.Initialize_Id;
-- Vertex_Array_Object.Bind;
--
-- Shader_Manager.Set_Ambient_Colour ((1.0, 1.0, 1.0, 1.0));
--
-- -- MVP_Matrix := Model_Matrix;
-- Translate := (Single (C3GA.e1 (Base)),
-- Single (C3GA.e2 (Base)),
-- Single (C3GA.e3 (Base)));
-- E2_Norm := Multivectors.Norm_E2 (Base);
-- if E2_Norm /= 0.0 then
-- MVP_Matrix := Maths.Translation_Matrix (Translate) * MVP_Matrix;
-- end if;
--
-- if Method = Draw_Bivector_Parallelogram and then
-- Method = Draw_Bivector_Parallelogram_No_Vectors then
-- MVP_Matrix := Maths.Scaling_Matrix ((Scale_S, Scale_S, Scale_S)) * MVP_Matrix;
-- else
-- E2_Norm := Multivectors.Norm_E2 (Multivectors.Outer_Product (Ortho_1, Ortho_2));
-- Scaled := GL.Types.Single (Scale * Float_Functions.Sqrt (pi / E2_Norm));
-- MVP_Matrix := Maths.Scaling_Matrix ((Scaled, Scaled, Scaled))
-- * MVP_Matrix;
-- end if;
--
-- Case Method is
-- when Draw_Bivector_Circle |
-- Draw_Bivector_Circle_Outline =>
-- Draw_Circle (Render_Program, MVP_Matrix, Palet_Type, Method);
-- when others => null;
-- end case;
-- exception
-- when others =>
-- Put_Line ("An exception occurred in Draw_Object.Draw_Bivector.");
-- raise;
-- end Draw_Bivector;
-- ----------------------------------------------------------------------
-- procedure Draw_Multivector (Render_Program : GL.Objects.Programs.Program;
-- Model_Matrix : GL.Types.Singles.Matrix4;
-- MV : E2GA.Multivector;
-- Colour : GL.Types.Colors.Color := (1.0, 1.0, 1.0, 1.0);
-- Scale : GL.Types.Single) is
-- -- L : boolean;
-- Rotor_Step : float := 2.0 * Ada.Numerics.Pi / 64.0;
-- -- X : float;
-- -- Y : float;
-- MVP_Matrix : Singles.Matrix4 := Singles.Identity4;
-- Rotor : E2GA.Rotor;
--
-- begin
--
-- GL.Objects.Programs.Use_Program (Render_Program);
-- Vertex_Array_Object.Initialize_Id;
-- Vertex_Array_Object.Bind;
-- -- if E3GA.Norm_E2 (MV).M_C1 = 0.0 then
-- -- Maths.Translation_Matrix (Get_Coord_1 (Base),
-- -- Get_Coord_2 (Base), Get_Coord_3 (Base)) * MVP_Matrix;
-- -- end if;
-- exception
-- when others =>
-- Put_Line ("An exception occurred in Draw_Object.Draw_Multivector.");
-- raise;
-- end Draw_Multivector;
-- ----------------------------------------------------------------------
procedure Draw_Circle (Palet_Type : Palet.Colour_Palet;
Method : GA_Draw.Method_Type) is
use GA_Maths;
use GA_Maths.Float_Functions;
use GL.Objects.Buffers;
use Singles;
use Palet;
type Circle_Part is (Back_Part, Front_Part, Outline_Part);
Vertex_Array : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
procedure Draw_Part (Part : Circle_Part) is
Vertex_Buffer : GL.Objects.Buffers.Buffer;
Normals_Buffer : GL.Objects.Buffers.Buffer;
Num_Steps : constant int := 256;
VB_Size : Int := Num_Steps;
Angle : float := 0.0;
Rotor_Step : constant float :=
2.0 * Ada.Numerics.Pi / float (Num_Steps);
Norm_Z : Single;
Draw_Hooks : constant Boolean :=
Part = Outline_Part and Get_Draw_Mode.Orientation;
begin
Vertex_Array.Initialize_Id;
Vertex_Array.Bind;
Vertex_Buffer.Initialize_Id;
Normals_Buffer.Initialize_Id;
case Part is
when Back_Part | Outline_Part =>
Norm_Z := 1.0;
when Front_Part =>
Norm_Z := -1.0;
end case;
if Draw_Hooks then
VB_Size := Num_Steps + 12;
end if;
declare
Fan : Vector3_Array (1 .. VB_Size);
Normal : Vector3_Array (1 .. VB_Size) :=
(others => (0.0, 0.0, 1.0));
Hooks : Vector3_Array (1 .. 2) := ((1.0, 0.0, 0.0),
(1.0, -0.5, 0.0));
Hook_Rotation : constant Matrix3 := Rotation_Matrix
(Maths.Radian (Ada.Numerics.Pi / 3.0), (0.0, 0.0, 1.0));
Hook_Index : Int := 1;
begin
for Count in 1 .. Num_Steps loop
case Part is
when Back_Part | Outline_Part =>
Fan (Count) := (Single (Cos (Angle)), Single (Sin (Angle)), 0.0);
when Front_Part =>
Fan (Count) := (-Single (Cos (Angle)), Single (Sin (Angle)), 0.0);
end case;
Normal (Count) := (0.0, 0.0, Norm_Z);
Angle := Angle + Rotor_Step;
end loop;
if Draw_Hooks then
-- draw six 'hooks' along the edge of the circle
while Hook_Index < 12 loop
Fan (Num_Steps + Hook_Index) := Hooks (1);
Fan (Num_Steps + Hook_Index + 1) := Hooks (2);
Normal (Num_Steps + Hook_Index) := (0.0, 0.0, Norm_Z);
Normal (Num_Steps + Hook_Index + 1) := (0.0, 0.0, Norm_Z);
Hooks (1) := Hook_Rotation * Hooks (1);
Hooks (2) := Hook_Rotation * Hooks (2);
Hook_Index := Hook_Index + 2;
end loop;
end if;
Vertex_Array.Bind;
Array_Buffer.Bind (Vertex_Buffer);
Utilities.Load_Vertex_Buffer (Array_Buffer, Fan, Static_Draw);
Array_Buffer.Bind (Normals_Buffer);
Utilities.Load_Vertex_Buffer (Array_Buffer, Normal, Static_Draw);
GL.Attributes.Enable_Vertex_Attrib_Array (0);
Array_Buffer.Bind (Vertex_Buffer);
GL.Attributes.Set_Vertex_Attrib_Pointer (0, 3, Single_Type, 0, 0);
GL.Attributes.Enable_Vertex_Attrib_Array (1);
Array_Buffer.Bind (Normals_Buffer);
GL.Attributes.Set_Vertex_Attrib_Pointer (1, 3, Single_Type, 0, 0);
if Part = Back_Part or Part = Front_Part then
if Part = Back_Part and then Get_Draw_Mode.Orientation then
GL.Rasterization.Set_Polygon_Mode (GL.Rasterization.Line);
end if;
GL.Objects.Vertex_Arrays.Draw_Arrays (Mode => Triangle_Fan,
First => 0,
Count => VB_Size);
else -- Outline part
GL.Objects.Vertex_Arrays.Draw_Arrays (Mode => Line_Loop,
First => 0,
Count => Num_Steps);
if Draw_Hooks then
GL.Objects.Vertex_Arrays.Draw_Arrays (Mode => Lines,
First => Num_Steps,
Count => 12);
end if;
end if;
GL.Attributes.Disable_Vertex_Attrib_Array (0);
GL.Attributes.Disable_Vertex_Attrib_Array (1);
end; -- declare block
end Draw_Part;
begin
Shader_Manager.Set_Model_Matrix (Identity4);
if (Method = Draw_Bivector_Circle) and then
(Palet_Type = Is_Null or
Palet.Foreground_Alpha (Palet_Type) > 0.0000001) then
Draw_Part (Back_Part);
Draw_Part (Front_Part);
end if;
if Palet_Type /= Is_Null then
Set_Outline_Colour (Palet_Type);
end if;
Draw_Part (Outline_Part);
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Circle.");
raise;
end Draw_Circle;
-- ------------------------------------------------------------------------
procedure Draw_Cone (Render_Program : GL.Objects.Programs.Program;
Scale : Float) is
use GL.Objects.Buffers;
use GA_Maths.Float_Functions;
Vertex_Array : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
Vertex_Buffer : GL.Objects.Buffers.Buffer;
S_Scale : constant Single := Single (5.0 / Scale);
Z : float := 0.0;
Num_Steps : constant int := 256;
Rotor_Step : constant float :=
2.0 * Ada.Numerics.Pi / float (Num_Steps);
Fan : Singles.Vector3_Array (1 .. Num_Steps);
begin
Vertex_Array.Initialize_Id;
Vertex_Array.Bind;
Vertex_Buffer.Initialize_Id;
Fan (1) := (0.0, 0.0, 0.0);
for Count in 2 .. Num_Steps loop
Fan (Count) := (S_Scale * Single (Cos (Z)), S_Scale * Single (Sin (Z)), -0.25);
Z := Z + Rotor_Step;
end loop;
Array_Buffer.Bind (Vertex_Buffer);
Utilities.Load_Vertex_Buffer (Array_Buffer, Fan, Static_Draw);
GL.Objects.Programs.Use_Program (Render_Program);
-- Shader_Manager.Set_Model_Matrix (Model_Matrix);
GL.Attributes.Enable_Vertex_Attrib_Array (0);
GL.Attributes.Set_Vertex_Attrib_Pointer (0, 3, Single_Type, 0, 0);
GL.Objects.Vertex_Arrays.Draw_Arrays (Mode => Triangle_Fan,
First => 0,
Count => Num_Steps);
GL.Attributes.Disable_Vertex_Attrib_Array (0);
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Cone.");
raise;
end Draw_Cone;
-- ------------------------------------------------------------------------
procedure Draw_Line (Render_Program : GL.Objects.Programs.Program;
Direction : C3GA.Vector_E3;
Weight : Float := 1.0) is
use GL.Objects.Buffers;
use GL.Types.Singles;
use Shader_Manager;
Vertex_Array : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
Vertex_Buffer : GL.Objects.Buffers.Buffer;
-- Scale_Constant and Step_Size are used for building Line_Strip
Scale_Constant : constant Single := Single (Palet.Line_Length); -- 6.0
Step_Size : constant Single := 0.1;
Step_Length : constant Single := Scale_Constant * Step_Size;
Num_Steps : constant Int := Int (2.0 / Step_Size + 0.5) + 1;
Num_Vertices : constant Int := Num_Steps + 1;
Length_Vertices : Singles.Vector3_Array (1 .. Num_Steps);
C_Steps : constant Int := Int (1.0 / Step_Size + 0.5) + 1;
C_Rotation_Matrix : Matrix4 := Identity4;
Rotation_Matrix : Matrix4 := Identity4;
Translation_Matrix : Matrix4 := Identity4;
Scale_Matrix : Matrix4 :=
Maths.Scaling_Matrix (Single (Weight));
Model_Matrix : Matrix4 := Identity4;
Z : Single := -Scale_Constant;
C : Single := 0.0;
Num_C_Vertices : constant Int := 3 * C_Steps + 1;
C_Vertices : Singles.Vector3_Array (1 .. Num_C_Vertices);
C_Index : Int := 0;
C_Vertex1 : constant Singles.Vector3 := (-0.25, 0.0, -1.0);
C_Vertex2 : constant Singles.Vector3 := (0.0, 0.0, 0.0);
C_Vertex3 : constant Singles.Vector3 := (0.25, 0.0, -1.0);
begin
-- aPoint and Direction are model coordinates
GL.Objects.Programs.Use_Program (Render_Program);
-- Utilities.Print_Vector ("GA_Draw.Draw_Line aPoint", aPoint);
-- Utilities.Print_Vector ("GA_Draw.Draw_Line Direction", Direction);
for index in 1 .. Num_Steps loop
Length_Vertices (index) := (0.0, 0.0, Z);
Z := Z + Step_Length;
end loop;
Vertex_Array.Initialize_Id;
Vertex_Array.Bind;
Vertex_Buffer.Initialize_Id;
Array_Buffer.Bind (Vertex_Buffer);
Utilities.Load_Vertex_Buffer (Array_Buffer, Length_Vertices, Static_Draw);
-- rotate e3 to line direction
Rotation_Matrix :=
GA_Maths.Vector_Rotation_Matrix ((0.0, 0.0, 1.0), Direction);
Set_Rotation_Matrix (Rotation_Matrix);
Set_Translation_Matrix (Translation_Matrix);
Model_Matrix := Scale_Matrix * Model_Matrix;
-- translate to point on line
-- Translation_Matrix :=
-- Maths.Translation_Matrix ((aPoint (GL.X), aPoint (GL.Y), aPoint (GL.Z)));
-- Model_Matrix := Translation_Matrix * Model_Matrix;
Set_Model_Matrix (Model_Matrix);
GL.Attributes.Enable_Vertex_Attrib_Array (0);
Array_Buffer.Bind (Vertex_Buffer);
GL.Attributes.Set_Vertex_Attrib_Pointer (0, 3, Single_Type, 0, 0);
GL.Objects.Vertex_Arrays.Draw_Arrays (Mode => Line_Strip,
First => 0, Count => Num_Vertices);
GL.Attributes.Disable_Vertex_Attrib_Array (0);
if Palet.Get_Draw_Mode.Orientation then
if Palet.Get_Draw_Mode.Magnitude then
Scale_Matrix :=
Maths.Scaling_Matrix (Single (0.5 * Abs (Weight)));
else
Scale_Matrix := Maths.Scaling_Matrix (0.5);
end if;
Set_Model_Matrix (Scale_Matrix);
Translation_Matrix :=
Maths.Translation_Matrix ((0.0, 0.0, -Scale_Constant));
while C < 1.0 loop
C_Index := C_Index + 1;
C_Vertices (C_Index) := C_Vertex1;
C_Index := C_Index + 1;
C_Vertices (C_Index) := C_Vertex2;
C_Index := C_Index + 1;
C_Vertices (C_Index) := C_Vertex3;
C := C + Step_Size;
Utilities.Load_Vertex_Buffer (Array_Buffer, C_Vertices, Static_Draw);
Set_Rotation_Matrix (C_Rotation_Matrix);
Set_Translation_Matrix (Translation_Matrix);
GL.Attributes.Set_Vertex_Attrib_Pointer (0, 3, Single_Type, 0, 0);
GL.Attributes.Enable_Vertex_Attrib_Array (0);
GL.Objects.Vertex_Arrays.Draw_Arrays
(Mode => Line_Strip, First => 0, Count => Num_C_Vertices);
GL.Attributes.Disable_Vertex_Attrib_Array (0);
C_Rotation_Matrix :=
Maths.Rotation_Matrix (Maths.Degree (90.0), (0.0, 0.0, 1.0));
Translation_Matrix :=
Maths.Translation_Matrix ((0.0, 0.0, 2.0 * Step_Length));
end loop;
end if;
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Line.");
raise;
end Draw_Line;
-- ------------------------------------------------------------------------
procedure Draw_Parallelepiped (Render_Program : GL.Objects.Programs.Program;
Model_Matrix : GL.Types.Singles.Matrix4;
MVC : Multivector_Analyze.E3_Vector_Array;
Scale : Float;
Method : Method_Type) is
use GL.Objects.Buffers;
use Singles;
Vertex_Array : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
Vertex_Buffer : GL.Objects.Buffers.Buffer;
Normals_Buffer : GL.Objects.Buffers.Buffer;
Scale_Matrix : Matrix4;
Scale_Sign : GL.Types.Single;
Polygon : constant Ints.Vector4_Array (1 .. 6) :=
((0, 1, 5, 4),
(0, 4, 7, 3),
(4, 5, 6, 7),
(1, 2, 6, 5),
(6, 2, 3, 7),
(0, 3, 2, 1));
Vertex : Vector3_Array (1 .. 8) :=
(others => (others => 0.0));
GL_Vertices : Vector3_Array (1 .. 4) :=
(others => (others => 0.0));
aVertex : Vector3;
Vertex_Vectors : constant Ints.Vector3_Array (1 .. 8) :=
((-1, -1, -1), -- -
(0, -1, -1), -- 0
(0, 1, -1), -- 0 + 1
(1, -1, -1), -- 1
(2, -1, -1), -- 2
(0, 2, -1), -- 0 + 2
(0, 1, 2), -- 0 + 1 + 2
(1, 2, -1)); -- 1 + 2
Vertex_Index : Int := 0;
GL_Normals : Vector3_Array (1 .. 6) :=
(others => (others => 0.0));
V1 : E3GA.E3_Vector;
V2 : E3GA.E3_Vector;
V3 : E3GA.E3_Vector;
Stride : constant Int := 0;
begin
Vertex_Array.Initialize_Id;
Vertex_Array.Bind;
-- for index in 1 .. MVC'Length loop
-- VC (Int (index)) := E3GA.Get_Coords (MVC (index));
-- end loop;
if Scale >= 0.0 then
Scale_Sign := 1.0;
else
Scale_Sign := -1.0;
end if;
if Palet.Get_Draw_Mode.Orientation then
Scale_Matrix := Maths.Scaling_Matrix (Scale_Sign);
end if;
for Row in Int range 1 .. 8 loop
aVertex := (0.0, 0.0, 0.0);
for Col in GL.Index_Homogeneous range GL.X .. GL.Z loop
Vertex_Index := Vertex_Vectors (Row) (Col);
if Vertex_Index >= 0 then
aVertex := aVertex + MVC (Integer (Vertex_Index));
Vertex (Row) := aVertex;
end if;
end loop;
end loop;
for Index in GL_Normals'Range loop
V1 := Vertex (Polygon (Index) (GL.X));
V2 := Vertex (Polygon (Index) (GL.Y));
V3 := Vertex (Polygon (Index) (GL.W));
GL_Normals (Index) :=
(Scale_Sign * E3GA.Outer_Product ((V2 - V1), (V3 - V1)));
if Scale >= 0.0 then
for GL_Index in Int range 1 .. 3 loop
GL_Vertices (GL_Index) :=
Vertex (Polygon (Index)
(GL.Index_Homogeneous'Enum_Val (GL_Index)));
end loop;
else
for GL_Index in reverse Int range 3 .. 1 loop
GL_Vertices (GL_Index) :=
Vertex (Polygon (Index)
(GL.Index_Homogeneous'Enum_Val (GL_Index)));
end loop;
end if;
end loop;
Vertex_Buffer.Initialize_Id;
Array_Buffer.Bind (Vertex_Buffer);
Utilities.Load_Vertex_Buffer (Array_Buffer, GL_Vertices, Static_Draw);
Normals_Buffer.Initialize_Id;
Array_Buffer.Bind (Normals_Buffer);
Utilities.Load_Vertex_Buffer (Array_Buffer, GL_Normals, Static_Draw);
if Method = Draw_TV_Parellelepiped then
Draw_Parallelepiped
(Render_Program, Model_Matrix, MVC, Scale, Method);
end if;
GL.Objects.Programs.Use_Program (Render_Program);
Shader_Manager.Set_Ambient_Colour ((1.0, 1.0, 1.0, 1.0));
Shader_Manager.Set_Model_Matrix (Scale_Matrix * Model_Matrix);
GL.Attributes.Set_Vertex_Attrib_Pointer (0, 3, Single_Type, 0, 0);
GL.Attributes.Enable_Vertex_Attrib_Array (0);
GL.Attributes.Set_Vertex_Attrib_Pointer (1, 3, Single_Type, Stride, 0);
GL.Objects.Vertex_Arrays.Draw_Arrays (Mode => Lines,
First => 0,
Count => 1 * 3);
GL.Attributes.Disable_Vertex_Attrib_Array (0);
GL.Attributes.Disable_Vertex_Attrib_Array (1);
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Parallelepiped.");
raise;
end Draw_Parallelepiped;
-- ------------------------------------------------------------------------
-- Based on draw.cpp DrawState::drawSphere(e3ga::mv::Float normal)
procedure Draw_Sphere (Render_Program : GL.Objects.Programs.Program;
Normal : GL.Types.Single) is
use Geosphere;
Sphere : constant Geosphere.Geosphere := Palet.Current_Sphere;
begin
Count := Count + 1;
Geosphere.New_Sphere_List (Sphere);
-- gsDraw(m_sphere, 0.0f);
Put_Line ("GA_Draw.Draw_Sphere calling GS_Draw Count : " &
Integer'Image (Count));
Geosphere.GS_Draw (Render_Program, Sphere);
if Normal = 0.0 then
Draw_Sphere_List (Render_Program);
else
Geosphere.GS_Draw (Render_Program, Sphere, Normal);
end if;
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Sphere.");
raise;
end Draw_Sphere;
-- ------------------------------------------------------------------------
-- procedure Draw_Sphere (Render_Program : GL.Objects.Programs.Program;
-- Translation_Matrix, Projection_Matrix : GL.Types.Singles.Matrix4;
-- Normal : E3GA.Vector; Scale : float := 1.0;
-- Colour : GL.Types.Colors.Color) is
-- begin
-- if G_Draw_State.Max_Vertices = 0 then
-- Geosphere.GS_Compute (G_Draw_State.M_Sphere, 4);
-- end if;
-- exception
-- when others =>
-- Put_Line ("An exception occurred in GA_Draw.Draw_Line.");
-- raise;
-- end Draw_Sphere;
-- ------------------------------------------------------------------------
-- Based on draw.cpp drawTriVector
procedure Draw_Trivector (Render_Program : GL.Objects.Programs.Program;
Base : C3GA.Vector_E3;
Scale : float := 1.0;
Palet_Type : Palet.Colour_Palet;
Method : Method_Type := Draw_TV_Sphere) is
-- use GL.Types.Singles;
-- use Ada.Numerics.Elementary_Functions; -- needed for fractional powers
-- use GA_Maths;
-- Vector_Base : constant Singles.Vector3 := (0.0, 0.0, 0.0);
-- Scale_Sign : Float;
-- P_Scale : Float;
Normal : Single;
-- Base_Coords : constant GA_Maths.Float_3D := C3GA.Get_Coords (Base);
-- Translation : Singles.Vector3;
-- MV_Matrix : Matrix4 := Identity4;
begin
-- if Scale >= 0.0 then
-- Scale_Sign := 1.0;
-- else
-- Scale_Sign := -1.0;
-- end if;
if Method = Draw_TV_Parellelepiped or
Method = Draw_TV_Parellelepiped_No_Vectors then
Put_Line ("GA_Draw.Draw_Trivector, Draw_TV_Parellelepiped or Draw_TV_Parellelepiped_No_Vectors");
Draw_Trivector (Render_Program, Base, Scale,
Palet_Type, Draw_TV_Sphere) ;
-- P_Scale := Scale_Sign * ((Scale_Sign * Scale) ** 1.0 / 3.0);
-- else
-- P_Scale := Scale_Sign * ((Scale_Sign * Scale / (4.0 / 3.0 * GA_Maths.PI)) ** 1.0 / 3.0);
end if;
-- if C3GA.Norm_e2 (Base) /= 0.0 then
-- Translation := (Single (Base_Coords (1)), Single (Base_Coords (2)), Single (Base_Coords (3)));
-- MV_Matrix := Maths.Translation_Matrix (Translation) * MV_Matrix;
-- end if;
--
-- MV_Matrix := Maths.Scaling_Matrix (Single (P_Scale)) * MV_Matrix;
case Method is
when Draw_TV_Sphere =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Sphere.");
if Palet.Get_Draw_Mode.Orientation then
Normal := 0.1;
else
Normal := 0.0;
end if;
-- g_drawState.drawSphere (s)
Draw_Sphere (Render_Program, Normal);
when Draw_TV_Cross =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Cross.");
null;
when Draw_TV_Curly_Tail =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Curly_Tail.");
null;
when Draw_TV_Parellelepiped =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Parellelepiped.");
-- Draw_Vector (Render_Program => Render_Program,
-- Model_Matrix => MV_Matrix,
-- Tail => Vector_Base,
-- Direction => ,
-- Scale => );
when Draw_TV_Parellelepiped_No_Vectors =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Parellelepiped_No_Vectors.");
-- Draw_Parallelepiped (Render_Program, MV_Matrix, V, Scale,
-- Draw_TV_Parellelepiped_No_Vectors);
when others => null;
Put_Line ("GA_Draw.Draw_Trivector others.");
end case;
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Trivector.");
raise;
end Draw_Trivector;
-- ------------------------------------------------------------------------
procedure Draw_Trivector (Render_Program : GL.Objects.Programs.Program;
Base : C3GA.Vector_E3; Scale : float := 1.0;
V : Multivector_Analyze.E3_Vector_Array;
-- Palet_Type : Palet.Colour_Palet;
Method : Method_Type := Draw_TV_Sphere) is
use GL.Types.Singles;
use Ada.Numerics.Elementary_Functions; -- needed for fractional powers
use GA_Maths;
Scale_Sign : Float;
P_Scale : Float;
Normal : Single;
Base_Coords : constant GA_Maths.Float_3D := C3GA.Get_Coords (Base);
Translation : Singles.Vector3;
MV_Matrix : Matrix4 := Identity4;
begin
if Scale >= 0.0 then
Scale_Sign := 1.0;
else
Scale_Sign := -1.0;
end if;
if Method = Draw_TV_Parellelepiped or
Method = Draw_TV_Parellelepiped_No_Vectors then
Put_Line ("GA_Draw.Draw_Trivector, Draw_TV_Parellelepiped or Draw_TV_Parellelepiped_No_Vectors");
P_Scale := Scale_Sign * ((Scale_Sign * Scale) ** 1.0 / 3.0);
else
P_Scale := Scale_Sign * ((Scale_Sign * Scale / (4.0 / 3.0 * GA_Maths.PI)) ** 1.0 / 3.0);
end if;
if C3GA.Norm_e2 (Base) /= 0.0 then
Translation := (Single (Base_Coords (1)), Single (Base_Coords (2)), Single (Base_Coords (3)));
MV_Matrix := Maths.Translation_Matrix (Translation) * MV_Matrix;
end if;
MV_Matrix := Maths.Scaling_Matrix (Single (P_Scale)) * MV_Matrix;
case Method is
when Draw_TV_Sphere =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Sphere.");
if Palet.Get_Draw_Mode.Orientation then
Normal := 0.1;
else
Normal := 0.0;
end if;
-- g_drawState.drawSphere (s)
Draw_Sphere (Render_Program, Normal);
when Draw_TV_Cross =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Cross.");
null;
when Draw_TV_Curly_Tail =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Curly_Tail.");
null;
when Draw_TV_Parellelepiped =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Parellelepiped.");
Draw_Parallelepiped (Render_Program, MV_Matrix, V, Scale,
Draw_TV_Parellelepiped);
when Draw_TV_Parellelepiped_No_Vectors =>
Put_Line ("GA_Draw.Draw_Trivector Draw_TV_Parellelepiped_No_Vectors.");
-- Draw_Parallelepiped (Render_Program, MV_Matrix, V, Scale,
-- Draw_TV_Parellelepiped_No_Vectors);
when others => null;
Put_Line ("GA_Draw.Draw_Trivector others.");
end case;
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Trivector.");
raise;
end Draw_Trivector;
-- ------------------------------------------------------------------------
procedure Draw_Vector (Render_Program : GL.Objects.Programs.Program;
Tail, Direction : C3GA.Vector_E3;
Scale : float := 1.0) is
use GL.Culling;
use GL.Toggles;
use GL.Types.Singles;
use Multivectors;
use Maths.Single_Math_Functions;
Vertex_Array_Object : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
MV_Matrix : Matrix4 := Identity4;
Dir_Coords : constant GA_Maths.Float_3D :=
C3GA.Get_Coords (Direction);
-- GL_Tail : constant Vector3 := GL_Util.To_GL (Tail);
-- GL_Dir : constant Vector3 := GL_Util.To_GL (Direction);
MV_Dir : constant Multivectors.M_Vector :=
New_Vector (Dir_Coords (1), Dir_Coords (2), Dir_Coords (3));
aRotor : Rotor;
Saved_Cull_Face : constant Face_Selector := Cull_Face;
Saved_Front_Face : constant GL.Types.Orientation := GL.Culling.Front_Face;
begin
if Scale /= 0.0 then
Vertex_Array_Object.Initialize_Id;
Vertex_Array_Object.Bind;
GL.Objects.Programs.Use_Program (Render_Program);
if C3GA.Norm_e2 (Tail) /= 0.0 then
MV_Matrix := Maths.Translation_Matrix (Tail) * MV_Matrix;
end if;
MV_Matrix := Maths.Scaling_Matrix (Single (Scale)) * MV_Matrix;
-- Draw the stick of the vector
Draw_Line (Render_Program, (0.98 * Direction (GL.X),
0.98 * Direction (GL.Y), 0.98 * Direction (GL.Z)), Scale);
-- Setup translation matrix for arrow head
-- rotate e3 to vector direction
MV_Matrix := Maths.Translation_Matrix (Direction) * MV_Matrix;
aRotor := E3GA_Utilities.Rotor_Vector_To_Vector
(Basis_Vector (Blade_Types.E3_e3), MV_Dir);
if Scale > 1.2 then
MV_Matrix := Maths.Scaling_Matrix (Single (1.2 / Scale)) * MV_Matrix;
MV_Matrix := Maths.Scaling_Matrix (1.1 / Sqrt (Single (Scale))) * MV_Matrix;
end if;
GL_Util.Rotor_GL_Multiply (aRotor, MV_Matrix);
if C3GA.Norm_e2 (Tail) /= 0.0 then
MV_Matrix := Maths.Translation_Matrix (Tail) * MV_Matrix;
end if;
-- Translate to head of vector
MV_Matrix := Maths.Translation_Matrix
(Single (Scale) * Direction) * MV_Matrix;
Shader_Manager.Set_Model_Matrix (MV_Matrix);
Enable (Cull_Face);
Set_Front_Face (GL.Types.Clockwise);
Set_Cull_Face (Front);
Draw_Cone (Render_Program, Scale);
Draw_Base (Render_Program, Scale);
Set_Front_Face (Saved_Front_Face);
Set_Cull_Face (Saved_Cull_Face);
end if;
exception
when others =>
Put_Line ("An exception occurred in GA_Draw.Draw_Vector.");
raise;
end Draw_Vector;
-- -----------------------------------------------------------------------
end GA_Draw;
|
oeis/017/A017320.asm | neoneye/loda-programs | 11 | 88322 | ; A017320: a(n) = (10*n + 4)^4.
; 256,38416,331776,1336336,3748096,8503056,16777216,29986576,49787136,78074896,116985856,168896016,236421376,322417936,429981696,562448656,723394816,916636176,1146228736,1416468496,1731891456,2097273616,2517630976,2998219536,3544535296,4162314256,4857532416,5636405776,6505390336,7471182096,8540717056,9721171216,11019960576,12444741136,14003408896,15704099856,17555190016,19565295376,21743271936,24098215696,26639462656,29376588816,32319410176,35477982736,38862602496,42483805456,46352367616
mul $0,10
add $0,4
pow $0,4
|
case-studies/performance/synthesis/alloy/model/sketch.als | uwplse/memsynth | 19 | 2593 | <reponame>uwplse/memsynth
module sketch
open model
-- A simple sketch that simply chooses between three models
abstract sig Model {}
one sig SC, TSO, PSO extends Model {}
fun ppo_sketch[s: one Model, t: Test] : MemoryEvent->MemoryEvent {
s = SC => ppo_SC[t]
else s = TSO => ppo_TSO[t]
else ppo_PSO[t]
}
fun grf_sketch[s: one Model, t: Test, rf: MemoryEvent->MemoryEvent] : MemoryEvent->MemoryEvent {
s = SC => grf_SC[rf, t]
else s = TSO => grf_TSO[rf, t]
else grf_PSO[rf, t]
}
fun ab_sketch[s: one Model, t: Test, rf: MemoryEvent->MemoryEvent] : MemoryEvent->MemoryEvent {
s = SC => ab_SC[rf, t]
else s = TSO => ab_TSO[rf, t]
else ab_PSO[rf, t]
}
pred Allowed_Sketch[t: Test, s: one Model] {
some rf: t.Writes->t.Reads, ws: t.Writes->t.Writes |
let ppo = ppo_sketch[s, t], grf = grf_sketch[s, t, rf], ab = ab_sketch[s, t, rf] |
ValidExecution[rf, ws, ppo, grf, ab, t]
}
|
test/include/gmp-6.1.2/mpn/sqr_basecase.asm | kcpikkt/apa | 43 | 98943 | dnl AMD64 mpn_sqr_basecase optimised for Intel Broadwell.
dnl Copyright 2015, 2017 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/limb mul_1 addmul_1
C AMD K8,K9 n/a n/a
C AMD K10 n/a n/a
C AMD bd1 n/a n/a
C AMD bd2 n/a n/a
C AMD bd3 n/a n/a
C AMD bd4 ? ?
C AMD zen ? ?
C AMD bt1 n/a n/a
C AMD bt2 n/a n/a
C Intel P4 n/a n/a
C Intel PNR n/a n/a
C Intel NHM n/a n/a
C Intel SBR n/a n/a
C Intel IBR n/a n/a
C Intel HWL 1.68 n/a
C Intel BWL 1.51 1.67-1.74
C Intel SKL 1.52 1.63-1.71
C Intel atom n/a n/a
C Intel SLM n/a n/a
C VIA nano n/a n/a
C The inner loops of this code are the result of running a code generation and
C optimisation tool suite written by <NAME> and <NAME>.
C TODO
C * We have 8 addmul_1 loops which fall into each other. The idea is to save
C on switching code, since a circularly updated computed goto target will
C hardly allow correct branch prediction. On 2nd thought, we now might make
C each of the 8 loop branches be poorly predicted since they will be
C executed fewer times for each time. With just one addmul_1 loop, the loop
C count will change only once each 8th time.
C * Do overlapped software pipelining.
C * Perhaps load in shrx/sarx, eliminating separate load insn.
C * Schedule add+stored in small n code.
C * Try swapping adox and adcx insn, making mulx have more time to run.
define(`rp', `%rdi')
define(`up', `%rsi')
define(`un_param',`%rdx')
define(`n', `%rcx')
define(`un_save', `%rbx')
define(`u0', `%rdx')
define(`w0', `%r8')
define(`w1', `%r9')
define(`w2', `%r10')
define(`w3', `%r11')
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_sqr_basecase)
FUNC_ENTRY(3)
cmp $2, un_param
jae L(gt1)
mov (up), %rdx
mulx( %rdx, %rax, %rdx)
mov %rax, (rp)
mov %rdx, 8(rp)
FUNC_EXIT()
ret
L(gt1): jne L(gt2)
mov (up), %rdx
mov 8(up), %rcx
mulx( %rcx, %r9, %r10) C v0 * v1 W 1 2
mulx( %rdx, %rax, %r8) C v0 * v0 W 0 1
mov %rcx, %rdx
mulx( %rdx, %r11, %rdx) C v1 * v1 W 2 3
add %r9, %r9 C W 1
adc %r10, %r10 C W 2
adc $0, %rdx C W 3
add %r9, %r8 C W 1
adc %r11, %r10 C W 2
adc $0, %rdx C W 3
mov %rax, (rp)
mov %r8, 8(rp)
mov %r10, 16(rp)
mov %rdx, 24(rp)
FUNC_EXIT()
ret
L(gt2): cmp $4, un_param
jae L(gt3)
push %rbx
mov (up), %rdx
mulx( 8,(up), w2, w3)
mulx( 16,(up), w0, w1)
add w3, w0
mov 8(up), %rdx
mulx( 16,(up), %rax, w3)
adc %rax, w1
adc $0, w3
test R32(%rbx), R32(%rbx)
mov (up), %rdx
mulx( %rdx, %rbx, %rcx)
mov %rbx, (rp)
mov 8(up), %rdx
mulx( %rdx, %rax, %rbx)
mov 16(up), %rdx
mulx( %rdx, %rsi, %rdx)
adcx( w2, w2)
adcx( w0, w0)
adcx( w1, w1)
adcx( w3, w3)
adox( w2, %rcx)
adox( w0, %rax)
adox( w1, %rbx)
adox( w3, %rsi)
mov $0, R32(%r8)
adox( %r8, %rdx)
adcx( %r8, %rdx)
mov %rcx, 8(rp)
mov %rax, 16(rp)
mov %rbx, 24(rp)
mov %rsi, 32(rp)
mov %rdx, 40(rp)
pop %rbx
FUNC_EXIT()
ret
L(gt3): push %rbx
lea -3(un_param), R32(un_save)
lea 5(un_param), R32(n)
mov R32(un_param), R32(%rax)
and $-8, R32(un_save)
shr $3, R32(n) C count for mul_1 loop
neg un_save C 8*count and offert for addmul_1 loops
and $7, R32(%rax) C clear CF for adc as side-effect
mov (up), u0
lea L(mtab)(%rip), %r10
ifdef(`PIC',
` movslq (%r10,%rax,4), %r8
lea (%r8, %r10), %r10
jmp *%r10
',`
jmp *(%r10,%rax,8)
')
L(mf0): mulx( u0, w0, w1) C up[0]^2
add u0, u0
mulx( 8,(up), w2, w3)
lea 64(up), up
add w1, w2
jmp L(mb0)
L(mf3): mulx( u0, w2, w3) C up[0]^2
add u0, u0
mov w2, (rp)
mulx( 8,(up), w0, w1)
lea 24(up), up
lea 24(rp), rp
add w3, w0
jmp L(mb3)
L(mf4): mulx( u0, w0, w1) C up[0]^2
add u0, u0
mulx( 8,(up), w2, w3)
mov w0, (rp)
lea 32(up), up
lea 32(rp), rp
add w1, w2
jmp L(mb4)
L(mf5): mulx( u0, w2, w3) C up[0]^2
add u0, u0
mulx( 8,(up), w0, w1)
mov w2, (rp)
lea 40(up), up
lea 40(rp), rp
add w3, w0
jmp L(mb5)
L(mf6): mulx( u0, w0, w1) C up[0]^2
add u0, u0
mulx( 8,(up), w2, w3)
mov w0, (rp)
lea 48(up), up
lea 48(rp), rp
add w1, w2
jmp L(mb6)
L(mf7): mulx( u0, w2, w3) C up[0]^2
add u0, u0
mulx( 8,(up), w0, w1)
mov w2, (rp)
lea 56(up), up
lea 56(rp), rp
add w3, w0
jmp L(mb7)
L(mf1): mulx( u0, w2, w3) C up[0]^2
add u0, u0
mulx( 8,(up), w0, w1)
mov w2, (rp)
lea 8(up), up
lea 8(rp), rp
add w3, w0
jmp L(mb1)
L(mf2): mulx( u0, w0, w1) C up[0]^2
add u0, u0
mulx( 8,(up), w2, w3)
mov w0, (rp)
lea 16(up), up
lea 16(rp), rp
dec R32(n)
add w1, w2
mulx( (up), w0, w1)
ALIGN(16)
L(top): mov w2, -8(rp)
adc w3, w0
L(mb1): mulx( 8,(up), w2, w3)
adc w1, w2
lea 64(up), up
L(mb0): mov w0, (rp)
mov w2, 8(rp)
mulx( -48,(up), w0, w1)
lea 64(rp), rp
adc w3, w0
L(mb7): mulx( -40,(up), w2, w3)
mov w0, -48(rp)
adc w1, w2
L(mb6): mov w2, -40(rp)
mulx( -32,(up), w0, w1)
adc w3, w0
L(mb5): mulx( -24,(up), w2, w3)
mov w0, -32(rp)
adc w1, w2
L(mb4): mulx( -16,(up), w0, w1)
mov w2, -24(rp)
adc w3, w0
L(mb3): mulx( -8,(up), w2, w3)
adc w1, w2
mov w0, -16(rp)
dec R32(n)
mulx( (up), w0, w1)
jnz L(top)
L(end): mov w2, -8(rp)
adc w3, w0
C mov w0, (rp)
C adc %rcx, w1
C mov w1, 8(rp)
lea L(atab)(%rip), %r10
ifdef(`PIC',
` movslq (%r10,%rax,4), %r11
lea (%r11, %r10), %r11
',`
mov (%r10,%rax,8), %r11
')
mov $63, R32(%rax)
jmp *%r11
L(ed0): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f7): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea -64(up,un_save,8), up
mov R32(un_save), R32(n)
lea -56(rp,un_save,8), rp
mov (up), w1 C up[-1]
mov 8(up), u0 C up[0]
shrx( %rax, w1, w0)
sarx( %rax, w1, w1)
and u0, w1 C "ci" in C code
mulx( u0, w2, w3) C up[0]^2
lea (w0,u0,2), u0 C "u0" arg in C code
jmp L(b7)
ALIGN(16)
L(tp0): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed0)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
L(b0): mov w0, (rp)
adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp0)
L(ed1): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f0): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea -64(up,un_save,8), up
mov R32(un_save), R32(n)
lea -56(rp,un_save,8), rp
mov -8(up), w3 C up[-1]
mov (up), u0 C up[0]
shrx( %rax, w3, w2)
sarx( %rax, w3, w3)
and u0, w3 C "ci" in C code
mulx( u0, w0, w1) C up[0]^2
lea (w2,u0,2), u0 C "u0" arg in C code
adcx( w3, w0)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
jmp L(b0)
ALIGN(16)
L(tp1): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed1)
L(b1): mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
mov w0, (rp)
adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp1)
L(ed2): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f1): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea (up,un_save,8), up
mov R32(un_save), R32(n)
lea 8(un_save), un_save
lea -56(rp,un_save,8), rp
mov -16(up), w1 C up[-1]
mov -8(up), u0 C up[0]
shrx( %rax, w1, w0)
sarx( %rax, w1, w1)
and u0, w1 C "ci" in C code
mulx( u0, w2, w3) C up[0]^2
lea (w0,u0,2), u0 C "u0" arg in C code
adcx( w1, w2) C FIXME: crossjump?
mulx( (up), w0, w1)
adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jmp L(b1)
ALIGN(16)
L(tp2): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed2)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
mov w0, (rp)
adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
L(b2): adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp2)
L(ed3): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f2): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea (up,un_save,8), up
or R32(un_save), R32(n)
jz L(cor3)
lea -56(rp,un_save,8), rp
mov -24(up), w3 C up[-1]
mov -16(up), u0 C up[0]
shrx( %rax, w3, w2)
sarx( %rax, w3, w3)
and u0, w3 C "ci" in C code
mulx( u0, w0, w1) C up[0]^2
lea (w2,u0,2), u0 C "u0" arg in C code
adcx( w3, w0)
jmp L(b2)
ALIGN(16)
L(tp3): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed3)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
mov w0, (rp)
adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
L(b3): mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp3)
L(ed4): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f3): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea (up,un_save,8), up
mov R32(un_save), R32(n)
lea -56(rp,un_save,8), rp
mov -32(up), w1 C up[-1]
mov -24(up), u0 C up[0]
shrx( %rax, w1, w0)
sarx( %rax, w1, w1)
and u0, w1 C "ci" in C code
mulx( u0, w2, w3) C up[0]^2
lea (w0,u0,2), u0 C "u0" arg in C code
adcx( w1, w2)
jmp L(b3)
ALIGN(16)
L(tp4): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed4)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
mov w0, (rp)
adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
L(b4): mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp4)
L(ed5): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f4): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea (up,un_save,8), up
mov R32(un_save), R32(n)
lea -56(rp,un_save,8), rp
mov -40(up), w3 C up[-1]
mov -32(up), u0 C up[0]
shrx( %rax, w3, w2)
sarx( %rax, w3, w3)
and u0, w3 C "ci" in C code
mulx( u0, w0, w1) C up[0]^2
lea (w2,u0,2), u0 C "u0" arg in C code
adcx( w3, w0)
jmp L(b4)
ALIGN(16)
L(tp5): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed5)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
mov w0, (rp)
adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
L(b5): mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp5)
L(ed6): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f5): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea (up,un_save,8), up
mov R32(un_save), R32(n)
lea -56(rp,un_save,8), rp
mov -48(up), w1 C up[-1]
mov -40(up), u0 C up[0]
shrx( %rax, w1, w0)
sarx( %rax, w1, w1)
and u0, w1 C "ci" in C code
mulx( u0, w2, w3) C up[0]^2
lea (w0,u0,2), u0 C "u0" arg in C code
adcx( w1, w2)
jmp L(b5)
ALIGN(16)
L(tp6): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed6)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
mov w0, (rp)
adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
L(b6): adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp6)
L(ed7): adox( (rp), w0)
adox( %rcx, w1) C relies on rcx = 0
L(f6): mov w0, (rp)
adc %rcx, w1 C relies on rcx = 0
mov w1, 8(rp)
lea (up,un_save,8), up
mov R32(un_save), R32(n)
lea -56(rp,un_save,8), rp
mov -56(up), w3 C up[-1]
mov -48(up), u0 C up[0]
shrx( %rax, w3, w2)
sarx( %rax, w3, w3)
and u0, w3 C "ci" in C code
mulx( u0, w0, w1) C up[0]^2
lea (w2,u0,2), u0 C "u0" arg in C code
adcx( w3, w0)
mulx( -40,(up), w2, w3)
jmp L(b6)
ALIGN(16)
L(tp7): adox( -8,(rp), w2)
adcx( w3, w0)
mov w2, -8(rp)
jrcxz L(ed7)
mulx( 8,(up), w2, w3)
adox( (rp), w0)
lea 8(n), R32(n)
mov w0, (rp)
L(b7): adcx( w1, w2)
mulx( 16,(up), w0, w1)
adcx( w3, w0)
adox( 8,(rp), w2)
mov w2, 8(rp)
mulx( 24,(up), w2, w3)
lea 64(up), up
adcx( w1, w2)
adox( 16,(rp), w0)
mov w0, 16(rp)
mulx( -32,(up), w0, w1)
adox( 24,(rp), w2)
adcx( w3, w0)
mov w2, 24(rp)
mulx( -24,(up), w2, w3)
adcx( w1, w2)
adox( 32,(rp), w0)
mov w0, 32(rp)
mulx( -16,(up), w0, w1)
adox( 40,(rp), w2)
adcx( w3, w0)
mov w2, 40(rp)
adox( 48,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 48(rp)
lea 64(rp), rp
adcx( w1, w2)
mulx( (up), w0, w1)
jmp L(tp7)
L(cor3):lea -64(rp), rp
mov -24(up), w3 C up[-1]
mov -16(up), u0 C up[0]
shrx( %rax, w3, w2)
sarx( %rax, w3, w3)
and u0, w3 C "ci" in C code
mulx( u0, w0, w1) C up[0]^2
lea (w2,u0,2), u0 C "u0" arg in C code
adcx( w3, w0)
adox( 56,(rp), w0)
mulx( -8,(up), w2, w3)
mov w0, 56(rp)
adcx( w1, w2)
mulx( (up), %rbx, w1)
adox( 64,(rp), w2)
adcx( w3, %rbx)
mov w2, 64(rp)
adox( 72,(rp), %rbx)
adox( %rcx, w1) C relies on rcx = 0
adc %rcx, w1 C relies on rcx = 0
mov w1, 80(rp) C FIXME
C wd2
mov -16(up), w1 C up[-1]
mov -8(up), u0 C up[0]
shrx( %rax, w1, w0)
sarx( %rax, w1, w1)
and u0, w1 C "ci" in C code
mulx( u0, w2, w3) C up[0]^2
lea (w0,u0,2), u0 C "u0" arg in C code
adcx( w1, w2)
mulx( (up), w0, %rax)
adox( %rbx, w2)
adcx( w3, w0)
mov w2, 72(rp)
adox( 80,(rp), w0)
adox( %rcx, %rax) C relies on rcx = 0
mov w0, 80(rp)
adc %rcx, %rax C relies on rcx = 0
C wd1
mov -8(up), w3 C up[-1]
mov (up), u0 C up[0]
sar $63, w3
and u0, w3 C "ci" in C code
mulx( u0, w0, w1) C up[0]^2
adcx( w3, w0)
adox( %rax, w0)
mov w0, 88(rp)
adcx( %rcx, w1)
adox( %rcx, w1)
mov w1, 96(rp)
pop %rbx
FUNC_EXIT()
ret
JUMPTABSECT
ALIGN(8)
L(mtab):JMPENT( L(mf7), L(mtab))
JMPENT( L(mf0), L(mtab))
JMPENT( L(mf1), L(mtab))
JMPENT( L(mf2), L(mtab))
JMPENT( L(mf3), L(mtab))
JMPENT( L(mf4), L(mtab))
JMPENT( L(mf5), L(mtab))
JMPENT( L(mf6), L(mtab))
L(atab):JMPENT( L(f6), L(atab))
JMPENT( L(f7), L(atab))
JMPENT( L(f0), L(atab))
JMPENT( L(f1), L(atab))
JMPENT( L(f2), L(atab))
JMPENT( L(f3), L(atab))
JMPENT( L(f4), L(atab))
JMPENT( L(f5), L(atab))
TEXT
EPILOGUE()
|
src/babel-streams-files.ads | stcarrez/babel | 1 | 21322 | <filename>src/babel-streams-files.ads
-----------------------------------------------------------------------
-- babel-streams-files -- Local file stream management
-- Copyright (C) 2014, 2015 Stephane.Carrez
-- Written by Stephane.Carrez (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
private with Util.Streams.Raw;
-- == Local Files Stream ==
-- The <tt>Babel.Streams.Files</tt> package provides the streams support to read and write
-- local files.
package Babel.Streams.Files is
type Stream_Type is new Babel.Streams.Stream_Type with private;
type Stream_Access is access all Stream_Type'Class;
-- Open the local file for reading and use the given buffer for the Read operation.
procedure Open (Stream : in out Stream_Type;
Path : in String;
Buffer : in Babel.Files.Buffers.Buffer_Access);
-- Create a file and prepare for the Write operation.
procedure Create (Stream : in out Stream_Type;
Path : in String;
Mode : in Util.Systems.Types.mode_t);
-- Read the data stream as much as possible and return the result in a buffer.
-- The buffer is owned by the stream and need not be released. The same buffer may
-- or may not be returned by the next <tt>Read</tt> operation.
-- A null buffer is returned when the end of the data stream is reached.
overriding
procedure Read (Stream : in out Stream_Type;
Buffer : out Babel.Files.Buffers.Buffer_Access);
-- Write the buffer in the data stream.
overriding
procedure Write (Stream : in out Stream_Type;
Buffer : in Babel.Files.Buffers.Buffer_Access);
-- Close the data stream.
overriding
procedure Close (Stream : in out Stream_Type);
-- Prepare to read again the data stream from the beginning.
overriding
procedure Rewind (Stream : in out Stream_Type);
private
type Stream_Type is new Babel.Streams.Stream_Type with record
File : Util.Streams.Raw.Raw_Stream;
Eof : Boolean := False;
end record;
end Babel.Streams.Files;
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_10756_709.asm | ljhsiun2/medusa | 9 | 83397 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %r9
push %rbp
push %rcx
push %rsi
// Load
lea addresses_A+0x1970e, %r13
nop
dec %rsi
mov (%r13), %r11d
nop
nop
add %r13, %r13
// Store
lea addresses_UC+0x17e02, %r14
add %r9, %r9
movb $0x51, (%r14)
nop
nop
nop
sub $1322, %rcx
// Faulty Load
lea addresses_UC+0x1030e, %r11
nop
nop
dec %rbp
mov (%r11), %r9d
lea oracles, %r11
and $0xff, %r9
shlq $12, %r9
mov (%r11,%r9,1), %r9
pop %rsi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'37': 10756}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
|
source/scene/inventoryScene.asm | evanbowman/Red | 5 | 178998 | ;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;;;
;;; ASM Source code for Red GBC, by <NAME>, 2021
;;;
;;;
;;; The following licence covers the source code included in this file. The
;;; game's characters and artwork belong to <NAME>, and should not be used
;;; without permission.
;;;
;;;
;;; 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.
;;;
;;; 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.
;;;
;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;;;
;;;
;;; Inventory Scene
;;;
;;;
;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
InventorySceneEnter:
xor a
ld [var_scene_counter], a
ld de, DrawonlyUpdateFn
fcall SceneSetUpdateFn
ld de, InventorySceneFadeinVBlank
fcall SceneSetVBlankFn
ret
;;; ----------------------------------------------------------------------------
InventorySceneExit:
ld a, 255
ld [var_scene_counter], a
fcall VBlankIntrWait
fcall BlackScreenExcludeOverlay
fcall VBlankIntrWait
ld a, 136
ld [rWY], a
ldh [hvar_overlay_y_offset], a
xor a
ld [var_overlay_alternate_pos], a
fcall ShowOverlay
fcall OverlayRepaintRow2
fcall DrawEntitiesSimple
ld de, InventorySceneFadeOutVBlank
fcall SceneSetVBlankFn
ld de, DrawonlyUpdateFn
fcall SceneSetUpdateFn
ret
;;; ----------------------------------------------------------------------------
InventorySceneUpdate:
ldh a, [hvar_joypad_current]
and PADF_START | PADF_B
jr Z, .idle
fcall InventorySceneExit
ret
.idle:
LONG_CALL r8_InventoryUpdate
ret
;;; ----------------------------------------------------------------------------
InventorySceneDiscardUpdate:
LONG_CALL r8_InventorySceneDiscardUpdate
ret
;;; ----------------------------------------------------------------------------
InventorySceneConsumeUpdate:
LONG_CALL r8_InventorySceneConsumeUpdate
ret
;;; ----------------------------------------------------------------------------
InventorySceneCraftOptionUpdate:
LONG_CALL r8_InventorySceneCraftOptionUpdate
ret
;;; ----------------------------------------------------------------------------
InventorySceneEquipUpdate:
LONG_CALL r8_InventorySceneEquipUpdate
ret
;;; ----------------------------------------------------------------------------
InventorySceneUseFirewoodUpdate:
LONG_CALL r8_InventorySceneUseFirewoodUpdate
ret
;;; ----------------------------------------------------------------------------
InventorySceneFadeinVBlank:
ld a, HIGH(var_oam_back_buffer)
fcall hOAMDMA
SET_BANK 7
ldh a, [hvar_overlay_y_offset]
ld b, 136
cp b
jr C, .inc
jr .skip
.inc:
inc a
ldh [hvar_overlay_y_offset], a
.skip:
ldh a, [hvar_overlay_y_offset]
ld [rWY], a
ld a, [var_scene_counter]
ld c, a
add 18
jr C, .transition
jr .continue
.transition:
ld de, VoidVBlankFn
fcall SceneSetVBlankFn
ld de, InventorySceneUpdate
fcall SceneSetUpdateFn
ld c, 255
fcall BlackScreenExcludeOverlay
LONG_CALL r8_InventoryOpen
ret
.continue:
ld [var_scene_counter], a
fcall FadeToBlackExcludeOverlay
ret
;;; ----------------------------------------------------------------------------
InventorySceneFadeOutVBlank:
ld a, HIGH(var_oam_back_buffer)
fcall hOAMDMA
SET_BANK 7
ld a, [var_scene_counter]
ld c, a
sub 24
jr C, .transition
jr .continue
.transition:
fcall FadeNone
ld de, OverworldSceneUpdate
fcall SceneSetUpdateFn
ld de, OverworldSceneOnVBlank
fcall SceneSetVBlankFn
ret
.continue:
ld [var_scene_counter], a
fcall FadeToBlackExcludeOverlay
ret
|
Assignment2/Ass2-Q2/Ass2-Q2.asm | ConstantinCezB/Computer-Architecture-assembly | 0 | 104903 | <gh_stars>0
; Author: <NAME> 104808191
include Irvine32.inc
.data
string BYTE 129 DUP (0)
numberOFChar DWORD 0
numberOfUpper DWORD 0
; Messages used as display for this program
message BYTE 'Enter a string of at most 128 characters: ', 0
message1 BYTE 'Here it is, with all lowercases and uppercases flipped, and in reverse order:', 0
message2 BYTE 'There are ', 0
message3 BYTE ' upper-case letters after conversion.', 0
message4 BYTE 'There are ', 0
message5 BYTE ' characters in the string.', 0
.code
main proc
; Prompts the user to enter a string according to specifications
MOV EDX, OFFSET message
CALL WriteString
; Reads the string from the user
MOV EDX, OFFSET string
MOV ECX, SIZEOF string
CALL ReadString
; Convers the upper letter to lower case letters
MOV EDX, 0
do_while:
; Loop counter if ECX >= counter
CMP EDX, ECX
JAE end_do
MOV AL, [string + EDX]
; IF statment
cmp AL, 0
JE L1
;statment 1
; Converts from lower to upper
; .IF AL >= 'a' && AL <= 'z'
cmp AL, 'a'
JB next
cmp AL, 'z'
JA next
INC numberOfUpper
SUB AL, 20h
MOV [string + EDX], AL
MOV AL, [string + EDX]
jmp next1
next:
; Converts from upper to lower
; .IF AL >= 'A' && AL <= 'Z'
cmp AL, 'A'
JB next1
cmp AL, 'Z'
JA next1
ADD AL, 20h
MOV [string + EDX], AL
next1:
INC numberOFChar
INC EDX
jmp L2
L1:
;statment 2
MOV EDX, ECX
L2:
JMP do_while
end_do:
; This is the better way to do it but since the prof wants us to practice this way.
; .WHILE EDX < ECX
; MOV AL, [string + EDX]
; .IF AL != 0
; ; Converts lower to upper
; .IF AL >= 'a' && AL <= 'z'
; INC numberOfUpper
; SUB AL, 20h
; MOV [string + EDX], AL
; ; Converts upper to lower
; .ELSEIF AL >= 'A' && AL <= 'Z'
; ADD AL, 20h
; MOV [string + EDX], AL
; .ENDIF
; INC numberOFChar
; INC EDX
; .ELSE
; MOV EDX, ECX
; .ENDIF
;s .ENDW
; Lets the user know that the output bellow is the ans
CALL Crlf
MOV EDX, OFFSET message1
CALL WriteString
CALL Crlf
; Prints the string entered in reverse order
; number 200 can be used since the max string can be 128 (much lower then 200)
MOV EDX, numberOFChar
DEC EDX
do_while1:
; Loop counter if ECX = counter exit
CMP EDX, 200
JE end_do1
MOV AL, [string + EDX]
CALL WriteChar
; IF statment
cmp EDX, 0
JE L11
DEC EDX
jmp L21
L11:
MOV EDX, 200
L21:
JMP do_while1
end_do1:
; This the best way but the prof required us to write it from scrap
; .WHILE EDX != 200
; MOV AL, [string + EDX]
; CALL WriteChar
;
; .IF EDX != 0
; DEC EDX
; .ELSE
; MOV EDX, 200
; .ENDIF
; .ENDW
CALL Crlf
CALL Crlf
; Prints the number of upper case letters
MOV EDX, OFFSET message2
CALL WriteString
MOV EAX, numberOfUpper
CALL WriteDec
MOV EDX, OFFSET message3
CALL WriteString
CALL Crlf
; Prints the number of characters in the inputed string
MOV EDX, OFFSET message4
CALL WriteString
MOV EAX, numberOFChar
CALL WriteDec
MOV EDX, OFFSET message5
CALL WriteString
CALL Crlf
exit
main endp
end main |
firmware/coreboot/3rdparty/blobs/cpu/amd/geode_lx/gplvsa_ii/sysmgr/bugs.asm | fabiojna02/OpenCellular | 1 | 179064 | <gh_stars>1-10
;
; Copyright (c) 2006-2008 Advanced Micro Devices,Inc. ("AMD").
;
; This library is free software; you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as
; published by the Free Software Foundation; either version 2.1 of the
; License, or (at your option) any later version.
;
; This code is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General
; Public License along with this library; if not, write to the
; Free Software Foundation, Inc., 59 Temple Place, Suite 330,
; Boston, MA 02111-1307 USA
;
;* Function: *
;* This file contains hardware bug fixes.
include VSA2.INC
include ISA.INC
include GX2.INC
include CHIPSET.INC
.model tiny,c
.586p
.CODE
externdef Nested_SMI: proc
externdef SysMgr_Entry: proc
externdef Restore_IDT: proc
externdef Install_IDT: proc
externdef Sample_SMI_Pin: proc
externdef Clear_SMI_Pin: proc
externdef Header_Addr: dword
externdef HC_Status: dword
externdef SMI_Sources: dword
externdef HardwareInfo: Hardware
;*******************************************************************************
; Remove the RTC fix if an RTC VSM is installed.
;*******************************************************************************
Remove_RTC_Fix proc
mov word ptr [Fix_RTC], 0C3F8h ; CLC RET
ret
Remove_RTC_Fix endp
; *******************************************************************************
; This routine is called upon entry to a non-nested SMI.
; *******************************************************************************
VSA_Entry proc
; Patch a "jmp Nested_SMI" at Start
mov word ptr ds:[1], OFFSET Nested_SMI-3
; Install exception handlers
call Install_IDT
ret
VSA_Entry endp
; *******************************************************************************
; This routine is called upon exit from a non-nested SMI.
; It performs:
; 1) RTC fix
; 2) USB fix
; 3) IDT restore
; 4) Re-enable Suspend Modulation
;
; If CF=1 is returned, then loop back to SMI handlers.
; *******************************************************************************
VSA_Exit proc
mov eax, [Header_Addr] ; Restore the original SMM header
mov ecx, MSR_SMM_HDR
wrmsr
call Fix_RTC
jc short Exit ; Don't exit from VSA
; Restore "JMP SysMgr_Entry" at Start
mov word ptr ds:[1], OFFSET SysMgr_Entry-3
call Restore_IDT ; Restore IDT
clc
Exit: ret
VSA_Exit endp
; *******************************************************************************
; Handle the case where the RTC UIP bit was clear, application code was about to
; read the RTC, but an SMI occurs. When VSA returns, the RTC is updating, so the
; application reads a bad value.
;
; The Solution:
;
; The Time Stamp Counter is read upon entry to VSA. On exit, if UIP is low or
; it is determined that the SMI has taken < 250 us, then just exit. This leaves
; 44 us for the application to finish reading the RTC safely. If the SMI has
; taken > 250 us, then spin for 500 us minus the time spent servicing the SMI.
; This guarantees the RTC has finished updating. Then set the SET bit, wait for
; UIP to go low, then clear the SET bit.
;
; *******************************************************************************
RTC_TIME equ 250
Fix_RTC proc
in al, CMOS_INDEX ; Get RTC index
cmp al, 9 ; Only RTC indices 0-9 are UIP sensitive
ja Exit
mov bl, al ; Save RTC index
push si
mov al, CMOS_STATUS_A ; Read RTC Status A
out CMOS_INDEX, al
in al, CMOS_DATA
test al, UIP
jz Restore_RTC_Index
mov al, CMOS_STATUS_B ; Exit if StatusB[SET] = 1
out CMOS_INDEX, al
in al, CMOS_DATA
test al, SET
jz Restore_RTC_Index
ASSUME SI: PTR System ; Compute time servicing SMI in us
mov si, OFFSET VSM_Header.SysStuff
rdtsc
sub eax, [si+0].StartTime
sbb edx, [si+4].StartTime
movzx ecx, [HardwareInfo].CPU_MHz
cmp edx, ecx ; If sitting in Dowser or Standby too long,
jae Restore_RTC_Index ; the divide could overflow.
div ecx
cmp eax, RTC_TIME ; If < RTC_TIME us, exit
jb Restore_RTC_Index
call Clear_SMI_Pin
WaitForUpdate:
call Sample_SMI_Pin
stc
jnz short SMI_Abort ; Yes, go process it
rdtsc ; Wait for additional 300 us
sub eax, [si+0].StartTime
sbb edx, [si+4].StartTime
div ecx
cmp eax, RTC_TIME + 300
jb WaitForUpdate
ASSUME SI: NOTHING
; StatusB[SET] = 1;
mov al, CMOS_STATUS_B ; Read RTC StatusB
out CMOS_INDEX, al
in al, CMOS_DATA
test al, SET ; If (SET == 1)
jnz short Restore_RTC_Index ; bail
or al, SET ; else
out CMOS_DATA, al ; SET = 1
; Wait for StatusA[UIP] to go inactive
mov cx, 0FFFFh ; RTC timeout
SpinUIP:
mov al, CMOS_STATUS_A ; Yes, spin until UIP is clear
out CMOS_INDEX, al
in al, CMOS_DATA
test al, UIP
loopnz SpinUIP
mov al, CMOS_STATUS_B ; SET = 0
out CMOS_INDEX, al
in al, CMOS_DATA
and al, NOT SET
out CMOS_DATA, al
Restore_RTC_Index:
clc
SMI_Abort:
pop si
mov al, bl ; Restore CMOS index
out CMOS_INDEX, al
Exit: ret
Fix_RTC endp
END
|
programs/oeis/229/A229347.asm | neoneye/loda | 22 | 167571 | ; A229347: a(1) = 1, for n > 1 a(n) = n*2^(omega(n)-1) where omega is A001221.
; 1,2,3,4,5,12,7,8,9,20,11,24,13,28,30,16,17,36,19,40,42,44,23,48,25,52,27,56,29,120,31,32,66,68,70,72,37,76,78,80,41,168,43,88,90,92,47,96,49,100,102,104,53,108,110,112,114,116,59,240,61,124,126,64,130,264,67,136,138,280,71,144,73,148,150,152,154,312,79,160,81,164,83,336,170,172,174,176,89,360,182,184,186,188,190,192,97,196,198,200
mov $1,$0
add $0,1
seq $1,1221 ; Number of distinct primes dividing n (also called omega(n)).
sub $1,1
lpb $1
mul $0,2
sub $1,1
lpe
|
src/sqlite/sqlite3_h-perfect_hash.adb | My-Colaborations/ada-ado | 0 | 19010 | <gh_stars>0
-- Generated by gperfhash
with Util.Strings.Transforms;
with Interfaces; use Interfaces;
package body Sqlite3_H.Perfect_Hash is
C : constant array (Character) of Unsigned_8 :=
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0,
0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
P : constant array (0 .. 6) of Natural :=
(1, 2, 3, 4, 7, 9, 13);
T1 : constant array (0 .. 6, Unsigned_8 range 0 .. 24) of Unsigned_8 :=
((143, 96, 170, 168, 5, 221, 118, 70, 107, 192, 176, 130, 205, 180, 29,
75, 72, 130, 134, 58, 11, 112, 107, 171, 238),
(180, 2, 196, 77, 209, 61, 149, 97, 43, 57, 69, 126, 232, 154, 25, 211,
62, 215, 181, 201, 228, 167, 28, 102, 215),
(133, 106, 209, 117, 51, 209, 60, 189, 39, 41, 33, 19, 192, 151, 94,
120, 190, 187, 151, 241, 38, 145, 217, 75, 212),
(147, 18, 41, 107, 118, 30, 200, 90, 101, 192, 44, 168, 94, 60, 134,
10, 50, 154, 4, 213, 75, 107, 141, 216, 51),
(41, 104, 175, 241, 124, 61, 0, 11, 87, 21, 236, 106, 178, 89, 202,
193, 188, 51, 144, 208, 221, 139, 171, 90, 222),
(52, 176, 202, 98, 235, 165, 118, 228, 58, 161, 116, 43, 211, 102, 236,
7, 198, 105, 78, 186, 118, 191, 16, 48, 128),
(133, 172, 79, 95, 45, 169, 47, 156, 128, 214, 180, 197, 86, 107, 99,
99, 39, 28, 235, 81, 124, 139, 132, 225, 23));
T2 : constant array (0 .. 6, Unsigned_8 range 0 .. 24) of Unsigned_8 :=
((94, 74, 218, 128, 191, 64, 53, 80, 54, 36, 176, 13, 192, 31, 45, 43,
139, 74, 169, 234, 141, 5, 208, 79, 239),
(35, 233, 99, 220, 99, 211, 131, 143, 149, 138, 37, 42, 35, 57, 202,
217, 88, 108, 105, 114, 42, 103, 27, 56, 67),
(102, 8, 146, 198, 7, 113, 80, 188, 109, 57, 239, 32, 76, 186, 96, 142,
157, 156, 48, 211, 145, 223, 106, 24, 131),
(216, 125, 109, 240, 114, 175, 39, 237, 107, 142, 180, 185, 208, 65,
55, 65, 42, 73, 137, 94, 38, 12, 174, 228, 122),
(151, 225, 8, 68, 9, 166, 38, 56, 223, 64, 116, 197, 63, 224, 30, 6,
175, 188, 140, 240, 98, 105, 210, 183, 235),
(57, 193, 135, 211, 112, 69, 91, 204, 78, 191, 151, 115, 179, 221, 162,
204, 110, 205, 176, 96, 78, 227, 122, 91, 186),
(27, 62, 122, 225, 148, 217, 212, 155, 163, 21, 117, 47, 179, 197, 108,
150, 229, 148, 35, 115, 179, 191, 58, 3, 49));
G : constant array (0 .. 242) of Unsigned_8 :=
(0, 70, 0, 85, 0, 0, 0, 45, 60, 5, 0, 112, 0, 0, 0, 18, 0, 0, 46, 43, 0,
114, 51, 45, 0, 0, 0, 0, 6, 72, 5, 81, 0, 106, 0, 0, 32, 0, 0, 0, 0, 0,
35, 113, 58, 0, 21, 60, 0, 23, 0, 0, 53, 75, 47, 44, 25, 0, 0, 13, 81,
0, 0, 0, 0, 63, 0, 0, 0, 7, 0, 0, 60, 12, 0, 0, 71, 0, 0, 0, 51, 0,
106, 20, 0, 0, 0, 0, 0, 14, 80, 0, 0, 0, 2, 0, 0, 25, 97, 0, 0, 0, 70,
0, 117, 0, 0, 0, 0, 19, 16, 12, 74, 40, 94, 0, 0, 10, 0, 111, 0, 85,
47, 0, 11, 0, 45, 0, 0, 0, 28, 16, 0, 0, 66, 0, 0, 64, 0, 100, 62, 15,
0, 100, 3, 0, 0, 0, 0, 46, 0, 81, 0, 13, 89, 0, 0, 40, 0, 67, 20, 28,
36, 58, 0, 0, 0, 0, 4, 57, 0, 7, 17, 0, 0, 118, 78, 114, 0, 0, 59, 74,
0, 12, 44, 0, 0, 0, 120, 0, 48, 50, 110, 88, 0, 1, 32, 0, 0, 8, 0, 21,
54, 56, 0, 26, 62, 0, 0, 0, 0, 15, 31, 90, 0, 0, 0, 21, 5, 104, 33, 0,
78, 3, 35, 0, 0, 0, 18, 0, 0, 105, 0, 50, 19, 0, 6, 95, 17, 0, 14, 39,
0);
function Hash (S : String) return Natural is
F : constant Natural := S'First - 1;
L : constant Natural := S'Length;
F1, F2 : Natural := 0;
J : Unsigned_8;
begin
for K in P'Range loop
exit when L < P (K);
J := C (S (P (K) + F));
F1 := (F1 + Natural (T1 (K, J))) mod 243;
F2 := (F2 + Natural (T2 (K, J))) mod 243;
end loop;
return (Natural (G (F1)) + Natural (G (F2))) mod 121;
end Hash;
-- Returns true if the string <b>S</b> is a keyword.
function Is_Keyword (S : in String) return Boolean is
H : constant Natural := Hash (S);
begin
return Keywords (H).all = Util.Strings.Transforms.To_Upper_Case (S);
end Is_Keyword;
end Sqlite3_H.Perfect_Hash;
|
audio/sfx/noise_instrument14_1.asm | opiter09/ASM-Machina | 1 | 13824 | SFX_Noise_Instrument14_1_Ch8:
noise_note 0, 10, 2, 80
sound_ret
|
src/main/antlr/RpgLexer.g4 | rpglang/rpgleparser | 0 | 5312 | <filename>src/main/antlr/RpgLexer.g4
/**
* Define a grammar called RpgLexer
*/
lexer grammar RpgLexer;
@members {
public boolean isEndOfToken() {
return " (;".indexOf(_input.LA(1)) >=0;
}
int lastTokenType = 0;
public void emit(Token token) {
super.emit(token);
lastTokenType = token.getType();
}
protected int getLastTokenType(){
return lastTokenType;
}
}
// Parser Rules
//End Source. Not more parsing after this.
END_SOURCE : '**' {getCharPositionInLine()==2}? ~[\r\n]~[\r\n]~[\r\n]~[\r\n*]~[\r\n]* EOL -> pushMode(EndOfSourceMode) ;
//Ignore or skip leading 5 white space.
LEAD_WS5 : ' ' {getCharPositionInLine()==5}? -> skip;
LEAD_WS5_Comments : WORD5 {getCharPositionInLine()==5}? -> channel(HIDDEN);
//5 position blank means FREE, unless..
FREE_SPEC : {getCharPositionInLine()==5}? [ ] -> pushMode(OpCode),skip;
// 6th position asterisk is a comment
COMMENT_SPEC_FIXED : {getCharPositionInLine()==5}? .'*' -> pushMode(FIXED_CommentMode),channel(HIDDEN) ;
// X specs
DS_FIXED : D {getCharPositionInLine()==6}? -> pushMode(FIXED_DefSpec) ;
FS_FIXED : F {getCharPositionInLine()==6}? -> pushMode(FIXED_FileSpec) ;
OS_FIXED : O {getCharPositionInLine()==6}? -> pushMode(FIXED_OutputSpec) ;
CS_FIXED : C {getCharPositionInLine()==6}? -> pushMode(FIXED_CalcSpec),pushMode(OnOffIndicatorMode),pushMode(IndicatorMode) ;
CS_ExecSQL: C '/' {getCharPositionInLine()==7}? EXEC_SQL -> pushMode(FIXED_CalcSpec_SQL);
IS_FIXED : I {getCharPositionInLine()==6}? -> pushMode(FIXED_InputSpec) ;
PS_FIXED : P {getCharPositionInLine()==6}? -> pushMode(FIXED_ProcedureSpec) ;
HS_FIXED : H {getCharPositionInLine()==6}? -> pushMode(HeaderSpecMode) ;
BLANK_LINE : [ ] {getCharPositionInLine()==6}? [ ]* NEWLINE -> skip;
BLANK_SPEC_LINE1 : . NEWLINE {getCharPositionInLine()==7}?-> skip;
BLANK_SPEC_LINE : .[ ] {getCharPositionInLine()==7}? [ ]* NEWLINE -> skip;
COMMENTS : [ ] {getCharPositionInLine()>=6}? [ ]*? '//' -> pushMode(FIXED_CommentMode),channel(HIDDEN) ;
EMPTY_LINE :
' '
{getCharPositionInLine()>=80}? -> pushMode(FIXED_CommentMode),channel(HIDDEN) ;
//Directives are not necessarily blank at pos 5
DIRECTIVE : . {getCharPositionInLine()>=6}? [ ]*? '/' -> pushMode(DirectiveMode) ;
OPEN_PAREN : '(';
CLOSE_PAREN : ')';
NUMBER : ([0-9]+([.][0-9]*)?) | [.][0-9]+ ;
SEMI : ';';
COLON : ':';
ID : ('*' {getCharPositionInLine()>7}? '*'? [a-zA-Z])?
[#@%$a-zA-Z]{getCharPositionInLine()>7}? [#@$a-zA-Z0-9_]* ;
NEWLINE : ('\r'? '\n') -> skip;
WS : [ \t] {getCharPositionInLine()>6}? [ \t]* -> skip ; // skip spaces, tabs
mode DirectiveTitle;
TITLE_Text : ~[\r\n]+ -> type(DIR_OtherText);
TITLE_EOL : NEWLINE -> type(EOL),popMode,popMode;
mode DirectiveMode;
DIR_NOT: N O T ;
DIR_DEFINED: D E F I N E D ;
DIR_FREE: {_input.LA(-1)=='/'}? F R E E -> pushMode(SKIP_REMAINING_WS);
DIR_ENDFREE: {_input.LA(-1)=='/'}? E N D '-' F R E E -> pushMode(SKIP_REMAINING_WS);
DIR_TITLE:{_input.LA(-1)=='/'}? (T I T L E ) -> pushMode(DirectiveTitle);
DIR_EJECT: {_input.LA(-1)=='/'}? E J E C T -> pushMode(SKIP_REMAINING_WS);
DIR_SPACE: {_input.LA(-1)=='/'}? S P A C E ;
DIR_SET: {_input.LA(-1)=='/'}? S E T ;
DIR_RESTORE: {_input.LA(-1)=='/'}? R E S T O R E ;
DIR_COPY: {_input.LA(-1)=='/'}? C O P Y ;
DIR_INCLUDE: {_input.LA(-1)=='/'}? I N C L U D E ;
DIR_EOF: {_input.LA(-1)=='/'}? E O F ;
DIR_DEFINE: {_input.LA(-1)=='/'}? (D E F I N E );
DIR_UNDEFINE: {_input.LA(-1)=='/'}? (U N D E F I N E );
DIR_IF: {_input.LA(-1)=='/'}? (I F );
DIR_ELSE: {_input.LA(-1)=='/'}? (E L S E );
DIR_ELSEIF: {_input.LA(-1)=='/'}? (E L S E I F );
DIR_ENDIF: {_input.LA(-1)=='/'}? (E N D I F );
DIR_Number: NUMBER -> type(NUMBER);
DIR_WhiteSpace: [ ] -> type(WS),skip;
DIR_OtherText : ~[/'"\r\n \t,()]+ ;
DIR_Comma : [,] -> skip;
DIR_Slash : [/] ;
DIR_OpenParen: [(] -> type(OPEN_PAREN);
DIR_CloseParen: [)] -> type(CLOSE_PAREN);
DIR_DblStringLiteralStart: ["] -> pushMode(InDoubleStringMode),type(StringLiteralStart) ;
DIR_StringLiteralStart: ['] -> pushMode(InStringMode),type(StringLiteralStart) ;
DIR_EOL : [ ]* NEWLINE {setText(getText().trim());} -> type(EOL),popMode;
mode SKIP_REMAINING_WS;
DIR_FREE_OTHER_TEXT: ~[\r\n]* -> popMode,skip;
mode EndOfSourceMode;
EOS_Text : ~[\r\n]+ ;
EOS_EOL : NEWLINE -> type(EOL);
// ----------------------------------------------
mode OpCode;
OP_WS: [ \t] {getCharPositionInLine()>6}? [ \t]* -> skip;
OP_ACQ: A C Q {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_BEGSR: B E G S R {isEndOfToken()}?-> mode(FREE);
OP_CALLP: C A L L P {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_CHAIN: C H A I N {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_CLEAR: C L E A R {isEndOfToken()}?-> mode(FREE);
OP_CLOSE: C L O S E {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_COMMIT: C O M M I T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_DEALLOC: D E A L L O C {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_DELETE: D E L E T E {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_DOU: D O U {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_DOW: D O W {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_DSPLY: D S P L Y {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_DUMP: D U M P {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_ELSE: E L S E {isEndOfToken()}?-> mode(FREE);
OP_ELSEIF: E L S E I F {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_ENDDO: E N D D O {isEndOfToken()}?-> mode(FREE);
OP_ENDFOR: E N D F O R {isEndOfToken()}?-> mode(FREE);
OP_ENDIF: E N D I F {isEndOfToken()}?-> mode(FREE);
OP_ENDMON: E N D M O N {isEndOfToken()}?-> mode(FREE);
OP_ENDSL: E N D S L {isEndOfToken()}?-> mode(FREE);
OP_ENDSR: E N D S R {isEndOfToken()}?-> mode(FREE);
OP_EVAL: E V A L {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_EVALR: E V A L R {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_EVAL_CORR: E V A L [-]C O R R {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_EXCEPT: E X C E P T {isEndOfToken()}?-> mode(FREE);
OP_EXFMT: E X F M T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_EXSR: E X S R {isEndOfToken()}?-> mode(FREE);
OP_FEOD: F E O D {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_FOR: F O R {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_FORCE: F O R C E {isEndOfToken()}?-> mode(FREE);
OP_IF: I F {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_IN: I N {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_ITER: I T E R {isEndOfToken()}?-> mode(FREE);
OP_LEAVE: L E A V E {isEndOfToken()}?-> mode(FREE);
OP_LEAVESR: L E A V E S R {isEndOfToken()}?-> mode(FREE);
OP_MONITOR: M O N I T O R {isEndOfToken()}?-> mode(FREE);
OP_NEXT: N E X T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_ON_ERROR: O N [-]E R R O R {isEndOfToken()}?-> mode(FREE);
OP_OPEN: O P E N {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_OTHER: O T H E R {isEndOfToken()}?-> mode(FREE);
OP_OUT: O U T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_POST: P O S T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_READ: R E A D {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_READC: R E A D C {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_READE: R E A D E {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_READP: R E A D P {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_READPE: R E A D P E {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_REL: R E L {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_RESET: R E S E T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_RETURN: R E T U R N {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_ROLBK: R O L B K {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_SELECT: S E L E C T {isEndOfToken()}?-> mode(FREE);
OP_SETGT: S E T G T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_SETLL: S E T L L {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_SORTA: S O R T A {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_TEST: T E S T {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_UNLOCK: U N L O C K {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_UPDATE: U P D A T E {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_WHEN: W H E N {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_WRITE: W R I T E {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_XML_INTO: X M L [-]I N T O {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_XML_SAX: X M L [-]S A X {isEndOfToken()}?-> mode(FREE),pushMode(FreeOpExtender);
OP_NoSpace: -> skip,mode(FREE);//,pushMode(FreeOpExtender);
mode FREE;
//OP_COMMIT: C O M M I T-> mode(FREE),pushMode(FreeOpExtender);
DS_Standalone : D C L '-' S ;//-> pushMode(F_SPEC_FREE);
DS_DataStructureStart : D C L '-' D S ;//-> pushMode(F_SPEC_FREE);
DS_DataStructureEnd : E N D '-' D S ;//-> pushMode(F_SPEC_FREE);
DS_PrototypeStart : D C L '-' P R ;//-> pushMode(F_SPEC_FREE);
DS_PrototypeEnd : E N D '-' P R ;//-> pushMode(F_SPEC_FREE);
DS_Parm : D C L '-' P A R M ;
DS_SubField : D C L '-' S U B F ;
DS_ProcedureInterfaceStart : D C L '-' P I ;//-> pushMode(F_SPEC_FREE);
DS_ProcedureInterfaceEnd : E N D '-' P I ;//-> pushMode(F_SPEC_FREE);
DS_ProcedureStart : D C L '-' P R O C ;//-> pushMode(F_SPEC_FREE);
DS_ProcedureEnd : E N D '-' P R O C ;//-> pushMode(F_SPEC_FREE);
DS_Constant : D C L '-' C ;//-> pushMode(F_SPEC_FREE);
FS_FreeFile : D C L '-' F ;//-> pushMode(F_SPEC_FREE);
H_SPEC : C T L '-' O P T ;
FREE_CONT: '...' [ ]* NEWLINE WORD5[ ]+ {setText("...");} -> type(CONTINUATION);
FREE_COMMENTS80 : ~[\r\n] {getCharPositionInLine()>80}? ~[\r\n]* -> channel(HIDDEN); // skip comments after 80
EXEC_SQL: E X E C [ ]+ S Q L -> pushMode(SQL_MODE) ;
// Built In functions
BIF_ABS: '%'A B S ;
BIF_ADDR: '%'A D D R ;
BIF_ALLOC: '%'A L L O C ;
BIF_BITAND: '%'B I T A N D ;
BIF_BITNOT: '%'B I T N O T ;
BIF_BITOR: '%'B I T O R ;
BIF_BITXOR: '%'B I T X O R ;
BIF_CHAR: '%'C H A R ;
BIF_CHECK: '%'C H E C K ;
BIF_CHECKR: '%'C H E C K R ;
BIF_DATE: '%'D A T E ;
BIF_DAYS: '%'D A Y S ;
BIF_DEC: '%'D E C ;
BIF_DECH: '%'D E C H ;
BIF_DECPOS: '%'D E C P O S ;
BIF_DIFF: '%'D I F F ;
BIF_DIV: '%'D I V ;
BIF_EDITC: '%'E D I T C ;
BIF_EDITFLT: '%'E D I T F L T ;
BIF_EDITW: '%'E D I T W ;
BIF_ELEM: '%'E L E M ;
BIF_EOF: '%'E O F ;
BIF_EQUAL: '%'E Q U A L ;
BIF_ERROR: '%'E R R O R ;
BIF_FIELDS: '%'F I E L D S ;
BIF_FLOAT: '%'F L O A T ;
BIF_FOUND: '%'F O U N D ;
BIF_GRAPH: '%'G R A P H ;
BIF_HANDLER: '%'H A N D L E R ;
BIF_HOURS: '%'H O U R S ;
BIF_INT: '%'I N T ;
BIF_INTH: '%'I N T H ;
BIF_KDS: '%'K D S ;
BIF_LEN: '%'L E N ;
BIF_LOOKUP: '%'L O O K U P ;
BIF_LOOKUPLT: '%'L O O K U P L T ;
BIF_LOOKUPLE: '%'L O O K U P L E ;
BIF_LOOKUPGT: '%'L O O K U P G T ;
BIF_LOOKUPGE: '%'L O O K U P G E ;
BIF_MINUTES: '%'M I N U T E S ;
BIF_MONTHS: '%'M O N T H S ;
BIF_MSECONDS: '%'M S E C O N D S ;
BIF_NULLIND: '%'N U L I N D ;
BIF_OCCUR: '%'O C U R ;
BIF_OPEN: '%'O P E N ;
BIF_PADDR: '%'P A D D R ;
BIF_PARMS: '%'P A R M S ;
BIF_PARMNUM: '%'P A R M N U M ;
BIF_REALLOC: '%'R E A L L O C ;
BIF_REM: '%'R E M ;
BIF_REPLACE: '%'R E P L A C E ;
BIF_SCAN: '%'S C A N ;
BIF_SCANRPL: '%'S C A N R P L ;
BIF_SECONDS: '%'S E C O N D ;
BIF_SHTDN: '%'S H T D N ;
BIF_SIZE: '%'S I Z E ;
BIF_SQRT: '%'S Q R T ;
BIF_STATUS: '%'S T A T U S ;
BIF_STR: '%'S T R ;
BIF_SUBARR: '%'S U B A R R ;
BIF_SUBDT: '%'S U B D T ;
BIF_SUBST: '%'S U B S T ;
BIF_THIS: '%'T H I S ;
BIF_TIME: '%'T I M E ;
BIF_TIMESTAMP: '%'T I M E S T A M P ;
BIF_TLOOKUP: '%'T L O O K U P ;
BIF_TLOOKUPLT: '%'T L O O K U P L T ;
BIF_TLOOKUPLE: '%'T L O O K U P L E ;
BIF_TLOOKUPGT: '%'T L O O K U P G T ;
BIF_TLOOKUPGE: '%'T L O O K U P G E ;
BIF_TRIM: '%'T R I M ;
BIF_TRIML: '%'T R I M L ;
BIF_TRIMR: '%'T R I M R ;
BIF_UCS2: '%'U C S '2';
BIF_UNS: '%'U N S ;
BIF_UNSH: '%'U N S H ;
BIF_XFOOT: '%'X F O O T ;
BIF_XLATE: '%'X L A T E ;
BIF_XML: '%'X M L ;
BIF_YEARS: '%'Y E A R S ;
// Symbolic Constants
SPLAT_ALL: '*'A L L ;
SPLAT_NONE: '*'N O N E ;
SPLAT_YES: '*'Y E S ;
SPLAT_NO: '*'N O ;
SPLAT_ILERPG: '*'I L E R P G ;
SPLAT_COMPAT: '*'C O M P A T ;
SPLAT_CRTBNDRPG: '*'C R T B N D R P G ;
SPLAT_CRTRPGMOD: '*'C R T R P G M O D ;
SPLAT_VRM: '*'V [0-9]R [0-9]M [0-9];
SPLAT_ALLG: '*'A L L G ;
SPLAT_ALLU: '*'A L L U ;
SPLAT_ALLTHREAD: '*'A L L T H R E A D ;
SPLAT_ALLX: '*'A L L X ;
SPLAT_BLANKS: ('*'B L A N K S | '*'B L A N K );
SPLAT_CANCL: '*'C A N C L ;
SPLAT_CYMD: '*'C Y M D ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_CMDY: '*'C M D Y ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_CDMY: '*'C D M Y ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_MDY: '*'M D Y ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_DMY: '*'D M Y ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_DFT: '*'D F T ;
SPLAT_YMD: '*'Y M D ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_JUL: '*'J U L ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_JAVA: '*'J A V A ;
SPLAT_ISO: '*'I S O ('0' | '-')?;
SPLAT_USA: '*'U S A ('0' | '/')?;
SPLAT_EUR: '*'E U R ('0' | '.')?;
SPLAT_JIS: '*'J I S ('0' | '-')?;
SPLAT_DATE: '*'D A T E ;
SPLAT_DAY: '*'D A Y ;
SPlAT_DETC: '*'D E T C ;
SPLAT_DETL: '*'D E T L ;
SPLAT_DTAARA: '*'D T A A R A ;
SPLAT_END: '*'E N D ;
SPLAT_ENTRY: '*'E N T R Y ;
SPLAT_EQUATE: '*'E Q U A T E ;
SPLAT_EXTDFT: '*'E X T D F T ;
SPLAT_EXT: '*'E X T ;
SPLAT_FILE: '*'F I L E ;
SPLAT_GETIN: '*'G E T I N ;
SPLAT_HIVAL: '*'H I V A L ;
SPLAT_INIT: '*'I N I T ;
SPLAT_INDICATOR: ('*'I N [0-9][0-9] | '*'I N '('[0-9][0-9]')');
SPLAT_INZSR: '*'I N Z S R ;
SPLAT_IN: '*'I N ;
SPLAT_INPUT: '*'I N P U T ;
SPLAT_OUTPUT: '*'O U T P U T ;
SPLAT_JOBRUN: '*'J O B R U N ;
SPLAT_JOB: '*'J O B ;
SPLAT_LDA: '*'L D A ;
SPLAT_LIKE: '*'L I K E ;
SPLAT_LONGJUL: '*'L O N G J U L ;
SPLAT_LOVAL: '*'L O V A L ;
SPLAT_KEY: '*'K E Y ;
SPLAT_MONTH: '*'M O N T H ;
SPLAT_NEXT: '*'N E X T ;
SPLAT_NOIND: '*'N O I N D ;
SPLAT_NOKEY: '*'N O K E Y ;
SPLAT_NULL: '*'N U L L ;
SPLAT_OFL: '*'O F L ;
SPLAT_ON: '*'O N ;
SPLAT_ONLY: '*'O N L Y ;
SPLAT_OFF: '*'O F F ;
SPLAT_PDA: '*'P D A ;
SPLAT_PLACE: '*'P L A C E ;
SPLAT_PSSR: '*'P S S R ;
SPLAT_ROUTINE: '*'R O U T I N E ;
SPLAT_START: '*'S T A R T ;
SPLAT_SYS: '*'S Y S ;
SPLAT_TERM: '*'T E R M ;
SPLAT_TOTC: '*'T O T C ;
SPLAT_TOTL: '*'T O T L ;
SPLAT_USER: '*'U S E R ;
SPLAT_VAR: '*'V A R ;
SPLAT_YEAR: '*'Y E A R ;
SPLAT_ZEROS: ('*'Z E R O S | '*'Z E R O );
SPLAT_HMS: '*'H M S ('0' | '/' | '-' | '.' | ',' | '&')?;
SPLAT_INLR: '*'I N L R ;
SPLAT_INOF: '*'I N O F ;
SPLAT_DATA: '*'D A T A ;
SPLAT_ASTFILL: '*'A S T F I L ;
SPLAT_CURSYM: '*'C U R S Y M ;
SPLAT_MAX: '*'M A X ;
SPLAT_LOCK: '*'L O C K ;
SPLAT_PROGRAM: '*'P R O G R A M ;
SPLAT_EXTDESC: '*'E X T D E S C ;
//Durations
SPLAT_D: '*'{getLastTokenType() == COLON}? D ;
SPLAT_H: '*'{getLastTokenType() == COLON}? H ;
SPLAT_HOURS: '*'{getLastTokenType() == COLON}? H O U R S ;
SPLAT_DAYS: '*' {getLastTokenType() == COLON}? D A Y S;
SPLAT_M: '*'{getLastTokenType() == COLON}? M ;
SPLAT_MINUTES: '*'{getLastTokenType() == COLON}? M I N U T E S ;
SPLAT_MONTHS: '*'{getLastTokenType() == COLON}? M O N T H S ;
SPLAT_MN: '*'{getLastTokenType() == COLON}? M N ; //Minutes
SPLAT_MS: '*'{getLastTokenType() == COLON}? M S ; //Minutes
SPLAT_MSECONDS: '*'{getLastTokenType() == COLON}? M S E C O N D S ;
SPLAT_S: '*'{getLastTokenType() == COLON}? S ;
SPLAT_SECONDS: '*'{getLastTokenType() == COLON}? S E C O N D S ;
SPLAT_Y: '*'{getLastTokenType() == COLON}? Y ;
SPLAT_YEARS: '*' {getLastTokenType() == COLON}? Y E A R S;
// Reserved Words
UDATE : U D A T E ;
DATE : '*' D A T E ;
UMONTH : U M O N T H ;
MONTH : '*' M O N T H ;
UYEAR : U Y E A R ;
YEAR : '*' Y E A R ;
UDAY : U D A Y ;
DAY : '*' D A Y ;
PAGE : P A G E [1-7]? ;
//DataType
CHAR: C H A R ;
VARCHAR: V A R C H A R ;
UCS2: U C S [2];
DATE_: D A T E ;
VARUCS2: V A R U C S [2];
GRAPH: G R A P H ;
VARGRAPH: V A R G R A P H ;
IND: I N D ;
PACKED: P A C K E D ;
ZONED: Z O N E D ;
BINDEC: B I N D E C ;
INT: I N T ;
UNS: U N S ;
FLOAT: F L O A T ;
TIME: T I M E ;
TIMESTAMP: T I M E S T A M P ;
POINTER: P O I N T E R ;
OBJECT: O B J E C T ;
// More Keywords
KEYWORD_ALIAS : A L I A S ;
KEYWORD_ALIGN : A L I G N ;
KEYWORD_ALT : A L T ;
KEYWORD_ALTSEQ : A L T S E Q ;
KEYWORD_ASCEND : A S C E N D ;
KEYWORD_BASED : B A S E D ;
KEYWORD_CCSID : C C S I D ;
KEYWORD_CLASS : C L A S S ;
KEYWORD_CONST : C O N S T ;
KEYWORD_CTDATA : C T D A T A ;
KEYWORD_DATFMT : D A T F M T ;
KEYWORD_DESCEND : D E S C E N D ;
KEYWORD_DIM : D I M ;
KEYWORD_DTAARA : D T A A R A ;
KEYWORD_EXPORT : E X P O R T ;
KEYWORD_EXT : E X T ;
KEYWORD_EXTFLD : E X T F L D ;
KEYWORD_EXTFMT : E X T F M T ;
KEYWORD_EXTNAME : E X T N A M E ;
KEYWORD_EXTPGM : E X T P G M ;
KEYWORD_EXTPROC : E X T P R O C ;
KEYWORD_FROMFILE : F R O M F I L E ;
KEYWORD_IMPORT : I M P O R T ;
KEYWORD_INZ : I N Z ;
KEYWORD_LEN : L E N ;
KEYWORD_LIKE : L I K E ;
KEYWORD_LIKEDS : L I K E D S ;
KEYWORD_LIKEFILE : L I K E F I L E ;
KEYWORD_LIKEREC : L I K E R E C ;
KEYWORD_NOOPT : N O O P T ;
KEYWORD_OCCURS : O C C U R S ;
KEYWORD_OPDESC : O P D E S C ;
KEYWORD_OPTIONS : O P T I O N S ;
KEYWORD_OVERLAY : O V E R L A Y ;
KEYWORD_PACKEVEN : P A C K E V E N ;
KEYWORD_PERRCD : P E R R C D ;
KEYWORD_PREFIX : P R E F I X ;
KEYWORD_POS : P O S ;
KEYWORD_PROCPTR : P R O C P T R ;
KEYWORD_QUALIFIED : Q U A L I F I E D ;
KEYWORD_RTNPARM : R T N P A R M ;
KEYWORD_STATIC : S T A T I C ;
KEYWORD_TEMPLATE : T E M P L A T E ;
KEYWORD_TIMFMT : T I M F M T ;
KEYWORD_TOFILE : T O F I L E ;
KEYWORD_VALUE : V A L U E ;
KEYWORD_VARYING : V A R Y I N G ;
// File spec keywords
KEYWORD_BLOCK : B L O C K ;
KEYWORD_COMMIT : C O M M I T ;
KEYWORD_DEVID : D E V I D ;
KEYWORD_EXTDESC : E X T D E S C ;
KEYWORD_EXTFILE : E X T F I L E ;
KEYWORD_EXTIND : E X T I N D ;
KEYWORD_EXTMBR : E X T M B R ;
KEYWORD_FORMLEN : F O R M L E N ;
KEYWORD_FORMOFL : F O R M O F L ;
KEYWORD_IGNORE : I G N O R E ;
KEYWORD_INCLUDE : I N C L U D E ;
KEYWORD_INDDS : I N D D S ;
KEYWORD_INFDS : I N F D S ;
KEYWORD_INFSR : I N F S R ;
KEYWORD_KEYLOC : K E Y L O C ;
KEYWORD_MAXDEV : M A X D E V ;
KEYWORD_OFLIND : O F L I N D ;
KEYWORD_PASS : P A S S ;
KEYWORD_PGMNAME : P G M N A M E ;
KEYWORD_PLIST : P L I S T ;
KEYWORD_PRTCTL : P R T C T L ;
KEYWORD_RAFDATA : R A F D A T A ;
KEYWORD_RECNO : R E C N O ;
KEYWORD_RENAME : R E N A M E ;
KEYWORD_SAVEDS : S A V E D S ;
KEYWORD_SAVEIND : S A V E I N D ;
KEYWORD_SFILE : S F I L E ;
KEYWORD_SLN : S L N ;
KEYWORD_SQLTYPE : S Q L T Y P E {_modeStack.contains(FIXED_DefSpec)}?;
KEYWORD_USROPN : U S R O P N ;
KEYWORD_DISK : D I S K ;
KEYWORD_WORKSTN : W O R K S T N ;
KEYWORD_PRINTER : P R I N T E R ;
KEYWORD_SPECIAL : S P E C I A L ;
KEYWORD_KEYED : K E Y E D ;
KEYWORD_USAGE : U S A G E ;
KEYWORD_PSDS: P S D S ;
AMPERSAND: '&';
// Boolean operators
AND : A N D ;
OR : O R ;
NOT : N O T ;
// Arithmetical Operators
PLUS : '+' ;
MINUS : '-' ;
EXP : '**' ;
ARRAY_REPEAT: {_input.LA(2) == ')' && _input.LA(-1) == '('}? '*' ;
MULT_NOSPACE: {_input.LA(2) != 32}? '*';
MULT: {_input.LA(2) == 32}? '*' ;
DIV : '/' ;
// Assignment Operators
CPLUS : '+=' ;
CMINUS : '-=' ;
CMULT : '*=' ;
CDIV : '/=' ;
CEXP : '**=' ;
// Comparison Operators
GT : '>' ;
LT : '<' ;
GE : '>=' ;
LE : '<=' ;
NE : '<>' ;
//--------------
//OP_E: '(' [aAdDeEhHmMnNpPrRtTzZ][aAdDeEhHmMnNpPrRtTzZ]? ')';
FREE_OPEN_PAREN: OPEN_PAREN -> type(OPEN_PAREN);
FREE_CLOSE_PAREN: CLOSE_PAREN -> type(CLOSE_PAREN);
FREE_DOT: '.';
FREE_NUMBER_CONT: NUMBER {_modeStack.peek()==FIXED_DefSpec}? -> pushMode(NumberContinuation),type(NUMBER);
FREE_NUMBER: NUMBER -> type(NUMBER);
EQUAL: '=';
FREE_COLON: COLON -> type(COLON);
FREE_BY: B Y ;
FREE_TO: T O ;
FREE_DOWNTO: D O W N T O ;
FREE_ID: ID -> type(ID);
//FREE_STRING: ['] ~[']* ['];
HexLiteralStart: X ['] -> pushMode(InStringMode) ;
DateLiteralStart: D ['] -> pushMode(InStringMode) ;
TimeLiteralStart: T ['] -> pushMode(InStringMode) ;
TimeStampLiteralStart: Z ['] -> pushMode(InStringMode) ;
GraphicLiteralStart: G ['] -> pushMode(InStringMode) ;
UCS2LiteralStart: U ['] -> pushMode(InStringMode) ;
StringLiteralStart: ['] -> pushMode(InStringMode) ;
FREE_COMMENTS: [ ]*? '//' {getCharPositionInLine()>=8}? -> pushMode(FIXED_CommentMode_HIDDEN),channel(HIDDEN) ;
FREE_WS: [ \t] {getCharPositionInLine()>6}? [ \t]* -> skip;
FREE_CONTINUATION : '...'
{_modeStack.peek()!=FIXED_CalcSpec && _modeStack.peek()!=FIXED_DefSpec}?
WS* NEWLINE -> type(CONTINUATION);
C_FREE_CONTINUATION_DOTS : '...' {_modeStack.peek()==FIXED_CalcSpec}? WS* NEWLINE
(WORD5 C ~[*] ' ') {setText("...");} -> type(CONTINUATION);
D_FREE_CONTINUATION_DOTS : '...' {_modeStack.peek()==FIXED_DefSpec}? WS* NEWLINE
(WORD5 D ~[*] ' ') {setText("...");} -> type(CONTINUATION);
C_FREE_CONTINUATION: NEWLINE {_modeStack.peek()==FIXED_CalcSpec}?
(
(WORD5 ~[\r\n] [*] ~[\r\n]* NEWLINE) //Skip mid statement comments
| (WORD5 ~[\r\n] [ ]* NEWLINE) //Skip mid statement blanks
)*
WORD5 C ~[*] ' ' -> skip;
D_FREE_CONTINUATION: NEWLINE {_modeStack.peek() == FIXED_DefSpec}?
WORD5 D ~[*] ' ' -> skip;
F_FREE_CONTINUATION: NEWLINE {_modeStack.peek() == FIXED_FileSpec}?
WORD5 F ~[*] ' ' -> skip;
FREE_LEAD_WS5 : ' ' {getCharPositionInLine()==5}? -> skip;
FREE_LEAD_WS5_Comments : WORD5 {getCharPositionInLine()==5}? -> channel(HIDDEN);
FREE_FREE_SPEC : [ ][ ] {getCharPositionInLine()==7}? -> skip;
C_FREE_NEWLINE: NEWLINE {_modeStack.peek()==FIXED_CalcSpec}? -> popMode,popMode;
O_FREE_NEWLINE: NEWLINE {_modeStack.peek()==FIXED_OutputSpec_PGMFIELD}? -> type(EOL),popMode,popMode,popMode;
D_FREE_NEWLINE: NEWLINE {_modeStack.peek() == FIXED_DefSpec}? -> type(EOL),popMode,popMode;
F_FREE_NEWLINE: NEWLINE {_modeStack.peek() == FIXED_FileSpec}? -> type(EOL),popMode,popMode;
FREE_NEWLINE: NEWLINE {_modeStack.peek()!=FIXED_CalcSpec}? -> skip,popMode;
FREE_SEMI: SEMI -> popMode, pushMode(FREE_ENDED); //Captures // immediately following the semi colon
mode NumberContinuation;
NumberContinuation_CONTINUATION: ([ ]* NEWLINE)
WORD5 D ~[*] ' ' [ ]* -> skip;
NumberPart: NUMBER -> popMode;
NumberContinuation_ANY: -> popMode,skip;
mode FixedOpCodes; //Referenced (not used)
OP_ADD: A D D ;
OP_ADDDUR: OP_ADD D U R ;
OP_ALLOC: A L L O C ;
OP_ANDxx: A N D [0-9][0-9];
OP_ANDEQ: A N D E Q ;
OP_ANDNE: A N D N E ;
OP_ANDLE: A N D L E ;
OP_ANDLT: A N D L T ;
OP_ANDGE: A N D G E ;
OP_ANDGT: A N D G T ;
OP_BITOFF: B I T O F F ;
OP_BITON: B I T O N ;
OP_CABxx: C A B [0-9][0-9];
OP_CABEQ: C A B E Q ;
OP_CABNE: C A B N E ;
OP_CABLE: C A B L E ;
OP_CABLT: C A B L T ;
OP_CABGE: C A B G E ;
OP_CABGT: C A B G T ;
OP_CALL: C A L L ;
OP_CALLB: OP_CALL B ;
OP_CASEQ: C A S E Q ;
OP_CASNE: C A S N E ;
OP_CASLE: C A S L E ;
OP_CASLT: C A S L T ;
OP_CASGE: C A S G E ;
OP_CASGT: C A S G T ;
OP_CAS: C A S ;
OP_CAT: C A T ;
OP_CHECK: C H E C K ;
OP_CHECKR: C H E C K R ;
OP_COMP: C O M P ;
OP_DEFINE: D E F I N E ;
OP_DIV: D I V ;
OP_DO: D O ;
OP_DOUEQ: D O U E Q ;
OP_DOUNE: D O U N E ;
OP_DOULE: D O U L E ;
OP_DOULT: D O U L T ;
OP_DOUGE: D O U G E ;
OP_DOUGT: D O U G T ;
OP_DOWEQ: D O W E Q ;
OP_DOWNE: D O W N E ;
OP_DOWLE: D O W L E ;
OP_DOWLT: D O W L T ;
OP_DOWGE: D O W G E ;
OP_DOWGT: D O W G T ;
OP_END: E N D ;
OP_ENDCS: E N D C S ;
OP_EXTRCT: E X T R C T ;
OP_GOTO: G O T O ;
OP_IFEQ: I F E Q ;
OP_IFNE: I F N E ;
OP_IFLE: I F L E ;
OP_IFLT: I F L T ;
OP_IFGE: I F G E ;
OP_IFGT: I F G T ;
OP_KFLD: K F L D ;
OP_KLIST: K L I S T ;
OP_LOOKUP: L O O K U P ;
OP_MHHZO: M H H Z O ;
OP_MHLZO: M H L Z O ;
OP_MLHZO: M L H Z O ;
OP_MLLZO: M L L Z O ;
OP_MOVE: M O V E ;
OP_MOVEA: M O V E A ;
OP_MOVEL: M O V E L ;
OP_MULT: M U L T ;
OP_MVR: M V R ;
OP_OCCUR: O C C U R ;
OP_OREQ: O R E Q ;
OP_ORNE: O R N E ;
OP_ORLE: O R L E ;
OP_ORLT: O R L T ;
OP_ORGE: O R G E ;
OP_ORGT: O R G T ;
OP_PARM: P A R M ;
OP_PLIST: P L I S T ;
OP_REALLOC: R E A L L O C ;
OP_SCAN: S C A N ;
OP_SETOFF: S E T O F F ;
OP_SETON: S E T O N ;
OP_SHTDN: S H T D N ;
OP_SQRT: S Q R T ;
OP_SUB: S U B ;
OP_SUBDUR: S U B D U R ;
OP_SUBST: S U B S T ;
OP_TAG: T A G ;
OP_TESTB: T E S T B ;
OP_TESTN: T E S T N ;
OP_TESTZ: T E S T Z ;
OP_TIME: T I M E ;
OP_WHENEQ: W H E N E Q ;
OP_WHENNE: W H E N N E ;
OP_WHENLE: W H E N L E ;
OP_WHENLT: W H E N L T ;
OP_WHENGE: W H E N G E ;
OP_WHENGT: W H E N G T ;
OP_XFOOT: X F O O T ;
OP_XLATE: X L A T E ;
OP_Z_ADD: Z '-'A D D ;
OP_Z_SUB: Z '-'S U B ;
mode FREE_ENDED;
FE_BLANKS : [ ]+ -> skip;
FE_COMMENTS: '//' -> popMode,pushMode(FIXED_CommentMode_HIDDEN),channel(HIDDEN) ;
FE_NEWLINE : NEWLINE -> popMode,skip;
mode InStringMode;
// Any char except +,- or ', or a + or - followed by more than just whitespace
StringContent: (
~['\r\n+-]
| [+-] [ ]* {_input.LA(1)!=' ' && _input.LA(1)!='\r' && _input.LA(1)!='\n'}? // Plus is ok as long as it's not the last char
)+;// space or not
StringEscapedQuote: [']['] {setText("'");};
StringLiteralEnd: ['] -> popMode;
FIXED_FREE_STRING_CONTINUATION: ('+' [ ]* NEWLINE)
{_modeStack.contains(FIXED_CalcSpec) || _modeStack.contains(FIXED_DefSpec)
|| _modeStack.contains(FIXED_OutputSpec)}?
-> pushMode(EatCommentLinesPlus),pushMode(EatCommentLines),skip;
FIXED_FREE_STRING_CONTINUATION_MINUS: ('-' [ ]* NEWLINE)
{_modeStack.contains(FIXED_CalcSpec) || _modeStack.contains(FIXED_DefSpec)
|| _modeStack.contains(FIXED_OutputSpec)}?
-> pushMode(EatCommentLines),skip;
FREE_STRING_CONTINUATION: {!_modeStack.contains(FIXED_CalcSpec)
&& !_modeStack.contains(FIXED_DefSpec)
&& !_modeStack.contains(FIXED_OutputSpec)}?
'+' [ ]* NEWLINE ' ' [ ]* -> skip;
FREE_STRING_CONTINUATION_MINUS: {!_modeStack.contains(FIXED_CalcSpec)
&& !_modeStack.contains(FIXED_DefSpec)
&& !_modeStack.contains(FIXED_OutputSpec)}?
'-' [ ]* NEWLINE ' ' -> skip;
PlusOrMinus: [+-];
mode InDoubleStringMode;
// Any char except +,- or ", or a + or - followed by more than just whitespace
DblStringContent: ~["\r\n]+ -> type(StringContent);
DblStringLiteralEnd: ["] -> popMode,type(StringLiteralEnd);
//This mode is basically a language independent flag.
mode EatCommentLinesPlus;
EatCommentLinesPlus_Any: -> popMode,skip;
// Inside continuations, ignore comment and blank lines.
mode EatCommentLines;
EatCommentLines_WhiteSpace: WORD5~[\r\n]{getCharPositionInLine()==6}?[ ]* NEWLINE -> skip;
EatCommentLines_StarComment:
WORD5~[\r\n]{getCharPositionInLine()==6}? [*] ~[\r\n]* NEWLINE -> skip;
FIXED_FREE_STRING_CONTINUATION_Part2:
(
WORD5
( C {_modeStack.contains(FIXED_CalcSpec)}?
| D {_modeStack.contains(FIXED_DefSpec)}?
| O {_modeStack.contains(FIXED_OutputSpec)}?
)
~[*]
( ' ' {_modeStack.contains(FIXED_CalcSpec)}?
| ' ' {_modeStack.contains(FIXED_DefSpec)}?
| ' ' {_modeStack.contains(FIXED_OutputSpec)}?
)
([ ]* {_modeStack.peek() == EatCommentLinesPlus}?
|
) // If it plus continuation eat whitespace.
)
-> type(CONTINUATION),skip ;
//Deliberate match no char, pop out again
EatCommentLines_NothingLeft: -> popMode,skip;
mode InFactorStringMode;
InFactor_StringContent:(
~[\r\n']
{(getCharPositionInLine()>=12 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=36 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=50 && getCharPositionInLine()<=63)
}?
)+ -> type(StringContent);
InFactor_StringEscapedQuote: ['][']
{(getCharPositionInLine()>=12 && getCharPositionInLine()<=24)
|| (getCharPositionInLine()>=36 && getCharPositionInLine()<=48)
|| (getCharPositionInLine()>=50 && getCharPositionInLine()<=62)
}?
-> type(StringEscapedQuote);
InFactor_StringLiteralEnd: [']
{(getCharPositionInLine()>=12 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=36 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=50 && getCharPositionInLine()<=63)
}?
-> type(StringLiteralEnd),popMode;
InFactor_EndFactor: {(getCharPositionInLine()==25)
|| (getCharPositionInLine()==49)
|| (getCharPositionInLine()==61)
}? -> skip,popMode;
// ----------------------------------------------
mode FIXED_CommentMode;
BLANK_COMMENTS_TEXT : [ ]+ -> skip;
COMMENTS_TEXT : ~[\r\n]+ {setText(getText().trim());} -> channel(HIDDEN);
COMMENTS_EOL : NEWLINE -> popMode,skip;
mode FIXED_CommentMode_HIDDEN;
COMMENTS_TEXT_SKIP : [ ]+ -> skip;
COMMENTS_TEXT_HIDDEN : ~[\r\n]* -> channel(HIDDEN);
COMMENTS_EOL_HIDDEN : NEWLINE -> channel(HIDDEN),popMode;
mode SQL_MODE;
SQL_WS: [ \t\r\n]+ -> skip;
//SINGLE_QTE: ['];
//DOUBLE_QTE: ["];
SEMI_COLON: SEMI -> type(SEMI),popMode, popMode;
WORDS: ~[ ;\r\n] (~[;\r\n]+ ~[ ;\r\n])?;
// ----------------- Everything FIXED_ProcedureSpec of a tag ---------------------
mode FIXED_ProcedureSpec;
PS_NAME : NAME5 NAME5 NAME5 {getCharPositionInLine()==21}? {setText(getText().trim());};
PS_CONTINUATION_NAME : [ ]* ~[\r\n ]+ PS_CONTINUATION {setText(getText().substring(0,getText().length()-3));} -> pushMode(CONTINUATION_ELIPSIS) ;
PS_CONTINUATION : '...' ;
PS_RESERVED1: ' ' {getCharPositionInLine()==23}? -> skip;
PS_BEGIN: B {getCharPositionInLine()==24}?;
PS_END: E {getCharPositionInLine()==24}?;
PS_RESERVED2: ' ' {getCharPositionInLine()==43}? -> skip;
PS_KEYWORDS : ~[\r\n] {getCharPositionInLine()==44}? (~[\r\n] {getCharPositionInLine()<=80}?)*;
PS_WS80 : [ ] {getCharPositionInLine()>80}? [ ]* NEWLINE -> skip;
PS_COMMENTS80: FREE_COMMENTS80-> channel(HIDDEN),popMode;
PS_Any: -> popMode,skip;
// ----------------- Everything FIXED_DefSpec of a tag ---------------------
mode FIXED_DefSpec;
BLANK_SPEC :
' '
{getCharPositionInLine()==81}?;
CONTINUATION_NAME : {getCharPositionInLine()<21}? [ ]* NAMECHAR+ CONTINUATION {setText(getText().substring(0,getText().length()-3).trim());} -> pushMode(CONTINUATION_ELIPSIS) ;
CONTINUATION : '...' ;
NAME : NAME5 NAME5 NAME5 {getCharPositionInLine()==21}? {setText(getText().trim());};
EXTERNAL_DESCRIPTION: [eE ] {getCharPositionInLine()==22}? ;
DATA_STRUCTURE_TYPE: [sSuU ] {getCharPositionInLine()==23}? ;
DEF_TYPE_C: C [ ] {getCharPositionInLine()==25}?;
DEF_TYPE_PI: P I {getCharPositionInLine()==25}?;
DEF_TYPE_PR: P R {getCharPositionInLine()==25}?;
DEF_TYPE_DS: D S {getCharPositionInLine()==25}?;
DEF_TYPE_S: S [ ] {getCharPositionInLine()==25}?;
DEF_TYPE_BLANK: [ ][ ] {getCharPositionInLine()==25}?;
DEF_TYPE: [a-zA-Z0-9 ][a-zA-Z0-9 ] {getCharPositionInLine()==25}?;
FROM_POSITION: WORD5 [a-zA-Z0-9+\- ][a-zA-Z0-9 ]{getCharPositionInLine()==32}?;
TO_POSITION: WORD5[a-zA-Z0-9+\- ][a-zA-Z0-9 ]{getCharPositionInLine()==39}? ;
DATA_TYPE: [a-zA-Z* ]{getCharPositionInLine()==40}? ;
DECIMAL_POSITIONS: [0-9+\- ][0-9 ]{getCharPositionInLine()==42}? ;
RESERVED : ' ' {getCharPositionInLine()==43}? -> pushMode(FREE);
//KEYWORDS : ~[\r\n] {getCharPositionInLine()==44}? ~[\r\n]* ;
D_WS : [ \t] {getCharPositionInLine()>=81}? [ \t]* -> skip ; // skip spaces, tabs, newlines
D_COMMENTS80 : ~[\r\n] {getCharPositionInLine()>=81}? ~[\r\n]* -> channel(HIDDEN); // skip comments after 80
EOL : NEWLINE -> popMode;
mode CONTINUATION_ELIPSIS;
CE_WS: WS ->skip;
CE_COMMENTS80 : ~[\r\n ] {getCharPositionInLine()>=81}? ~[\r\n]* -> channel(HIDDEN); // skip comments after 80
CE_LEAD_WS5 : LEAD_WS5 ->skip;
CE_LEAD_WS5_Comments : LEAD_WS5_Comments -> channel(HIDDEN);
CE_D_SPEC_FIXED : D {_modeStack.peek()==FIXED_DefSpec && getCharPositionInLine()==6}? -> skip,popMode ;
CE_P_SPEC_FIXED : P {_modeStack.peek()==FIXED_ProcedureSpec && getCharPositionInLine()==6}? -> skip,popMode ;
CE_NEWLINE: NEWLINE ->skip;
// ----------------- Everything FIXED_FileSpec of a tag ---------------------
mode FIXED_FileSpec;
FS_BLANK_SPEC : BLANK_SPEC -> type(BLANK_SPEC);
FS_RecordName : WORD5 WORD5 {getCharPositionInLine()==16}? ;
FS_Type: [a-zA-Z ] {getCharPositionInLine()==17}?;
FS_Designation: [a-zA-Z ] {getCharPositionInLine()==18}? ;
FS_EndOfFile: [eE ] {getCharPositionInLine()==19}?;
FS_Addution: [aA ] {getCharPositionInLine()==20}?;
FS_Sequence: [aAdD ] {getCharPositionInLine()==21}?;
FS_Format: [eEfF ] {getCharPositionInLine()==22}?;
FS_RecordLength: WORD5 {getCharPositionInLine()==27}?;
FS_Limits: [lL ] {getCharPositionInLine()==28}?;
FS_LengthOfKey: [0-9 ][0-9 ][0-9 ][0-9 ][0-9 ] {getCharPositionInLine()==33}?;
FS_RecordAddressType: [a-zA-Z ] {getCharPositionInLine()==34}?;
FS_Organization: [a-zA-Z ] {getCharPositionInLine()==35}?;
FS_Device: WORD5 [a-zA-Z ][a-zA-Z ] {getCharPositionInLine()==42}?;
FS_Reserved: [ ] {getCharPositionInLine()==43}? -> pushMode(FREE);
FS_WhiteSpace : [ \t] {getCharPositionInLine()>80}? [ \t]* -> skip ; // skip spaces, tabs, newlines
FS_EOL : NEWLINE -> type(EOL),popMode;
mode FIXED_OutputSpec;
OS_BLANK_SPEC : BLANK_SPEC -> type(BLANK_SPEC);
OS_RecordName : WORD5 WORD5 {getCharPositionInLine()==16}?;
OS_AndOr: ' ' (A N D | O R ' ') ' ' ->
pushMode(OnOffIndicatorMode),pushMode(OnOffIndicatorMode),pushMode(OnOffIndicatorMode);
OS_FieldReserved: ' ' {getCharPositionInLine()==20}?
-> pushMode(FIXED_OutputSpec_PGMFIELD),
pushMode(OnOffIndicatorMode),pushMode(OnOffIndicatorMode),pushMode(OnOffIndicatorMode);
OS_Type: [a-zA-Z ] {getCharPositionInLine()==17}?;
OS_AddDelete: ( A D D | D E L ) {getCharPositionInLine()==20}? -> pushMode(FIXED_OutputSpec_PGM1),
pushMode(OnOffIndicatorMode),pushMode(OnOffIndicatorMode),pushMode(OnOffIndicatorMode);
OS_FetchOverflow: (' ' | [fFrR]) ' ' {getCharPositionInLine()==20}? -> pushMode(OnOffIndicatorMode),
pushMode(OnOffIndicatorMode),pushMode(OnOffIndicatorMode);
OS_ExceptName: WORD5 WORD5 {getCharPositionInLine()==39}?;
OS_Space3: [ 0-9][ 0-9][ 0-9] {getCharPositionInLine()==42 || getCharPositionInLine()==45
|| getCharPositionInLine()==48 || getCharPositionInLine()==51}? ;
OS_RemainingSpace: ' ' {getCharPositionInLine()==80}?;
OS_Comments : CS_Comments -> channel(HIDDEN); // skip comments after 80
OS_WS : [ \t] {getCharPositionInLine()>80}? [ \t]* -> type(WS),skip ; // skip spaces, tabs, newlines
OS_EOL : NEWLINE -> type(EOL),popMode;//,skip;
mode FIXED_OutputSpec_PGM1;
O1_ExceptName: WORD5 WORD5 {getCharPositionInLine()==39}? -> type(OS_ExceptName);
O1_RemainingSpace: ' ' {getCharPositionInLine()==80}?
-> type(OS_RemainingSpace),popMode;
mode FIXED_OutputSpec_PGMFIELD;
OS_FieldName: WORD5 WORD5 ~[\r\n] ~[\r\n] ~[\r\n] ~[\r\n] {getCharPositionInLine()==43}? ;
OS_EditNames: [ 0-9A-Za-z] {getCharPositionInLine()==44}?;
OS_BlankAfter: [ bB] {getCharPositionInLine()==45}?;
OS_Reserved1: [ ] {getCharPositionInLine()==46}?-> skip;
OS_EndPosition: WORD5 {getCharPositionInLine()==51}?;
OS_DataFormat: [ 0-9A-Za-z] {getCharPositionInLine()==52}? -> pushMode(FREE);
OS_Any: -> popMode;
mode FIXED_CalcSpec;
// Symbolic Constants
CS_Factor1_SPLAT_ALL : SPLAT_ALL {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ALL);
CS_Factor1_SPLAT_NONE : SPLAT_NONE {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_NONE);
CS_Factor1_SPLAT_ILERPG : SPLAT_ILERPG {11+7<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ILERPG);
CS_Factor1_SPLAT_CRTBNDRPG : SPLAT_CRTBNDRPG {11+10<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_CRTBNDRPG);
CS_Factor1_SPLAT_CRTRPGMOD : SPLAT_CRTRPGMOD {11+10<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_CRTRPGMOD);
CS_Factor1_SPLAT_VRM : SPLAT_VRM{11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_VRM);
CS_Factor1_SPLAT_ALLG : SPLAT_ALLG {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ALLG);
CS_Factor1_SPLAT_ALLU : SPLAT_ALLU {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ALLU);
CS_Factor1_SPLAT_ALLX : SPLAT_ALLX {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ALLX);
CS_Factor1_SPLAT_BLANKS : SPLAT_BLANKS {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_BLANKS);
CS_Factor1_SPLAT_CANCL : SPLAT_CANCL {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_CANCL);
CS_Factor1_SPLAT_CYMD : SPLAT_CYMD {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_CYMD);
CS_Factor1_SPLAT_CMDY : SPLAT_CMDY {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_CMDY);
CS_Factor1_SPLAT_CDMY : SPLAT_CDMY {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_CDMY);
CS_Factor1_SPLAT_MDY : SPLAT_MDY {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_MDY);
CS_Factor1_SPLAT_DMY : SPLAT_DMY {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_DMY);
CS_Factor1_SPLAT_YMD : SPLAT_YMD {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_YMD);
CS_Factor1_SPLAT_JUL : SPLAT_JUL {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_JUL);
CS_Factor1_SPLAT_ISO : SPLAT_ISO {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ISO);
CS_Factor1_SPLAT_USA : SPLAT_USA {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_USA);
CS_Factor1_SPLAT_EUR : SPLAT_EUR {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_EUR);
CS_Factor1_SPLAT_JIS : SPLAT_JIS {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_JIS);
CS_Factor1_SPLAT_DATE : SPLAT_DATE {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_DATE);
CS_Factor1_SPLAT_DAY : SPLAT_DAY {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_DAY);
CS_Factor1_SPLAT_DETC : SPlAT_DETC {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPlAT_DETC);
CS_Factor1_SPLAT_DETL : SPLAT_DETL {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_DETL);
CS_Factor1_SPLAT_DTAARA : SPLAT_DTAARA {11+7<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_DTAARA);
CS_Factor1_SPLAT_END : SPLAT_END {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_END);
CS_Factor1_SPLAT_ENTRY : SPLAT_ENTRY {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ENTRY);
CS_Factor1_SPLAT_EQUATE : SPLAT_EQUATE {11+7<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_EQUATE);
CS_Factor1_SPLAT_EXTDFT : SPLAT_EXTDFT {11+7<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_EXTDFT);
CS_Factor1_SPLAT_EXT : SPLAT_EXT {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_EXT);
CS_Factor1_SPLAT_FILE : SPLAT_FILE {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_FILE);
CS_Factor1_SPLAT_GETIN : SPLAT_GETIN {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_GETIN);
CS_Factor1_SPLAT_HIVAL : SPLAT_HIVAL {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_HIVAL);
CS_Factor1_SPLAT_INIT : SPLAT_INIT {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_INIT);
CS_Factor1_SPLAT_INDICATOR : SPLAT_INDICATOR {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_INDICATOR);
CS_Factor1_SPLAT_INZSR : SPLAT_INZSR {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_INZSR);
CS_Factor1_SPLAT_IN : SPLAT_IN {11+3<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_IN);
CS_Factor1_SPLAT_JOBRUN : SPLAT_JOBRUN {11+7<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_JOBRUN);
CS_Factor1_SPLAT_JOB : SPLAT_JOB {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_JOB);
CS_Factor1_SPLAT_LDA : SPLAT_LDA {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_LDA);
CS_Factor1_SPLAT_LIKE : SPLAT_LIKE {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_LIKE);
CS_Factor1_SPLAT_LONGJUL : SPLAT_LONGJUL {11+8<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_LONGJUL);
CS_Factor1_SPLAT_LOVAL : SPLAT_LOVAL {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_LOVAL);
CS_Factor1_SPLAT_MONTH : SPLAT_MONTH {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_MONTH);
CS_Factor1_SPLAT_NOIND : SPLAT_NOIND {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_NOIND);
CS_Factor1_SPLAT_NOKEY : SPLAT_NOKEY {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_NOKEY);
CS_Factor1_SPLAT_NULL : SPLAT_NULL {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_NULL);
CS_Factor1_SPLAT_OFL : SPLAT_OFL {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_OFL);
CS_Factor1_SPLAT_ON : SPLAT_ON {11+3<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ON);
CS_Factor1_SPLAT_OFF : SPLAT_OFF {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_OFF);
CS_Factor1_SPLAT_PDA : SPLAT_PDA {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_PDA);
CS_Factor1_SPLAT_PLACE : SPLAT_PLACE {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_PLACE);
CS_Factor1_SPLAT_PSSR : SPLAT_PSSR {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_PSSR);
CS_Factor1_SPLAT_ROUTINE : SPLAT_ROUTINE {11+8<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ROUTINE);
CS_Factor1_SPLAT_START : SPLAT_START {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_START);
CS_Factor1_SPLAT_SYS : SPLAT_SYS {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_SYS);
CS_Factor1_SPLAT_TERM : SPLAT_TERM {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_TERM);
CS_Factor1_SPLAT_TOTC : SPLAT_TOTC {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_TOTC);
CS_Factor1_SPLAT_TOTL : SPLAT_TOTL {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_TOTL);
CS_Factor1_SPLAT_USER : SPLAT_USER {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_USER);
CS_Factor1_SPLAT_VAR : SPLAT_VAR {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_VAR);
CS_Factor1_SPLAT_YEAR : SPLAT_YEAR {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_YEAR);
CS_Factor1_SPLAT_ZEROS : SPLAT_ZEROS {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_ZEROS);
CS_Factor1_SPLAT_HMS : SPLAT_HMS {11+4<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_HMS);
CS_Factor1_SPLAT_INLR : SPLAT_INLR {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_INLR);
CS_Factor1_SPLAT_INOF : SPLAT_INOF {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_INOF);
//DurationCodes
CS_Factor1_SPLAT_D : SPLAT_D {11+2<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_D);
CS_Factor1_SPLAT_DAYS : SPLAT_DAYS {11+5<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_DAYS);
CS_Factor1_SPLAT_H : SPLAT_H {11+2<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_H);
CS_Factor1_SPLAT_HOURS : SPLAT_HOURS {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_HOURS);
CS_Factor1_SPLAT_MINUTES : SPLAT_MINUTES {11+8<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_MINUTES);
CS_Factor1_SPLAT_MONTHS : SPLAT_MONTHS {11+7<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_MONTHS);
CS_Factor1_SPLAT_M : SPLAT_M {11+2<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_M);
CS_Factor1_SPLAT_MN : SPLAT_MN {11+3<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_MN);
CS_Factor1_SPLAT_MS : SPLAT_MS {11+3<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_MS);
CS_Factor1_SPLAT_MSECONDS : SPLAT_MSECONDS {11+9<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_MSECONDS);
CS_Factor1_SPLAT_SECONDS : SPLAT_SECONDS {11+8<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_SECONDS);
CS_Factor1_SPLAT_YEARS : SPLAT_YEARS {11+6<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_YEARS);
CS_Factor1_SPLAT_Y : SPLAT_Y {11+2<= getCharPositionInLine() && getCharPositionInLine()<=24}? -> type(SPLAT_Y);
//Factor 2
CS_Factor2_SPLAT_ALL : SPLAT_ALL {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ALL);
CS_Factor2_SPLAT_NONE : SPLAT_NONE {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_NONE);
CS_Factor2_SPLAT_ILERPG : SPLAT_ILERPG {35+7<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ILERPG);
CS_Factor2_SPLAT_CRTBNDRPG : SPLAT_CRTBNDRPG {35+10<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_CRTBNDRPG);
CS_Factor2_SPLAT_CRTRPGMOD : SPLAT_CRTRPGMOD {35+10<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_CRTRPGMOD);
CS_Factor2_SPLAT_VRM : SPLAT_VRM {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_VRM);
CS_Factor2_SPLAT_ALLG : SPLAT_ALLG {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ALLG);
CS_Factor2_SPLAT_ALLU : SPLAT_ALLU {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ALLU);
CS_Factor2_SPLAT_ALLX : SPLAT_ALLX {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ALLX);
CS_Factor2_SPLAT_BLANKS : SPLAT_BLANKS {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_BLANKS);
CS_Factor2_SPLAT_CANCL : SPLAT_CANCL {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_CANCL);
CS_Factor2_SPLAT_CYMD : SPLAT_CYMD {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_CYMD);
CS_Factor2_SPLAT_CMDY : SPLAT_CMDY {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_CMDY);
CS_Factor2_SPLAT_CDMY : SPLAT_CDMY {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_CDMY);
CS_Factor2_SPLAT_MDY : SPLAT_MDY {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_MDY);
CS_Factor2_SPLAT_DMY : SPLAT_DMY {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_DMY);
CS_Factor2_SPLAT_YMD : SPLAT_YMD {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_YMD);
CS_Factor2_SPLAT_JUL : SPLAT_JUL {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_JUL);
CS_Factor2_SPLAT_ISO : SPLAT_ISO {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ISO);
CS_Factor2_SPLAT_USA : SPLAT_USA {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_USA);
CS_Factor2_SPLAT_EUR : SPLAT_EUR {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_EUR);
CS_Factor2_SPLAT_JIS : SPLAT_JIS {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_JIS);
CS_Factor2_SPLAT_DATE : SPLAT_DATE {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_DATE);
CS_Factor2_SPLAT_DAY : SPLAT_DAY {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_DAY);
CS_Factor2_SPLAT_DETC : SPlAT_DETC {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPlAT_DETC);
CS_Factor2_SPLAT_DETL : SPLAT_DETL {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_DETL);
CS_Factor2_SPLAT_DTAARA : SPLAT_DTAARA {35+7<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_DTAARA);
CS_Factor2_SPLAT_END : SPLAT_END {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_END);
CS_Factor2_SPLAT_ENTRY : SPLAT_ENTRY {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ENTRY);
CS_Factor2_SPLAT_EQUATE : SPLAT_EQUATE {35+7<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_EQUATE);
CS_Factor2_SPLAT_EXTDFT : SPLAT_EXTDFT {35+7<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_EXTDFT);
CS_Factor2_SPLAT_EXT : SPLAT_EXT {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_EXT);
CS_Factor2_SPLAT_FILE : SPLAT_FILE {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_FILE);
CS_Factor2_SPLAT_GETIN : SPLAT_GETIN {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_GETIN);
CS_Factor2_SPLAT_HIVAL : SPLAT_HIVAL {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_HIVAL);
CS_Factor2_SPLAT_INIT : SPLAT_INIT {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_INIT);
CS_Factor2_SPLAT_INDICATOR : SPLAT_INDICATOR {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_INDICATOR);
CS_Factor2_SPLAT_INZSR : SPLAT_INZSR {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_INZSR);
CS_Factor2_SPLAT_IN : SPLAT_IN {35+3<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_IN);
CS_Factor2_SPLAT_JOBRUN : SPLAT_JOBRUN {35+7<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_JOBRUN);
CS_Factor2_SPLAT_JOB : SPLAT_JOB {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_JOB);
CS_Factor2_SPLAT_LDA : SPLAT_LDA {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_LDA);
CS_Factor2_SPLAT_LIKE : SPLAT_LIKE {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_LIKE);
CS_Factor2_SPLAT_LONGJUL : SPLAT_LONGJUL {35+8<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_LONGJUL);
CS_Factor2_SPLAT_LOVAL : SPLAT_LOVAL {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_LOVAL);
CS_Factor2_SPLAT_MONTH : SPLAT_MONTH {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_MONTH);
CS_Factor2_SPLAT_NOIND : SPLAT_NOIND {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_NOIND);
CS_Factor2_SPLAT_NOKEY : SPLAT_NOKEY {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_NOKEY);
CS_Factor2_SPLAT_NULL : SPLAT_NULL {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_NULL);
CS_Factor2_SPLAT_OFL : SPLAT_OFL {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_OFL);
CS_Factor2_SPLAT_ON : SPLAT_ON {35+3<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ON);
CS_Factor2_SPLAT_OFF : SPLAT_OFF {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_OFF);
CS_Factor2_SPLAT_PDA : SPLAT_PDA {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_PDA);
CS_Factor2_SPLAT_PLACE : SPLAT_PLACE {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_PLACE);
CS_Factor2_SPLAT_PSSR : SPLAT_PSSR {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_PSSR);
CS_Factor2_SPLAT_ROUTINE : SPLAT_ROUTINE {35+8<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ROUTINE);
CS_Factor2_SPLAT_START : SPLAT_START {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_START);
CS_Factor2_SPLAT_SYS : SPLAT_SYS {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_SYS);
CS_Factor2_SPLAT_TERM : SPLAT_TERM {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_TERM);
CS_Factor2_SPLAT_TOTC : SPLAT_TOTC {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_TOTC);
CS_Factor2_SPLAT_TOTL : SPLAT_TOTL {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_TOTL);
CS_Factor2_SPLAT_USER : SPLAT_USER {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_USER);
CS_Factor2_SPLAT_VAR : SPLAT_VAR {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_VAR);
CS_Factor2_SPLAT_YEAR : SPLAT_YEAR {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_YEAR);
CS_Factor2_SPLAT_ZEROS : SPLAT_ZEROS {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_ZEROS);
CS_Factor2_SPLAT_HMS : SPLAT_HMS {35+4<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_HMS);
CS_Factor2_SPLAT_INLR : SPLAT_INLR {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_INLR);
CS_Factor2_SPLAT_INOF : SPLAT_INOF {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_INOF);
//Duration
CS_Factor2_SPLAT_D : SPLAT_D {35+2<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_D);
CS_Factor2_SPLAT_DAYS : SPLAT_DAYS {35+5<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_DAYS);
CS_Factor2_SPLAT_H : SPLAT_H {35+2<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_H);
CS_Factor2_SPLAT_HOURS : SPLAT_HOURS {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_HOURS);
CS_Factor2_SPLAT_MINUTES : SPLAT_MINUTES {35+8<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_MINUTES);
CS_Factor2_SPLAT_MONTHS : SPLAT_MONTHS {35+7<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_MONTHS);
CS_Factor2_SPLAT_M : SPLAT_M {35+2<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_M);
CS_Factor2_SPLAT_MN : SPLAT_MN {35+3<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_MN);
CS_Factor2_SPLAT_MS : SPLAT_MS {35+3<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_MS);
CS_Factor2_SPLAT_MSECONDS : SPLAT_MSECONDS {35+9<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_MSECONDS);
CS_Factor2_SPLAT_SECONDS : SPLAT_SECONDS {35+8<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_SECONDS);
CS_Factor2_SPLAT_YEARS : SPLAT_YEARS {35+6<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_YEARS);
CS_Factor2_SPLAT_Y : SPLAT_Y {35+2<= getCharPositionInLine() && getCharPositionInLine()<=48}? -> type(SPLAT_Y);
//Result
//Duration
CS_Result_SPLAT_D : SPLAT_D {49+2<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_D);
CS_Result_SPLAT_DAYS : SPLAT_DAYS {49+5<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_DAYS);
CS_Result_SPLAT_H : SPLAT_H {49+2<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_H);
CS_Result_SPLAT_HOURS : SPLAT_HOURS {49+6<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_HOURS);
CS_Result_SPLAT_MINUTES : SPLAT_MINUTES {49+8<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_MINUTES);
CS_Result_SPLAT_MONTHS : SPLAT_MONTHS {49+7<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_MONTHS);
CS_Result_SPLAT_M : SPLAT_M {49+2<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_M);
CS_Result_SPLAT_MN : SPLAT_MN {49+3<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_MN);
CS_Result_SPLAT_MS : SPLAT_MS {49+3<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_MS);
CS_Result_SPLAT_MSECONDS : SPLAT_MSECONDS {49+9<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_MSECONDS);
CS_Result_SPLAT_SECONDS : SPLAT_SECONDS {49+8<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_SECONDS);
CS_Result_SPLAT_YEARS : SPLAT_YEARS {49+6<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_YEARS);
CS_Result_SPLAT_Y : SPLAT_Y {49+2<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_Y);
CS_Result_SPLAT_S : SPLAT_S {49+2<= getCharPositionInLine() && getCharPositionInLine()<=62}? -> type(SPLAT_S);
CS_BlankFactor: ' '
{(getCharPositionInLine()==25)
|| (getCharPositionInLine()==49)
|| (getCharPositionInLine()==63)}?
;
//Factor to end of line is blank
CS_BlankFactor_EOL: ' ' {getCharPositionInLine()==25}? [ ]* NEWLINE -> type(EOL),popMode;
CS_FactorWs: (' '
{(getCharPositionInLine()>=12 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=36 && getCharPositionInLine()<=49)
}?
)+ -> skip;
CS_FactorWs2: (' '
{(getCharPositionInLine()>=50 && getCharPositionInLine()<=63)
}?
)+ -> skip;
/*
* This rather awkward token matches a literal. including whitespace literals
*/
CS_FactorContentHexLiteral: X [']
{(getCharPositionInLine()>=13 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=37 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=51 && getCharPositionInLine()<=63)
}?
-> type(HexLiteralStart),pushMode(InFactorStringMode);
CS_FactorContentDateLiteral: D [']
{(getCharPositionInLine()>=13 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=37 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=51 && getCharPositionInLine()<=63)
}?
-> type(DateLiteralStart),pushMode(InFactorStringMode);
CS_FactorContentTimeLiteral: T [']
{(getCharPositionInLine()>=13 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=37 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=51 && getCharPositionInLine()<=63)
}?
-> type(TimeLiteralStart),pushMode(InFactorStringMode);
CS_FactorContentGraphicLiteral: G [']
{(getCharPositionInLine()>=13 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=37 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=51 && getCharPositionInLine()<=63)
}?
-> type(GraphicLiteralStart),pushMode(InFactorStringMode);
CS_FactorContentUCS2Literal: U [']
{(getCharPositionInLine()>=13 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=37 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=51 && getCharPositionInLine()<=63)
}?
-> type(UCS2LiteralStart),pushMode(InFactorStringMode);
CS_FactorContentStringLiteral: [']
{(getCharPositionInLine()>=12 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=36 && getCharPositionInLine()<=49)
|| (getCharPositionInLine()>=50 && getCharPositionInLine()<=63)
}?
-> type(StringLiteralStart),pushMode(InFactorStringMode);
CS_FactorContent: (~[\r\n' :]
{(getCharPositionInLine()>=12 && getCharPositionInLine()<=25)
|| (getCharPositionInLine()>=36 && getCharPositionInLine()<=49)
}?
)+;
CS_ResultContent: (~[\r\n' :]
{(getCharPositionInLine()>=50 && getCharPositionInLine()<=63)}?
)+ -> type(CS_FactorContent);
CS_FactorColon: ([:]
{(getCharPositionInLine()>12 && getCharPositionInLine()<25)
|| (getCharPositionInLine()>36 && getCharPositionInLine()<49)
|| (getCharPositionInLine()>50 && getCharPositionInLine()<63)
}?
) -> type(COLON);//pushMode(FIXED_CalcSpec_2PartFactor),
CS_OperationAndExtender_Blank:
' '{getCharPositionInLine()==35}?;
CS_OperationAndExtender_WS:
([ ]{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?)+ -> skip;
CS_Operation_ACQ: OP_ACQ {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_ACQ);
CS_Operation_ADD: OP_ADD {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_ADD);
CS_Operation_ADDDUR: OP_ADDDUR {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_ADDDUR);
CS_Operation_ALLOC: OP_ALLOC {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ALLOC);
CS_Operation_ANDEQ: OP_ANDEQ {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ANDEQ);
CS_Operation_ANDNE: OP_ANDNE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ANDNE);
CS_Operation_ANDLE: OP_ANDLE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ANDLE);
CS_Operation_ANDLT: OP_ANDLT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ANDLT);
CS_Operation_ANDGE: OP_ANDGE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ANDGE);
CS_Operation_ANDGT: OP_ANDGT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ANDGT);
CS_Operation_ANDxx: OP_ANDxx {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ANDxx);
CS_Operation_BEGSR: OP_BEGSR {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_BEGSR);
CS_Operation_BITOFF: OP_BITOFF {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_BITOFF);
CS_Operation_BITON: OP_BITON {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_BITON);
CS_Operation_CABxx: OP_CABxx {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CABxx);
CS_Operation_CABEQ: OP_CABEQ {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CABEQ);
CS_Operation_CABNE: OP_CABNE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CABNE);
CS_Operation_CABLE: OP_CABLE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CABLE);
CS_Operation_CABLT: OP_CABLT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CABLT);
CS_Operation_CABGE: OP_CABGE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CABGE);
CS_Operation_CABGT: OP_CABGT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CABGT);
CS_Operation_CALL: OP_CALL {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_CALL);
CS_Operation_CALLB: OP_CALLB {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CALLB);
CS_Operation_CALLP: OP_CALLP {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CALLP),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_CASEQ: OP_CASEQ {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CASEQ);
CS_Operation_CASNE: OP_CASNE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CASNE);
CS_Operation_CASLE: OP_CASLE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CASLE);
CS_Operation_CASLT: OP_CASLT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CASLT);
CS_Operation_CASGE: OP_CASGE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CASGE);
CS_Operation_CASGT: OP_CASGT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CASGT);
CS_Operation_CAS: OP_CAS {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_CAS);
CS_Operation_CAT: OP_CAT {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_CAT);
CS_Operation_CHAIN: OP_CHAIN {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CHAIN);
CS_Operation_CHECK: OP_CHECK {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CHECK);
CS_Operation_CHECKR: OP_CHECKR {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_CHECKR);
CS_Operation_CLEAR: OP_CLEAR {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CLEAR);
CS_Operation_CLOSE: OP_CLOSE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_CLOSE);
CS_Operation_COMMIT: OP_COMMIT {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_COMMIT);
CS_Operation_COMP: OP_COMP {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_COMP);
CS_Operation_DEALLOC: OP_DEALLOC {getCharPositionInLine()>=32 && getCharPositionInLine()<36}? -> type(OP_DEALLOC);
CS_Operation_DEFINE: OP_DEFINE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DEFINE);
CS_Operation_DELETE: OP_DELETE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DELETE);
CS_Operation_DIV: OP_DIV {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_DIV);
CS_Operation_DO: OP_DO {getCharPositionInLine()>=27 && getCharPositionInLine()<36}? -> type(OP_DO);
CS_Operation_DOU: OP_DOU {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_DOU),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_DOUEQ: OP_DOUEQ {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOUEQ);
CS_Operation_DOUNE: OP_DOUNE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOUNE);
CS_Operation_DOULE: OP_DOULE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOULE);
CS_Operation_DOULT: OP_DOULT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOULT);
CS_Operation_DOUGE: OP_DOUGE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOUGE);
CS_Operation_DOUGT: OP_DOUGT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOUGT);
CS_Operation_DOW: OP_DOW {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_DOW),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_DOWEQ: OP_DOWEQ {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOWEQ);
CS_Operation_DOWNE: OP_DOWNE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOWNE);
CS_Operation_DOWLE: OP_DOWLE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOWLE);
CS_Operation_DOWLT: OP_DOWLT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOWLT);
CS_Operation_DOWGE: OP_DOWGE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOWGE);
CS_Operation_DOWGT: OP_DOWGT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DOWGT);
CS_Operation_DSPLY: OP_DSPLY {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_DSPLY);
CS_Operation_DUMP: OP_DUMP {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_DUMP);
CS_Operation_ELSE: OP_ELSE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_ELSE);
CS_Operation_ELSEIF: OP_ELSEIF {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_ELSEIF),pushMode(FREE);
CS_Operation_END: OP_END {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_END);
CS_Operation_ENDCS: OP_ENDCS {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ENDCS);
CS_Operation_ENDDO: OP_ENDDO {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ENDDO);
CS_Operation_ENDFOR: OP_ENDFOR {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_ENDFOR);
CS_Operation_ENDIF: OP_ENDIF {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ENDIF);
CS_Operation_ENDMON: OP_ENDMON {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_ENDMON);
CS_Operation_ENDSL: OP_ENDSL {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ENDSL);
CS_Operation_ENDSR: OP_ENDSR {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ENDSR);
CS_Operation_EVAL: OP_EVAL {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_EVAL),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_EVALR: OP_EVALR {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_EVALR),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_EVAL_CORR: OP_EVAL_CORR {getCharPositionInLine()>=34 && getCharPositionInLine()<36}? -> type(OP_EVAL_CORR),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_EXCEPT: OP_EXCEPT {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_EXCEPT);
CS_Operation_EXFMT: OP_EXFMT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_EXFMT);
CS_Operation_EXSR: OP_EXSR {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_EXSR);
CS_Operation_EXTRCT: OP_EXTRCT {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_EXTRCT);
CS_Operation_FEOD: OP_FEOD {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_FEOD);
CS_Operation_FOR: OP_FOR {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_FOR),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_FORCE: OP_FORCE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_FORCE);
CS_Operation_GOTO: OP_GOTO {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_GOTO);
CS_Operation_IF: OP_IF {getCharPositionInLine()>=27 && getCharPositionInLine()<36}? -> type(OP_IF),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_IFEQ: OP_IFEQ {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_IFEQ);
CS_Operation_IFNE: OP_IFNE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_IFNE);
CS_Operation_IFLE: OP_IFLE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_IFLE);
CS_Operation_IFLT: OP_IFLT {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_IFLT);
CS_Operation_IFGE: OP_IFGE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_IFGE);
CS_Operation_IFGT: OP_IFGT {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_IFGT);
CS_Operation_IN: OP_IN {getCharPositionInLine()>=27 && getCharPositionInLine()<36}? -> type(OP_IN);
CS_Operation_ITER: OP_ITER {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_ITER);
CS_Operation_KFLD: OP_KFLD {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_KFLD);
CS_Operation_KLIST: OP_KLIST {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_KLIST);
CS_Operation_LEAVE: OP_LEAVE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_LEAVE);
CS_Operation_LEAVESR: OP_LEAVESR {getCharPositionInLine()>=32 && getCharPositionInLine()<36}? -> type(OP_LEAVESR);
CS_Operation_LOOKUP: OP_LOOKUP {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_LOOKUP);
CS_Operation_MHHZO: OP_MHHZO {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_MHHZO);
CS_Operation_MHLZO: OP_MHLZO {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_MHLZO);
CS_Operation_MLHZO: OP_MLHZO {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_MLHZO);
CS_Operation_MLLZO: OP_MLLZO {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_MLLZO);
CS_Operation_MONITOR: OP_MONITOR {getCharPositionInLine()>=32 && getCharPositionInLine()<36}? -> type(OP_MONITOR);
CS_Operation_MOVE: OP_MOVE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_MOVE);
CS_Operation_MOVEA: OP_MOVEA {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_MOVEA);
CS_Operation_MOVEL: OP_MOVEL {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_MOVEL);
CS_Operation_MULT: OP_MULT {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_MULT);
CS_Operation_MVR: OP_MVR {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_MVR);
CS_Operation_NEXT: OP_NEXT {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_NEXT);
CS_Operation_OCCUR: OP_OCCUR {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_OCCUR);
CS_Operation_ON_ERROR: OP_ON_ERROR {getCharPositionInLine()>=33 && getCharPositionInLine()<36}? -> type(OP_ON_ERROR),pushMode(FREE);
CS_Operation_OPEN: OP_OPEN {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_OPEN);
CS_Operation_OREQ: OP_OREQ {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_OREQ);
CS_Operation_ORNE: OP_ORNE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_ORNE);
CS_Operation_ORLE: OP_ORLE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_ORLE);
CS_Operation_ORLT: OP_ORLT {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_ORLT);
CS_Operation_ORGE: OP_ORGE {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_ORGE);
CS_Operation_ORGT: OP_ORGT {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_ORGT);
CS_Operation_OTHER: OP_OTHER {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_OTHER);
CS_Operation_OUT: OP_OUT {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_OUT);
CS_Operation_PARM: OP_PARM {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_PARM);
CS_Operation_PLIST: OP_PLIST {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_PLIST);
CS_Operation_POST: OP_POST {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_POST);
CS_Operation_READ: OP_READ {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_READ);
CS_Operation_READC: OP_READC {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_READC);
CS_Operation_READE: OP_READE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_READE);
CS_Operation_READP: OP_READP {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_READP);
CS_Operation_READPE: OP_READPE {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_READPE);
CS_Operation_REALLOC: OP_REALLOC {getCharPositionInLine()>=32 && getCharPositionInLine()<36}? -> type(OP_REALLOC);
CS_Operation_REL: OP_REL {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_REL);
CS_Operation_RESET: OP_RESET {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_RESET);
CS_Operation_RETURN: OP_RETURN {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_RETURN),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_ROLBK: OP_ROLBK {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_ROLBK);
CS_Operation_SCAN: OP_SCAN {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_SCAN);
CS_Operation_SELECT: OP_SELECT {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_SELECT);
CS_Operation_SETGT: OP_SETGT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_SETGT);
CS_Operation_SETLL: OP_SETLL {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_SETLL);
CS_Operation_SETOFF: OP_SETOFF {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_SETOFF);
CS_Operation_SETON: OP_SETON {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_SETON);
CS_Operation_SORTA: OP_SORTA {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_SORTA),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_SHTDN: OP_SHTDN {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_SHTDN);
CS_Operation_SQRT: OP_SQRT {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_SQRT);
CS_Operation_SUB: OP_SUB {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_SUB);
CS_Operation_SUBDUR: OP_SUBDUR {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_SUBDUR);
CS_Operation_SUBST: OP_SUBST {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_SUBST);
CS_Operation_TAG: OP_TAG {getCharPositionInLine()>=28 && getCharPositionInLine()<36}? -> type(OP_TAG);
CS_Operation_TEST: OP_TEST {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_TEST);
CS_Operation_TESTB: OP_TESTB {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_TESTB);
CS_Operation_TESTN: OP_TESTN {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_TESTN);
CS_Operation_TESTZ: OP_TESTZ {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_TESTZ);
CS_Operation_TIME: OP_TIME {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_TIME);
CS_Operation_UNLOCK: OP_UNLOCK {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_UNLOCK);
CS_Operation_UPDATE: OP_UPDATE {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_UPDATE);
CS_Operation_WHEN: OP_WHEN {getCharPositionInLine()>=29 && getCharPositionInLine()<36}? -> type(OP_WHEN),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_WHENEQ: OP_WHENEQ {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_WHENEQ);
CS_Operation_WHENNE: OP_WHENNE {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_WHENNE);
CS_Operation_WHENLE: OP_WHENLE {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_WHENLE);
CS_Operation_WHENLT: OP_WHENLT {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_WHENLT);
CS_Operation_WHENGE: OP_WHENGE {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_WHENGE);
CS_Operation_WHENGT: OP_WHENGT {getCharPositionInLine()>=31 && getCharPositionInLine()<36}? -> type(OP_WHENGT);
CS_Operation_WRITE: OP_WRITE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_WRITE);
CS_Operation_XFOOT: OP_XFOOT {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_XFOOT);
CS_Operation_XLATE: OP_XLATE {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_XLATE);
CS_Operation_XML_INTO: OP_XML_INTO {getCharPositionInLine()>=33 && getCharPositionInLine()<36}? -> type(OP_XML_INTO),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_XML_SAX: OP_XML_SAX {getCharPositionInLine()>=32 && getCharPositionInLine()<36}? -> type(OP_XML_SAX),pushMode(FREE),pushMode(FixedOpExtender);
CS_Operation_Z_ADD: OP_Z_ADD {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_Z_ADD);
CS_Operation_Z_SUB: OP_Z_SUB {getCharPositionInLine()>=30 && getCharPositionInLine()<36}? -> type(OP_Z_SUB);
CS_OperationAndExtender:
([a-zA-Z0-9\\-]
{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?)+;
CS_OperationExtenderOpen: OPEN_PAREN{getCharPositionInLine()>=26 && getCharPositionInLine()<36}? -> type(OPEN_PAREN);
CS_OperationExtenderClose: CLOSE_PAREN{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?
( ' '{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?)*
{setText(getText().trim());}
-> type(CLOSE_PAREN);
CS_FieldLength: [+\- 0-9][+\- 0-9][+\- 0-9][+\- 0-9][+\- 0-9] {getCharPositionInLine()==68}?;
CS_DecimalPositions: [ 0-9][ 0-9] {getCharPositionInLine()==70}?
-> pushMode(IndicatorMode),pushMode(IndicatorMode),pushMode(IndicatorMode); // 3 Indicators in a row
CS_WhiteSpace : [ \t] {getCharPositionInLine()>=77}? [ \t]* -> skip ; // skip spaces, tabs, newlines
CS_Comments : ~[\r\n] {getCharPositionInLine()>80}? ~[\r\n]* ;
CS_FixedComments : ~[\r\n] {getCharPositionInLine()>=77}? ~[\r\n]* ;
CS_EOL : NEWLINE -> type(EOL),popMode;
mode FixedOpExtender;
CS_FixedOperationAndExtender_WS:
([ ]
{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?
)+ -> skip;
CS_FixedOperationExtenderOpen: OPEN_PAREN {getCharPositionInLine()>=26 && getCharPositionInLine()<36}?
-> type(OPEN_PAREN),popMode,pushMode(FixedOpExtender2);
CS_FixedOperationExtenderReturn: {getCharPositionInLine()>=25 && getCharPositionInLine()<=35}? ->skip,popMode;
mode FixedOpExtender2;
CS_FixedOperationAndExtender2_WS:
([ ]
{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?)+ -> skip;
CS_FixedOperationAndExtender2:
([a-zA-Z0-9\\-]
{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?)+ -> type(CS_OperationAndExtender);
CS_FixedOperationExtender2Close: CLOSE_PAREN {getCharPositionInLine()>=26 && getCharPositionInLine()<36}?
(' '
{getCharPositionInLine()>=26 && getCharPositionInLine()<36}?
)*
{setText(getText().trim());}
-> type(CLOSE_PAREN);
CS_FixedOperationExtender2Return: {getCharPositionInLine()==35}? ->skip,popMode;
mode FreeOpExtender;
FreeOpExtender_OPEN_PAREN: OPEN_PAREN -> popMode,type(OPEN_PAREN),pushMode(FreeOpExtender2);
//Deliberate match no char, pop out again
FreeOpExtender_Any: -> popMode,skip;
mode FreeOpExtender2;
FreeOpExtender2_CLOSE_PAREN: CLOSE_PAREN -> popMode,type(CLOSE_PAREN);
FreeOpExtender2_WS: WS -> skip;
FreeOpExtender_Extender: [a-zA-Z0-9\\-] -> type(CS_OperationAndExtender);
mode OnOffIndicatorMode;
BlankFlag: [ ] ->popMode,pushMode(IndicatorMode);
NoFlag: N ->popMode,pushMode(IndicatorMode);
mode IndicatorMode;
BlankIndicator: [ ][ ] ->popMode;
GeneralIndicator: ([0][1-9] | [1-9][0-9]) ->popMode;
FunctionKeyIndicator: K [A-NP-Ya-np-y] ->popMode;
ControlLevelIndicator: L [1-9] ->popMode;
ControlLevel0Indicator: L [0] ->popMode;
LastRecordIndicator: L R ->popMode;
MatchingRecordIndicator: M R ->popMode;
HaltIndicator: H [1-9] ->popMode;
ReturnIndicator: R T ->popMode;
ExternalIndicator: U [1-8] ->popMode;
OverflowIndicator: O [A-GVa-gv] ->popMode;
SubroutineIndicator: S R ->popMode;
AndIndicator: A N ->popMode;
OrIndicator: O R ->popMode;
DoubleSplatIndicator: '**';
FirstPageIndicator: [1]P ;
OtherTextIndicator: ~[\r\n]~[\r\n];
mode FIXED_CalcSpec_SQL;
CSQL_EMPTY_TEXT: [ ] {getCharPositionInLine()>=8}? [ ]* -> skip;
CSQL_TEXT: ~[\r\n] {getCharPositionInLine()>=8}? ~[\r\n]*;
CSQL_LEADBLANK : ' ' {getCharPositionInLine()==5}?-> skip;
CSQL_LEADWS : WORD5 {getCharPositionInLine()==5}?-> skip;
CSQL_END :
C '/' E N D [-] E X E C WS ~[\r\n]* {setText(getText().trim());} -> popMode ;
CSQL_CONT: [cC ] '+' -> skip;
CSQL_CSplat: [cC ] '*' -> skip,pushMode(FIXED_CalcSpec_SQL_Comments);
CSQL_EOL: NEWLINE -> skip;
CSQL_Any: -> skip,popMode;
mode FIXED_CalcSpec_SQL_Comments;
CSQLC_LEADWS : CSQL_LEADWS-> skip;
CSQLC_CSplat : [cC ] '*' -> skip;
CSQLC_WS : [ \t] {getCharPositionInLine()>=8}? [ \t]* -> skip;
CSQLC_Comments : ~[\r\n ] {getCharPositionInLine()>=8}? ~[\r\n]* -> channel(HIDDEN);
CSQLC_Any : NEWLINE? -> skip,popMode;
mode FIXED_CalcSpec_X2;
C2_FACTOR2_CONT: ~[\r\n]{getCharPositionInLine()==36}?
~[\r\n]* REPEAT_FIXED_CalcSpec_X2;
C2_FACTOR2: ~[\r\n]{getCharPositionInLine()==36}?
~[\r\n]* ->popMode;
C2_OTHER: ~('\r' | '\n') {getCharPositionInLine()<36}? ->skip;
fragment
REPEAT_FIXED_CalcSpec_X2 : '+' [ ]+ NEWLINE;
mode FIXED_InputSpec;
IS_BLANK_SPEC :
' '
{getCharPositionInLine()==80}? -> type(BLANK_SPEC);
IS_FileName: WORD5_WCOLON WORD5_WCOLON {getCharPositionInLine()==16}?;
IS_FieldReserved: ' ' {getCharPositionInLine()==30}? -> pushMode(FIXED_I_FIELD_SPEC),skip ;
IS_ExtFieldReserved: ' ' {getCharPositionInLine()==20}?-> pushMode(FIXED_I_EXT_FIELD_SPEC),skip ;
IS_LogicalRelationship : ('AND' | 'OR '| ' OR') {getCharPositionInLine()==18}?;
IS_ExtRecordReserved : ' ' {getCharPositionInLine()==20}? -> pushMode(FIXED_I_EXT_REC_SPEC),pushMode(IndicatorMode) ;
IS_Sequence : WORD_WCOLON WORD_WCOLON {getCharPositionInLine()==18}?;
IS_Number : [ 1nN] {getCharPositionInLine()==19}?;
IS_Option: [ oO] {getCharPositionInLine()==20}? -> pushMode(IndicatorMode);
IS_RecordIdCode: WORD5_WCOLON WORD5_WCOLON WORD5_WCOLON WORD5_WCOLON
WORD_WCOLON WORD_WCOLON WORD_WCOLON WORD_WCOLON {getCharPositionInLine()==46}?; //TODO better lexing
IS_WS : [ \t] {getCharPositionInLine()>=47}? [ \t]* -> type(WS),skip ; // skip spaces, tabs
IS_COMMENTS : ~[\r\n] {getCharPositionInLine()>80}? ~[\r\n]* -> channel(HIDDEN) ; // skip spaces, tabs, newlines
IS_EOL : NEWLINE -> type(EOL),popMode;
mode FIXED_I_EXT_FIELD_SPEC;
IF_Name: WORD5_WCOLON WORD5_WCOLON {getCharPositionInLine()==30}?;
IF_Reserved: ' ' {getCharPositionInLine()==48}? -> skip;
IF_FieldName: WORD5_WCOLON WORD5_WCOLON WORD_WCOLON WORD_WCOLON
WORD_WCOLON WORD_WCOLON {getCharPositionInLine()==62}? ->pushMode(IndicatorMode),pushMode(IndicatorMode);
IF_Reserved2: ' ' {getCharPositionInLine()==68}? ->pushMode(IndicatorMode),pushMode(IndicatorMode),pushMode(IndicatorMode),skip; // 3 Indicators in a row
IF_WS : [ \t] {getCharPositionInLine()>=75}? [ \t]* -> type(WS),popMode,skip ; // skip spaces, tabs
mode FIXED_I_EXT_REC_SPEC;
IR_WS : [ \t]{getCharPositionInLine()>=23}? [ \t]* -> type(WS),popMode ; // skip spaces, tabs
mode FIXED_I_FIELD_SPEC;
IFD_DATA_ATTR: WORD_WCOLON WORD_WCOLON WORD_WCOLON WORD_WCOLON {getCharPositionInLine()==34}?;
IFD_DATETIME_SEP: ~[\r\n] {getCharPositionInLine()==35}?;
IFD_DATA_FORMAT: [A-Z ] {getCharPositionInLine()==36}?;
IFD_FIELD_LOCATION: WORD5_WCOLON WORD5_WCOLON {getCharPositionInLine()==46}?;
IFD_DECIMAL_POSITIONS: [ 0-9][ 0-9] {getCharPositionInLine()==48}?;
IFD_FIELD_NAME: WORD5_WCOLON WORD5_WCOLON WORD_WCOLON WORD_WCOLON WORD_WCOLON WORD_WCOLON {getCharPositionInLine()==62}?;
IFD_CONTROL_LEVEL : ('L'[0-9] | ' ') {getCharPositionInLine()==64}?;
IFD_MATCHING_FIELDS: ('M'[0-9] | ' ') {getCharPositionInLine()==66}? ->pushMode(IndicatorMode),pushMode(IndicatorMode),
pushMode(IndicatorMode),pushMode(IndicatorMode);
IFD_BLANKS: ' ' {getCharPositionInLine()==80}? -> skip;
IFD_COMMENTS : ~[\r\n]{getCharPositionInLine()>80}? ~[\r\n]* -> channel(HIDDEN) ; // skip spaces, tabs, newlines
IFD_EOL : NEWLINE -> type(EOL),popMode,popMode;
mode HeaderSpecMode;
HS_OPEN_PAREN: OPEN_PAREN -> type(OPEN_PAREN);
HS_CLOSE_PAREN: CLOSE_PAREN -> type(CLOSE_PAREN);
HS_StringLiteralStart: ['] -> type(StringLiteralStart),pushMode(InStringMode) ;
HS_COLON: ':' -> type(COLON);
HS_ID: [#@%$*a-zA-Z] [&#@\-$*a-zA-Z0-9_/,.]* -> type(ID);
HS_WhiteSpace : [ \t]+ -> skip ; // skip spaces, tabs, newlines
HS_CONTINUATION: NEWLINE
WORD5 H ~[*] -> skip;
HS_EOL : NEWLINE -> type(EOL),popMode;
fragment WORD5 : ~[\r\n]~[\r\n]~[\r\n]~[\r\n]~[\r\n];
fragment NAME5 : NAMECHAR NAMECHAR NAMECHAR NAMECHAR NAMECHAR;
// valid characters in symbolic names.
fragment NAMECHAR : [A-Za-z0-9$#@_ ];
// names cannot start with _ or numbers
fragment INITNAMECHAR : [A-Za-z$#@];
fragment WORD_WCOLON : ~[\r\n];//[a-zA-Z0-9 :*];
fragment WORD5_WCOLON : WORD_WCOLON WORD_WCOLON WORD_WCOLON WORD_WCOLON WORD_WCOLON;
// Case insensitive alphabet fragments
fragment A: [aA];
fragment B: [bB];
fragment C: [cC];
fragment D: [dD];
fragment E: [eE];
fragment F: [fF];
fragment G: [gG];
fragment H: [hH];
fragment I: [iI];
fragment J: [jJ];
fragment K: [kK];
fragment L: [lL];
fragment M: [mM];
fragment N: [nN];
fragment O: [oO];
fragment P: [pP];
fragment Q: [qQ];
fragment R: [rR];
fragment S: [sS];
fragment T: [tT];
fragment U: [uU];
fragment V: [vV];
fragment W: [wW];
fragment X: [xX];
fragment Y: [yY];
fragment Z: [zZ];
|
src/d0xfa.adb | python36/0xfa | 0 | 28152 | <gh_stars>0
with ada.text_io;
with ada.command_line;
with ada.strings.fixed;
with gnat.os_lib;
with ada.containers.vectors;
with numbers; use numbers;
with strings; use strings;
procedure d0xfa is
use type ada.text_io.count;
use type byte;
use type word;
PROGRAMM_NAME : constant string := "d0xfa";
file : ada.text_io.file_type;
procedure close_app is
begin
if ada.text_io.is_open(file) then
ada.text_io.close(file);
end if;
end close_app;
procedure error (s : string) is
begin
close_app;
print(s);
gnat.os_lib.os_exit(1);
end error;
subtype label_t is string(1..6);
null_label : constant label_t := (others => ' ');
label_counter : natural := 1;
interrupt_lines_counter : natural := 0;
must_be_next_addr : word := 0;
type commands is (
f_rrc, f_swpb, f_rra, f_sxt, f_push, f_call, f_reti,
f_jne, f_jeq, f_jnc, f_jc, f_jn, f_jge, f_jl, f_jmp,
f_mov, f_add, f_addc, f_subc, f_sub, f_cmp, f_dadd,
f_bit, f_bic, f_bis, f_xor, f_and,
f_jnz, f_jz, f_jlo, f_jhs);
subtype single_commands is commands range f_rrc..f_reti;
subtype jump_commands is commands range f_jne..f_jmp;
subtype two_commands is commands range f_mov..f_and;
type command_types is (t_jump, t_single, t_two, t_interrupt);
type addressing_modes is (
m_constant,
m_immediate, m_indexed, m_symbolic, m_absolute,
m_indirect_register, m_indirect_autoincrement, m_register);
type address_t is record
mode : addressing_modes := m_constant;
address : word := 0;
register : word := 0;
ext_word : boolean := false;
label : label_t := null_label;
end record;
type command_t is record
command_raw : word;
command : commands;
command_type : command_types;
address : word;
first_op, second_op : word := 0;
source, destination : address_t;
label : label_t := null_label;
num_operands : byte := 0;
bw : boolean := true;
end record;
tmp_command : command_t;
package programm_t is new ada.containers.vectors(
element_type => command_t, index_type => natural);
programm : programm_t.vector;
programm_cursor : programm_t.cursor;
procedure parse_source (cmd : in out command_t) is
as : word := sr(cmd.command_raw, 4) and 3;
src : word;
begin
if cmd.command_type = t_single then
src := cmd.command_raw and 15;
else
src := sr(cmd.command_raw, 8) and 15;
end if;
cmd.source.register := src;
cmd.source.address := src;
if as = 0 then
if src = 3 then
cmd.source.mode := m_constant;
cmd.source.address := 0;
else
cmd.source.mode := m_register;
end if;
elsif as = 1 then
if src = 0 then
cmd.source.mode := m_symbolic;
elsif src = 2 then
cmd.source.mode := m_absolute;
elsif src = 3 then
cmd.source.mode := m_constant;
cmd.source.address := 1;
else
cmd.source.mode := m_indexed;
end if;
elsif as = 2 then
if src = 2 then
cmd.source.mode := m_constant;
cmd.source.address := 4;
elsif src = 3 then
cmd.source.mode := m_constant;
cmd.source.address := 2;
else
cmd.source.mode := m_indirect_register;
end if;
elsif as = 3 then
if src = 0 then
cmd.source.mode := m_immediate;
elsif src = 2 then
cmd.source.mode := m_constant;
cmd.source.address := 8;
elsif src = 3 then
cmd.source.mode := m_constant;
cmd.source.address := 16#ffff#;
else
cmd.source.mode := m_indirect_autoincrement;
end if;
end if;
if cmd.source.mode in m_immediate..m_absolute then
inc(cmd.num_operands);
cmd.source.ext_word := true;
end if;
end parse_source;
procedure parse_destination (cmd : in out command_t) is
ad : word := sr(cmd.command_raw, 7) and 1;
dst : word := cmd.command_raw and 15;
begin
cmd.destination.register := dst;
if ad = 0 then
cmd.destination.mode := m_register;
cmd.destination.address := dst;
else
inc(cmd.num_operands);
cmd.destination.ext_word := true;
if dst = 0 then
cmd.destination.mode := m_symbolic;
elsif dst = 2 then
cmd.destination.mode := m_absolute;
else
cmd.destination.mode := m_indexed;
end if;
end if;
end parse_destination;
procedure parse_single (cmd : in out command_t) is
begin
cmd.command := commands'val(
(sr(cmd.command_raw, 7) and 7) +
word(single_commands'pos(single_commands'first)));
parse_source(cmd);
end parse_single;
procedure parse_two (cmd : in out command_t) is
begin
cmd.command := commands'val(
(sr(cmd.command_raw, 12) +
word(two_commands'pos(two_commands'first)) - 4));
parse_source(cmd);
parse_destination(cmd);
end parse_two;
procedure parse_jump (cmd : in out command_t) is
begin
cmd.command := commands'val(
((sr(cmd.command_raw, 10) and 7) +
word(jump_commands'pos(jump_commands'first))));
end parse_jump;
procedure put_operand (op : address_t; op_m : addressing_modes) is
begin
if op_m = m_register then
put('r' & ltrim(op.address'img));
elsif op_m = m_indexed then
put(ltrim(word_to_integer(op.address)'img) & "(r" & ltrim(op.register'img) & ')');
elsif op_m = m_constant then
put('#' & ltrim(word_to_integer(op.address)'img));
elsif op_m = m_symbolic then
if op.label /= null_label then
put(rtrim(op.label));
else
put("$");
if word_to_integer(op.address) >= 0 then
put("+");
end if;
put(ltrim(word_to_integer(op.address)'img));
end if;
elsif op_m = m_absolute then
if op.label /= null_label then
put('&' & rtrim(op.label));
else
put("&" & hex(op.address));
end if;
elsif op_m = m_indirect_register then
put("@r" & ltrim(op.register'img));
elsif op_m = m_indirect_autoincrement then
put("@r" & ltrim(op.register'img) & "+");
elsif op_m = m_immediate then
put("#" & ltrim(word_to_integer(op.address)'img));
end if;
end put_operand;
function new_command (w, addr : word) return command_t is
cmd : command_t;
begin
cmd.command_raw := w;
cmd.address := addr;
if addr >= 16#ffc0# then
cmd.command_type := t_interrupt;
return cmd;
end if;
cmd.bw := (w and 64) /= 0;
case sr(cmd.command_raw, 13) is
when 0 => cmd.command_type := t_single; parse_single(cmd);
when 1 => cmd.command_type := t_jump; cmd.bw := false; parse_jump(cmd);
when others => cmd.command_type := t_two; parse_two(cmd);
end case;
return cmd;
end new_command;
procedure operand_to_command (cmd : in out command_t; w : word; tl : byte) is
begin
if cmd.num_operands = 2 then
if tl = 2 then
cmd.source.address := w;
else
cmd.destination.address := w;
end if;
elsif cmd.source.ext_word then
cmd.source.address := w;
else
cmd.destination.address := w;
end if;
end operand_to_command;
function get_addr_by_offset (cmd : command_t) return word is
begin
return ((cmd.command_raw and 1023) + 64512 * (
sr(cmd.command_raw, 9) and 1) + 1) * 2 + cmd.address;
end get_addr_by_offset;
procedure create_label (cmd : command_t; addr : in out address_t) is
tmp_addr : word := addr.address;
tmp_cursor : programm_t.cursor;
tmp_command : command_t;
begin
if cmd.command_type = t_jump then
tmp_addr := get_addr_by_offset(cmd);
elsif addr.mode = m_symbolic then
tmp_addr := tmp_addr + 2 + cmd.address;
if addr = cmd.destination and cmd.source.ext_word then
tmp_addr := tmp_addr + 2;
end if;
elsif addr.mode /= m_absolute then
error("programm error");
end if;
tmp_cursor := programm.first;
while (programm_t.has_element(tmp_cursor)) loop
tmp_command := programm_t.element(tmp_cursor);
if tmp_command.address = tmp_addr then
if tmp_command.label = null_label then
tmp_command.label := ada.strings.fixed.head(
'l' & ltrim(label_counter'img), null_label'length);
inc(label_counter);
programm_t.replace_element(programm, tmp_cursor, tmp_command);
end if;
addr.label := tmp_command.label;
exit;
end if;
tmp_cursor := programm_t.next(tmp_cursor);
end loop;
end create_label;
procedure end_command (cmd : in out command_t) is
tmp_addr : address_t;
begin
if cmd.command_type = t_jump then
create_label(cmd, cmd.destination);
else
if cmd.source.mode in m_symbolic|m_absolute then
create_label(cmd, cmd.source);
end if;
if cmd.destination.mode in m_symbolic|m_absolute then
create_label(cmd, cmd.destination);
end if;
end if;
programm.append(cmd);
end end_command;
procedure disasm (cmd : in out command_t) is
tmp_cur : programm_t.cursor;
col : ada.text_io.count := 1;
procedure shift_col (v : ada.text_io.count) is
begin
col := col + v;
ada.text_io.set_col(col);
end shift_col;
procedure set_col (v : ada.text_io.count) is
begin
col := v;
ada.text_io.set_col(col);
end set_col;
procedure put_hex_raw (w : word) is
strword : string(1..4) := image(w, 16);
begin
put(strword(3..4) & ' ' & strword(1..2));
end put_hex_raw;
function repr_bw return string is
begin
if cmd.bw then
return ".b";
end if;
return "";
end repr_bw;
function repr_commands (command : commands) return string is
begin
return lowercase(command'img(3..command'img'length)) & repr_bw;
end repr_commands;
procedure put_alternative (scmd : string) is
begin
put("; " & scmd);
shift_col(9);
end put_alternative;
procedure put_alternative_with_dst (scmd : string) is
begin
put_alternative(scmd);
put_operand(cmd.destination, cmd.destination.mode);
end put_alternative_with_dst;
procedure put_jump_offset (jcmd : command_t) is
begin
if jcmd.destination.label = null_label then
put("$");
if (sr(cmd.command_raw, 9) and 1) = 0 then
put("+");
end if;
put(ltrim(word_to_integer(
((jcmd.command_raw and 1023) + 64512 * (
sr(cmd.command_raw, 9) and 1) + 1) * 2)'img));
else
put(jcmd.destination.label);
end if;
end put_jump_offset;
procedure put_comment (sc : string) is
begin
put("; " & sc);
end put_comment;
procedure put_label (s : string) is
begin
put(ada.strings.fixed.head(
rtrim(s) & ':', null_label'length));
end put_label;
begin
if cmd.source.mode in m_symbolic|m_absolute then
create_label(cmd, cmd.source);
end if;
if cmd.destination.mode in m_symbolic|m_absolute then
create_label(cmd, cmd.destination);
end if;
if cmd.command_type = t_jump then
create_label(cmd, cmd.destination);
end if;
if cmd.label /= null_label then
put_label(cmd.label);
end if;
shift_col(7);
put(repr_commands(cmd.command));
shift_col(7);
if cmd.command_type = t_jump then
put_jump_offset(cmd);
if cmd.command in f_jne..f_jc then
shift_col(24);
put_alternative(repr_commands(
commands'val(commands'pos(cmd.command) + (
commands'pos(f_jnz) - commands'pos(f_jne)))));
put_jump_offset(cmd);
end if;
elsif cmd.command /= f_reti then
put_operand(cmd.source, cmd.source.mode);
end if;
if cmd.command_type = t_two then
put(",");
shift_col(12);
put_operand(cmd.destination, cmd.destination.mode);
shift_col(12);
if cmd.command = f_addc then
if cmd.source.mode = cmd.destination.mode and
cmd.source.address = cmd.destination.address then
put_alternative_with_dst("rlc" & repr_bw);
elsif cmd.source.mode = m_constant and cmd.source.address = 0 then
put_alternative_with_dst("adc" & repr_bw);
end if;
elsif cmd.command = f_add then
if cmd.source.mode = cmd.destination.mode and
(cmd.source.address = cmd.destination.address or (
cmd.source.mode = m_symbolic and cmd.source.address - 2 = cmd.destination.address)) then
put_alternative_with_dst("rla" & repr_bw);
elsif cmd.source.mode = m_constant then
if cmd.source.address = 1 then
put_alternative_with_dst("inc" & repr_bw);
elsif cmd.source.address = 2 then
put_alternative_with_dst("incd" & repr_bw);
end if;
end if;
elsif cmd.command = f_xor and cmd.source.mode = m_constant and cmd.source.address = 16#ffff# then
put_alternative_with_dst("inv" & repr_bw);
elsif cmd.command = f_bic and cmd.destination.mode = m_register and
cmd.destination.register = 2 and cmd.source.mode = m_constant then
if cmd.source.address = 1 then
put_alternative("clrc");
elsif cmd.source.address = 2 then
put_alternative("clrz");
elsif cmd.source.address = 4 then
put_alternative("clrn");
elsif cmd.source.address = 8 then
put_alternative("dint");
end if;
elsif cmd.command = f_bis and cmd.source.mode = m_constant and
cmd.destination.mode = m_register and cmd.destination.register = 2 then
if cmd.source.address = 1 then
put_alternative("setc");
elsif cmd.source.address = 2 then
put_alternative("setz");
elsif cmd.source.address = 4 then
put_alternative("setn");
elsif cmd.source.address = 8 then
put_alternative("eint");
end if;
elsif cmd.command = f_cmp and
cmd.source.mode = m_constant and cmd.source.address = 0 then
put_alternative_with_dst("tst" & repr_bw);
elsif cmd.command = f_dadd and
cmd.source.mode = m_constant and cmd.source.address = 0 then
put_alternative_with_dst("dadc" & repr_bw);
elsif cmd.command = f_subc and
cmd.source.mode = m_constant and cmd.source.address = 0 then
put_alternative_with_dst("sbc" & repr_bw);
elsif cmd.command = f_sub and
cmd.source.mode = m_constant then
if cmd.source.address = 1 then
put_alternative_with_dst("dec" & repr_bw);
elsif cmd.source.address = 2 then
put_alternative_with_dst("decd" & repr_bw);
end if;
elsif cmd.command = f_mov then
if cmd.source.mode = m_indirect_autoincrement and cmd.source.address = 1 then
if cmd.destination.mode = m_register and cmd.destination.address = 0 then
put_alternative("ret");
else
put_alternative_with_dst("pop" & repr_bw);
end if;
elsif cmd.destination.mode = m_register and cmd.destination.address = 0 then
put_alternative("br");
put_operand(cmd.source, cmd.source.mode);
elsif cmd.source.mode = m_constant and cmd.source.address = 0 then
if cmd.destination.mode = m_register and cmd.destination.register = 3 then
put_alternative("nop");
else
put_alternative_with_dst("clr" & repr_bw);
end if;
end if;
end if;
end if;
set_col(59);
if cmd.command_type = t_jump then
put_comment(hex(get_addr_by_offset(cmd)));
else
if cmd.source.mode = m_immediate then
put_comment('#' & hex(cmd.source.address));
elsif cmd.source.mode = m_constant and cmd.source.address = 16#ffff# then
put_comment('#' & hex(cmd.source.address));
elsif cmd.source.mode = m_symbolic then
put_comment(hex(cmd.address + 2 + cmd.source.address));
elsif cmd.source.mode = m_absolute then
put_comment('&' & hex(cmd.source.address));
end if;
if cmd.destination.mode = m_symbolic then
put_comment(hex(cmd.address + word(cmd.num_operands) * 2 + cmd.destination.address));
elsif cmd.destination.mode = m_absolute then
put_comment('&' & hex(cmd.destination.address));
end if;
end if;
set_col(78);
put("; ");
put(image(cmd.address, 16));
shift_col(9);
put_hex_raw(cmd.command_raw);
if cmd.source.ext_word then
put(" ");
put_hex_raw(cmd.source.address);
end if;
if cmd.destination.ext_word then
put(" ");
put_hex_raw(cmd.destination.address);
end if;
ada.text_io.new_line;
end disasm;
i : byte;
cmd : command_t;
l, op_l : byte := 0;
is_ssar : boolean := false;
is_end : boolean := true;
is_first : boolean := true;
checksum : byte;
first_char : character;
b : byte;
wt : word;
addr, next_addr, op_addr : word := 0;
begin
print(";;; 0xfa [http://0xfa.space] ;;;");
print("; d0xfa v0.1.0 - msp430 disassembler (ihex format [https://wikipedia.org/wiki/Intel_HEX])");
print("");
if ada.command_line.argument_count = 0 then
error("no input files");
end if;
ada.text_io.open(file, ada.text_io.in_file, ada.command_line.argument(1));
loop_read: while not ada.text_io.end_of_file(file) loop
if l /= 0 or not is_end then
error("bad format");
end if;
i := 0;
checksum := 0;
is_end := false;
for c of remove_ret_car(ada.text_io.get_line(file)) loop
if not (c in '0'..'9' or c in 'A'..'F' or (i = 0 and c = ':')) then
error("bad format");
end if;
if (i and 1) /= 0 then
first_char := c;
elsif i /= 0 then
b := byte'value("16#" & first_char & c & '#');
checksum := checksum + b;
if i = 2 then
l := b;
elsif i = 4 then
addr := word(b);
elsif i = 6 then
addr := sl(addr, 8) + word(b);
if next_addr > 0 and next_addr - word(op_l) * 2 /= addr then
if op_l /= 0 then
null;
-- error("seq addrs");
end if;
end if;
if op_l = 0 then
next_addr := addr;
op_addr := next_addr;
end if;
elsif i = 8 then
if b = 1 then
if l /= 0 or addr /= 0 then
error("bad end record");
end if;
exit loop_read;
elsif b = 3 then
if l /= 4 or addr /= 0 then
error("bad SSAR len");
end if;
is_ssar := true;
end if;
elsif i > 9 and l > 0 then
if is_first then
wt := word(b);
is_first := false;
else
wt := sl(word(b), 8) or wt;
is_first := true;
end if;
if is_first then
if op_l = 0 then
if is_ssar then
op_l := 1;
else
cmd := new_command(wt, op_addr);
op_l := cmd.num_operands;
next_addr := op_addr + 2 + word(op_l) * 2;
end if;
else
if is_ssar then
ada.text_io.set_col(1);
print("; SSAR: " & hex(sl(wt, 8) + sr(wt, 8)));
else
operand_to_command(cmd, wt, op_l);
end if;
dec(op_l);
end if;
if op_l = 0 then
if not is_ssar then
end_command(cmd);
op_addr := next_addr;
end if;
end if;
end if;
dec(l);
elsif i > 9 and l = 0 then
is_end := true;
if checksum /= 0 then
error("checksum error");
end if;
end if;
end if;
inc(i);
end loop;
end loop loop_read;
print(";label cmd 1st_operand 2nd_operand emulated comments addr raw");
programm_cursor := programm.first;
while (programm_t.has_element(programm_cursor)) loop
tmp_command := programm_t.element(programm_cursor);
if tmp_command.command_type = t_interrupt then
if interrupt_lines_counter = 0 then
print("; interrupt vectors:");
put(';');
interrupt_lines_counter := 1;
end if;
if tmp_command.address >= 16#fff0# and interrupt_lines_counter = 1 then
interrupt_lines_counter := 2;
ada.text_io.new_line;
put(';');
end if;
ada.text_io.set_col((ada.text_io.count(tmp_command.address - 16#ffe0#) mod 16) * 6 + 3);
put(image(tmp_command.address, 16) & ": " & image(tmp_command.command_raw, 16) & " ");
else
if must_be_next_addr /= 0 and must_be_next_addr /= tmp_command.address then
print("; ...");
end if;
disasm(tmp_command);
must_be_next_addr := tmp_command.address + 2 * word(tmp_command.num_operands) + 2;
end if;
programm_cursor := programm_t.next(programm_cursor);
end loop;
close_app;
end d0xfa; |
source/context/webidl-enumerations.ads | reznikmm/webidl | 0 | 24154 | -- SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with League.String_Vectors;
with WebIDL.Definitions;
package WebIDL.Enumerations is
pragma Preelaborate;
type Enumeration is limited interface and WebIDL.Definitions.Definition;
-- An enumeration is a definition used to declare a type whose valid values
-- are a set of predefined strings.
type Enumeration_Access is access all Enumeration'Class
with Storage_Size => 0;
not overriding function Values (Self : Enumeration)
return League.String_Vectors.Universal_String_Vector is abstract;
-- The enumeration values are specified as a comma-separated list of string
-- literals. The list of enumeration values must not include duplicates.
end WebIDL.Enumerations;
|
Definition/LogicalRelation/Properties/Escape.agda | loic-p/logrel-mltt | 0 | 6329 | <filename>Definition/LogicalRelation/Properties/Escape.agda
{-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Properties.Escape {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Weakening
open import Definition.Typed.Properties
open import Definition.LogicalRelation
open import Tools.Embedding
open import Tools.Product
import Tools.PropositionalEquality as PE
-- Reducible types are well-formed.
escape : ∀ {l Γ A} → Γ ⊩⟨ l ⟩ A → Γ ⊢ A
escape (Uᵣ′ l′ l< ⊢Γ) = Uⱼ ⊢Γ
escape (ℕᵣ [ ⊢A , ⊢B , D ]) = ⊢A
escape (ne′ K [ ⊢A , ⊢B , D ] neK K≡K) = ⊢A
escape (Πᵣ′ F G [ ⊢A , ⊢B , D ] ⊢F ⊢G A≡A [F] [G] G-ext) = ⊢A
escape (emb′ 0<1 [A]) = escape [A]
-- Reducible type equality respect the equality relation.
escapeEq : ∀ {l Γ A B} → ([A] : Γ ⊩⟨ l ⟩ A)
→ Γ ⊩⟨ l ⟩ A ≡ B / [A]
→ Γ ⊢ A ≅ B
escapeEq (Uᵣ′ l' l< ⊢Γ) (U₌ PE.refl) = ≅-Urefl ⊢Γ
escapeEq (ℕᵣ [ ⊢A , ⊢B , D ]) (ιx (ℕ₌ D′)) = ≅-red D D′ ℕₙ ℕₙ (≅-ℕrefl (wf ⊢A))
escapeEq (ne′ K D neK K≡K) (ιx (ne₌ M D′ neM K≡M)) = ≅-red (red D) (red D′) (ne neK) (ne neM) (~-to-≅ K≡M)
escapeEq (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) =
≅-red (red D) D′ Πₙ Πₙ A≡B
escapeEq (emb′ 0<1 A) (ιx A≡B) = escapeEq A A≡B
-- Reducible terms are well-formed.
escapeTerm : ∀ {l Γ A t} → ([A] : Γ ⊩⟨ l ⟩ A)
→ Γ ⊩⟨ l ⟩ t ∷ A / [A]
→ Γ ⊢ t ∷ A
escapeTerm (Uᵣ′ l′ l< ⊢Γ) (Uₜ A [ ⊢t , ⊢u , d ] typeA A≡A [A]) = ⊢t
escapeTerm (ℕᵣ D) (ιx (ℕₜ n [ ⊢t , ⊢u , d ] t≡t prop)) =
conv ⊢t (sym (subset* (red D)))
escapeTerm (ne′ K D neK K≡K) (ιx (neₜ k [ ⊢t , ⊢u , d ] nf)) =
conv ⊢t (sym (subset* (red D)))
escapeTerm (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext)
(f , [ ⊢t , ⊢u , d ] , funcF , f≡f , [f] , [f]₁) =
conv ⊢t (sym (subset* (red D)))
escapeTerm (emb′ 0<1 A) (ιx t) = escapeTerm A t
-- Reducible term equality respect the equality relation.
escapeTermEq : ∀ {l Γ A t u} → ([A] : Γ ⊩⟨ l ⟩ A)
→ Γ ⊩⟨ l ⟩ t ≡ u ∷ A / [A]
→ Γ ⊢ t ≅ u ∷ A
escapeTermEq (Uᵣ′ l′ l< ⊢Γ) (Uₜ₌ A B d d′ typeA typeB A≡B [A] [B] [A≡B]) =
≅ₜ-red (id (Uⱼ ⊢Γ)) (redₜ d) (redₜ d′) Uₙ (typeWhnf typeA) (typeWhnf typeB) A≡B
escapeTermEq (ℕᵣ D) (ιx (ℕₜ₌ k k′ d d′ k≡k′ prop)) =
let natK , natK′ = split prop
in ≅ₜ-red (red D) (redₜ d) (redₜ d′) ℕₙ
(naturalWhnf natK) (naturalWhnf natK′) k≡k′
escapeTermEq (ne′ K D neK K≡K)
(ιx (neₜ₌ k m d d′ (neNfₜ₌ neT neU t≡u))) =
≅ₜ-red (red D) (redₜ d) (redₜ d′) (ne neK) (ne neT) (ne neU)
(~-to-≅ₜ t≡u)
escapeTermEq (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext)
(Πₜ₌ f g d d′ funcF funcG f≡g [f] [g] [f≡g]) =
≅ₜ-red (red D) (redₜ d) (redₜ d′) Πₙ (functionWhnf funcF) (functionWhnf funcG) f≡g
escapeTermEq (emb′ 0<1 A) (ιx t≡u) = escapeTermEq A t≡u
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_779.asm | ljhsiun2/medusa | 9 | 24705 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x1c136, %rsi
lea addresses_A_ht+0x3fd6, %rdi
clflush (%rdi)
nop
nop
nop
nop
sub %r14, %r14
mov $64, %rcx
rep movsw
nop
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_A_ht+0x1a74e, %r14
nop
nop
nop
nop
sub %rsi, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
movups %xmm0, (%r14)
nop
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_D_ht+0x258e, %rsi
lea addresses_A_ht+0x17fd6, %rdi
xor $35154, %r11
mov $22, %rcx
rep movsw
nop
nop
nop
and %rdi, %rdi
lea addresses_WT_ht+0xd2f6, %rdx
nop
nop
nop
nop
dec %r14
mov (%rdx), %rsi
nop
nop
nop
nop
nop
cmp $48783, %rdx
lea addresses_normal_ht+0x167d6, %rsi
lea addresses_D_ht+0x67d6, %rdi
clflush (%rdi)
nop
nop
nop
nop
and %r10, %r10
mov $8, %rcx
rep movsq
nop
nop
nop
nop
cmp $20630, %rsi
lea addresses_normal_ht+0xeec6, %r11
nop
nop
nop
sub %rcx, %rcx
mov (%r11), %rdi
nop
sub $580, %r10
lea addresses_WC_ht+0xaed6, %rsi
lea addresses_WC_ht+0x2f66, %rdi
nop
nop
sub $8393, %rdx
mov $35, %rcx
rep movsb
nop
nop
nop
nop
nop
inc %rdx
lea addresses_D_ht+0xbd6, %rsi
lea addresses_UC_ht+0x58d6, %rdi
nop
nop
nop
add %rdx, %rdx
mov $8, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $8375, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %rax
push %rbx
push %rdi
push %rsi
// Store
lea addresses_WT+0xf7d6, %r11
nop
nop
nop
nop
nop
add %r13, %r13
mov $0x5152535455565758, %rbx
movq %rbx, %xmm3
movups %xmm3, (%r11)
nop
nop
nop
nop
nop
xor %r13, %r13
// Store
lea addresses_PSE+0x696, %rdi
add $59250, %r15
mov $0x5152535455565758, %r13
movq %r13, %xmm0
movups %xmm0, (%rdi)
cmp $53418, %rax
// Faulty Load
lea addresses_WT+0xf7d6, %rbx
dec %r13
mov (%rbx), %di
lea oracles, %r13
and $0xff, %rdi
shlq $12, %rdi
mov (%r13,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rbx
pop %rax
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}}
{'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
*/
|
tests/function_simple/err_argument_type1.asm | dommilosz/customasm | 0 | 169701 | #fn add1(value) => value + 1
#d8 add1(2 > 1) ; error: failed / error:_:1: invalid argument types |
PMOO/ADA/Lab_1_2_Ada/cine.adb | usainzg/EHU | 0 | 24753 | <reponame>usainzg/EHU
WITH Ada.Text_Io;
USE Ada.Text_Io;
WITH Salas;
PACKAGE BODY Cine IS
MAX_SALAS : CONSTANT := 30;
TYPE Arr_Salas IS ARRAY (1 .. MAX_SALAS) OF Sala;
Nombre_Cine : String (1 .. 7);
Cont : Integer;
Salas_Arr : Arr_Salas;
PROCEDURE Crear_Cine (
Nombre : String) IS
Nombre_Cine_Aux : String (1 .. Integer'Min (7, Nombre'Length)) := (OTHERS => ' ');
BEGIN
Nombre_Cine_Aux := Nombre;
Nombre_Cine := Nombre_Cine_Aux;
Cont := 0;
END Crear_Cine;
FUNCTION Nombre_Cine_F
RETURN String IS
BEGIN
RETURN Nombre_Cine;
END Nombre_Cine_F;
PROCEDURE Anadir_Sala (
S : Sala) IS
BEGIN
IF Cont /= Salas_Arr'Last THEN
Cont := Cont + 1;
Salas.Copiar_Sala(Salas_Arr(Cont), S);
END IF;
END Anadir_Sala;
PROCEDURE Vender_LoCalidades_Contiguas (
Peli : String;
Num_Entradas : Positive) IS
BEGIN
FOR I IN 1 .. Cont LOOP
IF Salas.La_PeliCula(Salas_Arr(I)) = Peli THEN
Salas.Vender_LoCalidades_Contiguas(Salas_Arr(I), Num_Entradas);
RETURN;
END IF;
END LOOP;
END Vender_LoCalidades_Contiguas;
PROCEDURE Mostrar_Cartelera IS
BEGIN
Put_Line("----Cartelera del Cine: "&Nombre_Cine&"----");
FOR I IN 1 .. Cont LOOP
Put_Line(Integer'Image(I)&". Sala"&
Salas.Nombre_Sala(Salas_Arr(I))&
": -> "&Salas.La_Pelicula(Salas_Arr(I)));
New_Line;
END LOOP;
END Mostrar_Cartelera;
PROCEDURE Cambiar_Peliculas (
Peli_Mostrando,
Peli_Nueva : String) IS
BEGIN
FOR I IN 1 .. Cont LOOP
IF Salas.La_Pelicula(Salas_Arr(I)) = Peli_Mostrando THEN
Salas.Modificar_Pelicula(Salas_Arr(I), Peli_Nueva);
END IF;
END LOOP;
END Cambiar_Peliculas;
PROCEDURE Mostrar_Salas IS
BEGIN
FOR I IN 1 .. Cont LOOP
Put_Line(Integer'Image(I)&". Sala: "&Salas.Nombre_Sala(Salas_Arr(I)));
Salas.Mostrar_Sala(Salas_Arr(I));
New_Line;
END LOOP;
END Mostrar_Salas;
END Cine;
|
agda-stdlib/src/Relation/Binary/Reasoning/Base/Partial.agda | DreamLinuxer/popl21-artifact | 5 | 9197 | <filename>agda-stdlib/src/Relation/Binary/Reasoning/Base/Partial.agda
------------------------------------------------------------------------
-- The Agda standard library
--
-- The basic code for equational reasoning with a partial relation
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary
module Relation.Binary.Reasoning.Base.Partial
{a ℓ} {A : Set a} (_∼_ : Rel A ℓ) (trans : Transitive _∼_)
where
open import Level using (_⊔_)
open import Relation.Binary.PropositionalEquality.Core as P
using (_≡_)
infix 4 _IsRelatedTo_
infix 3 _∎⟨_⟩
infixr 2 step-∼ step-≡ step-≡˘
infixr 2 _≡⟨⟩_
infix 1 begin_
------------------------------------------------------------------------
-- Definition of "related to"
-- This seemingly unnecessary type is used to make it possible to
-- infer arguments even if the underlying equality evaluates.
data _IsRelatedTo_ (x y : A) : Set ℓ where
relTo : (x∼y : x ∼ y) → x IsRelatedTo y
------------------------------------------------------------------------
-- Reasoning combinators
-- Note that the arguments to the `step`s are not provided in their
-- "natural" order and syntax declarations are later used to re-order
-- them. This is because the `step` ordering allows the type-checker to
-- better infer the middle argument `y` from the `_IsRelatedTo_`
-- argument (see issue 622).
--
-- This has two practical benefits. First it speeds up type-checking by
-- approximately a factor of 5. Secondly it allows the combinators to be
-- used with macros that use reflection, e.g. `Tactic.RingSolver`, where
-- they need to be able to extract `y` using reflection.
-- Beginning of a proof
begin_ : ∀ {x y} → x IsRelatedTo y → x ∼ y
begin relTo x∼y = x∼y
-- Standard step with the relation
step-∼ : ∀ x {y z} → y IsRelatedTo z → x ∼ y → x IsRelatedTo z
step-∼ _ (relTo y∼z) x∼y = relTo (trans x∼y y∼z)
-- Step with a non-trivial propositional equality
step-≡ : ∀ x {y z} → y IsRelatedTo z → x ≡ y → x IsRelatedTo z
step-≡ _ x∼z P.refl = x∼z
-- Step with a flipped non-trivial propositional equality
step-≡˘ : ∀ x {y z} → y IsRelatedTo z → y ≡ x → x IsRelatedTo z
step-≡˘ _ x∼z P.refl = x∼z
-- Step with a trivial propositional equality
_≡⟨⟩_ : ∀ x {y} → x IsRelatedTo y → x IsRelatedTo y
_ ≡⟨⟩ x∼y = x∼y
-- Termination step
_∎⟨_⟩ : ∀ x → x ∼ x → x IsRelatedTo x
_ ∎⟨ x∼x ⟩ = relTo x∼x
-- Syntax declarations
syntax step-∼ x y∼z x∼y = x ∼⟨ x∼y ⟩ y∼z
syntax step-≡ x y≡z x≡y = x ≡⟨ x≡y ⟩ y≡z
syntax step-≡˘ x y≡z y≡x = x ≡˘⟨ y≡x ⟩ y≡z
|
src/yaml/yaml-tags.ads | My-Colaborations/dynamo | 32 | 16944 | <reponame>My-Colaborations/dynamo<filename>src/yaml/yaml-tags.ads
-- part of AdaYaml, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "copying.txt"
package Yaml.Tags is
Question_Mark : constant Text.Reference; -- "?"
Exclamation_Mark : constant Text.Reference; -- "!"
Mapping : constant Text.Reference; -- "!!map"
Sequence : constant Text.Reference; -- "!!seq"
String : constant Text.Reference; -- "!!str"
Boolean : constant Text.Reference; -- "!!bool"
Null_Tag : constant Text.Reference; -- "!!null"
private
Question_Mark_Holder : constant Text.Constant_Instance :=
Text.Hold ("?");
Exclamation_Mark_Holder : constant Text.Constant_Instance :=
Text.Hold ("!");
Mapping_Holder : constant Text.Constant_Instance :=
Text.Hold ("tag:yaml.org,2002:map");
Sequence_Holder : constant Text.Constant_Instance :=
Text.Hold ("tag:yaml.org,2002:seq");
String_Holder : constant Text.Constant_Instance :=
Text.Hold ("tag:yaml.org,2002:str");
Boolean_Holder : constant Text.Constant_Instance :=
Text.Hold ("tag:yaml.org,2002:bool");
Null_Holder : constant Text.Constant_Instance :=
Text.Hold ("tag:yaml.org,2002:null");
Question_Mark : constant Text.Reference := Text.Held (Question_Mark_Holder);
Exclamation_Mark : constant Text.Reference :=
Text.Held (Exclamation_Mark_Holder);
Mapping : constant Text.Reference := Text.Held (Mapping_Holder);
Sequence : constant Text.Reference := Text.Held (Sequence_Holder);
String : constant Text.Reference := Text.Held (String_Holder);
Boolean : constant Text.Reference := Text.Held (Boolean_Holder);
Null_Tag : constant Text.Reference := Text.Held (Null_Holder);
end Yaml.Tags;
|
programs/oeis/022/A022133.asm | karttu/loda | 0 | 170522 | <gh_stars>0
; A022133: Fibonacci sequence beginning 4, 15.
; 4,15,19,34,53,87,140,227,367,594,961,1555,2516,4071,6587,10658,17245,27903,45148,73051,118199,191250,309449,500699,810148,1310847,2120995,3431842,5552837,8984679,14537516
mov $4,4
mov $5,15
lpb $0,1
sub $0,1
add $3,$5
add $3,$4
sub $3,$4
mov $5,$4
mov $4,$2
add $4,$3
lpe
add $1,$4
|
Transynther/x86/_processed/US/_st_/i3-7100_9_0x84_notsx.log_21829_2738.asm | ljhsiun2/medusa | 9 | 88896 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x11d8f, %rsi
lea addresses_WT_ht+0x10b4f, %rdi
clflush (%rsi)
nop
nop
nop
nop
and $60235, %r10
mov $123, %rcx
rep movsw
sub %r12, %r12
lea addresses_A_ht+0xf28f, %rdx
nop
nop
nop
xor $61768, %rbx
movups (%rdx), %xmm5
vpextrq $0, %xmm5, %r10
nop
nop
nop
nop
inc %rbx
lea addresses_WT_ht+0x568f, %rdi
nop
nop
nop
nop
nop
dec %rsi
movl $0x61626364, (%rdi)
nop
nop
nop
nop
sub %r10, %r10
lea addresses_WC_ht+0x1256f, %rsi
nop
nop
nop
add %rcx, %rcx
and $0xffffffffffffffc0, %rsi
vmovaps (%rsi), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %rdi
nop
nop
dec %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r15
push %r8
push %rbp
push %rdi
// Store
mov $0x78f, %r11
nop
nop
nop
nop
cmp %r15, %r15
mov $0x5152535455565758, %r13
movq %r13, %xmm4
vmovups %ymm4, (%r11)
nop
nop
nop
xor $53970, %r13
// Store
lea addresses_UC+0xcd9f, %rdi
nop
nop
nop
nop
and $63193, %r15
mov $0x5152535455565758, %r13
movq %r13, %xmm0
movups %xmm0, (%rdi)
nop
nop
nop
inc %rdi
// Store
lea addresses_D+0xd753, %r15
clflush (%r15)
nop
nop
nop
nop
nop
xor %rbp, %rbp
movw $0x5152, (%r15)
nop
nop
nop
nop
nop
xor $60992, %r11
// Load
lea addresses_A+0x1558f, %r15
nop
add %r8, %r8
movups (%r15), %xmm1
vpextrq $0, %xmm1, %r10
nop
nop
nop
and $25037, %r10
// Store
lea addresses_US+0x1d58f, %rbp
sub %r10, %r10
mov $0x5152535455565758, %r8
movq %r8, (%rbp)
nop
nop
nop
nop
sub %rdi, %rdi
// Store
lea addresses_WC+0x14b0f, %r10
clflush (%r10)
nop
nop
nop
cmp $35190, %r13
movw $0x5152, (%r10)
dec %r11
// Store
lea addresses_UC+0x1aef, %r8
nop
xor $59766, %r13
mov $0x5152535455565758, %rdi
movq %rdi, %xmm1
movups %xmm1, (%r8)
nop
nop
and $11358, %r10
// Faulty Load
lea addresses_US+0x758f, %rbp
nop
nop
nop
nop
nop
inc %r8
movb (%rbp), %r13b
lea oracles, %r11
and $0xff, %r13
shlq $12, %r13
mov (%r11,%r13,1), %r13
pop %rdi
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_US', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'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
*/
|
Task/Align-columns/Ada/align-columns.ada | LaudateCorpus1/RosettaCodeData | 1 | 12952 | with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Ada.Text_IO; use Ada.Text_IO;
with Strings_Edit; use Strings_Edit;
procedure Column_Aligner is
Text : constant String :=
"Given$a$text$file$of$many$lines,$where$fields$within$a$line$" & NUL &
"are$delineated$by$a$single$'dollar'$character,$write$a$program" & NUL &
"that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$" & NUL &
"column$are$separated$by$at$least$one$space." & NUL &
"Further,$allow$for$each$word$in$a$column$to$be$either$left$" & NUL &
"justified,$right$justified,$or$center$justified$within$its$column." & NUL;
File : File_Type;
Width : array (1..1_000) of Natural := (others => 0);
Line : String (1..200);
Column : Positive := 1;
Start : Positive := 1;
Pointer : Positive;
begin
Create (File, Out_File, "columned.txt");
-- Determining the widths of columns
for I in Text'Range loop
case Text (I) is
when '$' | NUL =>
Width (Column) := Natural'Max (Width (Column), I - Start + 1);
Start := I + 1;
if Text (I) = NUL then
Column := 1;
else
Column := Column + 1;
end if;
when others =>
null;
end case;
end loop;
-- Formatting
for Align in Alignment loop
Column := 1;
Start := 1;
Pointer := 1;
for I in Text'Range loop
case Text (I) is
when '$' | NUL =>
Put -- Formatted output of a word
( Destination => Line,
Pointer => Pointer,
Value => Text (Start..I - 1),
Field => Width (Column),
Justify => Align
);
Start := I + 1;
if Text (I) = NUL then
Put_Line (File, Line (1..Pointer - 1));
Pointer := 1;
Column := 1;
else
Column := Column + 1;
end if;
when others =>
null;
end case;
end loop;
end loop;
Close (File);
end Column_Aligner;
|
oeis/207/A207735.asm | neoneye/loda-programs | 11 | 96359 | <filename>oeis/207/A207735.asm
; A207735: Expansion of f(-x^2, x^3)^2 / f(x, -x^2) in powers of x where f() is Ramanujan's two-variable theta function.
; Submitted by <NAME>
; 1,-1,0,1,0,0,0,1,-1,0,0,0,0,0,-1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,-1
mul $0,5
seq $0,121373 ; Expansion of f(x) = f(x, -x^2) in powers of x where f(, ) is Ramanujan's general theta function.
|
oeis/217/A217471.asm | neoneye/loda-programs | 11 | 160635 | <filename>oeis/217/A217471.asm
; A217471: Partial sum of fifth power of the even-indexed Fibonacci numbers.
; Submitted by <NAME>(s1.)
; 0,1,244,33012,4117113,507401488,62424765712,7678070811369,944346243245076,116147016764564500,14285140634333292625,1756956185432949082176,216091326285380812359744,26577476188001703626949937,3268813479996841742752059988,402037480566992963752454459988,49447341296324188541988471750537,6081620941968457543428960816313744,747989928520844577825484377565541776,91996679587122284700746176696496273625,11314843599287526814533372475024756120500,1391633766032778795069367841287376332823476
lpb $0
mov $2,$0
sub $0,1
seq $2,215044 ; a(n) = F(2*n)^5 with F=A000045 (Fibonacci numbers).
add $1,$2
lpe
mov $0,$1
|
src/002/moving_thing.adb | xeenta/learning-ada | 0 | 20340 | package body Moving_Thing is
procedure Faster (T : in out Thing;
D : in Direction;
M : in Float) is
begin
null; -- null statement
end Faster;
procedure Stop (T : in out Thing) is
begin
T.Spd.Vx := 0.0;
T.Spd.Vy := 0.0;
T.Spd.Vz := 0.0;
end;
end Moving_Thing;
|
Demo1/Stage2/stage2.asm | mooseman/plan_42 | 7 | 8460 | <filename>Demo1/Stage2/stage2.asm
;*********************************************
; Stage2.asm
; - Second Stage Bootloader
;
; Operating Systems Development Series
;*********************************************
org 0x0 ; offset to 0, we will set segments later
bits 16 ; we are still in real mode
; we are loaded at linear address 0x10000
jmp main ; jump to main
;*************************************************;
; Prints a string
; DS=>SI: 0 terminated string
;************************************************;
Print:
lodsb ; load next byte from string from SI to AL
or al, al ; Does AL=0?
jz PrintDone ; Yep, null terminator found-bail out
mov ah, 0eh ; Nope-Print the character
int 10h
jmp Print ; Repeat until null terminator found
PrintDone:
ret ; we are done, so return
;*************************************************;
; Second Stage Loader Entry Point
;************************************************;
main:
cli ; clear interrupts
push cs ; Insure DS=CS
pop ds
mov si, Msg
call Print
cli ; clear interrupts to prevent triple faults
hlt ; hault the syst
;*************************************************;
; Data Section
;************************************************;
Msg db "Preparing to load operating system...",13,10,0
|
oeis/349/A349854.asm | neoneye/loda-programs | 11 | 171369 | ; A349854: Expansion of Sum_{k>=0} k^3 * x^k/(1 + k * x).
; Submitted by <NAME>
; 0,1,7,12,14,49,13,8,596,-1967,4011,9764,-128878,664545,-1837695,-2388448,67004968,-478198239,1994890287,-1669470404,-56929813514,615188040657,-3794477505067,12028579020088,50780206473820,-1172949397923535,10766410530764819,-61183127006113196
lpb $0
add $3,1
mov $2,$3
pow $2,$0
sub $0,1
mul $1,-1
mul $2,$3
mul $2,$3
add $1,$2
lpe
mov $0,$1
|
alloy4fun_models/trainstlt/models/12/wryTtWhCqbRqihy8y.als | Kaixi26/org.alloytools.alloy | 0 | 1685 | open main
pred idwryTtWhCqbRqihy8y_prop13 {
( all t:Train | no t.pos since no t.pos)
}
pred __repair { idwryTtWhCqbRqihy8y_prop13 }
check __repair { idwryTtWhCqbRqihy8y_prop13 <=> prop13o } |
boot/print_pm.asm | zehric/hollowos | 0 | 4769 | [bits 32]
VIDEO_MEMORY equ 0xb8000
WHITE_ON_BLACK equ 0x0f ; white color
print_string_pm:
pusha
mov edx, VIDEO_MEMORY
.loop:
mov al, [ebx]
mov ah, WHITE_ON_BLACK
cmp al, 0 ; check if end of string
je .done
mov [edx], ax ; store character + attribute in video memory
add ebx, 1 ; next char
add edx, 2 ; next video memory position
jmp .loop
.done:
popa
ret
|
Transynther/x86/_processed/NC/_st_zr_sm_/i7-7700_9_0x48.log_21829_1287.asm | ljhsiun2/medusa | 9 | 7907 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xc6f2, %rsi
lea addresses_UC_ht+0x4c6, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor %r11, %r11
mov $104, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %rax, %rax
lea addresses_normal_ht+0x19f26, %r10
nop
nop
nop
nop
add $61838, %r15
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
movups %xmm6, (%r10)
inc %r11
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r9
push %rbx
push %rdx
// Store
lea addresses_WC+0x1ec46, %r9
nop
add %rdx, %rdx
mov $0x5152535455565758, %r11
movq %r11, (%r9)
nop
sub $23660, %r11
// Store
lea addresses_RW+0x1e46, %r13
nop
nop
nop
nop
xor %r14, %r14
mov $0x5152535455565758, %r11
movq %r11, (%r13)
nop
nop
add %r13, %r13
// Store
mov $0x2a38800000000986, %r12
nop
dec %r11
mov $0x5152535455565758, %r9
movq %r9, %xmm7
vmovups %ymm7, (%r12)
nop
nop
nop
and $45295, %rbx
// Store
lea addresses_WT+0x6d46, %r12
nop
nop
nop
and $8363, %rbx
mov $0x5152535455565758, %r13
movq %r13, %xmm7
vmovups %ymm7, (%r12)
nop
nop
and $17343, %rdx
// Faulty Load
mov $0x2a38800000000986, %r12
nop
xor %rdx, %rdx
mov (%r12), %ebx
lea oracles, %r13
and $0xff, %rbx
shlq $12, %rbx
mov (%r13,%rbx,1), %rbx
pop %rdx
pop %rbx
pop %r9
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'58': 21599, '00': 230}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
data/maps/spawn_points.asm | Trap-Master/spacworld97-thingy | 0 | 165514 | <gh_stars>0
spawn: MACRO
; map, x, y
map_id \1
db \2, \3
ENDM
SpawnPoints:
; entries correspond to SPAWN_* constants
spawn REDS_HOUSE_2F, 3, 3
spawn CINNABAR_ISLAND, 11, 12
spawn ROUTE_23, 9, 6
spawn SHIZUOKA, 5, 13
spawn KYOTO, 27, 29
spawn OSAKA, 25, 15
spawn KOCHI, 31, 12
spawn TOTTORI, 15, 6
spawn HIROSHIMA, 3, 14
spawn KITAKYUSHU, 33, 17
spawn NIIGATA, 7, 9
spawn SADO, 9, 11
spawn AOMORI, 13, 19
spawn HAKODATE, 13, 16
spawn SENDAI, 13, 16
spawn TOKYO, 9, 46
spawn FUJI, 9, 46
spawn NIHON_LEAGUE, 9, 46
spawn FAST_SHIP_CABINS_SW_SSW_NW, 6, 2
spawn N_A, -1, -1
|
data/Updated_0x37_Event_Command/0x37 - Item.asm | nic0lette/ffr-hmsj | 1 | 3115 | <gh_stars>1-10
@Rewriting the item give/take/check command to allow for immediate parameters
@by setting bit 0x40 in the mode parameter
@However, you must use the 12-length command!
@For 0x5E318
.thumb
push {r4-r7,r14}
mov r7,r10
mov r6,r9
mov r5,r8
push {r5-r7}
mov r10,r0
ldr r4,GetVarMem
bl Longcall_4
mov r8,r0
ldr r0,EventStructPointer
add r0,r10
ldr r0,[r0]
ldr r0,[r0]
mov r9,r0 @Address of command in ROM
mov r3,r9 @Copy to r3
ldrb r1,[r0,#0x2] @Loading command's mode byte
mov r0,#0x40
and r0,r1
beq CheckTradeFlag
ldrb r6,[r3,#0x8] @Load item type
ldrb r7,[r3,#0xA] @And item ID
b CommandSort @Merge with other branches now
CheckTradeFlag:
mov r0,#0x80 @Are we looking for a dwarf trade quest item?
and r0,r1
cmp r0,#0x0
bne TradeQuestSelection
ldrb r1,[r3,#0x3] @If not, load event item index from command
b LoadItemFromTable
TradeQuestSelection: @If so, advance to the input for our permutation of the quest
ldr r1,TradeQuestSelectionParams
ldr r0,TradeQuestCounter
add r0,r8
ldrb r0,[r0]
lsl r0,r0,#0x2
ldrb r2,[r3,#0x3] @Loading quest index from command
add r0,r0,r2
add r1,#0x2
add r0,r0,r1
ldrb r1,[r0] @Use that to get the event item index
LoadItemFromTable:
ldr r0,EventItemList
lsl r1,r1,#0x1 @Multiply input by 2...
ldrb r6,[r0,r1] @Load item type
add r0,#0x1
ldrb r7,[r0,r1] @And item ID
CommandSort:
ldrb r0,[r3,#0x2] @Reload command mode byte
mov r1,#0x3F @Strip flags from mode byte
and r1,r0
cmp r1,#0x1 @Are we adding, removing or checking for an item?
beq RemoveItem
cmp r1,#0x1
bgt CommandSort_2
cmp r1,#0x0
beq AddItem
b MoveToNextEvent
CommandSort_2:
cmp r1,#0x2
beq CheckForItem
b MoveToNextEvent
AddItem:
mov r0,r8
mov r1,r6
mov r2,r7
mov r3,#0x1
ldr r4,AddItemToInventory
bl Longcall_4
ldr r0,EventStructPointer
add r0,r10
ldr r5,[r0]
ldr r0,UnkIndex
add r5,r5,r0
mov r0,r8
mov r1,r6
mov r2,r7
mov r3,#0x1
ldr r4,GetItemNameText
bl Longcall_4
mov r1,r0
mov r0,r5
ldr r4,CopyString
bl Longcall_4
b MoveToNextEvent
RemoveItem:
mov r0,r8
mov r1,r6
mov r2,r7
mov r3,#0x1
ldr r4,RemoveItemFromInventory
bl Longcall_4
b MoveToNextEvent
CheckForItem:
mov r0,r8
mov r1,r6
mov r2,r7
ldr r4,CountItemInInventory
bl Longcall_4
cmp r0,#0x0
bgt MoveToNextEvent
ldr r0,EventStructPointer
add r0,r10
ldr r1,[r0]
mov r2,r9
ldr r0,[r2,#0x4]
str r0,[r1]
b End
MoveToNextEvent:
ldr r0,EventStructPointer
add r0,r10
ldr r2,[r0]
mov r3,r9
ldrb r1,[r3,#0x1]
ldr r0,[r2]
add r0,r0,r1
str r0,[r2]
End:
mov r0,#0x1
pop {r3-r5}
mov r8,r3
mov r9,r4
mov r10,r5
pop {r4-r7}
pop {r1}
bx r1
.align 2
TradeQuestCounter:
.long 0x0000074C
UnkIndex:
.long 0x00001A5C
EventStructPointer:
.long 0x00007DAC
AddItemToInventory:
.long 0x0807EA15
GetItemNameText:
.long 0x0807EEB5
CountItemInInventory:
.long 0x0807EFBD
RemoveItemFromInventory:
.long 0x0807F029
GetVarMem:
.long 0x0807F15D
CopyString:
.long 0x08192355
EventItemList:
.long 0x082183B4
TradeQuestSelectionParams:
.long 0x08218954
Longcall_4:
bx r4
|
4-high/gel/source/gel-camera.ads | charlie5/lace-alire | 1 | 25082 | <reponame>charlie5/lace-alire
with
gel.World,
openGL.Surface,
openGL.Camera;
package gel.Camera
--
-- Models a camera.
--
is
type Item is new openGL.Camera.item with private;
type View is access all Camera.item'Class;
type Views is array (Positive range <>) of View;
---------
-- Forge
--
procedure free (Self : in out View);
--------------
-- Operations
--
procedure render (Self : in out Item; the_World : in gel.World.view;
To : in openGL.Surface.view);
private
type Item is new openGL.Camera.item with null record;
end gel.Camera;
|
test/maths/maths.ads | Fabien-Chouteau/sdlada | 89 | 23521 | -- -*- Mode: Ada -*-
-- Filename : maths.ads
-- Description : Sample shared library using an Ada and a C function as an example.
-- Author : <NAME>
-- Created On : Sun Oct 27 17:50:33 2013
package Maths is
function Add (A, B : in Integer) return Integer with
Export => True,
Convention => Ada,
External_Name => "Add";
function Sub (A, B : in Integer) return Integer with
Import => True,
Convention => C,
External_Name => "sub";
end Maths;
|
test/Succeed/Issue754.agda | shlevy/agda | 1,989 | 6464 | -- Andreas, 2012-11-13 issue reported by joshkos
module Issue754 where
data RDesc (I : Set) : Set₁ where
∎ : RDesc I
ṿ : (i : I) → RDesc I
σ : (S : Set) (D : S → RDesc I) → RDesc I
data ROrn {I J} (e : J → I) : RDesc I → RDesc J → Set₁ where
∎ : ROrn e ∎ ∎
ṿ : ∀ j i → ROrn e (ṿ i) (ṿ j)
σ : (S : Set) → ∀ {D E} (O : ∀ s → ROrn e (D s) (E s)) → ROrn e (σ S D) (σ S E)
Δ : (T : Set) → ∀ {D E} (O : ∀ t → ROrn e D (E t)) → ROrn e D (σ T E)
scROrn : ∀ {I J K} {e : J → I} {f : K → J} {D E F} → ROrn e D E → ROrn f E F → ROrn (λ x → e (f x)) D F
scROrn ∎ ∎ = ∎
scROrn {e = e} ∎ (Δ T P) = Δ T λ t → scROrn {e = e} ∎ (P t) -- culprit?
scROrn (ṿ j i) (ṿ k .j) = ṿ k i
scROrn {e = e} (ṿ j i) (Δ T P) = Δ T λ t → scROrn {e = e} (ṿ j i) (P t) -- culprit?
scROrn (σ S O) (σ .S P) = σ S λ s → scROrn (O s) (P s)
scROrn (σ S O) (Δ T P) = Δ T λ t → scROrn (σ S O) (P t) -- culprit?
scROrn (Δ T O) (σ .T P) = Δ T λ t → scROrn (O t) (P t)
scROrn (Δ T O) (Δ T' P) = Δ T' λ t → scROrn (Δ T O) (P t)
-- Internal error message was:
-- blowUpSparseVec (n = 2) aux i=3 j=3 length l = 2
-- The error was triggered by some operations on matrix-shaped orders
-- which did not preserve the internal invariants of sparse matrices.
|
oeis/349/A349594.asm | neoneye/loda-programs | 11 | 14721 | ; A349594: Number of 2 X n mazes that can be navigated from the top left corner to the bottom right corner.
; Submitted by <NAME>
; 1,7,40,216,1144,6016,31552,165312,865792,4533760,23739904,124305408,650874880,3408031744,17844699136,93436084224,489237741568,2561682178048,13413142233088,70232124948480,367740181282816,1925512588951552,10082114810675200,52790638512439296
mov $3,1
lpb $0
sub $0,1
sub $3,$1
add $1,$3
sub $2,$1
mul $3,8
add $3,$2
lpe
mov $0,$3
|
oeis/028/A028123.asm | neoneye/loda-programs | 11 | 245535 | <gh_stars>10-100
; A028123: Expansion of 1/((1-4x)(1-5x)(1-8x)(1-12x)).
; Submitted by <NAME>
; 1,29,545,8485,119481,1586589,20323345,254479445,3140238761,38383465549,466251023745,5640435145605,68049758226841,819519225638909,9857637166837745,118479045968342965,1423248497110019721
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,18250 ; Expansion of 1/((1-4x)(1-5x)(1-8x)).
mul $1,12
add $1,$0
lpe
mov $0,$1
|
notes/thesis/report/LogicalFramework/UniversalQuantifier.agda | asr/fotc | 11 | 558 | <reponame>asr/fotc
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module LogicalFramework.UniversalQuantifier where
postulate D : Set
-- The universal quantifier type on D.
data ForAll (A : D → Set) : Set where
dfun : ((t : D) → A t) → ForAll A
dapp : {A : D → Set}(t : D) → ForAll A → A t
dapp t (dfun f) = f t
|
Cubical/Categories/Instances/AbGroups.agda | FernandoLarrain/cubical | 1 | 16250 | <reponame>FernandoLarrain/cubical
-- The category Ab of abelian groups
{-# OPTIONS --safe #-}
module Cubical.Categories.Instances.AbGroups where
open import Cubical.Algebra.AbGroup.Base
open import Cubical.Algebra.Group.MorphismProperties
open import Cubical.Categories.Category.Base
open import Cubical.Foundations.Prelude
module _ {ℓ : Level} where
open Category
AbGroupCategory : Category (ℓ-suc ℓ) ℓ
AbGroupCategory .ob = AbGroup ℓ
AbGroupCategory .Hom[_,_] = AbGroupHom
AbGroupCategory .id = idGroupHom
AbGroupCategory ._⋆_ = compGroupHom
AbGroupCategory .⋆IdL f = GroupHom≡ refl
AbGroupCategory .⋆IdR f = GroupHom≡ refl
AbGroupCategory .⋆Assoc f g h = GroupHom≡ refl
AbGroupCategory .isSetHom = isSetGroupHom
|
Programas Ada95/inout.ada | mendoza/mini-ada95 | 0 | 13519 | <gh_stars>0
------ USANDO IN OUT
procedure Hello is
a: Integer;
b: Float := 2.0 ;
c: Boolean := false;
function uno(a,b:out Boolean; x,y :in Integer) return Boolean is
begin
Put(one);
return a;
end uno;
function dos(a: in out Float; x,y :in Integer) return Boolean is
begin
Put(one);
return a;
end dos;
begin
c := dos(c);
Put(b);
end Hello; |
P6_all/cmp/7/mips7.asm | Tantor-D/Computer-Organization | 0 | 166207 | <reponame>Tantor-D/Computer-Organization<gh_stars>0
#the first part is about the cal_r stall:all about load instruction will cause the stall.
ori $1,$0,-100
lui $2,100
add $1,$2,$1
sw $1,0($0)
lw $2,0($0)
addu $3,$2,$0#lw-addu-rs:stall
lw $3,0($0)
subu $4,$0,$3#lw-subu-rt:stall
lh $4,0($0)
add $5,$4,$0#lh-add-rs:stall
lhu $5,2($0)
sub $6,$0,$5#lhu-sub-rt:stall
lb $6,0($0)
and $7,$6,$3#lb-and-rs:stall
lb $7,1($0)
or $8,$2,$7#lb-or-rt:stall
lbu $8,2($0)
xor $9,$8,$1#lbu-xor-rs:stall
lbu $9,3($0)
nor $10,$1,$9#lbu-nor-rt:stall
lbu $11,3($0)
slt $12,$11,$9#lbu-slt-rs:stall
lhu $13,0($0)
sltu $14,$12,$13#lhu-sltu-rt:stall
#the next part is about the forward function:all about the load-x-cal_r,cal_i-cal_r,shift-cal_r,jumpandlink-cal_r,mfhi/lo-cal_r
ori $1,$0,300
add $2,$1,$1#ori-add-rs,rt:forward
slt $3,$1,$2#add-slt-rt:forward
sltu $4,$3,$0#slt-sltu-rs:forward
ori $5,$0,-80
slt $6,$5,$0#ori-slt-rs:forward
ori $7,$0,-100
sltu $8,$7,$5#ori-sltu-rt:forward
slt $8,$7,$5
or $9,$7,$6
xor $10,$9,$9#or-xor-rs,rt:forward
nor $11,$10,$9#xor-nor-rs:forward
and $12,$11,$1#nor-and-rs:forward
sll $13,$7,5
or $14,$13,$0#sll-or-rs:forward
srl $15,$7,5
or $16,$0,$15#srl-or-rt:forward
sra $17,$5,5
or $18,$17,$0#sra-or-rs:forward
ori $19,$0,7
sllv $20,$5,$19
or $21,$20,$0#sllv-or-rs:forward
srlv $22,$5,$19
or $23,$22,$19#srlv-or-rs:forward
srav $24,$5,$19
or $25,$24,$0#srav-or-rs:forward
jal next1
nop
mult1:ori $1,$0,100
ori $2,$0,-100
mult $1,$2
mflo $3
add $3,$3,$5
jr $5
next1:addu $31,$31,$0#jal-nop-addu-rs:forward
sltu $30,$31,$0
jalr $5,$31
nop
end1:
#this part is mainly focus on the load-cal_i-rs type stall.
ori $1,$0,-100
lui $2,64
add $1,$2,$1
sw $1,0($0)
lw $2,0($0)
addi $3,$2,20#lw-addi-rs:stall
lh $3,0($0)
addiu $4,$3,-20#lh-addiu-rs:stall
lhu $4,2($0)
ori $5,$4,200#lhu-ori-rs:stall
lb $5,0($0)
xori $6,$5,74#lb-xori-rs:stall
lbu $6,0($0)
slti $7,$6,-20#lbu-slti-rs:stall
lbu $7,0($0)
sltiu $8,$7,-20#lbu-sltiu-rs:stall
lb $8,0($0)
slti $9,$8,0#lb-slti-rs:stall
lb $9,0($0)
sltiu $10,$9,0#lb-sltiu-rs:stall
#this part is mainly focus on the forward type.
lui $1,0xffff
addi $1,$1,1000#cal_i-cal_i-rs:forward
addiu $2,$1,0#addi-addiu-rs:forward
andi $3,$2,0xffff#addiu-andi-rs:forward
ori $4,$3,0#andi-ori-rs:forward
xori $5,$4,0xf0f0#ori-xori-rs-forward
ori $6,$0,-50
slti $7,$6,0#ori-slti-rs:forward
ori $6,$0,-90
sltiu $8,$6,0#ori-sltiu-rs:forward
addu $1,$1,$8
ori $1,$1,0#addu-ori:forward
lw $9,0($0)
nop
slti $9,$9,0#lw-otherinstruction-slti-ori:forward
ori $10,$0,-98
sll $11,$10,7
ori $12,$11,0#sll-ori-rs:forward
srl $13,$10,5
ori $14,$13,0#srl-ori-rs:forward
sra $15,$10,3
ori $16,$15,0#sra-ori-rs:forward
ori $17,$0,4
sllv $18,$10,$17
ori $18,$18,0#sllv-ori-rs:forward
srlv $19,$10,$17
ori $19,$19,0
srav $20,$10,$17
ori $20,$20,0#srav-ori-rs:forward
jal next2
nop
mult2:ori $21,$0,100
ori $22,$0,-23
divu $21,$22
addi $21,$21,1
mflo $23
subi $23,$23,1#mflo-subi-rs:forward.
mfhi $24
slti $25,$24,0#mfhi-slti-rs:forward
jr $5
nop
next2:addiu $31,$31,0#jal-nop-addiu-rs:forward
jalr $5,$31
nop
end2:
#the first part is mainly test the stall:load
ori $1,$0,4
sw $1,0($0)
ori $1,$0,100
sw $1,4($0)
lw $2,0($0)
lw $3,0($2)#lw-lw-rs:stall
lh $4,0($0)
lw $5,0($4)#lh-lw-rs:stall
lhu $6,0($0)
lw $7,0($6)#lhu-lw-rs:stall
lb $8,0($0)
lw $9,0($8)#lb-lw-rs:stall
lbu $10,0($0)
lw $11,0($10)#lbu-lw-rs:stall
#the second part is mainly test the forward
ori $1,$0,4
addu $2,$1,$0
lw $3,0($2)#addu-lw-rs:forward
addi $3,$0,4
lw $4,0($3)
ori $5,$0,1
sll $5,$5,2
lw $6,0($5)#shift-lw-rs:forward
mult3:jal next3
nop
ori $1,$0,4
ori $2,$0,1
multu $1,$2
mflo $3
lw $4,0($3)
jr $5
nop
next3:jalr $5,$31
nop
end3:
#the first part is focused on the stall.
ori $1,$0,4
sw $1,0($0)
ori $1,$0,0x5678
lui $2,0x1234
addu $1,$1,$2
sw $1,4($0)
lw $2,0($0)
sw $1,0($2)#lw-sw-rs:stall
lh $3,0($0)
sh $1,0($3)#lh-sh-rs:stall
lhu $4,0($0)
sh $1,2($4)#lhu-sh-rs:stall
lb $5,0($0)
sb $1,0($5)#lb-sb-rs:stall
lb $6,0($0)
sb $1,1($6)#lb-sb-rs:stall
#this part is mainly focused on the forward
li $30,0x12345678
ori $1,$0,4
addu $2,$0,$1
sw $30,0($2)#addu-sw-rs:forward
addu $30,$30,$1
sh $30,2($0)#addu-sw-rt:forward
li $30,0x12345678
sw $30,4($0)#ori-sw-rt:forward
addi $4,$0,5
sb $30,0($4)#ori-sb-rs:forward
ori $5,$0,1
sll $5,$5,2
sw $30,4($5)#sll-sw-rs:forward
sra $29,$30,2
sw $29,8($5)#sra-sw-rt:forward
mult4:jal next4
nop
sw $5,0($0)#jalr-nop-sw-rt:forward
ori $1,$0,8
ori $2,$0,2
div $1,$2
mflo $3
sw $31,0($3)#mflo-sw-rt:forward
ori $7,$0,29
ori $9,$0,30
mult $7,$9
mfhi $4
sw $4,4($3)#mfhi-sw-rs:forward
jr $5
nop
next4:
sw $31,0($0)#jal-nop-sw-rt:forward
jalr $5,$31
nop
end4:
#the first part is mainly focused on the shift instructon's stall.->load-shift
ori $1,$0,-50
sw $1,0($0)
lw $2,0($0)
sll $3,$2,20#lw-sll-rs:forward
lh $3,0($0)
srl $4,$3,5#lw-srl-rs:stall
lb $4,0($0)
sra $5,$4,5
ori $1,$0,50
sw $1,4($0)
lw $5,4($0)
sra $5,$5,4#lw-sra-rs:stall
ori $1,$0,-50
sll $2,$1,6
addiu $1,$1,0xffff
srl $1,$1,7#addiu-srl-rs:forward
lui $1,0xffff
sra $1,$1,9#lui-sra-rs:forward
addiu $1,$1,200
sll $1,$1,5#addiu-sll-rs"forward
ori $1,$1,1
sll $1,$1,31#ori-sll-rs:forwaard
sra $1,$1,20
srl $1,$1,9#sra-srl-rs:forward
jal next5
nop
mult5:
ori $1,$0,0xffff
lui $2,0xffff
mult $1,$2
mfhi $3
sll $3,$3,4
mflo $4
sra $4,$4,7
multu $1,$2
mfhi $3
srl $3,$3,5
mflo $4
sra $4,$4,6
mthi $1
mtlo $2
mfhi $1
sll $1,$1,20
mflo $2
sra $2,$2,10
jr $5
nop
next5:sll $29,$31,16#jal-sll-rs
sra $28,$29,7
srl $27,$28,9
jalr $5,$31
nop
end5:
ori $1,$0,1
addiu $2,$0,20
for1:beq $1,$2,endfor1
sw $1,0($0)
addiu $1,$1,1
j for1
nop
endfor1:
ori $1,$0,3
addiu $2,$0,3
for2:bne $1,$2,endfor2
sb $2,4($2)
addiu $1,$1,1
mult $2,$2
mflo $2
j for2
nop
endfor2:
ori $2,$0,10
subu $3,$2,$0
for3:blez $3,endfor3
sw $3,0($0)
addiu $2,$2,-1
subu $3,$2,$0
j for3
nop
endfor3:
ori $2,$0,11
subu $3,$0,$2
for4:bgtz $3,endfor4
sw $3,8($0)
addiu $2,$2,-1
subu $3,$0,$2
j for4
nop
endfor4:
ori $2,$0,10
subu $3,$2,$0
for5:bltz $3,endfor5
sw $3,12($0)
addiu $2,$2,-1
subu $3,$2,$0
j for5
nop
endfor5:
ori $2,$0,11
subu $3,$0,$2
for6:bgez $3,endfor6
sw $3,0($0)
addiu $2,$2,1
subu $3,$2,$0
j for6
nop
endfor6:
ori $2,$0,11
subu $3,$0,$2
for7:bgezal $3,endfor7
sw $3,0($0)
addiu $2,$2,1
subu $3,$2,$0
j for7
nop
endfor7:
ori $2,$1,-100
lui $3,123
mult $2,$3
mfhi $4
mflo $5
multu $2,$3
mfhi $4
mflo $5
div $2,$3
mfhi $4
mflo $5
divu $2,$3
mfhi $4
mflo $5
addi $4,$4,1
mthi $4
mfhi $5
ori $1,$0,0x1234
sw $1,0($0)
lw $2,0($0)
mthi $2
mfhi $3
exit: j exit
nop
|
Nat.agda | karrym/NatToReal | 0 | 15948 | <gh_stars>0
module Nat where
open import Data.Product
open import Data.Sum
open import Relation.Binary.PropositionalEquality as Eq
open import Data.Empty
open import Level hiding (zero)
data ℕ : Set where
zero : ℕ
succ : ℕ → ℕ
open Eq.≡-Reasoning
¬_ : { ℓ : Level} → Set ℓ → Set ℓ
¬ P = P → ⊥
≡-succ : (n m : ℕ) → succ n ≡ succ m → n ≡ m
≡-succ zero .zero refl = refl
≡-succ (succ n) .(succ n) refl = refl
sn≢0 : (n : ℕ) → ¬ (succ n ≡ zero)
sn≢0 _ ()
_+_ : ℕ → ℕ → ℕ
zero + m = m
succ n + m = succ (n + m)
_*_ : ℕ → ℕ → ℕ
zero * _ = zero
succ n * m = m + (n * m)
+-rUnit : (n : ℕ) → n + zero ≡ n
+-rUnit zero = refl
+-rUnit (succ n) = cong succ (+-rUnit n)
+-lUnit : (n : ℕ) → zero + n ≡ n
+-lUnit _ = refl
+-assoc : (n m l : ℕ) → n + (m + l) ≡ (n + m) + l
+-assoc zero m l = refl
+-assoc (succ n) m l = cong succ (+-assoc n m l)
+-right : (n m : ℕ) → n + succ m ≡ succ (n + m)
+-right zero m = refl
+-right (succ n) m = cong succ (+-right n m)
+-comm : (m n : ℕ) → m + n ≡ n + m
+-comm zero n = sym (+-rUnit n)
+-comm (succ m) n = begin
succ (m + n)
≡⟨ cong succ (+-comm m n) ⟩
succ (n + m)
≡⟨ sym (+-right n m) ⟩
n + succ m
∎
+-lCancel : (n m l : ℕ) → l + n ≡ l + m → n ≡ m
+-lCancel n m zero p = p
+-lCancel n m (succ l) p = +-lCancel n m l (≡-succ (l + n) (l + m) p)
+-rCancel : (n m l : ℕ) → n + l ≡ m + l → n ≡ m
+-rCancel n m zero p =
begin
n
≡⟨ sym (+-rUnit n) ⟩
n + zero
≡⟨ p ⟩
m + zero
≡⟨ +-rUnit m ⟩
m
∎
+-rCancel n m (succ l) n+sl≡m+sl = +-rCancel n m l (≡-succ (n + l) (m + l)
(begin
succ (n + l)
≡⟨ sym (+-right n l) ⟩
n + succ l
≡⟨ n+sl≡m+sl ⟩
m + succ l
≡⟨ +-right m l ⟩
succ (m + l)
∎))
*-rAbsorp : (n : ℕ) → n * zero ≡ zero
*-rAbsorp zero = refl
*-rAbsorp (succ n) = begin
succ n * zero
≡⟨ refl ⟩
zero + (n * zero)
≡⟨ cong (λ x → zero + x) (*-rAbsorp n) ⟩
zero + zero
≡⟨ refl ⟩
zero
∎
*-right : (m n : ℕ) → m * succ n ≡ (m * n) + m
*-right zero n = begin
zero * succ n
≡⟨ refl ⟩
zero
≡⟨ refl ⟩
zero * n
≡⟨ +-rUnit (zero * n) ⟩
(zero * n) + zero
∎
*-right (succ m) n = begin
succ m * succ n
≡⟨ refl ⟩
succ n + (m * succ n)
≡⟨ cong (λ x → succ n + x) (*-right m n) ⟩
succ n + ((m * n) + m)
≡⟨ refl ⟩
succ (n + ((m * n) + m))
≡⟨ cong succ (+-assoc n (m * n) m) ⟩
succ ((n + (m * n)) + m)
≡⟨ sym (+-right (n + (m * n)) m) ⟩
(succ m * n) + succ m
∎
+*-rDist : (m n l : ℕ) → (m + n) * l ≡ (m * l) + (n * l)
+*-rDist m n zero = begin
(m + n) * zero
≡⟨ *-rAbsorp (m + n) ⟩
zero
≡⟨ sym (*-rAbsorp m) ⟩
m * zero
≡⟨ sym (+-rUnit (m * zero)) ⟩
(m * zero) + zero
≡⟨ cong (λ x → (m * zero) + x) (sym (*-rAbsorp n)) ⟩
(m * zero) + (n * zero)
∎
+*-rDist m n (succ l) = begin
(m + n) * succ l
≡⟨ *-right (m + n) l ⟩
((m + n) * l) + (m + n)
≡⟨ cong (λ x → x + (m + n)) (+*-rDist m n l) ⟩
((m * l) + (n * l)) + (m + n)
≡⟨ +-assoc ((m * l) + (n * l)) m n ⟩
(((m * l) + (n * l)) + m) + n
≡⟨ cong (λ x → x + n) (sym (+-assoc (m * l) (n * l) m)) ⟩
((m * l) + ((n * l) + m)) + n
≡⟨ cong (λ x → x + n) (cong (λ x → (m * l) + x) (+-comm (n * l) m)) ⟩
((m * l) + (m + (n * l))) + n
≡⟨ cong (λ x → x + n) (+-assoc (m * l) m (n * l)) ⟩
(((m * l) + m) + (n * l)) + n
≡⟨ sym (+-assoc ((m * l) + m) (n * l) n) ⟩
((m * l) + m) + ((n * l) + n)
≡⟨ cong (λ x → x + ((n * l) + n)) (sym (*-right m l)) ⟩
(m * succ l) + ((n * l) + n)
≡⟨ cong (λ x → (m * succ l) + x) (sym (*-right n l)) ⟩
(m * succ l) + (n * succ l)
∎
*-assoc : (m n l : ℕ) → m * (n * l) ≡ (m * n) * l
*-assoc zero n l = refl
*-assoc (succ m) n l = begin
succ m * (n * l)
≡⟨ refl ⟩
(n * l) + (m * (n * l))
≡⟨ cong (λ x → (n * l) + x) (*-assoc m n l) ⟩
(n * l) + ((m * n) * l)
≡⟨ sym (+*-rDist n (m * n) l) ⟩
(n + (m * n)) * l
≡⟨ refl ⟩
(succ m * n) * l
∎
*-comm : (m n : ℕ) → m * n ≡ n * m
*-comm zero n = sym (*-rAbsorp n)
*-comm (succ m) n = begin
succ m * n
≡⟨ refl ⟩
n + (m * n)
≡⟨ +-comm n (m * n) ⟩
(m * n) + n
≡⟨ cong (λ x → x + n) (*-comm m n) ⟩
(n * m) + n
≡⟨ sym (*-right n m) ⟩
n * succ m
∎
_≤_ : ℕ → ℕ → Set
n ≤ m = Σ ℕ (λ l → n + l ≡ m)
≤-refl : (n : ℕ) → n ≤ n
≤-refl zero = zero , refl
≤-refl (succ n) = zero ,
(begin
(succ n + zero)
≡⟨ +-rUnit (succ n) ⟩
(succ n)
∎)
0≤n : (n : ℕ) → zero ≤ n
0≤n zero = ≤-refl zero
0≤n (succ n) = succ n , refl
≤-trans : (n m l : ℕ) → n ≤ m → m ≤ l → n ≤ l
≤-trans zero m l p q = l , refl
≤-trans (succ n) m l (a , succn+a≡m) (b , m+b≡l)
= (a + b) , (begin
succ n + (a + b)
≡⟨ +-assoc (succ n) a b ⟩
(succ n + a) + b
≡⟨ cong (λ x → x + b) succn+a≡m ⟩
m + b
≡⟨ m+b≡l ⟩
l
∎)
+-lZero : (n m : ℕ) → n + m ≡ zero → n ≡ zero
+-lZero zero m = λ _ → refl
+-lZero (succ n) m ()
≤-antisym : (n m : ℕ) → n ≤ m → m ≤ n → n ≡ m
≤-antisym n m (c , n+c≡m) (d , m+d≡n) = trans (sym n+c≡n) n+c≡m
where
c≡0 : c ≡ zero
c≡0 = +-lZero c d (+-lCancel (c + d) zero n (
begin
n + (c + d)
≡⟨ +-assoc n c d ⟩
(n + c) + d
≡⟨ cong (λ x → x + d) n+c≡m ⟩
m + d
≡⟨ m+d≡n ⟩
n
≡⟨ sym (+-rUnit n) ⟩
n + zero
∎))
n+c≡n : n + c ≡ n
n+c≡n = begin
n + c
≡⟨ cong (λ x → n + x) c≡0 ⟩
n + zero
≡⟨ +-rUnit n ⟩
n
∎
n+s0≡sn : (n : ℕ) → n + succ zero ≡ succ n
n+s0≡sn n = begin
n + succ zero
≡⟨ +-right n zero ⟩
succ (n + zero)
≡⟨ cong succ (+-rUnit n) ⟩
succ n
∎
n≤sn : (n : ℕ) → n ≤ succ n
n≤sn n = succ zero , n+s0≡sn n
ℕ-ω : (n : ℕ) → n ≡ zero ⊎ Σ ℕ (λ c → n ≡ succ c)
ℕ-ω zero = inj₁ refl
ℕ-ω (succ n) = inj₂ (n , refl)
m+sn≡sm+n : (m n : ℕ) → m + succ n ≡ succ m + n
m+sn≡sm+n m zero = begin
m + succ zero
≡⟨ n+s0≡sn m ⟩
succ m
≡⟨ sym (+-rUnit (succ m)) ⟩
succ m + zero
∎
m+sn≡sm+n m (succ n) = begin
m + succ (succ n)
≡⟨ +-right m (succ n) ⟩
succ (m + succ n)
≡⟨ cong succ (m+sn≡sm+n m n) ⟩
succ (succ m + n)
≡⟨ sym (+-right (succ m) n) ⟩
succ m + succ n
∎
sn≤m : (n m : ℕ) → n ≤ m → ¬ (n ≡ m) → succ n ≤ m
sn≤m n m (c , n+c≡m) q = lem (ℕ-ω c)
where
n+c≡n : c ≡ zero → n + c ≡ n
n+c≡n p = begin
n + c
≡⟨ cong (λ x → n + x) p ⟩
n + zero
≡⟨ +-rUnit n ⟩
n
∎
lem : c ≡ zero ⊎ Σ ℕ (λ d → c ≡ succ d) → succ n ≤ m
lem (inj₁ x) = ⊥-elim (q (trans (sym (n+c≡n x)) n+c≡m))
lem (inj₂ (d , c≡sd)) = d , (begin
succ n + d
≡⟨ sym (m+sn≡sm+n n d) ⟩
n + succ d
≡⟨ sym (cong (λ x → n + x) c≡sd) ⟩
n + c
≡⟨ n+c≡m ⟩
m
∎)
≤-all : (m n : ℕ) → m ≤ n ⊎ n ≤ m
≤-all m zero = inj₂ (m , refl)
≤-all m (succ n) = lem (≤-all m n)
where
lem : m ≤ n ⊎ n ≤ m → m ≤ succ n ⊎ succ n ≤ m
lem (inj₁ x) = inj₁ (≤-trans m n (succ n) x (n≤sn n))
lem (inj₂ (zero , n+zero≡m)) = inj₁ (succ zero , (begin
m + succ zero
≡⟨ +-right m zero ⟩
succ (m + zero)
≡⟨ cong succ (+-rUnit m) ⟩
succ m
≡⟨ cong succ (sym n+zero≡m) ⟩
succ (n + zero)
≡⟨ cong succ (+-rUnit n) ⟩
succ n
∎))
lem (inj₂ (succ c , n+sc≡m)) = inj₂ (c , (begin
succ n + c
≡⟨ refl ⟩
succ (n + c)
≡⟨ sym (+-right n c) ⟩
n + succ c
≡⟨ n+sc≡m ⟩
m
∎))
+-mono : (m n l : ℕ) → m ≤ n → (m + l) ≤ (n + l)
+-mono m n zero (c , m+c≡n) = c , (begin
(m + zero) + c
≡⟨ cong (λ x → x + c) (+-rUnit m) ⟩
m + c
≡⟨ m+c≡n ⟩
n
≡⟨ sym (+-rUnit n) ⟩
n + zero
∎)
+-mono m n (succ l) (c , m+c≡n) = lem (+-mono m n l (c , m+c≡n))
where
lem : (m + l) ≤ (n + l) → (m + succ l) ≤ (n + succ l)
lem (d , m+l+d≡n+l) = d , (begin
(m + succ l) + d
≡⟨ cong (λ x → x + d) (+-right m l) ⟩
succ (m + l) + d
≡⟨ refl ⟩
succ ((m + l) + d)
≡⟨ cong succ m+l+d≡n+l ⟩
succ (n + l)
≡⟨ sym (+-right n l) ⟩
n + succ l
∎)
*-mono : (m n l : ℕ) → m ≤ n → (m * l) ≤ (n * l)
*-mono m n zero (c , m+c≡n) = zero , (begin
(m * zero) + zero
≡⟨ +-rUnit (m * zero) ⟩
m * zero
≡⟨ trans (*-rAbsorp m) (sym (*-rAbsorp n)) ⟩
n * zero
∎)
*-mono m n (succ l) (c , m+c≡n) = lem (*-mono m n l (c , m+c≡n))
where
lem : (m * l) ≤ (n * l) → (m * succ l) ≤ (n * succ l)
lem (d , m*l+d≡n*l) = (c * succ l) , sym (begin
n * succ l
≡⟨ cong (λ x → x * succ l) (sym m+c≡n) ⟩
(m + c) * succ l
≡⟨ +*-rDist m c (succ l) ⟩
(m * succ l) + (c * succ l)
∎)
s≤s : (m n : ℕ) → m ≤ n → succ m ≤ succ n
s≤s zero n (c , c≡n) = n , refl
s≤s (succ m) n (c , sm+c≡n) = c , cong succ sm+c≡n
data _≲_ : ℕ → ℕ → Set where
0≲n : {n : ℕ} → zero ≲ n
s≲s : {n m : ℕ} → n ≲ m → succ n ≲ succ m
≤-≲ : (m n : ℕ) → m ≤ n → m ≲ n
≤-≲ zero _ _ = 0≲n
≤-≲ (succ m) zero (c , ())
≤-≲ (succ m) (succ n) (c , m+c≡n) = s≲s (≤-≲ m n (c , ≡-succ (m + c) n m+c≡n))
≲-≤ : (m n : ℕ) → m ≲ n → m ≤ n
≲-≤ .zero n 0≲n = n , refl
≲-≤ (succ m) (succ n) (s≲s p) = s≤s m n (≲-≤ m n p)
|
src/definitions.ads | kraileth/ravenadm | 0 | 15116 | <reponame>kraileth/ravenadm
-- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
package Definitions is
pragma Pure;
raven_version_major : constant String := "1";
raven_version_minor : constant String := "71";
copyright_years : constant String := "2015-2021";
raven_tool : constant String := "ravenadm";
variant_standard : constant String := "standard";
contact_nobody : constant String := "nobody";
contact_automaton : constant String := "automaton";
dlgroup_main : constant String := "main";
dlgroup_none : constant String := "none";
options_none : constant String := "none";
options_all : constant String := "all";
broken_all : constant String := "all";
boolean_yes : constant String := "yes";
homepage_none : constant String := "none";
spkg_complete : constant String := "complete";
spkg_docs : constant String := "docs";
spkg_examples : constant String := "examples";
spkg_nls : constant String := "nls";
ports_default : constant String := "floating";
default_ssl : constant String := "libressl";
default_mysql : constant String := "oracle-8.0";
default_lua : constant String := "5.3";
default_perl : constant String := "5.30";
default_pgsql : constant String := "12";
default_php : constant String := "7.4";
default_python3 : constant String := "3.8";
default_ruby : constant String := "2.7";
default_tcltk : constant String := "8.6";
default_firebird : constant String := "2.5";
default_binutils : constant String := "binutils:ravensys";
default_compiler : constant String := "gcc9";
previous_default : constant String := "gcc9";
compiler_version : constant String := "9.3.0";
previous_compiler : constant String := "9.2.0";
binutils_version : constant String := "2.35.1";
previous_binutils : constant String := "2.34";
arc_ext : constant String := ".tzst";
jobs_per_cpu : constant := 2;
task_stack_limit : constant := 10_000_000;
type supported_opsys is (dragonfly, freebsd, netbsd, openbsd, sunos, linux, macos);
type supported_arch is (x86_64, i386, aarch64);
type cpu_range is range 1 .. 64;
type scanners is range cpu_range'First .. cpu_range'Last;
type builders is range cpu_range'First .. cpu_range'Last * jobs_per_cpu;
type count_type is (total, success, failure, ignored, skipped);
-- Modify following with post-patch sed accordingly
platform_type : constant supported_opsys := dragonfly;
host_localbase : constant String := "/raven";
raven_var : constant String := "/var/ravenports";
host_pkg8 : constant String := host_localbase & "/sbin/ravensw";
ravenexec : constant String := host_localbase & "/libexec/ravenexec";
end Definitions;
|
msp430x2/msp430g2553/svd/msp430_svd-timer_1_a3.ads | ekoeppen/MSP430_Generic_Ada_Drivers | 0 | 30249 | <reponame>ekoeppen/MSP430_Generic_Ada_Drivers
-- This spec has been automatically generated from msp430g2553.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
-- Timer1_A3
package MSP430_SVD.TIMER_1_A3 is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- Timer A mode control 1
type TA1CTL_MC_Field is
(-- Timer A mode control: 0 - Stop
Mc_0,
-- Timer A mode control: 1 - Up to CCR0
Mc_1,
-- Timer A mode control: 2 - Continous up
Mc_2,
-- Timer A mode control: 3 - Up/Down
Mc_3)
with Size => 2;
for TA1CTL_MC_Field use
(Mc_0 => 0,
Mc_1 => 1,
Mc_2 => 2,
Mc_3 => 3);
-- Timer A clock input divider 1
type TA1CTL_ID_Field is
(-- Timer A input divider: 0 - /1
Id_0,
-- Timer A input divider: 1 - /2
Id_1,
-- Timer A input divider: 2 - /4
Id_2,
-- Timer A input divider: 3 - /8
Id_3)
with Size => 2;
for TA1CTL_ID_Field use
(Id_0 => 0,
Id_1 => 1,
Id_2 => 2,
Id_3 => 3);
-- Timer A clock source select 1
type TA1CTL_TASSEL_Field is
(-- Timer A clock source select: 0 - TACLK
Tassel_0,
-- Timer A clock source select: 1 - ACLK
Tassel_1,
-- Timer A clock source select: 2 - SMCLK
Tassel_2,
-- Timer A clock source select: 3 - INCLK
Tassel_3)
with Size => 2;
for TA1CTL_TASSEL_Field use
(Tassel_0 => 0,
Tassel_1 => 1,
Tassel_2 => 2,
Tassel_3 => 3);
-- Timer1_A3 Control
type TA1CTL_Register is record
-- Timer A counter interrupt flag
TAIFG : MSP430_SVD.Bit := 16#0#;
-- Timer A counter interrupt enable
TAIE : MSP430_SVD.Bit := 16#0#;
-- Timer A counter clear
TACLR : MSP430_SVD.Bit := 16#0#;
-- unspecified
Reserved_3_3 : MSP430_SVD.Bit := 16#0#;
-- Timer A mode control 1
MC : TA1CTL_MC_Field := MSP430_SVD.TIMER_1_A3.Mc_0;
-- Timer A clock input divider 1
ID : TA1CTL_ID_Field := MSP430_SVD.TIMER_1_A3.Id_0;
-- Timer A clock source select 1
TASSEL : TA1CTL_TASSEL_Field := MSP430_SVD.TIMER_1_A3.Tassel_0;
-- unspecified
Reserved_10_15 : MSP430_SVD.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 16,
Bit_Order => System.Low_Order_First;
for TA1CTL_Register use record
TAIFG at 0 range 0 .. 0;
TAIE at 0 range 1 .. 1;
TACLR at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
MC at 0 range 4 .. 5;
ID at 0 range 6 .. 7;
TASSEL at 0 range 8 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
end record;
-- Output mode 2
type TA1CCTL0_OUTMOD_Field is
(-- PWM output mode: 0 - output only
Outmod_0,
-- PWM output mode: 1 - set
Outmod_1,
-- PWM output mode: 2 - PWM toggle/reset
Outmod_2,
-- PWM output mode: 3 - PWM set/reset
Outmod_3,
-- PWM output mode: 4 - toggle
Outmod_4,
-- PWM output mode: 5 - Reset
Outmod_5,
-- PWM output mode: 6 - PWM toggle/set
Outmod_6,
-- PWM output mode: 7 - PWM reset/set
Outmod_7)
with Size => 3;
for TA1CCTL0_OUTMOD_Field use
(Outmod_0 => 0,
Outmod_1 => 1,
Outmod_2 => 2,
Outmod_3 => 3,
Outmod_4 => 4,
Outmod_5 => 5,
Outmod_6 => 6,
Outmod_7 => 7);
-- Capture input select 1
type TA1CCTL0_CCIS_Field is
(-- Capture input select: 0 - CCIxA
Ccis_0,
-- Capture input select: 1 - CCIxB
Ccis_1,
-- Capture input select: 2 - GND
Ccis_2,
-- Capture input select: 3 - Vcc
Ccis_3)
with Size => 2;
for TA1CCTL0_CCIS_Field use
(Ccis_0 => 0,
Ccis_1 => 1,
Ccis_2 => 2,
Ccis_3 => 3);
-- Capture mode 1
type TA1CCTL0_CM_Field is
(-- Capture mode: 0 - disabled
Cm_0,
-- Capture mode: 1 - pos. edge
Cm_1,
-- Capture mode: 1 - neg. edge
Cm_2,
-- Capture mode: 1 - both edges
Cm_3)
with Size => 2;
for TA1CCTL0_CM_Field use
(Cm_0 => 0,
Cm_1 => 1,
Cm_2 => 2,
Cm_3 => 3);
-- Timer1_A3 Capture/Compare Control 0
type TA1CCTL_Register is record
-- Capture/compare interrupt flag
CCIFG : MSP430_SVD.Bit := 16#0#;
-- Capture/compare overflow flag
COV : MSP430_SVD.Bit := 16#0#;
-- PWM Output signal if output mode 0
OUT_k : MSP430_SVD.Bit := 16#0#;
-- Capture input signal (read)
CCI : MSP430_SVD.Bit := 16#0#;
-- Capture/compare interrupt enable
CCIE : MSP430_SVD.Bit := 16#0#;
-- Output mode 2
OUTMOD : TA1CCTL0_OUTMOD_Field := MSP430_SVD.TIMER_1_A3.Outmod_0;
-- Capture mode: 1 /Compare mode : 0
CAP : MSP430_SVD.Bit := 16#0#;
-- unspecified
Reserved_9_9 : MSP430_SVD.Bit := 16#0#;
-- Latched capture signal (read)
SCCI : MSP430_SVD.Bit := 16#0#;
-- Capture sychronize
SCS : MSP430_SVD.Bit := 16#0#;
-- Capture input select 1
CCIS : TA1CCTL0_CCIS_Field := MSP430_SVD.TIMER_1_A3.Ccis_0;
-- Capture mode 1
CM : TA1CCTL0_CM_Field := MSP430_SVD.TIMER_1_A3.Cm_0;
end record
with Volatile_Full_Access, Object_Size => 16,
Bit_Order => System.Low_Order_First;
for TA1CCTL_Register use record
CCIFG at 0 range 0 .. 0;
COV at 0 range 1 .. 1;
OUT_k at 0 range 2 .. 2;
CCI at 0 range 3 .. 3;
CCIE at 0 range 4 .. 4;
OUTMOD at 0 range 5 .. 7;
CAP at 0 range 8 .. 8;
Reserved_9_9 at 0 range 9 .. 9;
SCCI at 0 range 10 .. 10;
SCS at 0 range 11 .. 11;
CCIS at 0 range 12 .. 13;
CM at 0 range 14 .. 15;
end record;
-----------------
-- Peripherals --
-----------------
-- Timer1_A3
type TIMER_1_A3_Peripheral is record
-- Timer1_A3 Interrupt Vector Word
TA1IV : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Control
TA1CTL : aliased TA1CTL_Register;
-- Timer1_A3 Capture/Compare Control 0
TA1CCTL0 : aliased TA1CCTL_Register;
-- Timer1_A3 Capture/Compare Control 1
TA1CCTL1 : aliased TA1CCTL_Register;
-- Timer1_A3 Capture/Compare Control 2
TA1CCTL2 : aliased TA1CCTL_Register;
-- Timer1_A3 Counter Register
TA1R : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Capture/Compare 0
TA1CCR0 : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Capture/Compare 1
TA1CCR1 : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Capture/Compare 2
TA1CCR2 : aliased MSP430_SVD.UInt16;
end record
with Volatile;
for TIMER_1_A3_Peripheral use record
TA1IV at 16#0# range 0 .. 15;
TA1CTL at 16#62# range 0 .. 15;
TA1CCTL0 at 16#64# range 0 .. 15;
TA1CCTL1 at 16#66# range 0 .. 15;
TA1CCTL2 at 16#68# range 0 .. 15;
TA1R at 16#72# range 0 .. 15;
TA1CCR0 at 16#74# range 0 .. 15;
TA1CCR1 at 16#76# range 0 .. 15;
TA1CCR2 at 16#78# range 0 .. 15;
end record;
-- Timer1_A3
TIMER_1_A3_Periph : aliased TIMER_1_A3_Peripheral
with Import, Address => TIMER_1_A3_Base;
end MSP430_SVD.TIMER_1_A3;
|
src/kernel/idt.asm | metiu07/osdev | 10 | 8489 | section .text
global idt_flush
idt_flush:
mov eax, [esp + 4]
lidt [eax]
ret
|
echo.asm | willh99/MSBOSS-proj | 0 | 26650 |
_echo: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "types.h"
#include "stat.h"
#include "user.h"
int main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 53 push %ebx
e: 51 push %ecx
f: 83 ec 10 sub $0x10,%esp
12: 89 cb mov %ecx,%ebx
int i;
for (i = 1; i < argc; i++)
14: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp)
1b: eb 3c jmp 59 <main+0x59>
printf(1, "%s%s", argv[i], i + 1 < argc ? " " : "\n");
1d: 8b 45 f4 mov -0xc(%ebp),%eax
20: 83 c0 01 add $0x1,%eax
23: 3b 03 cmp (%ebx),%eax
25: 7d 07 jge 2e <main+0x2e>
27: ba 31 08 00 00 mov $0x831,%edx
2c: eb 05 jmp 33 <main+0x33>
2e: ba 33 08 00 00 mov $0x833,%edx
33: 8b 45 f4 mov -0xc(%ebp),%eax
36: 8d 0c 85 00 00 00 00 lea 0x0(,%eax,4),%ecx
3d: 8b 43 04 mov 0x4(%ebx),%eax
40: 01 c8 add %ecx,%eax
42: 8b 00 mov (%eax),%eax
44: 52 push %edx
45: 50 push %eax
46: 68 35 08 00 00 push $0x835
4b: 6a 01 push $0x1
4d: e8 29 04 00 00 call 47b <printf>
52: 83 c4 10 add $0x10,%esp
int main(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++)
55: 83 45 f4 01 addl $0x1,-0xc(%ebp)
59: 8b 45 f4 mov -0xc(%ebp),%eax
5c: 3b 03 cmp (%ebx),%eax
5e: 7c bd jl 1d <main+0x1d>
printf(1, "%s%s", argv[i], i + 1 < argc ? " " : "\n");
exit();
60: e8 57 02 00 00 call 2bc <exit>
00000065 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
65: 55 push %ebp
66: 89 e5 mov %esp,%ebp
68: 57 push %edi
69: 53 push %ebx
asm volatile("cld; rep stosb" :
6a: 8b 4d 08 mov 0x8(%ebp),%ecx
6d: 8b 55 10 mov 0x10(%ebp),%edx
70: 8b 45 0c mov 0xc(%ebp),%eax
73: 89 cb mov %ecx,%ebx
75: 89 df mov %ebx,%edi
77: 89 d1 mov %edx,%ecx
79: fc cld
7a: f3 aa rep stos %al,%es:(%edi)
7c: 89 ca mov %ecx,%edx
7e: 89 fb mov %edi,%ebx
80: 89 5d 08 mov %ebx,0x8(%ebp)
83: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
86: 90 nop
87: 5b pop %ebx
88: 5f pop %edi
89: 5d pop %ebp
8a: c3 ret
0000008b <strcpy>:
#include "fcntl.h"
#include "user.h"
#include "x86.h"
char *strcpy(char *s, char *t)
{
8b: 55 push %ebp
8c: 89 e5 mov %esp,%ebp
8e: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
91: 8b 45 08 mov 0x8(%ebp),%eax
94: 89 45 fc mov %eax,-0x4(%ebp)
while ((*s++ = *t++) != 0) ;
97: 90 nop
98: 8b 45 08 mov 0x8(%ebp),%eax
9b: 8d 50 01 lea 0x1(%eax),%edx
9e: 89 55 08 mov %edx,0x8(%ebp)
a1: 8b 55 0c mov 0xc(%ebp),%edx
a4: 8d 4a 01 lea 0x1(%edx),%ecx
a7: 89 4d 0c mov %ecx,0xc(%ebp)
aa: 0f b6 12 movzbl (%edx),%edx
ad: 88 10 mov %dl,(%eax)
af: 0f b6 00 movzbl (%eax),%eax
b2: 84 c0 test %al,%al
b4: 75 e2 jne 98 <strcpy+0xd>
return os;
b6: 8b 45 fc mov -0x4(%ebp),%eax
}
b9: c9 leave
ba: c3 ret
000000bb <strcmp>:
int strcmp(const char *p, const char *q)
{
bb: 55 push %ebp
bc: 89 e5 mov %esp,%ebp
while (*p && *p == *q)
be: eb 08 jmp c8 <strcmp+0xd>
p++, q++;
c0: 83 45 08 01 addl $0x1,0x8(%ebp)
c4: 83 45 0c 01 addl $0x1,0xc(%ebp)
return os;
}
int strcmp(const char *p, const char *q)
{
while (*p && *p == *q)
c8: 8b 45 08 mov 0x8(%ebp),%eax
cb: 0f b6 00 movzbl (%eax),%eax
ce: 84 c0 test %al,%al
d0: 74 10 je e2 <strcmp+0x27>
d2: 8b 45 08 mov 0x8(%ebp),%eax
d5: 0f b6 10 movzbl (%eax),%edx
d8: 8b 45 0c mov 0xc(%ebp),%eax
db: 0f b6 00 movzbl (%eax),%eax
de: 38 c2 cmp %al,%dl
e0: 74 de je c0 <strcmp+0x5>
p++, q++;
return (uchar) * p - (uchar) * q;
e2: 8b 45 08 mov 0x8(%ebp),%eax
e5: 0f b6 00 movzbl (%eax),%eax
e8: 0f b6 d0 movzbl %al,%edx
eb: 8b 45 0c mov 0xc(%ebp),%eax
ee: 0f b6 00 movzbl (%eax),%eax
f1: 0f b6 c0 movzbl %al,%eax
f4: 29 c2 sub %eax,%edx
f6: 89 d0 mov %edx,%eax
}
f8: 5d pop %ebp
f9: c3 ret
000000fa <strlen>:
uint strlen(char *s)
{
fa: 55 push %ebp
fb: 89 e5 mov %esp,%ebp
fd: 83 ec 10 sub $0x10,%esp
int n;
for (n = 0; s[n]; n++) ;
100: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
107: eb 04 jmp 10d <strlen+0x13>
109: 83 45 fc 01 addl $0x1,-0x4(%ebp)
10d: 8b 55 fc mov -0x4(%ebp),%edx
110: 8b 45 08 mov 0x8(%ebp),%eax
113: 01 d0 add %edx,%eax
115: 0f b6 00 movzbl (%eax),%eax
118: 84 c0 test %al,%al
11a: 75 ed jne 109 <strlen+0xf>
return n;
11c: 8b 45 fc mov -0x4(%ebp),%eax
}
11f: c9 leave
120: c3 ret
00000121 <memset>:
void *memset(void *dst, int c, uint n)
{
121: 55 push %ebp
122: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
124: 8b 45 10 mov 0x10(%ebp),%eax
127: 50 push %eax
128: ff 75 0c pushl 0xc(%ebp)
12b: ff 75 08 pushl 0x8(%ebp)
12e: e8 32 ff ff ff call 65 <stosb>
133: 83 c4 0c add $0xc,%esp
return dst;
136: 8b 45 08 mov 0x8(%ebp),%eax
}
139: c9 leave
13a: c3 ret
0000013b <strchr>:
char *strchr(const char *s, char c)
{
13b: 55 push %ebp
13c: 89 e5 mov %esp,%ebp
13e: 83 ec 04 sub $0x4,%esp
141: 8b 45 0c mov 0xc(%ebp),%eax
144: 88 45 fc mov %al,-0x4(%ebp)
for (; *s; s++)
147: eb 14 jmp 15d <strchr+0x22>
if (*s == c)
149: 8b 45 08 mov 0x8(%ebp),%eax
14c: 0f b6 00 movzbl (%eax),%eax
14f: 3a 45 fc cmp -0x4(%ebp),%al
152: 75 05 jne 159 <strchr+0x1e>
return (char *)s;
154: 8b 45 08 mov 0x8(%ebp),%eax
157: eb 13 jmp 16c <strchr+0x31>
return dst;
}
char *strchr(const char *s, char c)
{
for (; *s; s++)
159: 83 45 08 01 addl $0x1,0x8(%ebp)
15d: 8b 45 08 mov 0x8(%ebp),%eax
160: 0f b6 00 movzbl (%eax),%eax
163: 84 c0 test %al,%al
165: 75 e2 jne 149 <strchr+0xe>
if (*s == c)
return (char *)s;
return 0;
167: b8 00 00 00 00 mov $0x0,%eax
}
16c: c9 leave
16d: c3 ret
0000016e <gets>:
char *gets(char *buf, int max)
{
16e: 55 push %ebp
16f: 89 e5 mov %esp,%ebp
171: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for (i = 0; i + 1 < max;) {
174: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
17b: eb 42 jmp 1bf <gets+0x51>
cc = read(0, &c, 1);
17d: 83 ec 04 sub $0x4,%esp
180: 6a 01 push $0x1
182: 8d 45 ef lea -0x11(%ebp),%eax
185: 50 push %eax
186: 6a 00 push $0x0
188: e8 47 01 00 00 call 2d4 <read>
18d: 83 c4 10 add $0x10,%esp
190: 89 45 f0 mov %eax,-0x10(%ebp)
if (cc < 1)
193: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
197: 7e 33 jle 1cc <gets+0x5e>
break;
buf[i++] = c;
199: 8b 45 f4 mov -0xc(%ebp),%eax
19c: 8d 50 01 lea 0x1(%eax),%edx
19f: 89 55 f4 mov %edx,-0xc(%ebp)
1a2: 89 c2 mov %eax,%edx
1a4: 8b 45 08 mov 0x8(%ebp),%eax
1a7: 01 c2 add %eax,%edx
1a9: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1ad: 88 02 mov %al,(%edx)
if (c == '\n' || c == '\r')
1af: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1b3: 3c 0a cmp $0xa,%al
1b5: 74 16 je 1cd <gets+0x5f>
1b7: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1bb: 3c 0d cmp $0xd,%al
1bd: 74 0e je 1cd <gets+0x5f>
char *gets(char *buf, int max)
{
int i, cc;
char c;
for (i = 0; i + 1 < max;) {
1bf: 8b 45 f4 mov -0xc(%ebp),%eax
1c2: 83 c0 01 add $0x1,%eax
1c5: 3b 45 0c cmp 0xc(%ebp),%eax
1c8: 7c b3 jl 17d <gets+0xf>
1ca: eb 01 jmp 1cd <gets+0x5f>
cc = read(0, &c, 1);
if (cc < 1)
break;
1cc: 90 nop
buf[i++] = c;
if (c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
1cd: 8b 55 f4 mov -0xc(%ebp),%edx
1d0: 8b 45 08 mov 0x8(%ebp),%eax
1d3: 01 d0 add %edx,%eax
1d5: c6 00 00 movb $0x0,(%eax)
return buf;
1d8: 8b 45 08 mov 0x8(%ebp),%eax
}
1db: c9 leave
1dc: c3 ret
000001dd <stat>:
int stat(char *n, struct stat *st)
{
1dd: 55 push %ebp
1de: 89 e5 mov %esp,%ebp
1e0: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
1e3: 83 ec 08 sub $0x8,%esp
1e6: 6a 00 push $0x0
1e8: ff 75 08 pushl 0x8(%ebp)
1eb: e8 0c 01 00 00 call 2fc <open>
1f0: 83 c4 10 add $0x10,%esp
1f3: 89 45 f4 mov %eax,-0xc(%ebp)
if (fd < 0)
1f6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1fa: 79 07 jns 203 <stat+0x26>
return -1;
1fc: b8 ff ff ff ff mov $0xffffffff,%eax
201: eb 25 jmp 228 <stat+0x4b>
r = fstat(fd, st);
203: 83 ec 08 sub $0x8,%esp
206: ff 75 0c pushl 0xc(%ebp)
209: ff 75 f4 pushl -0xc(%ebp)
20c: e8 03 01 00 00 call 314 <fstat>
211: 83 c4 10 add $0x10,%esp
214: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
217: 83 ec 0c sub $0xc,%esp
21a: ff 75 f4 pushl -0xc(%ebp)
21d: e8 c2 00 00 00 call 2e4 <close>
222: 83 c4 10 add $0x10,%esp
return r;
225: 8b 45 f0 mov -0x10(%ebp),%eax
}
228: c9 leave
229: c3 ret
0000022a <atoi>:
int atoi(const char *s)
{
22a: 55 push %ebp
22b: 89 e5 mov %esp,%ebp
22d: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
230: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while ('0' <= *s && *s <= '9')
237: eb 25 jmp 25e <atoi+0x34>
n = n * 10 + *s++ - '0';
239: 8b 55 fc mov -0x4(%ebp),%edx
23c: 89 d0 mov %edx,%eax
23e: c1 e0 02 shl $0x2,%eax
241: 01 d0 add %edx,%eax
243: 01 c0 add %eax,%eax
245: 89 c1 mov %eax,%ecx
247: 8b 45 08 mov 0x8(%ebp),%eax
24a: 8d 50 01 lea 0x1(%eax),%edx
24d: 89 55 08 mov %edx,0x8(%ebp)
250: 0f b6 00 movzbl (%eax),%eax
253: 0f be c0 movsbl %al,%eax
256: 01 c8 add %ecx,%eax
258: 83 e8 30 sub $0x30,%eax
25b: 89 45 fc mov %eax,-0x4(%ebp)
int atoi(const char *s)
{
int n;
n = 0;
while ('0' <= *s && *s <= '9')
25e: 8b 45 08 mov 0x8(%ebp),%eax
261: 0f b6 00 movzbl (%eax),%eax
264: 3c 2f cmp $0x2f,%al
266: 7e 0a jle 272 <atoi+0x48>
268: 8b 45 08 mov 0x8(%ebp),%eax
26b: 0f b6 00 movzbl (%eax),%eax
26e: 3c 39 cmp $0x39,%al
270: 7e c7 jle 239 <atoi+0xf>
n = n * 10 + *s++ - '0';
return n;
272: 8b 45 fc mov -0x4(%ebp),%eax
}
275: c9 leave
276: c3 ret
00000277 <memmove>:
void *memmove(void *vdst, void *vsrc, int n)
{
277: 55 push %ebp
278: 89 e5 mov %esp,%ebp
27a: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
27d: 8b 45 08 mov 0x8(%ebp),%eax
280: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
283: 8b 45 0c mov 0xc(%ebp),%eax
286: 89 45 f8 mov %eax,-0x8(%ebp)
while (n-- > 0)
289: eb 17 jmp 2a2 <memmove+0x2b>
*dst++ = *src++;
28b: 8b 45 fc mov -0x4(%ebp),%eax
28e: 8d 50 01 lea 0x1(%eax),%edx
291: 89 55 fc mov %edx,-0x4(%ebp)
294: 8b 55 f8 mov -0x8(%ebp),%edx
297: 8d 4a 01 lea 0x1(%edx),%ecx
29a: 89 4d f8 mov %ecx,-0x8(%ebp)
29d: 0f b6 12 movzbl (%edx),%edx
2a0: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while (n-- > 0)
2a2: 8b 45 10 mov 0x10(%ebp),%eax
2a5: 8d 50 ff lea -0x1(%eax),%edx
2a8: 89 55 10 mov %edx,0x10(%ebp)
2ab: 85 c0 test %eax,%eax
2ad: 7f dc jg 28b <memmove+0x14>
*dst++ = *src++;
return vdst;
2af: 8b 45 08 mov 0x8(%ebp),%eax
}
2b2: c9 leave
2b3: c3 ret
000002b4 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2b4: b8 01 00 00 00 mov $0x1,%eax
2b9: cd 40 int $0x40
2bb: c3 ret
000002bc <exit>:
SYSCALL(exit)
2bc: b8 02 00 00 00 mov $0x2,%eax
2c1: cd 40 int $0x40
2c3: c3 ret
000002c4 <wait>:
SYSCALL(wait)
2c4: b8 03 00 00 00 mov $0x3,%eax
2c9: cd 40 int $0x40
2cb: c3 ret
000002cc <pipe>:
SYSCALL(pipe)
2cc: b8 04 00 00 00 mov $0x4,%eax
2d1: cd 40 int $0x40
2d3: c3 ret
000002d4 <read>:
SYSCALL(read)
2d4: b8 05 00 00 00 mov $0x5,%eax
2d9: cd 40 int $0x40
2db: c3 ret
000002dc <write>:
SYSCALL(write)
2dc: b8 10 00 00 00 mov $0x10,%eax
2e1: cd 40 int $0x40
2e3: c3 ret
000002e4 <close>:
SYSCALL(close)
2e4: b8 15 00 00 00 mov $0x15,%eax
2e9: cd 40 int $0x40
2eb: c3 ret
000002ec <kill>:
SYSCALL(kill)
2ec: b8 06 00 00 00 mov $0x6,%eax
2f1: cd 40 int $0x40
2f3: c3 ret
000002f4 <exec>:
SYSCALL(exec)
2f4: b8 07 00 00 00 mov $0x7,%eax
2f9: cd 40 int $0x40
2fb: c3 ret
000002fc <open>:
SYSCALL(open)
2fc: b8 0f 00 00 00 mov $0xf,%eax
301: cd 40 int $0x40
303: c3 ret
00000304 <mknod>:
SYSCALL(mknod)
304: b8 11 00 00 00 mov $0x11,%eax
309: cd 40 int $0x40
30b: c3 ret
0000030c <unlink>:
SYSCALL(unlink)
30c: b8 12 00 00 00 mov $0x12,%eax
311: cd 40 int $0x40
313: c3 ret
00000314 <fstat>:
SYSCALL(fstat)
314: b8 08 00 00 00 mov $0x8,%eax
319: cd 40 int $0x40
31b: c3 ret
0000031c <link>:
SYSCALL(link)
31c: b8 13 00 00 00 mov $0x13,%eax
321: cd 40 int $0x40
323: c3 ret
00000324 <mkdir>:
SYSCALL(mkdir)
324: b8 14 00 00 00 mov $0x14,%eax
329: cd 40 int $0x40
32b: c3 ret
0000032c <chdir>:
SYSCALL(chdir)
32c: b8 09 00 00 00 mov $0x9,%eax
331: cd 40 int $0x40
333: c3 ret
00000334 <dup>:
SYSCALL(dup)
334: b8 0a 00 00 00 mov $0xa,%eax
339: cd 40 int $0x40
33b: c3 ret
0000033c <getpid>:
SYSCALL(getpid)
33c: b8 0b 00 00 00 mov $0xb,%eax
341: cd 40 int $0x40
343: c3 ret
00000344 <sbrk>:
SYSCALL(sbrk)
344: b8 0c 00 00 00 mov $0xc,%eax
349: cd 40 int $0x40
34b: c3 ret
0000034c <sleep>:
SYSCALL(sleep)
34c: b8 0d 00 00 00 mov $0xd,%eax
351: cd 40 int $0x40
353: c3 ret
00000354 <uptime>:
SYSCALL(uptime)
354: b8 0e 00 00 00 mov $0xe,%eax
359: cd 40 int $0x40
35b: c3 ret
0000035c <shm_get>:
SYSCALL(shm_get) //mod2
35c: b8 1c 00 00 00 mov $0x1c,%eax
361: cd 40 int $0x40
363: c3 ret
00000364 <shm_rem>:
SYSCALL(shm_rem) //mod2
364: b8 1d 00 00 00 mov $0x1d,%eax
369: cd 40 int $0x40
36b: c3 ret
0000036c <setHighPrio>:
SYSCALL(setHighPrio) //scheduler
36c: b8 1e 00 00 00 mov $0x1e,%eax
371: cd 40 int $0x40
373: c3 ret
00000374 <mutex_create>:
SYSCALL(mutex_create)//mod3
374: b8 16 00 00 00 mov $0x16,%eax
379: cd 40 int $0x40
37b: c3 ret
0000037c <mutex_delete>:
SYSCALL(mutex_delete)
37c: b8 17 00 00 00 mov $0x17,%eax
381: cd 40 int $0x40
383: c3 ret
00000384 <mutex_lock>:
SYSCALL(mutex_lock)
384: b8 18 00 00 00 mov $0x18,%eax
389: cd 40 int $0x40
38b: c3 ret
0000038c <mutex_unlock>:
SYSCALL(mutex_unlock)
38c: b8 19 00 00 00 mov $0x19,%eax
391: cd 40 int $0x40
393: c3 ret
00000394 <cv_wait>:
SYSCALL(cv_wait)
394: b8 1a 00 00 00 mov $0x1a,%eax
399: cd 40 int $0x40
39b: c3 ret
0000039c <cv_signal>:
SYSCALL(cv_signal)
39c: b8 1b 00 00 00 mov $0x1b,%eax
3a1: cd 40 int $0x40
3a3: c3 ret
000003a4 <putc>:
#include "types.h"
#include "stat.h"
#include "user.h"
static void putc(int fd, char c)
{
3a4: 55 push %ebp
3a5: 89 e5 mov %esp,%ebp
3a7: 83 ec 18 sub $0x18,%esp
3aa: 8b 45 0c mov 0xc(%ebp),%eax
3ad: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
3b0: 83 ec 04 sub $0x4,%esp
3b3: 6a 01 push $0x1
3b5: 8d 45 f4 lea -0xc(%ebp),%eax
3b8: 50 push %eax
3b9: ff 75 08 pushl 0x8(%ebp)
3bc: e8 1b ff ff ff call 2dc <write>
3c1: 83 c4 10 add $0x10,%esp
}
3c4: 90 nop
3c5: c9 leave
3c6: c3 ret
000003c7 <printint>:
static void printint(int fd, int xx, int base, int sgn)
{
3c7: 55 push %ebp
3c8: 89 e5 mov %esp,%ebp
3ca: 53 push %ebx
3cb: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
3ce: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if (sgn && xx < 0) {
3d5: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
3d9: 74 17 je 3f2 <printint+0x2b>
3db: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
3df: 79 11 jns 3f2 <printint+0x2b>
neg = 1;
3e1: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
3e8: 8b 45 0c mov 0xc(%ebp),%eax
3eb: f7 d8 neg %eax
3ed: 89 45 ec mov %eax,-0x14(%ebp)
3f0: eb 06 jmp 3f8 <printint+0x31>
} else {
x = xx;
3f2: 8b 45 0c mov 0xc(%ebp),%eax
3f5: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
3f8: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do {
buf[i++] = digits[x % base];
3ff: 8b 4d f4 mov -0xc(%ebp),%ecx
402: 8d 41 01 lea 0x1(%ecx),%eax
405: 89 45 f4 mov %eax,-0xc(%ebp)
408: 8b 5d 10 mov 0x10(%ebp),%ebx
40b: 8b 45 ec mov -0x14(%ebp),%eax
40e: ba 00 00 00 00 mov $0x0,%edx
413: f7 f3 div %ebx
415: 89 d0 mov %edx,%eax
417: 0f b6 80 90 0a 00 00 movzbl 0xa90(%eax),%eax
41e: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
} while ((x /= base) != 0);
422: 8b 5d 10 mov 0x10(%ebp),%ebx
425: 8b 45 ec mov -0x14(%ebp),%eax
428: ba 00 00 00 00 mov $0x0,%edx
42d: f7 f3 div %ebx
42f: 89 45 ec mov %eax,-0x14(%ebp)
432: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
436: 75 c7 jne 3ff <printint+0x38>
if (neg)
438: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
43c: 74 2d je 46b <printint+0xa4>
buf[i++] = '-';
43e: 8b 45 f4 mov -0xc(%ebp),%eax
441: 8d 50 01 lea 0x1(%eax),%edx
444: 89 55 f4 mov %edx,-0xc(%ebp)
447: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while (--i >= 0)
44c: eb 1d jmp 46b <printint+0xa4>
putc(fd, buf[i]);
44e: 8d 55 dc lea -0x24(%ebp),%edx
451: 8b 45 f4 mov -0xc(%ebp),%eax
454: 01 d0 add %edx,%eax
456: 0f b6 00 movzbl (%eax),%eax
459: 0f be c0 movsbl %al,%eax
45c: 83 ec 08 sub $0x8,%esp
45f: 50 push %eax
460: ff 75 08 pushl 0x8(%ebp)
463: e8 3c ff ff ff call 3a4 <putc>
468: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
} while ((x /= base) != 0);
if (neg)
buf[i++] = '-';
while (--i >= 0)
46b: 83 6d f4 01 subl $0x1,-0xc(%ebp)
46f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
473: 79 d9 jns 44e <printint+0x87>
putc(fd, buf[i]);
}
475: 90 nop
476: 8b 5d fc mov -0x4(%ebp),%ebx
479: c9 leave
47a: c3 ret
0000047b <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void printf(int fd, char *fmt, ...)
{
47b: 55 push %ebp
47c: 89 e5 mov %esp,%ebp
47e: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
481: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint *) (void *)&fmt + 1;
488: 8d 45 0c lea 0xc(%ebp),%eax
48b: 83 c0 04 add $0x4,%eax
48e: 89 45 e8 mov %eax,-0x18(%ebp)
for (i = 0; fmt[i]; i++) {
491: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
498: e9 59 01 00 00 jmp 5f6 <printf+0x17b>
c = fmt[i] & 0xff;
49d: 8b 55 0c mov 0xc(%ebp),%edx
4a0: 8b 45 f0 mov -0x10(%ebp),%eax
4a3: 01 d0 add %edx,%eax
4a5: 0f b6 00 movzbl (%eax),%eax
4a8: 0f be c0 movsbl %al,%eax
4ab: 25 ff 00 00 00 and $0xff,%eax
4b0: 89 45 e4 mov %eax,-0x1c(%ebp)
if (state == 0) {
4b3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4b7: 75 2c jne 4e5 <printf+0x6a>
if (c == '%') {
4b9: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
4bd: 75 0c jne 4cb <printf+0x50>
state = '%';
4bf: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
4c6: e9 27 01 00 00 jmp 5f2 <printf+0x177>
} else {
putc(fd, c);
4cb: 8b 45 e4 mov -0x1c(%ebp),%eax
4ce: 0f be c0 movsbl %al,%eax
4d1: 83 ec 08 sub $0x8,%esp
4d4: 50 push %eax
4d5: ff 75 08 pushl 0x8(%ebp)
4d8: e8 c7 fe ff ff call 3a4 <putc>
4dd: 83 c4 10 add $0x10,%esp
4e0: e9 0d 01 00 00 jmp 5f2 <printf+0x177>
}
} else if (state == '%') {
4e5: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
4e9: 0f 85 03 01 00 00 jne 5f2 <printf+0x177>
if (c == 'd') {
4ef: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
4f3: 75 1e jne 513 <printf+0x98>
printint(fd, *ap, 10, 1);
4f5: 8b 45 e8 mov -0x18(%ebp),%eax
4f8: 8b 00 mov (%eax),%eax
4fa: 6a 01 push $0x1
4fc: 6a 0a push $0xa
4fe: 50 push %eax
4ff: ff 75 08 pushl 0x8(%ebp)
502: e8 c0 fe ff ff call 3c7 <printint>
507: 83 c4 10 add $0x10,%esp
ap++;
50a: 83 45 e8 04 addl $0x4,-0x18(%ebp)
50e: e9 d8 00 00 00 jmp 5eb <printf+0x170>
} else if (c == 'x' || c == 'p') {
513: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
517: 74 06 je 51f <printf+0xa4>
519: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
51d: 75 1e jne 53d <printf+0xc2>
printint(fd, *ap, 16, 0);
51f: 8b 45 e8 mov -0x18(%ebp),%eax
522: 8b 00 mov (%eax),%eax
524: 6a 00 push $0x0
526: 6a 10 push $0x10
528: 50 push %eax
529: ff 75 08 pushl 0x8(%ebp)
52c: e8 96 fe ff ff call 3c7 <printint>
531: 83 c4 10 add $0x10,%esp
ap++;
534: 83 45 e8 04 addl $0x4,-0x18(%ebp)
538: e9 ae 00 00 00 jmp 5eb <printf+0x170>
} else if (c == 's') {
53d: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
541: 75 43 jne 586 <printf+0x10b>
s = (char *)*ap;
543: 8b 45 e8 mov -0x18(%ebp),%eax
546: 8b 00 mov (%eax),%eax
548: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
54b: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if (s == 0)
54f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
553: 75 25 jne 57a <printf+0xff>
s = "(null)";
555: c7 45 f4 3a 08 00 00 movl $0x83a,-0xc(%ebp)
while (*s != 0) {
55c: eb 1c jmp 57a <printf+0xff>
putc(fd, *s);
55e: 8b 45 f4 mov -0xc(%ebp),%eax
561: 0f b6 00 movzbl (%eax),%eax
564: 0f be c0 movsbl %al,%eax
567: 83 ec 08 sub $0x8,%esp
56a: 50 push %eax
56b: ff 75 08 pushl 0x8(%ebp)
56e: e8 31 fe ff ff call 3a4 <putc>
573: 83 c4 10 add $0x10,%esp
s++;
576: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if (c == 's') {
s = (char *)*ap;
ap++;
if (s == 0)
s = "(null)";
while (*s != 0) {
57a: 8b 45 f4 mov -0xc(%ebp),%eax
57d: 0f b6 00 movzbl (%eax),%eax
580: 84 c0 test %al,%al
582: 75 da jne 55e <printf+0xe3>
584: eb 65 jmp 5eb <printf+0x170>
putc(fd, *s);
s++;
}
} else if (c == 'c') {
586: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
58a: 75 1d jne 5a9 <printf+0x12e>
putc(fd, *ap);
58c: 8b 45 e8 mov -0x18(%ebp),%eax
58f: 8b 00 mov (%eax),%eax
591: 0f be c0 movsbl %al,%eax
594: 83 ec 08 sub $0x8,%esp
597: 50 push %eax
598: ff 75 08 pushl 0x8(%ebp)
59b: e8 04 fe ff ff call 3a4 <putc>
5a0: 83 c4 10 add $0x10,%esp
ap++;
5a3: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5a7: eb 42 jmp 5eb <printf+0x170>
} else if (c == '%') {
5a9: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
5ad: 75 17 jne 5c6 <printf+0x14b>
putc(fd, c);
5af: 8b 45 e4 mov -0x1c(%ebp),%eax
5b2: 0f be c0 movsbl %al,%eax
5b5: 83 ec 08 sub $0x8,%esp
5b8: 50 push %eax
5b9: ff 75 08 pushl 0x8(%ebp)
5bc: e8 e3 fd ff ff call 3a4 <putc>
5c1: 83 c4 10 add $0x10,%esp
5c4: eb 25 jmp 5eb <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
5c6: 83 ec 08 sub $0x8,%esp
5c9: 6a 25 push $0x25
5cb: ff 75 08 pushl 0x8(%ebp)
5ce: e8 d1 fd ff ff call 3a4 <putc>
5d3: 83 c4 10 add $0x10,%esp
putc(fd, c);
5d6: 8b 45 e4 mov -0x1c(%ebp),%eax
5d9: 0f be c0 movsbl %al,%eax
5dc: 83 ec 08 sub $0x8,%esp
5df: 50 push %eax
5e0: ff 75 08 pushl 0x8(%ebp)
5e3: e8 bc fd ff ff call 3a4 <putc>
5e8: 83 c4 10 add $0x10,%esp
}
state = 0;
5eb: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint *) (void *)&fmt + 1;
for (i = 0; fmt[i]; i++) {
5f2: 83 45 f0 01 addl $0x1,-0x10(%ebp)
5f6: 8b 55 0c mov 0xc(%ebp),%edx
5f9: 8b 45 f0 mov -0x10(%ebp),%eax
5fc: 01 d0 add %edx,%eax
5fe: 0f b6 00 movzbl (%eax),%eax
601: 84 c0 test %al,%al
603: 0f 85 94 fe ff ff jne 49d <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
609: 90 nop
60a: c9 leave
60b: c3 ret
0000060c <free>:
static Header base;
static Header *freep;
void free(void *ap)
{
60c: 55 push %ebp
60d: 89 e5 mov %esp,%ebp
60f: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header *) ap - 1; //take address of memory -> subtract one size of p to get to header to memeory
612: 8b 45 08 mov 0x8(%ebp),%eax
615: 83 e8 08 sub $0x8,%eax
618: 89 45 f8 mov %eax,-0x8(%ebp)
for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) //comparing pointers to headers...maybe ordering spatially...
61b: a1 ac 0a 00 00 mov 0xaac,%eax
620: 89 45 fc mov %eax,-0x4(%ebp)
623: eb 24 jmp 649 <free+0x3d>
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr))
625: 8b 45 fc mov -0x4(%ebp),%eax
628: 8b 00 mov (%eax),%eax
62a: 3b 45 fc cmp -0x4(%ebp),%eax
62d: 77 12 ja 641 <free+0x35>
62f: 8b 45 f8 mov -0x8(%ebp),%eax
632: 3b 45 fc cmp -0x4(%ebp),%eax
635: 77 24 ja 65b <free+0x4f>
637: 8b 45 fc mov -0x4(%ebp),%eax
63a: 8b 00 mov (%eax),%eax
63c: 3b 45 f8 cmp -0x8(%ebp),%eax
63f: 77 1a ja 65b <free+0x4f>
void free(void *ap)
{
Header *bp, *p;
bp = (Header *) ap - 1; //take address of memory -> subtract one size of p to get to header to memeory
for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) //comparing pointers to headers...maybe ordering spatially...
641: 8b 45 fc mov -0x4(%ebp),%eax
644: 8b 00 mov (%eax),%eax
646: 89 45 fc mov %eax,-0x4(%ebp)
649: 8b 45 f8 mov -0x8(%ebp),%eax
64c: 3b 45 fc cmp -0x4(%ebp),%eax
64f: 76 d4 jbe 625 <free+0x19>
651: 8b 45 fc mov -0x4(%ebp),%eax
654: 8b 00 mov (%eax),%eax
656: 3b 45 f8 cmp -0x8(%ebp),%eax
659: 76 ca jbe 625 <free+0x19>
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if (bp + bp->s.size == p->s.ptr) { //checks sizes to merge contiguous freed regions
65b: 8b 45 f8 mov -0x8(%ebp),%eax
65e: 8b 40 04 mov 0x4(%eax),%eax
661: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
668: 8b 45 f8 mov -0x8(%ebp),%eax
66b: 01 c2 add %eax,%edx
66d: 8b 45 fc mov -0x4(%ebp),%eax
670: 8b 00 mov (%eax),%eax
672: 39 c2 cmp %eax,%edx
674: 75 24 jne 69a <free+0x8e>
bp->s.size += p->s.ptr->s.size;
676: 8b 45 f8 mov -0x8(%ebp),%eax
679: 8b 50 04 mov 0x4(%eax),%edx
67c: 8b 45 fc mov -0x4(%ebp),%eax
67f: 8b 00 mov (%eax),%eax
681: 8b 40 04 mov 0x4(%eax),%eax
684: 01 c2 add %eax,%edx
686: 8b 45 f8 mov -0x8(%ebp),%eax
689: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
68c: 8b 45 fc mov -0x4(%ebp),%eax
68f: 8b 00 mov (%eax),%eax
691: 8b 10 mov (%eax),%edx
693: 8b 45 f8 mov -0x8(%ebp),%eax
696: 89 10 mov %edx,(%eax)
698: eb 0a jmp 6a4 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
69a: 8b 45 fc mov -0x4(%ebp),%eax
69d: 8b 10 mov (%eax),%edx
69f: 8b 45 f8 mov -0x8(%ebp),%eax
6a2: 89 10 mov %edx,(%eax)
if (p + p->s.size == bp) {
6a4: 8b 45 fc mov -0x4(%ebp),%eax
6a7: 8b 40 04 mov 0x4(%eax),%eax
6aa: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6b1: 8b 45 fc mov -0x4(%ebp),%eax
6b4: 01 d0 add %edx,%eax
6b6: 3b 45 f8 cmp -0x8(%ebp),%eax
6b9: 75 20 jne 6db <free+0xcf>
p->s.size += bp->s.size;
6bb: 8b 45 fc mov -0x4(%ebp),%eax
6be: 8b 50 04 mov 0x4(%eax),%edx
6c1: 8b 45 f8 mov -0x8(%ebp),%eax
6c4: 8b 40 04 mov 0x4(%eax),%eax
6c7: 01 c2 add %eax,%edx
6c9: 8b 45 fc mov -0x4(%ebp),%eax
6cc: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
6cf: 8b 45 f8 mov -0x8(%ebp),%eax
6d2: 8b 10 mov (%eax),%edx
6d4: 8b 45 fc mov -0x4(%ebp),%eax
6d7: 89 10 mov %edx,(%eax)
6d9: eb 08 jmp 6e3 <free+0xd7>
} else
p->s.ptr = bp;
6db: 8b 45 fc mov -0x4(%ebp),%eax
6de: 8b 55 f8 mov -0x8(%ebp),%edx
6e1: 89 10 mov %edx,(%eax)
freep = p;
6e3: 8b 45 fc mov -0x4(%ebp),%eax
6e6: a3 ac 0a 00 00 mov %eax,0xaac
}
6eb: 90 nop
6ec: c9 leave
6ed: c3 ret
000006ee <morecore>:
static Header *morecore(uint nu)
{
6ee: 55 push %ebp
6ef: 89 e5 mov %esp,%ebp
6f1: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if (nu < 4096)
6f4: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
6fb: 77 07 ja 704 <morecore+0x16>
nu = 4096;
6fd: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
704: 8b 45 08 mov 0x8(%ebp),%eax
707: c1 e0 03 shl $0x3,%eax
70a: 83 ec 0c sub $0xc,%esp
70d: 50 push %eax
70e: e8 31 fc ff ff call 344 <sbrk>
713: 83 c4 10 add $0x10,%esp
716: 89 45 f4 mov %eax,-0xc(%ebp)
if (p == (char *)-1)
719: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
71d: 75 07 jne 726 <morecore+0x38>
return 0;
71f: b8 00 00 00 00 mov $0x0,%eax
724: eb 26 jmp 74c <morecore+0x5e>
hp = (Header *) p;
726: 8b 45 f4 mov -0xc(%ebp),%eax
729: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
72c: 8b 45 f0 mov -0x10(%ebp),%eax
72f: 8b 55 08 mov 0x8(%ebp),%edx
732: 89 50 04 mov %edx,0x4(%eax)
free((void *)(hp + 1));
735: 8b 45 f0 mov -0x10(%ebp),%eax
738: 83 c0 08 add $0x8,%eax
73b: 83 ec 0c sub $0xc,%esp
73e: 50 push %eax
73f: e8 c8 fe ff ff call 60c <free>
744: 83 c4 10 add $0x10,%esp
return freep;
747: a1 ac 0a 00 00 mov 0xaac,%eax
}
74c: c9 leave
74d: c3 ret
0000074e <malloc>:
void *malloc(uint nbytes)
{
74e: 55 push %ebp
74f: 89 e5 mov %esp,%ebp
751: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1) / sizeof(Header) + 1;
754: 8b 45 08 mov 0x8(%ebp),%eax
757: 83 c0 07 add $0x7,%eax
75a: c1 e8 03 shr $0x3,%eax
75d: 83 c0 01 add $0x1,%eax
760: 89 45 ec mov %eax,-0x14(%ebp)
if ((prevp = freep) == 0) {
763: a1 ac 0a 00 00 mov 0xaac,%eax
768: 89 45 f0 mov %eax,-0x10(%ebp)
76b: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
76f: 75 23 jne 794 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
771: c7 45 f0 a4 0a 00 00 movl $0xaa4,-0x10(%ebp)
778: 8b 45 f0 mov -0x10(%ebp),%eax
77b: a3 ac 0a 00 00 mov %eax,0xaac
780: a1 ac 0a 00 00 mov 0xaac,%eax
785: a3 a4 0a 00 00 mov %eax,0xaa4
base.s.size = 0;
78a: c7 05 a8 0a 00 00 00 movl $0x0,0xaa8
791: 00 00 00
}
for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) {
794: 8b 45 f0 mov -0x10(%ebp),%eax
797: 8b 00 mov (%eax),%eax
799: 89 45 f4 mov %eax,-0xc(%ebp)
if (p->s.size >= nunits) {
79c: 8b 45 f4 mov -0xc(%ebp),%eax
79f: 8b 40 04 mov 0x4(%eax),%eax
7a2: 3b 45 ec cmp -0x14(%ebp),%eax
7a5: 72 4d jb 7f4 <malloc+0xa6>
if (p->s.size == nunits)
7a7: 8b 45 f4 mov -0xc(%ebp),%eax
7aa: 8b 40 04 mov 0x4(%eax),%eax
7ad: 3b 45 ec cmp -0x14(%ebp),%eax
7b0: 75 0c jne 7be <malloc+0x70>
prevp->s.ptr = p->s.ptr;
7b2: 8b 45 f4 mov -0xc(%ebp),%eax
7b5: 8b 10 mov (%eax),%edx
7b7: 8b 45 f0 mov -0x10(%ebp),%eax
7ba: 89 10 mov %edx,(%eax)
7bc: eb 26 jmp 7e4 <malloc+0x96>
else {
p->s.size -= nunits;
7be: 8b 45 f4 mov -0xc(%ebp),%eax
7c1: 8b 40 04 mov 0x4(%eax),%eax
7c4: 2b 45 ec sub -0x14(%ebp),%eax
7c7: 89 c2 mov %eax,%edx
7c9: 8b 45 f4 mov -0xc(%ebp),%eax
7cc: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
7cf: 8b 45 f4 mov -0xc(%ebp),%eax
7d2: 8b 40 04 mov 0x4(%eax),%eax
7d5: c1 e0 03 shl $0x3,%eax
7d8: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
7db: 8b 45 f4 mov -0xc(%ebp),%eax
7de: 8b 55 ec mov -0x14(%ebp),%edx
7e1: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
7e4: 8b 45 f0 mov -0x10(%ebp),%eax
7e7: a3 ac 0a 00 00 mov %eax,0xaac
//printf(0, "\nMalloc Pointer Value = %p\n", p+1);
return (void *)(p + 1);
7ec: 8b 45 f4 mov -0xc(%ebp),%eax
7ef: 83 c0 08 add $0x8,%eax
7f2: eb 3b jmp 82f <malloc+0xe1>
}
if (p == freep)
7f4: a1 ac 0a 00 00 mov 0xaac,%eax
7f9: 39 45 f4 cmp %eax,-0xc(%ebp)
7fc: 75 1e jne 81c <malloc+0xce>
if ((p = morecore(nunits)) == 0)
7fe: 83 ec 0c sub $0xc,%esp
801: ff 75 ec pushl -0x14(%ebp)
804: e8 e5 fe ff ff call 6ee <morecore>
809: 83 c4 10 add $0x10,%esp
80c: 89 45 f4 mov %eax,-0xc(%ebp)
80f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
813: 75 07 jne 81c <malloc+0xce>
return 0;
815: b8 00 00 00 00 mov $0x0,%eax
81a: eb 13 jmp 82f <malloc+0xe1>
nunits = (nbytes + sizeof(Header) - 1) / sizeof(Header) + 1;
if ((prevp = freep) == 0) {
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) {
81c: 8b 45 f4 mov -0xc(%ebp),%eax
81f: 89 45 f0 mov %eax,-0x10(%ebp)
822: 8b 45 f4 mov -0xc(%ebp),%eax
825: 8b 00 mov (%eax),%eax
827: 89 45 f4 mov %eax,-0xc(%ebp)
return (void *)(p + 1);
}
if (p == freep)
if ((p = morecore(nunits)) == 0)
return 0;
}
82a: e9 6d ff ff ff jmp 79c <malloc+0x4e>
}
82f: c9 leave
830: c3 ret
|
oeis/036/A036216.asm | neoneye/loda-programs | 11 | 3028 | ; A036216: Expansion of 1/(1 - 3*x)^4; 4-fold convolution of A000244 (powers of 3).
; 1,12,90,540,2835,13608,61236,262440,1082565,4330260,16888014,64481508,241805655,892820880,3252418920,11708708112,41712272649,147219785820,515269250370,1789882659180,6175095174171,21171754882872,72176437100700,244772264950200,826106394206925,2775717484535268,9287977736714166,30959925789047220,102831182085049695,340406671729819680,1123342016708404944,3696157603363138848,12128017136035299345,39691692445206434220,129581701806409241130,422066114455161528252,1371714871979274966819
mov $1,-3
pow $1,$0
mov $2,-4
bin $2,$0
mul $1,$2
mov $0,$1
|
src/GBA.Display.adb | 98devin/ada-gba-dev | 7 | 26204 | <reponame>98devin/ada-gba-dev
-- Copyright (c) 2021 <NAME>
-- zlib License -- see LICENSE for details.
package body GBA.Display is
procedure Set_Display_Mode (Mode : Video_Mode; Forced_Blank : Boolean := False) is
begin
Display_Control :=
( Display_Control with delta
Mode => Mode
, Forced_Blank => Forced_Blank
);
end;
procedure Enable_Display_Element
(Element : Toggleable_Display_Element; Enable : Boolean := True) is
begin
Display_Control.Displayed_Elements (Element) := Enable;
end;
procedure Request_VBlank_Interrupt (Request : Boolean := True) is
begin
Display_Status.Request_VBlank_Interrupt := Request;
end;
procedure Request_HBlank_Interrupt (Request : Boolean := True) is
begin
Display_Status.Request_HBlank_Interrupt := Request;
end;
end GBA.Display; |
src/tests/trainingsettests.adb | sebsgit/textproc | 0 | 17642 | with AUnit.Assertions; use AUnit.Assertions;
with Ada.Text_IO;
with Ada.Strings.Unbounded;
with Ada.Containers;
with TrainingData;
with PixelArray;
with MathUtils;
with NeuralNet;
with NNClassifier;
with Timer;
with ImageIO;
with CSV;
use Ada.Containers;
use MathUtils.Float_Vec;
package body TrainingSetTests is
procedure Register_Tests (T: in out TestCase) is
use AUnit.Test_Cases.Registration;
begin
Register_Routine (T, testDataGenerator'Access, "float vec generator");
Register_Routine (T, testTrainInputMNIST'Access, "NN train on MNIST");
Register_Routine (T, testTrainInputImages'Access, "NN train on local image data");
end Register_Tests;
function Name(T: TestCase) return Test_String is
begin
return Format("Training Set Tests");
end Name;
procedure testDataGenerator(T : in out Test_Cases.Test_Case'Class) is
image: PixelArray.ImagePlane;
output: MathUtils.Vector;
expectedValues: MathUtils.Vector;
begin
image.assign(PixelArray.allocate(16, 16));
for x in 0 .. 15 loop
for y in 0 .. 15 loop
image.set(x, y, PixelArray.Pixel((x + 1) * (y + 1) - 1));
expectedValues.Append(Float(image.get(x, y)) / 255.0);
end loop;
end loop;
output := TrainingData.toDataVector(image);
Assert(output.Length = 16 * 16, "data length");
Assert(output = expectedValues, "");
end testDataGenerator;
function oneHotEncode(label: Natural; labelCount: Positive) return MathUtils.Vector
with Pre => label < labelCount
is
result: MathUtils.Vector;
begin
result.Set_Length(Ada.Containers.Count_Type(labelCount));
for x of result loop
x := 0.0;
end loop;
result(label + 1) := 1.0;
return result;
end oneHotEncode;
procedure loadMNistData(input, validation: in out TrainingData.Set) is
reader: CSV.Reader := CSV.open("../training_set/mnist_train_small.csv");
trainSetSize: constant Positive := 1350;
testSetSize: constant Positive := 250;
procedure load(s: in out TrainingData.Set; cnt: in Positive)
with Post => s.size >= cnt
is
i: Positive := 1;
vec: MathUtils.Vector;
label: Natural;
begin
while i <= cnt loop
vec := reader.next;
label := Natural(vec.Element(1));
vec.Delete_First;
for v of vec loop
v := v / 255.0;
end loop;
Assert(Positive(vec.Length) = TrainingData.blockArea, "wrong size of input, expected: " & TrainingData.blockArea'Image & ", got: " & vec.Length'Image);
s.add(label, vec);
i := i + 1;
end loop;
end load;
begin
load(input, trainSetSize);
load(validation, testSetSize);
end loadMNistData;
procedure saveToFile(data: MathUtils.Vector; path: String)
with Pre => Positive(data.Length) = TrainingData.blockArea
is
image: PixelArray.ImagePlane := PixelArray.allocate(width => TrainingData.blockSize,
height => TrainingData.blockSize);
saveResult: Boolean;
begin
for y in 0 .. image.height - 1 loop
for x in 0 .. image.width - 1 loop
declare
id: constant Positive := y * image.width + x + 1;
begin
image.set(x => x,
y => y,
px => PixelArray.Pixel(255.0 * data(id)));
end;
end loop;
end loop;
saveResult := ImageIO.save(filename => path,
image => image);
end saveToFile;
function Get_Index_Of_Max(vec: in MathUtils.Vector) return Natural is
result: Positive := vec.First_Index;
begin
for i in vec.First_Index + 1 .. vec.Last_Index loop
if vec(i) > vec(result) then
result := i;
end if;
end loop;
return result;
end Get_Index_Of_Max;
procedure testTrainInputMNIST(T : in out Test_Cases.Test_Case'Class) is
set: TrainingData.Set;
validationSet: TrainingData.Set;
config: NeuralNet.Config(1);
dnn: NNClassifier.DNN(config.size + 1);
tm: Timer.T;
pred: MathUtils.Vector;
di: Positive := 1;
index_of_max: Positive := 1;
failedPredictions: Natural := 0;
begin
loadMNistData(set, validationSet);
Assert(set.size > 10, "not enough train data: " & set.size'Image);
Assert(validationSet.size > 10, "not enough test data: " & validationSet.size'Image);
config.act := NeuralNet.LOGISTIC;
config.inputSize := TrainingData.blockArea;
config.lr := 0.7;
config.sizes := (1 => 32);
dnn := NNClassifier.create(config => config,
numberOfClasses => 10);
Ada.Text_IO.Put_Line("Train the model...");
tm := Timer.start;
dnn.train(data => set.values,
labels => set.labels);
tm.report;
Ada.Text_IO.Put_Line("Inference...");
tm.reset;
for lab of validationSet.labels loop
-- MathUtils.print(validationSet.values.data(di));
pred := dnn.classify(validationSet.values.data(di));
index_of_max := Get_Index_Of_Max(pred);
if index_of_max /= lab + 1 then
failedPredictions := failedPredictions + 1;
end if;
di := di + 1;
end loop;
tm.report;
declare
acc: Float;
begin
acc := Float(validationSet.size - failedPredictions) / Float(validationSet.size);
Ada.Text_IO.Put_Line("Model accuracy: " & acc'Image);
-- require > 75% accuracy
Assert(acc > 0.75, "total: " & validationSet.size'Image & ", failed: " & failedPredictions'Image);
end;
end testTrainInputMNIST;
procedure testTrainInputImages(T : in out Test_Cases.Test_Case'Class) is
set: TrainingData.Set;
validationSet: TrainingData.Set;
config: NeuralNet.Config(1);
dnn: NNClassifier.DNN(config.size + 1);
tm: Timer.T;
pred: MathUtils.Vector;
di: Positive := 1;
index_of_max: Positive := 1;
failedPredictions: Natural := 0;
begin
Ada.Text_IO.Put_Line("Load training set...");
tm := Timer.start;
set.loadFrom(Ada.Strings.Unbounded.To_Unbounded_String("../training_set/"));
tm.report;
validationSet.loadFrom(Ada.Strings.Unbounded.To_Unbounded_String("../training_set_test_cases/"));
tm.report;
Assert(set.size > 10, "not enough train data: " & set.size'Image);
Assert(validationSet.size > 10, "not enough test data: " & validationSet.size'Image);
config.act := NeuralNet.LOGISTIC;
config.inputSize := TrainingData.blockArea;
config.lr := 0.7;
config.sizes := (1 => 32);
dnn := NNClassifier.create(config => config,
numberOfClasses => 10);
Ada.Text_IO.Put_Line("Train the model...");
tm.reset;
-- TODO: remove the loop when there is more train data
for i in 0 .. 2 loop
dnn.train(data => set.values,
labels => set.labels);
end loop;
tm.report;
Ada.Text_IO.Put_Line("Inference...");
tm.reset;
for lab of validationSet.labels loop
-- MathUtils.print(validationSet.values.data(di));
pred := dnn.classify(validationSet.values.data(di));
index_of_max := Get_Index_Of_Max(pred);
if index_of_max /= (lab + 1) then
failedPredictions := failedPredictions + 1;
end if;
di := di + 1;
end loop;
tm.report;
declare
acc: Float;
begin
acc := Float(validationSet.size - failedPredictions) / Float(validationSet.size);
Ada.Text_IO.Put_Line("Model accuracy: " & acc'Image);
-- require > 75% accuracy
Assert(acc > 0.75, "total: " & validationSet.size'Image & ", failed: " & failedPredictions'Image);
end;
end testTrainInputImages;
end TrainingSetTests;
|
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca.log_21829_228.asm | ljhsiun2/medusa | 9 | 243951 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x4f5b, %rsi
lea addresses_A_ht+0x59eb, %rdi
clflush (%rsi)
nop
xor %rdx, %rdx
mov $60, %rcx
rep movsq
nop
nop
mfence
lea addresses_D_ht+0x8d1b, %r9
nop
and %r13, %r13
vmovups (%r9), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rcx
nop
nop
add %rsi, %rsi
lea addresses_A_ht+0x1ef5b, %rcx
nop
nop
cmp %rsi, %rsi
mov $0x6162636465666768, %r9
movq %r9, %xmm1
movups %xmm1, (%rcx)
nop
nop
nop
inc %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %rbx
push %rcx
push %rdx
// Faulty Load
lea addresses_RW+0xdb5b, %rcx
nop
nop
nop
nop
and $57364, %r14
vmovntdqa (%rcx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r13
lea oracles, %r14
and $0xff, %r13
shlq $12, %r13
mov (%r14,%r13,1), %r13
pop %rdx
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_RW', 'same': True, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': True, 'type': 'addresses_RW', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'00': 19144, '46': 2685}
00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 46 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 46 00 46 00 00 00 46 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 46 00 00 00 00 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 46 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 46 00 46 00 00 00 46 00 00 46 00 00 00 00 00 00 00 00 00 46 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 00 46 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 46 46 00 00 00 00 46 00 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 00 46 00 46 00 00 00 46 00 00 00 46 46 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 46 00 00 00 46 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 46 00 00 00 00 00 00 00 46 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00
*/
|
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_376_485.asm | ljhsiun2/medusa | 9 | 15192 | <filename>Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_376_485.asm
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r8
push %r9
push %rcx
push %rdi
// Faulty Load
lea addresses_normal+0x1cb7f, %r9
nop
add %rcx, %rcx
vmovntdqa (%r9), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r8
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_normal', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 376}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
spectranet/libspectranet/zxromdefs.asm | speccytools/spectranet-gdbserver | 40 | 178540 | <gh_stars>10-100
; Some definitions for ZX ROM entry points.
DEFC ZX_ERROR_1 = 0x08
DEFC ZX_GET_CHAR = 0x18
DEFC ZX_NEXT_CHAR = 0x20
DEFC ZX_BEEPER = 0x03B5
DEFC ZX_ED_LOOP = 0x0F38
DEFC ZX_ED_EDIT = 0x0FA9
DEFC ZX_ED_ERROR = 0x107F
DEFC ZX_CHAN_OPEN = 0x1601
DEFC ZX_STR_DATA1 = 0x1727
DEFC ZX_NEXT_2NUM = 0x1C79
DEFC ZX_EXPT_1NUM = 0x1C82
DEFC ZX_EXPT_EXP = 0x1C8C
DEFC ZX_FIND_INT1 = 0x1E94
DEFC ZX_FIND_INT2 = 0x1E99
DEFC ZX_STK_FETCH = 0x2BF1
DEFC ZX_STACK_A = 0x2D28
DEFC ZX_PRINT_FP = 0x2DE3
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1544.asm | ljhsiun2/medusa | 9 | 8124 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r15
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xdf0, %rbx
nop
nop
nop
dec %rdx
mov (%rbx), %r15d
nop
nop
nop
sub %r10, %r10
lea addresses_UC_ht+0x130a0, %rbx
nop
nop
nop
nop
and %rdx, %rdx
movups (%rbx), %xmm3
vpextrq $0, %xmm3, %r13
nop
nop
nop
nop
nop
xor $48891, %r10
lea addresses_normal_ht+0x16434, %r14
nop
nop
nop
nop
sub %r8, %r8
mov (%r14), %r13d
xor %rdx, %rdx
lea addresses_WC_ht+0x1984, %rsi
lea addresses_WC_ht+0xee74, %rdi
nop
and $40969, %r13
mov $28, %rcx
rep movsb
nop
nop
nop
nop
nop
and $21049, %r14
lea addresses_UC_ht+0x497c, %rsi
lea addresses_UC_ht+0x11e04, %rdi
nop
nop
nop
nop
nop
and %r8, %r8
mov $125, %rcx
rep movsb
and %r15, %r15
lea addresses_A_ht+0x528f, %rsi
lea addresses_WT_ht+0x15e14, %rdi
nop
nop
nop
nop
nop
xor $18172, %r13
mov $19, %rcx
rep movsl
nop
nop
nop
nop
nop
inc %rsi
lea addresses_WT_ht+0x1a114, %rsi
lea addresses_normal_ht+0x229c, %rdi
clflush (%rdi)
nop
nop
cmp $42836, %r10
mov $39, %rcx
rep movsw
nop
nop
nop
nop
xor %r13, %r13
lea addresses_A_ht+0x6a14, %rcx
nop
nop
nop
nop
nop
xor $48312, %r14
movb $0x61, (%rcx)
nop
nop
nop
cmp $39569, %r15
lea addresses_normal_ht+0x141ec, %r8
xor $63637, %rcx
mov $0x6162636465666768, %r10
movq %r10, (%r8)
nop
nop
nop
nop
nop
sub $63832, %r10
lea addresses_normal_ht+0x3194, %r10
and %rdx, %rdx
mov $0x6162636465666768, %r14
movq %r14, (%r10)
inc %rdx
lea addresses_A_ht+0x565d, %rbx
nop
nop
nop
nop
add %r15, %r15
mov $0x6162636465666768, %r14
movq %r14, (%rbx)
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_UC_ht+0xccbc, %rsi
lea addresses_WT_ht+0x161d4, %rdi
nop
nop
xor %rdx, %rdx
mov $78, %rcx
rep movsb
nop
nop
add $25389, %r13
lea addresses_A_ht+0xcc14, %rsi
clflush (%rsi)
nop
nop
nop
nop
inc %r13
mov (%rsi), %r10w
cmp %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %rbx
push %rcx
// Store
lea addresses_PSE+0x1e214, %r15
nop
nop
nop
nop
nop
cmp %r12, %r12
mov $0x5152535455565758, %r10
movq %r10, (%r15)
nop
and $49570, %r15
// Faulty Load
lea addresses_WC+0x6214, %rbx
nop
nop
nop
nop
nop
add $28736, %r15
movups (%rbx), %xmm4
vpextrq $0, %xmm4, %r10
lea oracles, %r15
and $0xff, %r10
shlq $12, %r10
mov (%r15,%r10,1), %r10
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_PSE', 'size': 8, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': True}}
{'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.