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
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0_notsx.log_21829_521.asm
ljhsiun2/medusa
9
4000
.global s_prepare_buffers s_prepare_buffers: push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1d5b5, %rsi lea addresses_WC_ht+0xb1d5, %rdi nop nop nop nop nop sub $3566, %r8 mov $55, %rcx rep movsw cmp $3789, %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r8 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r14 push %r8 push %rbp push %rdx // Store lea addresses_UC+0xe287, %rbp xor $49400, %r14 movw $0x5152, (%rbp) nop add $18209, %rdx // Load mov $0xcf5, %r10 nop nop nop nop mfence movb (%r10), %r12b nop nop cmp %r10, %r10 // Store lea addresses_D+0xd9d5, %r8 nop nop nop add %r13, %r13 movb $0x51, (%r8) nop xor %r12, %r12 // Store lea addresses_WT+0x7b7d, %rdx nop nop inc %r10 mov $0x5152535455565758, %rbp movq %rbp, (%rdx) nop sub $18711, %r12 // Faulty Load lea addresses_A+0x59d5, %r8 nop add %r13, %r13 movb (%r8), %r12b lea oracles, %r8 and $0xff, %r12 shlq $12, %r12 mov (%r8,%r12,1), %r12 pop %rdx pop %rbp pop %r8 pop %r14 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}} [Faulty Load] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}} {'51': 21829} 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 */
jmespath-core/src/main/antlr4/io/burt/jmespath/parser/JmesPath.g4
retractable/jmespath-java
0
4410
<filename>jmespath-core/src/main/antlr4/io/burt/jmespath/parser/JmesPath.g4 grammar JmesPath; jmesPathExpression : expression EOF ; expression : expression '.' chainedExpression # chainExpression | expression bracketSpecifier # bracketedExpression | bracketSpecifier # bracketExpression | expression COMPARATOR expression # comparisonExpression | '!' expression # notExpression | expression '&&' expression # andExpression | expression '||' expression # orExpression | identifier # identifierExpression | '(' expression ')' # parenExpression | wildcard # wildcardExpression | multiSelectList # multiSelectListExpression | multiSelectHash # multiSelectHashExpression | literal # literalExpression | functionExpression # functionCallExpression | expression '|' expression # pipeExpression | RAW_STRING # rawStringExpression | currentNode # currentNodeExpression ; chainedExpression : identifier | multiSelectList | multiSelectHash | functionExpression | wildcard ; wildcard : '*' ; multiSelectList : '[' expression (',' expression)* ']' ; multiSelectHash : '{' keyvalExpr (',' keyvalExpr)* '}' ; keyvalExpr : identifier ':' expression ; bracketSpecifier : '[' SIGNED_INT ']' # bracketIndex | '[' '*' ']' # bracketStar | '[' slice ']' # bracketSlice | '[' ']' # bracketFlatten | '[?' expression ']' # select ; slice : start=SIGNED_INT? ':' stop=SIGNED_INT? (':' step=SIGNED_INT?)? ; COMPARATOR : '<' | '<=' | '==' | '>=' | '>' | '!=' ; functionExpression : NAME '(' functionArg (',' functionArg)* ')' | NAME '(' ')' ; functionArg : expression | expressionType ; currentNode : '@' ; expressionType : '&' expression ; RAW_STRING : '\'' (RAW_ESC | ~['\\])* '\'' ; fragment RAW_ESC : '\\' . ; literal : '`' jsonValue '`' ; identifier : NAME | STRING | JSON_CONSTANT ; JSON_CONSTANT : 'true' | 'false' | 'null' ; NAME : [a-zA-Z_] [a-zA-Z0-9_]* ; jsonObject : '{' jsonObjectPair (',' jsonObjectPair)* '}' | '{' '}' ; jsonObjectPair : STRING ':' jsonValue ; jsonArray : '[' jsonValue (',' jsonValue)* ']' | '[' ']' ; jsonValue : STRING # jsonStringValue | (REAL_OR_EXPONENT_NUMBER | SIGNED_INT) # jsonNumberValue | jsonObject # jsonObjectValue | jsonArray # jsonArrayValue | JSON_CONSTANT # jsonConstantValue ; STRING : '"' (ESC | ~ ["\\])* '"' ; fragment ESC : '\\' (["\\/bfnrt`] | UNICODE) ; fragment UNICODE : 'u' HEX HEX HEX HEX ; fragment HEX : [0-9a-fA-F] ; REAL_OR_EXPONENT_NUMBER : '-'? INT '.' [0-9] + EXP? | '-'? INT EXP ; SIGNED_INT : '-'? INT ; fragment INT : '0' | [1-9] [0-9]* ; fragment EXP : [Ee] [+\-]? INT ; WS : [ \t\n\r] + -> skip ;
libsrc/target/zx-common/graphics/getmaxx.asm
ahjelm/z88dk
640
178235
MODULE getmaxx SECTION code_clib PUBLIC getmaxx PUBLIC _getmaxx EXTERN __zx_screenmode EXTERN __console_w EXTERN __gfx_fatpix .getmaxx ._getmaxx ld a,(__zx_screenmode) ld hl,255 cp 3 ret c and 7 cp 6 jr nz,zxn_getmaxx ld a,(__gfx_fatpix) and a ret nz ld hl,511 ret zxn_getmaxx: ; So we must be left with a ZXN screenmode ld hl,(__console_w) ld h,0 add hl,hl dec hl ret
RW/Data/RTrie/Insert.agda
VictorCMiraldo/agda-rw
16
3632
open import Prelude open import Level using (_⊔_; Lift; lift) renaming (suc to ls; zero to lz) open import Data.String using (String) open import Data.Maybe using (Maybe; nothing; just) open import Data.Nat using (_≤_) module RW.Data.RTrie.Insert where open import Relation.Binary.PropositionalEquality using (inspect; [_]) open import RW.Data.RTrie.Decl import RW.Data.PMap (RTermᵢ ⊥) as IdxMap import RW.Data.PMap ℕ as ℕmap postulate trie-err : ∀{a}{A : Set a} → String → A open import RW.Utils.Monads open Monad {{...}} open Eq {{...}} I : ∀{a} → Set a → Set a I {a} = STₐ {lz} {a} (Σ ℕ (λ _ → Maybe ℕ)) _<$>_ : ∀{a}{A B : Set a} → (A → B) → I A → I B f <$> ix = ix >>= (return ∘ f) -------------------- -- Monadic boilerplate private getLbl : I (Maybe ℕ) getLbl = getₐ >>= return ∘ p2 putLbl : ℕ → I Unit putLbl n = getₐ >>= λ x → putₐ (p1 x , just n) getCount : I ℕ getCount = p1 <$> getₐ putCount : ℕ → I Unit putCount x = getLbl >>= putₐ ∘ (_,_ x) ++count : I ℕ ++count = getCount <>= (putCount ∘ suc) CellCtx : Set _ CellCtx = RTrie → Cell singleton : ∀{a}{A : Set a} → A → List A singleton x = x ∷ [] applyBRule : Rule → ℕ → Maybe ℕ applyBRule (Tr m n) k with m ≟-ℕ k ...| yes _ = just n ...| no _ = nothing applyBRule _ _ = nothing -- |Makes a new rule *without* checking anything. -- If the current label is nothing, returns a Gather -- If the current label is a (just l), return a Tr l. -- -- Changes the state to the newly created label. makeRule : I Rule makeRule = getLbl >>= λ l → (++count <>= putLbl) -- increments the counter and set's it. >>= λ c′ → return $ maybe (flip Tr c′) (Gr c′) l -- |Given a list of rules, which arise from we reaching -- either a leaf node or a previously bound symbol, -- will apply one of such rules or create a new one. -- -- In any case, this will change the current label either -- to a fresh one or by a transition in the list. handleRules : List Rule → I (List Rule) handleRules rs = getLbl >>= maybe (flip l≡just rs) (l≡nothing rs) where l≡just : ℕ → List Rule → I (List Rule) l≡just l [] = singleton <$> makeRule l≡just l (r ∷ rs) with applyBRule r l ...| just l′ = putLbl l′ >> return (r ∷ rs) ...| nothing = (_∷_ r) <$> l≡just l rs l≡nothing : List Rule → I (List Rule) l≡nothing [] = singleton <$> makeRule l≡nothing ((Gr k) ∷ rs) = putLbl k >> return ((Gr k) ∷ rs) l≡nothing (r ∷ rs) = _∷_ r <$> l≡nothing rs -- |Given a cell and a NON-BINDING index, mIdx takes care -- of finding the trie we need to keep traversing and -- creating a reconstruction function, for when we -- finish modifying the mentioned trie. mIdx : Cell → RTermᵢ ⊥ → I (CellCtx × RTrie) -- In the case we are inserting a ivarᵢ, we are going to merge the new btrie, -- which is going to be a leaf (TODO: why?), in the default branch. mIdx ((d , mh) , bs) (ivarᵢ _) = return $ (λ bt → (merge d bt , mh) , bs) , BTrieEmpty where merge : RTrie → RTrie → RTrie merge (Leaf as) (Leaf bs) = Leaf (as ++ bs) merge _ bt = bt -- For the more general case, if tid ∉ mh, we add and entry (tid ↦ empty). -- After, we return mh(tid) and the context that modifies this exact entry. mIdx ((d , mh) , bs) tid = let mh′ , prf = IdxMap.alterPrf BTrieEmpty tid mh in return $ (λ f → (d , IdxMap.insert tid f mh) , bs) , (IdxMap.lkup' tid mh′ prf) -- |When we find a binding symbol, however, things can be a bit more tricky. -- This symbol is either registered, in which case we just add a fresh -- rule to it, or it is not registered in the map, where we add it with -- a fresh rule. mSym : Cell → ℕ → I (CellCtx × RTrie) mSym (mh , bs) tsym with ℕmap.lkup tsym bs ...| nothing = makeRule >>= λ r → return (const (mh , (tsym , r ∷ []) ∷ bs) , BTrieEmpty) ...| just rs = handleRules rs >>= λ r → return (const (mh , ℕmap.insert tsym r bs) , BTrieEmpty) -- |𝑴 chooses which traversal function to use. 𝑴 : {A : Set}{{enA : Enum A}} → Cell → RTermᵢ A → I (CellCtx × RTrie) 𝑴 {{enum aℕ _}} c tid with toSymbol tid | inspect toSymbol tid ...| nothing | [ prf ] = mIdx c (idx-cast tid prf) ...| just s | _ = maybe (mSym c) enum-err (aℕ s) where postulate enum-err : I (CellCtx × RTrie) -- |Insertion of an (opened) term in a cell. Returns the altered cell. mutual insCell* : {A : Set}{{enA : Enum A}} → List (RTerm A) → List Cell → I (List Cell) insCell* [] _ = return [] insCell* _ [] = return [] insCell* (t ∷ ts) (b ∷ bs) = insCell (out t) b >>= λ b′ → (_∷_ b′) <$> insCell* ts bs -- Variation of insCell*, assuming we're always adding to empty cells. insCell*ε : {A : Set}{{enA : Enum A}} → List (RTerm A) → I (List Cell) insCell*ε [] = return [] insCell*ε (t ∷ ts) = insCell (out t) ((Leaf [] , IdxMap.empty) , []) >>= λ b → (_∷_ b) <$> insCell*ε ts {-# TERMINATING #-} insCell : {A : Set}{{enA : Enum A}} → RTermᵢ A × List (RTerm A) → Cell → I Cell insCell (tid , tr) cell = 𝑴 cell tid >>= λ { (c , bt) → insCellAux tid tr bt >>= return ∘ c } where -- Note how if tid is a binding symbol, we don't do anything. That's -- because 𝑴 already took care of adding the rules in the correct place for us. tr≡[] : {A : Set}{{enA : Enum A}} → RTermᵢ A → I RTrie tr≡[] tid with toSymbol tid ...| nothing = (Leaf ∘ singleton) <$> makeRule ...| _ = return $ Fork [] insCellAux : {A : Set}{{enA : Enum A}} → RTermᵢ A → List (RTerm A) → RTrie → I RTrie -- Inserting in a Leaf is impossible... insCellAux tid _ (Leaf r) = return (Leaf r) -- If we don't have recursive arguments in the term beeing inserted, -- we follow by tr≡[] insCellAux tid [] _ = tr≡[] tid -- Otherwise we simply add our recursive arguments. insCellAux tid tr (Fork []) = Fork <$> insCell*ε tr insCellAux tid tr (Fork ms) = Fork <$> insCell* tr ms -- |Insertion has to begin in a 1-cell fork. -- This gives some intuition that BTries should contain an arity, somewhere in their type. ins : {A : Set}{{enA : Enum A}} → RTerm A → RTrie → I RTrie ins t (Fork (cell ∷ [])) = (Fork ∘ singleton) <$> insCell (out t) cell ins t (Fork []) = (Fork ∘ singleton) <$> insCell (out t) ((Leaf [] , IdxMap.empty) , []) ins t _ = trie-err "Insertion has to begin in a 1-cell fork" -- Interfacing {-# TERMINATING #-} insertTerm : {A : Set}{{enA : Enum A}} → Name → RTerm A → (ℕ × RTrie) → (ℕ × RTrie) insertTerm d term (n , Leaf r) = trie-err "Can't insert in a leaf" insertTerm d term (n , bt) = let bt′ , n′ , lbl = STₐ.run (ins term bt) (n + 1 , nothing) in maybe′ (λ l′ → l′ , substΣ l′ d bt′) (trie-err "empty final lbl") lbl where open import Data.Maybe using (maybe′) -- Substitution boilerplate. sR : ℕ → Name → Rule → Rule sR k c (Tr m n) with n ≟-ℕ k ...| yes _ = Fr m c ...| no _ = Tr m n sR _ _ r = r mutual sC : ℕ → Name → Cell → Cell sC k c ((d , mh) , bs) = (substΣ k c d , IdxMap.map (substΣ k c) mh) , ℕmap.map (Prelude.map (sR k c)) bs substΣ : ℕ → Name → RTrie → RTrie substΣ k c (Leaf rs) = Leaf (Prelude.map (sR k c) rs) substΣ k c (Fork ms) = Fork (Prelude.map (sC k c) ms)
Cubical/HITs/Truncation/FromNegTwo.agda
marcinjangrzybowski/cubical
301
13421
{-# OPTIONS --safe #-} module Cubical.HITs.Truncation.FromNegTwo where open import Cubical.HITs.Truncation.FromNegTwo.Base public open import Cubical.HITs.Truncation.FromNegTwo.Properties public
alloy4fun_models/trashltl/models/16/8m8o2yZxSajt2Qn5L.als
Kaixi26/org.alloytools.alloy
0
660
<gh_stars>0 open main pred id8m8o2yZxSajt2Qn5L_prop17 { all f: File | always f in Trash implies after f not in File } pred __repair { id8m8o2yZxSajt2Qn5L_prop17 } check __repair { id8m8o2yZxSajt2Qn5L_prop17 <=> prop17o }
Numeral/Natural/Oper.agda
Lolirofle/stuff-in-agda
6
4005
module Numeral.Natural.Oper where open import Numeral.Natural infixl 10010 _+_ infix 10010 _−₀_ _𝄩_ infixl 10020 _⋅_ -- infix 10020 _/₀_ infixl 10030 _^_ -- TODO: It would require a great amount of work, but consider changing the induction to being on the left side instead of the right on _+_ and _⋅_. It will then mirror how lists (a similar structure) uses induction in its definition. The advantage of having it on the right side as it is now is that induction using the full operator name is easier: ℕ-induction(_+_ a) vs ℕ-induction(a ↦ _+_ a b) -- Addition _+_ : ℕ → ℕ → ℕ x + 𝟎 = x x + 𝐒(y) = 𝐒(x + y) {-# BUILTIN NATPLUS _+_ #-} -- Multiplication _⋅_ : ℕ → ℕ → ℕ _ ⋅ 𝟎 = 𝟎 x ⋅ 𝐒(y) = x + (x ⋅ y) {-# BUILTIN NATTIMES _⋅_ #-} -- Exponentiation _^_ : ℕ → ℕ → ℕ x ^ 𝟎 = 𝐒(𝟎) x ^ 𝐒(y) = x ⋅ (x ^ y) -- Factorial _! : ℕ → ℕ 𝟎 ! = 𝐒(𝟎) 𝐒(x) ! = 𝐒(x) ⋅ (x !) -- Distance (Absolute subtraction) (Interval length) _𝄩_ : ℕ → ℕ → ℕ 𝟎 𝄩 𝟎 = 𝟎 𝐒(x) 𝄩 𝟎 = 𝐒(x) 𝟎 𝄩 𝐒(x) = 𝐒(x) 𝐒(x) 𝄩 𝐒(y) = x 𝄩 y -- Closed total subtraction (monus) _−₀_ : ℕ → ℕ → ℕ x −₀ 𝟎 = x 𝟎 −₀ 𝐒(_) = 𝟎 𝐒(x) −₀ 𝐒(y) = x −₀ y {-# BUILTIN NATMINUS _−₀_ #-} -- Closed total ceiled division (rounding up) {-# TERMINATING #-} _⌈/₀⌉_ : ℕ → ℕ → ℕ 𝟎 ⌈/₀⌉ y = 𝟎 {-# CATCHALL #-} x ⌈/₀⌉ 𝟎 = 𝟎 {-# CATCHALL #-} x ⌈/₀⌉ y = 𝐒((x −₀ y) ⌈/₀⌉ y) -- Hyperoperation: (a ↑[n]↑ b) where (n=0)⇒(_ ↦ 𝐒) , (n=1)⇒(+) , (n=2)⇒(⋅) , (n=3)⇒(^) _↑[_]↑_ : ℕ → ℕ → ℕ → ℕ _ ↑[ 0 ]↑ b = 𝐒(b) a ↑[ 1 ]↑ 0 = a _ ↑[ 2 ]↑ 0 = 0 _ ↑[ 𝐒(𝐒(𝐒(n))) ]↑ 0 = 1 {-# CATCHALL #-} a ↑[ 𝐒(n) ]↑ (𝐒(b)) = a ↑[ n ]↑ (a ↑[ n ]↑ b)
test/Fail/Issue1886.agda
alhassy/agda
3
14944
<filename>test/Fail/Issue1886.agda -- Andreas, 2016-12-30, issue #1886, reported by nad -- {-# OPTIONS -v tc.data:40 -v scope.data.def:40 -v tc.decl:10 #-} data D (X : Set) : Set data D (X : Set Set) where
libsrc/z80_crt0s/z80/sccz80/l_xor.asm
jpoikela/z88dk
38
98200
<reponame>jpoikela/z88dk ; Z88 Small C+ Run time Library ; Moved functions over to proper libdefs ; To make startup code smaller and neater! ; ; 6/9/98 djm SECTION code_crt0_sccz80 PUBLIC l_xor ; "xor" HL and DE into HL .l_xor ld a,l xor e ld l,a ld a,h xor d ld h,a ret
tools-src/gnu/gcc/gcc/ada/s-mastop.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
4434
<reponame>enfoTek/tomato.linksys.e2000.nvram-mod ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- SYSTEM.MACHINE_STATE_OPERATIONS -- -- -- -- B o d y -- -- (Dummy version) -- -- -- -- $Revision$ -- -- -- Copyright (C) 1999-2001 Ada Core Technologies, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This dummy version of System.Machine_State_Operations is used -- on targets for which zero cost exception handling is not implemented. package body System.Machine_State_Operations is use System.Exceptions; ---------------------------- -- Allocate_Machine_State -- ---------------------------- function Allocate_Machine_State return Machine_State is begin return Machine_State (Null_Address); end Allocate_Machine_State; ------------------- -- Enter_Handler -- ------------------- procedure Enter_Handler (M : Machine_State; Handler : Handler_Loc) is begin null; end Enter_Handler; ---------------- -- Fetch_Code -- ---------------- function Fetch_Code (Loc : Code_Loc) return Code_Loc is begin return Loc; end Fetch_Code; ------------------------ -- Free_Machine_State -- ------------------------ procedure Free_Machine_State (M : in out Machine_State) is begin M := Machine_State (Null_Address); end Free_Machine_State; ------------------ -- Get_Code_Loc -- ------------------ function Get_Code_Loc (M : Machine_State) return Code_Loc is begin return Null_Address; end Get_Code_Loc; -------------------------- -- Machine_State_Length -- -------------------------- function Machine_State_Length return System.Storage_Elements.Storage_Offset is begin return 0; end Machine_State_Length; --------------- -- Pop_Frame -- --------------- procedure Pop_Frame (M : Machine_State; Info : Subprogram_Info_Type) is begin null; end Pop_Frame; ----------------------- -- Set_Machine_State -- ----------------------- procedure Set_Machine_State (M : Machine_State) is begin null; end Set_Machine_State; ------------------------------ -- Set_Signal_Machine_State -- ------------------------------ procedure Set_Signal_Machine_State (M : Machine_State; Context : System.Address) is begin null; end Set_Signal_Machine_State; end System.Machine_State_Operations;
programs/oeis/141/A141104.asm
neoneye/loda
22
7799
<filename>programs/oeis/141/A141104.asm ; A141104: Lower Even Swappage of Upper Wythoff Sequence. ; 2,4,6,10,12,14,18,20,22,26,28,30,34,36,38,40,44,46,48,52,54,56,60,62,64,68,70,72,74,78,80,82,86,88,90,94,96,98,102,104,106,108,112,114,116,120,122,124,128,130,132,136,138,140,142,146,148,150,154,156,158,162 add $0,1 mul $0,34 div $0,26 mul $0,2
samples/if.asm
wilsonpilon/msx-menu
0
178233
; if.asm proc local v v equ 0 if v ld a, 0 else ld a, 1 endif endp nop ; if.asm finished
src/Polynomial/Simple/AlmostCommutativeRing.agda
mckeankylej/agda-ring-solver
36
1036
<filename>src/Polynomial/Simple/AlmostCommutativeRing.agda {-# OPTIONS --without-K --safe #-} module Polynomial.Simple.AlmostCommutativeRing where import Algebra.Solver.Ring.AlmostCommutativeRing as Complex open import Level open import Relation.Binary open import Algebra open import Algebra.Structures open import Algebra.FunctionProperties import Algebra.Morphism as Morphism open import Function open import Level open import Data.Maybe as Maybe using (Maybe; just; nothing) record IsAlmostCommutativeRing {a ℓ} {A : Set a} (_≈_ : Rel A ℓ) (_+_ _*_ : A → A → A) (-_ : A → A) (0# 1# : A) : Set (a ⊔ ℓ) where field isCommutativeSemiring : IsCommutativeSemiring _≈_ _+_ _*_ 0# 1# -‿cong : -_ Preserves _≈_ ⟶ _≈_ -‿*-distribˡ : ∀ x y → ((- x) * y) ≈ (- (x * y)) -‿+-comm : ∀ x y → ((- x) + (- y)) ≈ (- (x + y)) open IsCommutativeSemiring isCommutativeSemiring public import Polynomial.Exponentiation as Exp record AlmostCommutativeRing c ℓ : Set (suc (c ⊔ ℓ)) where infix 8 -_ infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ infixr 8 _^_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier -_ : Op₁ Carrier 0# : Carrier 0≟_ : (x : Carrier) → Maybe (0# ≈ x) 1# : Carrier isAlmostCommutativeRing : IsAlmostCommutativeRing _≈_ _+_ _*_ -_ 0# 1# open IsAlmostCommutativeRing isAlmostCommutativeRing hiding (refl) public open import Data.Nat as ℕ using (ℕ) commutativeSemiring : CommutativeSemiring _ _ commutativeSemiring = record { isCommutativeSemiring = isCommutativeSemiring } open CommutativeSemiring commutativeSemiring public using ( +-semigroup; +-monoid; +-commutativeMonoid ; *-semigroup; *-monoid; *-commutativeMonoid ; semiring ) rawRing : RawRing _ _ rawRing = record { Carrier = Carrier ; _≈_ = _≈_ ; _+_ = _+_ ; _*_ = _*_ ; -_ = -_ ; 0# = 0# ; 1# = 1# } _^_ : Carrier → ℕ → Carrier _^_ = Exp._^_ rawRing {-# NOINLINE _^_ #-} refl : ∀ {x} → x ≈ x refl = IsAlmostCommutativeRing.refl isAlmostCommutativeRing flipped : ∀ {c ℓ} → AlmostCommutativeRing c ℓ → AlmostCommutativeRing c ℓ flipped rng = record { Carrier = Carrier ; _≈_ = _≈_ ; _+_ = flip _+_ ; _*_ = flip _*_ ; -_ = -_ ; 0# = 0# ; 0≟_ = 0≟_ ; 1# = 1# ; isAlmostCommutativeRing = record { -‿cong = -‿cong ; -‿*-distribˡ = λ x y → *-comm y (- x) ⟨ trans ⟩ (-‿*-distribˡ x y ⟨ trans ⟩ -‿cong (*-comm x y)) ; -‿+-comm = λ x y → -‿+-comm y x ; isCommutativeSemiring = record { +-isCommutativeMonoid = record { isSemigroup = record { isMagma = record { isEquivalence = isEquivalence ; ∙-cong = flip (+-cong ) } ; assoc = λ x y z → sym (+-assoc z y x) } ; identityˡ = +-identityʳ ; comm = λ x y → +-comm y x } ; *-isCommutativeMonoid = record { isSemigroup = record { isMagma = record { isEquivalence = isEquivalence ; ∙-cong = flip (*-cong ) } ; assoc = λ x y z → sym (*-assoc z y x) } ; identityˡ = *-identityʳ ; comm = λ x y → *-comm y x } ; distribʳ = λ x y z → distribˡ _ _ _ ; zeroˡ = zeroʳ } } } where open AlmostCommutativeRing rng record _-Raw-AlmostCommutative⟶_ {c r₁ r₂ r₃} (From : RawRing c r₁) (To : AlmostCommutativeRing r₂ r₃) : Set (c ⊔ r₁ ⊔ r₂ ⊔ r₃) where private module F = RawRing From module T = AlmostCommutativeRing To open Morphism.Definitions F.Carrier T.Carrier T._≈_ field ⟦_⟧ : Morphism +-homo : Homomorphic₂ ⟦_⟧ F._+_ T._+_ *-homo : Homomorphic₂ ⟦_⟧ F._*_ T._*_ -‿homo : Homomorphic₁ ⟦_⟧ F.-_ T.-_ 0-homo : Homomorphic₀ ⟦_⟧ F.0# T.0# 1-homo : Homomorphic₀ ⟦_⟧ F.1# T.1# -raw-almostCommutative⟶ : ∀ {r₁ r₂} (R : AlmostCommutativeRing r₁ r₂) → AlmostCommutativeRing.rawRing R -Raw-AlmostCommutative⟶ R -raw-almostCommutative⟶ R = record { ⟦_⟧ = id ; +-homo = λ _ _ → refl ; *-homo = λ _ _ → refl ; -‿homo = λ _ → refl ; 0-homo = refl ; 1-homo = refl } where open AlmostCommutativeRing R -- A homomorphism induces a notion of equivalence on the raw ring. Induced-equivalence : ∀ {c₁ c₂ ℓ₁ ℓ₂} {Coeff : RawRing c₁ ℓ₁} {R : AlmostCommutativeRing c₂ ℓ₂} → Coeff -Raw-AlmostCommutative⟶ R → Rel (RawRing.Carrier Coeff) ℓ₂ Induced-equivalence {R = R} morphism a b = ⟦ a ⟧ ≈ ⟦ b ⟧ where open AlmostCommutativeRing R open _-Raw-AlmostCommutative⟶_ morphism ------------------------------------------------------------------------ -- Conversions -- Commutative rings are almost commutative rings. fromCommutativeRing : ∀ {r₁ r₂} → (CR : CommutativeRing r₁ r₂) → (∀ x → Maybe ((CommutativeRing._≈_ CR) (CommutativeRing.0# CR) x)) → AlmostCommutativeRing _ _ fromCommutativeRing CR 0≟_ = record { isAlmostCommutativeRing = record { isCommutativeSemiring = isCommutativeSemiring ; -‿cong = -‿cong ; -‿*-distribˡ = -‿*-distribˡ ; -‿+-comm = ⁻¹-∙-comm } ; 0≟_ = 0≟_ } where open CommutativeRing CR import Algebra.Properties.Ring as R; open R ring import Algebra.Properties.AbelianGroup as AG; open AG +-abelianGroup fromCommutativeSemiring : ∀ {r₁ r₂} → (CS : CommutativeSemiring r₁ r₂) → (∀ x → Maybe ((CommutativeSemiring._≈_ CS) (CommutativeSemiring.0# CS) x)) → AlmostCommutativeRing _ _ fromCommutativeSemiring CS 0≟_ = record { -_ = id ; isAlmostCommutativeRing = record { isCommutativeSemiring = isCommutativeSemiring ; -‿cong = id ; -‿*-distribˡ = λ _ _ → refl ; -‿+-comm = λ _ _ → refl } ; 0≟_ = 0≟_ } where open CommutativeSemiring CS
orka/src/orka/implementation/orka-logging.adb
onox/orka
52
2893
<gh_stars>10-100 -- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2018 onox <<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.Finalization; with GL.Debug; with Orka.Loggers.Terminal; with Orka.OS; with Orka.Terminals; package body Orka.Logging is function Image (Value : Duration) return String renames Terminals.Image; function Trim (Value : String) return String renames Terminals.Trim; function Image (Value : Orka.Transforms.Singles.Vectors.Vector4) return String is begin return "(" & Trim (Value (X)'Image) & ", " & Trim (Value (Y)'Image) & ", " & Trim (Value (Z)'Image) & ", " & Trim (Value (W)'Image) & ")"; end Image; function Image (Value : Orka.Transforms.Doubles.Vectors.Vector4) return String is begin return "(" & Trim (Value (X)'Image) & ", " & Trim (Value (Y)'Image) & ", " & Trim (Value (Z)'Image) & ", " & Trim (Value (W)'Image) & ")"; end Image; ----------------------------------------------------------------------------- type Clock_Initializer is new Ada.Finalization.Limited_Controlled with null record; overriding procedure Initialize (Object : in out Clock_Initializer) is begin Orka.Terminals.Set_Time_Zero (Orka.OS.Monotonic_Clock); end Initialize; Initialize_Clock : Clock_Initializer; ----------------------------------------------------------------------------- Current_Logger : Loggers.Logger_Ptr := Orka.Loggers.Terminal.Logger'Access; procedure Set_Logger (Logger : Loggers.Logger_Ptr) is begin Current_Logger := Logger; end Set_Logger; procedure Log (From : Source; Kind : Message_Type; Level : Severity; Message : String) is begin Current_Logger.Log (From, Kind, Level, Message); end Log; package body Messages is Kind : constant Message_Type := Message_Type (GL.Debug.Message_Type'(GL.Debug.Other)); -- TODO Make generic parameter procedure Log (Level : Severity; Message : String) is begin Orka.Logging.Log (From, Kind, Level, Message); end Log; end Messages; end Orka.Logging;
libsrc/games/spectrum/bit_open_di.asm
meesokim/z88dk
0
163111
; $Id: bit_open_di.asm,v 1.6 2015/01/19 01:32:45 pauloscustodio Exp $ ; ; ZX Spectrum 1 bit sound functions ; ; Open sound and disable interrupts for exact timing ; ; <NAME> - 28/9/2001 ; PUBLIC bit_open_di EXTERN snd_tick EXTERN bit_irqstatus INCLUDE "games/games.inc" .bit_open_di ld a,i ; get the current status of the irq line di push af ex (sp),hl ld (bit_irqstatus),hl pop hl ld a,(23624) rra rra rra and 7 or 8 push de ld e,a ld a,(snd_tick) and sndbit_mask or e pop de ld (snd_tick),a ret
src/rejuvenation-node_locations.ads
TNO/Rejuvenation-Ada
1
27174
<gh_stars>1-10 package Rejuvenation.Node_Locations is type Node_Location is (No_Trivia, Trivia_On_Same_Line, All_Trivia); -- Between two adjacent nodes in the AST, trivia -- (i.e. white space and comment) can occur. -- This raises the question: Where does a Node start / end? -- No_Trivia : Trivia before / after the node is -- not considered part of that node -- Trivia_On_Same_Line : Trivia before / after the node -- on the same line is considered part -- of that node -- All_Trivia : Trivia before / after the node is -- considered part of that node -- TODO: Investigate (suggestion of Arjan) is there a need -- for the following? -- Trivia_Until_Empty_Line: Trivia before / after the node -- until an empty line is considered -- part of that node -- TODO: Investigate is there a need for the following? -- All_Trivia_When_Keyword : when each node has all trivia -- before and after him, -- we will duplicate trivia. -- E.g. "Node1; -- comment Node2;" -- when we limit trivia to one direction (before / after node), -- we still miss trivia (before/after) keywords e.g. -- (if -- missed_after Condition -- missed_before then ...) function Start_Offset (Node : Ada_Node'Class; Before : Node_Location := No_Trivia) return Positive; function End_Offset (Node : Ada_Node'Class; After : Node_Location := No_Trivia) return Natural; end Rejuvenation.Node_Locations;
programs/oeis/028/A028835.asm
jmorken/loda
1
171484
; A028835: Numbers n such that iterated sum of digits of n is a prime. ; 2,3,5,7,11,12,14,16,20,21,23,25,29,30,32,34,38,39,41,43,47,48,50,52,56,57,59,61,65,66,68,70,74,75,77,79,83,84,86,88,92,93,95,97,101,102,104,106,110,111,113,115,119,120,122,124,128,129,131,133,137,138,140,142,146,147,149,151,155,156,158,160,164,165,167,169,173,174,176,178,182,183,185,187,191,192,194,196,200,201,203,205,209,210,212,214,218,219,221,223,227,228,230,232,236,237,239,241,245,246,248,250,254,255,257,259,263,264,266,268,272,273,275,277,281,282,284,286,290,291,293,295,299,300,302,304,308,309,311,313,317,318,320,322,326,327,329,331,335,336,338,340,344,345,347,349,353,354,356,358,362,363,365,367,371,372,374,376,380,381,383,385,389,390,392,394,398,399,401,403,407,408,410,412,416,417,419,421,425,426,428,430,434,435,437,439,443,444,446,448,452,453,455,457,461,462,464,466,470,471,473,475,479,480,482,484,488,489,491,493,497,498,500,502,506,507,509,511,515,516,518,520,524,525,527,529,533,534,536,538,542,543,545,547,551,552,554,556,560,561 add $0,1 mov $2,$0 lpb $2 mov $1,1 mov $3,$2 trn $5,$0 lpb $4 trn $4,$3 add $5,4 lpe add $0,$5 add $0,$1 sub $2,3 trn $2,1 trn $3,2 mov $4,$1 lpe mov $1,$0 add $1,$3
_tests/trunfold/Expression.g4
kaby76/Domemtech.Trash
16
5113
grammar Expresion; s : e ; e : e '*' e # Mult | INT # primary ; INT : [0-9]+ ; WS : [ \t\n]+ -> skip ;
programs/oeis/232/A232980.asm
karttu/loda
0
94444
<filename>programs/oeis/232/A232980.asm<gh_stars>0 ; A232980: The Gauss factorial n_3!. ; 1,1,2,2,8,40,40,280,2240,2240,22400,246400,246400,3203200,44844800,44844800,717516800,12197785600,12197785600,231757926400,4635158528000,4635158528000,101973487616000,2345390215168000,2345390215168000,58634755379200000 mov $1,1 lpb $0,1 mov $2,$0 lpb $0,1 mod $0,3 sub $0,1 lpe add $0,$2 mul $1,$0 sub $0,1 lpe
programs/oeis/004/A004343.asm
neoneye/loda
22
246803
<reponame>neoneye/loda<filename>programs/oeis/004/A004343.asm<gh_stars>10-100 ; A004343: Binomial coefficient C(5n,n-1). ; 1,10,105,1140,12650,142506,1623160,18643560,215553195,2505433700,29248649430,342700125300,4027810484880,47465835030320,560658857389200,6635869816740560,78682166288559225,934433788613079150 mov $1,5 mul $1,$0 add $1,5 bin $1,$0 mov $0,$1
projects/batfish/src/main/antlr4/org/batfish/grammar/palo_alto/PaloAlto_readonly.g4
zabrewer/batfish
763
3183
parser grammar PaloAlto_readonly; import PaloAlto_common, PaloAlto_device_group; s_readonly : DEVICES name = variable sro_statement ; sro_statement : sro_device_group // null rule must come last | null_rest_of_line ; sro_device_group : DEVICE_GROUP name = variable ( sdg_parent_dg // null rule must come last | null_rest_of_line ) ;
src/static/antlr4/grammars/CommonLexerRules.g4
jlenoble/casem
0
827
lexer grammar CommonLexerRules; ID : [a-zA-Z][a-zA-Z0-9]* ; UINT : ('0'|[1-9][0-9]*) ; STRING : '"' .*? '"' ; WS : [ \t] ; NEWLINE : '\r'? '\n' ;
Games/banchorce/source/area.asm
CiaranGruber/Ti-84-Calculator
1
163212
;---------------------------------------------------------------; ; ; ; Banchor ; ; Area Name Routines ; ; ; ;---------------------------------------------------------------; ;------------------------------------------------ ; drawAreaName - draw the area name ; input: A = __drawAreaName value (will always be NZ) ; output: none ;------------------------------------------------ drawAreaName: ld b,a ld a,(areaNum) or a jr z,noAreaName ld a,b call clearHud noAreaClear: ; update __drawAreaName dec a ld (__drawAreaName),a jr nz,noHudRedraw REDRAW_HUD() ; redraw HUD after showing the area name noHudRedraw: ld hl,(areaNum) dec l ld h,3 mlt hl ld de,areaNames add hl,de ld de,(hl) ex de,hl call calcStringWidth push hl ; save string pointer ld hl,9*8 add hl,bc ex de,hl ld hl,320 or a sbc hl,de srl h rr l ; HL = x position to use for centred area name (including the "ENTERING ") ex de,hl push de ld c,240-11 ld hl,strEntering ld a,COLOUR_REDORANGE call drawStringColour pop de ld hl,9*8 add hl,de ex de,hl pop hl ld c,240-11 ld a,COLOUR_REDORANGE jp drawStringColour noAreaName: ld (__drawAreaName),a ; A is always 0 here REDRAW_HUD() ret .end
cmd/command/tenv2.asm
minblock/msdos
0
3479
<reponame>minblock/msdos page ,132 ; SCCSID = @(#)tenv2.asm 1.1 85/05/14 ; SCCSID = @(#)tenv2.asm 1.1 85/05/14 TITLE Part6 COMMAND Transient routines. ;/* ; * Microsoft Confidential ; * Copyright (C) Microsoft Corporation 1991 ; * All Rights Reserved. ; */ ; Environment utilities and misc. routines .xlist .xcref include comsw.asm include dossym.inc include syscall.inc include find.inc include comseg.asm include comequ.asm .list .cref DATARES SEGMENT PUBLIC BYTE ;AC000; EXTRN pipeflag:byte DATARES ENDS TRANDATA SEGMENT PUBLIC BYTE ;AC000; EXTRN ACRLF_PTR:WORD EXTRN BadCD_Ptr:WORD EXTRN Badmkd_ptr:word EXTRN BADRMD_PTR:WORD EXTRN Extend_buf_ptr:word ;AN000; EXTRN Extend_buf_sub:byte ;AN022; EXTRN MD_exists_ptr:word ;AN006; EXTRN msg_disp_class:byte ;AC000; EXTRN NOSPACE_PTR:WORD EXTRN parse_chdir:byte ;AC000; EXTRN parse_mrdir:byte ;AC000; EXTRN PIPEEMES_PTR:WORD EXTRN string_buf_ptr:word TRANDATA ENDS TRANSPACE SEGMENT PUBLIC BYTE ;AC000; EXTRN CURDRV:BYTE EXTRN DESTINFO:BYTE EXTRN DESTTAIL:WORD EXTRN DIRCHAR:BYTE EXTRN dirflag:byte ;AN015; EXTRN KPARSE:BYTE ;AC000; 3/3/KK EXTRN msg_numb:word ;AN022; EXTRN parse1_addr:dword ;AC000; EXTRN parse1_type:byte ;AC000; EXTRN PATHPOS:WORD EXTRN RESSEG:WORD EXTRN srcxname:byte ;AC000; EXTRN string_ptr_2:word EXTRN SWITCHAR:BYTE EXTRN USERDIR1:BYTE TRANSPACE ENDS TRANCODE SEGMENT PUBLIC byte ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING EXTRN cerror:near PUBLIC $chdir PUBLIC $mkdir PUBLIC $rmdir PUBLIC crlf2 PUBLIC crprint PUBLIC delim PUBLIC error_output PUBLIC fcb_to_ascz PUBLIC pathchrcmp PUBLIC pathcrunch PUBLIC savudir PUBLIC savudir1 PUBLIC scanoff PUBLIC strcomp break $Chdir ; **************************************************************** ; * ; * ROUTINE: $CHDIR ; * ; * FUNCTION: Entry point for CHDIR command. Parse the command ; * line. If path is found, CHDIR to path. If a drive ; * letter is found, get and display the current dir ; * of the specified drive. If nothing is found, get ; * and display the current dir of the default drive. ; * ; * INPUT: command line at offset 81H ; * ; * OUTPUT: none ; * ; **************************************************************** assume ds:trangroup,es:trangroup $CHDIR: mov si,81H mov di,offset trangroup:parse_chdir ;AN000; Get adderss of PARSE_CHDIR xor cx,cx ;AN000; clear cx,dx xor dx,dx ;AN000; invoke parse_with_msg ;AC018; call parser cmp ax,end_of_line ;AC000; are we at end of line? jz bwdJ ; No args cmp ax,result_no_error ;AC000; did we have an error? jnz ChDirErr ;AC018; yes - exit cmp parse1_type,result_drive ;AC000; was a drive entered? jnz REALCD ; no ; ; D: was found. See if there is anything more. ; mov di,offset trangroup:parse_chdir ;AC000; get address of parse_chdir xor dx,dx ;AC000; invoke parse_check_eol ;AC000; call parser jnz ChDirErr ;AC000; bwdJ: invoke build_dir_for_chdir ; Drive only specified call crlf2 return REALCD: push si ;AN000; save position in line lds si,parse1_addr ;AN000; get address of filespec invoke move_to_srcbuf ;AN000; move to srcbuf pop si ;AN000; restore position in line mov di,offset trangroup:parse_chdir ;AC000; get address of parse_chdir xor dx,dx ;AC000; invoke parse_check_eol ;AC000; call parser jnz ChDirErr ;AC000; invoke SETPATH TEST [DESTINFO],2 JNZ BadChdir MOV AH,CHDIR INT 21h retnc invoke get_ext_error_number ;AN022; get the extended error cmp ax,error_path_not_found ;AN022; see if path not found jz BadChDir ;AN022; yes - issue old message ;SR; ; We want to issue "Invalid Directory" message even if the path is valid ;but is not a directory. The extended error returns "Access denied" which ;is kind of confusing. Issue the old message if access denied error is ;returned ; cmp ax,error_access_denied jz BadChDir call Set_Ext_Error_Subst ;AN022; jmp short chdirerr ;AN022; BadChDir: MOV DX,OFFSET TRANGROUP:BADCD_ptr ChDirErr: invoke Std_Eprintf return break $Mkdir assume ds:trangroup,es:trangroup $MKDIR: CALL SETRMMK JC MkDirErr MOV AH,MKDIR INT 21h retnc invoke get_ext_error_number ;AN022; get the extended error cmp ax,error_path_not_found ;AN022; see if path not found jz MD_other_err ;AN022; yes - issue old message cmp ax,error_access_denied ;AN022; access denied? jz badmderr ;AN022; yes - see if file exists call Set_Ext_Error_Subst ;AN022; jmp short MkDirerr ;AC022; yes - go print it BADMDERR: mov dx,offset trangroup:srcxname ;AN006; Set Disk transfer address mov ah,Set_DMA ;AN006; int 21h ;AN006; MOV AH,Find_First ;AN006; see if file/dir exists mov cx,attr_directory ;AN006; search for directory INT 21h ;AN006; jc MD_other_err ;AN006; doesn't exist - must be something else mov dl,srcxname.find_buf_attr ;AN006; we found a file/dir test dl,attr_directory ;AN006; was it a directory? jz MD_other_err ;AN006; no - must have been a file mov dx,offset trangroup:MD_exists_ptr ;AN006; set up already exists error jmp short MkDirErr ;AN006; make sure we didn't have network error MD_other_err: ;AN006; MOV DX,OFFSET TRANGROUP:BADMKD_ptr MkDirErr: invoke Std_Eprintf return Break <Common MkDir/RmDir set up code> ;**************************************************************** ;* ;* ROUTINE: SETRMMK ;* ;* FUNCTION: Parse routine for the internal MKDIR and RMDIR ;* commands. Parses the command line for a required ;* filespec. ;* ;* INPUT: command line at offset 81H ;* ;* OUTPUT: carry clear ;* DS:DX points to ASCIIZ argument ;* carry set ;* DS:DX has error message pointer ;* ;**************************************************************** SETRMMK: mov si,81H mov di,offset trangroup:parse_mrdir ;AN000; Get adderss of PARSE_MRDIR xor cx,cx ;AN000; clear cx,dx xor dx,dx ;AN000; invoke parse_with_msg ;AC000; call parser cmp ax,result_no_error ;AC000; did we have an error? jnz NOARGERR ;AC000; yes - exit mov di,offset trangroup:srcxname ;AN000; get address of srcxname push di ;AN000; save address push si ;AN000; save position in line lds si,parse1_addr ;AN000; get address of path mrdir_move_filename: ;AN000; put filespec in srcxname lodsb ;get a char from buffer stosb ;AN000; store in srcxname cmp al,end_of_line_out ;AC000; it char a terminator? jnz mrdir_move_filename ;AC000; no - keep moving pop si ;AN000; get line position back ; ; we have scanned an argument. See if any args beyond. ; mov di,offset trangroup:parse_mrdir ;AC000; get address of parse_mrdir invoke parse_check_eol ;AC000; are we at end of line? pop dx ;AC000; get address of SRCXNAME retz ;yes - return no error NOARGERR: mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer XOR AX,AX STC return break $Rmdir assume ds:trangroup,es:trangroup $RMDIR: CALL SETRMMK JC RmDirErr JNZ BADRDERR MOV AH,RMDIR INT 21h retnc invoke get_ext_error_number ;AN022; get the extended error cmp ax,error_path_not_found ;AN022; see if path not found jz badrderr ;AN022; yes - issue old message cmp ax,error_access_denied ;AN022; access denied? jz badrderr ;AN022; yes - issue old message call Set_Ext_Error_Subst ;AN022; jmp short RmDirerr ;AC022; yes - go print it BADRDERR: MOV DX,OFFSET TRANGROUP:BADRMD_ptr RmDirErr: invoke STD_Eprintf return ;**************************************************************** ;* ;* ROUTINE: Set_ext_error_subst ;* ;* FUNCTION: Sets up substitution for extended error ;* ;* INPUT: AX - extended error number ;* DX - offset of string ;* ;* OUTPUT: Extend_Buf_Ptr set up for STD_EPRINTF ;* ;**************************************************************** Set_ext_error_subst proc near ;AN022; mov msg_disp_class,ext_msg_class ;AN022; set up extended error msg class mov string_ptr_2,dx ;AN022; get address of failed string mov Extend_buf_sub,one_subst ;AN022; put number of subst in control block mov dx,offset TranGroup:Extend_Buf_ptr ;AN022; get extended message pointer mov Extend_Buf_ptr,ax ;AN022; get message number in control block ret ;AN022; return Set_ext_error_subst endp ;AN022; Break <SavUDir - preserve the users current directory on a particular drive> ; ; SavUDir - move the user's current directory on a drive into UserDir1 ; SavUDir1 - move the user's current directory on a drive into a specified ; buffer ; ; Inputs: DL has 1-based drive number ; ES:DI has destination buffer (SavUDir1 only) ; Outputs: Carry Clear ; DS = TranGroup ; Carry Set ; AX has error code ; Registers Modified: AX, SI ; SAVUDIR: MOV DI,OFFSET TRANGROUP:USERDIR1 SAVUDIR1: MOV AL,DL ADD AL,'@' CMP AL,'@' JNZ GOTUDRV ADD AL,[CURDRV] INC AL ; A = 1 GOTUDRV: STOSB MOV AH,[DIRCHAR] MOV AL,':' STOSW PUSH ES POP DS ASSUME DS:NOTHING MOV SI,DI MOV AH,CURRENT_DIR ; Get the Directory Text INT 21h retc PUSH CS POP DS ASSUME DS:TRANGROUP return CRLF2: PUSH DX MOV DX,OFFSET TRANGROUP:ACRLF_ptr PR: PUSH DS PUSH CS POP DS invoke std_printf POP DS POP DX return ; ; These routines (SCANOFF, DELIM) are called in batch processing when DS ; may NOT be TRANGROUP ; ASSUME DS:NOTHING,ES:NOTHING SCANOFF: LODSB CALL DELIM JZ SCANOFF DEC SI ; Point to first non-delimiter return ; ; Input: AL is character to classify ; Output: Z set if delimiter ; NZ set otherwise ; Registers modified: none ; DELIM: CMP AL,' ' retz CMP AL,'=' retz CMP AL,',' retz CMP AL,';' retz CMP AL,9 ; Check for TAB character retz CMP AL,0ah ; Check for line feed character - BAS return ASSUME DS:TRANGROUP,ES:TRANGROUP FCB_TO_ASCZ: ; Convert DS:SI to ASCIZ ES:DI MOV CX,8 MAINNAME: LODSB CMP AL,' ' JZ SKIPSPC STOSB SKIPSPC: LOOP MAINNAME LODSB CMP AL,' ' JZ GOTNAME MOV AH,AL MOV AL,dot_chr STOSB XCHG AL,AH STOSB MOV CL,2 EXTNAME: LODSB CMP AL,' ' JZ GOTNAME STOSB LOOP EXTNAME GOTNAME: XOR AL,AL STOSB return STRCOMP: ; ; Compare ASCIZ DS:SI with ES:DI. ; SI,DI destroyed. ; CMPSB retnz ; Strings not equal cmp byte ptr [SI-1],0 ; Hit NUL terminator? retz ; Yes, strings equal jmp short STRCOMP ; Equal so far, keep going CRPRINT: PUSH AX MOV AL,13 PUSH CX PUSH DI MOV DI,DX MOV CX,-1 PUSH ES PUSH DS POP ES REPNZ SCASB ; LOOK FOR TERMINATOR mov byte ptr [di-1],0 ; nul terminate the string POP ES mov string_ptr_2,dx mov dx,offset trangroup:string_buf_ptr invoke std_printf mov ds:byte ptr [di-1],13 ; now put the CR back JC ERROR_OUTPUT POP DI POP CX POP AX return ERROR_OUTPUT: PUSH CS POP DS ASSUME DS:TRANGROUP MOV ES,[RESSEG] ASSUME ES:RESGROUP MOV DX,OFFSET TRANGROUP:NOSPACE_ptr CMP [PIPEFLAG],0 JZ GO_TO_ERROR invoke PipeOff MOV DX,OFFSET TRANGROUP:PIPEEMES_ptr GO_TO_ERROR: JMP CERROR ASSUME DS:TRANGROUP,ES:TRANGROUP PATHCHRCMP: ;---- Mod for path invocation ---- PUBLIC pathchrcmp ;---- push ax mov ah,'/' CMP [SWITCHAR],ah JZ NOSLASHT CMP AL,'/' jz pccont NOSLASHT: CMP AL,'\' pccont: pop ax return ; ; PATHCRUNCH - ; ; ENTRY FCB (in PSP) contains drive # to crunch on ; PathPos = ptr to string with pathname in it ; PathCnt = length of string ; ; EXIT PathPos = ptr after pathname (w/ NULL) in string ; PathCnt = length left in string ; DestIsDir = nonzero if pathname delimiter char's found in pathname ; DestInfo<bit1> = set if wildcard char's found in pathname ; If path crunched successfully, ; CY = clear ; Current directory is changed to directory in pathname ; UserDir1 contains previous directory for use by RestUDir ; RestDir = nonzero to flag later restoration of user's dir ; DestTail = ptr to beginning of filename ; If filename found in pathname, ; ZR = clear ; FCB filename fields contain filename ; If filename not found (pure directory path), ; ZR = set ; FCB filename fields are wildcarded with ?'s ; If pathcrunch failed (no ChDir's worked), ; CY = set ; Msg_Numb = extended error code ; ; NOTE DIR asks PathCrunch to forego parsing the filename into the ; FCB by setting DirFlag. In this case, the FCB is returned ; with the filename wildcarded. ; PATHCRUNCH: mov [msg_numb],0 ;AN022; Set up message flag MOV DL,DS:[FCB] ; DL = drive # (1 = A) CALL SAVUDIR ; save current directory in UserDir1 jc pcrunch_cderrJ ;AN022; if error on current dir - report invoke SETPATH ; scan past switches, whitespace ; DX = ptr to pathname, NULL-terminated ; PathPos = ptr to byte after NULL at end of pathname TEST [DESTINFO],2 ; test if wildcards (? or *) seen JNZ TRYPEEL ; wildcard seen, peel filename MOV AH,CHDIR ; AH = DOS ChDir function code INT 21h ; call DOS jnc chdir_worked ;AN022; no error - continue invoke get_ext_error_number ;AN022; get the extended error cmp ax,error_path_not_found ;AN022; if path not found jz trypeel ;AC022; keep trying cmp ax,error_access_denied ;AN022; if access denied jz trypeel ;AC022; keep trying mov [msg_numb],ax ;AN022; set up message flag jmp peelfail ;AN022; exit with other error chdir_worked: invoke SETREST1 ; set 'Restore Directory' flag true MOV AL,'?' ; if pure dir, wildcard filename in FCB MOV DI,5DH MOV CX,11 REP STOSB XOR AL,AL ; return carry clear, zero set return pcrunch_cderrj: ;AN022; need this for long jmp jmp pcrunch_cderr ;AN022; TRYPEEL: MOV SI,[PATHPOS] DEC SI ; SI = ptr to NULL at end of pathname MOV AL,[SI-1] ; AL = last char of pathname CMP [KPARSE],0 JNZ DELSTRT ; Last char is second KANJI byte, might be '\' CALL PATHCHRCMP JZ PEELFAIL ; Trailing '/' DELSTRT: MOV CX,SI ; CX = ptr to NULL at end of pathname MOV SI,DX ; SI = ptr to start of pathname PUSH DX ; save ptr to pathname DELLOOP: CMP SI,CX JZ GOTDELE ; no char's left, we have what we have LODSB ; AL = next char of pathname invoke TESTKANJ JZ NOTKANJ8 ; not Kanji, move along INC SI JMP DELLOOP NOTKANJ8: CALL PATHCHRCMP JNZ DELLOOP ; not a path delimiter, keep looking MOV DX,SI DEC DX ; DX = ptr to last delimiter found JMP DELLOOP ; go look for more GOTDELE: MOV SI,DX ; SI = ptr to pathname or last delim POP DX ; DX = ptr to pathname CMP SI,DX JZ BADRET ; didn't find path delim MOV CX,SI ; CX = ptr to last path delimiter MOV SI,DX ; SI = ptr to pathname DELLOOP2: ; Set value of KPARSE CMP SI,CX JZ TRYCD ; roll up till SI meets CX MOV [KPARSE],0 LODSB INVOKE TESTKANJ JZ DELLOOP2 INC SI INC [KPARSE] JMP DELLOOP2 TRYCD: push ax mov al,dot_chr ; AL = '.' CMP BYTE PTR [SI+1],al ; check for '.' after path delim ;M019; allow continuation if '. ' or ;M019; '..' is not found. jnz @F ;M019; '.' not found cmp BYTE PTR [SI+2],al ;M019; check for '..' jz @F ;M019; found '..' cmp BYTE PTR [SI+2],0 ;M019; check for '. ' (null terminated) @@: pop ax JZ PEELFAIL ; if . or .., pure cd should have worked mov al,[si-1] CMP al,':' ; Special case d:\file JZ BADRET CMP [KPARSE],0 JNZ NOTDOUBLESL ; Last char is second KANJI byte, might be '\' CALL PATHCHRCMP JNZ NOTDOUBLESL PEELFAIL: STC ; // return NOTDOUBLESL: MOV BYTE PTR [SI],0 MOV AH,CHDIR INT 21h JNC CDSUCC pcrunch_cderr: invoke get_ext_error_number ;AN022; get the extended error mov [msg_numb],ax ;AN022; set up message flag or si,si ;AN022; set up zero flag to not zero stc ;AN022; set up carry flag return BADRET: MOV AL,[SI] CALL PATHCHRCMP ; Special case 'DIRCHAR'file STC retnz XOR BL,BL XCHG BL,[SI+1] MOV AH,CHDIR INT 21h jc pcrunch_cderr ;AN022; go to error exit MOV [SI+1],BL CDSUCC: invoke SETREST1 INC SI ; Reset zero MOV [DESTTAIL],SI pushf ;AN015; save flags cmp dirflag,-1 ;AN015; don't do parse if in DIR jz pcrunch_end ;AN015; MOV DI,FCB MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR 02H ; Parse with default drive INT 21h pcrunch_end: popf ;AN015; get flags back return trancode ends end 
Working Disassembly/General/Sprites/Level Misc/Map - Scaled Art.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
5
178137
<gh_stars>1-10 Map_24BE8: dc.w word_24C28-Map_24BE8 dc.w word_24C8A-Map_24BE8 dc.w word_24CEC-Map_24BE8 dc.w word_24CEC-Map_24BE8 dc.w word_24D24-Map_24BE8 dc.w word_24D24-Map_24BE8 dc.w word_24D24-Map_24BE8 dc.w word_24D3E-Map_24BE8 dc.w word_24D3E-Map_24BE8 dc.w word_24D3E-Map_24BE8 dc.w word_24D3E-Map_24BE8 dc.w word_24D3E-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D58-Map_24BE8 dc.w word_24D60-Map_24BE8 dc.w word_24D60-Map_24BE8 dc.w word_24D60-Map_24BE8 dc.w word_24D60-Map_24BE8 word_24C28: dc.w $10 dc.b 0, $F, 0, 0, 0, 0 dc.b 0, $F, 0, $10, 0, $20 dc.b 0, $F, 0, $20, 0, $40 dc.b 0, $F, 0, $30, 0, $60 dc.b $20, $F, 0, $40, 0, 0 dc.b $20, $F, 0, $50, 0, $20 dc.b $20, $F, 0, $60, 0, $40 dc.b $20, $F, 0, $70, 0, $60 dc.b $40, $F, 0, $80, 0, 0 dc.b $40, $F, 0, $90, 0, $20 dc.b $40, $F, 0, $A0, 0, $40 dc.b $40, $F, 0, $B0, 0, $60 dc.b $60, $F, 0, $C0, 0, 0 dc.b $60, $F, 0, $D0, 0, $20 dc.b $60, $F, 0, $E0, 0, $40 dc.b $60, $F, 0, $F0, 0, $60 word_24C8A: dc.w $10 dc.b 0, $F, 0, 0, 0, 0 dc.b 0, $F, 0, $10, 0, $20 dc.b 0, $F, 0, $20, 0, $40 dc.b 0, 7, 0, $30, 0, $60 dc.b $20, $F, 0, $40, 0, 0 dc.b $20, $F, 0, $50, 0, $20 dc.b $20, $F, 0, $60, 0, $40 dc.b $20, 7, 0, $70, 0, $60 dc.b $40, $F, 0, $80, 0, 0 dc.b $40, $F, 0, $90, 0, $20 dc.b $40, $F, 0, $A0, 0, $40 dc.b $40, 7, 0, $B0, 0, $60 dc.b $60, $F, 0, $C0, 0, 0 dc.b $60, $F, 0, $D0, 0, $20 dc.b $60, $F, 0, $E0, 0, $40 dc.b $60, 7, 0, $F0, 0, $60 word_24CEC: dc.w 9 dc.b 0, $F, 0, 0, 0, 0 dc.b 0, $F, 0, $10, 0, $20 dc.b 0, $F, 0, $20, 0, $40 dc.b $20, $F, 0, $30, 0, 0 dc.b $20, $F, 0, $40, 0, $20 dc.b $20, $F, 0, $50, 0, $40 dc.b $40, $F, 0, $60, 0, 0 dc.b $40, $F, 0, $70, 0, $20 dc.b $40, $F, 0, $80, 0, $40 word_24D24: dc.w 4 dc.b 0, $F, 0, 0, 0, 0 dc.b 0, $F, 0, $10, 0, $20 dc.b $20, $F, 0, $20, 0, 0 dc.b $20, $F, 0, $30, 0, $20 word_24D3E: dc.w 4 dc.b 0, $F, 0, 0, 0, 0 dc.b 0, 7, 0, $10, 0, $20 dc.b $20, $F, 0, $20, 0, 0 dc.b $20, 7, 0, $30, 0, $20 word_24D58: dc.w 1 dc.b 0, $F, 0, 0, 0, 0 word_24D60: dc.w 1 dc.b 0, 7, 0, 0, 0, 0
src/controller.asm
ViGrey/iss-nes
23
5797
; Copyright (C) 2020, <NAME> ; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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. ; Controller1 to Top Bar Data Protocol ; ; Bit 76543210 First Byte ($0500) ; ||||++++- Day Ones Digit ; ||++----- Day Tens Digit ; ++------- Hour Tens Digit ; ; Bit 76543210 Second Byte ($0501) ; ||||++++- Year Hundreds Digit ; ++++----- Year Thousands Digit ; ; Bit 76543210 Third Byte ($0502) ; ||||++++- Year Ones Digit ; ++++----- Year Tens Digit ; ; Bit 76543210 Fourth Byte ($0503) ; ||||++++- Month Offset Minus 1 ; ++++----- Hour Ones Digit ; ; Bit 76543210 Fifth Byte ($0504) ; ||||++++- Latitude Ones Digit ; |+++----- Latitude Tens Digit ; +-------- Longitude Hundreds Digit ; ; Bit 76543210 Sixth Byte ($0505) ; ||||++++- Latitude Hundredths Place ; ++++----- Latitude Tenths Place ; ; Bit 76543210 Seventh Byte ($0506) ; ||||++++- Longitude Ones Digit ; ++++----- Longitude Tens Digit ; ; Bit 76543210 Eighth Byte ($0507) ; ||||++++- Longitude Hundredths Place ; ++++----- Longitude Tenths Place ; ; Bit 76543210 Ninth Byte ($0508) ; ||||++++- Second Ones Digit ; |+++----- Second Tens Digit ; +-------- Latitude Hemisphere (0=North/1=South) ; ; Bit 76543210 Tenth Byte ($0509) ; ||||++++- Minute Ones Digit ; |+++----- Minute Tens Digit ; +-------- Longitude Hemisphere (0=East/1=West) SetDefaultDate: lda #$01 sta controller1 lda #$19 sta (controller1 + 1) lda #$70 sta (controller1 + 2) rts PollControllerSync: lda #$00 sta controllervalid ldx #$06 ldy #$08 PollControllerSyncLatch: lda #$01 sta CONTROLLER1 lda #$00 sta CONTROLLER1 PollControllerSyncLoop: lda CONTROLLER1 lsr rol controllersync dey bne PollControllerSyncLoop lda controllersync cmp #$FF beq PollControllerSyncLoopIsFF cpx #$06 beq PollControllerSyncContinue ; FF sync pulse is required at least once per frame lda #$01 sta controllervalid jmp PollControllerSyncContinue PollControllerSyncLoopIsFF: ldy #$08 dex bne PollControllerSyncLatch PollControllerSyncContinue: lda controllervalid beq PollControllerSyncInvalid lda controllersync sta controller1 ldx #$01 ldy #$08 jmp PollControllerLatch PollControllerSyncInvalid: jsr SetController1LastFrameToController1 PollControllerSyncDone: jsr PollControllerFinished rts PollController: ldx #$00 ldy #$08 PollControllerLatch: lda #$01 sta CONTROLLER1 lda #$00 sta CONTROLLER1 PollController1Loop: lda CONTROLLER1 lsr rol controller1, X dey bne PollController1Loop ldy #$08 inx cpx #$0A bne PollControllerLatch PollControllerFinished: jsr GetDate jsr GetTime jsr GetLatitude jsr GetLongitude jsr DrawDate jsr DrawTime jsr DrawLatitude jsr DrawLongitude jsr LatitudeToTmp jsr LatitudeToYPosition jsr LongitudeToTmp jsr LongitudeToXScroll rts GetHour: lda controller1 and #%11000000 asl rol rol sta hour lda (controller1 + 3) and #%11110000 lsr lsr lsr lsr sta (hour + 1) rts GetMinute: lda (controller1 + 9) and #%01110000 lsr lsr lsr lsr sta minute lda (controller1 + 9) and #%00001111 sta (minute + 1) rts GetSecond: lda (controller1 + 8) and #%01110000 lsr lsr lsr lsr sta second lda (controller1 + 8) and #%00001111 sta (second + 1) rts GetDay: lda controller1 and #%00110000 lsr lsr lsr lsr sta day lda controller1 and #%00001111 sta (day + 1) rts GetYear: lda (controller1 + 1) and #%11110000 lsr lsr lsr lsr sta year lda (controller1 + 1) and #%00001111 sta (year + 1) lda (controller1 + 2) and #%11110000 lsr lsr lsr lsr sta (year + 2) lda (controller1 + 2) and #%00001111 sta (year + 3) rts GetMonth: lda (controller1 + 3) and #%00001111 sta month asl clc adc month sta month rts GetDate: jsr GetDay jsr GetYear jsr GetMonth rts GetTime: jsr GetHour jsr GetMinute jsr GetSecond GetLatitude: lda (controller1 + 4) and #%01110000 lsr lsr lsr lsr sta lat lda (controller1 + 4) and #%00001111 sta (lat + 1) lda (controller1 + 5) and #%11110000 lsr lsr lsr lsr sta (lat + 2) lda (controller1 + 5) and #%00001111 sta (lat + 3) lda (controller1 + 8) and #%10000000 asl rol sta northsouth rts GetLongitude: lda (controller1 + 4) and #%10000000 asl rol sta lon lda (controller1 + 6) and #%11110000 lsr lsr lsr lsr sta (lon + 1) lda (controller1 + 6) and #%00001111 sta (lon + 2) lda (controller1 + 7) and #%11110000 lsr lsr lsr lsr sta (lon + 3) lda (controller1 + 7) and #%00001111 sta (lon + 4) lda (controller1 + 9) and #%10000000 asl rol sta eastwest rts DrawDate: ldy drawBufferOffset lda #$20 sta (drawBuffer), Y iny lda #$48 sta (drawBuffer), Y iny ldx month lda Months, X sta (drawBuffer), Y iny inx lda Months, X sta (drawBuffer), Y iny inx lda Months, X sta (drawBuffer), Y iny lda #$04 sta (drawBuffer), Y iny lda day clc adc #$E1 sta (drawBuffer), Y iny lda (day + 1) clc adc #$E1 sta (drawBuffer), Y iny lda #$04 sta (drawBuffer), Y iny lda year clc adc #$E1 sta (drawBuffer), Y iny lda (year + 1) clc adc #$E1 sta (drawBuffer), Y iny lda (year + 2) clc adc #$E1 sta (drawBuffer), Y iny lda (year + 3) clc adc #$E1 sta (drawBuffer), Y iny lda #$8E sta (drawBuffer), Y iny sty drawBufferOffset rts DrawTime: ldy drawBufferOffset lda #$20 sta (drawBuffer), Y iny lda #$68 sta (drawBuffer), Y iny lda hour adc #$E1 sta (drawBuffer), Y iny lda (hour + 1) clc adc #$E1 sta (drawBuffer), Y iny lda #$E0 sta (drawBuffer), Y iny lda minute clc adc #$E1 sta (drawBuffer), Y iny lda (minute + 1) clc adc #$E1 sta (drawBuffer), Y iny lda #$E0 sta (drawBuffer), Y iny lda second clc adc #$E1 sta (drawBuffer), Y iny lda (second + 1) clc adc #$E1 sta (drawBuffer), Y iny lda #$8E sta (drawBuffer), Y iny sty drawBufferOffset rts DrawLatitude: ldy drawBufferOffset lda #$20 sta (drawBuffer), Y iny lda #$88 sta (drawBuffer), Y iny lda lat clc adc #$E1 sta (drawBuffer), Y iny lda (lat + 1) clc adc #$E1 sta (drawBuffer), Y iny lda #$DF sta (drawBuffer), Y iny lda (lat + 2) clc adc #$E1 sta (drawBuffer), Y iny lda (lat + 3) clc adc #$E1 sta (drawBuffer), Y iny lda #$04 sta (drawBuffer), Y iny ldx northsouth lda NorthSouth, X sta (drawBuffer), Y iny lda #$8E sta (drawBuffer), Y iny sty drawBufferOffset rts DrawLongitude: ldy drawBufferOffset lda #$20 sta (drawBuffer), Y iny lda #$A7 sta (drawBuffer), Y iny lda lon beq DrawLongitudeNotHundred clc adc #$E1 jmp DrawLongitudeContinue DrawLongitudeNotHundred: lda #$04 DrawLongitudeContinue: sta (drawBuffer), Y iny lda (lon + 1) clc adc #$E1 sta (drawBuffer), Y iny lda (lon + 2) clc adc #$E1 sta (drawBuffer), Y iny lda #$DF sta (drawBuffer), Y iny lda (lon + 3) clc adc #$E1 sta (drawBuffer), Y iny lda (lon + 4) clc adc #$E1 sta (drawBuffer), Y iny lda #$04 sta (drawBuffer), Y iny ldx eastwest lda EastWest, X sta (drawBuffer), Y iny lda #$8E sta (drawBuffer), Y iny sty drawBufferOffset rts LatitudeToTmp: lda #$00 ldx lat LatitudeToTmpTensLoop: cpx #$00 beq LatitudeToTmpTensLoopDone clc adc #$0A dex jmp LatitudeToTmpTensLoop LatitudeToTmpTensLoopDone: clc adc (lat + 1) cmp #91 bcc LatitudeToTmpDone lda #$00 LatitudeToTmpDone: sta tmp rts LatitudeToYPosition: lda northsouth bne LatitudeToYPositionSouth lda #90 sec sbc tmp jmp LatitudeToYPositionContinue LatitudeToYPositionSouth: lda tmp clc adc #90 LatitudeToYPositionContinue: tay lda (Latitudes), Y sta $204 sta $208 sta $20C clc adc #$08 sta $210 sta $214 sta $218 rts LongitudeToTmp: lda #$00 ldx lon LongitudeToTmpHundredsLoop: beq LongitudeToTmpHundredsLoopDone clc adc #100 LongitudeToTmpHundredsLoopDone: ldx (lon + 1) LongitudeToTmpTensLoop: cpx #$00 beq LongitudeToTmpTensLoopDone clc adc #$0A dex jmp LongitudeToTmpTensLoop LongitudeToTmpTensLoopDone: clc adc (lon + 2) cmp #179 bcc LongitudeToTmpDone lda #179 LongitudeToTmpDone: sta tmp rts LongitudeToXScroll: lda eastwest beq LongitudeToXScrollEast lda #$00 sta nametable lda #179 sec sbc tmp jmp LongitudeToXScrollContinue LongitudeToXScrollEast: lda #$01 sta nametable lda tmp LongitudeToXScrollContinue: tay lda (Longitudes), Y sec sbc #$80 sta xscroll bcs LongitudeToXScrollDone lda nametable eor #%00000001 sta nametable LongitudeToXScrollDone: rts SetController1ToController1LastFrame: ldy #$00 SetController1ToController1LastFrameLoop: lda (controller1), Y sta (controller1LastFrame), Y iny cpy #$0A bcc SetController1ToController1LastFrameLoop rts SetController1LastFrameToController1: ldy #$00 SetController1LastFrameToController1Loop: lda (controller1LastFrame), Y sta (controller1), Y iny cpy #$0A bcc SetController1LastFrameToController1Loop rts
programs/oeis/153/A153644.asm
karttu/loda
1
3187
<filename>programs/oeis/153/A153644.asm ; A153644: a(n) = 4*n^2 + 28*n + 10. ; 42,82,130,186,250,322,402,490,586,690,802,922,1050,1186,1330,1482,1642,1810,1986,2170,2362,2562,2770,2986,3210,3442,3682,3930,4186,4450,4722,5002,5290,5586,5890,6202,6522,6850,7186,7530,7882,8242,8610,8986,9370,9762,10162,10570,10986,11410,11842,12282,12730,13186,13650,14122,14602,15090,15586,16090,16602,17122,17650,18186,18730,19282,19842,20410,20986,21570,22162,22762,23370,23986,24610,25242,25882,26530,27186,27850,28522,29202,29890,30586,31290,32002,32722,33450,34186,34930,35682,36442,37210,37986,38770,39562,40362,41170,41986,42810,43642,44482,45330,46186,47050,47922,48802,49690,50586,51490,52402,53322,54250,55186,56130,57082,58042,59010,59986,60970,61962,62962,63970,64986,66010,67042,68082,69130,70186,71250,72322,73402,74490,75586,76690,77802,78922,80050,81186,82330,83482,84642,85810,86986,88170,89362,90562,91770,92986,94210,95442,96682,97930,99186,100450,101722,103002,104290,105586,106890,108202,109522,110850,112186,113530,114882,116242,117610,118986,120370,121762,123162,124570,125986,127410,128842,130282,131730,133186,134650,136122,137602,139090,140586,142090,143602,145122,146650,148186,149730,151282,152842,154410,155986,157570,159162,160762,162370,163986,165610,167242,168882,170530,172186,173850,175522,177202,178890,180586,182290,184002,185722,187450,189186,190930,192682,194442,196210,197986,199770,201562,203362,205170,206986,208810,210642,212482,214330,216186,218050,219922,221802,223690,225586,227490,229402,231322,233250,235186,237130,239082,241042,243010,244986,246970,248962,250962,252970,254986,257010 mov $1,$0 add $1,$0 add $1,9 pow $1,2 sub $1,39
sound/sfxasm/67.asm
NatsumiFox/Sonic-3-93-Nov-03
7
102332
<filename>sound/sfxasm/67.asm 67_Header: sHeaderInit ; Z80 offset is $C8C3 sHeaderPatch 67_Patches sHeaderTick $01 sHeaderCh $01 sHeaderSFX $80, $02, 67_FM3, $2B, $00 67_FM3: sPatFM $00 67_Loop1: dc.b nCs1, $02 saVolFM $01 sLoop $00, $08, 67_Loop1 saVolFM $E0 sLoop $00, $05, 67_Loop1 sStop 67_Patches: ; Patch $00 ; $35 ; $00, $00, $00, $00, $1F, $1F, $1F, $1F ; $00, $00, $00, $00, $00, $00, $00, $00 ; $0F, $0F, $0F, $0F, $15, $80, $80, $80 spAlgorithm $05 spFeedback $06 spDetune $00, $00, $00, $00 spMultiple $00, $00, $00, $00 spRateScale $00, $00, $00, $00 spAttackRt $1F, $1F, $1F, $1F spAmpMod $00, $00, $00, $00 spSustainRt $00, $00, $00, $00 spSustainLv $00, $00, $00, $00 spDecayRt $00, $00, $00, $00 spReleaseRt $0F, $0F, $0F, $0F spTotalLv $15, $00, $00, $00
vbox/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemSet.asm
Nurzamal/rest_api_docker
0
242079
<gh_stars>0 ; $Id: bs3-cmn-MemSet.asm 69111 2017-10-17 14:26:02Z vboxsync $ ;; @file ; BS3Kit - Bs3MemSet. ; ; ; Copyright (C) 2007-2017 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; ; you can redistribute it and/or modify it under the terms of the GNU ; General Public License (GPL) as published by the Free Software ; Foundation, in version 2 as it comes in the "COPYING" file of the ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ; ; The contents of this file may alternatively be used under the terms ; of the Common Development and Distribution License Version 1.0 ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the ; VirtualBox OSE distribution, in which case the provisions of the ; CDDL are applicable instead of those of the GPL. ; ; You may elect to license modified versions of this file under the ; terms and conditions of either the GPL or the CDDL or both. ; %include "bs3kit-template-header.mac" ;; ; @cproto BS3_CMN_PROTO_NOSB(void, Bs3MemSet,(void BS3_FAR *pvDst, uint8_t bFiller, size_t cbDst)); ; BS3_PROC_BEGIN_CMN Bs3MemSet, BS3_PBC_HYBRID push xBP mov xBP, xSP push xDI %ifdef RT_ARCH_AMD64 mov rdi, rcx ; rdi = pvDst mov rcx, r8 ; rcx = cbDst movzx edx, dl ; bFiller mov rax, 0101010101010101h mul rdx mov rcx, r8 shr rcx, 3 ; calc qword count. cld rep stosq mov rcx, r8 ; cbDst and rcx, 7 ; calc trailing byte count. rep stosb %elif ARCH_BITS == 16 push es mov di, [bp + 2 + cbCurRetAddr] ; pvDst.off mov es, [bp + 2 + cbCurRetAddr + 2] ; pvDst.sel mov al, [bp + 2 + cbCurRetAddr + 4] ; bFiller mov ah, al mov cx, [bp + 2 + cbCurRetAddr + 6] ; cbDst shr cx, 1 ; calc dword count. rep stosw mov cx, [bp + 2 + cbCurRetAddr + 6] ; cbDst and cx, 1 ; calc tailing byte count. rep stosb pop es %elif ARCH_BITS == 32 mov edi, [ebp + 8] ; pvDst mov al, byte [ebp + 4 + cbCurRetAddr + 4] ; bFiller mov ah, al mov dx, ax shl eax, 16 mov ax, dx ; eax = RT_MAKE_U32_FROM_U8(bFiller, bFiller, bFiller, bFiller) mov ecx, [ebp + 4 + cbCurRetAddr + 8] ; cbDst shr cx, 2 ; calc dword count. rep stosd mov ecx, [ebp + 4 + cbCurRetAddr + 8] ; cbDst and ecx, 3 ; calc tailing byte count. rep stosb %else %error "Unknown bitness." %endif pop xDI pop xBP BS3_HYBRID_RET BS3_PROC_END_CMN Bs3MemSet
oeis/306/A306185.asm
neoneye/loda-programs
11
26414
; A306185: a(n) = (2n+1)!! + (2n)!! where k!! = A006882(k). ; 5,23,153,1329,14235,181215,2672145,44781345,840523635,17465201775,397983749625,9867844134225,264469801070475,7618612476650175,234748657653134625,7703855828862818625,268263758052098683875,9879138385352252391375,383608053176023482431625,15664153113813817068080625 mul $0,2 add $0,2 seq $0,76051 ; Sum of product of odd numbers <= n and the product of even numbers <= n.
Nip.g4
AudriusButkevicius/NipSharp
4
3497
// To generate run: // java -jar antlr-4.9.3-complete.jar Nip.g4 -o Generated -Dlanguage=CSharp -no-listener -visitor -package NipSharp grammar Nip; /* * Parser Rules */ // Left hand side flagProperty: FLAG; affixProperty: AFFIX; stat: IDENTIFIER | INTEGER; property: IDENTIFIER; maxQuantity: MAXQUANTITY; tier: TIER; mercTier: MERCTIER; // Right hand side number: INTEGER | FLOAT; numberOrAlias: IDENTIFIER | INTEGER; statExpr : statExpr op=(MUL | DIV) statExpr #statMulDivRule | statExpr op=(ADD | SUB) statExpr #statAddSubRule | op=(ADD | SUB)? '['stat']' #statNameRule | op=(ADD | SUB)? number #statNumberRule | op=(ADD | SUB)? '('statExpr')' #statExprParenRule ; statRule : statExpr op=(EQ | NEQ | GT | GTE | LT | LTE) statExpr #statRelationalRule | statRule op=(AND | OR) statRule #statLogicalRule | '('statRule')' #statParenRule ; // Because we peek at the value propertyRule : '['flagProperty']' op=(EQ | NEQ | GT | GTE | LT | LTE) numberOrAlias #propFlagRule // This is special because it's actually [flag]&value == value | '['affixProperty']' op=(EQ | NEQ | GT | GTE | LT | LTE) numberOrAlias #propAffixRule // This is special because it creates a chain of OR's, (i.e, [prefix] == 1 turns into [prefix0] == 1 || [prefix1] == 1 || [prefix2] == 1) | '['property']' op=(EQ | NEQ | GT | GTE | LT | LTE) numberOrAlias #propRelationalRule | property op=(EQ | NEQ | GT | GTE | LT | LTE) numberOrAlias #propRelationalRule | propertyRule op=(AND | OR) propertyRule #propLogicalRule | '('propertyRule')' #propParenRule ; // These are all special as I have no idea what they really do. additionalRule : '['maxQuantity']' op=EQ statExpr #additionalMaxQuantityRule | '['tier']' op=EQ statExpr #additionalTierRule | '['mercTier']' op=EQ statExpr #additionalMercTierRule | additionalRule op=(AND | OR) additionalRule #additionalLogicalRule | '('additionalRule')' #additionalParenRule ; nipRule: propertyRule? ('#' statRule? ('#' additionalRule?)?)?; line: nipRule | <EOF>; /* * Lexer Rules */ fragment DIGIT: [0-9]; fragment LETTER: [a-z]; fragment QUOTE: '\''; fragment COMMA: ','; FLAG: 'flag'; AFFIX: ('prefix' | 'suffix'); MAXQUANTITY: 'maxquantity'; TIER: 'tier'; MERCTIER: 'merctier'; FLOAT: DIGIT+ '.' DIGIT+; INTEGER: DIGIT+; IDENTIFIER: LETTER(LETTER | DIGIT | QUOTE | COMMA)*; EQ: '=='; NEQ: '!='; GT: '>'; GTE: '>='; LT: '<'; LTE: '<='; AND: '&&'; OR: '||'; MUL: '*'; DIV: '/'; ADD: '+'; SUB: '-'; WS: [\t\r\n ]+ -> skip; LINE_COMMENT: '//' ~[\r\n]* -> skip; BLOCK_COMMENT: '/*' .*? '*/' -> skip; // The wildcard catch in the middle might be wrong? But seems to work?
test/succeed/Issue674.agda
larrytheliquid/agda
1
3895
-- Andreas 2012-07-07 module Issue674 where record unit : Set where constructor tt module A ⦃ t : unit ⦄ (i : unit) where id : unit → unit id x = x open A {{t = _}} tt module N = A {{ tt }} tt open N open A {{tt}} tt module M = A tt open M open A tt -- the last statement caused a panic when inserting the instance meta -- because due to open it found candidates in scope that were not -- in the signature yet
libsrc/gfx/wide/w_getsprite.asm
ahjelm/z88dk
640
24616
; ; Getsprite - Picks up a sprite from display with the given size ; by <NAME> - 2019 ; ; The original putsprite code is by <NAME> (TI 85) ; ; Generic version (just a bit slow) ; ; THIS IS A QUICK PLACEHOLDER, WORKING ONLY ON THE PIXELS REGION (0,0)-(255,255) ; ; ; $Id: w_getsprite.asm $ ; IF !__CPU_INTEL__ && !__CPU_GBZ80__ SECTION smc_clib PUBLIC getsprite PUBLIC _getsprite PUBLIC getsprite_sub EXTERN w_pointxy EXTERN swapgfxbk EXTERN __graphics_end INCLUDE "graphics/grafix.inc" ; __gfx_coords: d,e (vert-horz) ; sprite: (ix) .getsprite ._getsprite push ix ld hl,4 add hl,sp ld e,(hl) inc hl ld d,(hl) ; sprite address push de pop ix inc hl ld e,(hl) inc hl inc hl ld d,(hl) ; x and y __gfx_coords ld h,d ; X ld l,e ; Y .getsprite_sub dec h ld c,h ; keep copy of X position IF NEED_swapgfxbk = 1 call swapgfxbk ENDIF ld b,(ix+0) ; x size (iloop) ld d,(ix+1) ; y size (oloop) ld e,$fe ; trailing byte for "set 7,.." instruction ld a,7 or b ; mess up the byte boundary check if the sprite edge is not exactly on a byte jr z,skip_inc ; NOP ld a,$23 ; INC IX .skip_inc ld (inc_smc+1),a inc b .oloop xor a ld (ix+2),a push de push bc ; keep copy of counters ld (nopoint-1),a ld e,a .iloop push bc push de push hl ld e,l ; Y ld l,h ; X ld d,0 ld h,d call w_pointxy pop hl pop de jr z,nopoint set 7,(ix+2) ; SMC (23 T) .nopoint ld a,e sub 8 ; next bit (count 7 to 0) cp $c6-8 ; trailing byte for "set 0,.." instruction (rightmost bit) jr nc,next_bit inc ix ; next byte in the sprite data xor a ld (ix+2),a ld a,$fe ; trailing byte for "set 0,.." instruction .next_bit ld (nopoint-1),a ld e,a inc h ; increment X pop bc ; djnz iloop ld a,$fe ; trailing byte for "set 7,.." instruction cp e jr z,noinc .inc_smc inc ix ; next byte in the sprite data .noinc pop bc ; restore counters pop de ld h,c ; reset X inc l ; increment Y dec d jr nz,oloop IF NEED_swapgfxbk jp __graphics_end ELSE IF !__CPU_INTEL__ & !__CPU_GBZ80__ pop ix ENDIF ret ENDIF ENDIF
src/skill-internal-file_parsers.ads
skill-lang/adaCommon
0
21255
-- ___ _ ___ _ _ -- -- / __| |/ (_) | | Common SKilL implementation -- -- \__ \ ' <| | | |__ file parser implementation -- -- |___/_|\_\_|_|____| by: <NAME> -- -- -- pragma Ada_2012; with Skill.Streams; with Skill.Files; with Skill.Types; with Skill.String_Pools; with Skill.Types.Pools; with Skill.Field_Types; with Skill.Streams.Reader; with Skill.Field_Types.Builtin; with Skill.Field_Types.Builtin.String_Type_P; -- documentation can be found in java common package Skill.Internal.File_Parsers is generic type Result_T is new Skill.Files.File_T with private; type Result is access Result_T; with function New_Pool (Type_ID : Natural; Name : Skill.Types.String_Access; Super : Skill.Types.Pools.Pool) return Skill.Types.Pools.Pool is <>; with function Make_State (Path : Types.String_Access; Mode : Files.Write_Mode; Strings : String_Pools.Pool; String_Type : Skill.Field_Types.Builtin.String_Type_P.Field_Type; Annotation_Type : Skill.Field_Types.Builtin.Annotation_Type_P .Field_Type; Types : Skill.Types.Pools.Type_Vector; Types_By_Name : Skill.Types.Pools.Type_Map) return Result is <>; function Read (Input : Skill.Streams.Reader.Input_Stream; Mode : Skill.Files.Write_Mode) return Result; end Skill.Internal.File_Parsers;
scripts/Route11Gate1F.asm
AmateurPanda92/pokemon-rby-dx
9
81634
<filename>scripts/Route11Gate1F.asm Route11Gate1F_Script: jp EnableAutoTextBoxDrawing Route11Gate1F_TextPointers: dw Route11GateText1 Route11GateText1: TX_FAR _Route11GateText1 db "@"
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0_notsx.log_21829_2004.asm
ljhsiun2/medusa
9
247170
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r15 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x1442, %rsi lea addresses_WC_ht+0x1ec52, %rdi nop add $63703, %r13 mov $30, %rcx rep movsq nop nop nop nop nop sub $19263, %rbx lea addresses_A_ht+0xd4f2, %r13 nop nop sub $49135, %r12 movups (%r13), %xmm3 vpextrq $1, %xmm3, %rcx nop sub %rdi, %rdi lea addresses_A_ht+0x6af2, %rcx nop nop sub $29956, %r9 movups (%rcx), %xmm3 vpextrq $0, %xmm3, %rsi nop nop nop nop nop and $1965, %r13 lea addresses_UC_ht+0x7ef2, %rdi nop nop nop nop xor %r12, %r12 mov (%rdi), %rbx nop nop nop nop nop add $64825, %rdi lea addresses_D_ht+0xa892, %r12 and %rdi, %rdi mov $0x6162636465666768, %rbx movq %rbx, %xmm4 movups %xmm4, (%r12) nop sub $54285, %r9 lea addresses_normal_ht+0xfef2, %rsi lea addresses_A_ht+0x182f2, %rdi add %r15, %r15 mov $67, %rcx rep movsq nop nop nop dec %r13 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r9 push %rbx push %rdi push %rdx // Faulty Load mov $0x39848700000002f2, %r9 nop nop xor $8830, %rdi mov (%r9), %bx lea oracles, %rdi and $0xff, %rbx shlq $12, %rbx mov (%rdi,%rbx,1), %rbx pop %rdx pop %rdi pop %rbx pop %r9 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': True, 'same': True, 'congruent': 10}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, '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 */
libsrc/stdio_new/file/stream-in/stdio_getchar.asm
andydansby/z88dk-mk2
1
3992
; stdio_getchar ; 05.2008 aralbrec XLIB stdio_getchar LIB l_jpix INCLUDE "../../stdio.def" ; all character input from stream is read through this function ; ; enter : ix = FILE * ; bc' = number of chars read thus far ; de' = number of conversions done thus far ; MUST NOT ALTER HL' FOR SSCANF FUNCTIONS ; exit : bc' = number of chars read thus far ; de' = number of conversions done thus far ; a = input char ; carry set if error on stream (EOF) ; uses : af, exx .stdio_getchar bit 0,(ix+3) ; is an unget char available? jr z, readfromstream ld a,(ix+4) ; return unget char res 0,(ix+3) ; unget char no longer available exx inc bc ; increase number of bytes read from stream exx or a ; no error ret .readfromstream exx push bc push de ld a,STDIO_MSG_GETC call l_jpix pop de pop bc jr c, error inc bc ; increase number of bytes read from stream .error exx ret
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_SetPrintPos_callee.asm
jpoikela/z88dk
640
80872
<reponame>jpoikela/z88dk ; void sp1_SetPrintPos(struct sp1_pss *ps, uchar row, uchar col) SECTION code_clib SECTION code_temp_sp1 PUBLIC _sp1_SetPrintPos_callee EXTERN asm_sp1_SetPrintPos _sp1_SetPrintPos_callee: pop af pop hl pop bc pop de push af ld d,c jp asm_sp1_SetPrintPos
texmecs/src/main/antlr4/nl/knaw/huygens/alexandria/texmecs/grammar/TexMECSLexer.g4
HuygensING/alexandria-lmnl
4
1717
// based on http://mlcd.blackmesatech.com/mlcd/2003/Papers/texmecs.html lexer grammar TexMECSLexer; BEGIN_COMMENT : '<*' -> pushMode(INSIDE_COMMENT) ; BEGIN_CDATA : '<#CDATA<' -> pushMode(INSIDE_CDATA) ; BEGIN_VIRTUAL_ELEMENT : '<^' -> pushMode(INSIDE_VIRTUAL_ELEMENT) ; BEGIN_RESUME_TAG : '<+' -> pushMode(INSIDE_START_TAG) ; BEGIN_START_TAGSET : '<|' -> pushMode(INSIDE_START_TAG) ; BEGIN_START_TAG : '<' -> pushMode(INSIDE_START_TAG) ; TEXT : ~[<|\r\n]+ ; NL : [\r\n]+ -> skip ; BEGIN_SUSPEND_TAG : '|-' -> pushMode(INSIDE_END_TAG) ; BEGIN_END_TAGSET : '||' -> pushMode(INSIDE_END_TAG) ; BEGIN_END_TAG : '|' -> pushMode(INSIDE_END_TAG) ; //----------------- mode INSIDE_START_TAG; NAME_O : NAME ; SUFFIX_O : SUFFIX ; AtChar : '@'; WS : [ \t\r\n] -> skip ; EQUALS : '=' ; RESUME : '+' ; STRING : '"' ~[<"]* '"' | '\'' ~[<']* '\'' ; END_START_TAGSET : '||' -> popMode ; END_START_TAG : '|' -> popMode ; END_SOLE_TAG : '>' -> popMode ; //----------------- mode INSIDE_END_TAG; NAME_C : NAME ; SUFFIX_C : SUFFIX ; END_END_TAGSET : '|>' -> popMode ; END_END_TAG : '>' -> popMode ; //----------------- mode INSIDE_COMMENT; BEGIN_COMMENT_IN_COMMENT : '<*' -> pushMode(INSIDE_COMMENT) ; END_COMMENT : '*>' -> popMode ; COMMENT_TEXT : ~[*><]+ ; //----------------- mode INSIDE_CDATA; END_CDATA : '>#CDATA>' -> popMode ; CDATA : ~[>]+ ; //----------------- mode INSIDE_VIRTUAL_ELEMENT; END_VIRTUAL_ELEMENT : '>' -> popMode ; NAME_V : NAME ; CARET : '^' ; EQUALS_V : '=' ; STRING_V : '"' ~[<"]* '"' | '\'' ~[<']* '\'' ; //----------------- NAME : Nameinit Namechar* ; Nameinit : [a-zA-Z_] ; Namechar : Nameinit | [0-9] | ':' | '.' | '-' ; S : [ \t\r\n\u000C]+ //(#x20 | #x9 | #xD | #xA | #x85 | #x2028 | #x2029)+ ; //URL // : ~[>]+ //(CHAR/* - '>'*/)+ // ; // SUFFIX : '~' Namechar* ; //DQSTRINGCHAR // : ~["] // ; // //SQSTRINGCHAR // : ~['] // ; CHAR : [a-zA-Z] | '\u2070'..'\u218F' | '\u2C00'..'\u2FEF' | '\u3001'..'\uD7FF' | '\uF900'..'\uFDCF' | '\uFDF0'..'\uFFFD' ; DIGITS : [0-9]+ ; HEXDIGITS : [A-Fa-f0-9]+ ; DoublePipeChar : '||'; DQuoteChar : '"'; SQuoteChar : '\''; CommentOpen : '<*'; CommentClose : '*>'; CDataOpen : '<#CDATA<'; CDataClose : '>#CDATA>'; CharacterRefOpen : '<#'; ExternalEntityOpen : '<<'; ExternalEntityClose : '>>'; InternalEntityOpen : '<&'; ResumeOpen : '<+'; SuspendOpen : '|-'; StartTagSetOpen : '<|'; EndTagSetClose : '|>'; VirtualElementOpen : '<^'; fragment D : 'd' | 'D' ; fragment X : 'x' | 'X' ;
grammars/cs652/j/parser/J.g4
bkommineni/CS652-Java-To-C-Translator-Part2
0
6718
<gh_stars>0 grammar J; file: classDeclaration* main EOF ; main: (fieldDeclaration | statement)* ; classDeclaration : 'class' Identifier ('extends' typeType)? classBody ; classBody : '{' classBodyDeclaration* '}' ; classBodyDeclaration : ';' | block | memberDeclaration ; memberDeclaration : methodDeclaration | fieldDeclaration ; methodDeclaration : (typeType|'void') Identifier formalParameters ( methodBody | ';' ) ; formalParameters : '(' formalParameterList? ')' ; formalParameterList : formalParameter (',' formalParameter)* ; formalParameter : typeType variableDeclaratorId ; methodBody : block ; fieldDeclaration : typeType variableDeclarators ';' ; variableDeclarators : variableDeclarator (',' variableDeclarator)* ; variableDeclarator : variableDeclaratorId ; variableDeclaratorId : Identifier ('[' ']')* ; variableInitializer : arrayInitializer | expression ; arrayInitializer : '{' (variableInitializer (',' variableInitializer)* (',')? )? '}' ; typeType : classOrInterfaceType | primitiveType ; classOrInterfaceType : Identifier ('.' Identifier )* ; primitiveType : 'boolean' | 'char' | 'byte' | 'short' | 'int' | 'long' | 'float' | 'double' ; literal : IntegerLiteral | FloatingPointLiteral | StringLiteral | 'null' ; block : '{' blockStatement* '}' ; blockStatement : localVariableDeclarationStatement | statement ; localVariableDeclarationStatement : localVariableDeclaration ';' ; localVariableDeclaration : typeType variableDeclarators ; statement : block | 'if' parExpression statement ('else' statement)? | 'while' parExpression statement | 'return' expression? ';' | ';' | statementExpression ';' | Identifier ':' statement ; parExpression : '(' expression ')' ; expressionList : expression (',' expression)* ; statementExpression : expression ; expression : primary | expression '.' Identifier | expression '.' 'this' | expression '.' 'super' superSuffix | expression '.' explicitGenericInvocation | expression '[' expression ']' | expression '(' expressionList? ')' | 'new' creator | '(' typeType ')' expression | expression ('=') expression ; primary : '(' expression ')' | 'this' | 'super' | literal | Identifier | typeType '.' 'class' | 'void' '.' 'class' ; creator : createdName classCreatorRest ; createdName : Identifier ('.' Identifier )* | primitiveType ; classCreatorRest : arguments classBody? ; explicitGenericInvocation : explicitGenericInvocationSuffix ; superSuffix : arguments | '.' Identifier arguments? ; explicitGenericInvocationSuffix : 'super' superSuffix | Identifier arguments ; arguments : '(' expressionList? ')' ; IntegerLiteral : [0-9]+ ; FloatingPointLiteral : [0-9]+ '.' [0-9]+ ; StringLiteral : '"' .*? '"' ; Identifier : [a-zA-Z] [a-zA-Z0-9]* ; WS : [ \t\r\n\u000C]+ -> skip ; COMMENT : '/*' .*? '*/' -> channel(HIDDEN) ; LINE_COMMENT : '//' ~[\r\n]* -> channel(HIDDEN) ;
user/kill.asm
eric-qian-d/TCP
0
103947
user/_kill: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <main>: #include "kernel/stat.h" #include "user/user.h" int main(int argc, char **argv) { 0: 1101 addi sp,sp,-32 2: ec06 sd ra,24(sp) 4: e822 sd s0,16(sp) 6: e426 sd s1,8(sp) 8: e04a sd s2,0(sp) a: 1000 addi s0,sp,32 int i; if(argc < 2){ c: 4785 li a5,1 e: 02a7dd63 bge a5,a0,48 <main+0x48> 12: 00858493 addi s1,a1,8 16: ffe5091b addiw s2,a0,-2 1a: 1902 slli s2,s2,0x20 1c: 02095913 srli s2,s2,0x20 20: 090e slli s2,s2,0x3 22: 05c1 addi a1,a1,16 24: 992e add s2,s2,a1 fprintf(2, "usage: kill pid...\n"); exit(1); } for(i=1; i<argc; i++) kill(atoi(argv[i])); 26: 6088 ld a0,0(s1) 28: 00000097 auipc ra,0x0 2c: 1b2080e7 jalr 434(ra) # 1da <atoi> 30: 00000097 auipc ra,0x0 34: 2da080e7 jalr 730(ra) # 30a <kill> for(i=1; i<argc; i++) 38: 04a1 addi s1,s1,8 3a: ff2496e3 bne s1,s2,26 <main+0x26> exit(0); 3e: 4501 li a0,0 40: 00000097 auipc ra,0x0 44: 29a080e7 jalr 666(ra) # 2da <exit> fprintf(2, "usage: kill pid...\n"); 48: 00000597 auipc a1,0x0 4c: 7c058593 addi a1,a1,1984 # 808 <malloc+0xe8> 50: 4509 li a0,2 52: 00000097 auipc ra,0x0 56: 5e2080e7 jalr 1506(ra) # 634 <fprintf> exit(1); 5a: 4505 li a0,1 5c: 00000097 auipc ra,0x0 60: 27e080e7 jalr 638(ra) # 2da <exit> 0000000000000064 <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 64: 1141 addi sp,sp,-16 66: e422 sd s0,8(sp) 68: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 6a: 87aa mv a5,a0 6c: 0585 addi a1,a1,1 6e: 0785 addi a5,a5,1 70: fff5c703 lbu a4,-1(a1) 74: fee78fa3 sb a4,-1(a5) 78: fb75 bnez a4,6c <strcpy+0x8> ; return os; } 7a: 6422 ld s0,8(sp) 7c: 0141 addi sp,sp,16 7e: 8082 ret 0000000000000080 <strcmp>: int strcmp(const char *p, const char *q) { 80: 1141 addi sp,sp,-16 82: e422 sd s0,8(sp) 84: 0800 addi s0,sp,16 while(*p && *p == *q) 86: 00054783 lbu a5,0(a0) 8a: cb91 beqz a5,9e <strcmp+0x1e> 8c: 0005c703 lbu a4,0(a1) 90: 00f71763 bne a4,a5,9e <strcmp+0x1e> p++, q++; 94: 0505 addi a0,a0,1 96: 0585 addi a1,a1,1 while(*p && *p == *q) 98: 00054783 lbu a5,0(a0) 9c: fbe5 bnez a5,8c <strcmp+0xc> return (uchar)*p - (uchar)*q; 9e: 0005c503 lbu a0,0(a1) } a2: 40a7853b subw a0,a5,a0 a6: 6422 ld s0,8(sp) a8: 0141 addi sp,sp,16 aa: 8082 ret 00000000000000ac <strlen>: uint strlen(const char *s) { ac: 1141 addi sp,sp,-16 ae: e422 sd s0,8(sp) b0: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) b2: 00054783 lbu a5,0(a0) b6: cf91 beqz a5,d2 <strlen+0x26> b8: 0505 addi a0,a0,1 ba: 87aa mv a5,a0 bc: 4685 li a3,1 be: 9e89 subw a3,a3,a0 c0: 00f6853b addw a0,a3,a5 c4: 0785 addi a5,a5,1 c6: fff7c703 lbu a4,-1(a5) ca: fb7d bnez a4,c0 <strlen+0x14> ; return n; } cc: 6422 ld s0,8(sp) ce: 0141 addi sp,sp,16 d0: 8082 ret for(n = 0; s[n]; n++) d2: 4501 li a0,0 d4: bfe5 j cc <strlen+0x20> 00000000000000d6 <memset>: void* memset(void *dst, int c, uint n) { d6: 1141 addi sp,sp,-16 d8: e422 sd s0,8(sp) da: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ dc: ce09 beqz a2,f6 <memset+0x20> de: 87aa mv a5,a0 e0: fff6071b addiw a4,a2,-1 e4: 1702 slli a4,a4,0x20 e6: 9301 srli a4,a4,0x20 e8: 0705 addi a4,a4,1 ea: 972a add a4,a4,a0 cdst[i] = c; ec: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ f0: 0785 addi a5,a5,1 f2: fee79de3 bne a5,a4,ec <memset+0x16> } return dst; } f6: 6422 ld s0,8(sp) f8: 0141 addi sp,sp,16 fa: 8082 ret 00000000000000fc <strchr>: char* strchr(const char *s, char c) { fc: 1141 addi sp,sp,-16 fe: e422 sd s0,8(sp) 100: 0800 addi s0,sp,16 for(; *s; s++) 102: 00054783 lbu a5,0(a0) 106: cb99 beqz a5,11c <strchr+0x20> if(*s == c) 108: 00f58763 beq a1,a5,116 <strchr+0x1a> for(; *s; s++) 10c: 0505 addi a0,a0,1 10e: 00054783 lbu a5,0(a0) 112: fbfd bnez a5,108 <strchr+0xc> return (char*)s; return 0; 114: 4501 li a0,0 } 116: 6422 ld s0,8(sp) 118: 0141 addi sp,sp,16 11a: 8082 ret return 0; 11c: 4501 li a0,0 11e: bfe5 j 116 <strchr+0x1a> 0000000000000120 <gets>: char* gets(char *buf, int max) { 120: 711d addi sp,sp,-96 122: ec86 sd ra,88(sp) 124: e8a2 sd s0,80(sp) 126: e4a6 sd s1,72(sp) 128: e0ca sd s2,64(sp) 12a: fc4e sd s3,56(sp) 12c: f852 sd s4,48(sp) 12e: f456 sd s5,40(sp) 130: f05a sd s6,32(sp) 132: ec5e sd s7,24(sp) 134: 1080 addi s0,sp,96 136: 8baa mv s7,a0 138: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ 13a: 892a mv s2,a0 13c: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 13e: 4aa9 li s5,10 140: 4b35 li s6,13 for(i=0; i+1 < max; ){ 142: 89a6 mv s3,s1 144: 2485 addiw s1,s1,1 146: 0344d863 bge s1,s4,176 <gets+0x56> cc = read(0, &c, 1); 14a: 4605 li a2,1 14c: faf40593 addi a1,s0,-81 150: 4501 li a0,0 152: 00000097 auipc ra,0x0 156: 1a0080e7 jalr 416(ra) # 2f2 <read> if(cc < 1) 15a: 00a05e63 blez a0,176 <gets+0x56> buf[i++] = c; 15e: faf44783 lbu a5,-81(s0) 162: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 166: 01578763 beq a5,s5,174 <gets+0x54> 16a: 0905 addi s2,s2,1 16c: fd679be3 bne a5,s6,142 <gets+0x22> for(i=0; i+1 < max; ){ 170: 89a6 mv s3,s1 172: a011 j 176 <gets+0x56> 174: 89a6 mv s3,s1 break; } buf[i] = '\0'; 176: 99de add s3,s3,s7 178: 00098023 sb zero,0(s3) return buf; } 17c: 855e mv a0,s7 17e: 60e6 ld ra,88(sp) 180: 6446 ld s0,80(sp) 182: 64a6 ld s1,72(sp) 184: 6906 ld s2,64(sp) 186: 79e2 ld s3,56(sp) 188: 7a42 ld s4,48(sp) 18a: 7aa2 ld s5,40(sp) 18c: 7b02 ld s6,32(sp) 18e: 6be2 ld s7,24(sp) 190: 6125 addi sp,sp,96 192: 8082 ret 0000000000000194 <stat>: int stat(const char *n, struct stat *st) { 194: 1101 addi sp,sp,-32 196: ec06 sd ra,24(sp) 198: e822 sd s0,16(sp) 19a: e426 sd s1,8(sp) 19c: e04a sd s2,0(sp) 19e: 1000 addi s0,sp,32 1a0: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 1a2: 4581 li a1,0 1a4: 00000097 auipc ra,0x0 1a8: 176080e7 jalr 374(ra) # 31a <open> if(fd < 0) 1ac: 02054563 bltz a0,1d6 <stat+0x42> 1b0: 84aa mv s1,a0 return -1; r = fstat(fd, st); 1b2: 85ca mv a1,s2 1b4: 00000097 auipc ra,0x0 1b8: 17e080e7 jalr 382(ra) # 332 <fstat> 1bc: 892a mv s2,a0 close(fd); 1be: 8526 mv a0,s1 1c0: 00000097 auipc ra,0x0 1c4: 142080e7 jalr 322(ra) # 302 <close> return r; } 1c8: 854a mv a0,s2 1ca: 60e2 ld ra,24(sp) 1cc: 6442 ld s0,16(sp) 1ce: 64a2 ld s1,8(sp) 1d0: 6902 ld s2,0(sp) 1d2: 6105 addi sp,sp,32 1d4: 8082 ret return -1; 1d6: 597d li s2,-1 1d8: bfc5 j 1c8 <stat+0x34> 00000000000001da <atoi>: int atoi(const char *s) { 1da: 1141 addi sp,sp,-16 1dc: e422 sd s0,8(sp) 1de: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 1e0: 00054603 lbu a2,0(a0) 1e4: fd06079b addiw a5,a2,-48 1e8: 0ff7f793 andi a5,a5,255 1ec: 4725 li a4,9 1ee: 02f76963 bltu a4,a5,220 <atoi+0x46> 1f2: 86aa mv a3,a0 n = 0; 1f4: 4501 li a0,0 while('0' <= *s && *s <= '9') 1f6: 45a5 li a1,9 n = n*10 + *s++ - '0'; 1f8: 0685 addi a3,a3,1 1fa: 0025179b slliw a5,a0,0x2 1fe: 9fa9 addw a5,a5,a0 200: 0017979b slliw a5,a5,0x1 204: 9fb1 addw a5,a5,a2 206: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 20a: 0006c603 lbu a2,0(a3) 20e: fd06071b addiw a4,a2,-48 212: 0ff77713 andi a4,a4,255 216: fee5f1e3 bgeu a1,a4,1f8 <atoi+0x1e> return n; } 21a: 6422 ld s0,8(sp) 21c: 0141 addi sp,sp,16 21e: 8082 ret n = 0; 220: 4501 li a0,0 222: bfe5 j 21a <atoi+0x40> 0000000000000224 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 224: 1141 addi sp,sp,-16 226: e422 sd s0,8(sp) 228: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 22a: 02b57663 bgeu a0,a1,256 <memmove+0x32> while(n-- > 0) 22e: 02c05163 blez a2,250 <memmove+0x2c> 232: fff6079b addiw a5,a2,-1 236: 1782 slli a5,a5,0x20 238: 9381 srli a5,a5,0x20 23a: 0785 addi a5,a5,1 23c: 97aa add a5,a5,a0 dst = vdst; 23e: 872a mv a4,a0 *dst++ = *src++; 240: 0585 addi a1,a1,1 242: 0705 addi a4,a4,1 244: fff5c683 lbu a3,-1(a1) 248: fed70fa3 sb a3,-1(a4) while(n-- > 0) 24c: fee79ae3 bne a5,a4,240 <memmove+0x1c> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 250: 6422 ld s0,8(sp) 252: 0141 addi sp,sp,16 254: 8082 ret dst += n; 256: 00c50733 add a4,a0,a2 src += n; 25a: 95b2 add a1,a1,a2 while(n-- > 0) 25c: fec05ae3 blez a2,250 <memmove+0x2c> 260: fff6079b addiw a5,a2,-1 264: 1782 slli a5,a5,0x20 266: 9381 srli a5,a5,0x20 268: fff7c793 not a5,a5 26c: 97ba add a5,a5,a4 *--dst = *--src; 26e: 15fd addi a1,a1,-1 270: 177d addi a4,a4,-1 272: 0005c683 lbu a3,0(a1) 276: 00d70023 sb a3,0(a4) while(n-- > 0) 27a: fee79ae3 bne a5,a4,26e <memmove+0x4a> 27e: bfc9 j 250 <memmove+0x2c> 0000000000000280 <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 280: 1141 addi sp,sp,-16 282: e422 sd s0,8(sp) 284: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 286: ca05 beqz a2,2b6 <memcmp+0x36> 288: fff6069b addiw a3,a2,-1 28c: 1682 slli a3,a3,0x20 28e: 9281 srli a3,a3,0x20 290: 0685 addi a3,a3,1 292: 96aa add a3,a3,a0 if (*p1 != *p2) { 294: 00054783 lbu a5,0(a0) 298: 0005c703 lbu a4,0(a1) 29c: 00e79863 bne a5,a4,2ac <memcmp+0x2c> return *p1 - *p2; } p1++; 2a0: 0505 addi a0,a0,1 p2++; 2a2: 0585 addi a1,a1,1 while (n-- > 0) { 2a4: fed518e3 bne a0,a3,294 <memcmp+0x14> } return 0; 2a8: 4501 li a0,0 2aa: a019 j 2b0 <memcmp+0x30> return *p1 - *p2; 2ac: 40e7853b subw a0,a5,a4 } 2b0: 6422 ld s0,8(sp) 2b2: 0141 addi sp,sp,16 2b4: 8082 ret return 0; 2b6: 4501 li a0,0 2b8: bfe5 j 2b0 <memcmp+0x30> 00000000000002ba <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 2ba: 1141 addi sp,sp,-16 2bc: e406 sd ra,8(sp) 2be: e022 sd s0,0(sp) 2c0: 0800 addi s0,sp,16 return memmove(dst, src, n); 2c2: 00000097 auipc ra,0x0 2c6: f62080e7 jalr -158(ra) # 224 <memmove> } 2ca: 60a2 ld ra,8(sp) 2cc: 6402 ld s0,0(sp) 2ce: 0141 addi sp,sp,16 2d0: 8082 ret 00000000000002d2 <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 2d2: 4885 li a7,1 ecall 2d4: 00000073 ecall ret 2d8: 8082 ret 00000000000002da <exit>: .global exit exit: li a7, SYS_exit 2da: 4889 li a7,2 ecall 2dc: 00000073 ecall ret 2e0: 8082 ret 00000000000002e2 <wait>: .global wait wait: li a7, SYS_wait 2e2: 488d li a7,3 ecall 2e4: 00000073 ecall ret 2e8: 8082 ret 00000000000002ea <pipe>: .global pipe pipe: li a7, SYS_pipe 2ea: 4891 li a7,4 ecall 2ec: 00000073 ecall ret 2f0: 8082 ret 00000000000002f2 <read>: .global read read: li a7, SYS_read 2f2: 4895 li a7,5 ecall 2f4: 00000073 ecall ret 2f8: 8082 ret 00000000000002fa <write>: .global write write: li a7, SYS_write 2fa: 48c1 li a7,16 ecall 2fc: 00000073 ecall ret 300: 8082 ret 0000000000000302 <close>: .global close close: li a7, SYS_close 302: 48d5 li a7,21 ecall 304: 00000073 ecall ret 308: 8082 ret 000000000000030a <kill>: .global kill kill: li a7, SYS_kill 30a: 4899 li a7,6 ecall 30c: 00000073 ecall ret 310: 8082 ret 0000000000000312 <exec>: .global exec exec: li a7, SYS_exec 312: 489d li a7,7 ecall 314: 00000073 ecall ret 318: 8082 ret 000000000000031a <open>: .global open open: li a7, SYS_open 31a: 48bd li a7,15 ecall 31c: 00000073 ecall ret 320: 8082 ret 0000000000000322 <mknod>: .global mknod mknod: li a7, SYS_mknod 322: 48c5 li a7,17 ecall 324: 00000073 ecall ret 328: 8082 ret 000000000000032a <unlink>: .global unlink unlink: li a7, SYS_unlink 32a: 48c9 li a7,18 ecall 32c: 00000073 ecall ret 330: 8082 ret 0000000000000332 <fstat>: .global fstat fstat: li a7, SYS_fstat 332: 48a1 li a7,8 ecall 334: 00000073 ecall ret 338: 8082 ret 000000000000033a <link>: .global link link: li a7, SYS_link 33a: 48cd li a7,19 ecall 33c: 00000073 ecall ret 340: 8082 ret 0000000000000342 <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 342: 48d1 li a7,20 ecall 344: 00000073 ecall ret 348: 8082 ret 000000000000034a <chdir>: .global chdir chdir: li a7, SYS_chdir 34a: 48a5 li a7,9 ecall 34c: 00000073 ecall ret 350: 8082 ret 0000000000000352 <dup>: .global dup dup: li a7, SYS_dup 352: 48a9 li a7,10 ecall 354: 00000073 ecall ret 358: 8082 ret 000000000000035a <getpid>: .global getpid getpid: li a7, SYS_getpid 35a: 48ad li a7,11 ecall 35c: 00000073 ecall ret 360: 8082 ret 0000000000000362 <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 362: 48b1 li a7,12 ecall 364: 00000073 ecall ret 368: 8082 ret 000000000000036a <sleep>: .global sleep sleep: li a7, SYS_sleep 36a: 48b5 li a7,13 ecall 36c: 00000073 ecall ret 370: 8082 ret 0000000000000372 <uptime>: .global uptime uptime: li a7, SYS_uptime 372: 48b9 li a7,14 ecall 374: 00000073 ecall ret 378: 8082 ret 000000000000037a <connect>: .global connect connect: li a7, SYS_connect 37a: 48d9 li a7,22 ecall 37c: 00000073 ecall ret 380: 8082 ret 0000000000000382 <ntas>: .global ntas ntas: li a7, SYS_ntas 382: 48dd li a7,23 ecall 384: 00000073 ecall ret 388: 8082 ret 000000000000038a <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 38a: 1101 addi sp,sp,-32 38c: ec06 sd ra,24(sp) 38e: e822 sd s0,16(sp) 390: 1000 addi s0,sp,32 392: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 396: 4605 li a2,1 398: fef40593 addi a1,s0,-17 39c: 00000097 auipc ra,0x0 3a0: f5e080e7 jalr -162(ra) # 2fa <write> } 3a4: 60e2 ld ra,24(sp) 3a6: 6442 ld s0,16(sp) 3a8: 6105 addi sp,sp,32 3aa: 8082 ret 00000000000003ac <printint>: static void printint(int fd, int xx, int base, int sgn) { 3ac: 7139 addi sp,sp,-64 3ae: fc06 sd ra,56(sp) 3b0: f822 sd s0,48(sp) 3b2: f426 sd s1,40(sp) 3b4: f04a sd s2,32(sp) 3b6: ec4e sd s3,24(sp) 3b8: 0080 addi s0,sp,64 3ba: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 3bc: c299 beqz a3,3c2 <printint+0x16> 3be: 0805c863 bltz a1,44e <printint+0xa2> neg = 1; x = -xx; } else { x = xx; 3c2: 2581 sext.w a1,a1 neg = 0; 3c4: 4881 li a7,0 3c6: fc040693 addi a3,s0,-64 } i = 0; 3ca: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 3cc: 2601 sext.w a2,a2 3ce: 00000517 auipc a0,0x0 3d2: 45a50513 addi a0,a0,1114 # 828 <digits> 3d6: 883a mv a6,a4 3d8: 2705 addiw a4,a4,1 3da: 02c5f7bb remuw a5,a1,a2 3de: 1782 slli a5,a5,0x20 3e0: 9381 srli a5,a5,0x20 3e2: 97aa add a5,a5,a0 3e4: 0007c783 lbu a5,0(a5) 3e8: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 3ec: 0005879b sext.w a5,a1 3f0: 02c5d5bb divuw a1,a1,a2 3f4: 0685 addi a3,a3,1 3f6: fec7f0e3 bgeu a5,a2,3d6 <printint+0x2a> if(neg) 3fa: 00088b63 beqz a7,410 <printint+0x64> buf[i++] = '-'; 3fe: fd040793 addi a5,s0,-48 402: 973e add a4,a4,a5 404: 02d00793 li a5,45 408: fef70823 sb a5,-16(a4) 40c: 0028071b addiw a4,a6,2 while(--i >= 0) 410: 02e05863 blez a4,440 <printint+0x94> 414: fc040793 addi a5,s0,-64 418: 00e78933 add s2,a5,a4 41c: fff78993 addi s3,a5,-1 420: 99ba add s3,s3,a4 422: 377d addiw a4,a4,-1 424: 1702 slli a4,a4,0x20 426: 9301 srli a4,a4,0x20 428: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 42c: fff94583 lbu a1,-1(s2) 430: 8526 mv a0,s1 432: 00000097 auipc ra,0x0 436: f58080e7 jalr -168(ra) # 38a <putc> while(--i >= 0) 43a: 197d addi s2,s2,-1 43c: ff3918e3 bne s2,s3,42c <printint+0x80> } 440: 70e2 ld ra,56(sp) 442: 7442 ld s0,48(sp) 444: 74a2 ld s1,40(sp) 446: 7902 ld s2,32(sp) 448: 69e2 ld s3,24(sp) 44a: 6121 addi sp,sp,64 44c: 8082 ret x = -xx; 44e: 40b005bb negw a1,a1 neg = 1; 452: 4885 li a7,1 x = -xx; 454: bf8d j 3c6 <printint+0x1a> 0000000000000456 <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 456: 7119 addi sp,sp,-128 458: fc86 sd ra,120(sp) 45a: f8a2 sd s0,112(sp) 45c: f4a6 sd s1,104(sp) 45e: f0ca sd s2,96(sp) 460: ecce sd s3,88(sp) 462: e8d2 sd s4,80(sp) 464: e4d6 sd s5,72(sp) 466: e0da sd s6,64(sp) 468: fc5e sd s7,56(sp) 46a: f862 sd s8,48(sp) 46c: f466 sd s9,40(sp) 46e: f06a sd s10,32(sp) 470: ec6e sd s11,24(sp) 472: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 474: 0005c903 lbu s2,0(a1) 478: 18090f63 beqz s2,616 <vprintf+0x1c0> 47c: 8aaa mv s5,a0 47e: 8b32 mv s6,a2 480: 00158493 addi s1,a1,1 state = 0; 484: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 486: 02500a13 li s4,37 if(c == 'd'){ 48a: 06400c13 li s8,100 printint(fd, va_arg(ap, int), 10, 1); } else if(c == 'l') { 48e: 06c00c93 li s9,108 printint(fd, va_arg(ap, uint64), 10, 0); } else if(c == 'x') { 492: 07800d13 li s10,120 printint(fd, va_arg(ap, int), 16, 0); } else if(c == 'p') { 496: 07000d93 li s11,112 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 49a: 00000b97 auipc s7,0x0 49e: 38eb8b93 addi s7,s7,910 # 828 <digits> 4a2: a839 j 4c0 <vprintf+0x6a> putc(fd, c); 4a4: 85ca mv a1,s2 4a6: 8556 mv a0,s5 4a8: 00000097 auipc ra,0x0 4ac: ee2080e7 jalr -286(ra) # 38a <putc> 4b0: a019 j 4b6 <vprintf+0x60> } else if(state == '%'){ 4b2: 01498f63 beq s3,s4,4d0 <vprintf+0x7a> for(i = 0; fmt[i]; i++){ 4b6: 0485 addi s1,s1,1 4b8: fff4c903 lbu s2,-1(s1) 4bc: 14090d63 beqz s2,616 <vprintf+0x1c0> c = fmt[i] & 0xff; 4c0: 0009079b sext.w a5,s2 if(state == 0){ 4c4: fe0997e3 bnez s3,4b2 <vprintf+0x5c> if(c == '%'){ 4c8: fd479ee3 bne a5,s4,4a4 <vprintf+0x4e> state = '%'; 4cc: 89be mv s3,a5 4ce: b7e5 j 4b6 <vprintf+0x60> if(c == 'd'){ 4d0: 05878063 beq a5,s8,510 <vprintf+0xba> } else if(c == 'l') { 4d4: 05978c63 beq a5,s9,52c <vprintf+0xd6> } else if(c == 'x') { 4d8: 07a78863 beq a5,s10,548 <vprintf+0xf2> } else if(c == 'p') { 4dc: 09b78463 beq a5,s11,564 <vprintf+0x10e> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ 4e0: 07300713 li a4,115 4e4: 0ce78663 beq a5,a4,5b0 <vprintf+0x15a> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 4e8: 06300713 li a4,99 4ec: 0ee78e63 beq a5,a4,5e8 <vprintf+0x192> putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 4f0: 11478863 beq a5,s4,600 <vprintf+0x1aa> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 4f4: 85d2 mv a1,s4 4f6: 8556 mv a0,s5 4f8: 00000097 auipc ra,0x0 4fc: e92080e7 jalr -366(ra) # 38a <putc> putc(fd, c); 500: 85ca mv a1,s2 502: 8556 mv a0,s5 504: 00000097 auipc ra,0x0 508: e86080e7 jalr -378(ra) # 38a <putc> } state = 0; 50c: 4981 li s3,0 50e: b765 j 4b6 <vprintf+0x60> printint(fd, va_arg(ap, int), 10, 1); 510: 008b0913 addi s2,s6,8 514: 4685 li a3,1 516: 4629 li a2,10 518: 000b2583 lw a1,0(s6) 51c: 8556 mv a0,s5 51e: 00000097 auipc ra,0x0 522: e8e080e7 jalr -370(ra) # 3ac <printint> 526: 8b4a mv s6,s2 state = 0; 528: 4981 li s3,0 52a: b771 j 4b6 <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 52c: 008b0913 addi s2,s6,8 530: 4681 li a3,0 532: 4629 li a2,10 534: 000b2583 lw a1,0(s6) 538: 8556 mv a0,s5 53a: 00000097 auipc ra,0x0 53e: e72080e7 jalr -398(ra) # 3ac <printint> 542: 8b4a mv s6,s2 state = 0; 544: 4981 li s3,0 546: bf85 j 4b6 <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 548: 008b0913 addi s2,s6,8 54c: 4681 li a3,0 54e: 4641 li a2,16 550: 000b2583 lw a1,0(s6) 554: 8556 mv a0,s5 556: 00000097 auipc ra,0x0 55a: e56080e7 jalr -426(ra) # 3ac <printint> 55e: 8b4a mv s6,s2 state = 0; 560: 4981 li s3,0 562: bf91 j 4b6 <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 564: 008b0793 addi a5,s6,8 568: f8f43423 sd a5,-120(s0) 56c: 000b3983 ld s3,0(s6) putc(fd, '0'); 570: 03000593 li a1,48 574: 8556 mv a0,s5 576: 00000097 auipc ra,0x0 57a: e14080e7 jalr -492(ra) # 38a <putc> putc(fd, 'x'); 57e: 85ea mv a1,s10 580: 8556 mv a0,s5 582: 00000097 auipc ra,0x0 586: e08080e7 jalr -504(ra) # 38a <putc> 58a: 4941 li s2,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 58c: 03c9d793 srli a5,s3,0x3c 590: 97de add a5,a5,s7 592: 0007c583 lbu a1,0(a5) 596: 8556 mv a0,s5 598: 00000097 auipc ra,0x0 59c: df2080e7 jalr -526(ra) # 38a <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 5a0: 0992 slli s3,s3,0x4 5a2: 397d addiw s2,s2,-1 5a4: fe0914e3 bnez s2,58c <vprintf+0x136> printptr(fd, va_arg(ap, uint64)); 5a8: f8843b03 ld s6,-120(s0) state = 0; 5ac: 4981 li s3,0 5ae: b721 j 4b6 <vprintf+0x60> s = va_arg(ap, char*); 5b0: 008b0993 addi s3,s6,8 5b4: 000b3903 ld s2,0(s6) if(s == 0) 5b8: 02090163 beqz s2,5da <vprintf+0x184> while(*s != 0){ 5bc: 00094583 lbu a1,0(s2) 5c0: c9a1 beqz a1,610 <vprintf+0x1ba> putc(fd, *s); 5c2: 8556 mv a0,s5 5c4: 00000097 auipc ra,0x0 5c8: dc6080e7 jalr -570(ra) # 38a <putc> s++; 5cc: 0905 addi s2,s2,1 while(*s != 0){ 5ce: 00094583 lbu a1,0(s2) 5d2: f9e5 bnez a1,5c2 <vprintf+0x16c> s = va_arg(ap, char*); 5d4: 8b4e mv s6,s3 state = 0; 5d6: 4981 li s3,0 5d8: bdf9 j 4b6 <vprintf+0x60> s = "(null)"; 5da: 00000917 auipc s2,0x0 5de: 24690913 addi s2,s2,582 # 820 <malloc+0x100> while(*s != 0){ 5e2: 02800593 li a1,40 5e6: bff1 j 5c2 <vprintf+0x16c> putc(fd, va_arg(ap, uint)); 5e8: 008b0913 addi s2,s6,8 5ec: 000b4583 lbu a1,0(s6) 5f0: 8556 mv a0,s5 5f2: 00000097 auipc ra,0x0 5f6: d98080e7 jalr -616(ra) # 38a <putc> 5fa: 8b4a mv s6,s2 state = 0; 5fc: 4981 li s3,0 5fe: bd65 j 4b6 <vprintf+0x60> putc(fd, c); 600: 85d2 mv a1,s4 602: 8556 mv a0,s5 604: 00000097 auipc ra,0x0 608: d86080e7 jalr -634(ra) # 38a <putc> state = 0; 60c: 4981 li s3,0 60e: b565 j 4b6 <vprintf+0x60> s = va_arg(ap, char*); 610: 8b4e mv s6,s3 state = 0; 612: 4981 li s3,0 614: b54d j 4b6 <vprintf+0x60> } } } 616: 70e6 ld ra,120(sp) 618: 7446 ld s0,112(sp) 61a: 74a6 ld s1,104(sp) 61c: 7906 ld s2,96(sp) 61e: 69e6 ld s3,88(sp) 620: 6a46 ld s4,80(sp) 622: 6aa6 ld s5,72(sp) 624: 6b06 ld s6,64(sp) 626: 7be2 ld s7,56(sp) 628: 7c42 ld s8,48(sp) 62a: 7ca2 ld s9,40(sp) 62c: 7d02 ld s10,32(sp) 62e: 6de2 ld s11,24(sp) 630: 6109 addi sp,sp,128 632: 8082 ret 0000000000000634 <fprintf>: void fprintf(int fd, const char *fmt, ...) { 634: 715d addi sp,sp,-80 636: ec06 sd ra,24(sp) 638: e822 sd s0,16(sp) 63a: 1000 addi s0,sp,32 63c: e010 sd a2,0(s0) 63e: e414 sd a3,8(s0) 640: e818 sd a4,16(s0) 642: ec1c sd a5,24(s0) 644: 03043023 sd a6,32(s0) 648: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 64c: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 650: 8622 mv a2,s0 652: 00000097 auipc ra,0x0 656: e04080e7 jalr -508(ra) # 456 <vprintf> } 65a: 60e2 ld ra,24(sp) 65c: 6442 ld s0,16(sp) 65e: 6161 addi sp,sp,80 660: 8082 ret 0000000000000662 <printf>: void printf(const char *fmt, ...) { 662: 711d addi sp,sp,-96 664: ec06 sd ra,24(sp) 666: e822 sd s0,16(sp) 668: 1000 addi s0,sp,32 66a: e40c sd a1,8(s0) 66c: e810 sd a2,16(s0) 66e: ec14 sd a3,24(s0) 670: f018 sd a4,32(s0) 672: f41c sd a5,40(s0) 674: 03043823 sd a6,48(s0) 678: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 67c: 00840613 addi a2,s0,8 680: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 684: 85aa mv a1,a0 686: 4505 li a0,1 688: 00000097 auipc ra,0x0 68c: dce080e7 jalr -562(ra) # 456 <vprintf> } 690: 60e2 ld ra,24(sp) 692: 6442 ld s0,16(sp) 694: 6125 addi sp,sp,96 696: 8082 ret 0000000000000698 <free>: static Header base; static Header *freep; void free(void *ap) { 698: 1141 addi sp,sp,-16 69a: e422 sd s0,8(sp) 69c: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 69e: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6a2: 00000797 auipc a5,0x0 6a6: 19e7b783 ld a5,414(a5) # 840 <freep> 6aa: a805 j 6da <free+0x42> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 6ac: 4618 lw a4,8(a2) 6ae: 9db9 addw a1,a1,a4 6b0: feb52c23 sw a1,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 6b4: 6398 ld a4,0(a5) 6b6: 6318 ld a4,0(a4) 6b8: fee53823 sd a4,-16(a0) 6bc: a091 j 700 <free+0x68> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 6be: ff852703 lw a4,-8(a0) 6c2: 9e39 addw a2,a2,a4 6c4: c790 sw a2,8(a5) p->s.ptr = bp->s.ptr; 6c6: ff053703 ld a4,-16(a0) 6ca: e398 sd a4,0(a5) 6cc: a099 j 712 <free+0x7a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6ce: 6398 ld a4,0(a5) 6d0: 00e7e463 bltu a5,a4,6d8 <free+0x40> 6d4: 00e6ea63 bltu a3,a4,6e8 <free+0x50> { 6d8: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6da: fed7fae3 bgeu a5,a3,6ce <free+0x36> 6de: 6398 ld a4,0(a5) 6e0: 00e6e463 bltu a3,a4,6e8 <free+0x50> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6e4: fee7eae3 bltu a5,a4,6d8 <free+0x40> if(bp + bp->s.size == p->s.ptr){ 6e8: ff852583 lw a1,-8(a0) 6ec: 6390 ld a2,0(a5) 6ee: 02059713 slli a4,a1,0x20 6f2: 9301 srli a4,a4,0x20 6f4: 0712 slli a4,a4,0x4 6f6: 9736 add a4,a4,a3 6f8: fae60ae3 beq a2,a4,6ac <free+0x14> bp->s.ptr = p->s.ptr; 6fc: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 700: 4790 lw a2,8(a5) 702: 02061713 slli a4,a2,0x20 706: 9301 srli a4,a4,0x20 708: 0712 slli a4,a4,0x4 70a: 973e add a4,a4,a5 70c: fae689e3 beq a3,a4,6be <free+0x26> } else p->s.ptr = bp; 710: e394 sd a3,0(a5) freep = p; 712: 00000717 auipc a4,0x0 716: 12f73723 sd a5,302(a4) # 840 <freep> } 71a: 6422 ld s0,8(sp) 71c: 0141 addi sp,sp,16 71e: 8082 ret 0000000000000720 <malloc>: return freep; } void* malloc(uint nbytes) { 720: 7139 addi sp,sp,-64 722: fc06 sd ra,56(sp) 724: f822 sd s0,48(sp) 726: f426 sd s1,40(sp) 728: f04a sd s2,32(sp) 72a: ec4e sd s3,24(sp) 72c: e852 sd s4,16(sp) 72e: e456 sd s5,8(sp) 730: e05a sd s6,0(sp) 732: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 734: 02051493 slli s1,a0,0x20 738: 9081 srli s1,s1,0x20 73a: 04bd addi s1,s1,15 73c: 8091 srli s1,s1,0x4 73e: 0014899b addiw s3,s1,1 742: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 744: 00000517 auipc a0,0x0 748: 0fc53503 ld a0,252(a0) # 840 <freep> 74c: c515 beqz a0,778 <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 74e: 611c ld a5,0(a0) if(p->s.size >= nunits){ 750: 4798 lw a4,8(a5) 752: 02977f63 bgeu a4,s1,790 <malloc+0x70> 756: 8a4e mv s4,s3 758: 0009871b sext.w a4,s3 75c: 6685 lui a3,0x1 75e: 00d77363 bgeu a4,a3,764 <malloc+0x44> 762: 6a05 lui s4,0x1 764: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 768: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 76c: 00000917 auipc s2,0x0 770: 0d490913 addi s2,s2,212 # 840 <freep> if(p == (char*)-1) 774: 5afd li s5,-1 776: a88d j 7e8 <malloc+0xc8> base.s.ptr = freep = prevp = &base; 778: 00000797 auipc a5,0x0 77c: 0d078793 addi a5,a5,208 # 848 <base> 780: 00000717 auipc a4,0x0 784: 0cf73023 sd a5,192(a4) # 840 <freep> 788: e39c sd a5,0(a5) base.s.size = 0; 78a: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 78e: b7e1 j 756 <malloc+0x36> if(p->s.size == nunits) 790: 02e48b63 beq s1,a4,7c6 <malloc+0xa6> p->s.size -= nunits; 794: 4137073b subw a4,a4,s3 798: c798 sw a4,8(a5) p += p->s.size; 79a: 1702 slli a4,a4,0x20 79c: 9301 srli a4,a4,0x20 79e: 0712 slli a4,a4,0x4 7a0: 97ba add a5,a5,a4 p->s.size = nunits; 7a2: 0137a423 sw s3,8(a5) freep = prevp; 7a6: 00000717 auipc a4,0x0 7aa: 08a73d23 sd a0,154(a4) # 840 <freep> return (void*)(p + 1); 7ae: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 7b2: 70e2 ld ra,56(sp) 7b4: 7442 ld s0,48(sp) 7b6: 74a2 ld s1,40(sp) 7b8: 7902 ld s2,32(sp) 7ba: 69e2 ld s3,24(sp) 7bc: 6a42 ld s4,16(sp) 7be: 6aa2 ld s5,8(sp) 7c0: 6b02 ld s6,0(sp) 7c2: 6121 addi sp,sp,64 7c4: 8082 ret prevp->s.ptr = p->s.ptr; 7c6: 6398 ld a4,0(a5) 7c8: e118 sd a4,0(a0) 7ca: bff1 j 7a6 <malloc+0x86> hp->s.size = nu; 7cc: 01652423 sw s6,8(a0) free((void*)(hp + 1)); 7d0: 0541 addi a0,a0,16 7d2: 00000097 auipc ra,0x0 7d6: ec6080e7 jalr -314(ra) # 698 <free> return freep; 7da: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) 7de: d971 beqz a0,7b2 <malloc+0x92> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7e0: 611c ld a5,0(a0) if(p->s.size >= nunits){ 7e2: 4798 lw a4,8(a5) 7e4: fa9776e3 bgeu a4,s1,790 <malloc+0x70> if(p == freep) 7e8: 00093703 ld a4,0(s2) 7ec: 853e mv a0,a5 7ee: fef719e3 bne a4,a5,7e0 <malloc+0xc0> p = sbrk(nu * sizeof(Header)); 7f2: 8552 mv a0,s4 7f4: 00000097 auipc ra,0x0 7f8: b6e080e7 jalr -1170(ra) # 362 <sbrk> if(p == (char*)-1) 7fc: fd5518e3 bne a0,s5,7cc <malloc+0xac> return 0; 800: 4501 li a0,0 802: bf45 j 7b2 <malloc+0x92>
oeis/143/A143731.asm
neoneye/loda-programs
11
160084
<filename>oeis/143/A143731.asm ; A143731: Characteristic function of numbers with at least two distinct prime factors (A024619). ; Submitted by <NAME> ; 0,0,0,0,0,1,0,0,0,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,0,1,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1 add $0,1 mov $2,2 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 add $2,1 cmp $4,0 cmp $4,0 sub $3,$4 lpe lpb $0 mov $4,$0 mod $4,$2 cmp $4,0 pow $2,$4 div $0,$2 lpe cmp $0,1 add $0,1 mod $0,2
programs/oeis/188/A188257.asm
jmorken/loda
1
2519
; A188257: [nr+kr]-[nr]-[kr], where r=sqrt(5), k=2, [ ]=floor. ; 0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1 add $0,2 cal $0,188189 ; [nr]-[kr]-[nr-kr], where r=sqrt(5), k=2, [ ]=floor. mov $1,$0
source/nodes/program-nodes-variant_parts.ads
optikos/oasis
0
13552
-- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Identifiers; with Program.Elements.Variants; with Program.Elements.Variant_Parts; with Program.Element_Visitors; package Program.Nodes.Variant_Parts is pragma Preelaborate; type Variant_Part is new Program.Nodes.Node and Program.Elements.Variant_Parts.Variant_Part and Program.Elements.Variant_Parts.Variant_Part_Text with private; function Create (Case_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Discriminant : not null Program.Elements.Identifiers.Identifier_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Variants : not null Program.Elements.Variants .Variant_Vector_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Case_Token_2 : not null Program.Lexical_Elements .Lexical_Element_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Variant_Part; type Implicit_Variant_Part is new Program.Nodes.Node and Program.Elements.Variant_Parts.Variant_Part with private; function Create (Discriminant : not null Program.Elements.Identifiers .Identifier_Access; Variants : not null Program.Elements.Variants .Variant_Vector_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Variant_Part with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Variant_Part is abstract new Program.Nodes.Node and Program.Elements.Variant_Parts.Variant_Part with record Discriminant : not null Program.Elements.Identifiers.Identifier_Access; Variants : not null Program.Elements.Variants .Variant_Vector_Access; end record; procedure Initialize (Self : aliased in out Base_Variant_Part'Class); overriding procedure Visit (Self : not null access Base_Variant_Part; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Discriminant (Self : Base_Variant_Part) return not null Program.Elements.Identifiers.Identifier_Access; overriding function Variants (Self : Base_Variant_Part) return not null Program.Elements.Variants.Variant_Vector_Access; overriding function Is_Variant_Part_Element (Self : Base_Variant_Part) return Boolean; overriding function Is_Definition_Element (Self : Base_Variant_Part) return Boolean; type Variant_Part is new Base_Variant_Part and Program.Elements.Variant_Parts.Variant_Part_Text with record Case_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Case_Token_2 : not null Program.Lexical_Elements .Lexical_Element_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Variant_Part_Text (Self : aliased in out Variant_Part) return Program.Elements.Variant_Parts.Variant_Part_Text_Access; overriding function Case_Token (Self : Variant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Is_Token (Self : Variant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function End_Token (Self : Variant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Case_Token_2 (Self : Variant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Semicolon_Token (Self : Variant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access; type Implicit_Variant_Part is new Base_Variant_Part with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; end record; overriding function To_Variant_Part_Text (Self : aliased in out Implicit_Variant_Part) return Program.Elements.Variant_Parts.Variant_Part_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Variant_Part) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Variant_Part) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Variant_Part) return Boolean; end Program.Nodes.Variant_Parts;
src/sparknacl-scalar.adb
yannickmoy/SPARKNaCl
76
18866
with SPARKNaCl.Utils; package body SPARKNaCl.Scalar with SPARK_Mode => On is pragma Warnings (GNATProve, Off, "pragma * ignored (not yet supported)"); Nine : constant Bytes_32 := (9, others => 0); GF_121665 : constant Normal_GF := (16#DB41#, 1, others => 0); -------------------------------------------------------- -- Scalar multiplication -------------------------------------------------------- function Mult (N : in Bytes_32; P : in Bytes_32) return Bytes_32 is -- X and Z are variables not constants, so can be sanitized X : Normal_GF := Utils.Unpack_25519 (P); Z : Bytes_32 := (N (0) and 248) & N (1 .. 30) & ((N (31) and 127) or 64); Swap : Boolean; CB : Byte; Shift : Natural; A, B, C, D, E, F : Normal_GF; -- Additional temporaries needed to avoid aliasing of -- function results and their arguments. This enables RSO -- in all function/operator calls below. T1, T2 : Normal_GF; Result : Bytes_32; begin B := X; C := GF_0; A := GF_1; D := GF_1; for I in reverse U32 range 0 .. 254 loop pragma Loop_Optimize (No_Unroll); CB := Z (I32 (Shift_Right (I, 3))); Shift := Natural (I and 7); Swap := Boolean'Val (Shift_Right (CB, Shift) mod 2); pragma Loop_Invariant (A in Normal_GF and B in Normal_GF and C in Normal_GF and D in Normal_GF); Utils.CSwap16 (A, B, Swap); Utils.CSwap16 (C, D, Swap); -- Single binary operator or unary function call per statement to -- avoid introduction of a compiler-generated temporary that we -- won't be able to sanitize. E := A + C; T1 := A - C; C := B + D; T2 := B - D; D := Square (E); F := Square (T1); A := C * T1; C := T2 * E; E := A + C; T2 := A - C; B := Square (T2); T1 := D - F; A := T1 * GF_121665; T2 := A + D; C := T1 * T2; A := D * F; D := B * X; B := Square (E); Utils.CSwap16 (A, B, Swap); Utils.CSwap16 (C, D, Swap); end loop; -- Compute Result in 3 steps here to avoid introducing a -- compiler-generated temporary which we won't be able -- to sanitize. T1 := Utils.Inv_25519 (C); T2 := A * T1; Result := Utils.Pack_25519 (T2); -- Sanitize as per WireGuard sources pragma Warnings (GNATProve, Off, "statement has no effect"); Sanitize_Boolean (Swap); Sanitize (Z); Sanitize_GF16 (X); Sanitize_GF16 (A); Sanitize_GF16 (B); Sanitize_GF16 (C); Sanitize_GF16 (D); Sanitize_GF16 (E); Sanitize_GF16 (F); Sanitize_GF16 (T1); Sanitize_GF16 (T2); pragma Unreferenced (Swap, Z, X, A, B, C, D, E, F, T1, T2); return Result; end Mult; function Mult_Base (N : in Bytes_32) return Bytes_32 is begin return Mult (N, Nine); end Mult_Base; end SPARKNaCl.Scalar;
oeis/070/A070824.asm
neoneye/loda-programs
11
92553
<reponame>neoneye/loda-programs ; A070824: Number of divisors of n which are > 1 and < n (nontrivial divisors). ; Submitted by <NAME> ; 0,0,0,1,0,2,0,2,1,2,0,4,0,2,2,3,0,4,0,4,2,2,0,6,1,2,2,4,0,6,0,4,2,2,2,7,0,2,2,6,0,6,0,4,4,2,0,8,1,4,2,4,0,6,2,6,2,2,0,10,0,2,4,5,2,6,0,4,2,6,0,10,0,2,4,4,2,6,0,8,3,2,0,10,2,2,2,6,0,10,2,4,2,2,2,10,0,4,4,7 mov $1,1 max $1,$0 seq $1,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n. mov $0,$1 sub $0,2
data/mapHeaders/Route2Gate.asm
AmateurPanda92/pokemon-rby-dx
9
97357
<filename>data/mapHeaders/Route2Gate.asm Route2Gate_h: db GATE ; tileset db ROUTE_2_GATE_HEIGHT, ROUTE_2_GATE_WIDTH ; dimensions (y, x) dw Route2Gate_Blocks ; blocks dw Route2Gate_TextPointers ; texts dw Route2Gate_Script ; scripts db 0 ; connections dw Route2Gate_Object ; objects
Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_11177_886.asm
ljhsiun2/medusa
9
93428
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r8 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x18749, %r10 nop nop sub $2863, %rax movl $0x61626364, (%r10) nop nop nop sub %rbp, %rbp lea addresses_D_ht+0x17749, %r8 and %rcx, %rcx vmovups (%r8), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %r9 and $50573, %rax lea addresses_A_ht+0xdf49, %rsi lea addresses_UC_ht+0xd849, %rdi nop and %r12, %r12 mov $126, %rcx rep movsl cmp %r12, %r12 lea addresses_WT_ht+0x1b349, %rsi lea addresses_D_ht+0x13f49, %rdi clflush (%rdi) nop nop nop cmp %r12, %r12 mov $44, %rcx rep movsw nop nop nop inc %rdi lea addresses_normal_ht+0x1c1c9, %rdi nop nop nop nop nop sub %rsi, %rsi mov (%rdi), %cx add %r8, %r8 lea addresses_A_ht+0x17fc9, %r8 nop and %rcx, %rcx mov (%r8), %edi nop sub %rdi, %rdi lea addresses_WT_ht+0x129a9, %r8 nop nop nop nop nop cmp %r12, %r12 mov (%r8), %r9 nop sub %r8, %r8 lea addresses_WC_ht+0x19b99, %rbp nop nop nop nop nop xor $10507, %r8 movb $0x61, (%rbp) and %rcx, %rcx lea addresses_normal_ht+0xd449, %rsi nop nop nop and %rax, %rax and $0xffffffffffffffc0, %rsi movntdqa (%rsi), %xmm1 vpextrq $1, %xmm1, %r9 nop nop nop nop and %r9, %r9 lea addresses_A_ht+0x779, %rsi lea addresses_WT_ht+0x3509, %rdi nop nop and $63726, %rbp mov $43, %rcx rep movsw nop nop nop nop nop and $6813, %rdi lea addresses_normal_ht+0x15349, %rsi lea addresses_WC_ht+0x13d49, %rdi nop and $16866, %r10 mov $119, %rcx rep movsl nop nop nop nop cmp %rax, %rax lea addresses_normal_ht+0x139d9, %rsi lea addresses_normal_ht+0x1649, %rdi cmp $50737, %r9 mov $84, %rcx rep movsl nop nop xor %rax, %rax lea addresses_normal_ht+0x1aa49, %rdi nop dec %rbp movb $0x61, (%rdi) nop cmp $29597, %rbp lea addresses_UC_ht+0x18749, %rax nop sub %rcx, %rcx mov $0x6162636465666768, %rdi movq %rdi, (%rax) and %rbp, %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r8 push %rbp push %rbx // Faulty Load lea addresses_WT+0x1749, %r13 nop nop nop nop nop and $58103, %rbx mov (%r13), %r12d lea oracles, %r8 and $0xff, %r12 shlq $12, %r12 mov (%r8,%r12,1), %r12 pop %rbx pop %rbp pop %r8 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'39': 11177} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
source/binary/compare.asm
paulscottrobson/Atomic-Basic-2
0
27281
; ******************************************************************************************* ; ******************************************************************************************* ; ; Name : compare.asm ; Purpose : Number Comparison ; Date : 26th July 2019 ; Author : <NAME> (<EMAIL>) ; ; ******************************************************************************************* ; ******************************************************************************************* ; ******************************************************************************************* ; ; Equals: In pairs, so CC accept result, CS invert it. ; ; ******************************************************************************************* BFUNC_Equals: ;; = clc bra BFUNC_EqualCheck BFUNC_NotEquals: ;; <> sec BFUNC_EqualCheck: php ; save invert flag lda evalStack+0 ; check equality cmp evalStack+4 bne COMP_Fail lda evalStack+1 cmp evalStack+5 bne COMP_Fail lda evalStack+2 cmp evalStack+6 bne COMP_Fail lda evalStack+3 cmp evalStack+7 bne COMP_Fail ; COMP_Succeed: ; here return -1 lda #$FF bra COMP_SetResult COMP_Fail: lda #0 ; here return 0 COMP_SetResult: plp ; but if CS bcc COMP_Accept eor #$FF ; invert that COMP_Accept: sta evalStack+0,x ; write to result. sta evalStack+1,x sta evalStack+2,x sta evalStack+3,x rts ; ******************************************************************************************* ; ; Less Than : In pairs, so CC accept result, CS invert it. ; ; ******************************************************************************************* BFUNC_Less: ;; < clc bra BFUNC_LessCheck BFUNC_GreaterEqual: ;; >= sec BFUNC_LessCheck: php sec lda evalStack+0 ; compare using direct subtraction sbc evalStack+4 lda evalStack+1 sbc evalStack+5 lda evalStack+2 sbc evalStack+6 lda evalStack+3 sbc evalStack+7 bmi COMP_Succeed bra COMP_Fail ; ******************************************************************************************* ; ; Less Than : In pairs, so CC accept result, CS invert it. ; ; ******************************************************************************************* BFUNC_Greater: ;; > clc bra BFUNC_GreaterCheck BFUNC_LessEqual: ;; <= sec BFUNC_GreaterCheck: php sec lda evalStack+4 ; compare using direct subtraction sbc evalStack+0 lda evalStack+5 sbc evalStack+1 lda evalStack+6 sbc evalStack+2 lda evalStack+7 sbc evalStack+3 bmi COMP_Succeed bra COMP_Fail
Aurora/Aurora/x64/Debug/sysfb.asm
manaskamal/aurora-xeneva
8
168684
; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1 include listing.inc INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC ?sys_get_fb_mem@@YAPEAIXZ ; sys_get_fb_mem PUBLIC ?sys_fb_update@@YAXXZ ; sys_fb_update PUBLIC ?sys_fb_move_cursor@@YAXII@Z ; sys_fb_move_cursor EXTRN x64_cli:PROC EXTRN ?svga_update@@YAXIIII@Z:PROC ; svga_update EXTRN ?svga_get_fb_mem@@YAPEAIXZ:PROC ; svga_get_fb_mem EXTRN ?hw_move_cursor@@YAXPEAIII@Z:PROC ; hw_move_cursor EXTRN ?get_screen_width@@YAIXZ:PROC ; get_screen_width EXTRN ?get_screen_height@@YAIXZ:PROC ; get_screen_height pdata SEGMENT $pdata$?sys_get_fb_mem@@YAPEAIXZ DD imagerel $LN3 DD imagerel $LN3+19 DD imagerel $unwind$?sys_get_fb_mem@@YAPEAIXZ $pdata$?sys_fb_update@@YAXXZ DD imagerel $LN3 DD imagerel $LN3+47 DD imagerel $unwind$?sys_fb_update@@YAXXZ $pdata$?sys_fb_move_cursor@@YAXII@Z DD imagerel $LN3 DD imagerel $LN3+38 DD imagerel $unwind$?sys_fb_move_cursor@@YAXII@Z pdata ENDS xdata SEGMENT $unwind$?sys_get_fb_mem@@YAPEAIXZ DD 010401H DD 04204H $unwind$?sys_fb_update@@YAXXZ DD 010401H DD 06204H $unwind$?sys_fb_move_cursor@@YAXII@Z DD 010c01H DD 0420cH xdata ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\sysserv\sysfb.cpp _TEXT SEGMENT x$ = 48 y$ = 56 ?sys_fb_move_cursor@@YAXII@Z PROC ; sys_fb_move_cursor ; 31 : void sys_fb_move_cursor (uint32_t x, uint32_t y) { $LN3: mov DWORD PTR [rsp+16], edx mov DWORD PTR [rsp+8], ecx sub rsp, 40 ; 00000028H ; 32 : x64_cli(); call x64_cli ; 33 : hw_move_cursor (NULL, x, y); mov r8d, DWORD PTR y$[rsp] mov edx, DWORD PTR x$[rsp] xor ecx, ecx call ?hw_move_cursor@@YAXPEAIII@Z ; hw_move_cursor ; 34 : } add rsp, 40 ; 00000028H ret 0 ?sys_fb_move_cursor@@YAXII@Z ENDP ; sys_fb_move_cursor _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\sysserv\sysfb.cpp _TEXT SEGMENT tv64 = 32 ?sys_fb_update@@YAXXZ PROC ; sys_fb_update ; 26 : void sys_fb_update () { $LN3: sub rsp, 56 ; 00000038H ; 27 : x64_cli(); call x64_cli ; 28 : svga_update (0,0,get_screen_width(),get_screen_height()); call ?get_screen_height@@YAIXZ ; get_screen_height mov DWORD PTR tv64[rsp], eax call ?get_screen_width@@YAIXZ ; get_screen_width mov ecx, DWORD PTR tv64[rsp] mov r9d, ecx mov r8d, eax xor edx, edx xor ecx, ecx call ?svga_update@@YAXIIII@Z ; svga_update ; 29 : } add rsp, 56 ; 00000038H ret 0 ?sys_fb_update@@YAXXZ ENDP ; sys_fb_update _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\sysserv\sysfb.cpp _TEXT SEGMENT ?sys_get_fb_mem@@YAPEAIXZ PROC ; sys_get_fb_mem ; 20 : uint32_t* sys_get_fb_mem () { $LN3: sub rsp, 40 ; 00000028H ; 21 : x64_cli(); call x64_cli ; 22 : return svga_get_fb_mem(); call ?svga_get_fb_mem@@YAPEAIXZ ; svga_get_fb_mem ; 23 : } add rsp, 40 ; 00000028H ret 0 ?sys_get_fb_mem@@YAPEAIXZ ENDP ; sys_get_fb_mem _TEXT ENDS END
Tareas/Ensamblador/tasm/BIN/proof.asm
TEC-2014092195/IC3101-Arquitectura_De_Computadores
0
18360
<gh_stars>0 datos segment mensaje db "VIRUS",10,13,"$" ;Para imprimir $ pongo el ascii 24h tablahex db "ABCDEF" var2 db ? tua db "Tuanis",10,13,"$" FIL DB 20 COL DB 50 DIR DB 4 ASTERIX DB '*',0AH ; Fondo negro y asterisco verde CLARO PAUSA1 dw 1000 PAUSA2 dw 1000 ; En total hace de pausa 10000x2000=20 000 000 de nops datos EndS codigo Segment Enigma Macro Param, Num mov cx,Num Param: push cx xor dx,dx mov dx,offset tua mov ah,09h int 21h pop cx loop Param EndM comienceaqui: Assume cs:codigo, ds:datos xor ax,ax mov ax,Datos mov Ds,Ax xor dx, dx mov dx,offset mensaje mov ah,09h int 21h ;mov ah,01h ;int 21h ;mov var2,al mov dl,var2 mov ah,09h int 21h Enigma A,11h mov ax,4c00h int 21h codigo EndS End comienceaqui
libsrc/_DEVELOPMENT/arch/zx/misc/c/sdcc_iy/zx_scroll_up.asm
jpoikela/z88dk
640
88884
<filename>libsrc/_DEVELOPMENT/arch/zx/misc/c/sdcc_iy/zx_scroll_up.asm ; void zx_scroll_up(uchar rows, uchar attr) SECTION code_clib SECTION code_arch PUBLIC _zx_scroll_up EXTERN asm0_zx_scroll_up _zx_scroll_up: pop af pop de push de push af ld l,d ld d,0 jp asm0_zx_scroll_up
sorting-algorithms/option1.asm
informramiz/Assembly-Language-Programs
0
27735
<filename>sorting-algorithms/option1.asm OPTION1 PROC ;use al and call appropriate proc PUSH DX PUSH AX START: LEA DX,INPUT_MSG MOV AH,9 INT 21H LEA DI,STRING CALL INPUT LEA SI,STRING MOV AH , 9 LEA DX,BUBBLE_OPTION INT 21H LEA DX,SELECTION_OPTION INT 21H LEA DX,INSERTION_OPTION INT 21H LEA DX,GNUM_OPTION INT 21H LEA DX,MINIMUM_OPTION INT 21H LEA DX,OPTION_INPUT INT 21H MOV AH,1 INT 21H CMP AL,'5' JG INVALID CMP AL,'1' JE ONE CMP AL,'2' JE TWO CMP AL,'3' JE THREE CMP AL,'4' JE FOUR CMP AL,'5' JE FIVE INVALID: LEA DX,INVALID_OPTION MOV AH,9 INT 21H JMP START ONE: CALL BUBBLE_SORT JMP AGAIN1 TWO: CALL SELECT_SORT JMP AGAIN1 THREE: CALL INSERT_SORT JMP AGAIN1 FOUR: CALL GNUM_SORT JMP AGAIN1 FIVE: CALL MINIMUM_ELEMENT_SORT JMP AGAIN1 AGAIN1: LEA DX,OUTPUT_MSG MOV AH,9 INT 21H CALL OUTPUT LEA DX,INPUT_AGAIN MOV AH,9 INT 21H MOV AH,1 INT 21H CMP AL,'1' JE START RETURN2: POP AX POP DX RET OPTION1 ENDP
test/Utils.agda
mchristianl/synthetic-reals
3
850
<filename>test/Utils.agda {-# OPTIONS --cubical --no-import-sorts --prop #-} module Utils where open import Agda.Primitive renaming (_⊔_ to ℓ-max; lsuc to ℓ-suc; lzero to ℓ-zero) open import Function.Base variable ℓ ℓ' ℓ'' : Level module Test where import Algebra.Properties.BooleanAlgebra open import Algebra.Bundles module _ (B : BooleanAlgebra ℓ ℓ') where open BooleanAlgebra B open import Algebra.Definitions _≈_ ∨-complementˡ : LeftInverse ⊤ ¬_ _∨_ ∨-complementˡ = {! comm+invʳ⇒invˡ ∨-comm ∨-complementʳ !} ∨-complement : Inverse ⊤ ¬_ _∨_ ∨-complement = {! ∨-complementˡ , ∨-complementʳ !} ∧-complementˡ : LeftInverse ⊥ ¬_ _∧_ ∧-complementˡ = {! comm+invʳ⇒invˡ ∧-comm ∧-complementʳ !} ∧-complement : Inverse ⊥ ¬_ _∧_ ∧-complement = {! ∧-complementˡ , ∧-complementʳ !} open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) -- open import Cubical.Structures.CommRing -- open import Cubical.Relation.Nullary.Base -- ¬_ -- open import Cubical.Relation.Binary.Base -- open import Cubical.Data.Sum.Base renaming (_⊎_ to infixr 4 _⊎_) open import Cubical.Data.Sigma.Base renaming (_×_ to infixr 4 _×_) -- open import Cubical.Data.Empty renaming (elim to ⊥-elim) -- `⊥` and `elim` -- -- open import Cubical.Structures.Poset -- open import Cubical.Foundations.Function -- open import Function.Base using (_∋_) -- open import Function.Base using (it) -- instance search open import Cubical.Foundations.Prelude open import Cubical.Foundations.Logic -- open import Algebra.Definitions -- open import Cubical.Data.Empty open import Cubical.HITs.PropositionalTruncation import Cubical.Data.Empty as ⊥ open import Cubical.Data.Unit.Base ⊥↑ : ∀{ℓ} → hProp ℓ ⊥↑ = Lift ⊥.⊥ , λ () ⊤↑ : ∀{ℓ} → hProp ℓ ⊤↑ = Lift Unit , isOfHLevelLift 1 (λ _ _ _ → tt) -- _ = {! ⇔toPath!} ⊔-complementˡ : ∀ x → ¬ x ⊔ x ≡ ⊤↑ -- LeftInverse _≡_ ⊤ ¬_ _⊔_ ⊔-complementˡ = {! comm+invʳ⇒invˡ ⊔-comm ⊔-complementʳ !} -- ⊔-complementʳ : ∀ x → x ⊔ ¬ x ≡ ∥ [ ⊤ ] ∥ₚ -- ⊔-complementʳ : ∀(x : hProp ℓ) → x ⊔ ¬ x ≡ ((hProp ℓ) ∋ ⊤) ⊔-complementʳ : ∀(x : hProp ℓ) → x ⊔ ¬ x ≡ ⊤↑ ⊔-complementʳ x = λ i → {! ⊔-comm x (¬ x) i !} ⊔-complement : (∀ x → ¬ x ⊔ x ≡ ⊤↑) × (∀ x → x ⊔ ¬ x ≡ ⊤↑) -- Inverse _≡_ ⊤ ¬_ _⊔_ ⊔-complement = ⊔-complementˡ , {! ⊔-complementʳ !} -- agda deduces -- Σ Type (λ A → (x y : A) → x ≡ y) -- hProp normalizes to -- λ ℓ → Σ (Type ℓ) (λ A → (x y : A) → x ≡ y) -- ⊓-complementˡ : ∀ x → ¬ x ⊓ x ≡ ⊥ -- LeftInverse _≡_ ⊥ ¬_ _⊓_ ⊓-complementˡ = {! isProp!} -- comm+invʳ⇒invˡ ⊓-comm ⊓-complementʳ ⊓-complementʳ : ∀ x → x ⊓ ¬ x ≡ ⊥ ⊓-complementʳ = {!!} ⊓-complement : (∀ x → ¬ x ⊓ x ≡ ⊥) × (∀ x → x ⊓ ¬ x ≡ ⊥) -- Inverse _≡_ ⊥ ¬_ _⊓_ ⊓-complement = ⊓-complementˡ , ⊓-complementʳ ⊓-⊔-distribʳ : (P : hProp ℓ) (Q : hProp ℓ')(R : hProp ℓ'') → (Q ⊔ R) ⊓ P ≡ (Q ⊓ P) ⊔ (R ⊓ P) ⊓-⊔-distribʳ P Q R = ( (Q ⊔ R) ⊓ P ≡⟨ ⊓-comm _ _ ⟩ P ⊓ (Q ⊔ R) ≡⟨ ⊓-⊔-distribˡ P Q R ⟩ (P ⊓ Q) ⊔ (P ⊓ R) ≡⟨ ( λ i → ⊓-comm P Q i ⊔ ⊓-comm P R i) ⟩ (Q ⊓ P) ⊔ (R ⊓ P) ∎) _ : isProp ≡ (λ(A : Type ℓ) → (x y : A) → x ≡ y) _ = refl -- `sq` stands for "squashed" and |_| is the constructor for ∥_∥ -- -- data ∥_∥ {ℓ} (A : Type ℓ) : Type ℓ where -- ∣_∣ : A → ∥ A ∥ -- squash : ∀ (x y : ∥ A ∥) → x ≡ y -- -- (see https://ice1000.org/2018/12-06-CubicalAgda.html#propositional-truncation ) -- we also have -- -- hProp ℓ = Σ[ A ∈ Type ℓ ] (∀( x y : A) → x ≡ y) -- isContr {ℓ} = λ( A : Type ℓ ) → Σ[ x ∈ A ] (∀ y → x ≡ y) -- isProp {ℓ} = λ( A : Type ℓ ) → ∀( x y : A) → x ≡ y -- -- and in `Cubical.Foundations.Id` we have -- -- postulate -- Id : ∀ {ℓ} {A : Set ℓ} → A → A → Set ℓ -- _≡_ : ∀ {ℓ} {A : Type ℓ} → A → A → Type ℓ -- _≡_ = Id -- -- which is imported in `Cubical.Foundations.Everything`, but _≡_ is hidden in favour of the _≡_ from `Agda.Builtin.Cubical.Path`: -- -- _≡_ : ∀ {ℓ} {A : Set ℓ} → A → A → Set ℓ -- _≡_ {A = A} = PathP (λ i → A) -- -- we have conversion functions between `Id` and `PathP` -- recall from https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/HoTT-UF-Agda.html -- -- is-center X c = (x : X) → c ≡ x -- is-singleton X = Σ c ꞉ X , is-center X c -- is-subsingleton X = (x y : X) → x ≡ y -- 𝟘-is-subsingleton : is-subsingleton 𝟘 -- singletons-are-subsingletons : (X : 𝓤 ̇ ) → is-singleton X → is-subsingleton X -- 𝟙-is-subsingleton : is-subsingleton 𝟙 -- -- now, -- see https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/HoTT-UF-Agda.html#axiomatic-approach -- see https://ice1000.org/2018/12-06-CubicalAgda.html#propositional-truncation -- However I would not only use recPropTrunc explicitly as we can just use pattern-matching to define functions out of HITs. -- see https://cstheory.stackexchange.com/questions/30542/squash-type-vs-propositional-truncation-type -- Squash types correspond to judgmental truncation, not propositional truncation. -- In a type theory without a type for judgmental equality, there's non much of a way to make use of an inhabitant of a squash type; -- there's no way to write an eliminator into any type except another squash type. -- Relatedly, having squash types, as presented in the book you linked, makes typechecking undecidable; -- having propositional truncation types does not result in this drawback. -- there is https://github.com/agda/cubical/pull/136 -- Elimination of propositional truncation to higher types import Cubical.Foundations.Id import Cubical.HITs.PropositionalTruncation.Properties -- look here for examples ∥∥-isProp : {A : Type ℓ} → ∀ (x y : ∥ A ∥) → x ≡ y ∥∥-isProp {ℓ = ℓ} {A = A} x y = (squash x y) _ = propTruncIsProp propTruncIsProp' : {A : Type ℓ} → isProp ∥ A ∥ propTruncIsProp' x y = squash x y {- t0 : {A : Type ℓ} → (x y : ∥ A ∥) → x ≡ y -- isProp (∥ A ∥) t0 x ∣ y ∣ = squash x ∣ y ∣ -- Goal: ∥ A ∥ -- ———— Boundary —————————————————————————————————————————————— -- i = i0 ⊢ t0 x y₀ j -- i = i1 ⊢ t0 x y₁ j -- j = i0 ⊢ x -- j = i1 ⊢ squash y₀ y₁ i t0 x (squash y₀ y₁ i) j = {! t0 !} -} {- -- Goal: ∣ x ∣ ≡ ∣ y ∣ t0 ∣ x ∣ ∣ y ∣ = squash ∣ x ∣ ∣ y ∣ -- Goal: ∣ x ∣ ≡ squash y₀ y₁ i -- ———— Boundary —————————————————————————————————————————————— -- i = i0 ⊢ t0 ∣ x ∣ y₀ -- i = i1 ⊢ t0 ∣ x ∣ y₁ t0 ∣ x ∣ (squash y₀ y₁ i) = squash ∣ x ∣ (squash y₀ y₁ i) -- {! squash ∣ x ∣ (squash y₀ y₁ i)!} -- {! λ j → squash ∣ x ∣ (squash y₁ y₂ j) {! !} !} t0 (squash x₁ x₂ i) ∣ y ∣ = squash (squash x₁ x₂ i) ∣ y ∣ t0 (squash x₁ x₂ i) (squash y₁ y₂ j) = squash (squash x₁ x₂ i) (squash y₁ y₂ j) -} -- Definition 2.4.3. The propositional truncation of a type X -- is a proposition ∥ X ∥ -- together with a truncation map |_| : X → ∥ X ∥ -- such that for any other proposition Q, given a map g : X → Q, we obtain a map h : ∥ X ∥ → Q. -- -- Remark 2.4.4. The uniqueness of the obtained map ∥ X ∥ → Q follows from the fact that Q is a proposition, and function extensionality -- -- The propositional truncation ∥ X ∥ of a type X is a proposition. We may say, quite simply, -- that we have a constructor sq which is a proof that the type ∥ X ∥ is a squashed to be a propo- -- sition: it takes two elements of ∥ X ∥ and gives a proof that they are identical, i.e. squashed -- together. -- Definition 2.4.7. -- We refer to types that are propositions as properties. -- We refer to types that potentially have several witnesses as structure. {- module _ {ℓ} (X Y : Type ℓ) (g : X → Y) where f : ∥ X ∥ → Y f ∣ x ∣ = g x f (squash x₀ x₁ i) = {! !} -} -- well, that might not work at all -- ⊓-unliftˡ : {P : hProp ℓ} {Q : hProp ℓ'} import Cubical.HITs.PropositionalTruncation.Properties -- _ : (P : hProp P.ℓ) (Q : hProp Q.ℓ) (R : hProp R.ℓ) → (hProp P.ℓ → hProp Q.ℓ → hProp R.ℓ) → h -- _ = ? --_ = _≡ₚ_ ⊓-identityˡ-↑ : (P : hProp ℓ) → ⊤↑ {ℓ} ⊓ P ≡ P ⊓-identityˡ-↑ _ = ⇔toPath snd λ x → lift tt , x -- \ is \\ -- ↑ is \u private lemma : ∀ x y → x ⊓ y ≡ ⊥ → x ⊔ y ≡ ⊤ → ¬ x ≡ y lemma x y x⊓y=⊥ x⊔y=⊤ = ( ¬ x ≡⟨ sym (⊓-identityʳ _) ⟩ ¬ x ⊓ ⊤ ≡⟨ (λ i → ¬ x ⊓ x⊔y=⊤ (~ i) ) ⟩ ¬ x ⊓ (x ⊔ y) ≡⟨ ⊓-⊔-distribˡ (¬ x) x y ⟩ (¬ x ⊓ x) ⊔ (¬ x ⊓ y) ≡⟨ (λ i → ⊓-complementˡ x i ⊔ (¬ x ⊓ y)) ⟩ ⊥ ⊔ (¬ x ⊓ y) ≡⟨ (λ i → x⊓y=⊥ (~ i) ⊔ (¬ x ⊓ y)) ⟩ (x ⊓ y) ⊔ (¬ x ⊓ y) ≡⟨ sym (⊓-⊔-distribʳ y x (¬ x)) ⟩ (x ⊔ ¬ x) ⊓ y ≡⟨ (λ i → (⊔-complementʳ x) i ⊓ y ) ⟩ ⊤↑ ⊓ y ≡⟨ ⊓-identityˡ-↑ _ ⟩ y ∎) data Prop2Type (P : Prop ℓ) : Type (ℓ-suc ℓ) where inₚ : (p : P) → Prop2Type P Prop-to-hProp : Prop ℓ → hProp (ℓ-suc ℓ) Prop-to-hProp P = Prop2Type P , λ{ (inₚ x) (inₚ y) → refl }
oeis/058/A058309.asm
neoneye/loda-programs
11
92438
<reponame>neoneye/loda-programs ; A058309: a(n) = (n+3)*a(n-1) + a(n-2), with a(0)=0, a(1)=1. ; Submitted by <NAME>(s3) ; 0,1,5,31,222,1807,16485,166657,1849712,22363201,292571325,4118361751,62067997590,997206323191,17014575491837,307259565176257,5854946313840720,117406185841990657,2471384848995644517,54487872863746170031,1255692460715157555230,30191106930027527495551,756033365711403344944005,19687058615426514496039681,532306615982227294738015392,14924272306117790767160470657,433336203493398159542391664445,13015010377108062577038910404007,403898657893843338047748614188662,12937772062980094880104994564441191 mov $2,4 lpb $0 sub $0,1 add $3,$2 mov $2,$1 mul $1,4 add $1,$3 mov $3,$1 mul $3,$0 lpe mov $0,$1 div $0,4
src/nso-types.adb
SSOCsoft/Log_Reporter
0
22338
<filename>src/nso-types.adb With Ada.Unchecked_Conversion, Ada.IO_Exceptions; Package Body NSO.Types is Use Ada.Streams; ------------------- -- INITALIZERS -- ------------------- Function From_String( Text : String ) return String_Stream with Inline, Pure_Function; Function Buffer ( Length : Natural ) return String_Stream with Inline, Pure_Function; -------------- -- R E A D -- -------------- Procedure Read (Stream : in out String_Stream; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) is Use Ada.IO_Exceptions, Ada.Streams; Begin -- When there is a read of zero, do nothing. -- When there is a read beyond the buffer's bounds, raise an exception. -- Note: I've used two cases here- -- 1) when the read is greater than the buffer, -- 2) when the read would go beyond the buffer. -- Finally, read the given amount of data and update the position. if Item'Length = 0 then null; elsif Item'Length > Stream.Data'Length then Raise End_Error with "Request is larger than the buffer's size."; elsif Stream_Element_Offset'Pred(Stream.Position)+Item'Length > Stream.Data'Length then Raise End_Error with "Buffer will over-read."; else Declare Subtype Selection is Stream_Element_Offset range Stream.Position..Stream.Position+Stream_Element_Offset'Pred(Item'Length); Begin Item(Item'Range):= Stream.Data(Selection); Stream.Position:= Stream_Element_Offset'Succ(Selection'Last); Last:= Selection'Last;--Stream.Position; End; end if; End Read; ----------------- -- W R I T E -- ----------------- Procedure Write (Stream : in out String_Stream; Item : Ada.Streams.Stream_Element_Array) is Begin Declare Subtype Selection is Stream_Element_Offset range Stream.Position..Stream.Position+Stream_Element_Offset'Pred(Item'Length); Begin Stream.Data(Selection):= Item(Item'Range); Stream.Position:= Stream_Element_Offset'Succ(Selection'Last); End; End Write; ---------------------------------- -- INITALIZER IMPLEMENTATIONS -- ---------------------------------- -- Create a buffer of the given length, zero-filled. Function Buffer( Length : Natural ) return String_Stream is Len : Constant Ada.Streams.Stream_Element_Offset := Ada.Streams.Stream_Element_Offset(Length); Begin Return Result : Constant String_Stream:= (Root_Stream_Type with Position => 1, Data => (1..Len => 0), Length => Len ); End Buffer; -- Create a buffer from the given string. Function From_String( Text : String ) return String_Stream is Use Ada.Streams; Subtype Element_Range is Stream_Element_Offset range Stream_Element_Offset(Text'First)..Stream_Element_Offset(Text'Last); Subtype Constrained_Array is Stream_Element_Array(Element_Range); Subtype Constrained_String is String(Text'Range); Function Convert is new Ada.Unchecked_Conversion( Source => Constrained_String, Target => Constrained_Array ); Begin Return Result : Constant String_Stream:= (Root_Stream_Type with Position => Element_Range'First, Data => Convert( Text ), Length => Text'Length ); End From_String; -- Classwide returning renames, for consistancy/overload. Function To_Stream( Text : String ) return Root_Stream_Class is ( From_String(Text) ) with Inline, Pure_Function; Function To_Stream( Length : Natural ) return Root_Stream_Class is ( Buffer(Length) ) with Inline, Pure_Function; ---------------------------- -- CONVERSION OPERATORS -- ---------------------------- -- Allocating / access-returning initalizing operations. Function "+"( Length : Natural ) return not null access Root_Stream_Class is ( New Root_Stream_Class'(To_Stream(Length)) ); Function "+"( Text : String ) return not null access Root_Stream_Class is ( New Root_Stream_Class'(To_Stream(Text)) ); -- Conversion from text or integer to a stream; renaming of the initalizers. Function "+"( Text : String ) return String_Stream renames From_String; Function "+"( Length : Natural ) return String_Stream renames Buffer; -- Convert a given Stream_Element_Array to a String. Function "-"( Data : Ada.Streams.Stream_Element_Array ) Return String is Subtype Element_Range is Natural range Natural(Data'First)..Natural(Data'Last); Subtype Constrained_Array is Stream_Element_Array(Data'Range); Subtype Constrained_String is String(Element_Range); Function Convert is new Ada.Unchecked_Conversion( Source => Constrained_Array, Target => Constrained_String ); Begin Return Convert( Data ); End "-"; ---------------------- -- DATA RETRIEVAL -- ---------------------- Function "-"( Stream : String_Stream ) return String is Begin Return -Stream.Data(Stream.Position..Stream.Length); End "-"; Function Data(Stream : String_Stream ) return String is Begin Return -Stream.Data; End Data; End NSO.Types;
alloy4fun_models/trainstlt/models/3/j2HEH2W6uYZvb7FM7.als
Kaixi26/org.alloytools.alloy
0
3595
<reponame>Kaixi26/org.alloytools.alloy open main pred idj2HEH2W6uYZvb7FM7_prop4 { always one pos.Track } pred __repair { idj2HEH2W6uYZvb7FM7_prop4 } check __repair { idj2HEH2W6uYZvb7FM7_prop4 <=> prop4o }
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/requeue_statement_2.adb
ouankou/rose
488
7616
-- This code is for compiler front end testing only. It does nothing at run time. procedure Requeue_Statement_2 is protected Protected_1 is entry Entry_1; entry Entry_2; private Barrier_Open : Boolean := False; end Protected_1; protected body Protected_1 is entry Entry_1 when Barrier_Open is begin requeue Entry_1; end Entry_1; entry Entry_2 when Barrier_Open is begin requeue Entry_2 with abort; end Entry_2; end Protected_1; begin null; end Requeue_Statement_2; --------------------------------------------------------------
src/main/fragment/mos6502-common/vdum1=vduc1_plus_vdum2.asm
jbrandwood/kickc
2
16995
<gh_stars>1-10 clc lda {m2} adc #<{c1} sta {m1} lda {m2}+1 adc #>{c1} sta {m1}+1 lda {m2}+2 adc #<{c1}>>$10 sta {m1}+2 lda {m2}+3 adc #>{c1}>>$10 sta {m1}+3
Cubical/Algebra/Group/Instances/DiffInt.agda
FernandoLarrain/cubical
301
12337
<filename>Cubical/Algebra/Group/Instances/DiffInt.agda<gh_stars>100-1000 {-# OPTIONS --safe #-} module Cubical.Algebra.Group.Instances.DiffInt where open import Cubical.HITs.SetQuotients open import Cubical.Foundations.Prelude open import Cubical.Data.Int.MoreInts.DiffInt renaming (ℤ to ℤType ; _+_ to _+ℤ_ ; _-_ to _-ℤ_) open import Cubical.Algebra.Group.Base open import Cubical.Algebra.Semigroup.Base open import Cubical.Algebra.Monoid.Base open GroupStr ℤ-isGroup : IsGroup {G = ℤType} ([ 0 , 0 ]) (_+ℤ_) (-ℤ_) IsSemigroup.is-set (IsMonoid.isSemigroup (IsGroup.isMonoid ℤ-isGroup)) = ℤ-isSet IsSemigroup.assoc (IsMonoid.isSemigroup (IsGroup.isMonoid ℤ-isGroup)) = +ℤ-assoc IsMonoid.identity (IsGroup.isMonoid ℤ-isGroup) = λ x → (zero-identityʳ 0 x , zero-identityˡ 0 x) IsGroup.inverse ℤ-isGroup = λ x → (-ℤ-invʳ x , -ℤ-invˡ x) ℤ : Group₀ fst ℤ = ℤType 1g (snd ℤ) = [ 0 , 0 ] _·_ (snd ℤ) = _+ℤ_ inv (snd ℤ) = -ℤ_ isGroup (snd ℤ) = ℤ-isGroup
reuse/ada/sort.ads
cocolab8/cocktail
0
26209
-- $Id: Sort.md,v 1.0 1992/08/07 14:42:01 grosch rel $ -- $Log: Sort.md,v $ -- Ich, <NAME>, Informatiker, Aug. 1994 generic with function IsLess (X, Y: Integer) return Boolean; with procedure Swap (X, Y: Integer); package Sort is procedure QuickSort (Lwb, Upb: Integer); -- Sort data from the indices 'Lwb' to 'Upb' using quicksort. end Sort;
solutions/10 - Emergency Escapades/size-23_speed-21.asm
michaelgundlach/7billionhumans
45
10761
-- 7 Billion Humans (2053) -- -- 10: Emergency Escapades -- -- Author: ansvonwa -- Size: 23 -- Speed: 21 a: if w != hole: step w jump a endif if ne != hole or se != hole: if ne != hole: if nw == hole: step n endif step nw else: step sw endif step w endif step s step s step sw step w step w step w step nw step n step n step nw b: step n jump b
intel-avx2/matmul/asm/matmul_auto.asm
yanyh15/vectorization-examples
0
177871
# mark_description "Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.0.166 Build 20191121"; # mark_description "-o asm/matmul_auto.asm -O2 -xCORE_AVX2 -S -masm=intel"; .intel_syntax noprefix .file "matmul.c" .text ..TXTST0: .L_2__routine_start_main_0: # -- Begin main .text # mark_begin; .align 16,0x90 .globl main # --- main(int, char **) main: # parameter 1: edi # parameter 2: rsi ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] .cfi_startproc ..___tag_value_main.1: ..L2: #47.34 push rbp #47.34 .cfi_def_cfa_offset 16 mov rbp, rsp #47.34 .cfi_def_cfa 6, 16 .cfi_offset 6, -16 and rsp, -128 #47.34 push r12 #47.34 push r13 #47.34 push r14 #47.34 push r15 #47.34 push rbx #47.34 sub rsp, 88 #47.34 mov edi, 3 #47.34 mov esi, 10330110 #47.34 call __intel_new_feature_proc_init #47.34 .cfi_escape 0x10, 0x03, 0x0e, 0x38, 0x1c, 0x0d, 0x80, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0xd8, 0xff, 0xff, 0xff, 0x22 .cfi_escape 0x10, 0x0c, 0x0e, 0x38, 0x1c, 0x0d, 0x80, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0xf8, 0xff, 0xff, 0xff, 0x22 .cfi_escape 0x10, 0x0d, 0x0e, 0x38, 0x1c, 0x0d, 0x80, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0xf0, 0xff, 0xff, 0xff, 0x22 .cfi_escape 0x10, 0x0e, 0x0e, 0x38, 0x1c, 0x0d, 0x80, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0xe8, 0xff, 0xff, 0xff, 0x22 .cfi_escape 0x10, 0x0f, 0x0e, 0x38, 0x1c, 0x0d, 0x80, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0xe0, 0xff, 0xff, 0xff, 0x22 # LOE r12 r13 ..B1.36: # Preds ..B1.1 # Execution count [1.00e+00] vstmxcsr DWORD PTR [rsp] #47.34 mov edi, 1048576 #48.16 or DWORD PTR [rsp], 32832 #47.34 vldmxcsr DWORD PTR [rsp] #47.34 # malloc(size_t) call malloc #48.16 # LOE rax r12 r13 ..B1.35: # Preds ..B1.36 # Execution count [1.00e+00] mov r14, rax #48.16 # LOE r12 r13 r14 ..B1.2: # Preds ..B1.35 # Execution count [1.00e+00] mov edi, 1048576 #49.16 # malloc(size_t) call malloc #49.16 # LOE rax r12 r13 r14 ..B1.37: # Preds ..B1.2 # Execution count [1.00e+00] mov r15, rax #49.16 # LOE r12 r13 r14 r15 ..B1.3: # Preds ..B1.37 # Execution count [1.00e+00] mov edi, 1048576 #51.23 # malloc(size_t) call malloc #51.23 # LOE rax r12 r13 r14 r15 ..B1.38: # Preds ..B1.3 # Execution count [1.00e+00] mov rbx, rax #51.23 # LOE rbx r12 r13 r14 r15 ..B1.4: # Preds ..B1.38 # Execution count [1.00e+00] xor edi, edi #53.11 # time(time_t *) call time #53.11 # LOE rax rbx r12 r13 r14 r15 ..B1.5: # Preds ..B1.4 # Execution count [1.00e+00] mov edi, eax #53.5 # srand(unsigned int) call srand #53.5 # LOE rbx r12 r13 r14 r15 ..B1.6: # Preds ..B1.5 # Execution count [1.00e+00] xor edx, edx #54.5 xor eax, eax #54.5 mov r13d, edx #54.5 mov QWORD PTR [16+rsp], rbx #54.5[spill] mov rbx, rax #54.5 mov QWORD PTR [rsp], r15 #54.5[spill] # LOE rbx r14 r13d ..B1.7: # Preds ..B1.10 ..B1.6 # Execution count [5.12e+02] xor r15d, r15d #54.5 lea r12, QWORD PTR [r14+rbx*4] #54.5 # LOE rbx r12 r14 r15 r13d ..B1.8: # Preds ..B1.9 ..B1.7 # Execution count [2.62e+05] # rand(void) call rand #54.5 # LOE rbx r12 r14 r15 eax r13d ..B1.9: # Preds ..B1.8 # Execution count [2.62e+05] vxorps xmm0, xmm0, xmm0 #54.5 vcvtsi2ss xmm0, xmm0, eax #54.5 vdivss xmm1, xmm0, DWORD PTR .L_2il0floatpacket.0[rip] #54.5 vmovss DWORD PTR [r12+r15*4], xmm1 #54.5 inc r15 #54.5 cmp r15, 512 #54.5 jl ..B1.8 # Prob 99% #54.5 # LOE rbx r12 r14 r15 r13d ..B1.10: # Preds ..B1.9 # Execution count [5.12e+02] inc r13d #54.5 add rbx, 512 #54.5 cmp r13d, 512 #54.5 jl ..B1.7 # Prob 99% #54.5 # LOE rbx r14 r13d ..B1.11: # Preds ..B1.10 # Execution count [1.00e+00] xor edx, edx #55.5 xor eax, eax #55.5 mov r13d, edx #55.5 mov r15, QWORD PTR [rsp] #[spill] mov rbx, rax #55.5 mov QWORD PTR [24+rsp], r14 #55.5[spill] # LOE rbx r15 r13d ..B1.12: # Preds ..B1.15 ..B1.11 # Execution count [5.12e+02] xor r14d, r14d #55.5 lea r12, QWORD PTR [r15+rbx*4] #55.5 # LOE rbx r12 r14 r15 r13d ..B1.13: # Preds ..B1.14 ..B1.12 # Execution count [2.62e+05] # rand(void) call rand #55.5 # LOE rbx r12 r14 r15 eax r13d ..B1.14: # Preds ..B1.13 # Execution count [2.62e+05] vxorps xmm0, xmm0, xmm0 #55.5 vcvtsi2ss xmm0, xmm0, eax #55.5 vdivss xmm1, xmm0, DWORD PTR .L_2il0floatpacket.0[rip] #55.5 vmovss DWORD PTR [r12+r14*4], xmm1 #55.5 inc r14 #55.5 cmp r14, 512 #55.5 jl ..B1.13 # Prob 99% #55.5 # LOE rbx r12 r14 r15 r13d ..B1.15: # Preds ..B1.14 # Execution count [5.12e+02] inc r13d #55.5 add rbx, 512 #55.5 cmp r13d, 512 #55.5 jl ..B1.12 # Prob 99% #55.5 # LOE rbx r15 r13d ..B1.16: # Preds ..B1.15 # Execution count [1.00e+00] mov rbx, QWORD PTR [16+rsp] #[spill] lea rdi, QWORD PTR [rsp] #60.22 mov r14, QWORD PTR [24+rdi] #[spill] ..___tag_value_main.16: # ftime(struct timeb *) call ftime #60.22 ..___tag_value_main.17: # LOE rbx r12 r13 r14 r15 ..B1.17: # Preds ..B1.16 # Execution count [9.00e-01] vxorpd xmm0, xmm0, xmm0 #60.22 vxorpd xmm1, xmm1, xmm1 #60.22 movzx eax, WORD PTR [8+rsp] #60.22 xor r11b, r11b #61.10 vcvtsi2sd xmm0, xmm0, eax #60.22 vcvtsi2sd xmm1, xmm1, QWORD PTR [rsp] #60.22 vdivsd xmm2, xmm0, QWORD PTR .L_2il0floatpacket.1[rip] #60.22 xor eax, eax #61.10 vaddsd xmm3, xmm1, xmm2 #60.22 vmovsd QWORD PTR [40+rsp], xmm3 #60.22[spill] # LOE rbx r12 r14 r15 eax r11b ..B1.18: # Preds ..B1.24 ..B1.17 # Execution count [5.00e+00] mov r8d, eax #62.6 xor esi, esi #62.6 # LOE rbx rsi r12 r14 r15 eax r8d r11b ..B1.19: # Preds ..B1.23 ..B1.18 # Execution count [2.56e+03] xor ecx, ecx #62.6 lea r10, QWORD PTR [r14+rsi*4] #62.6 lea rdi, QWORD PTR [rbx+rsi*4] #62.6 # LOE rcx rbx rsi rdi r10 r12 r14 r15 eax r8d r11b ..B1.20: # Preds ..B1.22 ..B1.19 # Execution count [1.31e+06] mov DWORD PTR [48+rsp], eax #62.6 xor r9d, r9d #62.6 lea rdx, QWORD PTR [r15+rcx*4] #62.6 # LOE rdx rcx rbx rsi rdi r9 r10 r12 r14 r15 eax r8d r11b ..B1.21: # Preds ..B1.21 ..B1.20 # Execution count [6.71e+08] mov r13d, r9d #62.6 shl r13d, 9 #62.6 vmovss xmm0, DWORD PTR [48+rsp] #62.6 vmovss xmm1, DWORD PTR [r10+r9*4] #62.6 inc r9 #62.6 vfmadd132ss xmm1, xmm0, DWORD PTR [rdx+r13*4] #62.6 vmovss DWORD PTR [48+rsp], xmm1 #62.6 cmp r9, 512 #62.6 jl ..B1.21 # Prob 99% #62.6 # LOE rdx rcx rbx rsi rdi r9 r10 r12 r14 r15 eax r8d r11b ..B1.22: # Preds ..B1.21 # Execution count [1.31e+06] mov edx, DWORD PTR [48+rsp] #62.6 mov DWORD PTR [rdi+rcx*4], edx #62.6 inc rcx #62.6 cmp rcx, 512 #62.6 jl ..B1.20 # Prob 99% #62.6 # LOE rcx rbx rsi rdi r10 r12 r14 r15 eax r8d r11b ..B1.23: # Preds ..B1.22 # Execution count [2.56e+03] inc r8d #62.6 add rsi, 512 #62.6 cmp r8d, 512 #62.6 jl ..B1.19 # Prob 99% #62.6 # LOE rbx rsi r12 r14 r15 eax r8d r11b ..B1.24: # Preds ..B1.23 # Execution count [5.00e+00] inc r11b #61.27 cmp r11b, 10 #61.17 jl ..B1.18 # Prob 82% #61.17 # LOE rbx r12 r14 r15 eax r11b ..B1.25: # Preds ..B1.24 # Execution count [1.00e+00] lea rdi, QWORD PTR [16+rsp] #64.16 ..___tag_value_main.20: # ftime(struct timeb *) call ftime #64.16 ..___tag_value_main.21: # LOE r12 r13 ..B1.26: # Preds ..B1.25 # Execution count [1.00e+00] vxorpd xmm0, xmm0, xmm0 #64.16 vxorpd xmm1, xmm1, xmm1 #64.16 movzx eax, WORD PTR [24+rsp] #64.16 mov edi, offset flat: il0_peep_printf_format_0 #69.5 vcvtsi2sd xmm0, xmm0, eax #64.16 vcvtsi2sd xmm1, xmm1, QWORD PTR [16+rsp] #64.16 vdivsd xmm2, xmm0, QWORD PTR .L_2il0floatpacket.1[rip] #64.16 vaddsd xmm3, xmm1, xmm2 #64.16 vsubsd xmm4, xmm3, QWORD PTR [40+rsp] #64.31[spill] vmovsd QWORD PTR [32+rsp], xmm4 #64.31[spill] call puts #69.5 # LOE r12 r13 ..B1.27: # Preds ..B1.26 # Execution count [1.00e+00] mov edi, offset flat: .L_2__STRING.1 #70.5 mov esi, 512 #70.5 xor eax, eax #70.5 ..___tag_value_main.24: # printf(const char *__restrict__, ...) call printf #70.5 ..___tag_value_main.25: # LOE r12 r13 ..B1.28: # Preds ..B1.27 # Execution count [1.00e+00] mov edi, offset flat: il0_peep_printf_format_1 #71.5 call puts #71.5 # LOE r12 r13 ..B1.29: # Preds ..B1.28 # Execution count [1.00e+00] mov edi, offset flat: il0_peep_printf_format_2 #72.5 call puts #72.5 # LOE r12 r13 ..B1.30: # Preds ..B1.29 # Execution count [1.00e+00] mov edi, offset flat: il0_peep_printf_format_3 #73.5 call puts #73.5 # LOE r12 r13 ..B1.31: # Preds ..B1.30 # Execution count [1.00e+00] vmovsd xmm0, QWORD PTR [32+rsp] #74.5[spill] mov edi, offset flat: .L_2__STRING.4 #74.5 vmulsd xmm2, xmm0, QWORD PTR .L_2il0floatpacket.3[rip] #74.5 mov eax, 2 #74.5 vmovsd xmm1, QWORD PTR .L_2il0floatpacket.2[rip] #74.5 vdivsd xmm1, xmm1, xmm2 #74.5 ..___tag_value_main.27: # printf(const char *__restrict__, ...) call printf #74.5 ..___tag_value_main.28: # LOE r12 r13 ..B1.32: # Preds ..B1.31 # Execution count [1.00e+00] xor eax, eax #76.12 add rsp, 88 #76.12 .cfi_restore 3 pop rbx #76.12 .cfi_restore 15 pop r15 #76.12 .cfi_restore 14 pop r14 #76.12 .cfi_restore 13 pop r13 #76.12 .cfi_restore 12 pop r12 #76.12 mov rsp, rbp #76.12 pop rbp #76.12 .cfi_def_cfa 7, 8 .cfi_restore 6 ret #76.12 .align 16,0x90 # LOE .cfi_endproc # mark_end; .type main,@function .size main,.-main ..LNmain.0: .section .rodata.str1.4, "aMS",@progbits,1 .align 4 .align 4 il0_peep_printf_format_2: .long 1718773072 .long 1634562671 .long 979723118 .long 1968310537 .long 1835627630 .long 1932009573 .long 1193281833 .long 1347374150 .word 83 .section .rodata.str1.32, "aMS",@progbits,1 .align 32 .align 32 il0_peep_printf_format_0: .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .long 1027423549 .word 15677 .byte 0 .space 25, 0x00 # pad .align 32 il0_peep_printf_format_1: .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .word 11565 .byte 0 .space 25, 0x00 # pad .align 32 il0_peep_printf_format_3: .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .long 757935405 .word 11565 .byte 0 .data # -- End main .text .L_2__routine_start_read_timer_1: # -- Begin read_timer .text # mark_begin; .align 16,0x90 .globl read_timer # --- read_timer() read_timer: ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] .cfi_startproc ..___tag_value_read_timer.37: ..L38: #16.21 sub rsp, 24 #16.21 .cfi_def_cfa_offset 32 lea rdi, QWORD PTR [rsp] #18.5 ..___tag_value_read_timer.40: # ftime(struct timeb *) call ftime #18.5 ..___tag_value_read_timer.41: # LOE rbx rbp r12 r13 r14 r15 ..B2.2: # Preds ..B2.1 # Execution count [1.00e+00] vxorpd xmm0, xmm0, xmm0 #19.40 vxorpd xmm1, xmm1, xmm1 #19.21 movzx eax, WORD PTR [8+rsp] #19.40 vcvtsi2sd xmm0, xmm0, eax #19.40 vcvtsi2sd xmm1, xmm1, QWORD PTR [rsp] #19.21 vdivsd xmm2, xmm0, QWORD PTR .L_2il0floatpacket.1[rip] #19.53 vaddsd xmm0, xmm1, xmm2 #19.53 add rsp, 24 #19.53 .cfi_def_cfa_offset 8 ret #19.53 .align 16,0x90 # LOE .cfi_endproc # mark_end; .type read_timer,@function .size read_timer,.-read_timer ..LNread_timer.1: .data # -- End read_timer .text .L_2__routine_start_matmul_serial_2: # -- Begin matmul_serial .text # mark_begin; .align 16,0x90 .globl matmul_serial # --- matmul_serial(float *, float *, float *) matmul_serial: # parameter 1: rdi # parameter 2: rsi # parameter 3: rdx ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] .cfi_startproc ..___tag_value_matmul_serial.44: ..L45: #31.50 push r15 #31.50 .cfi_def_cfa_offset 16 .cfi_offset 15, -16 push rbx #31.50 .cfi_def_cfa_offset 24 .cfi_offset 3, -24 push rbp #31.50 .cfi_def_cfa_offset 32 .cfi_offset 6, -32 mov r8, rdx #31.50 xor edx, edx #36.10 xor eax, eax #36.14 xor ecx, ecx #36.10 # LOE rax rsi rdi r8 r12 r13 r14 edx ecx ..B3.2: # Preds ..B3.6 ..B3.1 # Execution count [5.12e+02] xor ebp, ebp #37.14 lea r11, QWORD PTR [rdi+rax*4] #40.26 lea r9, QWORD PTR [r8+rax*4] #42.13 # LOE rax rbp rsi rdi r8 r9 r11 r12 r13 r14 edx ecx ..B3.3: # Preds ..B3.5 ..B3.2 # Execution count [2.62e+05] mov DWORD PTR [-16+rsp], edx #38.13 xor r10d, r10d #39.18 lea rbx, QWORD PTR [rsi+rbp*4] #40.41 # LOE rax rbx rbp rsi rdi r8 r9 r10 r11 r12 r13 r14 edx ecx ..B3.4: # Preds ..B3.4 ..B3.3 # Execution count [1.34e+08] mov r15d, r10d #40.17 shl r15d, 9 #40.47 vmovss xmm0, DWORD PTR [-16+rsp] #40.17 vmovss xmm1, DWORD PTR [r11+r10*4] #40.26 inc r10 #39.32 vfmadd132ss xmm1, xmm0, DWORD PTR [rbx+r15*4] #40.17 vmovss DWORD PTR [-16+rsp], xmm1 #40.17 cmp r10, 512 #39.29 jl ..B3.4 # Prob 99% #39.29 # LOE rax rbx rbp rsi rdi r8 r9 r10 r11 r12 r13 r14 edx ecx ..B3.5: # Preds ..B3.4 # Execution count [2.62e+05] mov ebx, DWORD PTR [-16+rsp] #42.28 mov DWORD PTR [r9+rbp*4], ebx #42.13 inc rbp #37.28 cmp rbp, 512 #37.25 jl ..B3.3 # Prob 99% #37.25 # LOE rax rbp rsi rdi r8 r9 r11 r12 r13 r14 edx ecx ..B3.6: # Preds ..B3.5 # Execution count [5.12e+02] inc ecx #36.24 add rax, 512 #36.24 cmp ecx, 512 #36.21 jl ..B3.2 # Prob 99% #36.21 # LOE rax rsi rdi r8 r12 r13 r14 edx ecx ..B3.7: # Preds ..B3.6 # Execution count [1.00e+00] .cfi_restore 6 pop rbp #45.1 .cfi_def_cfa_offset 24 .cfi_restore 3 pop rbx #45.1 .cfi_def_cfa_offset 16 .cfi_restore 15 pop r15 #45.1 .cfi_def_cfa_offset 8 ret #45.1 .align 16,0x90 # LOE .cfi_endproc # mark_end; .type matmul_serial,@function .size matmul_serial,.-matmul_serial ..LNmatmul_serial.2: .data # -- End matmul_serial .text .L_2__routine_start_init_3: # -- Begin init .text # mark_begin; .align 16,0x90 .globl init # --- init(float *) init: # parameter 1: rdi ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] .cfi_startproc ..___tag_value_init.59: ..L60: #22.21 push r13 #22.21 .cfi_def_cfa_offset 16 .cfi_offset 13, -16 push r14 #22.21 .cfi_def_cfa_offset 24 .cfi_offset 14, -24 push r15 #22.21 .cfi_def_cfa_offset 32 .cfi_offset 15, -32 push rbx #22.21 .cfi_def_cfa_offset 40 .cfi_offset 3, -40 push rbp #22.21 .cfi_def_cfa_offset 48 .cfi_offset 6, -48 xor edx, edx #24.10 xor eax, eax #24.14 mov ebp, edx #24.14 mov rbx, rax #24.14 mov r14, rdi #24.14 # LOE rbx r12 r14 ebp ..B4.2: # Preds ..B4.5 ..B4.1 # Execution count [5.12e+02] xor r15d, r15d #25.14 lea r13, QWORD PTR [r14+rbx*4] #26.13 # LOE rbx r12 r13 r14 r15 ebp ..B4.3: # Preds ..B4.4 ..B4.2 # Execution count [2.62e+05] # rand(void) call rand #26.31 # LOE rbx r12 r13 r14 r15 eax ebp ..B4.4: # Preds ..B4.3 # Execution count [2.62e+05] vxorps xmm0, xmm0, xmm0 #26.31 vcvtsi2ss xmm0, xmm0, eax #26.31 vdivss xmm1, xmm0, DWORD PTR .L_2il0floatpacket.0[rip] #26.38 vmovss DWORD PTR [r13+r15*4], xmm1 #26.13 inc r15 #25.28 cmp r15, 512 #25.25 jl ..B4.3 # Prob 99% #25.25 # LOE rbx r12 r13 r14 r15 ebp ..B4.5: # Preds ..B4.4 # Execution count [5.12e+02] inc ebp #24.24 add rbx, 512 #24.24 cmp ebp, 512 #24.21 jl ..B4.2 # Prob 99% #24.21 # LOE rbx r12 r14 ebp ..B4.6: # Preds ..B4.5 # Execution count [1.00e+00] .cfi_restore 6 pop rbp #29.1 .cfi_def_cfa_offset 40 .cfi_restore 3 pop rbx #29.1 .cfi_def_cfa_offset 32 .cfi_restore 15 pop r15 #29.1 .cfi_def_cfa_offset 24 .cfi_restore 14 pop r14 #29.1 .cfi_def_cfa_offset 16 .cfi_restore 13 pop r13 #29.1 .cfi_def_cfa_offset 8 ret #29.1 .align 16,0x90 # LOE .cfi_endproc # mark_end; .type init,@function .size init,.-init ..LNinit.3: .data # -- End init .section .rodata, "a" .align 8 .align 8 .L_2il0floatpacket.1: .long 0x00000000,0x408f4000 .type .L_2il0floatpacket.1,@object .size .L_2il0floatpacket.1,8 .align 8 .L_2il0floatpacket.2: .long 0x00000000,0x41e40000 .type .L_2il0floatpacket.2,@object .size .L_2il0floatpacket.2,8 .align 8 .L_2il0floatpacket.3: .long 0x00000000,0x41cdcd65 .type .L_2il0floatpacket.3,@object .size .L_2il0floatpacket.3,8 .align 4 .L_2il0floatpacket.0: .long 0x4d4ccccd .type .L_2il0floatpacket.0,@object .size .L_2il0floatpacket.0,4 .section .rodata.str1.4, "aMS",@progbits,1 .space 2, 0x00 # pad .align 4 .L_2__STRING.1: .long 1952533769 .long 544762226 .long 1953264973 .long 1768714345 .long 1769234787 .long 540700271 .long 1565416257 .long 542985819 .long 1531060266 .long 1314610510 .long 540876893 .long 1565416259 .long 744312411 .long 624774688 .word 2660 .byte 0 .type .L_2__STRING.1,@object .size .L_2__STRING.1,59 .space 1, 0x00 # pad .align 4 .L_2__STRING.4: .long 1836343661 .long 1935633525 .long 1634300517 .long 151599724 .long 157692965 .long 174470181 .byte 0 .type .L_2__STRING.4,@object .size .L_2__STRING.4,25 .data .section .note.GNU-stack, "" # End
src/Lambda/Partiality-monad/Inductive/Virtual-machine.agda
nad/partiality-monad
2
4756
<reponame>nad/partiality-monad<gh_stars>1-10 ------------------------------------------------------------------------ -- A virtual machine ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --sized-types #-} module Lambda.Partiality-monad.Inductive.Virtual-machine where open import Prelude hiding (⊥) open import Partiality-monad.Inductive open import Lambda.Syntax open import Lambda.Virtual-machine open Closure Code -- A functional semantics for the VM. -- -- For an alternative definition, see the semantics in -- Lambda.Simplified.Partiality-monad.Inductive.Virtual-machine, which -- is defined using a fixpoint combinator. steps : State → ℕ → Maybe Value ⊥ steps s n with step s steps s zero | continue s′ = never steps s (suc n) | continue s′ = steps s′ n steps s n | done v = now (just v) steps s n | crash = now nothing steps-increasing : ∀ s n → steps s n ⊑ steps s (suc n) steps-increasing s n with step s steps-increasing s zero | continue s′ = never⊑ _ steps-increasing s (suc n) | continue s′ = steps-increasing s′ n steps-increasing s n | done v = ⊑-refl _ steps-increasing s n | crash = ⊑-refl _ stepsˢ : State → Increasing-sequence (Maybe Value) stepsˢ s = (steps s , steps-increasing s) exec : State → Maybe Value ⊥ exec s = ⨆ (stepsˢ s)
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_3314_928.asm
ljhsiun2/medusa
9
80956
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0x41e9, %r13 cmp %rbp, %rbp and $0xffffffffffffffc0, %r13 vmovaps (%r13), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %r11 nop nop nop nop add $7571, %r13 lea addresses_UC_ht+0xc671, %rsi lea addresses_D_ht+0x79d9, %rdi sub %r13, %r13 mov $49, %rcx rep movsq nop and %rsi, %rsi lea addresses_D_ht+0x1da09, %r11 nop nop nop sub %rdx, %rdx vmovups (%r11), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %rsi nop nop nop nop nop xor $27215, %rbp lea addresses_D_ht+0x1ee49, %rsi lea addresses_WC_ht+0x1ef29, %rdi nop nop cmp $33634, %r10 mov $54, %rcx rep movsl nop nop nop and $48789, %r11 lea addresses_A_ht+0xdd9, %r13 nop nop nop add %r10, %r10 mov (%r13), %cx nop nop nop sub %rdi, %rdi lea addresses_WT_ht+0x12d19, %rsi lea addresses_WT_ht+0x1c9d9, %rdi and %r13, %r13 mov $16, %rcx rep movsb add %rdx, %rdx lea addresses_A_ht+0x1b9d9, %rsi lea addresses_UC_ht+0xa571, %rdi clflush (%rdi) mfence mov $5, %rcx rep movsw nop nop nop nop nop lfence lea addresses_WT_ht+0x29d9, %rsi lea addresses_WT_ht+0x14bd9, %rdi nop cmp $2658, %r10 mov $31, %rcx rep movsb nop nop and $60913, %rdi lea addresses_UC_ht+0x1c548, %rsi lea addresses_D_ht+0x1b2d9, %rdi nop cmp $23192, %r11 mov $125, %rcx rep movsl nop cmp $62919, %rcx lea addresses_UC_ht+0x35d9, %rdx nop nop add %r10, %r10 mov $0x6162636465666768, %rdi movq %rdi, (%rdx) nop nop nop nop nop add %rdx, %rdx lea addresses_A_ht+0xe155, %rsi lea addresses_A_ht+0x11979, %rdi nop nop nop nop nop add $30606, %r13 mov $73, %rcx rep movsw nop nop nop add $30603, %rbp lea addresses_WT_ht+0xf599, %r11 nop add $40262, %r10 movl $0x61626364, (%r11) nop nop nop nop xor $6317, %rbp lea addresses_A_ht+0xcbd9, %rsi nop nop nop nop nop and $20321, %r11 mov (%rsi), %ebp nop add $10812, %rbp lea addresses_D_ht+0x16562, %rdx nop nop nop nop nop add %rdi, %rdi movb (%rdx), %cl nop inc %rdi lea addresses_normal_ht+0x1096c, %rsi lea addresses_UC_ht+0x181d9, %rdi nop nop nop xor %r13, %r13 mov $6, %rcx rep movsw nop nop nop nop nop inc %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %rax push %rbp push %rcx push %rdi push %rsi // Store lea addresses_UC+0xcbd9, %rax nop nop nop nop xor $12948, %rcx movw $0x5152, (%rax) nop nop nop xor $34155, %r10 // Store lea addresses_D+0xf9d9, %rbp clflush (%rbp) sub %rcx, %rcx movb $0x51, (%rbp) cmp %rdi, %rdi // Store lea addresses_D+0x1a039, %rbp clflush (%rbp) nop nop nop nop nop xor $2294, %r14 mov $0x5152535455565758, %rax movq %rax, %xmm7 vmovups %ymm7, (%rbp) add $35897, %rsi // Faulty Load lea addresses_normal+0x13dd9, %r10 sub %rbp, %rbp mov (%r10), %r14d lea oracles, %rdi and $0xff, %r14 shlq $12, %r14 mov (%rdi,%r14,1), %r14 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': True, 'NT': True, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'34': 3314} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
programs/oeis/154/A154106.asm
karttu/loda
1
952
; A154106: a(n) = 12*n^2 + 22*n + 11. ; 11,45,103,185,291,421,575,753,955,1181,1431,1705,2003,2325,2671,3041,3435,3853,4295,4761,5251,5765,6303,6865,7451,8061,8695,9353,10035,10741,11471,12225,13003,13805,14631,15481,16355,17253,18175,19121,20091,21085,22103,23145,24211,25301,26415,27553,28715,29901,31111,32345,33603,34885,36191,37521,38875,40253,41655,43081,44531,46005,47503,49025,50571,52141,53735,55353,56995,58661,60351,62065,63803,65565,67351,69161,70995,72853,74735,76641,78571,80525,82503,84505,86531,88581,90655,92753,94875,97021,99191,101385,103603,105845,108111,110401,112715,115053,117415,119801,122211,124645,127103,129585,132091,134621,137175,139753,142355,144981,147631,150305,153003,155725,158471,161241,164035,166853,169695,172561,175451,178365,181303,184265,187251,190261,193295,196353,199435,202541,205671,208825,212003,215205,218431,221681,224955,228253,231575,234921,238291,241685,245103,248545,252011,255501,259015,262553,266115,269701,273311,276945,280603,284285,287991,291721,295475,299253,303055,306881,310731,314605,318503,322425,326371,330341,334335,338353,342395,346461,350551,354665,358803,362965,367151,371361,375595,379853,384135,388441,392771,397125,401503,405905,410331,414781,419255,423753,428275,432821,437391,441985,446603,451245,455911,460601,465315,470053,474815,479601,484411,489245,494103,498985,503891,508821,513775,518753,523755,528781,533831,538905,544003,549125,554271,559441,564635,569853,575095,580361,585651,590965,596303,601665,607051,612461,617895,623353,628835,634341,639871,645425,651003,656605,662231,667881,673555,679253,684975,690721,696491,702285,708103,713945,719811,725701,731615,737553,743515,749501 mov $1,6 mul $1,$0 add $1,11 mul $1,$0 mul $1,2 add $1,11
grammars/CIF2Parser.g4
Sylvan-Materials/cifio
0
1219
parser grammar CIF2Parser; options { tokenVocab = CIF2Lexer; } cif : file_heading AllChars; file_heading : Magic_Code;
data/wildPokemon/seafoamislandb4.asm
adhi-thirumala/EvoYellow
16
167551
<filename>data/wildPokemon/seafoamislandb4.asm IslandMonsB4: db $0A db 36,GOLBAT db 36,ZUBAT db 30,KRABBY db 32,KINGLER db 28,SEEL db 32,SEEL db 27,GOLBAT db 45,ZUBAT db 30,DEWGONG db 34,DEWGONG db $05 db 25,STARYU db 30,STARYU db 20,TENTACOOL db 30,STARYU db 35,TENTACOOL db 30,CHINCHOU db 40,TENTACOOL db 30,STARYU db 30,LANTURN db 30,STARYU
programs/oeis/101/A101037.asm
jmorken/loda
1
8211
; A101037: Triangle read by rows: T(n,1) = T(n,n) = n and for 1<k<n: T(n,k) = floor((T(n-1,k-1)+T(n-1,k))/2). ; 1,2,2,3,2,3,4,2,2,4,5,3,2,3,5,6,4,2,2,4,6,7,5,3,2,3,5,7,8,6,4,2,2,4,6,8,9,7,5,3,2,3,5,7,9,10,8,6,4,2,2,4,6,8,10,11,9,7,5,3,2,3,5,7,9,11,12,10,8,6,4,2,2,4,6,8,10,12,13,11,9,7,5,3,2,3,5,7,9,11,13,14,12,10,8,6,4,2,2,4,6,8,10,12,14,15,13,11,9,7,5,3,2,3,5,7,9,11,13,15,16,14,12,10,8,6,4,2,2,4,6,8,10,12,14,16,17,15,13,11,9,7,5,3,2,3,5,7,9,11,13,15,17,18,16,14,12,10,8,6,4,2,2,4,6,8,10,12,14,16,18,19,17,15,13,11,9,7,5,3,2,3,5,7,9,11,13,15,17,19,20,18,16,14,12,10,8,6,4,2,2,4,6,8,10,12,14,16,18,20,21,19,17,15,13,11,9,7,5,3,2,3,5,7,9,11,13,15,17,19,21,22,20,18,16,14,12,10,8,6,4,2,2,4,6,8,10,12,14,16 lpb $0 mov $3,$0 cal $3,49581 ; Table T(n,k) = |n-k| read by antidiagonals (n >= 0, k >= 0). add $2,$3 mov $4,$2 cmp $4,0 add $2,$4 mov $0,$2 lpe mov $1,$0 add $1,1
Tests/mem_dep.asm
tim-roderick/simple-cpu-simulator
2
14595
<filename>Tests/mem_dep.asm<gh_stars>1-10 LDC r2 10 ADD r1 r2 1 SUB r1 r2 1 ADD r1 r2 1 SUB r1 r2 1 ADD r1 r2 1 SUB r1 r2 1 ADD r1 r2 1 SUB r1 r2 1 ADD r1 r2 1 SUB r1 r2 1 ADD r1 r2 1 SUB r1 r2 1 ADD r1 r2 1 SUB r1 r2 1 ADD r1 r2 1 SUB r1 r2 1 MUL r1 r2 1 MUL r1 r2 1 MUL r1 r2 1 MUL r1 r2 1 MUL r1 r2 1 STC 1 10 LD r11 1 0 SUB r1 r2 1 ST 0 r1 0 LD r10 0 0
ado/src/sqlbench.adb
fjudith/sql-benchmark
24
15462
----------------------------------------------------------------------- -- sqlbench -- SQL Benchmark -- Copyright (C) 2018 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Files; package body Sqlbench is -- ------------------------------ -- Register a benchmark handler under the given name. -- ------------------------------ procedure Register (Context : in out Context_Type; Handler : in Benchmark_Handler; Title : in String; Factor : in Repeat_Factor_Type := 100) is begin Context.Tests.Append (Benchmark_Test '(Len => Title'Length, Handler => Handler, Title => Title, Factor => Factor)); end Register; -- ------------------------------ -- Get the database session to make SQL requests on the database. -- ------------------------------ function Get_Session (Context : in Context_Type) return ADO.Sessions.Master_Session is begin return Context.Session; end Get_Session; -- ------------------------------ -- Get a benchmark configuration parameter. -- ------------------------------ function Get_Parameter (Context : in Context_Type; Name : in String) return String is begin return Context.Config.Get (Name, ""); end Get_Parameter; -- ------------------------------ -- Get a SQL configuration file path that depends on the database driver. -- The file is of the form: <config-directory>/<database-driver>-<name> -- ------------------------------ function Get_Config_Path (Context : in Context_Type; Name : in String) return String is begin return Util.Files.Compose ("config", Context.Get_Driver_Name & "-" & Name); end Get_Config_Path; -- ------------------------------ -- Get the database driver name. -- ------------------------------ function Get_Driver_Name (Context : in Context_Type) return String is begin return Context.Session.Get_Driver.Get_Driver_Name; end Get_Driver_Name; end Sqlbench;
tests/relocate/relocation_only_desired_offset.asm
fengjixuchui/sjasmplus
220
103696
ORG $1000 RELOCATE_START ASSERT 2 * relocate_count == relocate_size ASSERT 2 == relocate_count dw relocate_count dw relocate_size reloc1: ld hl,reloc1 ; to be relocated ld de,reloc2 ; to be relocated ld bc,reloc2-reloc1 ; not affected by relocation ld sp,absolute1 ; not affected by relocation ld hl,reloc2*2 ; affected but not relocated (invalid difference) (warning) ld hl,reloc2*2 ; reldiverts-ok ; warning suppressed reloc2: RELOCATE_END ; no relocation area (no warnings, no relocation data) ORG $17DC absolute1: ld hl,reloc1 ld de,reloc2 ld bc,reloc2-reloc1 ld sp,absolute1 ld hl,reloc2*2 RELOCATE_TABLE ASSERT 0 == __ERRORS__ ASSERT 1 == __WARNINGS__
programs/oeis/005/A005994.asm
jmorken/loda
1
6660
; A005994: Alkane (or paraffin) numbers l(7,n). ; 1,3,9,19,38,66,110,170,255,365,511,693,924,1204,1548,1956,2445,3015,3685,4455,5346,6358,7514,8814,10283,11921,13755,15785,18040,20520,23256,26248,29529,33099,36993,41211,45790,50730,56070,61810,67991,74613,81719,89309,97428,106076,115300,125100,135525,146575,158301,170703,183834,197694,212338,227766,244035,261145,279155,298065,317936,338768,360624,383504,407473,432531,458745,486115,514710,544530,575646,608058,641839,676989,713583,751621,791180,832260,874940,919220,965181,1012823,1062229,1113399,1166418,1221286,1278090,1336830,1397595,1460385,1525291,1592313,1661544,1732984,1806728,1882776,1961225,2042075,2125425,2211275,2299726,2390778,2484534,2580994,2680263,2782341,2887335,2995245,3106180,3220140,3337236,3457468,3580949,3707679,3837773,3971231,4108170,4248590,4392610,4540230,4691571,4846633,5005539,5168289,5335008,5505696,5680480,5859360,6042465,6229795,6421481,6617523,6818054,7023074,7232718,7446986,7666015,7889805,8118495,8352085,8590716,8834388,9083244,9337284,9596653,9861351,10131525,10407175,10688450,10975350,11268026,11566478,11870859,12181169,12497563,12820041,13148760,13483720,13825080,14172840,14527161,14888043,15255649,15629979,16011198,16399306,16794470,17196690,17606135,18022805,18446871,18878333,19317364,19763964,20218308,20680396,21150405,21628335,22114365,22608495,23110906,23621598,24140754,24668374,25204643,25749561,26303315,26865905,27437520,28018160,28608016,29207088,29815569,30433459,31060953,31698051,32344950,33001650,33668350,34345050,35031951,35729053,36436559,37154469,37882988,38622116,39372060,40132820,40904605,41687415,42481461,43286743,44103474,44931654,45771498,46623006,47486395,48361665,49249035,50148505,51060296,51984408,52921064,53870264,54832233,55806971,56794705,57795435,58809390,59836570,60877206,61931298,62999079,64080549,65175943,66285261,67408740,68546380,69698420,70864860,72045941,73241663,74452269,75677759,76918378,78174126,79445250,80731750,82033875,83351625 mov $17,$0 mov $19,$0 add $19,1 lpb $19 clr $0,17 mov $0,$17 sub $19,1 sub $0,$19 mov $14,$0 mov $16,$0 add $16,1 lpb $16 mov $0,$14 sub $16,1 sub $0,$16 mov $1,1 mov $5,$0 div $5,2 add $1,$5 pow $1,2 add $15,$1 lpe add $18,$15 lpe mov $1,$18
Obsolete/Wow-FV-zh/Wow-It-is-FV.agda
ice1000/Books
133
16240
<reponame>ice1000/Books {-# OPTIONS --without-K #-} module Wow-It-is-FV where open import Agda.Builtin.Nat open import Agda.Builtin.Equality open import Agda.Primitive levelEq : lzero ≡ lzero levelEq = refl levelEq′ : lsuc lzero ≡ lsuc lzero levelEq′ = refl trans : {l : Level} {Q : Set l} {a b c : Q} → a ≡ b → b ≡ c → a ≡ c trans refl refl = refl J : {A : Set} (P : (x y : A) → x ≡ y → Set) → ((x : A) → P x x refl) → (x y : A) (xy : x ≡ y) → P x y xy J P p x .x refl = p x cong : {A B : Set} (f : A → B) → {m n : A} → m ≡ n → f m ≡ f n cong f refl = refl sym : {A : Set} {m n : A} → m ≡ n → n ≡ m sym refl = refl theorem : suc zero + suc zero ≡ _ theorem = refl theorem′ : 1 + 1 ≡ 2 theorem′ = refl trivialEq : {a : _} {A : Set a} → A ≡ A trivialEq = refl trivialEq′ : ∀ {a} {A : Set a} → A ≡ A trivialEq′ = refl trivialEq′′ : ∀ a b → a + b ≡ a + b trivialEq′′ a b = refl trans′ : ∀ {a} {A : Set a} (a b c : A) → a ≡ b → b ≡ c → a ≡ c trans′ a .a c refl bc = bc data _<=_ : (a b : Nat) → Set where 0ltn : ∀ {n} → 0 <= n nltm : ∀ {n m} → n <= m → suc n <= suc m 7lt13 : 7 <= 13 7lt13 = nltm (nltm (nltm (nltm (nltm (nltm (nltm 0ltn)))))) abc : ∀ {a b c} → a <= b → b <= c → a <= c abc 0ltn bc = 0ltn abc (nltm ab) (nltm bc) = nltm (abc ab bc) data ⊥ : Set where ridiculous : ⊥ → ⊥ ridiculous a = a ridiculous′ : 1 ≡ 0 → ⊥ ridiculous′ () ⊥-elim : ∀ {a} {A : Set a} → ⊥ → A ⊥-elim () 4lt3 : 4 <= 3 → ⊥ 4lt3 (nltm (nltm (nltm ()))) infix 3 ¬_ ¬_ : ∀ {a} → Set a → Set a ¬ P = P → ⊥ _!=_ : ∀ {a} {A : Set a} → A → A → Set a x != y = ¬ x ≡ y _≡⟨_⟩_ : ∀ {A : Set} (x : A) {y z : A} → x ≡ y → y ≡ z → x ≡ z _ ≡⟨ refl ⟩ c = c _QED : ∀ {A : Set} (x : A) → x ≡ x _ QED = refl lemma₀ : ∀ n → n + 0 ≡ n lemma₀ zero = refl lemma₀ (suc n) = cong suc (lemma₀ n) lemma₁ : ∀ n m → suc (n + m) ≡ n + suc m lemma₁ zero _ = refl lemma₁ (suc n) m = cong suc (lemma₁ n m) comm : ∀ n m → n + m ≡ m + n comm zero n = sym (lemma₀ n) comm (suc n) m = suc n + m ≡⟨ refl ⟩ suc (n + m) ≡⟨ cong suc (comm n m) ⟩ suc (m + n) ≡⟨ lemma₁ m n ⟩ m + suc n QED infixr 2 _≡⟨_⟩_ infix 3 _QED
test/Fail/InstanceArgumentsNotFound.agda
cruhland/agda
1,989
15868
<filename>test/Fail/InstanceArgumentsNotFound.agda module InstanceArgumentsNotFound where postulate A B : Set f : {{a : A}} → B test : B test = f
GccTest/src/kernel/main.asm
chibicitiberiu/nanobyte_experiments
0
29415
org 0x0 bits 16 %define ENDL 0x0D, 0x0A start: ; print hello world message mov si, msg_hello call puts .halt: cli hlt ; ; Prints a string to the screen ; Params: ; - ds:si points to string ; puts: ; save registers we will modify push si push ax push bx .loop: lodsb ; loads next character in al or al, al ; verify if next character is null? jz .done mov ah, 0x0E ; call bios interrupt mov bh, 0 ; set page number to 0 int 0x10 jmp .loop .done: pop bx pop ax pop si ret msg_hello: db 'Hello world from KERNEL!', ENDL, 0
src/DistributedSystem/Prototype.agda
lisandrasilva/agda-liveness
0
6136
<filename>src/DistributedSystem/Prototype.agda {- Copyright 2019 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -} open import Prelude open import Data.Fin hiding (_≟_; _<?_; _≤?_ ;_+_; pred; lift) renaming (_<_ to _<F_; _≤_ to _≤F_) open import Data.List open import Data.List.Properties open import Data.Maybe.Base as Maybe using (Maybe; nothing; just) open import Data.Vec.Base as Vec using (Vec) open import Data.Bool hiding (_<_ ; _<?_; _≤_; _≤?_; _≟_) open import Data.Vec.Any open import Data.Vec.All hiding (lookup) open import StateMachineModel open import Stream module DistributedSystem.Prototype {ℓ₁ ℓ₂ ℓ₃ ℓ₄ ℓ₅ : Level} (N : ℕ) (f : ℕ) (fta : N > 3 * f) (ClientRequest : Set ℓ₂) (Block : Set ℓ₃) (Vote : Set ℓ₄) (QC : Set ℓ₅) where -- Client can make a request at any moment {- 0 - Set node role LEADER || LEADER & FOLLOWER 1 - block = getPoolReq 2 - broadcast block || 3 - receive block || 4 - vote for block 5 - while (#votes < N-f-1) 6 - reveive vote 5 - broadcast QC || 7 - receive QC || 8 - check commit rule || 9 - movenextview -} -- QUESTION: -- To prove the liveness not only the sequence of honest leaders per view must be -- long enough but also the length of the requests must be greater than 3. -- If the sequence is smaller we don't have enough requests to ensure the commit rule -- A dishonest leader can deliberately left honest nodes behind, and these nodes -- won't move to the next view, unless they timeout. However, t if these nodes have -- moved for the next view for timeout, they will be missing a block and a qc -- in the RecordStore, how to fix this? -- 1 - Whisper of proposed blocks and Qc's -- 2 - Whisper only of QC's (if they have attached the proposed block) -- 3 - Mechanism of asking records missing in the record store ----------------------------------------------------------------------------- -- SPECIFICATION ----------------------------------------------------------------------------- NodeID = Fin N HonestID = Fin (N ∸ f) Instruction = Fin 10 Receiver = Fin N DishonestID : NodeID → Set DishonestID nId = N ∸ f ≤ toℕ nId data Message : Set (ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where blockM : Block → Message voteM : Vote → Message qcM : QC → Message data Role : Set where leader : Role follower : Role record NodeState : Set (ℓ₁ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where field nodeRole : Role currNodeView : ℕ msgBuffer : List Message readMessages : ℕ currProposal : Block votesforQC : List Vote control : Instruction -- id : Node --recordTree : RecordTree -- previousRound : ℕ -- lockedRound : ℕ -- clock : ℕ -- timeout : ℕ open NodeState record State : Set (ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where field -- I am not sure that we don't need the faulty Node States -- because we may need to express that we have at least (N ∸ f) -- nodes on the same view and it may be that the f nodes behave normally nodeStates : Vec NodeState (N ∸ f) leaderPerView : Stream (Fin N) poolRequests : List ClientRequest committedReq : ℕ open State Honest? : Decidable ((_< N ∸ f) ∘ toℕ {N}) Honest? x = toℕ x <? N ∸ f Dishonest? : Decidable ((N ∸ f ≤_) ∘ toℕ {N}) Dishonest? x = N ∸ f ≤? toℕ x mkBlock : ClientRequest → NodeState → Block mkQC : NodeState → QC mkVote : NodeState → Vote validVote : State → HonestID → Vote → Set validBlock : State → HonestID → Block → Set validQC : State → HonestID → QC → Set ¬validMsg : State → HonestID → Message → Set data HonestEvent (nId : HonestID) : Set (ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where setNodeRole : HonestEvent nId getPoolReq : ClientRequest → HonestEvent nId broadcastB : Block → HonestEvent nId broadcastQC : QC → HonestEvent nId wait : HonestEvent nId receive : Message → HonestEvent nId dropMsg : Message → HonestEvent nId sendVote : Vote → Receiver → HonestEvent nId commit : HonestEvent nId moveNextView : HonestEvent nId data DSEvent : Set (ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where newRequest : ClientRequest → DSEvent -- A client add a request to the request pool honestEvent : ∀ {nId} → HonestEvent nId → DSEvent dishonestEvent : Message → HonestID → DSEvent -- dishonest nodes can send any msg to honest nodes nodeSt : HonestID → State → NodeState nodeSt nId st = Vec.lookup (nodeStates st) nId -- Other option is to have a flag in the NodeState saying if it's leader or follower isLeader : State → HonestID → Set isLeader st nId = nodeRole (nodeSt nId st) ≡ leader getLeader : State → HonestID → Fin N getLeader st nId = get (leaderPerView st) (currNodeView (nodeSt nId st)) {- Instruction is an abstraction for the number of intructions available for the node -} nextInstruction : State → HonestID → Instruction nextInstruction st nId = control (nodeSt nId st) data HonestEnabled (nId : HonestID) (st : State) : HonestEvent nId → Set (ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where setRoleEn : nextInstruction st nId ≡ 0F → HonestEnabled nId st setNodeRole getReqEn : ∀ {req} → isLeader st nId → nextInstruction st nId ≡ 1F → (comm< : committedReq st < length (poolRequests st)) -- Maybe it's better to have a function: -- fetchNextReq : List ClientRequests → Maybe (Index , Request) → req ≡ lookup (poolRequests st) (fromℕ≤ comm<) → HonestEnabled nId st (getPoolReq req) broadcastBEn : isLeader st nId → nextInstruction st nId ≡ 2F → HonestEnabled nId st (broadcastB (currProposal (nodeSt nId st))) receiveBlockEn : ∀ {b : Block} → nextInstruction st nId ≡ 3F → (i : readMessages (nodeSt nId st) < length (msgBuffer (nodeSt nId st))) → blockM b ≡ lookup (msgBuffer (nodeSt nId st)) (fromℕ≤ i) → validBlock st nId b → HonestEnabled nId st (receive (blockM b)) voteBlockEn : nextInstruction st nId ≡ 4F → HonestEnabled nId st (sendVote (mkVote (nodeSt nId st)) (getLeader st nId)) waitVotesEn : isLeader st nId → nextInstruction st nId ≡ 5F → length (votesforQC (nodeSt nId st)) < N ∸ f ∸ 1 → HonestEnabled nId st wait receiveVoteEn : ∀ {v : Vote} → isLeader st nId → nextInstruction st nId ≡ 6F → (i : readMessages (nodeSt nId st) < length (msgBuffer (nodeSt nId st))) → voteM v ≡ lookup (msgBuffer (nodeSt nId st)) (fromℕ≤ i) → validVote st nId v → HonestEnabled nId st (receive (voteM v)) broadcastQCEn : isLeader st nId → nextInstruction st nId ≡ 5F → length (votesforQC (nodeSt nId st)) ≡ N ∸ f ∸ 1 → HonestEnabled nId st (broadcastQC (mkQC (nodeSt nId st))) receiveQCEn : ∀ {qc : QC} → nextInstruction st nId ≡ 7F → (i : readMessages (nodeSt nId st) < length (msgBuffer (nodeSt nId st))) → qcM qc ≡ lookup (msgBuffer (nodeSt nId st)) (fromℕ≤ i) → validQC st nId qc → HonestEnabled nId st (receive (qcM qc)) dropMsgEn : ∀ {msg} → (i : readMessages (nodeSt nId st) < length (msgBuffer (nodeSt nId st))) → msg ≡ lookup (msgBuffer (nodeSt nId st)) (fromℕ≤ i) → ¬validMsg st nId msg → HonestEnabled nId st (dropMsg msg) commitEn : nextInstruction st nId ≡ 8F -- TODO: check commit rule → HonestEnabled nId st commit moveNextViewEn : nextInstruction st nId ≡ 8F ⊎ DishonestID (getLeader st nId) → HonestEnabled nId st moveNextView data Enabled : DSEvent → State → Set (ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where newReqEn : ∀ {st req} → Enabled (newRequest req) st honestEvEn : ∀ {st hId hEv} → HonestEnabled hId st hEv → Enabled (honestEvent hEv) st dishonestEvEn : ∀ {st dId msg hId} → DishonestID dId → Enabled (dishonestEvent msg hId) st -- Maybe I need to postulate that dishonest nodes cannot -- forge signatures (Node (N ∸ f)) sendMsgToNode : Message → NodeState → NodeState sendMsgToNode msg nodeSt = record nodeSt { msgBuffer = msgBuffer nodeSt ++ [ msg ] } broadcast : State → Message → Vec NodeState (N ∸ f) broadcast st msg = Vec.map (λ n → sendMsgToNode msg n) (nodeStates st) Action : ∀ {preState} {event} → Enabled event preState → State Action {ps} {newRequest req} x = record ps { poolRequests = poolRequests ps ++ [ req ] } Action {ps} {honestEvent {nId} setNodeRole} x with toℕ nId ≟ toℕ (getLeader ps nId) ... | yes p = let updateNode = λ old → record old { nodeRole = leader ; control = 1F } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } ... | no ¬p = let updateNode = λ old → record old { nodeRole = follower ; control = 3F } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } Action {ps} {honestEvent {nId} (getPoolReq req)} x = let updateNode = λ old → record old { control = 2F ; currProposal = mkBlock req old } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } -- QUESTION: -- Not sure if it's a good approach to consider a broadcast atomically, -- or have a different state transition to send to each node Action {ps} {honestEvent {nId} (broadcastB b)} x = let sendToAll = broadcast ps (blockM b) updateLeader = λ old → record old { control = 3F } in record ps { nodeStates = Vec.updateAt nId updateLeader sendToAll } Action {ps} {honestEvent {nId} (receive (blockM b))} x -- TODO : update RecordTree = let updateNode = λ old → record old { readMessages = 1 + readMessages old ; currProposal = b ; control = 4F } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } Action {ps} {honestEvent {nId} (sendVote v receiver)} x with toℕ receiver <? N ∸ f | nodeRole (nodeSt nId ps) -- If receiver is not honest → only updates the control variable of the sender ... | no ¬p | leader = let updateNode = λ old → record old { control = 5F } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } ... | no ¬p | follower = let updateNode = λ old → record old { control = 7F } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } -- If receiver is honest → update the message buffer of the receiver as well ... | yes p | leader = let updateReceiver = Vec.updateAt (fromℕ≤ p) (sendMsgToNode (voteM v)) (nodeStates ps) updateNode = λ old → record old { control = 5F } in record ps { nodeStates = Vec.updateAt nId updateNode updateReceiver } ... | yes p | follower = let updateReceiver = Vec.updateAt (fromℕ≤ p) (sendMsgToNode (voteM v)) (nodeStates ps) updateNode = λ old → record old { control = 7F } in record ps { nodeStates = Vec.updateAt nId updateNode updateReceiver } Action {ps} {honestEvent {nId} wait} x = let updateInst = λ old → record old { control = 6F } in record ps { nodeStates = Vec.updateAt nId updateInst (nodeStates ps) } Action {ps} {honestEvent {nId} (receive (voteM v))} x = let updateNode = λ old → record old { readMessages = 1 + readMessages old ; control = 5F ; votesforQC = v ∷ votesforQC old } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } Action {ps} {honestEvent {nId} (broadcastQC q)} x = let sendToAll = broadcast ps (qcM q) updateLeader = λ old → record old { control = 7F } in record ps { nodeStates = Vec.updateAt nId updateLeader sendToAll } Action {ps} {honestEvent {nId} (receive (qcM qc))} x = let updateNode = λ old → record old { readMessages = 1 + readMessages old ; control = 8F } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } Action {ps} {honestEvent {nId} (dropMsg msg)} x = let updateNode = λ old → record old { readMessages = 1 + readMessages old } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } Action {ps} {honestEvent commit} x = {!!} Action {ps} {honestEvent {nId} moveNextView} x = let updateNode = λ old → record old { currNodeView = 1 + currNodeView old ; control = 0F } in record ps { nodeStates = Vec.updateAt nId updateNode (nodeStates ps) } Action {ps} {dishonestEvent msg hId} x = record ps { nodeStates = Vec.updateAt hId (sendMsgToNode msg) (nodeStates ps) } nodeᵢ : NodeState → Set (ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) nodeᵢ nSt = nodeRole nSt ≡ follower × currNodeView nSt ≡ 0 × msgBuffer nSt ≡ [] × readMessages nSt ≡ 0 × currProposal nSt ≡ {!!} × votesforQC nSt ≡ [] × control nSt ≡ 0F stateᵢ : State → Set (ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) stateᵢ st = poolRequests st ≡ [] × committedReq st ≡ 0 × All nodeᵢ (nodeStates st) -- instantiate leaderPerView or maybe it's not necessary MyStateMachine : StateMachine State DSEvent MyStateMachine = record { initial = stateᵢ ; enabled = Enabled ; action = Action } NodeEvSet : HonestID → EventSet {Event = DSEvent} NodeEvSet nId (newRequest x) = ⊥ NodeEvSet nId₁ (honestEvent {nId₂} x) = nId₁ ≡ nId₂ NodeEvSet nId (dishonestEvent x x₁) = ⊥ data MyWeakFairness : EventSet → Set (ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄ ⊔ ℓ₅) where wf : (nId : HonestID) → MyWeakFairness (NodeEvSet nId) MySystem : System State DSEvent MySystem = record { stateMachine = MyStateMachine ; weakFairness = MyWeakFairness }
examples/sinatra/Example.agda
cruhland/agda
1,989
4992
module Example where open import Prelude import Typed data Data : Set where nat : Data bool : Data Datatype : Data -> List (List Data) Datatype nat = ε ◄ ε ◄ (ε ◄ nat) Datatype bool = ε ◄ ε ◄ ε data Effect : Set where data _⊆_ : Effect -> Effect -> Set where refl⊆ : forall {M} -> M ⊆ M Monad : Effect -> Set -> Set Monad e A = A return : forall {M A} -> A -> Monad M A return x = x map : forall {M A B} -> (A -> B) -> Monad M A -> Monad M B map f m = f m join : forall {M A} -> Monad M (Monad M A) -> Monad M A join m = m morph : forall {M N} -> M ⊆ N -> (A : Set) -> Monad M A -> Monad N A morph _ A x = x open module TT = Typed Data Datatype Effect _⊆_ Monad (\{M A} -> return {M}{A}) (\{M A B} -> map {M}{A}{B}) (\{M A} -> join {M}{A}) morph zero : forall {M Γ} -> InV M Γ (TyCon nat) zero = con (tl hd) ⟨⟩ suc : forall {M Γ} -> InV M Γ (TyCon nat) -> InV M Γ (TyCon nat) suc n = con hd (⟨⟩ ◃ n) true : forall {M Γ} -> InV M Γ (TyCon bool) true = con hd ⟨⟩ false : forall {M Γ} -> InV M Γ (TyCon bool) false = con (tl hd) ⟨⟩
packages/x86-toolkit/x86-assembler/tests/asm/bootslide.asm
Mati365/ts-c99-compiler-toolkit
66
21632
<reponame>Mati365/ts-c99-compiler-toolkit ;= test: boot slide game ;= bin: 31c08ed88ed0bc009cb4b88ec0b003cd10b401b526cd10b9d0079831fff3abbd0900e4403c10771ca1e47d86e0a3e47dc606487cccc606b17d48c606c57d44c6063a7d40bfcc00b4ffbb1600c606d87d1ec606de7d64e87e01b1ff497417e4402403685b7c74423c01745d3c0274763c030f849c00e81201e8b900b401cd1674f798cd1668757c80fc48741d80fc50743780fc4b744f80fc4d747680fc017402cd19b80200cd10cd2089eb83fb0b0f87810083c3048a87e47dc687e47d0089dd83eb048887e47dc389eb83fb04726483eb048a87e47dc687e47d0089dd83c3048887e47dc389eb80fb03744780fb07744280fb0b743d80fb0f743880c3018a87e47dc687e47d0089dd80eb018887e47dc389ebf6c3017505f6c302741680eb018a87e47dc687e47d0089dd80c3018887e47dc3c331dbbfb402b4308a87e47d4304303c3a720204073c307505e81f00eb01ab83c70c83fb04740a83fb08740583fb0c750481c7e80283fb1075ccc35381ef460198bb0500c606d87d07c606de7d92e8530081efd8015bc3ba78febe040081c2f602e8160083c20ee8100083c20ee80a0083c20ee804004e75e4c389d7b8b113bb0500c606d87d07c606de7d92e8150089d7b433bb0400c606d87d06c606de7d94e80100c3b90000f3ab81c700004b75f4c3060e040805090c0f02000b030d0a07010000000000000000000055aa ;15 Number Slider Game ; * Slide the numbers around until they are in order ; * This is boot sector ( <512 bytes) game ; * Controls to move are up/down/left/right ; * Any other key rescrambles numbers ; Some Fuckery: ; Polymorphic ; Abuse of "Call"/Ret ; * There are routines to move the tiles in the up/down/left/right direction, ; They are controlled by the user AND the scrambling routines. There is a ; 'valid' way to conditionally call and then return, but this requires a ; bit more space with all of the control/flow logic. I would rather just ; manually set the corresponding return points once, and then just do a ; bunch of conditional jumps, sort of evil, but less code. [ORG 0x7c00] LEFT EQU 75 RIGHT EQU 77 UP EQU 72 DOWN EQU 80 ;Init the environment xor ax, ax ; make it zero mov ds, ax ; DS=0 mov ss, ax ; stack starts at 0 mov sp, 0x9c00 ; 200h past code start mov ah, 0xb8 ; text video memory mov es, ax ; ES=0xB800 mov al, 0x03 int 0x10 mov ah, 1 mov ch, 0x26 int 0x10 ;Fill in all black mov cx, 0x07d0 ; whole screens worth cbw ; clear ax (black on black with null char) xor di, di ; first coordinate of video mem rep stosw ; push it to video memory mov bp, 0x9 ; blanklocation ; Evil? in al,(0x40) ; Get random cmp al, 0x10 ; 1 in 16 chance it will be evil ja draw_border ; If above, then not evil ; Evil (Descending solvability) mov ax, [boarddata] ; Get first and second board number xchg ah,al ; And then swap them mov [boarddata], ax ; (now evil, can't solve in ascending order) mov byte [border + 1], 0xcc ; Change border color to light red mov byte [tile1 + 2], 0x48 ; Change tile border to shaded red mov byte [tile2 + 1], 0x44 ; Change tile to red mov byte [number_color + 1], 0x40 ; Change number to black on red ;draw border draw_border: mov di, 1 * 160 + 44 ; corner to start on border: mov ah, 0xff ; white mov bx, 22 ; rows mov byte [rectrow + 1], 30 ; columns mov byte [nextline + 2], 0x64 ; value to get to next line call drawrect ; Scramble mov cl, 0xff ; Init to 255 rounds of movement scramble: dec cx je gameloop ; Once done, go to main game loop in al,(0x40) ; Get 'random' value and al, 3 ; Only preserve last 2 bits (for 4 possible up/down/left/right moves) push word scramble ; point of return instead of using call for the below jumps ; Do a random tile move based on random results ; cmp al, 0 ; and al,3 already did this comparison je up cmp al, 1 je down cmp al, 2 je left cmp al, 3 je right ; The Main Game Loop gameloop: call drawboard ; Draw the blank tiles of the board waitkey: call displaytiles ; Put the actual (hex) numbers into the tiles mov ah, 1 ; Is there a key int 0x16 ; "" jz waitkey ; If not wait for a key cbw ; clear ax (Get the key) int 0x16 ; "" push word gameloop ; point of return instead of using call ; Get the Keys cmp ah, UP je up cmp ah, DOWN je down cmp ah, LEFT je left cmp ah, RIGHT je right cmp ah, 0x01 je exit int 0x19 ; A non-directional key was pressed (reboot/rescramble) exit: mov ax,0x0002 ; Clear screen int 0x10 int 0x20 ; Return to bootOS up: mov bx, bp ; get blank tile location cmp bx, 0xb ; Out of bounds? ja keysdone ; Then return (don't move anything) add bx, 4 ; get location above it mov al, [boarddata + bx] ; get value above it mov byte [boarddata + bx], 0 ; make it the new blank mov bp, bx ; update blank location sub bx, 4 ; revert to old blank location mov [boarddata + bx], al ; put new value in ret down: mov bx, bp ; get blank tile location cmp bx, 4 ; Out of bounds? jb keysdone ; Then return (don't move anything) sub bx, 4 ; get location above it mov al, [boarddata + bx] ; get value above it mov byte [boarddata + bx], 0 ; make it the new blank mov bp, bx ; update blank location add bx, 4 ; revert to old blank location mov [boarddata + bx], al ; put new value in ret left: mov bx, bp ; get blank tile location cmp bl, 3 ; All the way to the left? je keysdone ; return without moving anything cmp bl, 7 ; "" je keysdone ; "" cmp bl, 11 ; "" je keysdone ; "" cmp bl, 15 ; "" je keysdone ; "" add bl, 1 ; get location above it mov al, [boarddata + bx] ; get value above it mov byte [boarddata + bx], 0 ; make it the new blank mov bp, bx ; update blank location sub bl, 1 ; revert to old blank location mov [boarddata + bx], al ; put new value in ret right: mov bx, bp ; get blank tile location ; Test Right edge, this is aligned with positions 0, 4, 8, and 12. ; In binary, these are the only positions where the least significant ; bits are always 0, so the below instructions tests for this quality test bl, 0x1 ; is the last bit a 1 jne right_cont ; if not (0), continue with movement test bl, 0x2 ; is the next bit a 1 je keysdone ; if so, don't move anything ... somehow this is the right logic right_cont: sub bl, 1 ; get location above it mov al, [boarddata + bx] ; get value above it mov byte [boarddata + bx], 0 ; make it the new blank mov bp, bx ; update blank location add bl, 1 ; revert to old blank location mov [boarddata + bx], al ; put new value in ret keysdone: ret displaytiles: ; This is a routine for displaying all of the tiles xor bx, bx mov di, 4 * 160 + 52 ; Position of top-left tile displaytilesloop: number_color: mov ah, 0x30 ; Black on light-blue background mov al, byte [boarddata + bx] ; current number value in boarddata structure inc bx ; next tile digit for next iteration add al, 0x30 ; 'Convert' to ASCII cmp al, 0x3A ; Is it above '9' jb number ; If its below (in range of number), skip adjustment add al, 7 ; Get it into the ASCII A-F range number: cmp al, 0x30 ; Check to see if it's 0 (our blank tile) jne next_a ; Keep processing if it's not call blanktile ; Otherwise, draw a blank (black) tile jmp next_b ; Skip over normal printing of number next_a: stosw ; Print the Number next_b: add di, 12 ; Go to the next column cmp bx, 4 ; Check if it's the last column je nextrow ; If so, do a row adjustment cmp bx, 8 ; "" je nextrow ; "" cmp bx, 12 ; "" jne norows ; "" nextrow: add di, 744 ; Coordinate adjustment for going to next row norows: cmp bx, 0x10 ; check to see if last tile has been printed jne displaytilesloop ; otherwise keep getting and printing them ret blanktile: ; A Blank Tile for the '0' tile push bx ; Don't pave over bx, as other routines us it sub di, 326 ; Adjust coord from middle to upper-left corner of tile cbw ; clear ax (black) mov bx, 5 ; rows mov byte [rectrow + 1], 7 ; columns mov byte [nextline + 2], 0x92 ; Value to get to next line call drawrect ; Draw the black rectangle sub di, 472 ; Restore coordinate to middle of tile pop bx ; Restore bx ret drawboard: ; This routine graphically draws the tiles (without the numbers) mov dx, 2 * 160 + 46 - 758 ; This is much before the start position, helps keep a tighter loop mov si, 4 ; 4 rows row: add dx, 758 ; Advance to next row call drawtile add dx, 14 ; next column call drawtile add dx, 14 call drawtile add dx, 14 call drawtile dec si jne row ret drawtile: ; Color 1 mov di, dx tile1: mov ax, 0x13b1 ; shaded corner border mov bx, 5 ; rows mov byte [rectrow + 1], 7 ; columns mov byte [nextline + 2], 0x92 ; Value to get to next line call drawrect ; Color 2 mov di, dx tile2: mov ah, 0x33 ; inner light blue main part of tile mov bx, 4 ; rows mov byte [rectrow + 1], 6 ; columns mov byte [nextline + 2], 0x94 ; Value to get to next line call drawrect ret drawrect: ; Draws rectangle rectrow: mov cx, 0 ; columns, self-modified by caller rep stosw ; add di, (next line value) (ammount self-modified by caller) nextline: db 0x81, 0xc7, 0x00, 0x00 dec bx jne rectrow ret ; Data structure for ordered game boarddata: db 0x06, 0x0e, 0x04, 0x08, 0x05, 0x09, 0x0c, 0x0f, 0x02, 0x00, 0x0b, 0x03, 0x0d, 0x0a, 0x07, 0x01 ;BIOS sig and padding times 510-($-$$) db 0 dw 0xAA55
source/s-debug.ads
ytomino/drake
33
23618
pragma License (Unrestricted); -- runtime unit package System.Debug is pragma Preelaborate; -- implementation of Ada.Debug function File return String with Import, Convention => Intrinsic; function Line return Positive with Import, Convention => Intrinsic; function Source_Location return String with Import, Convention => Intrinsic; function Enclosing_Entity return String with Import, Convention => Intrinsic; function Default_Put ( S : String; Source_Location : String; Enclosing_Entity : String) return Boolean with Export, Convention => Ada, External_Name => "__drake_debug_default_put"; type Put_Handler is access function ( S : String; Source_Location : String; Enclosing_Entity : String) return Boolean; Put_Hook : not null Put_Handler := Default_Put'Access with Export, Convention => Ada, External_Name => "__drake_debug_put_hook"; procedure Put ( S : String; Source_Location : String := Debug.Source_Location; Enclosing_Entity : String := Debug.Enclosing_Entity) with Import, Convention => Ada, External_Name => "__drake_debug_put"; function Put ( S : String; Source_Location : String := Debug.Source_Location; Enclosing_Entity : String := Debug.Enclosing_Entity) return Boolean with Import, Convention => Ada, External_Name => "__drake_debug_put"; -- for compiler-units function Runtime_Error ( S : String; Source_Location : String := Debug.Source_Location; Enclosing_Entity : String := Debug.Enclosing_Entity) return Boolean with Export, Convention => Ada, External_Name => "__drake_runtime_error"; pragma Machine_Attribute (Runtime_Error, "noreturn"); pragma Inline_Always (Runtime_Error); -- [gcc-7] can not skip calling Raise_Assertion_Error after "noreturn" private function Put_Impl ( S : String; Source_Location : String := Debug.Source_Location; Enclosing_Entity : String := Debug.Enclosing_Entity) return Boolean with Export, Convention => Ada, External_Name => "__drake_debug_put"; end System.Debug;
other.7z/SFC.7z/SFC/ソースデータ/MarioKart/kart-obj-j.asm
prismotizm/gigaleak
0
6804
<filename>other.7z/SFC.7z/SFC/ソースデータ/MarioKart/kart-obj-j.asm<gh_stars>0 Name: kart-obj-j.asm Type: file Size: 60170 Last-Modified: '1992-07-14T15:00:00Z' SHA-1: DD4ABC0B9A5D7AB152038A655DB77ACC0545147F Description: null
programs/oeis/135/A135713.asm
karttu/loda
1
241060
<reponame>karttu/loda ; A135713: a(n) = n*(n+1)*(4*n+1)/2. ; 0,5,27,78,170,315,525,812,1188,1665,2255,2970,3822,4823,5985,7320,8840,10557,12483,14630,17010,19635,22517,25668,29100,32825,36855,41202,45878,50895,56265,62000,68112,74613,81515,88830,96570,104747,113373,122460,132020,142065,152607,163658,175230,187335,199985,213192,226968,241325,256275,271830,288002,304803,322245,340340,359100,378537,398663,419490,441030,463295,486297,510048,534560,559845,585915,612782,640458,668955,698285,728460,759492,791393,824175,857850,892430,927927,964353,1001720,1040040,1079325,1119587,1160838,1203090,1246355,1290645,1335972,1382348,1429785,1478295,1527890,1578582,1630383,1683305,1737360,1792560,1848917,1906443,1965150,2025050,2086155,2148477,2212028,2276820,2342865,2410175,2478762,2548638,2619815,2692305,2766120,2841272,2917773,2995635,3074870,3155490,3237507,3320933,3405780,3492060,3579785,3668967,3759618,3851750,3945375,4040505,4137152,4235328,4335045,4436315,4539150,4643562,4749563,4857165,4966380,5077220,5189697,5303823,5419610,5537070,5656215,5777057,5899608,6023880,6149885,6277635,6407142,6538418,6671475,6806325,6942980,7081452,7221753,7363895,7507890,7653750,7801487,7951113,8102640,8256080,8411445,8568747,8727998,8889210,9052395,9217565,9384732,9553908,9725105,9898335,10073610,10250942,10430343,10611825,10795400,10981080,11168877,11358803,11550870,11745090,11941475,12140037,12340788,12543740,12748905,12956295,13165922,13377798,13591935,13808345,14027040,14248032,14471333,14696955,14924910,15155210,15387867,15622893,15860300,16100100,16342305,16586927,16833978,17083470,17335415,17589825,17846712,18106088,18367965,18632355,18899270,19168722,19440723,19715285,19992420,20272140,20554457,20839383,21126930,21417110,21709935,22005417,22303568,22604400,22907925,23214155,23523102,23834778,24149195,24466365,24786300,25109012,25434513,25762815,26093930,26427870,26764647,27104273,27446760,27792120,28140365,28491507,28845558,29202530,29562435,29925285,30291092,30659868,31031625 mov $1,$0 mul $0,4 add $0,3 bin $0,2 sub $0,1 mul $1,$0 div $1,4
libsrc/_DEVELOPMENT/l/sccz80/crt0_long/l_long_ge.asm
jpoikela/z88dk
640
178124
; Z88 Small C+ Run Time Library ; Long functions ; SECTION code_clib SECTION code_l_sccz80 PUBLIC l_long_ge EXTERN l_long_cmp l_long_ge: ; PRIMARY >= SECONDARY [signed], carry if true ; logical operations: HL set to 0 (false) or 1 (true) call l_long_cmp ccf ret c scf ret z dec l ccf ret
test/data/source_files/functools.applescript
darricktheprogrammer/ASDoc
0
3184
<filename>test/data/source_files/functools.applescript (*! * @header * Library to add additional functional programming support to Applescript. * Contains helper functions that are able to be passed into `map()` and * `filter()`. These are duplicates of Applescript built-in functionality, but * because the built-in functionality are not first-class functions, they are * unable to be passed into functional programming tools. * * For example, there are helper functions for coercion such as `tostring(x)`. * Even though this is built into the language, the helper function is there * so it can be passed into `map()` like in the following example: * `map(funclib's tostring, theList)` will convert {1, 2, 3} to {"1", "2", "3"}. * * !!! warning: Any function passed to `map` or `filter` that is not * self contained (i.e., calls another function) will error out. Once the * function is passed to `functools`, it is then a property of the `functools` * library, meaning it no longer has access to any of the functions in it's own * library. Until a fix can be determined, only attempt to `map` or `filter` * using self contained functions. * * <NAME> http://www.exitcodeone.com * @unordered *) property version : "1.0" -- Helper functions (*! Return true if x is less than y *) on lt(x, y) return x < y end lt (*! Return true if x is less than or equal to y *) on lte(x, y) return x ≤ y end lte (*! Return true if x greater than y *) on gt(x, y) x > y end gt (*! Return true if x greater than or equal to y *) on gte(x, y) return x ≥ y end gte (*! Return true if x equals y *) on eq(x, y) return x = y end eq (*! Return true if x does not equal y *) on neq(x, y) return x ≠ y end neq (*! Return true if x is in the list ls *) on isin(x, ls) return x is in ls end isin (*! Return true if the list ls contains x *) on contains_(x, ls) return isin(x, ls) end contains_ (*! Return true if class of x cls *) on isclass(x, cls) return class of x is cls end isclass (*! Return the count of x *) on len(x) return (count x) end len (*! Coerce x to a string *) on tostring(x) return x as string end tostring (*! Coerce x to a real number *) on toreal(x) return x as real end toreal (*! Coerce x to an integer *) on toint(x) return x as integer end toint (*! Coerce x to a generic number *) on tonum(x) return x as number end tonum (*! Coerce x to a list *) on tolist(x) return x as list end tolist (*! * Object that is responsible for actually running a single function and returning a result. *) script _FunctionRunner property function : missing value (*! * Run a given function with a single argument. * * The arg will be an item in a list. * * @param f (Function): The function to run * @param arg (Any): An argument to the function * @return (Any) *) on runit(f, arg) set function to f return function(arg) end runit (*! * Run a given function with two arguments. * * The first argument will be the item from a list. The second will be an * extra argument needed for the function. This argument may be used as * a comparison point or operator against the first argument. * * @param f (Function): The function to run * @param arg (Any): An argument to the function * @param extra_arg (Any): The second argument. Either a comparison point or * operator against the first argument * @return (Any) *) on runwitharg(f, arg, extra_arg) set function to f return function(arg, extra_arg) end runwitharg end script (*! * Create a new list by passing each item of a list through a function. * * @example map(tostring, {1, 2, 3}) * --> {"1", "2", "3"} * * @example map(len, {"hello", "world", "I'm", "here"}) * --> {5, 5, 3, 4} * * @param f (Function): * @param ls (List): * @return (List) *) on map(f, ls) if ls = {} then return ls end if return {_FunctionRunner's runit(f, item 1 of ls)} & map(f, rest of ls) end map (*! * Create a list from ls for each item that returns true when passed through f * * @example filter(is_even, {1, 2, 3}) * --> {2} * * @param f (Function): * @param ls (List): * @return (List) *) on filter(f, ls) if ls = {} then return {} else if not _FunctionRunner's runit(f, item 1 of ls) then return {} & filter(f, rest of ls) else return {item 1 of ls} & filter(f, rest of ls) end if end filter (*! * Same as `map()`, but with an additional argument. * * The last argument will be supplied as a second argument to the function. * * @example mapWithArg(add_value, {1, 2, 3}, 2) * --> {3, 4, 5} * * @param f (Function): * @param ls (List): * @param arg (Any): * @return (List) *) on mapWithArg(f, ls, arg) if ls = {} then return ls end if return _FunctionRunner's runwitharg(f, item 1 of ls, arg) & mapWithArg(f, rest of ls, arg) end mapWithArg (*! * Same as `filter()`, but with an additional argument. * * The additional argument is usually used to make a comparison to the * original value. * * @example filterWithArg(lte, {1, 2, 3, 4, 5, 6}, 4) * --> {1, 2, 3, 4} * * @param f (Function): * @param ls (List): * @param arg (Any): * @return (List) *) on filterWithArg(f, ls, arg) if ls = {} then return {} else if not _FunctionRunner's runwitharg(f, item 1 of ls, arg) then return {} & filterWithArg(f, rest of ls, arg) else return {item 1 of ls} & filterWithArg(f, rest of ls, arg) end if end filterWithArg
scripts/hello_world.applescript
prajjyadav/AvengersAssemble
41
2161
<reponame>prajjyadav/AvengersAssemble<filename>scripts/hello_world.applescript<gh_stars>10-100 # LANGUAGE: applescript # AUTHOR : <NAME> # GITHUB : https://github.com/packetChor display dialog "Hello World" # audio message using the computer voice # say "Hello, world!"
Cubical/HITs/2GroupoidTruncation.agda
dan-iel-lee/cubical
0
11586
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.2GroupoidTruncation where open import Cubical.HITs.2GroupoidTruncation.Base public open import Cubical.HITs.2GroupoidTruncation.Properties public
agda/Montuno.agda
halfaya/MusicTools
28
2973
<filename>agda/Montuno.agda {-# OPTIONS --cubical #-} module Montuno where open import Data.Fin using (#_) open import Data.Integer using (+_) open import Data.List using (List; _∷_; []; map; concat; _++_; replicate; zip) open import Data.Nat using (_*_; ℕ; suc; _+_) open import Data.Product using (_,_) open import Function using (_∘_) open import Note {- double : List Chord → List Chord double = map (λ c → flatten (c ∷ (transposeChord (+ chromaticScaleSize) c) ∷ [])) -- add the base note of the first chord to the first chord, transposed up 2 octaves add2octave : List Chord → List Chord add2octave [] = [] add2octave cs@(chord [] ∷ _) = cs add2octave (c@(chord (n ∷ ns)) ∷ cs) = (appendNote (transpose (+ (chromaticScaleSize * 2)) n) c) ∷ cs baseOctave : Chord baseOctave = chord (map (note ∘ +_ ∘ (_* chromaticScaleSize)) (0 ∷ 1 ∷ 2 ∷ [])) makeUnit : {n : ℕ} → Scale (suc n) → (Chord → List Chord) → ScaleDegree (suc n) → List Chord makeUnit scale f = add2octave ∘ double ∘ f ∘ relativeChordToChord ∘ triad scale ∘ (λ d → (d , octave (+ 0))) -- TODO: See if we can use the one in Data.List _≫=_ : {A B : Set} → List A → (A → List B) → List B xs ≫= f = concat (map f xs) make2 : {n : ℕ} → Scale (5 + n) → (Chord → List Chord) → ScaleDegree (5 + n) → List Chord make2 scale f secondScaleDegree = let scaleDegrees = secondScaleDegree ∷ map scaleDegree (# 4 ∷ # 3 ∷ []) in makeUnit scale f (scaleDegree (# 0)) ++ (scaleDegrees ≫= makeUnit scale oompah) ++ (baseOctave ∷ []) rhythm rhythma : List Duration rhythm = map duration (+ 2 ∷ + 1 ∷ (replicate 6 (+ 2) ++ (+ 1 ∷ []))) rhythma = map duration (+ 1 ∷ + 1 ∷ + 1 ∷ (replicate 6 (+ 2) ++ (+ 1 ∷ []))) ex8 ex9 ex10 : {n : ℕ} → Scale (5 + n) → List TimedChord ex8 scale = zip (make2 scale oompah (scaleDegree (# 3))) rhythm ex9 scale = zip (make2 scale arpegiate (scaleDegree (# 3))) rhythm ex10 scale = zip (make2 scale arpegiate (scaleDegree (# 1))) rhythma ++ ex8 scale -}
java/JavaComment.g4
dev10/comment-extraction
0
7275
<gh_stars>0 grammar JavaComment; /* * Parser Rules */ sourceFile : ignoredPreamble (comment ignored)+ ; comment : blockComment codeDeclaration (ignoredPreamble comment)* ; blockComment : '\n' BLOCK_COMMENT '\n' ; codeDeclaration : TEXT ; ignored : '{' ~'\n//'*? ; ignoredPreamble : ~'*/\n'*? | ~'/**'*? ; LINE_COMMENT : '//' .*? '\r'? '\n' -> skip ; BLOCK_COMMENT : WS? '/**' .*? '*/' ; END_SYMBOL : '{' | ';' ; TEXT : [ \t0-9<>\-_.~^#@=*|+:,`'"&a-zA-Z()/\\!%[\]]+ ('\n' TEXT END_SYMBOL)? ; WS : [ \t]+ -> skip ; NL : '\r'? '\n' ; IGNORED : [ a-zA-Z()+}] ;
kernel/arch/x86_64/mm/pagefault.asm
racing19th/MiraiOS
12
93764
<filename>kernel/arch/x86_64/mm/pagefault.asm global excPF:function global _userAcc:function extern puts extern hexprintln extern hexprintln64 extern cprint extern panic extern printk extern puts extern pfExit extern mmGetEntry extern allocPhysPage extern allocCleanPhysPage extern allocLargePhysPage extern allocLargeCleanPhysPage extern mmDoCOW extern mmGetPageEntry extern panicStack %define endl 10, 0 %define NROF_PAGE_LEVELS 4 SECTION .text invAlloc: mov rdi, invAllocMsg call puts jmp $ excPF: push rax push rcx push rdx push rsi push rdi push r8 push r9 push r10 push r11 push rbx push r12 mov rax, 0xffffffff80000000 cmp [rsp + 0x60], rax jae .noswapgs swapgs or [rsp + 0x80], dword 3 .noswapgs: ;Check error code mov eax, [rsp + 0x58] cmp eax, 7 je .writeFault test eax, 1 jnz .error mov ebx, NROF_PAGE_LEVELS - 1 .L1: mov rdi, cr2 mov esi, ebx call mmGetEntry ;rax contains pointer to pte mov r12, rax mov rax, [rax] test eax, 0x01 ;present flag jnz .L2 test eax, (1 << 9) ;inuse flag jz .error ;give error if not in use cmp ebx, 0 jne .L3 test eax, (1 << 10) ;clean flag jz .L4 call allocCleanPhysPage jmp .L7 .L4: call allocPhysPage jmp .L7 .L3: cmp ebx, 1 jne invAlloc test eax, (1 << 10) ;clean flag jz .L6 ;call allocLargeCleanPhysPage jmp .L7 .L6: call allocLargePhysPage .L7: mov rdx, 0xFFF0000000000FFF or rax, 1 ;set present bit and [r12], rdx ;clear address field or [r12], rax ;OR it with new address + present bit jmp .return .L2: sub ebx, 1 jns .L1 ;page already alloced mov rdi, weirdPF call puts jmp $ .writeFault: mov rdi, cr2 call mmDoCOW test eax, eax jnz .error .return: xor rdi, rdi mov cr2, rdi mov rax, 0xffffffff80000000 cmp [rsp + 0x60], rax jae .noswapgs2 swapgs .noswapgs2: pop r12 pop rbx pop r11 pop r10 pop r9 pop r8 pop rdi pop rsi pop rdx pop rcx pop rax add rsp, 8 ;jump over error code iretq .error: add rsp, 0x58 mov rcx, [gs:8] test ecx, ecx jz .noCatch mov rax, [rcx + 0x238] ;userAccBuf test rax, rax jz .noCatch ;page fault during USER_ACC add rsp, 8 ;error code mov r15, [rax] mov r14, [rax + 0x08] mov r13, [rax + 0x10] mov r12, [rax + 0x18] mov rbp, [rax + 0x20] mov rbx, [rax + 0x28] mov rdx, [rax + 0x30] ;rip mov [rsp], rdx ;return rip mov qword [rcx + 0x238], 0 mov eax, -10 ;-EFAULT iretq .noCatch: mov rdi, PFmsg2 mov rsi, cr2 mov rdx, [rsp + 8] mov rcx, [rsp] mov rax, 0xffffffff80000000 cmp rdx, rax jae .panic call printk mov rdi, cr2 mov rsi, [rsp + 8] call pfExit .panic: mov rax, [rsp + 0x20] mov [panicStack], rax call panic jmp $ _userAcc: ;(struct UserAccBuf *buf) mov rax, [rsp] mov rdx, [gs:8] test rdx, rdx jz .ret mov [rdi], r15 mov [rdi + 0x08], r14 mov [rdi + 0x10], r13 mov [rdi + 0x18], r12 mov [rdi + 0x20], rbp mov [rdi + 0x28], rbx mov [rdi + 0x30], rax ;ret addr mov [rdx + 0x238], rdi .ret: xor eax, eax ret SECTION .rodata PFmsg2: db 'Page fault cr2:%X rip:%X error:%x', 10, 0 invAllocMsg: db 'Invalid page alloc', endl weirdPF: db 'Weird Page fault occurred!', endl
wof/lcs/enemy/8B.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
93934
copyright zengfr site:http://github.com/zengfr/romhack 007B7C jsr $f98.w [enemy+8B] 007C0A jsr $f98.w [enemy+8B] 012382 rts [123p+ 8B, enemy+8B] 0123FA cmpi.b #$50, ($8b,A0) [enemy+8B] 012400 blt $123e8 [enemy+8B] 01B5C4 bge $1b6a6 [enemy+8B] 01C27A bge $1c3ca [enemy+8B] 01C37A bge $1c3ca 01D1AA bge $1d28c [enemy+8B] copyright zengfr site:http://github.com/zengfr/romhack
src/shaders/h264/mc/interpolate_C_4x4.asm
tizenorg/platform.upstream.libva-intel-driver
0
90593
<reponame>tizenorg/platform.upstream.libva-intel-driver<filename>src/shaders/h264/mc/interpolate_C_4x4.asm /* * Interpolation kernel for chrominance 4x4 motion compensation * Copyright © <2010>, Intel Corporation. * * This program is licensed under the terms and conditions of the * Eclipse Public License (EPL), version 1.0. The full text of the EPL is at * http://www.opensource.org/licenses/eclipse-1.0.php. * */ // Kernel name: Interpolate_C_4x4_Func.asm // // Interpolation kernel for chrominance 4x4 motion compensation // // $Revision: 8 $ // $Date: 10/09/06 4:00p $ // //#if !defined(__Interpolate_C_4x4_Func__) // Make sure this is only included once //#define __Interpolate_C_4x4_Func__ INTERLABEL(Interpolate_C_4x4_Func): // (8-xFrac) and (8-yFrac) add (2) gW0<1>:w gMVX_FRACC<2;2,1>:w -0x08:w // Compute the GRF address of the starting position of the reference area mov (1) pREF0:w nOFFSET_REFC:w {NoDDClr} mov (1) pREF1:uw nOFFSET_REFC+16:w {NoDDChk,NoDDClr} mov (1) pRESULT:uw gpINTPC:uw {NoDDChk} // gCOEFA = (8-xFrac)*(8-yFrac) // gCOEFB = xFrac*(8-yFrac) // gCOEFC = (8-xFrac)*yFrac // gCOEFD = xFrac*yFrac mul (1) gCOEFD:w gMVX_FRACC:w gMVY_FRACC:w {NoDDClr} mul (1) gCOEFA:w -gW0:w -gW1:uw {NoDDClr,NoDDChk} mul (1) gCOEFB:w gMVX_FRACC:w -gW1:uw {NoDDClr,NoDDChk} mul (1) gCOEFC:w -gW0:w gMVY_FRACC:w {NoDDChk} add (2) gW0<1>:uw pREF0<2;2,1>:uw 16:w // (8-xFrac)*(8-yFrac)*A // --------------------- mul (16) acc0<1>:uw r[pREF0,0]<16;8,1>:ub gCOEFA:uw mul (16) acc1<1>:uw r[pREF0,nGRFWIB]<16;8,1>:ub gCOEFA:uw // xFrac*(8-yFrac)*B // ------------------- mac (16) acc0<1>:uw r[pREF0,2]<16;8,1>:ub gCOEFB:uw mac (16) acc1<1>:uw r[pREF0,nGRFWIB+2]<16;8,1>:ub gCOEFB:uw // (8-xFrac)*yFrac*C // ------------------- mov (2) pREF0<1>:uw gW0<2;2,1>:uw mac (16) acc0<1>:uw r[pREF0,0]<8,1>:ub gCOEFC:uw mac (16) acc1<1>:uw r[pREF0,nGRFWIB]<8,1>:ub gCOEFC:uw // xFrac*yFrac*D // ----------------- mac (16) r[pRESULT]<1>:uw r[pREF0,2]<8,1>:ub gCOEFD:uw mac (16) r[pRESULT,GRFWIB]<1>:uw r[pREF0,nGRFWIB+2]<8,1>:ub gCOEFD:uw {SecHalf} //#endif // !defined(__Interpolate_C_4x4_Func__)
alloy4fun_models/trainstlt/models/8/x9D5JLxy88jFwHjmt.als
Kaixi26/org.alloytools.alloy
0
2820
open main pred idx9D5JLxy88jFwHjmt_prop9 { always ( all t:Train | no t.pos implies eventually (t.pos in Entry) ) } pred __repair { idx9D5JLxy88jFwHjmt_prop9 } check __repair { idx9D5JLxy88jFwHjmt_prop9 <=> prop9o }
language/antlr/Template.g4
uiuc-arc/probfuzz
12
5511
grammar Template; DISTRIBUTION: 'bernoulli' | 'normal' | 'invgamma' | 'gamma' ; INTEGERTYPE: 'int'; FLOATTYPE: 'float'; INT : [\-]?[0-9]+; DOUBLE : [\-]?([0-9]? '.' [0-9]+) | ([1-9][0-9]* '.' [0-9]+) | [0-9]+'E'[0-9]+ ; DISTHOLE: 'DIST'; CONSTHOLE: 'CONST'; DISTXHOLE: 'DISTX'; AOP: '+' | '-' | '*'; BOP: '>=' | '<=' | '<' | '>' | '=='; WS : [ \n\t\r]+ -> channel(HIDDEN) ; ID: [a-zA-Z]+[a-zA-Z0-9_]*; primitive: INTEGERTYPE | FLOATTYPE; number: INT | DOUBLE | CONSTHOLE; dims: INT (',' INT)*; dtype: primitive | (primitive '[' dims ']'); array : '[' number ( ',' number )* ']'; data: ID ':' dtype | ID ':' expr | ID ':' array ; param: CONSTHOLE | expr; params: param (',' param )*; distexpr: (DISTHOLE | DISTRIBUTION) '(' params ')' ('[' dims ']')? | DISTXHOLE ('[' dims ']')?; expr: number #val | ID #ref | expr AOP expr #arith | expr BOP expr #comp ; assign: ID '=' distexpr | ID '=' expr; prior: ID ':=' distexpr ; lrmodel: 'observe' '(' distexpr ',' ID ')'; condmodel: 'if' '(' expr ')' 'then' model 'else' model; model: lrmodel | condmodel | assign; query: ('posterior' | 'expectation') '(' ID ')' ; template : data+ prior+ model* query+;
km.asm
adkennan/BurgerMayhem
0
103196
incasm "macros.asm" incasm "sys_constants.asm" incasm "game_constants.asm" incasm "zero.asm" *=$0801 BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32 BYTE $33, $30, $34, $29, $00, $00, $00 *=$0900 jsr INIT_SYSTEM LOOP @is_title lda G_GAME_STATE cmp #GS_TITLE bne @is_start_game jsr TITLE @is_start_game lda G_GAME_STATE cmp #GS_START_GAME bne @is_pre_level jsr START_GAME @is_pre_level lda G_GAME_STATE cmp #GS_PRE_LEVEL bne @is_running jsr PRE_LEVEL @is_running lda G_GAME_STATE cmp #GS_RUNNING bne @is_post_level jsr RUN_LEVEL @is_post_level lda G_GAME_STATE cmp #GS_POST_LEVEL bne @is_game_over jsr POST_LEVEL @is_game_over lda G_GAME_STATE cmp #GS_GAME_OVER bne @done jsr GAME_OVER @done jmp LOOP incasm "game.asm" incasm "init.asm" incasm "player.asm" incasm "screen.asm" incasm "util.asm" *=$3000 incasm "levels.asm" incasm "themes.asm" incasm "maps.asm" incasm "strings.asm" incasm "lookup.asm" *=$4800 incasm "sprites.asm" *=$6800 incasm "chars.asm"
g-traceb.adb
ytomino/gnat4drake
0
18140
with System.Unwind.Backtrace; -- implementation unit package body GNAT.Traceback is procedure Call_Chain ( Traceback : out Tracebacks_Array; Len : out Natural) is X : System.Unwind.Exception_Occurrence; T_Index : Integer; begin System.Unwind.Backtrace.Call_Chain (X); Len := Integer'Min (X.Num_Tracebacks, Traceback'Length); T_Index := Traceback'First; for I in 1 .. Len loop Traceback (T_Index) := X.Tracebacks (I); T_Index := T_Index + 1; end loop; end Call_Chain; end GNAT.Traceback;
Sample/Platform/DUET/Library/Paging/Ia32/Cpu.asm
bitcrystal/edk
14
26330
title Cpu.asm ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation ; All rights reserved. This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at ; http://opensource.org/licenses/bsd-license.php ; ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; ; Module Name: ; Cpu.asm ; ; Abstract: ; ;------------------------------------------------------------------------------ .686 .MODEL FLAT,C .CODE ;------------------------------------------------------------------------------ ; VOID * ; GetPageTableBase ( ; VOID ; ) ;------------------------------------------------------------------------------ GetPageTableBase PROC PUBLIC mov eax, cr3 ret GetPageTableBase ENDP END
MSP430F541xA_MSP430F543xA_Code_Examples/Assembly_CCS/msp430x54xA_ta3_13.asm
sususweet/MSP430F541x-MSP430F543x-Code-Examples
0
103096
; --COPYRIGHT--,BSD_EX ; Copyright (c) 2012, Texas Instruments Incorporated ; 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 Texas Instruments Incorporated nor the names of ; its contributors may be used to endorse or promote products derived ; from this software without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ****************************************************************************** ; ; MSP430 CODE EXAMPLE DISCLAIMER ; ; MSP430 code examples are self-contained low-level programs that typically ; demonstrate a single peripheral function or device feature in a highly ; concise manner. For this the code may rely on the device's power-on default ; register values and settings such as the clock configuration and care must ; be taken when combining code from several examples to avoid potential side ; effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware ; for an API functional library-approach to peripheral configuration. ; ; --/COPYRIGHT-- ;****************************************************************************** ; MSP430F54xA Demo - Timer_A3, Toggle P2.1/TA1.0, Up/Down Mode, DCO SMCLK ; ; Description: Toggle P2.1 using hardware TA1.0 output. Timer1_A is configured ; for up/down mode with CCR0 defining period, TA1.0 also output on P1.1. In ; this example, CCR0 is loaded with 250 and TA1.0 will toggle P1.1 at ; TACLK/2*250. Thus the output frequency on P1.1 will be the TACLK/1000. ; No CPU or software resources required. ; As coded with TACLK = SMCLK, P2.1 output frequency is ~1.045M/1000. ; SMCLK = MCLK = TACLK = default DCO ~1.045MHz ; ; MSP430F5438A ; ------------------- ; /|\| | ; | | | ; --|RST | ; | | ; | P2.1/TA1.0|--> SMCLK/1000 ; ; <NAME> ; Texas Instruments Inc. ; December 2009 ; Built with CCS Version: 4.0.2 ;****************************************************************************** .cdecls C,LIST,"msp430.h" ;------------------------------------------------------------------------------- .def RESET ; Export program entry-point to ; make it known to linker. ;------------------------------------------------------------------------------- .global _main .text ; Assemble to Flash memory ;------------------------------------------------------------------------------- _main RESET mov.w #0x5C00,SP ; Initialize stackpointer mov.w #WDTPW + WDTHOLD,&WDTCTL; Stop WDT bis.b #BIT1,&P2DIR ; P2.1 output bis.b #BIT1,&P2SEL ; P2.1 option select mov.w #OUTMOD_4,&TA1CCTL0 ; CCR0 toggle mode mov.w #250,&TA1CCR0 mov.w #TASSEL_2 + MC_3 + TACLR,&TA1CTL ; SMCLK, up-downmode, clear TAR bis.w #LPM0,SP ; Enter LPM0 nop ; For debugger ;------------------------------------------------------------------------------- ; Interrupt Vectors ;------------------------------------------------------------------------------- .sect ".reset" ; POR, ext. Reset .short RESET .end
src/Yoneda.agda
myuon/agda-cate
2
2834
<gh_stars>1-10 module Yoneda where open import Level open import Data.Product open import Relation.Binary import Relation.Binary.SetoidReasoning as SetR open Setoid renaming (_≈_ to eqSetoid) open import Basic open import Category import Functor import Nat open Category.Category open Functor.Functor open Nat.Nat open Nat.Export yoneda : ∀{C₀ C₁ ℓ} (C : Category C₀ C₁ ℓ) → Functor.Functor C PSh[ C ] yoneda C = record { fobj = λ x → Hom[ C ][-, x ] ; fmapsetoid = λ {A} {B} → record { mapping = λ f → HomNat[ C ][-, f ] ; preserveEq = λ {x} {y} x₁ x₂ → begin⟨ C ⟩ Map.mapping (component HomNat[ C ][-, x ] _) x₂ ≈⟨ refl-hom C ⟩ C [ x ∘ x₂ ] ≈⟨ ≈-composite C x₁ (refl-hom C) ⟩ C [ y ∘ x₂ ] ≈⟨ refl-hom C ⟩ Map.mapping (component HomNat[ C ][-, y ] _) x₂ ∎ } ; preserveId = λ x → leftId C ; preserveComp = λ x → assoc C } YonedaLemma : ∀{C₀ C₁ ℓ} {C : Category C₀ C₁ ℓ} {F : Obj PSh[ C ]} {X : Obj C} → Setoids [ Homsetoid [ op C , Setoids ] (fobj (yoneda C) X) F ≅ LiftSetoid {C₁} {suc (suc ℓ) ⊔ (suc (suc C₁) ⊔ suc C₀)} {ℓ} {C₀ ⊔ C₁ ⊔ ℓ} (fobj F X) ] YonedaLemma {C₀} {C₁} {ℓ} {C} {F} {X} = record { map-→ = nat→obj ; map-← = obj→nat ; proof = obj→obj≈id , nat→nat≈id } where nat→obj : Map.Map (Homsetoid [ op C , Setoids ] (fobj (yoneda C) X) F) (LiftSetoid (fobj F X)) nat→obj = record { mapping = λ α → lift (Map.mapping (component α X) (id C)) ; preserveEq = λ x≈y → lift (x≈y (id C)) } obj→nat : Map.Map (LiftSetoid (fobj F X)) (Homsetoid [ op C , Setoids ] (fobj (yoneda C) X) F) obj→nat = record { mapping = λ a → record { component = component-map a ; naturality = λ {c} {d} {f} x → SetR.begin⟨ fobj F d ⟩ Map.mapping (Setoids [ component-map a d ∘ fmap (fobj (yoneda C) X) f ]) x SetR.≈⟨ refl (fobj F d) ⟩ Map.mapping (Map.mapping (fmapsetoid F) (C [ x ∘ f ])) (lower a) SetR.≈⟨ (preserveComp F) (lower a) ⟩ Map.mapping (Map.mapping (fmapsetoid F) f) (Map.mapping (Map.mapping (fmapsetoid F) x) (lower a)) SetR.≈⟨ refl (fobj F d) ⟩ Map.mapping (Setoids [ fmap F f ∘ component-map a c ]) x SetR.∎} ; preserveEq = λ {x} {y} x≈y f → SetR.begin⟨ fobj F _ ⟩ Map.mapping (component-map x _) f SetR.≈⟨ refl (fobj F _) ⟩ Map.mapping (Map.mapping (fmapsetoid F) f) (lower x) SetR.≈⟨ Map.preserveEq (fmap F f) (lower x≈y) ⟩ Map.mapping (Map.mapping (fmapsetoid F) f) (lower y) SetR.≈⟨ refl (fobj F _) ⟩ Map.mapping (component-map y _) f SetR.∎} where component-map = λ a b → record { mapping = λ u → Map.mapping (fmap F u) (lower a) ; preserveEq = λ {x} {y} x≈y → SetR.begin⟨ fobj F b ⟩ Map.mapping (fmap F x) (lower a) SetR.≈⟨ (Functor.preserveEq F x≈y) (lower a) ⟩ Map.mapping (fmap F y) (lower a) SetR.∎ } obj→obj≈id : Setoids [ Setoids [ nat→obj ∘ obj→nat ] ≈ id Setoids ] obj→obj≈id = λ x → lift (SetR.begin⟨ fobj F X ⟩ lower (Map.mapping (Setoids [ nat→obj ∘ obj→nat ]) x) SetR.≈⟨ refl (fobj F X) ⟩ Map.mapping (Map.mapping (fmapsetoid F) (id C)) (lower x) SetR.≈⟨ (preserveId F) (lower x) ⟩ lower x SetR.≈⟨ refl (fobj F X) ⟩ lower (Map.mapping {A = LiftSetoid {ℓ′ = ℓ} (fobj F X)} (id Setoids) x) SetR.∎) nat→nat≈id : Setoids [ Setoids [ obj→nat ∘ nat→obj ] ≈ id Setoids ] nat→nat≈id α f = SetR.begin⟨ fobj F _ ⟩ Map.mapping (component (Map.mapping (Setoids [ obj→nat ∘ nat→obj ]) α) _) f SetR.≈⟨ refl (fobj F _) ⟩ Map.mapping (Setoids [ fmap F f ∘ component α X ]) (id C) SetR.≈⟨ lemma (id C) ⟩ Map.mapping (Setoids [ component α (dom C f) ∘ fmap (fobj (yoneda C) X) f ]) (id C) SetR.≈⟨ Map.preserveEq (component α (dom C f)) (leftId C) ⟩ Map.mapping (component α (dom C f)) f SetR.≈⟨ refl (fobj F _) ⟩ Map.mapping (component (Map.mapping (id Setoids {Homsetoid [ (op C) , Setoids ] _ _}) α) (dom C f)) f SetR.∎ where lemma : Setoids [ Setoids [ fmap F f ∘ component α X ] ≈ Setoids [ component α (dom C f) ∘ fmap (fobj (yoneda C) X) f ] ] lemma = sym-hom Setoids {f = Setoids [ component α (dom C f) ∘ fmap (fobj (yoneda C) X) f ]} {g = Setoids [ fmap F f ∘ component α X ]} (naturality α)
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_2659_491.asm
ljhsiun2/medusa
9
14539
<filename>Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_2659_491.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r12 push %rax push %rbp push %rcx lea addresses_D_ht+0xf410, %rax nop xor %r12, %r12 vmovups (%rax), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %rbp nop sub $9745, %rcx pop %rcx pop %rbp pop %rax pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r9 push %rdx push %rsi // Faulty Load lea addresses_normal+0x15810, %r12 nop nop nop nop nop inc %rdx mov (%r12), %si lea oracles, %r11 and $0xff, %rsi shlq $12, %rsi mov (%r11,%rsi,1), %rsi pop %rsi pop %rdx pop %r9 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'34': 2659} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
ADA_RC_Car/src/sensor_behind.ads
Intelligente-sanntidssystemer/Ada-prosjekt
0
22230
<gh_stars>0 package sensor_behind is function HCSR04_Behind_Distance return float; end sensor_behind;