max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
test/Test/Compile/Golden/simple-arithmetic/simple-arithmetic-output.agda
vehicle-lang/vehicle
9
2332
<filename>test/Test/Compile/Golden/simple-arithmetic/simple-arithmetic-output.agda -- WARNING: This file was generated automatically by Vehicle -- and should not be modified manually! -- Metadata -- - Agda version: 2.6.2 -- - AISEC version: 0.1.0.1 -- - Time generated: ??? {-# OPTIONS --allow-exec #-} open import Vehicle open import Data.Integer as ℤ using (ℤ) open import Data.Rational as ℚ using (ℚ) module simple-arithmetic-temp-output where precedence : ℚ → (ℚ → (ℚ → ℚ)) precedence x y z = (x ℚ.+ (ℤ.+ 2 ℚ./ 1) ℚ.* y) ℚ.- z ℚ.÷ y
alloy4fun_models/trashltl/models/10/ES6Puggn4XshZgsBx.als
Kaixi26/org.alloytools.alloy
0
2127
<gh_stars>0 open main pred idES6Puggn4XshZgsBx_prop11 { Protected' = Protected +(File - Protected) } pred __repair { idES6Puggn4XshZgsBx_prop11 } check __repair { idES6Puggn4XshZgsBx_prop11 <=> prop11o }
oeis/006/A006172.asm
neoneye/loda-programs
11
13545
<gh_stars>10-100 ; A006172: a(n) = 1 + F(2*n+1) + (-1)^n*L(n). ; Submitted by <NAME> ; 4,2,9,10,42,79,252,582,1645,4106,11070,28459,75348,195898,515073,1344906,3526786,9223895,24163596,63236638,165595269,433469962,1134942774,2971150995,7778845732,20364843314,53316562617,139583423242,365436006810,956720876191,2504732642460 mov $2,-1 lpb $0 sub $0,1 add $4,1 add $4,$1 add $1,$4 add $4,1 max $5,$1 add $1,1 add $5,$2 mov $2,$3 add $2,$4 sub $5,$4 sub $5,$3 mov $3,$5 lpe mov $0,$3 add $0,4
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c35503k.ada
best08618/asylo
7
1734
-- C35503K.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT 'POS' AND 'VAL' YIELD THE CORRECT RESULTS WHEN THE -- PREFIX IS AN INTEGER TYPE. -- HISTORY: -- RJW 03/17/86 CREATED ORIGINAL TEST. -- DHH 10/19/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS. -- PWN 11/30/94 REMOVED ATTRIBUTE TESTS ILLEGAL IN ADA 9X. WITH SYSTEM; USE SYSTEM; WITH REPORT; USE REPORT; PROCEDURE C35503K IS BEGIN TEST ("C35503K", "CHECK THAT 'POS' AND 'VAL' YIELD THE " & "CORRECT RESULTS WHEN THE PREFIX IS AN " & "INTEGER TYPE" ); DECLARE TYPE INT IS RANGE -6 .. 6; SUBTYPE SINT IS INT RANGE -4 .. 4; PROCEDURE P (I : INTEGER; STR : STRING) IS BEGIN BEGIN IF INTEGER'POS (I) /= I THEN FAILED ( "WRONG POS FOR " & STR); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED FOR POS OF " & STR); END; BEGIN IF INTEGER'VAL (I) /= I THEN FAILED ( "WRONG VAL FOR " & STR); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED FOR VAL OF " & STR); END; END P; BEGIN P ( INTEGER'FIRST, "INTEGER'FIRST"); P ( INTEGER'LAST, "INTEGER'LAST"); P ( 0, "'0'"); FOR I IN INT'FIRST .. INT'LAST LOOP BEGIN IF SINT'POS (I) /= I THEN FAILED ( "WRONG POS FOR " & INT'IMAGE (I)); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED FOR POS OF " & INT'IMAGE (I)); END; BEGIN IF SINT'VAL (I) /= I THEN FAILED ( "WRONG VAL FOR " & INT'IMAGE (I)); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED FOR VAL OF " & INT'IMAGE (I)); END; END LOOP; BEGIN IF INT'VAL (INTEGER'(0)) /= 0 THEN FAILED ( "WRONG VAL FOR INT WITH INTEGER" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED FOR VAL OF " & "INT WITH INTEGER" ); END; BEGIN IF INTEGER'VAL (INT'(0)) /= 0 THEN FAILED ( "WRONG VAL FOR INTEGER WITH INT" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED FOR VAL OF " & "INTEGER WITH INT" ); END; END; RESULT; END C35503K;
agda-stdlib/src/Foreign/Haskell/Either.agda
DreamLinuxer/popl21-artifact
5
1967
<gh_stars>1-10 ------------------------------------------------------------------------ -- The Agda standard library -- -- The Either type which calls out to Haskell via the FFI ------------------------------------------------------------------------ {-# OPTIONS --without-K #-} module Foreign.Haskell.Either where open import Level open import Data.Sum.Base using (_⊎_; inj₁; inj₂) private variable a b : Level A : Set a B : Set b ------------------------------------------------------------------------ -- Definition data Either (A : Set a) (B : Set b) : Set (a ⊔ b) where left : A → Either A B right : B → Either A B {-# FOREIGN GHC type AgdaEither l1 l2 a b = Either a b #-} {-# COMPILE GHC Either = data MAlonzo.Code.Foreign.Haskell.Either.AgdaEither (Left | Right) #-} ------------------------------------------------------------------------ -- Conversion toForeign : A ⊎ B → Either A B toForeign (inj₁ a) = left a toForeign (inj₂ b) = right b fromForeign : Either A B → A ⊎ B fromForeign (left a) = inj₁ a fromForeign (right b) = inj₂ b
oeis/109/A109499.asm
neoneye/loda-programs
11
22275
<filename>oeis/109/A109499.asm ; A109499: Number of closed walks of length n on the complete graph on 5 nodes from a given node. ; Submitted by <NAME> ; 1,0,4,12,52,204,820,3276,13108,52428,209716,838860,3355444,13421772,53687092,214748364,858993460,3435973836,13743895348,54975581388,219902325556,879609302220,3518437208884,14073748835532,56294995342132,225179981368524,900719925474100,3602879701896396,14411518807585588,57646075230342348,230584300921369396,922337203685477580,3689348814741910324,14757395258967641292,59029581035870565172,236118324143482260684,944473296573929042740,3777893186295716170956,15111572745182864683828 mov $1,-4 pow $1,$0 add $1,4 mov $2,-1 bin $2,$0 mul $1,$2 mov $0,$1 div $0,5
source/strings/a-susfma.ads
ytomino/drake
33
17506
pragma License (Unrestricted); -- extended unit with Ada.Strings.Functions.Maps; package Ada.Strings.Unbounded_Strings.Functions.Maps is new Generic_Maps (Strings.Functions.Maps); pragma Preelaborate (Ada.Strings.Unbounded_Strings.Functions.Maps);
cards/bn4/ModCards/134-A015 PanelChange Cracked (0D).asm
RockmanEXEZone/MMBN-Mod-Card-Kit
10
160247
<filename>cards/bn4/ModCards/134-A015 PanelChange Cracked (0D).asm .include "defaults_mod.asm" table_file_jp equ "exe4-utf8.tbl" table_file_en equ "bn4-utf8.tbl" game_code_len equ 3 game_code equ 0x4234574A // B4WJ game_code_2 equ 0x42345745 // B4WE game_code_3 equ 0x42345750 // B4WP card_type equ 1 card_id equ 15 card_no equ "015" card_sub equ "Mod Card 015" card_sub_x equ 64 card_desc_len equ 3 card_desc_1 equ "Address 0D" card_desc_2 equ "PanelChange:" card_desc_3 equ "Cracked" card_name_jp_full equ "パネルチェンジ:ヒビ" card_name_jp_game equ "パネルチェンジ:ヒビ" card_name_en_full equ "PanelChange: Cracked" card_name_en_game equ "PanelChange: Cracked" card_address equ "0D" card_address_id equ 3 card_bug equ 0 card_wrote_en equ "PanelChange: Cracked" card_wrote_jp equ "パネルチェンジ:ヒビ"
programs/oeis/063/A063245.asm
karttu/loda
0
240906
<gh_stars>0 ; A063245: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 98 ). ; 3,10,18,23,31,38,44,51,59,64,72,79,85,92,100,105,113,120,126,133,141,146,154,161,167,174,182,187,195,202,208,215,223,228,236,243,249,256,264,269,277,284,290,297,305,310,318,325,331,338 mov $1,$0 mov $2,$0 mov $5,$0 mul $0,2 mov $3,3 mov $4,$0 lpb $2,1 lpb $4,1 add $1,1 add $2,1 trn $4,$3 lpe lpb $0,1 trn $0,4 sub $1,1 add $1,$2 trn $2,$1 lpe lpe lpb $5,1 add $1,4 sub $5,1 lpe add $1,3
6502EMU/Instructions/NOP.asm
austinbentley/6502toAVR
0
97143
<gh_stars>0 /* * NOP.asm * * Created: 5/13/2018 5:39:54 PM * Author: ROTP */ NOP_implied: RET
LexC.seemode/Contents/Resources/Scripts/lexc-rev-sorting.applescript
divvun/see-modes
0
923
<reponame>divvun/see-modes -- see settings on seescriptsettings() return {displayName:"LexC Reversed Stem Sorting", keyboardShortcut:"^~@b", inContextMenu:"yes"} -- Here is a overview of currently supported settings -- displayName: Name displayed in menus -- keyboardShortcut: A keyboard shortcut. alt=~, ctrl=^, shift=$, cmd=@ -- inContextMenu: Should it appear in the ctrl-click menu? end seescriptsettings -- the actual script tell application "SubEthaEdit" set savedClipboard to the clipboard if (length of selection = 0) then set the clipboard to contents of front document as text else set the clipboard to contents of selection as text end if end tell set UnixPath to POSIX path of ((path to me as text) & "::") set ScriptName to "lexc-giella-style.py" set ScriptPathName to UnixPath & ScriptName -- the following is a command to call an external script, in this case python -- notice the export preamble which is essential to make pbpaste work with -- utf8 content. set shellscriptString to "export LANG=en_US.UTF-8; pbpaste | python '" & ScriptPathName & "' --sort=revstem -" set shellresult to do shell script shellscriptString without altering line endings tell application "SubEthaEdit" set the clipboard to savedClipboard if (length of selection = 0) then set contents of front document to shellresult else set contents of selection of front document to shellresult as text end if end tell
src/Tactic/Monoid/Reflect.agda
lclem/agda-prelude
0
10057
module Tactic.Monoid.Reflect where open import Prelude open import Tactic.Reflection open import Tactic.Reflection.Match open import Control.Monad.Zero open import Control.Monad.State open import Container.Traversable open import Tactic.Monoid.Exp open import Tactic.Reflection.Parse renaming (parseEqn to parseEq) private data ExpF (A : Set) : Set where eVar : Nat → ExpF A eZero : ExpF A ePlus : A → A → ExpF A instance FunctorExpF : Functor ExpF fmap {{FunctorExpF}} _ (eVar i) = eVar i fmap {{FunctorExpF}} _ eZero = eZero fmap {{FunctorExpF}} f (ePlus x y) = ePlus (f x) (f y) TraversableExpF : Traversable ExpF traverse {{TraversableExpF}} f (eVar i) = pure (eVar i) traverse {{TraversableExpF}} f eZero = pure eZero traverse {{TraversableExpF}} f (ePlus x y) = ⦇ ePlus (f x) (f y) ⦈ mkExp : ExpF Exp → Exp mkExp (eVar i) = var i mkExp eZero = ε mkExp (ePlus x y) = x ⊕ y module _ (match : Term → Maybe (ExpF Term)) where parseEqn : Term → ParseTerm TC (Exp × Exp) parseEqn v = parseEq eVar match mkExp v parseGoal : Term → TC ((Exp × Exp) × List Term) parseGoal v = runParse (parseEqn v) private match<> : ∀ {a} {A : Set a} → Monoid A → TC (Term → Maybe (Vec Term 2)) match<> {A = A} dict = do `A ← quoteTC A `plus ← quoteTC (Monoid._<>_ dict) extendContext (vArg `A) $ extendContext (vArg $ weaken 1 `A) $ match 2 <$> normalise (safeApply (weaken 2 `plus) (vArg (safe (var 0 []) _) ∷ vArg (safe (var 1 []) _) ∷ [])) matchEmpty : ∀ {a} {A : Set a} → Monoid A → TC (Term → Bool) matchEmpty dict = do v ← quoteTC (Monoid.mempty dict) pure (isYes ∘ (v ==_)) monoidMatcher : ∀ {a} {A : Set a} → Monoid A → TC (Term → Maybe (ExpF Term)) monoidMatcher dict = withNormalisation true $ do isZ ← matchEmpty dict isP ← match<> dict pure λ v → guard! (isZ v) (pure eZero) <|> do x ∷ y ∷ [] ← isP v pure (ePlus x y) private lookupEnv : ∀ {a} {A : Set a} {{_ : Monoid A}} → List A → Nat → A lookupEnv xs i = maybe mempty id (index xs i) quoteList : List Term → Term quoteList = foldr (λ x xs → con₂ (quote List._∷_) x xs) (con₀ (quote List.[])) quoteEnv : Term → List Term → Term quoteEnv dict xs = def (quote lookupEnv) (iArg dict ∷ vArg (quoteList xs) ∷ [])
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_684.asm
ljhsiun2/medusa
9
100112
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x148d, %rsi lea addresses_A_ht+0x14f8d, %rdi clflush (%rdi) nop nop sub $42488, %rbx mov $58, %rcx rep movsb nop nop nop nop nop add $39303, %rbp lea addresses_normal_ht+0x1c08d, %r14 nop nop nop nop nop cmp %rdi, %rdi mov $0x6162636465666768, %rbp movq %rbp, %xmm1 movups %xmm1, (%r14) add $8056, %r14 lea addresses_UC_ht+0x13e8d, %rsi nop nop nop nop nop sub %r10, %r10 movb $0x61, (%rsi) nop nop nop nop nop sub $33098, %rcx lea addresses_UC_ht+0x1b115, %rsi lea addresses_normal_ht+0x1cadd, %rdi nop nop nop sub $48155, %r10 mov $61, %rcx rep movsl nop nop nop and $27902, %r10 lea addresses_WC_ht+0x919d, %rbx cmp $36438, %r10 mov $0x6162636465666768, %r14 movq %r14, %xmm5 movups %xmm5, (%rbx) nop nop nop nop nop sub %rsi, %rsi lea addresses_D_ht+0x15623, %rsi lea addresses_WC_ht+0x1454d, %rdi and $52553, %r9 mov $46, %rcx rep movsq nop and %rbx, %rbx lea addresses_WC_ht+0x196f1, %rsi lea addresses_WT_ht+0x1168d, %rdi dec %r14 mov $30, %rcx rep movsq nop nop xor %r10, %r10 lea addresses_WC_ht+0x198ad, %r10 nop nop nop nop and %rsi, %rsi movb (%r10), %cl nop nop nop nop sub $9880, %rbx lea addresses_WT_ht+0x1c68d, %rcx nop nop nop nop add %r14, %r14 mov (%rcx), %esi nop dec %r10 lea addresses_D_ht+0x214d, %rsi lea addresses_D_ht+0x1d32d, %rdi clflush (%rsi) clflush (%rdi) nop nop nop nop nop sub $11349, %r9 mov $70, %rcx rep movsw nop add $10635, %r14 lea addresses_WC_ht+0xa8d, %r14 xor $40038, %rcx mov (%r14), %r10 nop nop nop nop nop sub $59279, %rsi lea addresses_D_ht+0x1080d, %rsi lea addresses_WT_ht+0xd5d2, %rdi nop nop xor %r14, %r14 mov $101, %rcx rep movsb nop nop nop add $1663, %rcx lea addresses_normal_ht+0xdb1, %rcx nop nop add $16760, %rbx movw $0x6162, (%rcx) nop nop nop lfence lea addresses_WT_ht+0x127ad, %rbx nop and $665, %rsi mov (%rbx), %r9d nop inc %rbp lea addresses_A_ht+0xed5d, %rsi lea addresses_D_ht+0x1668d, %rdi nop nop nop nop cmp %r14, %r14 mov $11, %rcx rep movsb nop nop sub $44673, %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r9 push %rax push %rbp push %rbx push %rcx // Load lea addresses_normal+0x168d, %rbp nop nop xor %r10, %r10 mov (%rbp), %ecx nop and $46798, %r13 // Load lea addresses_D+0x1f3dd, %r10 nop nop nop nop nop cmp $37954, %rbp mov (%r10), %r13w nop nop add %r10, %r10 // Store mov $0x325, %rbx xor $34145, %rbp mov $0x5152535455565758, %r13 movq %r13, %xmm3 movups %xmm3, (%rbx) nop nop nop nop sub $2169, %r13 // Faulty Load lea addresses_US+0x13e8d, %rax nop nop inc %r9 mov (%rax), %bx lea oracles, %r9 and $0xff, %rbx shlq $12, %rbx mov (%r9,%rbx,1), %rbx pop %rcx pop %rbx pop %rbp pop %rax pop %r9 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': True, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, '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 */
projects/07/VMtranslator/script.asm
ITFS777/n2t
0
103479
<filename>projects/07/VMtranslator/script.asm // push local index @LCL D=M @index A=A+D D=M @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @LCL A=M A=A+1 M=D
oeis/145/A145826.asm
neoneye/loda-programs
11
11214
<filename>oeis/145/A145826.asm ; A145826: Arises from critical number of finite Abelian groups. ; Submitted by <NAME> ; 7,8,11,14,19,21,26,29,34,41,43,50,55,57,62,68,75,77,84,89,91,98,102,109,117,122,124,128,131,135,150,155,161,163,174,176,183,189,194,200,206,209,219,221,226,228,241,254,258,260,264,271,273,283,290,296,302,305,311,315,317,328,343,347,349,353,368,374,385,387,391,398,406,412,419,423,429,437,442,450,461,463,473,475,482,486,492,500,505,507,511,523,532,536,544,548,555,567,569,588 seq $0,40 ; The prime numbers. seq $0,183868 ; a(n) = n + floor(2*sqrt(n+1)); complement of A079524.
BitEpicness/TestInterupts.asm
davidov541/BitEpicness
0
85659
la $s0, loop loop: addi $0, 5 blt $0, $rr, $s0 ldi $a0, 10 nop mfc0 $s1, $epc wp $a0, 0 loop2: j loop2
Alfred.alfredpreferences/workflows/user.workflow.9702C8A8-B0C5-4F88-8192-25F35B776C37/div.scpt
tungd/dotfiles-lean
3
3926
<gh_stars>1-10 -- check if active application is in full screen mode on isItFullScreen() tell application "System Events" set activeApp to item 1 of (get name of processes whose frontmost is true) tell process activeApp get value of attribute "AXFullScreen" of window 1 end tell end tell return result as boolean end isItFullScreen on getActiveSceenIndex(divObjC) set screensCount to divObjC's getScreensCount() set screensSizes to divObjC's getScreensSizes() set screensOrigins to divObjC's getScreensOrigins() tell application "System Events" set activeApp to name of first application process whose frontmost is true tell process activeApp if subrole of window 1 is "AXUnknown" then set activeWindow to 2 else set activeWindow to 1 end if set positionOfCurrentApp to position of window activeWindow set sizeOfCurrentApp to size of window activeWindow set centerOfCurrentApp to (item 1 of positionOfCurrentApp) + (item 1 of sizeOfCurrentApp / 2) set activeScreenIndex to 1 set distanceFromDisplayCenter to 9999 repeat with screenIndex from 1 to screensCount set currentScreenXorigin to item 1 of item screenIndex of screensOrigins set currentScreenXsize to item 1 of item screenIndex of screensSizes set currentScreenCenter to currentScreenXorigin + (currentScreenXsize / 2) set currentScreenCenterDistanceToAppCenter to centerOfCurrentApp - currentScreenCenter if currentScreenCenterDistanceToAppCenter < 0 then set currentScreenCenterDistanceToAppCenter to -currentScreenCenterDistanceToAppCenter if currentScreenCenterDistanceToAppCenter < distanceFromDisplayCenter set activeScreenIndex to screenIndex set distanceFromDisplayCenter to currentScreenCenterDistanceToAppCenter end if end repeat end tell end tell return activeScreenIndex end getActiveSceenIndex -- return active screens size on getScreenSize(divObjC) set screensCount to divObjC's getScreensCount() set screensSizes to divObjC's getScreensSizes() if screensCount is 1 set _width to item 1 of item 1 of screensSizes set _height to item 2 of item 1 of screensSizes else set activeSceenIndex to getActiveSceenIndex(divObjC) set _width to item 1 of item activeSceenIndex of screensSizes set _height to item 2 of item activeSceenIndex of screensSizes end if return {_width, _height} end getScreenSize -- return active screens size on getScreenOrigin(divObjC) set screensCount to divObjC's getScreensCount() set screensSizes to divObjC's getScreensSizes() set screensOrigins to divObjC's getScreensOrigins() if screensCount is 1 set _x to item 1 of item 1 of screensOrigins set _y to item 2 of item 1 of screensOrigins else set activeSceenIndex to getActiveSceenIndex(divObjC) set activeSceenHeight to item 2 of item activeSceenIndex of screensSizes set mainSceenHeight to item 2 of item 1 of screensSizes set screensHeightDiff to mainSceenHeight - activeSceenHeight set _x to item 1 of item activeSceenIndex of screensOrigins set _y to item 2 of item activeSceenIndex of screensOrigins - screensHeightDiff end if return {_x, _y} end getScreenOrigin -- convert arguments to list on converttoList(delimiter, input) local delimiter, input, ASTID set ASTID to AppleScript's text item delimiters try set AppleScript's text item delimiters to delimiter set input to text items of input set AppleScript's text item delimiters to ASTID return input --> list on error eMsg number eNum set AppleScript's text item delimiters to ASTID error "Can't convert: " & eMsg number eNum end try end converttoList -- resize app window on resizeApp(positionX, positionY, sizeX, sizeY) tell application "System Events" set activeApp to name of first application process whose frontmost is true tell process activeApp if subrole of window 1 is "AXUnknown" then set activeWindow to 2 else set activeWindow to 1 end if set position of window activeWindow to {positionX, positionY} set size of window activeWindow to {sizeX, sizeY} end tell end tell end resizeApp -- display notification on displayNotification(_notification, _subtitle) display notification _notification with title "Div" subtitle _subtitle sound name "Basso" end displayNotification -- on script invocation read the passed argumens and assign to userQuery on run userQuery -- Load Objective-C script tell application "Finder" set myPath to container of (path to me) as text end tell set divObjC to load script file (myPath & "divObjC.scptd") -- set some variables set screenSize to getScreenSize(divObjC) set screensOrigin to getScreenOrigin(divObjC) set args to converttoList(" ", userQuery) set argsSize to count of args set isCurrentAppInFullScreenMode to isItFullScreen() -- warn user that the Div doesn't work in full screen mode if isCurrentAppInFullScreenMode is true then set _notification to "Div doesn't work in full screen mode!" set _subtitle to "Sorry dude :-(" displayNotification(_notification, _subtitle) return end if -- if user provided 4 arguments, resize to custom bounds if argsSize is 4 then set positionX to ((item 1 of args / 100) * item 1 of screenSize) + item 1 of screensOrigin set positionY to ((item 2 of args / 100) * item 2 of screenSize) - item 2 of screensOrigin set sizeX to ((item 3 of args / 100) - (item 1 of args / 100)) * item 1 of screenSize set sizeY to ((item 4 of args / 100) - (item 2 of args / 100)) * item 2 of screenSize resizeApp(positionX, positionY, sizeX, sizeY) -- if user provided 2 arguments, resize to absolute size on the center of a window else if argsSize is 2 then -- if monitor is not big enough to resize if item 1 of args as number > item 1 of screenSize as number or item 2 of args as number > item 2 of screenSize as number then set _notification to "Buy a bigger one dude" set _subtitle to "Screen not big enough :-(" displayNotification(_notification, _subtitle) -- otherwise resize to desired size else set positionX to ((item 1 of screenSize - item 1 of args) / 2) + item 1 of screensOrigin set positionY to ((item 2 of screenSize - item 2 of args) / 2) - item 2 of screensOrigin set sizeX to item 1 of args set sizeY to item 2 of args resizeApp(positionX, positionY, sizeX, sizeY) end if -- Otherwise remmind your user how many arguments is required else set _notification to "Two or four arguments (space separated) only!" set _subtitle to "Sorry dude :-(" displayNotification(_notification, _subtitle) end if end run
bb-runtimes/src/s-textio__erc32.adb
JCGobbi/Nucleo-STM32G474RE
0
19388
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . T E X T _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1999-2002 Universidad Politecnica de Madrid -- -- Copyright (C) 2003-2006 The European Space Agency -- -- Copyright (C) 2003-2013, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- -- The port of GNARL to bare board targets was initially developed by the -- -- Real-Time Systems Group at the Technical University of Madrid. -- -- -- ------------------------------------------------------------------------------ package body System.Text_IO is ----------- -- Local -- ----------- Control_Register_Address : constant System.Address := 16#1F80000#; UART_Channel_A_Rx_Tx_Register_Address : constant System.Address := 16#01F800E0#; UART_Status_Register_Address : constant System.Address := 16#01F800E8#; type Scaler_8 is mod 2 ** 8; for Scaler_8'Size use 8; -- 8-bit scaler type Reserved_8 is array (0 .. 7) of Boolean; for Reserved_8'Size use 8; pragma Pack (Reserved_8); type Reserved_24 is array (0 .. 23) of Boolean; for Reserved_24'Size use 24; pragma Pack (Reserved_24); type Control_Register is record PRD : Boolean; -- Power-down 1 : enabled (allowed) 0 : disabled r/w SWR : Boolean; -- Software reset 1 : enabled (allowed) 0 : disabled r/w BTO : Boolean; -- Bus timeout 1 : enabled 0 : disabled r/w BP : Boolean; -- Block protection instead of normal access protection -- 1 : enabled 0 : disabled r/w WDCS : Boolean; -- Watchdog clock supply -- 1 : external clock with prescaler (divide by 16) -- 0 : external clock, no prescaler r/w IUEMMSK : Boolean; -- IU Error Mode Mask 1 : Error masked (= disabled) -- 0 : Error not masked r/w RHIUEM : Boolean; -- Reset or Halt when IU error mode (ERROR*) -- 1 : Reset 0 : Halt r/w IUHEMSK : Boolean; -- IU Hardware Error Mask -- 1 : Error masked (= disabled) 0 : Error not masked r/w RHIUHE : Boolean; -- Reset or Halt when IU Hardware Error (HWERR*) -- 1 : Reset 0 : Halt r/w IUCMPMSK : Boolean; -- IU Comparison Error Mask -- 1 : Error masked (= disabled) 0 : Error not masked r/w RHIUCMP : Boolean; -- Reset or Halt when IU comparison error 1 : Reset 0 : Halt r/w FPUCMPMSK : Boolean; -- FPU Comparison Error Mask -- 1 : Error masked (= disabled) 0 : Error not masked r/w RHFPUCMP : Boolean; -- Reset or Halt when FPU comparison error -- 1 : Reset 0 : Halt r/w MECHEMSK : Boolean; -- MEC HW Error Mask -- 1 : Error masked (= disabled) 0 : Error not masked r/w RHMECHE : Boolean; -- Reset or Halt when MEC HW Error (MECHWERR) -- 1 : Reset 0 : Halt r/w RESERVED : Boolean; -- Not used r DMAE : Boolean; -- 1 DMA 1 : enabled 0 : disabled r/w DPE : Boolean; -- DMA Parity Enabled 1 : enabled 0 : disabled r/w DST : Boolean; -- DMA session timeout 1 : enabled 0 : disabled r/w UBR : Boolean; -- UART baud rate(1) -- 1 : No change of UART scaler baudrate -- 0 : Divide UART scaler baudrate by two r/w UPE : Boolean; -- UART parity enable -- 1 : parity enabled 0 : no parity r/w UP : Boolean; -- UART parity 1 : odd parity 0 : even parity r/w USB : Boolean; -- UART stop bits 1 : two stop bits 0 : one stop bit r/w UCS : Boolean; -- UART clock supply 1 : system clock 0 : external clock r/w UART_Scaler : Scaler_8; -- 1 - 255 : Divide factor (1) 0: stops the UART clock r/w end record; for Control_Register use record PRD at 0 range 31 .. 31; SWR at 0 range 30 .. 30; BTO at 0 range 29 .. 29; BP at 0 range 28 .. 28; WDCS at 0 range 27 .. 27; IUEMMSK at 0 range 26 .. 26; RHIUEM at 0 range 25 .. 25; IUHEMSK at 0 range 24 .. 24; RHIUHE at 0 range 23 .. 23; IUCMPMSK at 0 range 22 .. 22; RHIUCMP at 0 range 21 .. 21; FPUCMPMSK at 0 range 20 .. 20; RHFPUCMP at 0 range 19 .. 19; MECHEMSK at 0 range 18 .. 18; RHMECHE at 0 range 17 .. 17; RESERVED at 0 range 16 .. 16; DMAE at 0 range 15 .. 15; DPE at 0 range 14 .. 14; DST at 0 range 13 .. 13; UBR at 0 range 12 .. 12; UPE at 0 range 11 .. 11; UP at 0 range 10 .. 10; USB at 0 range 9 .. 9; UCS at 0 range 8 .. 8; UART_scaler at 0 range 0 .. 7; end record; for Control_Register'Size use 32; pragma Suppress_Initialization (Control_Register); Control : Control_Register; pragma Atomic (Control); for Control'Address use Control_Register_Address; type UART_Channel_Rx_Tx_Register is record RTD : Character; -- Rx/Tx Data r/w Reserved24 : Reserved_24; -- Not used r end record; for UART_Channel_Rx_Tx_Register use record RTD at 0 range 24 .. 31; Reserved24 at 0 range 0 .. 23; end record; for UART_Channel_Rx_Tx_Register'Size use 32; pragma Suppress_Initialization (UART_Channel_Rx_Tx_Register); UART_Channel_A : UART_Channel_Rx_Tx_Register; pragma Atomic (UART_Channel_A); for UART_Channel_A'Address use UART_Channel_A_Rx_Tx_Register_Address; type UART_Status_Register is record DRA : Boolean; -- Data Ready in channel A r TSEA : Boolean; -- Transmitter A Send register Empty (no data to send) r THEA : Boolean; -- Transmitter A Holding register Empty (ready to load data) r Reserved1A : Boolean; -- Not used r FEA : Boolean; -- Framing Error in receiver A r PEA : Boolean; -- Parity Error in receiver A r OEA : Boolean; -- Overrun Error in receiver A r CUA : Boolean; -- Clear UART A (bit read as zero) r/w Reserved8A : Reserved_8; -- Not used r DRB : Boolean; -- Data Ready in channel B r TSEB : Boolean; -- Transmitter B Send register Empty (no data to send) r THEB : Boolean; -- Transmitter B Holding register Empty (ready to load data) r Reserved1B : Boolean; -- Not used r FEB : Boolean; -- Framing Error in receiver B r PEB : Boolean; -- Parity Error in receiver B r OEB : Boolean; -- Overrun Error in receiver B r CUB : Boolean; -- Clear UART B (bit read as zero) r/w Reserved8B : Reserved_8; -- Not used r end record; for UART_Status_Register use record DRA at 0 range 31 .. 31; TSEA at 0 range 30 .. 30; THEA at 0 range 29 .. 29; Reserved1A at 0 range 28 .. 28; FEA at 0 range 27 .. 27; PEA at 0 range 26 .. 26; OEA at 0 range 25 .. 25; CUA at 0 range 24 .. 24; Reserved8A at 0 range 16 .. 23; DRB at 0 range 15 .. 15; TSEB at 0 range 14 .. 14; THEB at 0 range 13 .. 13; Reserved1B at 0 range 12 .. 12; FEB at 0 range 11 .. 11; PEB at 0 range 10 .. 10; OEB at 0 range 9 .. 9; CUB at 0 range 8 .. 8; Reserved8B at 0 range 0 .. 7; end record; for UART_Status_Register'Size use 32; pragma Suppress_Initialization (UART_Status_Register); UART_Status : UART_Status_Register; pragma Atomic (UART_Status); for UART_Status'Address use UART_Status_Register_Address; Clock_Frequency : constant Natural; -- Hertz pragma Import (Asm, Clock_Frequency, "clock_frequency"); -- Frequency of the system clock --------- -- Get -- --------- function Get return Character is begin -- Will never be called raise Program_Error; return ASCII.NUL; end Get; ---------------- -- Initialize -- ---------------- procedure Initialize is Control_Aux : Control_Register; Scaler_Aux : Scaler_8; begin -- Initialize the UART1 as output console -- Read the Control Register Control_Aux := Control; -- Set the UART scaler according to the baudrate given Scaler_Aux := Scaler_8 (Clock_Frequency / (32 * 115200 * 2)); Control_Aux.UART_Scaler := Scaler_8'Max (Scaler_Aux - 1, 1); Control_Aux.UBR := False; Control_Aux.UPE := False; Control_Aux.USB := False; Control_Aux.UCS := True; -- Write to the Control Register in the MEC Control := Control_Aux; Initialized := True; end Initialize; ----------------- -- Is_Rx_Ready -- ----------------- function Is_Rx_Ready return Boolean is begin return False; end Is_Rx_Ready; ----------------- -- Is_Tx_Ready -- ----------------- function Is_Tx_Ready return Boolean is UART_Status_Aux : constant UART_Status_Register := UART_Status; begin return UART_Status_Aux.THEA; end Is_Tx_Ready; --------- -- Put -- --------- procedure Put (C : Character) is UART_Tx : constant UART_Channel_Rx_Tx_Register := (RTD => C, Reserved24 => (others => False)); begin UART_Channel_A := UART_Tx; end Put; ---------------------------- -- Use_Cr_Lf_For_New_Line -- ---------------------------- function Use_Cr_Lf_For_New_Line return Boolean is begin return True; end Use_Cr_Lf_For_New_Line; end System.Text_IO;
output/antlr/1.4.19/T.g4
antlr/groom
408
6612
<gh_stars>100-1000 grammar T; a : A ;
programs/oeis/271/A271997.asm
neoneye/loda
22
10247
; A271997: The icosagen sequence : a(n) = A018227(n)-5, for n >= 2. ; 5,13,31,49,81,113,163,213,285,357,455,553,681,809,971,1133,1333,1533,1775,2017,2305,2593,2931,3269,3661,4053,4503,4953,5465,5977,6555,7133,7781,8429,9151,9873,10673,11473,12355,13237,14205,15173,16231,17289,18441,19593,20843,22093,23445,24797,26255,27713,29281,30849,32531,34213,36013,37813,39735,41657,43705,45753,47931,50109,52421,54733,57183,59633,62225,64817,67555,70293,73181,76069,79111,82153,85353,88553,91915,95277,98805,102333,106031,109729,113601,117473,121523,125573,129805,134037,138455,142873,147481,152089,156891,161693,166693,171693,176895,182097 mov $2,$0 add $0,1 seq $0,3451 ; Number of nonequivalent dissections of an n-gon into 3 polygons by nonintersecting diagonals up to rotation. mul $0,2 sub $0,8 add $0,$2 div $0,2 mul $0,2 add $0,5
libsrc/graphics/lbitmask.asm
Toysoft/z88dk
8
89768
<filename>libsrc/graphics/lbitmask.asm SECTION code_clib PUBLIC leftbitmask ; ; $Id: lbitmask.asm,v 1.4 2016-04-13 21:09:09 dom Exp $ ; ; ************************************************************************ ; ; Get left bitmask for left side of byte ; ; Design & programming by <NAME>, Copyright (C) InterLogic 1995 ; ; IN: A = bitposition ; ; OUT: A = bitmask at left side of bit position of byte ; ; Example: ; IN: A = 3 ; OUT: A = @11110000 (bit 7 - 4 as mask) ; ; registers chnaged after return: ; ..bcdehl/ixiy same ; af....../.... different ; .leftbitmask xor 7 ; 7-bitpos ret z ; no bitmask to preserve... push bc ld b,a xor a .left_bitmask_loop scf rra ; create left bitmask djnz left_bitmask_loop pop bc ret
library/fmGUI_ManageLayouts/fmGUI_ManageLayouts_Edit.applescript
NYHTC/applescript-fm-helper
1
183
-- fmGUI_ManageLayouts_Edit({layoutName:null}) -- <NAME>, NYHTC -- select a layout from Manage Layouts window (* HISTORY: 1.1 - 2017-11-06 ( eshagdar ): added window error checking. set objects via handlers. simplified logic. 1.0 - 201x-xx-xx ( dshockley ): created TODO: printing/triggers tabs. REQUIRES: fmGUI_CheckboxSet fmGUI_ManageLayouts_Open fmGUI_ManageLayouts_OpenEditForSelected fmGUI_ManageLayouts_Select fmGUI_NameOfFrontmostWindow fmGUI_ObjectClick_Button fmGUI_ObjectClick_CancelButton fmGUI_ObjectClick_OkButton fmGUI_PopupSet fmGUI_TextFieldSet *) on run fmGUI_ManageLayouts_Edit({layoutName:"Directory", layoutOldName:"Directory2", baseTableName:"ZZ_INTERFACE", doNotChangeExisting:true}) end run -------------------- -- START OF CODE -------------------- on fmGUI_ManageLayouts_Edit(prefs) -- version 1.0 try set defaultPrefs to {layoutName:null, layoutOldName:null, editExistingSetupWindow:false, doNotChangeExisting:false, baseTableName:null, includeInLayoutMenus:0, menuSet:"[File Default]", formViewEnabled:1, listViewEnabled:1, tableViewEnabled:1, defaultView:"Form View", scriptTriggers:{}} set prefs to prefs & defaultPrefs set layoutName to layoutName of prefs set editWindowName to "Layout Setup" if layoutName is null then error "must specify layout name" number -1024 -- already have edit window open, so need to check if we should be using this window or re-selecting another window -- todo: check for first STANDARD window if fmGUI_NameOfFrontmostWindow() is equal to editWindowName then tell application "System Events" tell process "FileMaker Pro Advanced" set currentLayoutName to value of text field "Layout Name" of tab group 1 of window 1 end tell end tell if editExistingSetupWindow of prefs then --continue else if currentLayoutName is equal to layoutName or currentLayoutName is equal to layoutOldName of prefs then -- continue else --need to close this window and find the layout to edit fmGUI_ObjectClick_CancelButton({}) end if end if -- find layout to edit if fmGUI_NameOfFrontmostWindow() is not equal to editWindowName then fmGUI_ManageLayouts_Open({}) set foundThisLayout to fmGUI_ManageLayouts_Select({layoutName:layoutName}) if layoutOldName of prefs is not null then set foundOldLayout to fmGUI_ManageLayouts_Select({layoutName:layoutOldName of prefs}) if foundThisLayout and foundOldLayout then error "Both the old '" & layoutOldName of prefs & "' and the current layout name '" & layoutName & "' already exist - PROBLEM!" else if not foundThisLayout and not foundOldLayout then error "Neither the old '" & layoutOldName of prefs & "' nor the current layout name '" & layoutName & "' already exist - PROBLEM!" end if if foundThisLayout and not foundOldLayout then fmGUI_ManageLayouts_Select({layoutName:layoutName}) end if fmGUI_ManageLayouts_OpenEditForSelected({}) end if -- edit layout settings - GENERAL tell application "System Events" tell process "FileMaker Pro Advanced" set tabButton to radio button "General" of tab group 1 of window 1 end tell end tell fmGUI_ObjectClick_Button({buttonRef:tabButton}) -- ensure layout name is updated tell application "System Events" tell process "FileMaker Pro Advanced" set layoutNameObj to text field "Layout Name" of tab group 1 of window 1 end tell end tell fmGUI_TextFieldSet({objRef:layoutNameObj, objValue:layoutName}) if not doNotChangeExisting of prefs then tell application "System Events" tell process "FileMaker Pro Advanced" set includeInMenuCheck to checkbox "Include in layout menus" of tab group 1 of window 1 set sourceTO to pop up button 1 of tab group 1 of window 1 --set saveAutomaticallyCheck to checkbox "Save record changes automatically" of tab group 1 of window 1 --set showFramesCheck to checkbox "Show field frames when record is active" of tab group 1 of window 1 --set listRecordIndicatorCheck to checkbox "Show current record indicator in List View" of tab group 1 of window 1 --set delineateCurrentRecordCheck to checkbox "Delineate fields on current record only" of tab group 1 of window 1 set menuSet to pop up button 2 of tab group 1 of window 1 --set quickFindCheck to checkbox "Enable Quick Find" of tab group 1 of window 1 end tell end tell fmGUI_CheckboxSet({objRef:includeInMenuCheck, objValue:includeInLayoutMenus of prefs}) if baseTableName of prefs is not null then fmGUI_PopupSet({objRef:sourceTO, objValue:baseTableName of prefs}) fmGUI_PopupSet({objRef:menuSet, objValue:menuSet of prefs}) end if -- edit layout settings - VIEWS if not doNotChangeExisting of prefs then tell application "System Events" tell process "FileMaker Pro Advanced" set tabButton to radio button "Views" of tab group 1 of window 1 end tell end tell fmGUI_ObjectClick_Button({buttonRef:tabButton}) tell application "System Events" tell process "FileMaker Pro Advanced" set formViewCheck to checkbox "Table View" of tab group 1 of window 1 set listViewCheck to checkbox "List View" of tab group 1 of window 1 set tableViewCheck to checkbox "Form View" of tab group 1 of window 1 set defaultViewObj to pop up button 1 of tab group 1 of window 1 end tell end tell fmGUI_CheckboxSet({objRef:formViewCheck, objValue:formViewEnabled of prefs}) fmGUI_CheckboxSet({objRef:listViewCheck, objValue:listViewEnabled of prefs}) fmGUI_CheckboxSet({objRef:tableViewCheck, objValue:tableViewEnabled of prefs}) fmGUI_PopupSet({objRef:defaultViewObj, objValue:defaultView of prefs}) end if -- edit layout settings - PRINTING -- edit layout settings - TRIGGERS -- save changes fmGUI_ObjectClick_OkButton({}) return true on error errMsg number errNum error "unable to fmGUI_ManageLayouts_Edit - " & errMsg number errNum end try end fmGUI_ManageLayouts_Edit -------------------- -- END OF CODE -------------------- on fmGUI_CheckboxSet(prefs) set objRefStr to coerceToString(objRef of prefs) tell application "htcLib" to fmGUI_CheckboxSet({objRef:objRefStr} & prefs) end fmGUI_CheckboxSet on fmGUI_ManageLayouts_Open(prefs) tell application "htcLib" to fmGUI_ManageLayouts_Open(prefs) end fmGUI_ManageLayouts_Open on fmGUI_ManageLayouts_OpenEditForSelected(prefs) tell application "htcLib" to fmGUI_ManageLayouts_OpenEditForSelected(prefs) end fmGUI_ManageLayouts_OpenEditForSelected on fmGUI_ManageLayouts_Select(prefs) tell application "htcLib" to fmGUI_ManageLayouts_Select(prefs) end fmGUI_ManageLayouts_Select on fmGUI_NameOfFrontmostWindow() tell application "htcLib" to fmGUI_NameOfFrontmostWindow() end fmGUI_NameOfFrontmostWindow on fmGUI_ObjectClick_Button(prefs) set buttonRef to my coerceToString(buttonRef of prefs) tell application "htcLib" to fmGUI_ObjectClick_Button({buttonRef:buttonRef} & prefs) end fmGUI_ObjectClick_Button on fmGUI_ObjectClick_CancelButton(prefs) tell application "htcLib" to fmGUI_ObjectClick_CancelButton(prefs) end fmGUI_ObjectClick_CancelButton on fmGUI_ObjectClick_OkButton(prefs) tell application "htcLib" to fmGUI_ObjectClick_OkButton(prefs) end fmGUI_ObjectClick_OkButton on fmGUI_PopupSet(prefs) set objRefStr to coerceToString(objRef of prefs) tell application "htcLib" to fmGUI_PopupSet({objRef:objRefStr} & prefs) end fmGUI_PopupSet on fmGUI_TextFieldSet(prefs) set objRefStr to coerceToString(objRef of prefs) tell application "htcLib" to fmGUI_TextFieldSet({objRef:objRefStr} & prefs) end fmGUI_TextFieldSet on coerceToString(incomingObject) -- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ). tell application "Finder" to set coercePath to (container of (container of (path to me)) as text) & "text parsing:coerceToString.applescript" set codeCoerce to read file coercePath as text tell application "htcLib" to set codeCoerce to "script codeCoerce " & return & getTextBetween({sourceText:codeCoerce, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeCoerce" set codeCoerce to run script codeCoerce tell codeCoerce to coerceToString(incomingObject) end coerceToString
programs/oeis/288/A288349.asm
jmorken/loda
1
165285
<gh_stars>1-10 ; A288349: Partial sums of A059268. ; 1,2,4,5,7,11,12,14,18,26,27,29,33,41,57,58,60,64,72,88,120,121,123,127,135,151,183,247,248,250,254,262,278,310,374,502,503,505,509,517,533,565,629,757,1013,1014,1016,1020,1028,1044,1076,1140,1268,1524,2036 mov $10,$0 mov $12,$0 add $12,1 lpb $12 mov $0,$10 sub $12,1 sub $0,$12 mov $1,1 mov $6,2 pow $6,$0 lpb $5,5 mul $1,2 add $2,$6 div $0,$2 add $0,$6 div $6,$1 lpe add $11,$0 lpe mov $1,$11
oeis/153/A153502.asm
neoneye/loda-programs
11
93488
<gh_stars>10-100 ; A153502: Primes of the form 3*n^2 - 3*n + 11. ; Submitted by <NAME> ; 11,17,29,47,71,101,137,179,227,281,479,557,641,827,929,1151,1667,1811,2447,2621,2801,3581,4007,4229,4457,4691,4931,6221,6779,8597,9587,9929,10631,12107,12491,13679,14087,16217,16661,19937,25127,25679,26237,26801,27947,32771,34679,35327,37307,39341,40031,45767,46511,48017,48779,49547,50321,57557,58391,60077,63521,67061,67961,69779,72551,75377,77291,79229,80207,83177,84179,86201,87221,94529,95597,96671,98837,99929,101027,107741,108881,112337,113501,114671,124247,125471,134207,135479,138041,140627 mov $2,332203 mov $5,10 mov $6,1 lpb $2 mov $3,$6 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,6 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,18 add $5,$1 mov $6,$5 lpe mov $0,$5 add $0,1
libsrc/_DEVELOPMENT/math/integer/fast/l_fast_divs_8_8x8.asm
meesokim/z88dk
0
22255
<gh_stars>0 SECTION code_math PUBLIC l_fast_divs_8_8x8, l0_fast_divs_8_8x8 EXTERN l0_fast_divu_8_8x8, error_divide_by_zero_mc ; alternate entry to swap dividend / divisor ex de,hl l_fast_divs_8_8x8: ; signed division of two 8-bit numbers ; ; enter : l = 8-bit dividend ; e = 8-bit divisor ; ; exit : success ; ; l = l / e ; e = l % e ; carry reset ; ; divide by zero ; ; l = CHAR_MAX or CHAR_MIN ; e = dividend ; carry set, errno = EDOM ; ; uses : af, b, de, hl ; test for divide by zero inc e dec e jr z, divide_by_zero l0_fast_divs_8_8x8: ; C standard requires that the result of division satisfy ; a = (a/b)*b + a%b ; remainder takes sign of the dividend ld a,l xor e ; P flag set if quotient > 0 ld a,l ; a = dividend push af ; save sign info or a jp p, dividend_ok neg ld l,a ; take absolute value of dividend dividend_ok: ld a,e or a jp p, divisor_ok neg ld e,a ; take absolute value of divisor divisor_ok: ; perform unsigned division call l0_fast_divu_8_8x8 ; l = unsigned quotient ; e = unsigned remainder pop af ; recover sign info ld d,a ; d = dividend jp p, quotient_ok ; if quotient > 0 ld a,l neg ld l,a ; negate quotient quotient_ok: bit 7,d ret z ; if dividend > 0 ld a,e neg ld e,a ; negate remainder ret divide_by_zero: ld e,l ; e = dividend call error_divide_by_zero_mc ld l,$80 ; hl = CHAR_MIN bit 7,e ret nz ; if dividend < 0 inc h dec l ; hl = CHAR_MAX ret
core/lib/groups/FreeGroup.agda
timjb/HoTT-Agda
0
7548
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.NType2 open import lib.types.Empty open import lib.types.Sigma open import lib.types.Pi open import lib.types.Group open import lib.types.Nat open import lib.types.List open import lib.types.Word open import lib.types.SetQuotient open import lib.groups.Homomorphism module lib.groups.FreeGroup {i} where -- [qwr-sym] is not needed, but it seems more principled to -- make [QuotWordRel] an equivalence relation. data QuotWordRel {A : Type i} : Word A → Word A → Type i where qwr-refl : ∀ {l₁ l₂} → l₁ == l₂ → QuotWordRel l₁ l₂ qwr-trans : ∀ {l₁ l₂ l₃} → QuotWordRel l₁ l₂ → QuotWordRel l₂ l₃ → QuotWordRel l₁ l₃ qwr-sym : ∀ {l₁ l₂} → QuotWordRel l₁ l₂ → QuotWordRel l₂ l₁ qwr-cons : ∀ x {l₁ l₂} → QuotWordRel l₁ l₂ → QuotWordRel (x :: l₁) (x :: l₂) qwr-flip : ∀ x₁ l → QuotWordRel (x₁ :: flip x₁ :: l) l -- The quotient QuotWord : Type i → Type i QuotWord A = SetQuot (QuotWordRel {A}) module _ {A : Type i} where qw[_] : Word A → QuotWord A qw[_] = q[_] module QuotWordElim {k} {P : QuotWord A → Type k} {{_ : {x : QuotWord A} → is-set (P x)}} (incl* : (a : Word A) → P qw[ a ]) (rel* : ∀ {a₁ a₂} (r : QuotWordRel a₁ a₂) → incl* a₁ == incl* a₂ [ P ↓ quot-rel r ]) = SetQuotElim incl* rel* open QuotWordElim public renaming (f to QuotWord-elim) hiding (quot-rel-β) module QuotWordRec {k} {B : Type k} {{_ : is-set B}} (incl* : Word A → B) (rel* : ∀ {a₁ a₂} (r : QuotWordRel a₁ a₂) → incl* a₁ == incl* a₂) = SetQuotRec incl* rel* open QuotWordRec public renaming (f to QuotWord-rec) module _ (A : Type i) where private abstract QuotWordRel-cong-++-l : ∀ {l₁ l₁'} → QuotWordRel {A} l₁ l₁' → (l₂ : Word A) → QuotWordRel (l₁ ++ l₂) (l₁' ++ l₂) QuotWordRel-cong-++-l (qwr-refl idp) l₂ = qwr-refl idp QuotWordRel-cong-++-l (qwr-trans qwr₁ qwr₂) l₂ = qwr-trans (QuotWordRel-cong-++-l qwr₁ l₂) (QuotWordRel-cong-++-l qwr₂ l₂) QuotWordRel-cong-++-l (qwr-sym qwr) l₂ = qwr-sym (QuotWordRel-cong-++-l qwr l₂) QuotWordRel-cong-++-l (qwr-cons x qwr₁) l₂ = qwr-cons x (QuotWordRel-cong-++-l qwr₁ l₂) QuotWordRel-cong-++-l (qwr-flip x₁ l₁) l₂ = qwr-flip x₁ (l₁ ++ l₂) QuotWordRel-cong-++-r : ∀ (l₁ : Word A) → ∀ {l₂ l₂'} → QuotWordRel l₂ l₂' → QuotWordRel (l₁ ++ l₂) (l₁ ++ l₂') QuotWordRel-cong-++-r nil qwr₂ = qwr₂ QuotWordRel-cong-++-r (x :: l₁) qwr₂ = qwr-cons x (QuotWordRel-cong-++-r l₁ qwr₂) infixl 80 _⊞_ _⊞_ : QuotWord A → QuotWord A → QuotWord A _⊞_ = QuotWord-rec (λ l₁ → QuotWord-rec (λ l₂ → qw[ l₁ ++ l₂ ]) (λ r → quot-rel $ QuotWordRel-cong-++-r l₁ r)) (λ {l₁} {l₁'} r → λ= $ QuotWord-elim (λ l₂ → quot-rel $ QuotWordRel-cong-++-l r l₂) (λ _ → prop-has-all-paths-↓)) abstract QuotWordRel-cong-flip : ∀ {l₁ l₂} → QuotWordRel {A} l₁ l₂ → QuotWordRel (Word-flip l₁) (Word-flip l₂) QuotWordRel-cong-flip (qwr-refl idp) = qwr-refl idp QuotWordRel-cong-flip (qwr-trans qwr₁ qwr₂) = qwr-trans (QuotWordRel-cong-flip qwr₁) (QuotWordRel-cong-flip qwr₂) QuotWordRel-cong-flip (qwr-sym qwr) = qwr-sym (QuotWordRel-cong-flip qwr) QuotWordRel-cong-flip (qwr-cons x qwr₁) = qwr-cons (flip x) (QuotWordRel-cong-flip qwr₁) QuotWordRel-cong-flip (qwr-flip (inl x) l) = qwr-flip (inr x) (Word-flip l) QuotWordRel-cong-flip (qwr-flip (inr x) l) = qwr-flip (inl x) (Word-flip l) QuotWordRel-cong-reverse : ∀ {l₁ l₂} → QuotWordRel {A} l₁ l₂ → QuotWordRel (reverse l₁) (reverse l₂) QuotWordRel-cong-reverse (qwr-refl x) = qwr-refl (ap reverse x) QuotWordRel-cong-reverse (qwr-trans qwr qwr₁) = qwr-trans (QuotWordRel-cong-reverse qwr) (QuotWordRel-cong-reverse qwr₁) QuotWordRel-cong-reverse (qwr-sym qwr) = qwr-sym (QuotWordRel-cong-reverse qwr) QuotWordRel-cong-reverse (qwr-cons x qwr) = QuotWordRel-cong-++-l (QuotWordRel-cong-reverse qwr) (x :: nil) QuotWordRel-cong-reverse (qwr-flip (inl x) l) = qwr-trans (qwr-refl (++-assoc (reverse l) (inr x :: nil) (inl x :: nil))) $ qwr-trans (QuotWordRel-cong-++-r (reverse l) (qwr-flip (inr x) nil)) $ qwr-refl (++-unit-r (reverse l)) QuotWordRel-cong-reverse (qwr-flip (inr x) l) = qwr-trans (qwr-refl (++-assoc (reverse l) (inl x :: nil) (inr x :: nil))) $ qwr-trans (QuotWordRel-cong-++-r (reverse l) (qwr-flip (inl x) nil)) $ qwr-refl (++-unit-r (reverse l)) ⊟ : QuotWord A → QuotWord A ⊟ = QuotWord-rec (qw[_] ∘ reverse ∘ Word-flip) (λ r → quot-rel $ QuotWordRel-cong-reverse $ QuotWordRel-cong-flip r) ⊞-unit : QuotWord A ⊞-unit = qw[ nil ] abstract ⊞-unit-l : ∀ g → ⊞-unit ⊞ g == g ⊞-unit-l = QuotWord-elim (λ _ → idp) (λ _ → prop-has-all-paths-↓) ⊞-assoc : ∀ g₁ g₂ g₃ → (g₁ ⊞ g₂) ⊞ g₃ == g₁ ⊞ (g₂ ⊞ g₃) ⊞-assoc = QuotWord-elim (λ l₁ → QuotWord-elim (λ l₂ → QuotWord-elim (λ l₃ → ap qw[_] $ ++-assoc l₁ l₂ l₃) (λ _ → prop-has-all-paths-↓)) (λ _ → prop-has-all-paths-↓)) (λ _ → prop-has-all-paths-↓) Word-inv-l : ∀ l → QuotWordRel {A} (reverse (Word-flip l) ++ l) nil Word-inv-l nil = qwr-refl idp Word-inv-l (inl x :: l) = qwr-trans (qwr-refl (++-assoc (reverse (Word-flip l)) (inr x :: nil) (inl x :: l))) $ qwr-trans (QuotWordRel-cong-++-r (reverse (Word-flip l)) (qwr-flip (inr x) l)) $ Word-inv-l l Word-inv-l (inr x :: l) = qwr-trans (qwr-refl (++-assoc (reverse (Word-flip l)) (inl x :: nil) (inr x :: l))) $ qwr-trans (QuotWordRel-cong-++-r (reverse (Word-flip l)) (qwr-flip (inl x) l)) $ Word-inv-l l ⊟-inv-l : ∀ g → (⊟ g) ⊞ g == ⊞-unit ⊟-inv-l = QuotWord-elim (λ l → quot-rel (Word-inv-l l)) (λ _ → prop-has-all-paths-↓) QuotWord-group-structure : GroupStructure (QuotWord A) QuotWord-group-structure = record { ident = ⊞-unit ; inv = ⊟ ; comp = _⊞_ ; unit-l = ⊞-unit-l ; assoc = ⊞-assoc ; inv-l = ⊟-inv-l } FreeGroup : Group i FreeGroup = group _ QuotWord-group-structure module FreeGroup = Group FreeGroup -- freeness module _ {A : Type i} {j} (G : Group j) where private module G = Group G abstract Word-extendᴳ-emap : ∀ f {l₁ l₂} → QuotWordRel {A} l₁ l₂ → Word-extendᴳ G f l₁ == Word-extendᴳ G f l₂ Word-extendᴳ-emap f (qwr-refl idp) = idp Word-extendᴳ-emap f (qwr-trans qwr qwr₁) = (Word-extendᴳ-emap f qwr) ∙ (Word-extendᴳ-emap f qwr₁) Word-extendᴳ-emap f (qwr-sym qwr) = ! (Word-extendᴳ-emap f qwr) Word-extendᴳ-emap f (qwr-cons x qwr) = ap (G.comp (PlusMinus-extendᴳ G f x)) (Word-extendᴳ-emap f qwr) Word-extendᴳ-emap f (qwr-flip (inl x) l) = ! (G.assoc (f x) (G.inv (f x)) (Word-extendᴳ G f l)) ∙ ap (λ g → G.comp g (Word-extendᴳ G f l)) (G.inv-r (f x)) ∙ G.unit-l _ Word-extendᴳ-emap f (qwr-flip (inr x) l) = ! (G.assoc (G.inv (f x)) (f x) (Word-extendᴳ G f l)) ∙ ap (λ g → G.comp g (Word-extendᴳ G f l)) (G.inv-l (f x)) ∙ G.unit-l _ FreeGroup-extend : (A → G.El) → (FreeGroup A →ᴳ G) FreeGroup-extend f' = record {M} where module M where f : QuotWord A → G.El f = QuotWord-rec (Word-extendᴳ G f') (λ r → Word-extendᴳ-emap f' r) abstract pres-comp : preserves-comp (FreeGroup.comp A) G.comp f pres-comp = QuotWord-elim (λ l₁ → QuotWord-elim (λ l₂ → Word-extendᴳ-++ G f' l₁ l₂) (λ _ → prop-has-all-paths-↓)) (λ _ → prop-has-all-paths-↓) private module Lemma (hom : FreeGroup A →ᴳ G) where open GroupHom hom f* : A → G.El f* a = f qw[ inl a :: nil ] abstract PlusMinus-extendᴳ-hom : ∀ x → PlusMinus-extendᴳ G f* x == f qw[ x :: nil ] PlusMinus-extendᴳ-hom (inl x) = idp PlusMinus-extendᴳ-hom (inr x) = ! $ pres-inv qw[ inl x :: nil ] Word-extendᴳ-hom : ∀ l → Word-extendᴳ G f* l == f qw[ l ] Word-extendᴳ-hom nil = ! pres-ident Word-extendᴳ-hom (x :: l) = ap2 G.comp (PlusMinus-extendᴳ-hom x) (Word-extendᴳ-hom l) ∙ ! (pres-comp _ _) open Lemma FreeGroup-extend-is-equiv : is-equiv FreeGroup-extend FreeGroup-extend-is-equiv = is-eq _ from to-from from-to where to = FreeGroup-extend from = f* abstract to-from : ∀ h → to (from h) == h to-from h = group-hom= $ λ= $ QuotWord-elim (λ l → Word-extendᴳ-hom h l) (λ _ → prop-has-all-paths-↓) from-to : ∀ f → from (to f) == f from-to f = λ= λ a → G.unit-r (f a)
OSDev/Try-17/KripayaOS/Kernel/Arch/x86_64/Boot/header.asm
Ashwin-Paudel/Tries
0
100473
<gh_stars>0 ; ; header.asm ; KripayaOS ; ; Created by <NAME> on 2021-06-08. ; section .multiboot_header header_start: ; The Magic Number dd 0xe85250d6 ; Multiboot2 ; Set the Architecture dd 0 ; Start Protected Mode i386 ; Set 'dd' equal to the Header Length dd header_end - header_start ; The Checksum dd 0x100000000 - (0xe85250d6 + 0 + (header_end - header_start)) ; Our End Tag dw 0 dw 0 dd 8 header_end:
tests/altium_crap/Soft Designs/Legacy/LiveDsn EVB/EX09/DigitalIO/DigitalIO.asm
hanun2999/Altium-Schematic-Parser
1
179441
;............................................................................... .section Data, Data MainCountLow .dsb 1 MainCountHigh .dsb 1 CountInner .dsb 1 CountOuter .dsb 1 ;............................................................................... .section Text, Code, inpage .global __start __start: GOTO MainProc ;............................................................................... IncrementCounter: ;............................................................................... INCFSZ MainCountLow,F ; increment MainCountLow RETLW 0 ; return if MainCountLow did not roll over INCF MainCountHigh,F ; else increment MainCountHigh as well RETLW 0 ;............................................................................... DisplayCounter: ;............................................................................... MOVF MainCountLow,W MOVWF PORTC MOVF MainCountHigh,W MOVWF PORTB ; Write to display RETLW 0 ;............................................................................... LongDelay: ;............................................................................... MOVLW 200 MOVWF CountOuter LoopOuter: MOVLW 99 MOVWF CountInner LoopInner: NOP NOP DECFSZ CountInner,F GOTO LoopInner DECFSZ CountOuter,F GOTO LoopOuter RETLW 0 ;............................................................................... MainProc: ;............................................................................... CLRF MainCountLow CLRF MainCountHigh CLRW TRIS PORTA ; Set Port A as output TRIS PORTB ; Set Port B as Output TRIS PORTC ; Set Port C as output MainLoop: CALL LongDelay CALL IncrementCounter CALL DisplayCounter GOTO MainLoop ;............................................................................... .END
src/util-encoders-sha1.adb
Letractively/ada-util
0
20270
<reponame>Letractively/ada-util ----------------------------------------------------------------------- -- util-encoders-sha1 -- Compute SHA-1 hash -- Copyright (C) 2011, 2012 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Encoders.Base16; with Util.Encoders.Base64; -- The <b>Util.Encodes.SHA1</b> package generates SHA-1 hash according to -- RFC3174 or [FIPS-180-1]. package body Util.Encoders.SHA1 is use Ada.Streams; -- ------------------------------ -- Encodes the binary input stream represented by <b>Data</b> into -- an SHA-1 hash output stream <b>Into</b>. -- -- If the transformer does not have enough room to write the result, -- it must return in <b>Encoded</b> the index of the last encoded -- position in the <b>Data</b> stream. -- -- The transformer returns in <b>Last</b> the last valid position -- in the output stream <b>Into</b>. -- -- The <b>Encoding_Error</b> exception is raised if the input -- stream cannot be transformed. -- ------------------------------ overriding procedure Transform (E : in Encoder; Data : in Ada.Streams.Stream_Element_Array; Into : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset; Encoded : out Ada.Streams.Stream_Element_Offset) is pragma Unreferenced (E); Hex_Encoder : Util.Encoders.Base16.Encoder; Sha_Encoder : Context; Hash : Ada.Streams.Stream_Element_Array (0 .. 19); begin Update (Sha_Encoder, Data); Finish (Sha_Encoder, Hash); Hex_Encoder.Transform (Data => Hash, Into => Into, Last => Last, Encoded => Encoded); Encoded := Data'Last; end Transform; Padding : constant String (1 .. 64) := (1 => Character'Val (16#80#), 2 .. 64 => ASCII.NUL); -- ------------------------------ -- Computes the SHA1 hash and returns the raw binary hash in <b>Hash</b>. -- ------------------------------ procedure Finish (E : in out Context; Hash : out Hash_Array) is N : constant Natural := E.Pos * 4 + E.Pending_Pos + 1 + 8; C : constant Unsigned_64 := E.Count * 8; begin -- Pad to 512-bit block with 0x80 and 64-bit bit count at the end. if N <= 64 then Update (E, Padding (1 .. 64 - N + 1)); else Update (E, Padding (1 .. 128 - N + 1)); end if; pragma Assert (E.Pending_Pos = 0); pragma Assert (E.Pos = 14); E.W (14) := Unsigned_32 (Shift_Right (C, 32)); E.W (15) := Unsigned_32 (C and 16#0ffffffff#); Compute (E); Hash (Hash'First) := Stream_Element (Shift_Right (E.H (0), 24) and 16#0FF#); Hash (Hash'First + 1) := Stream_Element (Shift_Right (E.H (0), 16) and 16#0FF#); Hash (Hash'First + 2) := Stream_Element (Shift_Right (E.H (0), 8) and 16#0FF#); Hash (Hash'First + 3) := Stream_Element (E.H (0) and 16#0FF#); Hash (Hash'First + 4) := Stream_Element (Shift_Right (E.H (1), 24) and 16#0FF#); Hash (Hash'First + 5) := Stream_Element (Shift_Right (E.H (1), 16) and 16#0FF#); Hash (Hash'First + 6) := Stream_Element (Shift_Right (E.H (1), 8) and 16#0FF#); Hash (Hash'First + 7) := Stream_Element (E.H (1) and 16#0FF#); Hash (Hash'First + 8) := Stream_Element (Shift_Right (E.H (2), 24) and 16#0FF#); Hash (Hash'First + 9) := Stream_Element (Shift_Right (E.H (2), 16) and 16#0FF#); Hash (Hash'First + 10) := Stream_Element (Shift_Right (E.H (2), 8) and 16#0FF#); Hash (Hash'First + 11) := Stream_Element (E.H (2) and 16#0FF#); Hash (Hash'First + 12) := Stream_Element (Shift_Right (E.H (3), 24) and 16#0FF#); Hash (Hash'First + 13) := Stream_Element (Shift_Right (E.H (3), 16) and 16#0FF#); Hash (Hash'First + 14) := Stream_Element (Shift_Right (E.H (3), 8) and 16#0FF#); Hash (Hash'First + 15) := Stream_Element (E.H (3) and 16#0FF#); Hash (Hash'First + 16) := Stream_Element (Shift_Right (E.H (4), 24) and 16#0FF#); Hash (Hash'First + 17) := Stream_Element (Shift_Right (E.H (4), 16) and 16#0FF#); Hash (Hash'First + 18) := Stream_Element (Shift_Right (E.H (4), 8) and 16#0FF#); Hash (Hash'First + 19) := Stream_Element (E.H (4) and 16#0FF#); -- Re-initialize for the next hash. E.Initialize; end Finish; -- ------------------------------ -- Computes the SHA1 hash and returns the hexadecimal hash in <b>Hash</b>. -- ------------------------------ procedure Finish (E : in out Context; Hash : out Digest) is Buf : Ada.Streams.Stream_Element_Array (1 .. Hash'Length); for Buf'Address use Hash'Address; pragma Import (Ada, Buf); H : Hash_Array; B : Util.Encoders.Base16.Encoder; Last : Ada.Streams.Stream_Element_Offset; Encoded : Ada.Streams.Stream_Element_Offset; begin Finish (E, H); B.Transform (Data => H, Into => Buf, Last => Last, Encoded => Encoded); end Finish; -- ------------------------------ -- Computes the SHA1 hash and returns the base64 hash in <b>Hash</b>. -- ------------------------------ procedure Finish_Base64 (E : in out Context; Hash : out Base64_Digest) is Buf : Ada.Streams.Stream_Element_Array (1 .. Hash'Length); for Buf'Address use Hash'Address; pragma Import (Ada, Buf); H : Hash_Array; B : Util.Encoders.Base64.Encoder; Last : Ada.Streams.Stream_Element_Offset; Encoded : Ada.Streams.Stream_Element_Offset; begin Finish (E, H); B.Transform (Data => H, Into => Buf, Last => Last, Encoded => Encoded); end Finish_Base64; function To_Unsigned_32 (C3, C2, C1, C0 : in Character) return Unsigned_32; pragma Inline_Always (To_Unsigned_32); function To_Unsigned_32 (C3, C2, C1, C0 : in Character) return Unsigned_32 is begin return Character'Pos (C3) or Shift_Left (Unsigned_32 (Character'Pos (C2)), 8) or Shift_Left (Unsigned_32 (Character'Pos (C1)), 16) or Shift_Left (Unsigned_32 (Character'Pos (C0)), 24); end To_Unsigned_32; -- ------------------------------ -- Update the hash with the string. -- ------------------------------ procedure Update (E : in out Context; S : in Ada.Streams.Stream_Element_Array) is Buf : String (1 .. S'Length); for Buf'Address use S'Address; pragma Import (Ada, Buf); begin E.Update (Buf); end Update; -- ------------------------------ -- Update the hash with the string. -- ------------------------------ procedure Update (E : in out Context; S : in String) is I : Natural := S'First; N : Natural := E.Pos; begin if S'Length = 0 then return; end if; E.Count := E.Count + S'Length; -- If we have pending characters, try to make a current word with the string. -- If the string is not wide enough, save it in the pending context array. -- We can save at most 3 bytes. case E.Pending_Pos is when 1 => if S'Length >= 3 then E.W (N) := To_Unsigned_32 (S (I + 2), S (I + 1), S (I + 0), E.Pending (1)); E.Pending_Pos := 0; N := N + 1; if N = 16 then Compute (E); N := 0; end if; I := S'First + 3; else E.Pending (2) := S (I + 0); if I + 1 >= S'Last then E.Pending (3) := S (I + 1); E.Pending_Pos := 3; else E.Pending_Pos := 2; end if; return; end if; when 2 => if S'Length >= 2 then E.W (N) := To_Unsigned_32 (S (I + 1), S (I + 0), E.Pending (2), E.Pending (1)); E.Pending_Pos := 0; N := N + 1; if N = 16 then Compute (E); N := 0; end if; I := S'First + 2; else E.Pending (3) := S (I + 0); E.Pending_Pos := 3; return; end if; when 3 => E.W (N) := To_Unsigned_32 (S (I + 0), E.Pending (3), E.Pending (2), E.Pending (1)); E.Pending_Pos := 0; N := N + 1; if N = 16 then Compute (E); N := 0; end if; I := S'First + 1; when others => I := S'First; end case; -- Fill the 32-bit word block array. When we have a full 512-bit block, -- compute the hash pass. while I + 3 <= S'Last loop E.W (N) := To_Unsigned_32 (S (I + 3), S (I + 2), S (I + 1), S (I + 0)); I := I + 4; N := N + 1; if N = 16 then Compute (E); N := 0; end if; end loop; E.Pos := N; -- Save what remains in the pending buffer. N := S'Last + 1 - I; if N > 0 then E.Pending (1 .. N) := S (I .. S'Last); E.Pending_Pos := N; end if; end Update; function F1 (B, C, D : in Unsigned_32) return Unsigned_32; pragma Inline_Always (F1); function F2 (B, C, D : in Unsigned_32) return Unsigned_32; pragma Inline_Always (F2); function F3 (B, C, D : in Unsigned_32) return Unsigned_32; pragma Inline_Always (F3); function F4 (B, C, D : in Unsigned_32) return Unsigned_32; pragma Inline_Always (F4); function F1 (B, C, D : in Unsigned_32) return Unsigned_32 is begin return (B and C) or ((not B) and D); end F1; function F2 (B, C, D : in Unsigned_32) return Unsigned_32 is begin return B xor C xor D; end F2; function F3 (B, C, D : in Unsigned_32) return Unsigned_32 is begin return (B and C) or (B and D) or (C and D); end F3; function F4 (B, C, D : in Unsigned_32) return Unsigned_32 is begin return B xor C xor D; end F4; -- ------------------------------ -- Process the message block collected in the context. -- ------------------------------ procedure Compute (Ctx : in out Context) is W : W_Array renames Ctx.W; H : H_Array renames Ctx.H; V, A, B, C, D, E : Unsigned_32; begin -- Step b: For t = 16 to 79 let -- W(t) = S^1(W(t-3) XOR W(t-8) XOR W(t-14) XOR W(t-16)). for I in 16 .. 79 loop W (I) := Rotate_Left (W (I - 3) xor W (I - 8) xor W (I - 14) xor W (I - 16), 1); end loop; -- Step c: Let A = H0, B = H1, C = H2, D = H3, E = H4. A := H (0); B := H (1); C := H (2); D := H (3); E := H (4); -- Step d: For t = 0 to 79 do -- TEMP = S^5(A) + f(t;B,C,D) + E + W(t) + K(t); -- E = D; D = C; C = S^30(B); B = A; A = TEMP; for I in 0 .. 19 loop V := Rotate_Left (A, 5) + F1 (B, C, D) + E + W (I) + 16#5A82_7999#; E := D; D := C; C := Rotate_Left (B, 30); B := A; A := V; end loop; for I in 20 .. 39 loop V := Rotate_Left (A, 5) + F2 (B, C, D) + E + W (I) + 16#6ED9_EBA1#; E := D; D := C; C := Rotate_Left (B, 30); B := A; A := V; end loop; for I in 40 .. 59 loop V := Rotate_Left (A, 5) + F3 (B, C, D) + E + W (I) + 16#8F1B_BCDC#; E := D; D := C; C := Rotate_Left (B, 30); B := A; A := V; end loop; for I in 60 .. 79 loop V := Rotate_Left (A, 5) + F4 (B, C, D) + E + W (I) + 16#CA62_C1D6#; E := D; D := C; C := Rotate_Left (B, 30); B := A; A := V; end loop; -- Step e: Let H0 = H0 + A, H1 = H1 + B, H2 = H2 + C, H3 = H3 + D, H4 = H4 + E. H (0) := H (0) + A; H (1) := H (1) + B; H (2) := H (2) + C; H (3) := H (3) + D; H (4) := H (4) + E; end Compute; -- ------------------------------ -- Initialize the SHA-1 context. -- ------------------------------ overriding procedure Initialize (E : in out Context) is begin E.Count := 0; E.Pending_Pos := 0; E.Pos := 0; E.H (0) := 16#67452301#; E.H (1) := 16#EFCDAB89#; E.H (2) := 16#98BADCFE#; E.H (3) := 16#10325476#; E.H (4) := 16#C3D2E1F0#; end Initialize; end Util.Encoders.SHA1;
tests/factorial.asm
derpman23/ACSL-Assembly-Compiler
0
160473
READ X LOAD X TOP SUB =1 BE DONE STORE A MULT X STORE X LOAD A BU TOP DONE PRINT X END
programs/oeis/000/A000855.asm
neoneye/loda
22
17725
<reponame>neoneye/loda ; A000855: Final two digits of 2^n. ; 1,2,4,8,16,32,64,28,56,12,24,48,96,92,84,68,36,72,44,88,76,52,4,8,16,32,64,28,56,12,24,48,96,92,84,68,36,72,44,88,76,52,4,8,16,32,64,28,56,12,24,48,96,92,84,68,36,72,44,88,76,52,4,8,16,32,64,28,56,12,24,48,96,92,84,68,36,72,44,88,76,52,4,8,16,32,64,28,56,12,24,48,96,92,84,68,36,72,44,88 mov $1,1 mov $2,$0 lpb $2 mul $1,2 mod $1,100 sub $2,1 lpe mov $0,$1
programs/oeis/140/A140156.asm
jmorken/loda
1
5471
<reponame>jmorken/loda<gh_stars>1-10 ; A140156: a(1)=1, a(n) = a(n-1) + n^3 if n odd, a(n) = a(n-1) + n^5 if n is even. ; 1,33,60,1084,1209,8985,9328,42096,42825,142825,144156,392988,395185,933009,936384,1984960,1989873,3879441,3886300,7086300,7095561,12249193,12261360,20223984,20239609,32120985,32140668,49351036,49375425,73675425,73705216,107259648,107295585,152731009,152773884,213240060,213290713,292525881,292585200,394985200,395054121,525745353,525824860,690741084,690832209,896795185,896899008,1151702976,1151820625,1464320625,1464453276,1844657308,1844806185,2303971209,2304137584,2854869360,2855054553,3511411321,3511616700,4289216700,4289443681,5205576513,5205826560,6279568384,6279843009,7532175585,7532476348,8986409916,8986738425,10667438425,10667796336,12602713968,12603102985,14822109609,14822531484,17358056860,17358513393,20245687761,20246180800,23522980800,23523512241,27230910673,27231482460,31413601884,31414216009,36118486185,36119144688,41396463856,41397168825,47302068825,47302822396,53893637628,53894441985,61233482209,61234339584,69388066560,69388979233,78428187201,78429157500,88429157500,88430187801,99470995833,99472088560,111638617584,111639775209,125022030985,125023256028,139716536796,139717831825,155822931825,155824299456,173447716288,173449159185,192703305009,192704825884,213708242460,213709844073,236587421641,236589106800,261472306800,261474078361,288501159993,288503020860,317819271484,317821224609,349579193985,349581242368,383940980736,383943127425,421072427425,421074675516,461149317948,461151670585,504355674009,504358134384,550884008560,550886579913,600935583081,600938268700,654720668700,654723471921,712458811153,712461735360,774379099584,774382148209,840720439185,840723615708,911731827676,911735135625,987672635625,987676078576,1068812890608,1068816472185,1155433565209,1155437289084,1247826868860,1247830738753,1346296543521,1346300563200,1451158163200,1451162336481,1562739437313,1562743768060,1681380517884,1681385010009,1807434310585,1807438968048,1941266789616,1941271616425,2083257316425,2083262316636,2233798962268,2233804139985,2393298834609,2393304193984,2562178407360,2562183952593,2740873854961,2740879590300,2929836390300,2929842320041,3129532606473,3129538734960,3340444822384,3340451154009,3563071432185,3563077971388,3797927258556,3797934009825,4045543909825,4045550877696,4306470140928,4306477329985,4581272218209,4581279633084,4870534288060,4870541933433,5174858749401,5174866630000,5494866630000,5494874750601,5831197966633,5831206332060,6184512189084,6184520804209,6555488507985,6555497377728,6944826306496,6944835435825,7353245535825,7353254929756,7781487114588,7781496778185,8230313332009,8230323270384,8700508254960,8700518473273,9192878138841,9192888642300,9708251842300,9708262636161,10247481245793,10247492335360,10811441673984,10811453064609,11401032321985,11401044019068,12017176685436,12017188694425,12660822994425,12660835320816,13332944651248,13332957300585,14034540672009,14034553649884,14766636132060,14766649444113,15530282615281,15530296267200,16326558667200,16326572664721,17156570251953,17156584600860,18021451213084,18021465919209,18922363738185,18922378807408,19860498827376,19860514265625,20837076765625 mov $6,$0 add $6,1 mov $7,$0 lpb $6 mov $0,$7 sub $6,1 sub $0,$6 mov $3,$0 mod $3,2 mul $3,2 mov $2,$3 add $2,3 add $4,1 mov $5,$4 pow $5,$2 add $1,$5 lpe
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1621.asm
ljhsiun2/medusa
9
15425
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x155b1, %r11 nop xor $9664, %r13 mov (%r11), %r9w nop nop nop nop nop add $54508, %rbp lea addresses_normal_ht+0x17141, %rsi lea addresses_normal_ht+0x18901, %rdi clflush (%rsi) nop nop nop add $26227, %rdx mov $84, %rcx rep movsq nop nop nop nop add $6004, %r13 lea addresses_D_ht+0x141c1, %rsi lea addresses_normal_ht+0x1ecc1, %rdi clflush (%rdi) nop and %r13, %r13 mov $110, %rcx rep movsq nop add $3870, %rcx lea addresses_WT_ht+0x79c1, %rsi lea addresses_normal_ht+0x9c51, %rdi nop xor %r11, %r11 mov $112, %rcx rep movsq nop nop nop xor $21253, %rbp lea addresses_WC_ht+0x17081, %r11 nop nop nop inc %rdx movw $0x6162, (%r11) cmp $48299, %r13 lea addresses_UC_ht+0x1849d, %rsi lea addresses_normal_ht+0x1b841, %rdi nop nop and %r13, %r13 mov $95, %rcx rep movsq nop add %rdi, %rdi lea addresses_WC_ht+0xdc1, %rdx nop inc %rbp movw $0x6162, (%rdx) nop nop nop nop and $1476, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %r9 push %rbx push %rcx push %rdx // Faulty Load lea addresses_A+0x149c1, %r15 cmp $48460, %r9 vmovups (%r15), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %r11 lea oracles, %rcx and $0xff, %r11 shlq $12, %r11 mov (%rcx,%r11,1), %r11 pop %rdx pop %rcx pop %rbx pop %r9 pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'35': 21829} 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/addr7.adb
best08618/asylo
7
1652
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/addr7.adb -- { dg-do compile } package body Addr7 is procedure Proc (B: aliased Bytes) is O: Integer; for O'Address use B'Address; begin null; end; end Addr7;
audio/sfx/cry09_2.asm
AmateurPanda92/pokemon-rby-dx
9
174967
<filename>audio/sfx/cry09_2.asm SFX_Cry09_2_Ch4: dutycycle 240 squarenote 15, 15, 7, 1952 squarenote 6, 14, 6, 1955 squarenote 10, 15, 4, 1952 dutycycle 165 squarenote 10, 15, 6, 2008 squarenote 4, 14, 3, 2007 squarenote 15, 15, 2, 2008 endchannel SFX_Cry09_2_Ch5: dutycycle 5 squarenote 2, 0, 8, 0 squarenote 15, 10, 7, 1697 squarenote 6, 8, 6, 1698 squarenote 10, 7, 4, 1697 dutycycle 95 squarenote 10, 7, 6, 1750 squarenote 4, 8, 3, 1753 squarenote 15, 10, 2, 1751 endchannel SFX_Cry09_2_Ch7: noisenote 2, 15, 2, 60 noisenote 8, 14, 4, 62 noisenote 15, 13, 7, 60 noisenote 6, 12, 5, 59 noisenote 6, 14, 4, 61 noisenote 8, 11, 6, 60 noisenote 6, 13, 4, 61 noisenote 8, 12, 1, 59 endchannel
2020 Fall E C E 252/HW09/HW09B/hw09.asm
jsswd888/2020_FALL_UW_MADISON
0
105284
<reponame>jsswd888/2020_FALL_UW_MADISON<filename>2020 Fall E C E 252/HW09/HW09B/hw09.asm ; Filename: hw09.asm ; Author(s): <NAME> ; <EMAIL> ; Partner: <NAME> (Partner but submitting individually) ; ; Description: Performs various operations on values in ; various memory locations .ORIG x0200 START ; YOUR CODE GOES BELOW HERE LEA R0, VARS ; pointer R0 to VARS Array LDR R1, R0, #0 ; load A into R1 LDR R2, R0, #1 ; load B into R2 ; negate B NOT R2, R2 ADD R2, R2, #1 ; A - B, compare which one bigger ; result of A - B write into R3 ADD R3, R1, R2 BRnz INC_C_WITH_D ; When A > B ; compare A > 32 or not: ADD R1, R1, #-16 ADD R1, R1, #-16 BRnz INC_C_WITH_E ; When A > 32: store value into C from B ; here R3 is B INC_C_WITH_B LDR R3, R0, #1 STR R3, R0, #2 BR INC_D_WITH_A ; When A < 32: store value into C from E ; here R2 is C R3 is E INC_C_WITH_E LDR R3, R0, #4 STR R3, R0, #2 ; last step: store value into D from A ; here R1 is A; since we have deduct value from R1 ; before, we need to reload again here INC_D_WITH_A LDR R1, R0, #0 STR R1, R0, #3 BR DONE ; when A < B: store value into C from D ; Here R3 is D INC_C_WITH_D LDR R3, R0, #3 STR R3, R0, #2 ; YOUR CODE GOES ABOVE HERE DONE BR DONE VARS .FILL 10 ; A .FILL 20 ; B .FILL 0 ; C .FILL 10 ; D .FILL 5 ; E .END
src/Projects/Backup/project_processor-projects-identifiers.adb
fintatarta/eugen
0
9035
<filename>src/Projects/Backup/project_processor-projects-identifiers.adb with Ada.Characters; with Ada.Characters.Handling; package body Project_Processor.Projects.Identifiers is ------------------------- -- Is_Valid_Identifier -- ------------------------- function Is_Valid_Identifier (X : String) return Boolean is use Ada.Characters.Handling; begin if X'Length = 0 then return False; end if; if not Is_Letter (X (X'First)) then return False; end if; return (for all I in X'Range => (Is_Letter (X(I)) or Is_Decimal_Digit (X (I)) or X (I) = '_' or X (I) = '-')); end Is_Valid_Identifier; ----------- -- To_ID -- ----------- function To_ID (X : String) return Identifier is begin if not Is_Valid_Identifier (X) then raise Constraint_Error; end if; return Identifier (ID_Names.To_Bounded_String (X)); end To_ID; --------------- -- To_String -- --------------- function To_String (X : Identifier) return String is begin return ID_Names.To_String (ID_Names.Bounded_String (X)); end To_String; end Project_Processor.Projects.Identifiers;
multiplication.asm
forkkr/Assembly-Lab
0
164016
segment .data a: dq 10 b: dq 11 mul: dw "Product" ,10 , 0 fmt: dq "%s %lld\n", 10, 0 segment .text global main extern printf main: push RBP mov RAX , [a] mov RDX, [b] mul RDX mov RDI, fmt mov RSI, mul mov RDX, RAX mov RAX , 0 call printf pop RBP ret
oeis/017/A017020.asm
neoneye/loda-programs
11
242008
; A017020: a(n) = (7*n + 3)^4. ; 81,10000,83521,331776,923521,2085136,4100625,7311616,12117361,18974736,28398241,40960000,57289761,78074896,104060401,136048896,174900625,221533456,276922881,342102016,418161601,506250000,607573201,723394816,855036081,1003875856,1171350625,1358954496,1568239201,1800814096,2058346161,2342560000,2655237841,2998219536,3373402561,3782742016,4228250625,4711998736,5236114321,5802782976,6414247921,7072810000,7780827681,8540717056,9354951841,10226063376,11156640625,12149330176,13206836241,14331920656 mul $0,7 add $0,3 pow $0,4
Outputs/mixers/m32flat/mix8b.asm
jgunthorpe/muse
0
14210
; ASM mixing code ; ; MixAsm_20_xx - For 2.0 <= x incrs ; Shuffles the code around to optimize for the constant motion using a ; variable whole number. ; ; MixAsm_10_20 - For 1.0 <= x < 2.0 incrs ; Shuffles the code around to optimize for the constant motion, uses a ; whole number portion of 1. ; ; MixAsm_05_10 - For 0.5 <= x < 1.0 incrs ; Takes advantage of the fact that a secondary addition does not need to be ; done due to the 0 whole number portion. ; ; MixAsm_03_05 - For 0.3 <= x < 0.5 incrs ; Takes advantage of the fact that in this number range a pattern of ; 2 loops and 3 loops, ie 2,3,2,2,3,2,2,3. varies with the counter. ; Since it never goes below 2 loops it is safe to combine two loops into ; one and do the math that way. ; ; MixAsm_00_03 - For 0.0 <= x < 0.3 incrs ; Takes advantage of the fact that in this number range a pattern of ; 3 loops and 4 loops, ie 3,4,3,3,4,3,3,4. varies with the counter. ; Since it never goes below 3 loops it is safe to combine three loops into ; one and do the math that way. ideal ; TASM Ideal ode p386 ; protected mode 386 code model os2 flat, syscall ; os/2 flat model, system calling nosmart public syscall MixAsm_20_xx ; Export the symbol public syscall MixAsm_10_20 ; Export the symbol public syscall MixAsm_05_10 ; Export the symbol public syscall MixAsm_03_05 ; Export the symbol public syscall MixAsm_00_03 ; Export the symbol public syscall MixAsm_20_xx_R ; Export the symbol public syscall MixAsm_10_20_R ; Export the symbol public syscall MixAsm_05_10_R ; Export the symbol public syscall MixAsm_03_05_R ; Export the symbol public syscall MixAsm_00_03_R ; Export the symbol dataseg StackSave DD ? ; Place to store esp VolTable DD ? ; Place to store VolMap MulIncr DD ? ; Place to store x*Incr WholeIncr DD ? ; Place to store Add JumpTarget DD ? codeseg ; Start the code segment FORWARD = 1 BACKWARD = 2 DIRECTION = FORWARD include "Mix8b.inc" DIRECTION = BACKWARD include "Mix8b.inc" end
3-mid/impact/source/3d/math/impact-d3-aabb_util.adb
charlie5/lace
20
5755
with impact.d3.Transform, impact.d3.Matrix, impact.d3.Vector; with impact.d3.min_max; package body impact.d3.aabb_Util is procedure Transform_Aabb (halfExtents : in math.Vector_3; margin : in math.Real; t : in Transform_3d; aabbMinOut, aabbMaxOut : out math.Vector_3) is use impact.d3.Transform, impact.d3.Matrix, impact.d3.Vector; halfExtentsWithMargin : constant math.Vector_3 := halfExtents + (margin, margin, margin); abs_b : constant math.Matrix_3x3 := absolute (getBasis (t)); center : constant math.Vector_3 := getOrigin (t); extent : constant math.Vector_3 := (dot (getRow (abs_b, 1), halfExtentsWithMargin), dot (getRow (abs_b, 2), halfExtentsWithMargin), dot (getRow (abs_b, 3), halfExtentsWithMargin)); begin aabbMinOut := center - extent; aabbMaxOut := center + extent; end Transform_Aabb; procedure Transform_Aabb (localAabbMin, localAabbMax : in math.Vector_3; margin : in math.Real; t : in Transform_3d; aabbMinOut, aabbMaxOut : out math.Vector_3) is use linear_Algebra_3d, impact.d3.Transform, impact.d3.Matrix, impact.d3.Vector; pragma Assert (localAabbMin (1) <= localAabbMax (1)); pragma Assert (localAabbMin (2) <= localAabbMax (2)); pragma Assert (localAabbMin (3) <= localAabbMax (3)); localHalfExtents : constant math.Vector_3 := 0.5 * (localAabbMax - localAabbMin) + (margin, margin, margin); localCenter : constant math.Vector_3 := 0.5 * (localAabbMax + localAabbMin); abs_b : constant math.Matrix_3x3 := absolute (getBasis (t)); center : constant math.Vector_3 := t * localCenter; extent : constant math.Vector_3 := (dot (getRow (abs_b, 1), localHalfExtents), dot (getRow (abs_b, 2), localHalfExtents), dot (getRow (abs_b, 3), localHalfExtents)); begin aabbMinOut := center - extent; aabbMaxOut := center + extent; end Transform_Aabb; function btRayAabb2 (rayFrom, rayInvDirection : in math.Vector_3; raySign : in Signs; bounds : in impact.d3.aabb_Util.Bounds; tmin : access math.Real; lambda_min, lambda_max : in math.Real) return Boolean is use type interfaces.unsigned_32; tmax, tymin, tymax, tzmin, tzmax : math.Real; begin tmin.all := (bounds ( Integer (raySign (1))) (1) - rayFrom (1)) * rayInvDirection (1); tmax := (bounds (1 - Integer (raySign (1))) (1) - rayFrom (1)) * rayInvDirection (1); tymin := (bounds ( Integer (raySign (2))) (2) - rayFrom (2)) * rayInvDirection (2); tymax := (bounds (1 - Integer (raySign (2))) (2) - rayFrom (2)) * rayInvDirection (2); if (tmin.all > tymax) or else (tymin > tmax) then return False; end if; if tymin > tmin.all then tmin.all := tymin; end if; if tymax < tmax then tmax := tymax; end if; tzmin := (bounds ( Integer (raySign (3))) (3) - rayFrom (3)) * rayInvDirection (3); tzmax := (bounds (1 - Integer (raySign (3))) (3) - rayFrom (3)) * rayInvDirection (3); if (tmin.all > tzmax) or else (tzmin > tmax) then return False; end if; if tzmin > tmin.all then tmin.all := tzmin; end if; if tzmax < tmax then tmax := tzmax; end if; return tmin.all < lambda_max and then tmax > lambda_min; end btRayAabb2; function btRayAabb (rayFrom, rayTo : in math.Vector_3; aabbMin, aabbMax : in math.Vector_3; param : access math.Real; normal : access math.Vector_3) return Boolean is use Interfaces; aabbHalfExtent : math.Vector_3 := (aabbMax - aabbMin) * 0.5; aabbCenter : constant math.Vector_3 := (aabbMax + aabbMin) * 0.5; source : math.Vector_3 := rayFrom - aabbCenter; target : constant math.Vector_3 := rayTo - aabbCenter; sourceOutcode : constant Unsigned_32 := btOutcode (source, aabbHalfExtent); targetOutcode : constant Unsigned_32 := btOutcode (target, aabbHalfExtent); begin if (sourceOutcode and targetOutcode) = 0 then declare use impact.d3.min_max; lambda_enter : math.Real := 0.0; lambda_exit : math.Real := param.all; r : math.Vector_3 := target - source; normSign : math.Real := 1.0; hitNormal : math.Vector_3 := (0.0, 0.0, 0.0); bit : Unsigned_32 := 1; lambda : math.Real; begin for j in 1 .. 3 loop for i in 1 .. 3 loop if (sourceOutcode and bit) /= 0 then lambda := (-source (i) - aabbHalfExtent (i) * normSign) / r (i); if lambda_enter <= lambda then lambda_enter := lambda; hitNormal := (0.0, 0.0, 0.0); hitNormal (i) := normSign; end if; elsif (targetOutcode and bit) /= 0 then lambda := (-source (i) - aabbHalfExtent (i) * normSign) / r (i); btSetMin (lambda_exit, lambda); end if; bit := bit * 2; end loop; normSign := -1.0; end loop; if lambda_enter <= lambda_exit then param.all := lambda_enter; normal.all := hitNormal; return True; end if; end; end if; return False; end btRayAabb; -- SIMD_FORCE_INLINE bool btRayAabb(const impact.d3.Vector& rayFrom, -- const impact.d3.Vector& rayTo, -- const impact.d3.Vector& aabbMin, -- const impact.d3.Vector& aabbMax, -- impact.d3.Scalar& param, impact.d3.Vector& normal) -- { -- impact.d3.Vector aabbHalfExtent = (aabbMax-aabbMin)* impact.d3.Scalar(0.5); -- impact.d3.Vector aabbCenter = (aabbMax+aabbMin)* impact.d3.Scalar(0.5); -- impact.d3.Vector source = rayFrom - aabbCenter; -- impact.d3.Vector target = rayTo - aabbCenter; -- int sourceOutcode = btOutcode(source,aabbHalfExtent); -- int targetOutcode = btOutcode(target,aabbHalfExtent); -- if ((sourceOutcode & targetOutcode) == 0x0) -- { -- impact.d3.Scalar lambda_enter = impact.d3.Scalar(0.0); -- impact.d3.Scalar lambda_exit = param; -- impact.d3.Vector r = target - source; -- int i; -- impact.d3.Scalar normSign = 1; -- impact.d3.Vector hitNormal(0,0,0); -- int bit=1; -- -- for (int j=0;j<2;j++) -- { -- for (i = 0; i != 3; ++i) -- { -- if (sourceOutcode & bit) -- { -- impact.d3.Scalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i]; -- if (lambda_enter <= lambda) -- { -- lambda_enter = lambda; -- hitNormal.setValue(0,0,0); -- hitNormal[i] = normSign; -- } -- } -- else if (targetOutcode & bit) -- { -- impact.d3.Scalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i]; -- btSetMin(lambda_exit, lambda); -- } -- bit<<=1; -- } -- normSign = impact.d3.Scalar(-1.); -- } -- if (lambda_enter <= lambda_exit) -- { -- param = lambda_enter; -- normal = hitNormal; -- return true; -- } -- } -- return false; -- } -- -- -- function btOutcode (p, halfExtent : in math.Vector_3) return Interfaces.Unsigned_32 is use type interfaces.Unsigned_32; X_lt, X_gt, Y_lt, Y_gt, Z_lt, Z_gt : Interfaces.Unsigned_32; begin if p (1) < -halfExtent (1) then X_lt := 16#01#; else X_lt := 16#00#; end if; if p (1) > halfExtent (1) then X_gt := 16#08#; else X_gt := 16#00#; end if; if p (2) < -halfExtent (2) then Y_lt := 16#02#; else Y_lt := 16#00#; end if; if p (2) > halfExtent (2) then Y_gt := 16#10#; else Y_gt := 16#00#; end if; if p (3) < -halfExtent (3) then Z_lt := 16#04#; else Z_lt := 16#00#; end if; if p (3) > halfExtent (3) then Z_gt := 16#20#; else Z_gt := 16#00#; end if; return X_lt or X_gt or Y_lt or Y_gt or Z_lt or Z_gt; end btOutcode; function TestTriangleAgainstAabb2 (vertices : in math.Matrix_3x3; aabbMin, aabbMax : in math.Vector_3) return Boolean is use impact.d3.Matrix; p1 : math.Vector_3 renames getRow (vertices, 1); p2 : math.Vector_3 renames getRow (vertices, 2); p3 : math.Vector_3 renames getRow (vertices, 3); begin if Real'Min (Real'Min (p1 (1), p2 (1)), p3 (1)) > aabbMax (1) then return False; end if; if Real'Max (Real'Max (p1 (1), p2 (1)), p3 (1)) < aabbMin (1) then return False; end if; if Real'Min (Real'Min (p1 (3), p2 (3)), p3 (3)) > aabbMax (3) then return False; end if; if Real'Max (Real'Max (p1 (3), p2 (3)), p3 (3)) < aabbMin (3) then return False; end if; if Real'Min (Real'Min (p1 (2), p2 (2)), p3 (2)) > aabbMax (2) then return False; end if; if Real'Max (Real'Max (p1 (2), p2 (2)), p3 (2)) < aabbMin (2) then return False; end if; return True; end TestTriangleAgainstAabb2; end impact.d3.aabb_Util;
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_21829_1781.asm
ljhsiun2/medusa
9
21270
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_D_ht+0x5de4, %rsi lea addresses_UC_ht+0x1b9e4, %rdi nop nop nop nop xor $7377, %r12 mov $127, %rcx rep movsb nop nop nop nop nop sub $62052, %rax lea addresses_UC_ht+0x17fe4, %rsi lea addresses_UC_ht+0x1ebe4, %rdi nop nop add %r9, %r9 mov $88, %rcx rep movsq nop nop lfence lea addresses_WC_ht+0xc19c, %r9 clflush (%r9) nop nop nop nop add $36053, %rsi movl $0x61626364, (%r9) dec %rax lea addresses_D_ht+0xf999, %r9 nop nop nop nop nop add $13427, %r11 mov (%r9), %esi nop nop nop xor $2983, %rsi lea addresses_A_ht+0xe4d8, %rcx and %rdi, %rdi mov $0x6162636465666768, %rsi movq %rsi, (%rcx) nop nop nop and $5041, %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %r15 push %rdi push %rdx push %rsi // Store lea addresses_normal+0x11fe4, %r14 clflush (%r14) nop xor %r15, %r15 movw $0x5152, (%r14) nop nop nop nop nop inc %r11 // Store lea addresses_PSE+0x1dde4, %rdx nop nop nop xor $6805, %r15 movb $0x51, (%rdx) nop nop nop xor %rdx, %rdx // Store lea addresses_WT+0x85e4, %rdx and %rdi, %rdi movb $0x51, (%rdx) nop sub %rdx, %rdx // Faulty Load lea addresses_PSE+0x1dde4, %r14 nop nop nop nop nop add %r13, %r13 mov (%r14), %dx lea oracles, %r13 and $0xff, %rdx shlq $12, %rdx mov (%r13,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %r15 pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT', 'size': 1, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': True}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}} {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': 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 */
second.asm
jacmba/nerdy-nights
0
245339
<reponame>jacmba/nerdy-nights<gh_stars>0 .inesprg 1 .ineschr 1 .inesmir 1 .inesmap 0 .bank 0 .org $8000 Reset: sei cld ldx #$00 VBlank: bit $2002 bpl VBlank inx cpx #$02 bne VBlank ; Wait for 2 V-Blank cycles lda #%10000000 ;enable NMI sta $2000 lda #%00010000 ;enable sprite rendering sta $2001 lda $2002 lda #$3F sta $2006 lda #$00 sta $2006 ldx #$00 LoadPalLoop: lda Palette, x sta $2007 inx cpx #$20 bne LoadPalLoop ldx #$00 LoadSpriteLoop: lda Sprite, x sta $0200, x inx cpx #$08 bne LoadSpriteLoop Forever: jmp Forever Nmi: lda #$00 sta $2003 lda #$02 sta $4014 rti Palette: .byte $0F,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3A,$3B,$3C,$3D,$3E,$3F .byte $0F,$05,$28,$08,$34,$35,$36,$37,$38,$39,$3A,$3B,$3C,$3D,$3E,$3F Sprite: .db $80, $36, $00, $80 .db $80, $37, $00, $88 .bank 1 .org $FFFA .dw Nmi, Reset, 0 .bank 2 .incbin "mario.chr"
Appl/Icon/Document/documentIcon.asm
steakknife/pcgeos
504
85167
<reponame>steakknife/pcgeos COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: Document FILE: documentIcon.asm AUTHOR: <NAME> ROUTINES: Name Description ---- ----------- DBViewerEditIcon -- MSG_DB_VIEWER_EDIT_ICON handler CheckIconDirtyAndDealWithIt -- see if current icon needs saving (far) SwitchIcons -- sets bitmap-object's bitmap to new one SetUpPreviewStuff -- updates entire preview area DBViewerDeleteIcons -- Deletes 1 or more icons, prompting DBViewerDeleteIconsNoConfirm -- Deletes 1 or more icons, no prompting DeleteTheIcon -- actually deletes the icon & its data structures DeleteIconByNumber -- utility routine called by DeleteTheIcon DBViewerDeleteCurrentIcon -- Deletes current icon, no prompt ReplaceBMOBitmap -- sets new bitmap into BMO, w/ new resolution, etc... DBViewerRenameIcon -- renames the selected icon in viewer EnableEditing -- enables user-editing of the bitmap object DisableEditing -- disables user-editing of the bitmap object ResizeBMOAndFatbits -- resizes bitmap displays CreateBitmapInBMO -- creates a bitmap (smartly) and returns it. CreateBitmapDataOnly -- creates a bitmap, nukes window & gstate REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 8/4/92 initial revision DESCRIPTION: Miscellaneous routines that haven't found a home yet. $Id: documentIcon.asm,v 1.1 97/04/04 16:06:01 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DocumentCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerEditIcon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Switches to a new icon in the database. CALLED BY: MSG_DB_VIEWER_EDIT_ICON PASS: *ds:si = DBViewer object ds:[di] = DBViewerInstance RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - save the icon if dirty (prompt for save) - update currentIcon in dgroup - get one of the formats for the icon - replace vis-bitmap's bitmap with the new format - invalidate contents & views for redraw - update the preview object for this icon - enable the UI for the new icon - Make sure a tool is selected or death, death, death KNOWN BUGS/SIDE EFFECTS/IDEAS: WARNING: Make sure DBVI_currentIcon is set to either: * NO_CURRENT_ICON, or * the previously edited icon. It cannot be set to the icon we're editing currently. Well, it can, I guess, but it'll slow things down appreciably, since we first discard all the mem handles associated with DBVI_currentIcon. If we do it to the icon we're about to switch to, it'll have to re-load all the blocks. REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 8/ 5/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerEditIcon method dynamic DBViewerClass, MSG_DB_VIEWER_EDIT_ICON uses ax, cx, dx, bp .enter ; ; Get the current selection in the database viewer. ; mov ax, MSG_DB_VIEWER_GET_FIRST_SELECTION call ObjCallInstanceNoLock ; cx <- selection jc bail ; none selected mov_tr ax, cx ; ax = selection ; ; If the current Icon is dirty, prompt for save and save it. ; Except if there is no current icon. ; cmp ds:[di].DBVI_currentIcon, NO_CURRENT_ICON je noCurrentIcon call CheckIconDirtyAndDealWithIt ; preserves ax jc bail ; user cancelled ; ; Switch edit to new icon, and update preview area. ; noCurrentIcon: ; DBVI_currentIcon gets set in SwitchIcons call SwitchIcons ; actually switches editing call SetUpPreviewStuff ; updates the preview area ; ; Enable appropriate UI stuff ; push si, ax ; save DBViewer and icon mov ax, MSG_DB_VIEWER_INIT_CHANGE_ICON_DIALOG call ObjCallInstanceNoLock mov si, offset FormatViewer mov ax, MSG_FORMAT_CONTENT_RESCAN_LIST call ObjCallInstanceNoLock ; ; Have the bitmap object broadcast its colors and whatnot. ; mov si, offset BMO mov ax, MSG_ICON_BITMAP_SEND_NOTIFICATIONS call ObjCallInstanceNoLock pop si, ax ; DBViewer & icon number ; ; Enable editing if we're editing an icon. ; mov di, ds:[si] add di, ds:[di].Gen_offset cmp ds:[di].DBVI_currentIcon, NO_CURRENT_ICON je doneEnable call EnableEditing doneEnable: mov ds:[di].DBVI_currentIcon, ax clr ds:[di].DBVI_iconDirty bail: .leave ret DBViewerEditIcon endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckIconDirtyAndDealWithIt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: See if we're editing an icon, and if it needs to be saved. CALLED BY: DBViewerAddIcon PASS: *ds:si = DBViewer object RETURN: carry set if user cancelled DESTROYED: nothing PSEUDO CODE/STRATEGY: - if icon is dirty, prompt the user for save, throw away, cancel. - if user wants to save it, save it. - set carry if they cancel. REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/10/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckIconDirtyAndDealWithIt proc far class DBViewerClass uses ax,bx,si,di .enter mov di, ds:[si] add di, ds:[di].DBViewer_offset tst ds:[di].DBVI_iconDirty ; is the icon dirty? jz done ; nope, we're done ; ; Prompt the user for saving the icon. ; push ds:[LMBH_handle], si ; save DBViewer mov si, offset PromptForSaveIconText call DisplaySaveChangesYesNo pop bx, si ; restore DBViewer call MemDerefDS ; *ds:si = DBViewer cmp ax, IC_YES ; do they want to save it? jne noWayMan ; nope, quit mov ax, MSG_DB_VIEWER_SAVE_CURRENT_FORMAT call ObjCallInstanceNoLock clc ; return no cancel jmp short done noWayMan: ; ; They selected either "no" or "cancel" -- if cancel, set the carry. ; cmp ax, IC_NO je nope stc ; they cancelled jmp short done nope: clc ; return no cancel done: .leave ret CheckIconDirtyAndDealWithIt endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SwitchIcons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Switch editing to a given icon. CALLED BY: DBViewerEditIcon PASS: *ds:si = DBViewer object ds:[di] = DBViewer instance ax = icon number RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - nuke the previous icon (free its memory handles) - edit the first format - make sure es:[selectedFormat] is set correctly - get the format - set the format as the BMO's bitmap - make sure the appropriate color-selector is enabled - make sure the current color & line width are set in the BMO REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/11/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SwitchIcons proc near class DBViewerClass uses ax,bx,cx,dx,si,di,bp .enter ; ; Ensure the memory handles from the previous icon are freed. ; push ax mov bp, ds:[di].GDI_fileHandle mov ax, ds:[di].DBVI_currentIcon call FreeMemHandles ; ; Store passed icon as current icon, and edit first format. ; pop ax mov ds:[di].DBVI_currentIcon, ax clr ds:[di].DBVI_currentFormat ; ; Replace the bitmap in the bitmap object and resize everything. ; clr bx ; bp = file handle, bx = format call IdGetFormat ; returns ^vcx:dx tst dx ; no bitmap! jz done call ReplaceBMOBitmap ; ; Size the fatbits correctly for the current format. ; push ax ; current icon call IdGetFormatDimensions ; cx = width, dx = height call IconAppGetImageBitSize ; returns in al call ResizeBMOAndFatbits pop ax ; current icon ; ; If we're editing a mouse-cursor icon, set the selection ; for header-type in the WriteSourceDialog. ; call IdGetFlags ; bx = flags test bx, mask IF_PTR_IMAGE ; cursor? jz notCursor mov di, ds:[si] add di, ds:[di].Gen_offset mov bx, ds:[di].GDI_display mov si, offset WriteSourceHeaderList mov di, mask MF_FORCE_QUEUE mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov cx, WSHT_PTR_IMAGE clr dx call ObjMessage jmp short done notCursor: mov bx, ds:[di].GDI_display mov si, offset WriteSourceHeaderList mov di, mask MF_FORCE_QUEUE mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov cx, WSHT_VIS_MONIKER clr dx ; not indeterminate call ObjMessage done: .leave ret SwitchIcons endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetUpPreviewStuff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets the preview object and moniker for the current icon. CALLED BY: DBViewerEditIcon PASS: *ds:si = DBViewer object RETURN: nothing DESTROYED: nothing SIDE EFFECTS/IDEAS: PSEUDO CODE/STRATEGY: - get the preview object from the database, and set it. - set the preview-menu selection to the new object - get the colors for the preview object from the icon entry - set the preview object to be those colors. - set the color-selector item groups to the right selections - get a format for the icon (3rd for now, but this will change) - convert the format to a moniker - replace the moniker for the preview object REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/11/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetUpPreviewStuff proc near class DBViewerClass uses ax,bx,cx,dx,si,di,bp .enter ; ; Get the preview object for this icon, and set it. ; mov di, ds:[si] add di, ds:[di].Gen_offset mov ax, ds:[di].DBVI_currentIcon cmp ax, NO_CURRENT_ICON je done mov bp, ds:[di].GDI_fileHandle call IdGetPreviewObject ; returns in cx mov ax, MSG_DB_VIEWER_SET_PREVIEW_OBJECT call ObjCallInstanceNoLock ; ; Set the preview menu selection (selection passed in cx) ; push si GetResourceHandleNS PreviewListGroup, bx mov si, offset PreviewListGroup mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION clr dx ; not indeterminate call ObjMessage ; nukes cx, dx, bp pop si ; *ds:si = DBViewer ; ; Finish applying the color changes by setting the selections ; in the color-selector toolboxes, and actually setting the ; colors in the preview object. ; mov di, ds:[si] add di, ds:[di].DBViewer_offset mov ax, ds:[di].DBVI_currentIcon mov bp, ds:[di].GDI_fileHandle call IdGetPreviewColors ; returns cx = on, dx = off movdw axbx, cxdx ; ax <- on, bx <- off call SetColorSelectorSelections ; set color-selectors call ChangePreviewObjectColors ; ; Get a format for the icon and set the preview monikers to that ; bitmap. ; mov ax, ds:[di].DBVI_currentIcon clr bx ; get first format call IdGetFormat ; returns ^vcx:dx = bitmap call SetPreviewMonikers done: .leave ret SetUpPreviewStuff endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerDeleteIcons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Deletes some icons from the database. CALLED BY: MSG_DB_VIEWER_DELETE_ICONS PASS: *ds:si = DBViewer object RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: Call UserStandardDialog to ask if they're sure, then call a helper routine (DeleteIcon) that gets all the selections in the dynamic list and deletes them. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 8/ 5/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerDeleteIcons method dynamic DBViewerClass, MSG_DB_VIEWER_DELETE_ICONS uses ax, cx, dx, bp .enter ; ; See if confirm-on-delete is set ; push si ; save object GetResourceHandleNS OptionsBooleanGroup, bx mov si, offset OptionsBooleanGroup mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_BOOLEAN_GROUP_GET_SELECTED_BOOLEANS call ObjMessage ; nukes cx, dx, bp pop si ; *ds:si = DBViewer test ax, mask IO_CONFIRM_DELETE jz noDialog ; ; Get the number of selections and put up the appropriate ; dialog. ; mov ax, MSG_DB_VIEWER_GET_NUM_SELECTIONS call ObjCallInstanceNoLock tst cx ; any selections? jz done push si ; save DBViewer cmp cx, 1 je oneSelection mov si, offset PromptForDeleteIconsText jmp short ask oneSelection: mov si, offset PromptForDeleteIconText ask: call DisplayQuestion ; will clean up stack. pop si ; restore DBViewer cmp ax, IC_YES jne done noDialog: ; ; Now we do the deleting in earnest. ; mov ax, MSG_DB_VIEWER_DELETE_ICONS_NO_CONFIRM call ObjCallInstanceNoLock ; ; Since we don't set any selections after deleting 1 or ; more icons, we disable the "Export to Token Database" ; dialog (as well as emptying it out). ; call DisableExportTokenDBTrigger mov ax, MSG_DB_VIEWER_INIT_CHANGE_ICON_DIALOG call ObjCallInstanceNoLock done: .leave ret DBViewerDeleteIcons endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerDeleteIconsNoConfirm %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Deletes the selected icons without prompting. CALLED BY: MSG_DB_VIEWER_DELETE_ICONS_NO_CONFIRM PASS: *ds:si = DBViewerClass object ds:di = DBViewerClass instance data RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 4/18/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerDeleteIconsNoConfirm method dynamic DBViewerClass, MSG_DB_VIEWER_DELETE_ICONS_NO_CONFIRM uses ax, cx, dx, bp .enter ; ; Mark the app as busy. ; call IconMarkBusy ; ; Delete all the selected icons (so get how many there are). ; mov ax, MSG_DB_VIEWER_GET_NUM_SELECTIONS call ObjCallInstanceNoLock jcxz doneDelete ; ; Actually delete them... ; call DeleteSomeIcons ; does all the work doneDelete: ; ; Make sure the deleted icons no longer appear in the viewer. ; mov ax, MSG_DB_VIEWER_RESCAN_DATABASE call ObjCallInstanceNoLock ; ; Mark the app as unbusy. ; call IconMarkNotBusy .leave ret DBViewerDeleteIconsNoConfirm endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DeleteSomeIcons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Actually deletes the icons and associated data structures. CALLED BY: DBViewerDeleteIcons PASS: *ds:si = DBViewer object cx = number of icons to delete RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - Find out which icons are selected for deleting - Delete the icons from the database and the viewer REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 8/ 7/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DeleteSomeIcons proc near class DBViewerClass uses ax,bx,cx,dx,si,di,bp,es .enter jcxz done ; just in case ; ; Allocate a block for the selections in the viewer. ; mov bp, cx ; bp = num selections mov_tr ax, cx ; ax = size to allocate shl ax ; word-sized selections mov cx, ALLOC_DYNAMIC_LOCK call MemAlloc ; bx = handle, ax = segment jc done push bx ; save mem handle mov_tr cx, ax clr dx ; cx:dx = buffer mov ax, MSG_DB_VIEWER_GET_MULTIPLE_SELECTIONS call ObjCallInstanceNoLock ; ; Loop through the selected icons, deleting them. Delete ; them in reverse order or suffer the consequences (namely, ; trying to delete icons that don't exist). ; mov es, cx ; es:0 = selection buffer mov di, bp ; di = num selections dec di ; 0-indexed selections shl di ; word-sized selections deleteLoop: mov cx, {word} es:[di] ; cx = selection call DeleteIconByNumber dec di dec di ; si = next selection cmp di, 0 jge deleteLoop ; ; Make sure the changes are written... ; mov di, ds:[si] add di, ds:[di].Gen_offset mov bx, ds:[di].GDI_fileHandle call VMUpdate pop bx ; handle of selection block call MemFree done: .leave ret DeleteSomeIcons endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DeleteIconByNumber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Deletes a single icon from the current database. CALLED BY: DeleteSomeIcons PASS: *ds:si = DBViewer object cx = icon number to delete RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - find out if the icon is being edited - if so, disable editing 'n' stuff - if the icon being deleted is BEFORE (i.e., less than) the current icon, then the current icon's number must be decremented (because it gets one closer to the first icon in the database). - delete the icon from the database - delete the vis-icon from the database viewer REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 12/13/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DeleteIconByNumber proc near class DBViewerClass uses ax,bx,cx,dx,si,di,bp .enter mov di, ds:[si] add di, ds:[di].Gen_offset cmp cx, ds:[di].DBVI_currentIcon jl decCurrent jg doDelete ; ; We're deleting the current icon. Disable editing. ; (No need to prompt for saving it since it's being deleted). ; push si, cx mov si, offset FormatViewer mov ax, MSG_FORMAT_CONTENT_DISABLE_LIST call ObjCallInstanceNoLock pop si, cx call DisableEditing mov di, ds:[si] add di, ds:[di].Gen_offset mov ds:[di].DBVI_currentIcon, NO_CURRENT_ICON clr ds:[di].DBVI_iconDirty jmp short doDelete decCurrent: dec ds:[di].DBVI_currentIcon doDelete: mov_tr ax, cx ; pass ax = icon mov bp, ds:[di].GDI_fileHandle call IdFreeIconFormats call IdDeleteIcon ; deletes the database entry .leave ret DeleteIconByNumber endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerDeleteCurrentIcon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Deletes the currently-edited icon only (no prompt). CALLED BY: MSG_DB_VIEWER_DELETE_CURRENT_ICON PASS: *ds:si = DBViewerClass object ds:di = DBViewerClass instance data RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 4/13/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerDeleteCurrentIcon method dynamic DBViewerClass, MSG_DB_VIEWER_DELETE_CURRENT_ICON uses ax, cx .enter ; ; Get the current icon and delete from database. ; mov cx, ds:[di].DBVI_currentIcon call DeleteIconByNumber ; ; Update the database viewer & stuff. ; mov ax, MSG_DB_VIEWER_RESCAN_DATABASE call ObjCallInstanceNoLock .leave ret DBViewerDeleteCurrentIcon endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ReplaceBMOBitmap %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: a smart version of replace-with-transfer-format CALLED BY: global (SwitchIcons, DBViewerSwitchFormat) PASS: *ds:si = DBViewer object ^vcx:dx = new bitmap RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: call MSG_VIS_BITMAP_REPLACE_WITH_TRANSFER_FORMAT. We don't need to call MSG_VIS_BITMAP_SET_FORMAT_AND_RESOLUTION, or MSG_VIS_BITMAP_VIS_BOUNDS_MATCH_BITMAP_BOUNDS, since the bitmap object takes care of that now. However we DO need to call MSG_VIS_BITMAP_CREATE_BACKUP_BITMAP. REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 10/ 5/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ReplaceBMOBitmap proc far uses ax,bx,cx,dx,si,di,bp .enter mov bx, ds:[LMBH_handle] mov si, offset BMO mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_BITMAP_REPLACE_WITH_TRANSFER_FORMAT call ObjMessage mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_BITMAP_CREATE_BACKUP_BITMAP call ObjMessage .leave ret ReplaceBMOBitmap endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerRenameIcon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Renames the currently selected icon in the database viewer. CALLED BY: MSG_DB_VIEWER_RENAME_ICON PASS: *ds:si = DBViewer object ds:di = DBViewerInstance RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - gets the name from the Rename dialog box - sets the name of the icon in the database - updates the database viewer - if we just renamed the icon we're currently editing, set the primary long-term moniker REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/14/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerRenameIcon method dynamic DBViewerClass, MSG_DB_VIEWER_RENAME_ICON uses ax,cx,dx,bp .enter ; ; Get the selection from the viewer. ; mov ax, MSG_DB_VIEWER_GET_FIRST_SELECTION ; returns cx call ObjCallInstanceNoLock jc done ; no selection ; ; Get the new name from the rename dialog. ; sub sp, size FileLongName mov bp, sp ; ss:bp = buffer push cx, si ; save icon number & instance mov bx, ds:[di].GDI_display mov si, offset RenameTextField mov di, mask MF_CALL or mask MF_FIXUP_DS mov dx, ss ; dx.bp = buffer mov ax, MSG_VIS_TEXT_GET_ALL_PTR call ObjMessage ; cx = length (without NULL) pop ax, si ; restore number & instance mov di, ds:[si] add di, ds:[di].Gen_offset inc cx ; add 1 for null-terminator mov bx, dx mov dx, bp ; bx:dx = buffer mov bp, ds:[di].GDI_fileHandle call IdSetIconName add sp, size FileLongName ; ; Update the icon that got renamed. ; push ax ; save icon number mov_tr cx, ax ; cx = icon number mov ax, MSG_VIS_FIND_CHILD_AT_POSITION call ObjCallInstanceNoLock ; ^lcx:dx = Vis-Icon pop ax ; restore icon number jc notFound push si ; save DBViewer movdw bxsi, cxdx ; ^lbx:si = destination mov cx, ax ; cx = icon number pushdw bxsi ; save the object mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_ICON_INITIALIZE call ObjMessage popdw bxsi mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_INVALIDATE call ObjMessage pop si ; restore DBViewer notFound: ; ; Dirty the database file ; mov ax, MSG_GEN_DOCUMENT_MARK_DIRTY call ObjCallInstanceNoLock done: .leave ret DBViewerRenameIcon endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EnableEditing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Enables UI gadgetry for editing an icon. CALLED BY: GLOBAL PASS: *ds:si = DBViewer object RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - enable WriteSourceDialog - enable the save icon trigger - enable the Preview icon trigger - enable MrFatbitsView - enable BMOView - enable format menu - set the tools usable and pick one. REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/ 9/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EnableEditing proc far class DBViewerClass uses ax,bx,cx,dx,si,di,bp .enter mov di, ds:[si] add di, ds:[di].Gen_offset ; ; Enable write-source dialog. ; mov bx, ds:[di].GDI_display mov si, offset WriteSourceDialog mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Enable save-icon trigger. ; mov si, offset SaveIconTrigger mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Enable the Preview Icon trigger. ; mov si, offset PreviewLaunchTrigger mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Enable the fatbits. ; mov si, offset FatbitsView mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Enable the bitmap object. ; mov si, offset BMOView mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Enable the format menu. ; mov si, offset FormatMenu mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_ENABLED mov dl, VUM_NOW call ObjMessage .leave ret EnableEditing endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisableEditing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Disables UI gadgetry for editing an icon. CALLED BY: GLOBAL PASS: *ds:si = DBViewer object RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - disable write-source dialog - disable save-icon trigger - disable edit-icon trigger - disable the RenameCurrentIconDialog - disable the PreviewIcon Dialog - disable BMO view - disable fatbits view - clear the bitmap (don't leave old icon gunk lying around) - disable format menu REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/15/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisableEditing proc near class DBViewerClass uses ax,bx,cx,dx,si,di,bp .enter ; ; Clear the change-token glyph in the change-icon dialog. ; mov ax, MSG_DB_VIEWER_INIT_CHANGE_ICON_DIALOG call ObjCallInstanceNoLock mov di, ds:[si] add di, ds:[di].Gen_offset push si ; ; Disable the Write-source dialog ; mov bx, ds:[di].GDI_display mov si, offset WriteSourceDialog mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Disable the save-icon trigger. ; mov si, offset SaveIconTrigger mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Disable the edit-icon trigger. ; mov si, offset EditIconTrigger mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Disable the rename icon dialog. ; mov si, offset RenameIconDialog mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Disable the Preview Icon trigger. ; mov si, offset PreviewLaunchTrigger mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Disable the format menu ; mov si, offset FormatMenu mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW mov dl, VUM_NOW call ObjMessage ; ; Close the transform dialog. ; mov si, offset TFDialog mov di, mask MF_CALL or mask MF_FIXUP_DS mov cx, IC_INTERACTION_COMPLETE mov ax, MSG_GEN_GUP_INTERACTION_COMMAND call ObjMessage ; ; Create a new empty bitmap. ; mov bx, ds:[LMBH_handle] mov si, offset BMO mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_BITMAP_GET_BITMAP_SIZE_IN_PIXELS call ObjMessage mov al, BMF_4BIT call CreateBitmapInBMO ; ; Make everything redraw ; mov si, offset MyFatbitsContent mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_MARK_INVALID mov cl, mask VOF_IMAGE_INVALID or mask VOF_GEOMETRY_INVALID mov dl, VUM_NOW call ObjMessage mov si, offset BMOContent mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_MARK_INVALID mov cl, mask VOF_IMAGE_INVALID or mask VOF_GEOMETRY_INVALID mov dl, VUM_NOW call ObjMessage ; ; set everything not-enabled ; pop si mov di, ds:[si] add di, ds:[di].Gen_offset ; ds:di = DBViewerInstance push si mov bx, ds:[di].GDI_display mov si, offset FatbitsView mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW call ObjMessage mov si, offset BMOView mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_NOW call ObjMessage ; ; Disable the format area ; mov si, offset FormatViewer mov ax, MSG_FORMAT_CONTENT_DISABLE_LIST call ObjCallInstanceNoLock ; ; mark the icon as clean so it won't be saved... ; pop si ; *ds:si = DBViewer mov di, ds:[si] add di, ds:[di].Gen_offset clr ds:[di].DBVI_iconDirty .leave ret DisableEditing endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerSetFatbitSize %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets a new image-bit-size for the fatbits display CALLED BY: MSG_DB_VIEWER_SET_FATBIT_SIZE PASS: *ds:si = DBViewer object RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: - Find out what the new fatbit size is to supposed to be - Find out what it is currently - If the two are different,then: - call ResizeBMOAndFatbits with the new size REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/29/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerSetFatbitSize method dynamic DBViewerClass, MSG_DB_VIEWER_SET_FATBIT_SIZE uses ax, cx, dx, bp .enter ; ; See if there's a selection, and get it into ax. ; push si GetResourceHandleNS FatbitImageSizeGroup, bx mov si, offset FatbitImageSizeGroup mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION ; ax = selection call ObjMessage ; nukes cx, dx, bp pop si jc done ; whoops, no selection push ax, si mov bx, ds:[LMBH_handle] mov si, offset BMO mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_BITMAP_GET_BITMAP_SIZE_IN_PIXELS call ObjMessage ; returns cx & dx pop ax, si ; restore ImageBitSize call ResizeBMOAndFatbits done: .leave ret DBViewerSetFatbitSize endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ResizeBMOAndFatbits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets up fatbits view/content and BMO view/content for new size. CALLED BY: INTERNAL PASS: *ds:si = DBViewer object ax = ImageBitSize (word) cx = width of bitmap dx = height of bitmap RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: This routine handles resizing the fatbits and real-icon content & view (and likely the inverse-icon content and view whenever they get implemented.) We send a MSG_VIS_SET_SIZE to each content, followed by a MSG_VIS_MARK_INVALID to force it to redraw. REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/ 9/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ResizeBMOAndFatbits proc far class DBViewerClass uses ax,bx,cx,dx,si,di,bp bitSize local word push ax newWidth local word push cx newHeight local word push dx instance local word push si .enter push bp ; locals mov bp, ax ; bp <- image bit size clrdw cxdx ; location mov bx, ds:[LMBH_handle] mov si, offset MyFatbits mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, \ MSG_VIS_FATBITS_SET_IMPORTANT_LOCATION_AND_IMAGE_BIT_SIZE call ObjMessage pop bp ; locals ; ; Set the item-group selection for the current fatbit size ; push bp ; locals GetResourceHandleNS FatbitImageSizeGroup, bx mov si, offset FatbitImageSizeGroup mov di, mask MF_CALL or mask MF_FIXUP_DS mov cx, bitSize ; cx <- image bit size mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION clr dx ; pass nonzero for indeterminate call ObjMessage pop bp ; locals ; ; Set size for the BMO content ; mov cx, newWidth mov dx, newHeight push bp ; locals mov bx, ds:[LMBH_handle] mov si, offset BMOContent mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_SET_SIZE call ObjMessage pop bp ; locals ; ; Resize fatbits content. First scale the width & height. ; mov cx, bitSize mov ax, newWidth mov bx, newHeight shl ax, cl ; scale the width shl bx, cl ; scale the height mov_tr cx, ax ; cx <- scaled width mov dx, bx ; dx <- scaled height push cx, dx ; save scaled width & height push bp ; locals mov bx, ds:[LMBH_handle] mov si, offset MyFatbitsContent mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_SET_SIZE call ObjMessage pop bp ; locals ; ; Resize the fatbits. ; pop cx, dx ; restore scaled width & height push bp ; locals mov si, offset MyFatbits mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_SET_SIZE call ObjMessage pop bp ; locals ; ; Try to get everything to come out the right size. ; push bp mov si, instance mov di, ds:[si] add di, ds:[di].Gen_offset ; ds:di = DBViewer instance mov bx, ds:[di].GDI_display mov si, offset IconDBDisplay mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_RESET_TO_INITIAL_SIZE mov dl, VUM_NOW call ObjMessage pop bp .leave ret ResizeBMOAndFatbits endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CreateBitmapInBMO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Creates a new bitmap using the BMO. CALLED BY: GLOBAL PASS: ds = document block (locked) ax = BMFormat cx = width dx = height RETURN: cx = vm file handle for bitmap dx = vm block handle for bitmap DESTROYED: nothing (ds fixed up) PSEUDO CODE/STRATEGY: When the file/tool handlers create the first two bitmaps (not the one to be edited) they need to save them somewhere, so they save them in the database entry for the icon. This routine creates the bitmap and copies the vm chain to the file. The caller takes the returned handle and saves it in the format list. REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 9/10/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CreateBitmapInBMO proc far class DBViewerClass uses ax,bx,si,di,bp .enter push ax ; save color scheme ; ; Free up data structures for existing bitmap. ; mov bx, ds:[LMBH_handle] mov si, offset BMO mov ax, MSG_VIS_BITMAP_BECOME_DORMANT mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage ; ; Create a new bitmap. ; clr bp ; no gstring for init. mov ax, MSG_VIS_BITMAP_CREATE_BITMAP mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage ; ; Set color scheme and resolution ; mov ax, MSG_VIS_BITMAP_SET_FORMAT_AND_RESOLUTION pop cx ; color scheme mov dx, STANDARD_ICON_DPI ; 72 dpi (x resolution) mov bp, dx ; y resolution mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage ; ; Make the vis bounds match the bitmap bounds -- important. ; mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_BITMAP_VIS_BOUNDS_MATCH_BITMAP_BOUNDS call ObjMessage ; ; Return the newly-created vm chain ; mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_VIS_BITMAP_GET_MAIN_BITMAP ; ^vcx:dx call ObjMessage mov bx, cx call VMUpdate .leave ret CreateBitmapInBMO endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CreateBitmapDataOnly %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Creates a bitmap and kills its Window & GState CALLED BY: GLOBAL PASS: al = BMFormat bx = vm file handle cx = width dx = height RETURN: ^vcx:dx = bitmap DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 4/15/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CreateBitmapDataOnly proc far uses ax,bx,si,di .enter ornf al, mask BMT_MASK clr di, si ; OD call GrCreateBitmap ; ^vbx:ax = bitmap pushdw bxax mov al, BMD_LEAVE_DATA call GrDestroyBitmap call VMUpdate ; bx is still file handle popdw cxdx .leave ret CreateBitmapDataOnly endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerMarkIconDirty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets DBVI_iconDirty CALLED BY: MSG_DB_VIEWER_MARK_ICON_DIRTY PASS: *ds:si = DBViewerClass object ds:di = DBViewerClass instance data RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 4/20/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerMarkIconDirty method dynamic DBViewerClass, MSG_DB_VIEWER_MARK_ICON_DIRTY .enter mov ds:[di].DBVI_iconDirty, 1 .leave ret DBViewerMarkIconDirty endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerGetSelectedFormats %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: returns selected format # CALLED BY: MSG_DB_VIEWER_GET_SELECTED_FORMATS PASS: *ds:si = DBViewer object ds:di = DBViewerInstance RETURN: ax = DBVI_currentFormat DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 2/25/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerGetSelectedFormats method dynamic DBViewerClass, MSG_DB_VIEWER_GET_SELECTED_FORMATS mov ax, ds:[di].DBVI_currentFormat ret DBViewerGetSelectedFormats endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerGetCurrentIcon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Returns the currently-edited icon. CALLED BY: MSG_DB_VIEWER_GET_CURRENT_ICON PASS: ds:di = DBViewerInstance RETURN: ax = current icon DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 2/25/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerGetCurrentIcon method dynamic DBViewerClass, MSG_DB_VIEWER_GET_CURRENT_ICON mov ax, ds:[di].DBVI_currentIcon ret DBViewerGetCurrentIcon endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FreeMemHandles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Free up all memory handles for an icon. CALLED BY: GLOBAL PASS: bp = vm file handle ax = icon number RETURN: nothing DESTROYED: nothing (handles freed) PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 8/24/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FreeMemHandles proc far uses ax,bx,cx,dx,bp .enter ; ; If it's not an icon, quit. ; cmp ax, NO_CURRENT_ICON je done ; ; Call DiscardVMChain on each format. ; call IdGetFormatCount ; bx = count mov cx, bx jcxz done formatLoop: push cx, ax mov bx, cx ; format number dec bx ; zero-indexed call IdGetFormat ; ^vcx:dx = format movdw bxax, cxdx call DiscardVMChain pop cx, ax loop formatLoop done: .leave ret FreeMemHandles endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DBViewerInitiateResizeFormatDialog %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Brings that baby up. CALLED BY: MSG_DB_VIEWER_INITIATE_RESIZE_FORMAT_DIALOG PASS: *ds:si = DBViewerClass object ds:di = DBViewerClass instance data RETURN: nothing DESTROYED: ax, cx, dx, bp PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 8/28/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DBViewerInitiateResizeFormatDialog method dynamic DBViewerClass, MSG_DB_VIEWER_INITIATE_RESIZE_FORMAT_DIALOG .enter ; ; Get the height & width for the current format. ; mov ax, ds:[di].DBVI_currentIcon cmp ax, NO_CURRENT_ICON je done mov bp, ds:[di].GDI_fileHandle mov bx, ds:[di].DBVI_currentFormat cmp bx, NO_CURRENT_FORMAT je done call IdGetFormatDimensions ; cx = width, dx = height ; ; Set the height & width GenValues appropriately. ; push dx ; save height mov bx, ds:[di].GDI_display mov si, offset ResizeWidthValue mov di, mask MF_CALL mov ax, MSG_GEN_VALUE_SET_INTEGER_VALUE clr bp call ObjMessage pop cx ; restore height mov si, offset ResizeHeightValue mov di, mask MF_CALL mov ax, MSG_GEN_VALUE_SET_INTEGER_VALUE clr bp call ObjMessage ; ; Bring up the interaction. ; mov si, offset ResizeFormatInteraction mov ax, MSG_GEN_INTERACTION_INITIATE mov di, mask MF_CALL call ObjMessage done: .leave ret DBViewerInitiateResizeFormatDialog endm DocumentCode ends
programs/oeis/052/A052571.asm
neoneye/loda
22
95661
; A052571: E.g.f. x^3/(1-x)^2. ; 0,0,0,6,48,360,2880,25200,241920,2540160,29030400,359251200,4790016000,68497228800,1046139494400,16999766784000,292919058432000,5335311421440000,102437979291648000,2067966706950144000,43792236147179520000,970727901262479360000,22480014555552153600000,542892351516584509440000,13649864838131267665920000,356757830996612677632000000,9678995067038535254016000000,272221736260458804019200000000,7927096959904560373039104000000,238727573830971952772677632000000,7427080074741349641816637440000000,238462320971159761714041323520000000 sub $0,1 trn $0,1 seq $0,90672 ; a(n) = (n^2-1)*n!/3. mul $0,3
gcc-gcc-7_3_0-release/gcc/ada/put_scos.adb
best08618/asylo
7
1522
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P U T _ S C O S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2009-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Namet; use Namet; with Opt; use Opt; with SCOs; use SCOs; procedure Put_SCOs is Current_SCO_Unit : SCO_Unit_Index := 0; -- Initial value must not be a valid unit index procedure Write_SCO_Initiate (SU : SCO_Unit_Index); -- Start SCO line for unit SU, also emitting SCO unit header if necessary procedure Write_Instance_Table; -- Output the SCO table of instances procedure Output_Range (T : SCO_Table_Entry); -- Outputs T.From and T.To in line:col-line:col format procedure Output_Source_Location (Loc : Source_Location); -- Output source location in line:col format procedure Output_String (S : String); -- Output S ------------------ -- Output_Range -- ------------------ procedure Output_Range (T : SCO_Table_Entry) is begin Output_Source_Location (T.From); Write_Info_Char ('-'); Output_Source_Location (T.To); end Output_Range; ---------------------------- -- Output_Source_Location -- ---------------------------- procedure Output_Source_Location (Loc : Source_Location) is begin Write_Info_Nat (Nat (Loc.Line)); Write_Info_Char (':'); Write_Info_Nat (Nat (Loc.Col)); end Output_Source_Location; ------------------- -- Output_String -- ------------------- procedure Output_String (S : String) is begin for J in S'Range loop Write_Info_Char (S (J)); end loop; end Output_String; -------------------------- -- Write_Instance_Table -- -------------------------- procedure Write_Instance_Table is begin for J in 1 .. SCO_Instance_Table.Last loop declare SIE : SCO_Instance_Table_Entry renames SCO_Instance_Table.Table (J); begin Output_String ("C i "); Write_Info_Nat (Nat (J)); Write_Info_Char (' '); Write_Info_Nat (SIE.Inst_Dep_Num); Write_Info_Char ('|'); Output_Source_Location (SIE.Inst_Loc); if SIE.Enclosing_Instance > 0 then Write_Info_Char (' '); Write_Info_Nat (Nat (SIE.Enclosing_Instance)); end if; Write_Info_Terminate; end; end loop; end Write_Instance_Table; ------------------------ -- Write_SCO_Initiate -- ------------------------ procedure Write_SCO_Initiate (SU : SCO_Unit_Index) is SUT : SCO_Unit_Table_Entry renames SCO_Unit_Table.Table (SU); begin if Current_SCO_Unit /= SU then Write_Info_Initiate ('C'); Write_Info_Char (' '); Write_Info_Nat (SUT.Dep_Num); Write_Info_Char (' '); Output_String (SUT.File_Name.all); Write_Info_Terminate; Current_SCO_Unit := SU; end if; Write_Info_Initiate ('C'); end Write_SCO_Initiate; -- Start of processing for Put_SCOs begin -- Loop through entries in SCO_Unit_Table. Note that entry 0 is by -- convention present but unused. for U in 1 .. SCO_Unit_Table.Last loop declare SUT : SCO_Unit_Table_Entry renames SCO_Unit_Table.Table (U); Start : Nat; Stop : Nat; begin Start := SUT.From; Stop := SUT.To; -- Loop through SCO entries for this unit loop exit when Start = Stop + 1; pragma Assert (Start <= Stop); Output_SCO_Line : declare T : SCO_Table_Entry renames SCO_Table.Table (Start); Continuation : Boolean; Ctr : Nat; -- Counter for statement entries begin case T.C1 is -- Statements (and dominance markers) when 'S' | '>' => Ctr := 0; Continuation := False; loop if Ctr = 0 then Write_SCO_Initiate (U); if not Continuation then Write_Info_Char ('S'); Continuation := True; else Write_Info_Char ('s'); end if; end if; Write_Info_Char (' '); declare Sent : SCO_Table_Entry renames SCO_Table.Table (Start); begin if Sent.C1 = '>' then Write_Info_Char (Sent.C1); end if; if Sent.C2 /= ' ' then Write_Info_Char (Sent.C2); if Sent.C1 = 'S' and then (Sent.C2 = 'P' or else Sent.C2 = 'p') and then Sent.Pragma_Aspect_Name /= No_Name then Write_Info_Name (Sent.Pragma_Aspect_Name); Write_Info_Char (':'); end if; end if; -- For dependence markers (except E), output sloc. -- For >E and all statement entries, output sloc -- range. if Sent.C1 = '>' and then Sent.C2 /= 'E' then Output_Source_Location (Sent.From); else Output_Range (Sent); end if; end; -- Increment entry counter (up to 6 entries per line, -- continuation lines are marked Cs). Ctr := Ctr + 1; if Ctr = 6 then Write_Info_Terminate; Ctr := 0; end if; exit when SCO_Table.Table (Start).Last; Start := Start + 1; end loop; if Ctr > 0 then Write_Info_Terminate; end if; -- Decision when 'E' | 'G' | 'I' | 'P' | 'W' | 'X' | 'A' => Start := Start + 1; Write_SCO_Initiate (U); Write_Info_Char (T.C1); if T.C1 = 'A' then Write_Info_Name (T.Pragma_Aspect_Name); end if; if T.C1 /= 'X' then Write_Info_Char (' '); Output_Source_Location (T.From); end if; -- Loop through table entries for this decision loop declare T : SCO_Table_Entry renames SCO_Table.Table (Start); begin Write_Info_Char (' '); if T.C1 = '!' or else T.C1 = '&' or else T.C1 = '|' then Write_Info_Char (T.C1); pragma Assert (T.C2 /= '?'); Output_Source_Location (T.From); else Write_Info_Char (T.C2); Output_Range (T); end if; exit when T.Last; Start := Start + 1; end; end loop; Write_Info_Terminate; when ASCII.NUL => -- Nullified entry: skip null; when others => raise Program_Error; end case; end Output_SCO_Line; Start := Start + 1; end loop; end; end loop; if Opt.Generate_SCO_Instance_Table then Write_Instance_Table; end if; end Put_SCOs;
libsrc/adt/queue/adt_QueueCount.asm
meesokim/z88dk
0
243471
; uint __FASTCALL__ adt_QueueCount(struct adt_Queue *q) ; 09.2005 aralbrec PUBLIC adt_QueueCount .adt_QueueCount ld a,(hl) inc hl ld h,(hl) ld l,a ret
Cubical/Functions/Fixpoint.agda
dan-iel-lee/cubical
0
7390
<reponame>dan-iel-lee/cubical {- Definition of function fixpoint and Kraus' lemma -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Functions.Fixpoint where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.Path private variable ℓ : Level A : Type ℓ Fixpoint : (A → A) → Type _ Fixpoint {A = A} f = Σ A (λ x → f x ≡ x) fixpoint : {f : A → A} → Fixpoint f → A fixpoint = fst fixpointPath : {f : A → A} → (p : Fixpoint f) → f (fixpoint p) ≡ fixpoint p fixpointPath = snd -- Kraus' lemma -- a version not using cubical features can be found at -- https://www.cs.bham.ac.uk/~mhe/GeneralizedHedberg/html/GeneralizedHedberg.html#21576 2-Constant→isPropFixpoint : (f : A → A) → 2-Constant f → isProp (Fixpoint f) 2-Constant→isPropFixpoint f fconst (x , p) (y , q) i = s i , t i where noose : ∀ x y → f x ≡ f y noose x y = sym (fconst x x) ∙ fconst x y -- the main idea is that for any path p, cong f p does not depend on p -- but only on its endpoints and the structure of 2-Constant f KrausInsight : ∀ {x y} → (p : x ≡ y) → noose x y ≡ cong f p KrausInsight {x} = J (λ y p → noose x y ≡ cong f p) (lCancel (fconst x x)) -- Need to solve for a path s : x ≡ y, such that: -- transport (λ i → cong f s i ≡ s i) p ≡ q s : x ≡ y s = sym p ∙∙ noose x y ∙∙ q t' : PathP (λ i → noose x y i ≡ s i) p q t' i j = doubleCompPath-filler (sym p) (noose x y) q j i t : PathP (λ i → cong f s i ≡ s i) p q t = subst (λ kraus → PathP (λ i → kraus i ≡ s i) p q) (KrausInsight s) t'
app/src/main/antlr/PWMS.g4
w158rk/PWMS
0
6503
<filename>app/src/main/antlr/PWMS.g4 grammar PWMS; @header { package pers.ruikai.pwms.compiler; } CATEGORY: 'category'; DOT: '.'; DASH : '-'; WS : [ \u000D\t\n] -> skip ; YEAR: [0-9][0-9][0-9][0-9]; NUM2: [0-9][0-9]; IN: 'IN'; OUT: 'OUT'; INTEGER: [0-9]+; ID : (~ [ \n\u000D\t.0-9-])(~ [ \n\u000D\t.])*; records: category* record*; category: CATEGORY name code attrname* DOT; record: date? (IN|OUT) name number unit attrvalue* (DOT note)? DOT; name: ID; code: INTEGER; attrname: ID; date: YEAR DASH NUM2 DASH NUM2; number: INTEGER; unit: ID; note: ID; attrvalue: ID | INTEGER;
programs/oeis/163/A163661.asm
neoneye/loda
22
12695
<filename>programs/oeis/163/A163661.asm ; A163661: a(n) = n*(2*n^2 + 5*n + 17)/2. ; 0,12,35,75,138,230,357,525,740,1008,1335,1727,2190,2730,3353,4065,4872,5780,6795,7923,9170,10542,12045,13685,15468,17400,19487,21735,24150,26738,29505,32457,35600,38940,42483,46235,50202,54390,58805,63453,68340,73472,78855,84495,90398,96570,103017,109745,116760,124068,131675,139587,147810,156350,165213,174405,183932,193800,204015,214583,225510,236802,248465,260505,272928,285740,298947,312555,326570,340998,355845,371117,386820,402960,419543,436575,454062,472010,490425,509313,528680,548532,568875,589715,611058,632910,655277,678165,701580,725528,750015,775047,800630,826770,853473,880745,908592,937020,966035,995643 mov $2,$0 mul $0,2 mov $3,5 lpb $2 add $3,6 add $1,$3 add $1,$2 sub $2,1 add $3,$0 lpe mov $0,$1
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c46044b.ada
best08618/asylo
7
16410
-- C46044B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT CONSTRAINT ERROR IS RAISED FOR CONVERSION TO A -- CONSTRAINED ARRAY TYPE IF THE TARGET TYPE IS NON-NULL AND -- CORRESPONDING DIMENSIONS OF THE TARGET AND OPERAND DO NOT HAVE -- THE SAME LENGTH. ALSO, CHECK THAT CONSTRAINT_ERROR IS RAISED IF -- THE TARGET TYPE IS NULL AND THE OPERAND TYPE IS NON-NULL. -- R.WILLIAMS 9/8/86 WITH REPORT; USE REPORT; PROCEDURE C46044B IS TYPE ARR1 IS ARRAY (INTEGER RANGE <>) OF INTEGER; SUBTYPE CARR1A IS ARR1 (IDENT_INT (1) .. IDENT_INT (6)); C1A : CARR1A := (CARR1A'RANGE => 0); SUBTYPE CARR1B IS ARR1 (IDENT_INT (2) .. IDENT_INT (5)); C1B : CARR1B := (CARR1B'RANGE => 0); SUBTYPE CARR1N IS ARR1 (IDENT_INT (1) .. IDENT_INT (0)); C1N : CARR1N := (CARR1N'RANGE => 0); TYPE ARR2 IS ARRAY (INTEGER RANGE <>, INTEGER RANGE <>) OF INTEGER; SUBTYPE CARR2A IS ARR2 (IDENT_INT (1) .. IDENT_INT (2), IDENT_INT (1) .. IDENT_INT (2)); C2A : CARR2A := (CARR2A'RANGE (1) => (CARR2A'RANGE (2) => 0)); SUBTYPE CARR2B IS ARR2 (IDENT_INT (0) .. IDENT_INT (2), IDENT_INT (0) .. IDENT_INT (2)); C2B : CARR2B := (CARR2B'RANGE (1) => (CARR2B'RANGE (2) => 0)); SUBTYPE CARR2N IS ARR2 (IDENT_INT (2) .. IDENT_INT (1), IDENT_INT (1) .. IDENT_INT (2)); C2N : CARR2N := (CARR2N'RANGE (1) => (CARR2N'RANGE (2) => 0)); PROCEDURE CHECK1 (A : ARR1; STR : STRING) IS BEGIN FAILED ( "NO EXCEPTION RAISED - " & STR ); END CHECK1; PROCEDURE CHECK2 (A : ARR2; STR : STRING) IS BEGIN FAILED ( "NO EXCEPTION RAISED - " & STR ); END CHECK2; BEGIN TEST ( "C46044B", "CHECK THAT CONSTRAINT ERROR IS RAISED FOR " & "CONVERSION TO A CONSTRAINED ARRAY TYPE " & "IF THE TARGET TYPE IS NON-NULL AND " & "CORRESPONDING DIMENSIONS OF THE TARGET AND " & "OPERAND DO NOT HAVE THE SAME LENGTH. " & "ALSO, CHECK THAT CONSTRAINT_ERROR IS " & "RAISED IF THE TARGET TYPE IS NULL AND " & "THE OPERAND TYPE IS NON-NULL" ); BEGIN -- (A). C1A := C1B; CHECK1 (C1A, "(A)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (A)" ); END; BEGIN -- (B). CHECK1 (CARR1A (C1B), "(B)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (B)" ); END; BEGIN -- (C). C1B := C1A; CHECK1 (C1B, "(C)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (C)" ); END; BEGIN -- (D). CHECK1 (CARR1B (C1A), "(D)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (D)" ); END; BEGIN -- (E). C1A := C1N; CHECK1 (C1A, "(E)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (E)" ); END; BEGIN -- (F). CHECK1 (CARR1A (C1N), "(F)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (F)" ); END; BEGIN -- (G). C2A := C2B; CHECK2 (C2A, "(G)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (G)" ); END; BEGIN -- (H). CHECK2 (CARR2A (C2B), "(H)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (H)" ); END; BEGIN -- (I). C2B := C2A; CHECK2 (C2B, "(I)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (I)" ); END; BEGIN -- (J). CHECK2 (CARR2A (C2B), "(J)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (J)" ); END; BEGIN -- (K). C2A := C2N; CHECK2 (C2A, "(K)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (K)" ); END; BEGIN -- (L). CHECK2 (CARR2A (C2N), "(L)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (L)" ); END; BEGIN -- (M). C1N := C1A; CHECK1 (C1N, "(M)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (M)" ); END; BEGIN -- (N). CHECK1 (CARR1N (C1A), "(N)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (N)" ); END; BEGIN -- (O). C2N := C2A; CHECK2 (C2N, "(O)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (O)" ); END; BEGIN -- (P). CHECK2 (CARR2N (C2A), "(P)"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - (P)" ); END; RESULT; END C46044B;
Sem4/AEIE_LAB/Blinking_7_segment2.asm
SOUMEE2000/Heritage-CSE-Codes
0
96389
ORG 2000H LXI SP, 3FFFH L1: LXI H, 2500H MOV A, M OUT 80H INX H MOV A, M OUT 81H INX H MOV A, M OUT 82H CALL 2600H MVI A, 00H OUT 80H OUT 81H OUT 82H CALL 2600H JMP L1 ORG 2600H MVI C, 20H L2: DCR C JNZ L2 RET ORG 2500H DB 39H, 6DH, 79H END
src/Tests/UCodes/VMULU.asm
bryanperris/cor64
38
85583
<gh_stars>10-100 // https://github.com/PeterLemon/N64 endian msb arch n64.rsp include "LIB/N64.INC" // Include N64 Definitions include "LIB/N64_GFX.INC" // Include Graphics Macros include "LIB/N64_RSP.INC" // Include RSP Macros align(8) // Align 64-Bit base $0000 // Set Base Of RSP Code Object To Zero lqv v0[e0],$00(r0) // V0 = 128-Bit DMEM $000(R0), Load Quad To Vector: LQV VT[ELEMENT],$OFFSET(BASE) lqv v1[e0],$10(r0) // V1 = 128-Bit DMEM $010(R0), Load Quad To Vector: LQV VT[ELEMENT],$OFFSET(BASE) vmulu v0,v1[e0] // V0 = V0 * V1[0], Vector Multiply Unsigned Fractions: VMULU VD,VS,VT[ELEMENT] sqv v0[e0],$00(r0) // 128-Bit DMEM $000(R0) = V0, Store Vector To Quad: SQV VT[ELEMENT],$OFFSET(BASE) vsar v0,v0[e8] // V0 = Vector Accumulator HI, Vector Accumulator Read: VSAR VD,VS,VT[ELEMENT] sqv v0[e0],$10(r0) // 128-Bit DMEM $010(R0) = V0, Store Vector To Quad: SQV VT[ELEMENT],$OFFSET(BASE) vsar v0,v0[e9] // V0 = Vector Accumulator MD, Vector Accumulator Read: VSAR VD,VS,VT[ELEMENT] sqv v0[e0],$20(r0) // 128-Bit DMEM $020(R0) = V0, Store Vector To Quad: SQV VT[ELEMENT],$OFFSET(BASE) vsar v0,v0[e10] // V0 = Vector Accumulator LO, Vector Accumulator Read: VSAR VD,VS,VT[ELEMENT] sqv v0[e0],$30(r0) // 128-Bit DMEM $030(R0) = V0, Store Vector To Quad: SQV VT[ELEMENT],$OFFSET(BASE) cfc2 t0,vco // T0 = RSP CP2 Control Register: VCO (Vector Carry Out) sh t0,$40(r0) // 16-Bit DMEM $040(R0) = T0 cfc2 t0,vcc // T0 = RSP CP2 Control Register: VCC (Vector Compare Code) sh t0,$42(r0) // 16-Bit DMEM $042(R0) = T0 cfc2 t0,vce // T0 = RSP CP2 Control Register: VCE (Vector Compare Extension) sb t0,$44(r0) // 8-Bit DMEM $044(R0) = T0 break // Set SP Status Halt, Broke & Check For Interrupt
libsrc/stdio/ansi/ts2068/f_ansi_char85.asm
meesokim/z88dk
0
88627
<gh_stars>0 ; ; Spectrum C Library ; ; ANSI Video handling for TS 2068 85 columns ; ** ROM font -DROMFONT ; ; set it up with: ; .text_cols = max columns ; .text_rows = max rows ; .font = font file ; ; Display a char in location (ansi_ROW),(ansi_COLUMN) ; A=char to display ; ; ; $Id: f_ansi_char85.asm,v 1.3 2015/01/19 01:33:19 pauloscustodio Exp $ ; PUBLIC ansi_CHAR EXTERN ansi_ROW EXTERN ansi_COLUMN PUBLIC text_cols PUBLIC text_rows ; Dirty thing for self modifying code PUBLIC INVRS PUBLIC BOLD PUBLIC UNDERLINE IF A85COL .text_cols defb 85 ENDIF IF A80COL .text_cols defb 80 ENDIF .text_rows defb 24 .ansi_CHAR ld (char+1),a ld a,(ansi_ROW) ; Line text position ld c,a and 24 ld d,a ld a,c and 7 rrca rrca rrca ld e,a ld hl,16384 add hl,de ld a,(ansi_COLUMN) ld c,a add a,a add a,c srl a srl a srl a add a,l ld l,a push hl ; screen address .char ld l,'A' ; Put here the character to be printed ld h,0 add hl,hl add hl,hl add hl,hl IF ROMFONT ld de,15360 ELSE ld de,font-256 ENDIF add hl,de ex de,hl; de - font pop hl ; screen ld a,c and 7 jp z,jump0 dec a jp z,jump1 dec a jp z,jump2 dec a jp z,jump3 dec a jp z,jump4 dec a jp z,jump5 dec a jp z,jump6 ; jp jump7 .jump7; second display bits 5-0 set 5,h ; jr jump3 .jump3; first display bits 5-0 ld b,8 .loop3 call prepare rrca rrca and 63; 00111111 ld c,a ld a,(hl) and 192 or c ld (hl),a inc h inc de djnz loop3 ld c,63 jr under .jump4; second display bits 7-2 set 5,h ; jr jump0 .jump0; first display, bits 7-2 ld b,8 .loop0 call prepare and 252; 11111100 ld c,a ld a,(hl) and 3 or c ld (hl),a inc h inc de djnz loop0 ld c,252 jr under .jump1; first screen 1-0, second screen 7-4 push de push hl ld b,8 .loop1a call prepare rlca rlca and 3; 00000011 ld c,a ld a,(hl) and 252 or c ld (hl),a inc h inc de djnz loop1a ld c,3 call under pop hl set 5,h .preloop1b pop de ld b,8 .loop1b call prepare rlca rlca and 240; 11110000 ld c,a ld a,(hl) and 15 or c ld (hl),a inc h inc de djnz loop1b ld c,240 jr under .jump5; second display bits 1-0, first display next 7-4 push de push hl set 5,h ld b,8 .loop5a call prepare rlca rlca and 3; 00000011 ld c,a ld a,(hl) and 252 or c ld (hl),a inc h inc de djnz loop5a ld c,3 call under pop hl inc hl jr preloop1b .under dec h .UNDERLINE ld a,0 ; underline and c or (hl) ld (hl),a ret .jump2; second display bits 3-0, first display next 7-6 push de push hl set 5,h ld b,8 .loop2a call prepare rrca rrca rrca rrca and 15; 00001111 ld c,a ld a,(hl) and 240 or c ld (hl),a inc h inc de djnz loop2a ld c,15 call under pop hl inc hl .preloop2b ld b,8 pop de .loop2b call prepare rrca rrca rrca rrca and 192; 11000000 ld c,a ld a,(hl) and 63 or c ld (hl),a inc h inc de djnz loop2b ld c,192 jr under .jump6; first display bits 3-0; second display bits 7-6 push de push hl ld b,8 .loop6a call prepare rrca rrca rrca rrca and 15; 00001111 ld c,a ld a,(hl) and 240 or c ld (hl),a inc h inc de djnz loop6a ld c,15 call under pop hl set 5,h jr preloop2b .prepare ex de,hl ld a,(hl) .BOLD nop nop .INVRS xor 0 ex de,hl ret .font IF ROMFONT ; nothing here ! ELSE BINARY "stdio/ansi/F6.BIN" ENDIF
src/playercollision.asm
hackneyc/CastleEscape
0
178838
<gh_stars>0 extern _currentTileMap extern _falling extern _jumping extern _setupScreen extern _tileMapX extern _tileMapY extern _xPos extern _xSpeed extern _yPos extern _ySpeed extern die extern wyz_play_sound public checkXCol public checkYCol include "defs.inc" section CODE_2 defc ID_SOLID_TILE=12*TILE_SHEET_WIDTH defc ID_SOFT_TILE=10*TILE_SHEET_WIDTH defc FALL_DISTANCE=33 ; ; Check for player colliding with platforms on ; the X axis and if the player is going off the screen ; to the left or right display the next or previous ; level. ; ; Entry: ; a - xSpeed ; ; Register variables: ; b - xSpeed ; c - yPos ; checkXCol: ld b, a ; Save xSpeed ld a, (_xPos) ; Get the X pixel offset ld e, a ld d, 0 ; or a ; Flags were updated based on this value before we were called jp p, movingRight ; If positive moving right dec de ; else negative, moving left. Subtract 1 from xPos. jr endif movingRight: ld a, PLAYER_WIDTH ; else add player width addde endif: ld a, (_yPos) ; Get the yPos ld l, a ld h, 0 ld a, -24 ; Subtract the delta between the screen offset and the level offset add l ; Add the current y position ld c, a ; save it in 'c' and %11111000 ; Remove the pixel offset within the byte (lower 3 bits) ld l, a hlx TILEMAP_WIDTH/8 ; Divide by 8 to get byte offset and multiply by width of tilemap ; Divide xPos by 8 to get byte offset ld a, e sra d rra sra d rra sra d rra ld e, a add hl, de ; Add X byte offset to tile map Y index ld de, (_currentTileMap) add hl, de ld a, (hl) cp ID_SOLID_TILE ret nc ; 'nc' if a >= value ; Check the bottom half of the sprite ld de, TILEMAP_WIDTH add hl, de ld a, (hl) cp ID_SOLID_TILE ret nc ; 'nc' if a >= value ld a, c ; Restore yPos and %00000111 ; If the lower 3 bits are zero player has not shifted into jr z, checkXDone ; the next row down, we are done. add hl, de ; Next row down ld a, (hl) cp ID_SOLID_TILE ret nc ; 'nc' if a >= value checkXDone: ld a, (_xPos) ; Get the X pixel offset add b ; Add speed cp 0xff ; If new xPos is -1 jr z, previousXLevel ; display previous level. cp MAX_X_POS-PLAYER_WIDTH+1 jr nc, nextXLevel ; 'nc' if a >= value ld (_xPos), a ret previousXLevel: ld a, (_tileMapX) or a ret z dec a ld b, MAX_X_POS-PLAYER_WIDTH ; New x position jr changeXLevel nextXLevel: ld a, (_tileMapX) cp MAX_LEVEL_X-1 ret z inc a ld b, 0 ; New x position changeXLevel: ld (_tileMapX), a ld a, b ; New x position ld (_xPos), a call _setupScreen ret ; ; Check for player colliding with platforms on ; the Y axis and if the player is going off the screen ; to the top or bottom display the next or previous ; level. ; ; Entry: ; None ; ; Register variables: ; b - ySpeed ; c - xPos ; checkYCol: ld a, (_yPos) ld l, a ld h, 0 ld a, (_ySpeed) ; Check if ySpeed is negative ld b, a or a jp p, movingDown ; Moving down or stopped ld de, -25 ; Pixel position above the player jr endif2 movingDown: ld b, 1 ; Force gravity as ySpeed could by 0 ld de, PLAYER_HEIGHT-24 ; Pixel position below the player endif2: add hl, de ; ; Divide hl by 8 to remove the pixel offset. ; It could be negative at this point. ; ld a, l sra h rra sra h rra sra h rra ld l, a ; ; Multiply by TILEMAP_WIDTH ; hlx TILEMAP_WIDTH ld a, (_xPos) ; Get the X pixel offset ld c, a ; Save pixel offset for later rrca ; Divide by 8 to get the byte offset rrca ; Faster to do rrca followed by AND rather than srl rrca and %00011111 addhl ; Add X byte offset to tile map Y index ld de, (_currentTileMap) add hl, de ld d, ID_SOLID_TILE ; Default to ID_SOLID_TILE ld a, b or a jp m, test ; Player is moving upward, only check solid tiles ; Player is moving downward, include solid tiles also. ld d, ID_SOFT_TILE ; Switch to ID_SOFT_TILE test: ld a, (hl) ; Get tile ID cp d jr nc, yCollision ; 'nc' if a >= value inc hl ; Next tile to the right ld a, (hl) ; Get tile ID cp d jr nc, yCollision ; 'nc' if a >= value ld a, c ; Restore X pixel offset and %00000111 ; Check if any of the lower 3 bits are set jr z, noYCollision ; if not we are done inc hl ; Check the tile to the right ld a, (hl) cp d jr nc, yCollision ; 'nc' if a >= value noYCollision: ld a, (_jumping) ; Check if player jumping or a jr nz, updateYPos ; ; Transition to falling. ; Clear X movement. ; set ySpeed to 1 (down). ; increment the falling counter. xor a ld (_xSpeed), a inc a ld (_ySpeed), a ld hl, _falling inc (hl) ld a, FALL_DISTANCE ; Distance before falling starts cp (hl) ld a, AYFX_FALLING call z, wyz_play_sound updateYPos: ; ; Update y position ; ld a, (_yPos) add b cp MAX_Y_POS-PLAYER_HEIGHT jr nc, nextYLevel ; 'nc' if a >= value cp 24 jr c, previousYLevel ; 'c' if 'a' < value ld (_yPos), a ret previousYLevel: ld a, (_tileMapY) or a ret z dec a ld b, MAX_Y_POS-PLAYER_HEIGHT jr changeYLevel nextYLevel: ld a, (_tileMapY) cp MAX_LEVEL_Y-1 ret z inc a ld b, 24 changeYLevel: ld (_tileMapY), a ld a, b ld (_yPos), a call _setupScreen ret yCollision: ; ; If player was moving down, stop moving ; ld a, b or a jp p, landed ; ; Player is going up check for ID_SOFT_TILE ; ld a, d cp ID_SOFT_TILE jr z, noYCollision ; ; Collided with ID_SOLID_TILE going up ; Don't update yPos. ; ret landed: ; ; Reset ySpeed, jumping count and falling flag ; ld a, (_falling) cp FALL_DISTANCE call nc, die xor a ld (_ySpeed), a ld (_jumping), a ld (_falling), a ret
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52104y.ada
best08618/asylo
7
24032
<reponame>best08618/asylo -- C52104Y.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS. -- MORE SPECIFICALLY, TEST THAT ATTEMPTED ASSIGNMENTS BETWEEN -- ARRAYS WITH NON-MATCHING LENGTHS LEAVE THE DESTINATION ARRAY -- INTACT AND CAUSE CONSTRAINT_ERROR TO BE RAISED. -- (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT -- ARE TREATED ELSEWHERE.) -- THIS IS A SPECIAL CASE IN -- DIVISION D : NULL ARRAYS WHOSE LENGTHS ARE NOT DETERMINABLE -- STATICALLY -- WHICH (THE SPECIAL CASE) TREATS TWO-DIMENSIONAL ARRAYS WHOSE LENGTH -- ALONG ONE DIMENSION IS GREATER THAN INTEGER'LAST AND WHOSE -- LENGTH ALONG THE OTHER DIMENSION IS 0 . -- AN ADDITIONAL OBJECTIVE OF THIS TEST IS TO CHECK WHETHER LENGTH -- COMPARISONS (AND LENGTH COMPUTATIONS) CAUSE CONSTRAINT_ERROR -- TO BE RAISED. -- *** NOTE: This test has been modified since ACVC version 1.11 to -- 9X -- *** remove incompatibilities associated with the transition -- 9X -- *** to Ada 9X. -- 9X -- *** -- 9X -- RM 07/31/81 -- SPS 03/22/83 -- JBG 06/16/83 -- EG 10/28/85 FIX NUMERIC_ERROR/CONSTRAINT_ERROR ACCORDING TO -- AI-00387. -- MRM 03/30/93 REMOVE NUMERIC_ERROR FOR 9X COMPATIBILITY WITH REPORT; PROCEDURE C52104Y IS USE REPORT ; BEGIN TEST( "C52104Y" , "CHECK THAT IN ARRAY ASSIGNMENTS AND IN SLICE" & " ASSIGNMENTS, THE LENGTHS MUST MATCH" ); -- IN THIS TEST WE CAN'T USE AGGREGATE ASSIGNMENT (EXCEPT WHEN -- THE AGGREGATES ARE STRING LITERALS); THEREFORE: -- -- (1) ARRAYS WILL BE INITIALIZED BY INDIVIDUAL ASSIGNMENTS; -- (2) CAN'T USE NON-NULL CONSTANT ARRAYS. -- WE ASSUME THAT IN AN ARRAY_TYPE_DEFINITION THE INDEX PORTION -- AND THE COMPONENT_TYPE PORTION ARE FUNCTIONALLY ORTHOGONAL -- ALSO AT THE IMPLEMENTATION LEVEL, I.E. THAT THE CORRECTNESS -- OF THE ACCESSING MECHANISM FOR ARRAYS DOES NOT DEPEND ON -- COMPONENT_TYPE. ACCORDINGLY WE ARE TESTING FOR SOME BUT -- NOT ALL KINDS OF COMPONENT_TYPE. (COMPONENT_TYPES INCLUDED: -- INTEGER , CHARACTER , BOOLEAN .) ------------------------------------------------------------------- -- (10) MULTIDIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS WERE -- DEFINED USING THE "BOX" COMPOUND SYMBOL. -- (TWO-DIMENSIONAL ARRAYS OF BOOLEANS.) CONSTR_ERR: BEGIN -- THIS BLOCK CATCHES CONSTRAINT_ERROR IF IT IS -- RAISED BY THE SUBTYPE DECLARATION. DCL_ARR: DECLARE TYPE TABOX5 IS ARRAY( INTEGER RANGE <> , INTEGER RANGE <> ) OF BOOLEAN ; PRAGMA PACK (TABOX5); SUBTYPE TABOX52 IS TABOX5( IDENT_INT(13)..IDENT_INT( 13 ) , IDENT_INT(-6)..IDENT_INT( INTEGER'LAST-4 ) ); BEGIN COMMENT ("NO CONSTRAINT_ERROR FOR NON-NULL ARRAY SUBTYPE " & "WHEN ONE DIMENSION HAS INTEGER'LAST + 3 " & "COMPONENTS"); OBJ_DCL: DECLARE -- THIS BLOCK DECLARES ONE NULL ARRAY AND ONE -- PACKED BOOLEAN ARRAY WITH INTEGER'LAST + 3 -- COMPONENTS; STORAGE ERROR MAY BE RAISED. ARRX51 : TABOX5( IDENT_INT(13)..IDENT_INT( 12 ) , IDENT_INT(-6)..IDENT_INT( INTEGER'LAST-4 ) ); ARRX52 : TABOX52 ; -- BIG ARRAY HERE. BEGIN COMMENT ("NO CONSTRAINT OR STORAGE ERROR WHEN ARRAY "& "WITH INTEGER'LAST+3 COMPONENTS ALLOCATED"); -- NULL ARRAY ASSIGNMENT: ARRX52 := ARRX51 ; FAILED( "EXCEPTION NOT RAISED (10)" ); EXCEPTION WHEN CONSTRAINT_ERROR => COMMENT ("CONSTRAINT_ERROR RAISED WHEN " & "CHECKING LENGTHS FOR ARRAY HAVING " & "> INTEGER'LAST COMPONENTS ON ONE " & "DIMENSION"); WHEN OTHERS => FAILED( "OTHER EXCEPTION RAISED - SUBTEST 10"); END OBJ_DCL; EXCEPTION WHEN STORAGE_ERROR => COMMENT ("STORAGE_ERROR RAISED WHEN DECLARING ONE "& "PACKED BOOLEAN ARRAY WITH INTEGER'LAST "& "+ 3 COMPONENTS"); WHEN CONSTRAINT_ERROR => COMMENT ("CONSTRAINT_ERROR RAISED WHEN DECLARING "& "ONE PACKED BOOLEAN ARRAY WITH "& "INTEGER'LAST + 3 COMPONENTS"); WHEN OTHERS => FAILED ("SOME EXCEPTION RAISED - 3"); END DCL_ARR; EXCEPTION WHEN CONSTRAINT_ERROR => COMMENT ("CONSTRAINT_ERROR RAISED WHEN DECLARING AN " & "ARRAY SUBTYPE WITH INTEGER'LAST + 3 " & "COMPONENTS"); WHEN STORAGE_ERROR => FAILED ("STORAGE_ERROR RAISED FOR TYPE DECLARATION"); WHEN OTHERS => FAILED( "OTHER EXCEPTION RAISED - 4"); END CONSTR_ERR; RESULT ; END C52104Y;
scripts/UndergroundPathRoute7Copy.asm
opiter09/ASM-Machina
1
98666
UndergroundPathRoute7Copy_Script: ld a, ROUTE_7 ld [wLastMap], a ret UndergroundPathRoute7Copy_TextPointers: dw UGPathRoute7EntranceUnusedText_5d773 dw UGPathRoute7EntranceUnusedText_5d77d UGPathRoute7EntranceUnusedText_5d773: text_far _UGPathRoute7EntranceUnusedText_5d773 text_end UGPathRoute7EntranceUnusedText_5d778: text_far _UGPathRoute7EntranceUnusedText_5d778 text_end UGPathRoute7EntranceUnusedText_5d77d: text_far _UGPathRoute7EntranceUnusedText_5d77d text_end UGPathRoute7EntranceUnusedText_5d782: text_far _UGPathRoute7EntranceUnusedText_5d782 text_end
source/serial.asm
re0ah/nameless-OS16
0
87793
;This is free and unencumbered software released into the public domain. ;Anyone is free to copy, modify, publish, use, compile, sell, or ;distribute this software, either in source code form or as a compiled ;binary, for any purpose, commercial or non-commercial, and by any ;means. ;In jurisdictions that recognize copyright laws, the author or authors ;of this software dedicate any and all copyright interest in the ;software to the public domain. We make this dedication for the benefit ;of the public at large and to the detriment of our heirs and ;successors. We intend this dedication to be an overt act of ;relinquishment in perpetuity of all present and future rights to this ;software under copyright law. ;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ;IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ;ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ;OTHER DEALINGS IN THE SOFTWARE. ;For more information, please refer to <http://unlicense.org/> ;thanks for information: ;https://www.youtube.com/watch?v=Fi2IU2TxKhI (отличные лекции) ;https://wiki.osdev.org/Serial_Ports ;https://en.wikipedia.org/wiki/Serial_port ;http://users.utcluj.ro/~baruch/media/siee/labor/Serial-Port.pdf ;base address COM port + offset = address of the register. COM1_PORT equ 0x03F8 COM2_PORT equ 0x02F8 COM3_PORT equ 0x03E8 COM4_PORT equ 0x02E8 COM_THR equ 0x00 ;write, Transmitter Holding Register COM_RBR equ 0x00 ;read, Receiver Buffer Register COM_LSB equ 0x00 ;r/w, Divisor Latch Register LSB low COM_IER equ 0x01 ;r/w, Interrupt Enable Register COM_MSB equ 0x01 ;r/w, Divisor Latch Register MSB high COM_IIR equ 0x02 ;read, Interrupt Identification Register COM_FCR equ 0x02 ;write, FIFO Control Register COM_LCR equ 0x03 ;r/w, Line Control Register COM_MCR equ 0x04 ;r/w, Modem Control Register COM_LSR equ 0x05 ;read, Line Status Register COM_MSR equ 0x06 ;read, Modem Status Register COM_SCR equ 0x07 ;r/w, Scratch Register SYNC_CHAR equ 0x16 IRQ_COM1 equ 0x04 IRQ_COM2 equ 0x03 IRQ_COM3 equ 0x04 IRQ_COM4 equ 0x03 PICM equ 0x20 ;master PIC port PICS equ 0xA0 ;slave PIC port PIC_EOI equ 0x20 ;end of interrupt code serial_init: ;in: ;out: al = 0x0B ; dx = COM1_PORT + COM_MCR ;disable interrupts of com port mov al, 0x00 mov dx, COM1_PORT + COM_IER out dx, al ;enable DLAB mov al, 0x80 mov dx, COM1_PORT + COM_LCR out dx, al ;set Baud rate (0x0003) 38,400 bits/s mov al, 0x03 mov dx, COM1_PORT + COM_LSB out dx, al mov al, 0x00 mov dx, COM1_PORT + COM_MSB out dx, al ;clear Baud rate bit and set (8 bits one message, ; one stop bit, ; no parity) mov al, 0x03 mov dx, COM1_PORT + COM_LCR out dx, al ; enable FIFO, clear FIFO, reset FIFO, DMA off, ;interrupt requst generated after 14 chars mov al, 0xC7 mov dx, COM1_PORT + COM_FCR out dx, al ;RTS & DTR enable, IRQ enable, loop disable mov al, 0x0B mov dx, COM1_PORT + COM_MCR out dx, al retn serial_received: ;check if data ready (LSR bit 0) ;in: ;out: al = 0x00 if have not data, 0x01 if have ; dx = COM1_PORT + COM_LSR mov dx, COM1_PORT + COM_LSR in al, dx and al, 0x01 retn read_serial: ;read while data ready ;in: ;out: al = data from com port ; dx = COM1_PORT + COM_RBR call serial_received test al, al je read_serial mov dx, COM1_PORT + COM_RBR in al, dx retn is_transmit_empty: ;in: ;out: al = 0x00 if transmit is empty, else 0x20 ; dx = COM1_PORT + COM_LSR mov dx, COM1_PORT + COM_LSR in al, dx and al, 0x20 retn write_serial: ;in: al = char ;out: al = char ; dx = COM1_PORT + COM_THR push ax call is_transmit_empty test al, al je write_serial pop ax mov dx, COM1_PORT + COM_THR out dx, al retn com1_int: ;for this interruption need buffer where will be stored received data. ; in case of overflow data will be lost. In future, maybe, data will be saved ;in disk mov bx, word[com1_buffer_pos] cmp bx, COM1_BUFFER_SIZE je .buffer_overflow mov dx, COM1_PORT + COM_RBR in al, dx mov byte[COM1_BUFFER + bx], al inc bx mov word[com1_buffer_pos], bx .buffer_overflow: jmp return_from_interrupt
testsuite/league/string_compare_test.adb
svn2github/matreshka
24
8833
<reponame>svn2github/matreshka ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Testsuite Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2011, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Characters.Wide_Wide_Latin_1; with League.Application; with League.Strings; procedure String_Compare_Test is use Ada.Characters.Wide_Wide_Latin_1; use League.Strings; procedure Test_1; procedure Test_2; ------------ -- Test_1 -- ------------ procedure Test_1 is -- Checks whether string with different length compared correctly. S1 : Universal_String := To_Universal_String ("1"); S2 : Universal_String := To_Universal_String ("12"); begin if S1 = S2 then raise Program_Error; end if; if S1 > S2 then raise Program_Error; end if; if S1 >= S2 then raise Program_Error; end if; if not (S1 < S2) then raise Program_Error; end if; if not (S1 <= S2) then raise Program_Error; end if; end Test_1; ------------ -- Test_2 -- ------------ procedure Test_2 is -- This test checks correct handling case when early characters is not -- equal and had reverse relationship than later characters. S1 : Universal_String := To_Universal_String ("03"); S2 : Universal_String := To_Universal_String ("12"); begin if S1 = S2 then raise Program_Error; end if; if S1 > S2 then raise Program_Error; end if; if S1 >= S2 then raise Program_Error; end if; if not (S1 < S2) then raise Program_Error; end if; if not (S1 <= S2) then raise Program_Error; end if; end Test_2; begin Test_1; Test_2; end String_Compare_Test;
tests/tcl-info-test_data-tests.adb
thindil/tashy2
2
27239
<gh_stars>1-10 -- This package has been generated automatically by GNATtest. -- You are allowed to add your code to the bodies of test routines. -- Such changes will be kept during further regeneration of this file. -- All code placed outside of test routine bodies will be lost. The -- code intended to set up and tear down the test environment should be -- placed into Tcl.Info.Test_Data. with AUnit.Assertions; use AUnit.Assertions; with System.Assertions; -- begin read only -- id:2.2/00/ -- -- This section can be used to add with clauses if necessary. -- -- end read only with Tcl.Lists; use Tcl.Lists; with Tcl.Strings; use Tcl.Strings; with Tcl.Variables; use Tcl.Variables; -- begin read only -- end read only package body Tcl.Info.Test_Data.Tests is -- begin read only -- id:2.2/01/ -- -- This section can be used to add global variables and other elements. -- -- end read only -- begin read only -- end read only -- begin read only function Wrap_Test_Get_Arguments_58c9c6_88ad08 (Proc_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin begin pragma Assert ((Proc_Name'Length > 0 and Proc_Name'Length < Integer'Last - 10) and Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Arguments test requirement violated"); end; declare Test_Get_Arguments_58c9c6_88ad08_Result: constant Array_List := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Arguments (Proc_Name, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Arguments test commitment violated"); end; return Test_Get_Arguments_58c9c6_88ad08_Result; end; end Wrap_Test_Get_Arguments_58c9c6_88ad08; -- end read only -- begin read only procedure Test_Get_Arguments_test_info_arguments(Gnattest_T: in out Test); procedure Test_Get_Arguments_58c9c6_88ad08(Gnattest_T: in out Test) renames Test_Get_Arguments_test_info_arguments; -- id:2.2/58c9c62146c0356d/Get_Arguments/1/0/test_info_arguments/ procedure Test_Get_Arguments_test_info_arguments(Gnattest_T: in out Test) is function Get_Arguments (Proc_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List renames Wrap_Test_Get_Arguments_58c9c6_88ad08; -- end read only pragma Unreferenced(Gnattest_T); begin Tcl_Eval("proc myproc {arg1 {arg2 2}} {return 0}"); declare Result: Array_List := Get_Arguments("myproc"); begin Assert (Result'Length = 2 and Result(1) = To_Tcl_String("arg1"), "Failed to get arguments list of Tcl procedure."); end; -- begin read only end Test_Get_Arguments_test_info_arguments; -- end read only -- begin read only function Wrap_Test_Get_Procedure_Body_4ab4c1_bdefa7 (Proc_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert ((Proc_Name'Length > 0 and Proc_Name'Length < Integer'Last - 10) and Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Procedure_Body test requirement violated"); end; declare Test_Get_Procedure_Body_4ab4c1_bdefa7_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Procedure_Body (Proc_Name, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Procedure_Body test commitment violated"); end; return Test_Get_Procedure_Body_4ab4c1_bdefa7_Result; end; end Wrap_Test_Get_Procedure_Body_4ab4c1_bdefa7; -- end read only -- begin read only procedure Test_Get_Procedure_Body_test_info_procedure_body (Gnattest_T: in out Test); procedure Test_Get_Procedure_Body_4ab4c1_bdefa7 (Gnattest_T: in out Test) renames Test_Get_Procedure_Body_test_info_procedure_body; -- id:2.2/4ab4c1197abe1ad1/Get_Procedure_Body/1/0/test_info_procedure_body/ procedure Test_Get_Procedure_Body_test_info_procedure_body (Gnattest_T: in out Test) is function Get_Procedure_Body (Proc_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Procedure_Body_4ab4c1_bdefa7; -- end read only pragma Unreferenced(Gnattest_T); begin Assert (Get_Procedure_Body("myproc") = "return 0", "Failed to get the body of Tcl procedure."); -- begin read only end Test_Get_Procedure_Body_test_info_procedure_body; -- end read only -- begin read only function Wrap_Test_Get_Commands_Count_9e53d6_cae496 (Interpreter: Tcl_Interpreter := Get_Interpreter) return Natural is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Commands_Count test requirement violated"); end; declare Test_Get_Commands_Count_9e53d6_cae496_Result: constant Natural := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Commands_Count (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Commands_Count test commitment violated"); end; return Test_Get_Commands_Count_9e53d6_cae496_Result; end; end Wrap_Test_Get_Commands_Count_9e53d6_cae496; -- end read only -- begin read only procedure Test_Get_Commands_Count_test_info_commands_count (Gnattest_T: in out Test); procedure Test_Get_Commands_Count_9e53d6_cae496 (Gnattest_T: in out Test) renames Test_Get_Commands_Count_test_info_commands_count; -- id:2.2/9e53d671a67c9d1c/Get_Commands_Count/1/0/test_info_commands_count/ procedure Test_Get_Commands_Count_test_info_commands_count (Gnattest_T: in out Test) is function Get_Commands_Count (Interpreter: Tcl_Interpreter := Get_Interpreter) return Natural renames Wrap_Test_Get_Commands_Count_9e53d6_cae496; -- end read only pragma Unreferenced(Gnattest_T); begin Tcl_Eval("info cmdcount"); Assert (Get_Commands_Count = Tcl_Get_Result, "Failed to get amount of available Tcl commands."); -- begin read only end Test_Get_Commands_Count_test_info_commands_count; -- end read only -- begin read only function Wrap_Test_Get_Commands_f2ad9c_3093bd (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin begin pragma Assert (Interpreter /= Null_Interpreter and Pattern'Length < Integer'Last - 14); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Command test requirement violated"); end; declare Test_Get_Commands_f2ad9c_3093bd_Result: constant Array_List := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Commands (Pattern, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Command test commitment violated"); end; return Test_Get_Commands_f2ad9c_3093bd_Result; end; end Wrap_Test_Get_Commands_f2ad9c_3093bd; -- end read only -- begin read only procedure Test_Get_Commands_test_info_command(Gnattest_T: in out Test); procedure Test_Get_Commands_f2ad9c_3093bd(Gnattest_T: in out Test) renames Test_Get_Commands_test_info_command; -- id:2.2/f2ad9ce2c55ff78f/Get_Commands/1/0/test_info_command/ procedure Test_Get_Commands_test_info_command(Gnattest_T: in out Test) is function Get_Commands (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List renames Wrap_Test_Get_Commands_f2ad9c_3093bd; -- end read only pragma Unreferenced(Gnattest_T); Commands_Array: Array_List := Get_Commands("put*"); begin Assert (Commands_Array'Length = 1 and Commands_Array(1) = To_Unbounded_String("puts"), "Failed to get names of available Tcl commands."); -- begin read only end Test_Get_Commands_test_info_command; -- end read only -- begin read only function Wrap_Test_Complete_c39017_214fb5 (Command: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Boolean_Result is begin begin pragma Assert ((Command'Length > 0 and Command'Length < Integer'Last - 14) and Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Complete test requirement violated"); end; declare Test_Complete_c39017_214fb5_Result: constant Tcl_Boolean_Result := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Complete (Command, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Complete test commitment violated"); end; return Test_Complete_c39017_214fb5_Result; end; end Wrap_Test_Complete_c39017_214fb5; -- end read only -- begin read only procedure Test_Complete_test_info_complete(Gnattest_T: in out Test); procedure Test_Complete_c39017_214fb5(Gnattest_T: in out Test) renames Test_Complete_test_info_complete; -- id:2.2/c3901773247ad5a6/Complete/1/0/test_info_complete/ procedure Test_Complete_test_info_complete(Gnattest_T: in out Test) is function Complete (Command: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Boolean_Result renames Wrap_Test_Complete_c39017_214fb5; -- end read only pragma Unreferenced(Gnattest_T); begin Assert (Complete("puts").Result, "Failed to get completion status of the selected Tcl command."); -- begin read only end Test_Complete_test_info_complete; -- end read only -- begin read only function Wrap_Test_Get_Coroutine_df9ca4_613b2a (Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Coroutine test requirement violated"); end; declare Test_Get_Coroutine_df9ca4_613b2a_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Coroutine (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Coroutine test commitment violated"); end; return Test_Get_Coroutine_df9ca4_613b2a_Result; end; end Wrap_Test_Get_Coroutine_df9ca4_613b2a; -- end read only -- begin read only procedure Test_Get_Coroutine_test_info_coroutine(Gnattest_T: in out Test); procedure Test_Get_Coroutine_df9ca4_613b2a(Gnattest_T: in out Test) renames Test_Get_Coroutine_test_info_coroutine; -- id:2.2/df9ca4d1f658a1c9/Get_Coroutine/1/0/test_info_coroutine/ procedure Test_Get_Coroutine_test_info_coroutine(Gnattest_T: in out Test) is function Get_Coroutine (Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Coroutine_df9ca4_613b2a; -- end read only pragma Unreferenced(Gnattest_T); begin Assert (Get_Coroutine = "", "Failed to get the name of current coroutine."); -- begin read only end Test_Get_Coroutine_test_info_coroutine; -- end read only -- begin read only function Wrap_Test_Get_Default_b559cf_8294d7 (Proc_Name, Argument, Var_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Boolean_Result is begin begin pragma Assert ((Proc_Name'Length > 0 and Argument'Length > 0 and Var_Name'Length > 0 and Interpreter /= Null_Interpreter) and then Proc_Name'Length + Argument'Length + Var_Name'Length < Long_Long_Integer(Integer'Last - 15)); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Default test requirement violated"); end; declare Test_Get_Default_b559cf_8294d7_Result: constant Tcl_Boolean_Result := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Default (Proc_Name, Argument, Var_Name, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Default test commitment violated"); end; return Test_Get_Default_b559cf_8294d7_Result; end; end Wrap_Test_Get_Default_b559cf_8294d7; -- end read only -- begin read only procedure Test_Get_Default_test_info_default(Gnattest_T: in out Test); procedure Test_Get_Default_b559cf_8294d7(Gnattest_T: in out Test) renames Test_Get_Default_test_info_default; -- id:2.2/b559cf9b1d02f32b/Get_Default/1/0/test_info_default/ procedure Test_Get_Default_test_info_default(Gnattest_T: in out Test) is function Get_Default (Proc_Name, Argument, Var_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Boolean_Result renames Wrap_Test_Get_Default_b559cf_8294d7; -- end read only pragma Unreferenced(Gnattest_T); begin Assert (not Get_Default("myproc", "arg1", "myvalue").Result, "Failed to get info about no default value in Tcl procedure."); if Get_Default("myproc", "arg2", "myvalue").Result then Assert (Tcl_Get_Var("myvalue") = "2", "Failed to get default value for Tcl procedure."); else Assert (False, "Failed to get info about default value in Tcl procedure."); end if; -- begin read only end Test_Get_Default_test_info_default; -- end read only -- begin read only function Wrap_Test_Get_Error_Stack_c33442_123ed2 (Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_ErrorStack test requirement violated"); end; declare Test_Get_Error_Stack_c33442_123ed2_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Error_Stack (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_ErrorStack test commitment violated"); end; return Test_Get_Error_Stack_c33442_123ed2_Result; end; end Wrap_Test_Get_Error_Stack_c33442_123ed2; -- end read only -- begin read only procedure Test_Get_Error_Stack_test_info_errorstack (Gnattest_T: in out Test); procedure Test_Get_Error_Stack_c33442_123ed2 (Gnattest_T: in out Test) renames Test_Get_Error_Stack_test_info_errorstack; -- id:2.2/c33442c4db0e9986/Get_Error_Stack/1/0/test_info_errorstack/ procedure Test_Get_Error_Stack_test_info_errorstack (Gnattest_T: in out Test) is function Get_Error_Stack (Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Error_Stack_c33442_123ed2; -- end read only pragma Unreferenced(Gnattest_T); begin Assert(Get_Error_Stack'Length = 0, "Failed to get error stack info."); -- begin read only end Test_Get_Error_Stack_test_info_errorstack; -- end read only -- begin read only function Wrap_Test_Exists_a87cb0_c90638 (Var_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Boolean_Result is begin begin pragma Assert ((Var_Name'Length > 0 and Var_Name'Length < Integer'Last - 12) and Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Exists test requirement violated"); end; declare Test_Exists_a87cb0_c90638_Result: constant Tcl_Boolean_Result := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Exists (Var_Name, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Exists test commitment violated"); end; return Test_Exists_a87cb0_c90638_Result; end; end Wrap_Test_Exists_a87cb0_c90638; -- end read only -- begin read only procedure Test_Exists_test_info_exists(Gnattest_T: in out Test); procedure Test_Exists_a87cb0_c90638(Gnattest_T: in out Test) renames Test_Exists_test_info_exists; -- id:2.2/a87cb0d7f49d8e1f/Exists/1/0/test_info_exists/ procedure Test_Exists_test_info_exists(Gnattest_T: in out Test) is function Exists (Var_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Boolean_Result renames Wrap_Test_Exists_a87cb0_c90638; -- end read only pragma Unreferenced(Gnattest_T); begin if not Tcl_Set_Var("myvar", "2") then Assert(False, "Failed to set Tcl variable for Info.Exists tests"); end if; Assert(Info.Exists("myvar").Result, "Failed to find existing variable."); Assert (not Info.Exists("randomnamevar").Result, "Failed to not find non existing variable."); -- begin read only end Test_Exists_test_info_exists; -- end read only -- begin read only function Wrap_Test_Get_Functions_5a1dbc_b56c6e (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin begin pragma Assert (Interpreter /= Null_Interpreter and Pattern'Length < Integer'Last - 15); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Functions test requirement violated"); end; declare Test_Get_Functions_5a1dbc_b56c6e_Result: constant Array_List := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Functions (Pattern, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Functions test commitment violated"); end; return Test_Get_Functions_5a1dbc_b56c6e_Result; end; end Wrap_Test_Get_Functions_5a1dbc_b56c6e; -- end read only -- begin read only procedure Test_Get_Functions_test_info_functions(Gnattest_T: in out Test); procedure Test_Get_Functions_5a1dbc_b56c6e(Gnattest_T: in out Test) renames Test_Get_Functions_test_info_functions; -- id:2.2/5a1dbc0c2cd65b4e/Get_Functions/1/0/test_info_functions/ procedure Test_Get_Functions_test_info_functions(Gnattest_T: in out Test) is function Get_Functions (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List renames Wrap_Test_Get_Functions_5a1dbc_b56c6e; -- end read only pragma Unreferenced(Gnattest_T); Functions_Array: Array_List := Get_Functions("log1*"); begin Assert (Functions_Array'Length = 1 and Functions_Array(1) = To_Unbounded_String("log10"), "Failed to get names of available Tcl math functions."); -- begin read only end Test_Get_Functions_test_info_functions; -- end read only -- begin read only function Wrap_Test_Get_Globals_1284d9_ae8ce6 (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin begin pragma Assert (Interpreter /= Null_Interpreter and Pattern'Length < Integer'Last - 13); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Globals test requirement violated"); end; declare Test_Get_Globals_1284d9_ae8ce6_Result: constant Array_List := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Globals (Pattern, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Globals test commitment violated"); end; return Test_Get_Globals_1284d9_ae8ce6_Result; end; end Wrap_Test_Get_Globals_1284d9_ae8ce6; -- end read only -- begin read only procedure Test_Get_Globals_test_info_globals(Gnattest_T: in out Test); procedure Test_Get_Globals_1284d9_ae8ce6(Gnattest_T: in out Test) renames Test_Get_Globals_test_info_globals; -- id:2.2/1284d97e337e3f8a/Get_Globals/1/0/test_info_globals/ procedure Test_Get_Globals_test_info_globals(Gnattest_T: in out Test) is function Get_Globals (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List renames Wrap_Test_Get_Globals_1284d9_ae8ce6; -- end read only pragma Unreferenced(Gnattest_T); Globals_Array: Array_List := Get_Globals("en*"); begin Assert (Globals_Array'Length = 1 and Globals_Array(1) = To_Unbounded_String("env"), "Failed to get names of available Tcl global variables."); -- begin read only end Test_Get_Globals_test_info_globals; -- end read only -- begin read only function Wrap_Test_Get_Host_Name_0a278d_b2a918 (Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_HostName test requirement violated"); end; declare Test_Get_Host_Name_0a278d_b2a918_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Host_Name (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_HostName test commitment violated"); end; return Test_Get_Host_Name_0a278d_b2a918_Result; end; end Wrap_Test_Get_Host_Name_0a278d_b2a918; -- end read only -- begin read only procedure Test_Get_Host_Name_test_info_hostname(Gnattest_T: in out Test); procedure Test_Get_Host_Name_0a278d_b2a918(Gnattest_T: in out Test) renames Test_Get_Host_Name_test_info_hostname; -- id:2.2/0a278d606913e740/Get_Host_Name/1/0/test_info_hostname/ procedure Test_Get_Host_Name_test_info_hostname(Gnattest_T: in out Test) is function Get_Host_Name (Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Host_Name_0a278d_b2a918; -- end read only pragma Unreferenced(Gnattest_T); begin Tcl_Eval("set host [info hostname]"); Assert (Get_Host_Name = Tcl_Get_Var("host"), "Failed to get the host name."); -- begin read only end Test_Get_Host_Name_test_info_hostname; -- end read only -- begin read only function Wrap_Test_Get_Library_36938c_8b9a20 (Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Library test requirement violated"); end; declare Test_Get_Library_36938c_8b9a20_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Library (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Library test commitment violated"); end; return Test_Get_Library_36938c_8b9a20_Result; end; end Wrap_Test_Get_Library_36938c_8b9a20; -- end read only -- begin read only procedure Test_Get_Library_test_info_library(Gnattest_T: in out Test); procedure Test_Get_Library_36938c_8b9a20(Gnattest_T: in out Test) renames Test_Get_Library_test_info_library; -- id:2.2/36938c1064dbfd83/Get_Library/1/0/test_info_library/ procedure Test_Get_Library_test_info_library(Gnattest_T: in out Test) is function Get_Library (Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Library_36938c_8b9a20; -- end read only pragma Unreferenced(Gnattest_T); begin Tcl_Eval("set library [info library]"); Assert (Get_Library = Tcl_Get_Var("library"), "Failed to get the path to Tcl library."); -- begin read only end Test_Get_Library_test_info_library; -- end read only -- begin read only function Wrap_Test_Get_Locals_09a275_95f4c0 (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin begin pragma Assert (Interpreter /= Null_Interpreter and Pattern'Length < Integer'Last - 12); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Locals test requirement violated"); end; declare Test_Get_Locals_09a275_95f4c0_Result: constant Array_List := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Locals (Pattern, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Locals test commitment violated"); end; return Test_Get_Locals_09a275_95f4c0_Result; end; end Wrap_Test_Get_Locals_09a275_95f4c0; -- end read only -- begin read only procedure Test_Get_Locals_test_info_locals(Gnattest_T: in out Test); procedure Test_Get_Locals_09a275_95f4c0(Gnattest_T: in out Test) renames Test_Get_Locals_test_info_locals; -- id:2.2/09a2750c074ec5b0/Get_Locals/1/0/test_info_locals/ procedure Test_Get_Locals_test_info_locals(Gnattest_T: in out Test) is function Get_Locals (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List renames Wrap_Test_Get_Locals_09a275_95f4c0; -- end read only pragma Unreferenced(Gnattest_T); Locals_Array: Array_List := Get_Locals; begin Assert (Locals_Array'Length = 0, "Failed to get names of available Tcl local variables."); -- begin read only end Test_Get_Locals_test_info_locals; -- end read only -- begin read only function Wrap_Test_Get_Name_Of_Executable_1cc16d_24ff4c (Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Name_Of_Executable test requirement violated"); end; declare Test_Get_Name_Of_Executable_1cc16d_24ff4c_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Name_Of_Executable (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Name_Of_Executable test commitment violated"); end; return Test_Get_Name_Of_Executable_1cc16d_24ff4c_Result; end; end Wrap_Test_Get_Name_Of_Executable_1cc16d_24ff4c; -- end read only -- begin read only procedure Test_Get_Name_Of_Executable_test_info_name_of_executable (Gnattest_T: in out Test); procedure Test_Get_Name_Of_Executable_1cc16d_24ff4c (Gnattest_T: in out Test) renames Test_Get_Name_Of_Executable_test_info_name_of_executable; -- id:2.2/1cc16d3669fcd83d/Get_Name_Of_Executable/1/0/test_info_name_of_executable/ procedure Test_Get_Name_Of_Executable_test_info_name_of_executable (Gnattest_T: in out Test) is function Get_Name_Of_Executable (Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Name_Of_Executable_1cc16d_24ff4c; -- end read only pragma Unreferenced(Gnattest_T); begin Tcl_Eval("set nameofexec [info nameofexecutable]"); Assert (Get_Name_Of_Executable = Tcl_Get_Var("nameofexec"), "Failed to get the name of executable."); -- begin read only end Test_Get_Name_Of_Executable_test_info_name_of_executable; -- end read only -- begin read only function Wrap_Test_Get_Patch_Level_0baa9d_325136 (Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Patch_Level test requirement violated"); end; declare Test_Get_Patch_Level_0baa9d_325136_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Patch_Level (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Patch_Level test commitment violated"); end; return Test_Get_Patch_Level_0baa9d_325136_Result; end; end Wrap_Test_Get_Patch_Level_0baa9d_325136; -- end read only -- begin read only procedure Test_Get_Patch_Level_test_info_patch_level (Gnattest_T: in out Test); procedure Test_Get_Patch_Level_0baa9d_325136 (Gnattest_T: in out Test) renames Test_Get_Patch_Level_test_info_patch_level; -- id:2.2/0baa9dff03cbd14f/Get_Patch_Level/1/0/test_info_patch_level/ procedure Test_Get_Patch_Level_test_info_patch_level (Gnattest_T: in out Test) is function Get_Patch_Level (Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Patch_Level_0baa9d_325136; -- end read only pragma Unreferenced(Gnattest_T); begin Tcl_Eval("set patch [info patchlevel]"); Assert (Get_Patch_Level = Tcl_Get_Var("patch"), "Failed to get the library patch level."); -- begin read only end Test_Get_Patch_Level_test_info_patch_level; -- end read only -- begin read only function Wrap_Test_Get_Procedures_848b43_17d3ea (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin begin pragma Assert (Interpreter /= Null_Interpreter and Pattern'Length < Integer'Last - 11); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Procs test requirement violated"); end; declare Test_Get_Procedures_848b43_17d3ea_Result: constant Array_List := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Procedures (Pattern, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Procs test commitment violated"); end; return Test_Get_Procedures_848b43_17d3ea_Result; end; end Wrap_Test_Get_Procedures_848b43_17d3ea; -- end read only -- begin read only procedure Test_Get_Procedures_test_info_procs(Gnattest_T: in out Test); procedure Test_Get_Procedures_848b43_17d3ea(Gnattest_T: in out Test) renames Test_Get_Procedures_test_info_procs; -- id:2.2/848b431ab34cfb83/Get_Procedures/1/0/test_info_procs/ procedure Test_Get_Procedures_test_info_procs(Gnattest_T: in out Test) is function Get_Procedures (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List renames Wrap_Test_Get_Procedures_848b43_17d3ea; -- end read only pragma Unreferenced(Gnattest_T); Procs_Array: Array_List := Get_Procedures("mypr*"); begin Assert (Procs_Array'Length = 1 and Procs_Array(1) = To_Unbounded_String("myproc"), "Failed to get names of available Tcl procedures."); -- begin read only end Test_Get_Procedures_test_info_procs; -- end read only -- begin read only function Wrap_Test_Get_Script_86aa75_0ba2b7 (File_Name: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert (Interpreter /= Null_Interpreter and File_Name'Length < Integer'Last - 12); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Script test requirement violated"); end; declare Test_Get_Script_86aa75_0ba2b7_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Script (File_Name, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Script test commitment violated"); end; return Test_Get_Script_86aa75_0ba2b7_Result; end; end Wrap_Test_Get_Script_86aa75_0ba2b7; -- end read only -- begin read only procedure Test_Get_Script_test_info_script(Gnattest_T: in out Test); procedure Test_Get_Script_86aa75_0ba2b7(Gnattest_T: in out Test) renames Test_Get_Script_test_info_script; -- id:2.2/86aa75d0f7b04cd9/Get_Script/1/0/test_info_script/ procedure Test_Get_Script_test_info_script(Gnattest_T: in out Test) is function Get_Script (File_Name: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Script_86aa75_0ba2b7; -- end read only pragma Unreferenced(Gnattest_T); begin Assert(Get_Script'Length = 0, "Failed to get the name of Tcl script."); -- begin read only end Test_Get_Script_test_info_script; -- end read only -- begin read only function Wrap_Test_Get_Tcl_Version_d04078_6661d4 (Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin begin pragma Assert(Interpreter /= Null_Interpreter); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Tcl_Version test requirement violated"); end; declare Test_Get_Tcl_Version_d04078_6661d4_Result: constant String := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Tcl_Version (Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Tcl_Version test commitment violated"); end; return Test_Get_Tcl_Version_d04078_6661d4_Result; end; end Wrap_Test_Get_Tcl_Version_d04078_6661d4; -- end read only -- begin read only procedure Test_Get_Tcl_Version_test_info_tcl_version (Gnattest_T: in out Test); procedure Test_Get_Tcl_Version_d04078_6661d4 (Gnattest_T: in out Test) renames Test_Get_Tcl_Version_test_info_tcl_version; -- id:2.2/d0407807e1ae595a/Get_Tcl_Version/1/0/test_info_tcl_version/ procedure Test_Get_Tcl_Version_test_info_tcl_version (Gnattest_T: in out Test) is function Get_Tcl_Version (Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames Wrap_Test_Get_Tcl_Version_d04078_6661d4; -- end read only pragma Unreferenced(Gnattest_T); begin Tcl_Eval("set version [info tclversion]"); Assert (Get_Tcl_Version = Tcl_Get_Var("version"), "Failed to get the Tcl version."); -- begin read only end Test_Get_Tcl_Version_test_info_tcl_version; -- end read only -- begin read only function Wrap_Test_Get_Variables_fedbab_b301bd (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin begin pragma Assert (Interpreter /= Null_Interpreter and Pattern'Length < Integer'Last - 10); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tcl-info.ads:0):Test_Info_Vars test requirement violated"); end; declare Test_Get_Variables_fedbab_b301bd_Result: constant Array_List := GNATtest_Generated.GNATtest_Standard.Tcl.Info.Get_Variables (Pattern, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tcl-info.ads:0:):Test_Info_Vars test commitment violated"); end; return Test_Get_Variables_fedbab_b301bd_Result; end; end Wrap_Test_Get_Variables_fedbab_b301bd; -- end read only -- begin read only procedure Test_Get_Variables_test_info_vars(Gnattest_T: in out Test); procedure Test_Get_Variables_fedbab_b301bd(Gnattest_T: in out Test) renames Test_Get_Variables_test_info_vars; -- id:2.2/fedbab0106f2223f/Get_Variables/1/0/test_info_vars/ procedure Test_Get_Variables_test_info_vars(Gnattest_T: in out Test) is function Get_Variables (Pattern: String := ""; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List renames Wrap_Test_Get_Variables_fedbab_b301bd; -- end read only pragma Unreferenced(Gnattest_T); Variables_Array: Array_List := Get_Variables("en*"); begin Assert (Variables_Array'Length = 1 and Variables_Array(1) = To_Tcl_String("env"), "Failed to get names of available all Tcl variables."); -- begin read only end Test_Get_Variables_test_info_vars; -- end read only -- begin read only -- id:2.2/02/ -- -- This section can be used to add elaboration code for the global state. -- begin -- end read only null; -- begin read only -- end read only end Tcl.Info.Test_Data.Tests;
oeis/218/A218173.asm
neoneye/loda-programs
11
243635
<filename>oeis/218/A218173.asm<gh_stars>10-100 ; A218173: Expansion of f(x^7, x^17) - x^2 * f(x, x^23) in powers of x where f(,) is Ramanujan's two-variable theta function. ; Submitted by <NAME> ; 1,0,-1,-1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,-1,0,0,-1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 mul $0,2 add $0,1 seq $0,121373 ; Expansion of f(x) = f(x, -x^2) in powers of x where f(, ) is Ramanujan's general theta function.
programs/oeis/084/A084367.asm
karttu/loda
1
2232
<filename>programs/oeis/084/A084367.asm ; A084367: a(n) = n*(2*n+1)^2. ; 0,9,50,147,324,605,1014,1575,2312,3249,4410,5819,7500,9477,11774,14415,17424,20825,24642,28899,33620,38829,44550,50807,57624,65025,73034,81675,90972,100949,111630,123039,135200,148137,161874,176435,191844,208125,225302,243399,262440,282449,303450,325467,348524,372645,397854,424175,451632,480249,510050,541059,573300,606797,641574,677655,715064,753825,793962,835499,878460,922869,968750,1016127,1065024,1115465,1167474,1221075,1276292,1333149,1391670,1451879,1513800,1577457,1642874,1710075,1779084,1849925,1922622,1997199,2073680,2152089,2232450,2314787,2399124,2485485,2573894,2664375,2756952,2851649,2948490,3047499,3148700,3252117,3357774,3465695,3575904,3688425,3803282,3920499,4040100,4162109,4286550,4413447,4542824,4674705,4809114,4946075,5085612,5227749,5372510,5519919,5670000,5822777,5978274,6136515,6297524,6461325,6627942,6797399,6969720,7144929,7323050,7504107,7688124,7875125,8065134,8258175,8454272,8653449,8855730,9061139,9269700,9481437,9696374,9914535,10135944,10360625,10588602,10819899,11054540,11292549,11533950,11778767,12027024,12278745,12533954,12792675,13054932,13320749,13590150,13863159,14139800,14420097,14704074,14991755,15283164,15578325,15877262,16179999,16486560,16796969,17111250,17429427,17751524,18077565,18407574,18741575,19079592,19421649,19767770,20117979,20472300,20830757,21193374,21560175,21931184,22306425,22685922,23069699,23457780,23850189,24246950,24648087,25053624,25463585,25877994,26296875,26720252,27148149,27580590,28017599,28459200,28905417,29356274,29811795,30272004,30736925,31206582,31680999,32160200,32644209,33133050,33626747,34125324,34628805,35137214,35650575,36168912,36692249,37220610,37754019,38292500,38836077,39384774,39938615,40497624,41061825,41631242,42205899,42785820,43371029,43961550,44557407,45158624,45765225,46377234,46994675,47617572,48245949,48879830,49519239,50164200,50814737,51470874,52132635,52800044,53473125,54151902,54836399,55526640,56222649,56924450,57632067,58345524,59064845,59790054,60521175,61258232,62001249 mov $1,$0 add $1,$0 add $1,1 pow $1,2 mul $1,$0
project/adl/arch/ARM/Nordic/drivers/nrf51-gpio-tasks_and_events.ads
corentingay/ada_epita
2
30184
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2016, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package nRF51.GPIO.Tasks_And_Events is type GPIOTE_Channel is range 0 .. 3; procedure Disable (Chan : GPIOTE_Channel); type Event_Polarity is (Rising_Edge, Falling_Edge, Any_Change); procedure Enable_Event (Chan : GPIOTE_Channel; GPIO_Pin : GPIO_Pin_Index; Polarity : Event_Polarity); -- When GPIO_Pin value changes the event associated with Chan is raised type Task_Action is (Set_Pin, Clear_Pin, Toggle_Pin); type Init_Value is (Init_Set, Init_Clear); procedure Enable_Task (Chan : GPIOTE_Channel; GPIO_Pin : GPIO_Pin_Index; Action : Task_Action; Initial_Value : Init_Value); -- When the tasks associated with Chan is triggered, Action (Set, Clear, -- Toggle) is applied to GPIO_Pin. end nRF51.GPIO.Tasks_And_Events;
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_369.asm
ljhsiun2/medusa
9
16716
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_369.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r15 push %r9 push %rcx push %rdi push %rsi lea addresses_D_ht+0xba12, %rsi lea addresses_A_ht+0x1a7fb, %rdi nop nop nop nop nop inc %r12 mov $80, %rcx rep movsl nop nop nop add $14912, %r15 lea addresses_WT_ht+0x1af1a, %r12 nop nop nop nop nop add $39728, %r9 movups (%r12), %xmm5 vpextrq $1, %xmm5, %rdi xor $50633, %r15 lea addresses_normal_ht+0xe11a, %rsi clflush (%rsi) nop nop mfence mov $0x6162636465666768, %r9 movq %r9, %xmm0 vmovups %ymm0, (%rsi) nop nop nop cmp $37904, %rdi lea addresses_WT_ht+0x1d99a, %rsi lea addresses_normal_ht+0xc59a, %rdi clflush (%rdi) nop nop nop and $31995, %r9 mov $65, %rcx rep movsb nop add %r15, %r15 lea addresses_D_ht+0x189ae, %rsi nop nop nop nop nop and %r11, %r11 mov $0x6162636465666768, %rdi movq %rdi, %xmm2 vmovups %ymm2, (%rsi) nop nop nop nop dec %rcx lea addresses_normal_ht+0x113ae, %rsi clflush (%rsi) nop nop nop nop nop cmp $8321, %r15 mov (%rsi), %di nop nop inc %r9 pop %rsi pop %rdi pop %rcx pop %r9 pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %rbp push %rcx push %rsi // Faulty Load lea addresses_PSE+0x1119a, %rsi nop nop xor %r14, %r14 mov (%rsi), %cx lea oracles, %r12 and $0xff, %rcx shlq $12, %rcx mov (%r12,%rcx,1), %rcx pop %rsi pop %rcx pop %rbp pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
Cubical/DStructures/Structures/VertComp.agda
Schippmunk/cubical
0
12104
<filename>Cubical/DStructures/Structures/VertComp.agda {- This module contains - the type of vertical composition operations that can be defined on a reflexive graph -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.DStructures.Structures.VertComp where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Structure open import Cubical.Functions.FunExtEquiv open import Cubical.Homotopy.Base open import Cubical.Data.Sigma open import Cubical.Relation.Binary open import Cubical.Algebra.Group open import Cubical.Structures.LeftAction open import Cubical.DStructures.Base open import Cubical.DStructures.Meta.Properties open import Cubical.DStructures.Structures.Constant open import Cubical.DStructures.Structures.Type open import Cubical.DStructures.Structures.Group open import Cubical.DStructures.Structures.ReflGraph open MorphismLemmas open GroupLemmas private variable ℓ ℓ' : Level {- -- The type of vertical composition operations -- that can be defined over a reflexive graph 𝒢 -- -- we use the property isComposable instead of defining -- a type of composable morphisms of G₁, because -- otherwise it would be difficult to formulate -- properties involving an odd number of composable morphisms -- in a uniform and clean way. -} record VertComp (𝒢 : ReflGraph ℓ ℓ') : Type (ℓ-max ℓ ℓ') where no-eta-equality constructor vertcomp open ReflGraphNotation 𝒢 open ReflGraphLemmas 𝒢 -- the vertical composition operation with convenient syntax field vcomp : (g f : ⟨ G₁ ⟩) → isComposable g f → ⟨ G₁ ⟩ syntax vcomp g f p = g ∘⟨ p ⟩ f field -- vcomp preserves source and target σ-∘ : (g f : ⟨ G₁ ⟩) (c : isComposable g f) → s (g ∘⟨ c ⟩ f) ≡ s f τ-∘ : (g f : ⟨ G₁ ⟩) (c : isComposable g f) → t (g ∘⟨ c ⟩ f) ≡ t g -- vcomp is a homomorphism, also known as interchange law isHom-∘ : (g f : ⟨ G₁ ⟩) (c : isComposable g f) (g' f' : ⟨ G₁ ⟩) (c' : isComposable g' f') (c'' : isComposable (g +₁ g') (f +₁ f')) → (g +₁ g') ∘⟨ c'' ⟩ (f +₁ f') ≡ (g ∘⟨ c ⟩ f) +₁ (g' ∘⟨ c' ⟩ f') -- vcomp is associative assoc-∘ : (h g f : ⟨ G₁ ⟩) (c-hg : isComposable h g) (c-gf : isComposable g f) (c-h-gf : isComposable h (g ∘⟨ c-gf ⟩ f)) (c-hg-f : isComposable (h ∘⟨ c-hg ⟩ g) f) → h ∘⟨ c-h-gf ⟩ (g ∘⟨ c-gf ⟩ f) ≡ (h ∘⟨ c-hg ⟩ g) ∘⟨ c-hg-f ⟩ f -- composing with identity arrows does nothing lid-∘ : (f : ⟨ G₁ ⟩) (c : isComposable (𝒾 (t f)) f) → 𝒾 (t f) ∘⟨ c ⟩ f ≡ f rid-∘ : (g : ⟨ G₁ ⟩) (c : isComposable g (𝒾 (s g))) → g ∘⟨ c ⟩ 𝒾 (s g) ≡ g -- alternative lid/rid definition, but taking paramter c is more flexible -- lid-∘ : (f : ⟨ G₁ ⟩) → 𝒾 (t f) ∘⟨ σι-≡-fun (t f) ⟩ f ≡ f -- assoc-∘ : (h g f : ⟨ G₁ ⟩) (c : isComposable h g) (c' : isComposable g f) -- → h ∘⟨ c ∙ sym (τ-∘ g f c') ⟩ (g ∘⟨ c' ⟩ f) ≡ (h ∘⟨ c ⟩ g) ∘⟨ σ-∘ h g c ∙ c' ⟩ f -- → h ∘⟨ c-hg ∙ sym (τ-∘ g f c-gf) ⟩ (g ∘⟨ c-gf ⟩ f) -- ≡ (h ∘⟨ c-hg ⟩ g) ∘⟨ σ-∘ h g c-hg ∙ c-gf ⟩ f module _ {𝒢 : ReflGraph ℓ ℓ'} where open ReflGraphNotation 𝒢 open ReflGraphLemmas 𝒢 -- lemmas about a given vertical composition module _ (𝒞 : VertComp 𝒢) where open VertComp 𝒞 -- These are all propositions, so we use abstract. -- Most of these lemmas are nontrivial, because we need to keep a -- proof of composability at hand. abstract -- if (g, f), and (g', f') are composable, -- then so is (g + g', f + f') +-c : (g f : ⟨ G₁ ⟩) (c : isComposable g f) (g' f' : ⟨ G₁ ⟩) (c' : isComposable g' f') → isComposable (g +₁ g') (f +₁ f') +-c g f c g' f' c' = σ .isHom g g' ∙∙ cong (_+₀ s g') c ∙∙ cong (t f +₀_) c' ∙ sym (τ .isHom f f') -- if (g, f) is composable, and g ≡ g', -- then (g', f) is composable ∘-cong-l-c : {g f : ⟨ G₁ ⟩} (c : isComposable g f) {g' : ⟨ G₁ ⟩} (p : g ≡ g') → isComposable g' f ∘-cong-l-c c p = cong s (sym p) ∙ c -- if (g, f) is composable, and f ≡ f', -- then (g, f') is composable ∘-cong-r-c : {g f : ⟨ G₁ ⟩} (c : isComposable g f) {f' : ⟨ G₁ ⟩} (p : f ≡ f') → isComposable g f' ∘-cong-r-c c p = c ∙ cong t p -- if (g, f) are composable, and (g, f) ≡ (g', f'), -- then (g', f') is composable -- by combining the two lemmas above ∘-cong-c : {g f : ⟨ G₁ ⟩} (c : isComposable g f) {g' f' : ⟨ G₁ ⟩} (p : g ≡ g') (q : f ≡ f') → isComposable g' f' ∘-cong-c c p q = ∘-cong-l-c c p ∙ cong t q -- if (g, f) is composable, and g ≡ g', -- then g ∘ f ≡ g' ∘ f ∘-cong-l : {g f : ⟨ G₁ ⟩} (c : isComposable g f) {g' : ⟨ G₁ ⟩} (p : g ≡ g') → g ∘⟨ c ⟩ f ≡ g' ∘⟨ ∘-cong-l-c c p ⟩ f ∘-cong-l {g = g} {f = f} c {g'} p = cong₂ (λ h d → h ∘⟨ d ⟩ f) p (toPathP (isPropIsComposable g' f (transp (λ i → isComposable (p i) f) i0 c) (∘-cong-l-c c p))) -- if (g, f) is composable, and f ≡ f', -- then g ∘ f ≡ g ∘ f' ∘-cong-r : {g f : ⟨ G₁ ⟩} (c : isComposable g f) {f' : ⟨ G₁ ⟩} (p : f ≡ f') → g ∘⟨ c ⟩ f ≡ g ∘⟨ ∘-cong-r-c c p ⟩ f' ∘-cong-r {g = g} c {f'} p = cong₂ (λ h d → g ∘⟨ d ⟩ h) p (toPathP (isPropIsComposable g f' (transp (λ i → isComposable g (p i)) i0 c) (∘-cong-r-c c p))) -- if (g, f) are composable, and (g, f) ≡ (g', f'), -- then g ∘ f ≡ g' ∘ f' ∘-cong : {g f : ⟨ G₁ ⟩} (c : isComposable g f) {g' f' : ⟨ G₁ ⟩} (p : g ≡ g') (q : f ≡ f') → g ∘⟨ c ⟩ f ≡ g' ∘⟨ ∘-cong-c c p q ⟩ f' ∘-cong c p q = ∘-cong-l c p ∙ ∘-cong-r (∘-cong-l-c c p) q -- an alternate version of lid-∘ -- where a composable g is assumed and ι (σ g) -- instead of ι (τ f) is used ∘-lid' : {g f : ⟨ G₁ ⟩} (c : isComposable g f) (c' : isComposable (𝒾s g) f) → (𝒾s g) ∘⟨ c' ⟩ f ≡ f ∘-lid' {g} {f} c c' = (𝒾s g) ∘⟨ c' ⟩ f ≡⟨ ∘-cong-l c' (cong 𝒾 c) ⟩ 𝒾t f ∘⟨ ∘-cong-l-c c' (cong 𝒾 c) ⟩ f ≡⟨ lid-∘ f (∘-cong-l-c c' (cong 𝒾 c)) ⟩ f ∎ -- Fundamental theorem: -- Any vertical composition is necessarily of the form -- g ∘⟨ _ ⟩ f ≡ g - ι (σ g) + f -- This implies contractibility of VertComp 𝒢 VertComp→+₁ : (g f : ⟨ G₁ ⟩) (c : isComposable g f) → g ∘⟨ c ⟩ f ≡ (g -₁ 𝒾s g) +₁ f VertComp→+₁ g f c = g ∘⟨ c ⟩ f ≡⟨ ∘-cong c (sym (rId₁ g) ∙ cong (g +₁_) (sym (lCancel₁ isg))) (sym (lId₁ f) ∙ cong (_+₁ f) (sym (rCancel₁ isg))) ⟩ (g +₁ (-isg +₁ isg)) ∘⟨ c₁ ⟩ ((isg -₁ isg) +₁ f) ≡⟨ ∘-cong-l c₁ (assoc₁ g -isg isg) ⟩ ((g -₁ isg) +₁ isg) ∘⟨ c₂ ⟩ ((isg -₁ isg) +₁ f) ≡⟨ isHom-∘ (g -₁ isg) (isg -₁ isg) c₄ isg f c₃ c₂ ⟩ ((g +₁ -isg) ∘⟨ c₄ ⟩ (isg +₁ -isg)) +₁ (isg ∘⟨ c₃ ⟩ f) ≡⟨ cong (_+₁ (isg ∘⟨ c₃ ⟩ f)) (isHom-∘ g isg c₅ -isg -isg c₆ c₄) ⟩ ((g ∘⟨ c₅ ⟩ isg) +₁ (-isg ∘⟨ c₆ ⟩ -isg)) +₁ (isg ∘⟨ c₃ ⟩ f) ≡⟨ cong (λ z → (z +₁ (-isg ∘⟨ c₆ ⟩ -isg)) +₁ (isg ∘⟨ c₃ ⟩ f)) (rid-∘ g (isComp-g-isg g)) ⟩ (g +₁ (-isg ∘⟨ c₆ ⟩ -isg)) +₁ (isg ∘⟨ c₃ ⟩ f) ≡⟨ cong ((g +₁ (-isg ∘⟨ c₆ ⟩ -isg)) +₁_) (∘-lid' c c₃) ⟩ (g +₁ (-isg ∘⟨ c₆ ⟩ -isg)) +₁ f ≡⟨ cong (λ z → (g +₁ z) +₁ f) (-isg ∘⟨ c₆ ⟩ -isg ≡⟨ ∘-cong-r c₆ -- prove that is(-isg)≡-isg (sym (cong 𝒾s (sym (mapInv ι (s g))) ∙∙ cong 𝒾 (σι-≡-fun (-₀ s g)) ∙∙ mapInv ι (s g))) ⟩ -isg ∘⟨ c₈ ⟩ (𝒾s -isg) ≡⟨ rid-∘ -isg c₈ ⟩ -isg ∎) ⟩ (g -₁ isg) +₁ f ∎ where -- abbreviations to reduce the amount of parentheses isg = 𝒾s g -isg = -₁ isg itf = 𝒾t f -- composability proofs, -- none of which are really interesting. c₁ : isComposable (g +₁ (-isg +₁ isg)) ((isg -₁ isg) +₁ f) c₁ = ∘-cong-c c (sym (rId₁ g) ∙ cong (g +₁_) (sym (lCancel₁ isg))) (sym (lId₁ f) ∙ cong (_+₁ f) (sym (rCancel₁ isg))) c₂ : isComposable ((g -₁ isg) +₁ isg) ((isg -₁ isg) +₁ f) c₂ = ∘-cong-l-c c₁ (assoc₁ g -isg isg) c₃ : isComposable isg f c₃ = σι-≡-fun (s g) ∙ c c₄ : isComposable (g -₁ isg) (isg -₁ isg) c₄ = s (g -₁ isg) ≡⟨ σ-g--isg g ⟩ 0₀ ≡⟨ sym (cong t (rCancel₁ isg) ∙ mapId τ) ⟩ t (isg -₁ isg) ∎ c₅ : isComposable g isg c₅ = isComp-g-isg g c₆ : isComposable -isg -isg c₆ = s -isg ≡⟨ mapInv σ isg ⟩ -₀ (s isg) ≡⟨ cong -₀_ (σι-≡-fun (s g)) ⟩ -₀ (s g) ≡⟨ cong -₀_ (sym (τι-≡-fun (s g))) ⟩ -₀ (t isg) ≡⟨ sym (mapInv τ isg) ⟩ t -isg ∎ c₈ : isComposable -isg (𝒾s -isg) c₈ = ∘-cong-r-c c₆ (sym (cong 𝒾s (sym (mapInv ι (s g))) ∙∙ cong 𝒾 (σι-≡-fun (-₀ s g)) ∙∙ mapInv ι (s g))) -- properties of the interchange law IC2 : (g g' f : ⟨ G₁ ⟩) (c-gf : isComposable g f) → (g' +₁ (-is g' -₁ is g)) +₁ f ≡ (-is g +₁ f) +₁ (g' -₁ is g') IC2 g g' f c-gf = (g' +₁ (-isg' +₁ -isg)) +₁ f ≡⟨ cong ((g' +₁ (-isg' +₁ -isg)) +₁_) (sym (rCancel-rId G₁ f f') ∙ assoc₁ f f' -f') ⟩ (g' +₁ (-isg' +₁ -isg)) +₁ ((f +₁ f') -₁ f') ≡⟨ assoc₁ (g' +₁ (-isg' +₁ -isg)) (f +₁ f') (-₁ f') ⟩ ((g' +₁ (-isg' +₁ -isg)) +₁ (f +₁ f')) -₁ f' ≡⟨ cong (_-₁ f') (sym (lCancel-lId G₁ g _)) ⟩ ((-g +₁ g) +₁ ((g' +₁ (-isg' +₁ -isg)) +₁ (f +₁ f'))) -₁ f' ≡⟨ cong (_-₁ f') (sym (assoc₁ -g g _)) ⟩ (-g +₁ (g +₁ ((g' +₁ (-isg' +₁ -isg)) +₁ (f +₁ f')))) -₁ f' ≡⟨ cong (λ z → (-g +₁ z) -₁ f') (assoc₁ g _ (f +₁ f')) ⟩ (-g +₁ ((g +₁ (g' +₁ (-isg' +₁ -isg))) +₁ (f +₁ f'))) -₁ f' ≡⟨ cong (λ z → (-g +₁ (z +₁ (f +₁ f'))) -₁ f') (assoc₁ g g' (-isg' -₁ isg)) ⟩ (-g +₁ (((g +₁ g') +₁ (-isg' +₁ -isg)) +₁ (f +₁ f'))) -₁ f' ≡⟨ cong (λ z → (-g +₁ z) -₁ f') (sym q) ⟩ (-g +₁ ((g +₁ g') ∘⟨ c-gf'+ ⟩ (f +₁ f'))) -₁ f' ≡⟨ cong (λ z → (-g +₁ z) -₁ f') (isHom-∘ g f c-gf g' f' c-gf' c-gf'+) ⟩ (-g +₁ ((g ∘⟨ c-gf ⟩ f) +₁ (g' ∘⟨ c-gf' ⟩ f'))) -₁ f' ≡⟨ cong (λ z → (-g +₁ ((g ∘⟨ c-gf ⟩ f) +₁ z)) -₁ f') (VertComp→+₁ g' f' c-gf') ⟩ (-g +₁ ((g ∘⟨ c-gf ⟩ f) +₁ ((g' -₁ isg') +₁ f'))) -₁ f' ≡⟨ cong (λ z → (-g +₁ (z +₁ ((g' -₁ isg') +₁ f'))) -₁ f') (VertComp→+₁ g f c-gf) ⟩ (-g +₁ (((g -₁ isg) +₁ f) +₁ ((g' -₁ isg') +₁ f'))) -₁ f' ≡⟨ cong (λ z → (-g +₁ (z +₁ ((g' -₁ isg') +₁ f'))) -₁ f') (sym (assoc₁ g -isg f)) ⟩ (-g +₁ ((g +₁ (-isg +₁ f)) +₁ ((g' -₁ isg') +₁ f'))) -₁ f' ≡⟨ cong (λ z → (-g +₁ z) -₁ f') (sym (assoc₁ g (-isg +₁ f) _)) ⟩ (-g +₁ (g +₁ ((-isg +₁ f) +₁ ((g' -₁ isg') +₁ f')))) -₁ f' ≡⟨ cong (_-₁ f') (assoc₁ -g g _) ⟩ ((-g +₁ g) +₁ ((-isg +₁ f) +₁ ((g' -₁ isg') +₁ f'))) -₁ f' ≡⟨ cong (_-₁ f') (lCancel-lId G₁ g _) ⟩ ((-isg +₁ f) +₁ ((g' -₁ isg') +₁ f')) -₁ f' ≡⟨ sym (assoc₁ (-isg +₁ f) _ -f') ⟩ (-isg +₁ f) +₁ (((g' -₁ isg') +₁ f') -₁ f') ≡⟨ cong ((-isg +₁ f) +₁_) (sym (assoc₁ (g' -₁ isg') f' -f')) ⟩ (-isg +₁ f) +₁ ((g' -₁ isg') +₁ (f' -₁ f')) ≡⟨ cong ((-isg +₁ f) +₁_ ) (rCancel-rId G₁ (g' -₁ isg') f') ⟩ (-isg +₁ f) +₁ (g' -₁ isg') ∎ where -- abbreviations to reduce the number of parentheses -g = -₁ g isg = 𝒾s g isg' = 𝒾s g' -isg = -₁ isg -isg' = -₁ isg' f' = isg' -f' = -₁ f' -- composability proofs c-gf' = isComp-g-isg g' c-gf'+ = +-c g f c-gf g' f' c-gf' -- q = (g +₁ g') ∘⟨ c-gf'+ ⟩ (f +₁ f') ≡⟨ VertComp→+₁ (g +₁ g') (f +₁ f') c-gf'+ ⟩ ((g +₁ g') -₁ (𝒾s (g +₁ g'))) +₁ (f +₁ f') ≡⟨ cong (λ z → ((g +₁ g') -₁ z) +₁ (f +₁ f')) (ι∘σ .isHom g g') ⟩ ((g +₁ g') -₁ (isg +₁ isg')) +₁ (f +₁ f') ≡⟨ cong (λ z → ((g +₁ g') +₁ z) +₁ (f +₁ f')) (invDistr G₁ isg isg') ⟩ ((g +₁ g') +₁ (-isg' +₁ -isg)) +₁ (f +₁ f') ∎ IC3 : (g g' f : ⟨ G₁ ⟩) (c-gf : isComposable g f) → (-₁ f) +₁ ((is g +₁ is g') -₁ g') ≡ (is g' -₁ g') +₁ ((-₁ f) +₁ is g) IC3 g g' f c-gf = -f +₁ ((isg +₁ isg') -₁ g') ≡⟨ cong (λ z → -f +₁ ((isg +₁ z) -₁ g')) (sym (invInvo G₁ isg')) ⟩ -f +₁ ((isg -₁ -isg') -₁ g') ≡⟨ cong (λ z → -f +₁ ((z -₁ -isg') -₁ g')) (sym (invInvo G₁ isg)) ⟩ -f +₁ (((-₁ -isg) -₁ -isg') -₁ g') ≡⟨ cong (λ z → -f +₁ (z -₁ g')) (sym (invDistr G₁ -isg' -isg)) ⟩ -f +₁ ((-₁ (-isg' +₁ -isg)) -₁ g') ≡⟨ cong (λ z → -f +₁ z) (sym (invDistr G₁ g' (-isg' +₁ -isg))) ⟩ -f -₁ (g' +₁ (-isg' +₁ -isg)) ≡⟨ sym (invDistr G₁ _ f) ⟩ -₁ ((g' +₁ (-isg' +₁ -isg)) +₁ f) ≡⟨ cong -₁_ (IC2 g g' f c-gf) ⟩ -₁ ((-isg +₁ f) +₁ (g' -₁ isg')) ≡⟨ invDistr G₁ (-isg +₁ f) (g' -₁ isg') ⟩ (-₁ (g' -₁ isg')) +₁ (-₁ (-isg +₁ f)) ≡⟨ cong ((-₁ (g' -₁ isg')) +₁_) (invDistr G₁ -isg f) ⟩ (-₁ (g' -₁ isg')) +₁ (-f -₁ -isg) ≡⟨ cong (_+₁ (-f -₁ -isg)) (invDistr G₁ g' -isg') ⟩ ((-₁ -isg') -₁ g') +₁ (-f -₁ -isg) ≡⟨ cong (λ z → (z -₁ g') +₁ (-f -₁ -isg)) (invInvo G₁ isg') ⟩ (isg' -₁ g') +₁ (-f -₁ -isg) ≡⟨ cong (λ z → (isg' -₁ g') +₁ (-f +₁ z)) (invInvo G₁ isg) ⟩ (isg' -₁ g') +₁ (-f +₁ isg) ∎ where -f = -₁ f -g = -₁ g isg = 𝒾s g isg' = 𝒾s g' -isg = -₁ isg -isg' = -₁ isg' IC4 : (g g' f : ⟨ G₁ ⟩) (c-gf : isComposable g f) → f +₁ (((-is g) -₁ (is g')) +₁ g') ≡ ((-is g') +₁ g') +₁ (f -₁ (is g)) IC4 g g' f c-gf = f +₁ ((-isg -₁ isg') +₁ g') ≡⟨ cong (λ z → f +₁ ((-isg -₁ isg') +₁ z)) (sym (invInvo G₁ g')) ⟩ (f +₁ ((-isg -₁ isg') -₁ -g')) ≡⟨ cong (λ z → f +₁ ((-isg +₁ z) -₁ -g')) (sym (mapInv ι∘σ g')) ⟩ f +₁ ((-isg +₁ (is- g')) -₁ -g') ≡⟨ cong (λ z → f +₁ ((z +₁ (is- g')) -₁ -g')) (sym (mapInv ι∘σ g)) ⟩ f +₁ (((is- g) +₁ (is- g')) -₁ -g') ≡⟨ cong (_+₁ ((is- g +₁ is- g') -₁ -g')) (sym (invInvo G₁ f)) ⟩ (-₁ -f) +₁ (((is- g) +₁ (is- g')) -₁ -g') ≡⟨ IC3 -g -g' -f c--gf ⟩ ((is- g') -₁ -g') +₁ ((-₁ -f) +₁ (is- g)) ≡⟨ cong (λ z → (z -₁ -g') +₁ ((-₁ -f) +₁ (is- g))) (mapInv ι∘σ g') ⟩ (-isg' -₁ -g') +₁ ((-₁ -f) +₁ (is- g)) ≡⟨ cong (λ z → (-isg' +₁ z) +₁ ((-₁ -f) +₁ (is- g))) (invInvo G₁ g') ⟩ (-isg' +₁ g') +₁ ((-₁ -f) +₁ (is- g)) ≡⟨ cong (λ z → (-isg' +₁ g') +₁ (z +₁ (is- g))) (invInvo G₁ f) ⟩ (-isg' +₁ g') +₁ (f +₁ (is- g)) ≡⟨ cong (λ z → (-isg' +₁ g') +₁ (f +₁ z)) (mapInv ι∘σ g) ⟩ (-isg' +₁ g') +₁ (f -₁ isg) ∎ where -f = -₁ f -g = -₁ g -g' = -₁ g' isg = 𝒾s g isg' = 𝒾s g' -isg = -₁ isg -isg' = -₁ isg' c--gf = s -g ≡⟨ mapInv σ g ⟩ -₀ (s g) ≡⟨ cong -₀_ c-gf ⟩ -₀ (t f) ≡⟨ sym (mapInv τ f) ⟩ t -f ∎ -- g = itf IC5 : (g' f : ⟨ G₁ ⟩) → f +₁ (((-it f) -₁ (is g')) +₁ g') ≡ ((-is g') +₁ g') +₁ (f -₁ (it f)) IC5 g' f = f +₁ ((-itf -₁ isg') +₁ g') ≡⟨ cong (λ z → f +₁ (((-₁ (𝒾 z)) -₁ isg') +₁ g')) (sym c-gf) ⟩ f +₁ ((-isg -₁ isg') +₁ g') ≡⟨ IC4 g g' f c-gf ⟩ (-isg' +₁ g') +₁ (f -₁ isg) ≡⟨ cong (λ z → (-isg' +₁ g') +₁ (f -₁ (𝒾 z))) c-gf ⟩ (-isg' +₁ g') +₁ (f -₁ itf) ∎ where -f = -₁ f -itf = -it f itf = it f g = it f -g = -₁ g -g' = -₁ g' isg = 𝒾s g isg' = 𝒾s g' -isg = -₁ isg -isg' = -₁ isg' c-gf : isComposable g f c-gf = isComp-itf-f f open VertComp -- the record VertComp has no eta equality, so this can be used to -- construct paths between vertical compositions η-VertComp : (𝒱 : VertComp 𝒢) → vertcomp (vcomp 𝒱) (σ-∘ 𝒱) (τ-∘ 𝒱) (isHom-∘ 𝒱) (assoc-∘ 𝒱) (lid-∘ 𝒱) (rid-∘ 𝒱) ≡ 𝒱 vcomp (η-VertComp 𝒱 i) = vcomp 𝒱 σ-∘ (η-VertComp 𝒱 i) = σ-∘ 𝒱 τ-∘ (η-VertComp 𝒱 i) = τ-∘ 𝒱 isHom-∘ (η-VertComp 𝒱 i) = isHom-∘ 𝒱 assoc-∘ (η-VertComp 𝒱 i) = assoc-∘ 𝒱 lid-∘(η-VertComp 𝒱 i) = lid-∘ 𝒱 rid-∘ (η-VertComp 𝒱 i) = rid-∘ 𝒱 -- this is just a helper for the module below module _ (𝒞 𝒞' : VertComp 𝒢) where p∘ : vcomp 𝒞 ≡ vcomp 𝒞' p∘ = funExt₃ (λ g f c → VertComp→+₁ 𝒞 g f c ∙ sym (VertComp→+₁ 𝒞' g f c)) pσ : PathP (λ j → (g f : ⟨ G₁ ⟩) (c : isComposable g f) → s (p∘ j g f c) ≡ s f) (σ-∘ 𝒞) (σ-∘ 𝒞') pσ = isProp→PathP (λ i → isPropΠ3 (λ g f c → set₀ (s (p∘ i g f c)) (s f))) (σ-∘ 𝒞) (σ-∘ 𝒞') passoc : PathP (λ i → (h g f : ⟨ G₁ ⟩) (c-hg : isComposable h g) (c-gf : isComposable g f) (c-h-gf : isComposable h (p∘ i g f c-gf)) (c-hg-f : isComposable (p∘ i h g c-hg) f) → p∘ i h (p∘ i g f c-gf) c-h-gf ≡ p∘ i (p∘ i h g c-hg) f c-hg-f) (assoc-∘ 𝒞) (assoc-∘ 𝒞') passoc = isProp→PathP (λ j → isPropΠ4 (λ h g f c-hg → isPropΠ3 (λ c-gf c-h-gf c-hg-f → set₁ (p∘ j h (p∘ j g f c-gf) c-h-gf) (p∘ j (p∘ j h g c-hg) f c-hg-f)))) (assoc-∘ 𝒞) (assoc-∘ 𝒞') -- (p∘ j h (p∘ j g f c-gf) c-h-gf ≡ p∘ j (p∘ j h g c-hg) f c-hg-f) -- proof that there is at most one vertical composition on a reflexive graph module _ (𝒢 : ReflGraph ℓ ℓ') where open ReflGraphNotation 𝒢 open ReflGraphLemmas 𝒢 open VertComp isPropVertComp : isProp (VertComp 𝒢) vcomp (isPropVertComp 𝒞 𝒞' i) = funExt₃ (λ g f c → VertComp→+₁ 𝒞 g f c ∙ sym (VertComp→+₁ 𝒞' g f c)) i -- σ-∘ (isPropVertComp 𝒞 𝒞' i) = funExt₃ P i σ-∘ (isPropVertComp 𝒞 𝒞' i) = pσ 𝒞 𝒞' i where P : (g f : ⟨ G₁ ⟩) (c : isComposable g f) → PathP (λ j → s (vcomp (isPropVertComp 𝒞 𝒞' j) g f c) ≡ s f) (σ-∘ 𝒞 g f c) (σ-∘ 𝒞' g f c) P g f c = isProp→PathP (λ j → set₀ (s (vcomp (isPropVertComp 𝒞 𝒞' j) g f c)) (s f)) (σ-∘ 𝒞 g f c) (σ-∘ 𝒞' g f c) τ-∘ (isPropVertComp 𝒞 𝒞' i) = funExt₃ P i where P : (g f : ⟨ G₁ ⟩) (c : isComposable g f) → PathP (λ j → t (vcomp (isPropVertComp 𝒞 𝒞' j) g f c) ≡ t g) (τ-∘ 𝒞 g f c) (τ-∘ 𝒞' g f c) P g f c = isProp→PathP (λ j → set₀ (t (vcomp (isPropVertComp 𝒞 𝒞' j) g f c)) (t g)) (τ-∘ 𝒞 g f c) (τ-∘ 𝒞' g f c) isHom-∘ (isPropVertComp 𝒞 𝒞' i) = funExt₃ (λ g f c → funExt₃ (λ g' f' c' → funExt (λ c+ → P g f c g' f' c' c+))) i where P : (g f : ⟨ G₁ ⟩) (c : isComposable g f) (g' f' : ⟨ G₁ ⟩) (c' : isComposable g' f') (c+ : isComposable (g +₁ g') (f +₁ f')) → PathP (λ j → vcomp (isPropVertComp 𝒞 𝒞' j) (g +₁ g') (f +₁ f') c+ ≡ (vcomp (isPropVertComp 𝒞 𝒞' j) g f c) +₁ (vcomp (isPropVertComp 𝒞 𝒞' j) g' f' c')) (isHom-∘ 𝒞 g f c g' f' c' c+) (isHom-∘ 𝒞' g f c g' f' c' c+) P g f c g' f' c' c+ = isProp→PathP (λ j → set₁ (vcomp (isPropVertComp 𝒞 𝒞' j) (g +₁ g') (f +₁ f') c+) ((vcomp (isPropVertComp 𝒞 𝒞' j) g f c) +₁ (vcomp (isPropVertComp 𝒞 𝒞' j) g' f' c'))) (isHom-∘ 𝒞 g f c g' f' c' c+) (isHom-∘ 𝒞' g f c g' f' c' c+) assoc-∘ (isPropVertComp 𝒞 𝒞' i) = passoc 𝒞 𝒞' i lid-∘ (isPropVertComp 𝒞 𝒞' i) = funExt₂ P i where P : (f : ⟨ G₁ ⟩) (c : isComposable (𝒾 (t f)) f) → PathP (λ j → vcomp (isPropVertComp 𝒞 𝒞' j) (𝒾 (t f)) f c ≡ f) (lid-∘ 𝒞 f c) (lid-∘ 𝒞' f c) P f c = isProp→PathP (λ j → set₁ (vcomp (isPropVertComp 𝒞 𝒞' j) (𝒾 (t f)) f c) f) (lid-∘ 𝒞 f c) (lid-∘ 𝒞' f c) rid-∘ (isPropVertComp 𝒞 𝒞' i) = funExt₂ P i where P : (g : ⟨ G₁ ⟩) (c : isComposable g (𝒾 (s g))) → PathP (λ j → vcomp (isPropVertComp 𝒞 𝒞' j) g (𝒾 (s g)) c ≡ g) (rid-∘ 𝒞 g c) (rid-∘ 𝒞' g c) P g c = isProp→PathP (λ j → set₁ (vcomp (isPropVertComp 𝒞 𝒞' j) g (𝒾 (s g)) c) g) (rid-∘ 𝒞 g c) (rid-∘ 𝒞' g c)
examples/host_bot.adb
erik/ada-irc
5
29536
<reponame>erik/ada-irc with Irc.Bot; with Irc.Commands; with Irc.Message; with Ada.Strings.Unbounded; -- Some custom commands (commands.ads) with Commands; procedure Host_Bot is Bot : Irc.Bot.Connection; begin Bot := Irc.Bot.Create ("irc.tenthbit.net", 6667, Nick => "hostbot"); -- Set some bot administrators. The '!' is just to make sure the nick -- foosomeoneelse doesn't get admin rights. You could include host/cloak -- if you wanted. Bot.Add_Administrator ("foo!"); Bot.Add_Administrator ("bar!"); -- Add channels to join on connect Bot.Add_Default_Channel ("#bots"); -- Installs the default command set Irc.Commands.Install_Commands (Bot); -- Setup our hostname command callback Bot.On_Privmsg ("$host", Commands.Host'Access); -- Connect the socket and identify the bot (send NICK and USER) Bot.Connect; Bot.Identify; -- Loop until program is killed or an error occurs loop declare Line : Ada.Strings.Unbounded.Unbounded_String; Msg : Irc.Message.Message; begin Bot.Read_Line (Line); Msg := Irc.Message.Parse_Line (Line); Bot.Do_Message (Msg); exception when Irc.Message.Parse_Error => exit; end; end loop; -- Close the socket Bot.Disconnect; end Host_Bot;
codec/encoder/core/asm/deblock.asm
TechSmith/openh264
1
164434
;*! ;* \copy ;* Copyright (c) 2009-2013, Cisco Systems ;* 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. ;* ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ;* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ;* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ;* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ;* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ;* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ;* POSSIBILITY OF SUCH DAMAGE. ;* ;* ;* deblock.asm ;* ;* Abstract ;* edge loop ;* ;* History ;* 08/07/2009 Created ;* ;* ;*************************************************************************/ %include "asm_inc.asm" BITS 32 ;******************************************************************************* ; Macros and other preprocessor constants ;******************************************************************************* %ifdef FORMAT_COFF SECTION .rodata pData %else SECTION .rodata align=16 %endif SECTION .text ;******************************************************************************** ; void DeblockChromaEq4V_sse2(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta) ;******************************************************************************** WELS_EXTERN DeblockChromaEq4V_sse2 ALIGN 16 DeblockChromaEq4V_sse2: push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,68h mov edx,[ebp+10h] ; iStride mov eax,[ebp+8] ; pPixCb mov ecx,[ebp+0Ch] ; pPixCr movq xmm4,[ecx] movq xmm5,[edx+ecx] push esi push edi lea esi,[edx+edx] mov edi,eax sub edi,esi movq xmm1,[edi] mov edi,ecx sub edi,esi movq xmm2,[edi] punpcklqdq xmm1,xmm2 mov esi,eax sub esi,edx movq xmm2,[esi] mov edi,ecx sub edi,edx movq xmm3,[edi] punpcklqdq xmm2,xmm3 movq xmm3,[eax] punpcklqdq xmm3,xmm4 movq xmm4,[edx+eax] mov edx, [ebp + 14h] punpcklqdq xmm4,xmm5 movd xmm5,edx mov edx, [ebp + 18h] pxor xmm0,xmm0 movdqa xmm6,xmm5 punpcklwd xmm6,xmm5 pshufd xmm5,xmm6,0 movd xmm6,edx movdqa xmm7,xmm6 punpcklwd xmm7,xmm6 pshufd xmm6,xmm7,0 movdqa xmm7,xmm1 punpckhbw xmm1,xmm0 punpcklbw xmm7,xmm0 movdqa [esp+40h],xmm1 movdqa [esp+60h],xmm7 movdqa xmm7,xmm2 punpcklbw xmm7,xmm0 movdqa [esp+10h],xmm7 movdqa xmm7,xmm3 punpcklbw xmm7,xmm0 punpckhbw xmm3,xmm0 movdqa [esp+50h],xmm7 movdqa xmm7,xmm4 punpckhbw xmm4,xmm0 punpckhbw xmm2,xmm0 punpcklbw xmm7,xmm0 movdqa [esp+30h],xmm3 movdqa xmm3,[esp+10h] movdqa xmm1,xmm3 psubw xmm1,[esp+50h] pabsw xmm1,xmm1 movdqa [esp+20h],xmm4 movdqa xmm0,xmm5 pcmpgtw xmm0,xmm1 movdqa xmm1,[esp+60h] psubw xmm1,xmm3 pabsw xmm1,xmm1 movdqa xmm4,xmm6 pcmpgtw xmm4,xmm1 pand xmm0,xmm4 movdqa xmm1,xmm7 psubw xmm1,[esp+50h] pabsw xmm1,xmm1 movdqa xmm4,xmm6 pcmpgtw xmm4,xmm1 movdqa xmm1,xmm2 psubw xmm1,[esp+30h] pabsw xmm1,xmm1 pcmpgtw xmm5,xmm1 movdqa xmm1,[esp+40h] pand xmm0,xmm4 psubw xmm1,xmm2 pabsw xmm1,xmm1 movdqa xmm4,xmm6 pcmpgtw xmm4,xmm1 movdqa xmm1,[esp+20h] psubw xmm1,[esp+30h] pand xmm5,xmm4 pabsw xmm1,xmm1 pcmpgtw xmm6,xmm1 pand xmm5,xmm6 mov edx,2 movsx edx,dx movd xmm1,edx movdqa xmm4,xmm1 punpcklwd xmm4,xmm1 pshufd xmm1,xmm4,0 movdqa xmm4,[esp+60h] movdqa xmm6,xmm4 paddw xmm6,xmm4 paddw xmm6,xmm3 paddw xmm6,xmm7 movdqa [esp+10h],xmm1 paddw xmm6,[esp+10h] psraw xmm6,2 movdqa xmm4,xmm0 pandn xmm4,xmm3 movdqa xmm3,[esp+40h] movdqa xmm1,xmm0 pand xmm1,xmm6 por xmm1,xmm4 movdqa xmm6,xmm3 paddw xmm6,xmm3 movdqa xmm3,[esp+10h] paddw xmm6,xmm2 paddw xmm6,[esp+20h] paddw xmm6,xmm3 psraw xmm6,2 movdqa xmm4,xmm5 pand xmm4,xmm6 movdqa xmm6,xmm5 pandn xmm6,xmm2 por xmm4,xmm6 packuswb xmm1,xmm4 movdqa xmm4,[esp+50h] movdqa xmm6,xmm7 paddw xmm6,xmm7 paddw xmm6,xmm4 paddw xmm6,[esp+60h] paddw xmm6,xmm3 psraw xmm6,2 movdqa xmm2,xmm0 pand xmm2,xmm6 pandn xmm0,xmm4 por xmm2,xmm0 movdqa xmm0,[esp+20h] movdqa xmm6,xmm0 paddw xmm6,xmm0 movdqa xmm0,[esp+30h] paddw xmm6,xmm0 paddw xmm6,[esp+40h] movdqa xmm4,xmm5 paddw xmm6,xmm3 movq [esi],xmm1 psraw xmm6,2 pand xmm4,xmm6 pandn xmm5,xmm0 por xmm4,xmm5 packuswb xmm2,xmm4 movq [eax],xmm2 psrldq xmm1,8 movq [edi],xmm1 pop edi psrldq xmm2,8 movq [ecx],xmm2 pop esi mov esp,ebp pop ebp ret ;****************************************************************************** ; void DeblockChromaLt4V_sse2(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta, int8_t * pTC); ;******************************************************************************* WELS_EXTERN DeblockChromaLt4V_sse2 DeblockChromaLt4V_sse2: push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,0E4h push ebx push esi mov esi, [ebp+1Ch] ; pTC movsx ebx, byte [esi+2] push edi movsx di,byte [esi+3] mov word [esp+0Ch],bx movsx bx,byte [esi+1] movsx esi,byte [esi] mov word [esp+0Eh],si movzx esi,di movd xmm1,esi movzx esi,di movd xmm2,esi mov si,word [esp+0Ch] mov edx, [ebp + 10h] mov eax, [ebp + 08h] movzx edi,si movzx esi,si mov ecx, [ebp + 0Ch] movd xmm4,esi movzx esi,bx movd xmm5,esi movd xmm3,edi movzx esi,bx movd xmm6,esi mov si,word [esp+0Eh] movzx edi,si movzx esi,si punpcklwd xmm6,xmm2 pxor xmm0,xmm0 movdqa [esp+40h],xmm0 movd xmm7,edi movd xmm0,esi lea esi,[edx+edx] mov edi,eax sub edi,esi punpcklwd xmm5,xmm1 movdqa xmm1,[esp+40h] punpcklwd xmm0,xmm4 movq xmm4,[edx+ecx] punpcklwd xmm7,xmm3 movq xmm3,[eax] punpcklwd xmm0,xmm6 movq xmm6,[edi] punpcklwd xmm7,xmm5 punpcklwd xmm0,xmm7 mov edi,ecx sub edi,esi movdqa xmm2,xmm1 psubw xmm2,xmm0 movdqa [esp+60h],xmm2 movq xmm2, [edi] punpcklqdq xmm6,xmm2 mov esi,eax sub esi,edx movq xmm7,[esi] mov edi,ecx sub edi,edx movq xmm2,[edi] punpcklqdq xmm7,xmm2 movq xmm2,[ecx] punpcklqdq xmm3,xmm2 movq xmm2,[edx+eax] movsx edx,word [ebp + 14h] punpcklqdq xmm2,xmm4 movdqa [esp+0E0h],xmm2 movd xmm2,edx movsx edx,word [ebp + 18h] movdqa xmm4,xmm2 punpcklwd xmm4,xmm2 movd xmm2,edx movdqa xmm5,xmm2 punpcklwd xmm5,xmm2 pshufd xmm2,xmm5,0 movdqa [esp+50h],xmm2 movdqa xmm2,xmm6 punpcklbw xmm2,xmm1 movdqa [esp+0D0h],xmm3 pshufd xmm4,xmm4,0 movdqa [esp+30h],xmm2 punpckhbw xmm6,xmm1 movdqa [esp+80h],xmm6 movdqa xmm6,[esp+0D0h] punpckhbw xmm6,xmm1 movdqa [esp+70h],xmm6 movdqa xmm6, [esp+0E0h] punpckhbw xmm6,xmm1 movdqa [esp+90h],xmm6 movdqa xmm5, [esp+0E0h] movdqa xmm2,xmm7 punpckhbw xmm7,xmm1 punpcklbw xmm5,xmm1 movdqa [esp+0A0h],xmm7 punpcklbw xmm3,xmm1 mov edx,4 punpcklbw xmm2,xmm1 movsx edx,dx movd xmm6,edx movdqa xmm7,xmm6 punpcklwd xmm7,xmm6 pshufd xmm6,xmm7,0 movdqa xmm7,[esp+30h] movdqa [esp+20h],xmm6 psubw xmm7,xmm5 movdqa xmm6,xmm0 pcmpgtw xmm6,xmm1 movdqa xmm1,[esp+60h] movdqa [esp+40h],xmm6 movdqa xmm6,xmm3 psubw xmm6,xmm2 psllw xmm6,2 paddw xmm6,xmm7 paddw xmm6, [esp+20h] movdqa xmm7, [esp+50h] psraw xmm6,3 pmaxsw xmm1,xmm6 movdqa [esp+10h],xmm0 movdqa xmm6, [esp+10h] pminsw xmm6,xmm1 movdqa [esp+10h],xmm6 movdqa xmm1,xmm2 psubw xmm1,xmm3 pabsw xmm1,xmm1 movdqa xmm6,xmm4 pcmpgtw xmm6,xmm1 movdqa xmm1, [esp+30h] psubw xmm1,xmm2 pabsw xmm1,xmm1 pcmpgtw xmm7,xmm1 movdqa xmm1,[esp+50h] pand xmm6,xmm7 movdqa xmm7,[esp+50h] psubw xmm5,xmm3 pabsw xmm5,xmm5 pcmpgtw xmm1,xmm5 movdqa xmm5,[esp+80h] psubw xmm5,[esp+90h] pand xmm6,xmm1 pand xmm6,[esp+40h] movdqa xmm1,[esp+10h] pand xmm1,xmm6 movdqa xmm6,[esp+70h] movdqa [esp+30h],xmm1 movdqa xmm1,[esp+0A0h] psubw xmm6,xmm1 psllw xmm6,2 paddw xmm6,xmm5 paddw xmm6,[esp+20h] movdqa xmm5,[esp+60h] psraw xmm6,3 pmaxsw xmm5,xmm6 pminsw xmm0,xmm5 movdqa xmm5,[esp+70h] movdqa xmm6,xmm1 psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm4,xmm6 movdqa xmm6,[esp+80h] psubw xmm6,xmm1 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+90h] pand xmm4,xmm7 movdqa xmm7,[esp+50h] psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 pand xmm4,xmm7 pand xmm4,[esp+40h] pand xmm0,xmm4 movdqa xmm4,[esp+30h] paddw xmm2,xmm4 paddw xmm1,xmm0 packuswb xmm2,xmm1 movq [esi],xmm2 psubw xmm3,xmm4 psubw xmm5,xmm0 packuswb xmm3,xmm5 movq [eax],xmm3 psrldq xmm2,8 movq [edi],xmm2 pop edi pop esi psrldq xmm3,8 movq [ecx],xmm3 pop ebx mov esp,ebp pop ebp ret ;*************************************************************************** ; void DeblockChromaEq4H_sse2(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta) ;*************************************************************************** WELS_EXTERN DeblockChromaEq4H_sse2 ALIGN 16 DeblockChromaEq4H_sse2: push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,0C8h mov ecx,dword [ebp+8] mov edx,dword [ebp+0Ch] mov eax,dword [ebp+10h] sub ecx,2 sub edx,2 push esi lea esi,[eax+eax*2] mov dword [esp+18h],ecx mov dword [esp+4],edx lea ecx,[ecx+eax*4] lea edx,[edx+eax*4] lea eax,[esp+7Ch] push edi mov dword [esp+14h],esi mov dword [esp+18h],ecx mov dword [esp+0Ch],edx mov dword [esp+10h],eax mov esi,dword [esp+1Ch] mov ecx,dword [ebp+10h] mov edx,dword [esp+14h] movd xmm0,dword [esi] movd xmm1,dword [esi+ecx] movd xmm2,dword [esi+ecx*2] movd xmm3,dword [esi+edx] mov esi,dword [esp+8] movd xmm4,dword [esi] movd xmm5,dword [esi+ecx] movd xmm6,dword [esi+ecx*2] movd xmm7,dword [esi+edx] punpckldq xmm0,xmm4 punpckldq xmm1,xmm5 punpckldq xmm2,xmm6 punpckldq xmm3,xmm7 mov esi,dword [esp+18h] mov edi,dword [esp+0Ch] movd xmm4,dword [esi] movd xmm5,dword [edi] punpckldq xmm4,xmm5 punpcklqdq xmm0,xmm4 movd xmm4,dword [esi+ecx] movd xmm5,dword [edi+ecx] punpckldq xmm4,xmm5 punpcklqdq xmm1,xmm4 movd xmm4,dword [esi+ecx*2] movd xmm5,dword [edi+ecx*2] punpckldq xmm4,xmm5 punpcklqdq xmm2,xmm4 movd xmm4,dword [esi+edx] movd xmm5,dword [edi+edx] punpckldq xmm4,xmm5 punpcklqdq xmm3,xmm4 movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov edi,dword [esp+10h] movdqa [edi],xmm0 movdqa [edi+10h],xmm5 movdqa [edi+20h],xmm1 movdqa [edi+30h],xmm6 movsx ecx,word [ebp+14h] movsx edx,word [ebp+18h] movdqa xmm6,[esp+80h] movdqa xmm4,[esp+90h] movdqa xmm5,[esp+0A0h] movdqa xmm7,[esp+0B0h] pxor xmm0,xmm0 movd xmm1,ecx movdqa xmm2,xmm1 punpcklwd xmm2,xmm1 pshufd xmm1,xmm2,0 movd xmm2,edx movdqa xmm3,xmm2 punpcklwd xmm3,xmm2 pshufd xmm2,xmm3,0 movdqa xmm3,xmm6 punpckhbw xmm6,xmm0 movdqa [esp+60h],xmm6 movdqa xmm6,[esp+90h] punpckhbw xmm6,xmm0 movdqa [esp+30h],xmm6 movdqa xmm6,[esp+0A0h] punpckhbw xmm6,xmm0 movdqa [esp+40h],xmm6 movdqa xmm6,[esp+0B0h] punpckhbw xmm6,xmm0 movdqa [esp+70h],xmm6 punpcklbw xmm7,xmm0 punpcklbw xmm4,xmm0 punpcklbw xmm5,xmm0 punpcklbw xmm3,xmm0 movdqa [esp+50h],xmm7 movdqa xmm6,xmm4 psubw xmm6,xmm5 pabsw xmm6,xmm6 movdqa xmm0,xmm1 pcmpgtw xmm0,xmm6 movdqa xmm6,xmm3 psubw xmm6,xmm4 pabsw xmm6,xmm6 movdqa xmm7,xmm2 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+50h] psubw xmm6,xmm5 pabsw xmm6,xmm6 pand xmm0,xmm7 movdqa xmm7,xmm2 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+30h] psubw xmm6,[esp+40h] pabsw xmm6,xmm6 pcmpgtw xmm1,xmm6 movdqa xmm6,[esp+60h] psubw xmm6,[esp+30h] pabsw xmm6,xmm6 pand xmm0,xmm7 movdqa xmm7,xmm2 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+70h] psubw xmm6,[esp+40h] pabsw xmm6,xmm6 pand xmm1,xmm7 pcmpgtw xmm2,xmm6 pand xmm1,xmm2 mov eax,2 movsx ecx,ax movd xmm2,ecx movdqa xmm6,xmm2 punpcklwd xmm6,xmm2 pshufd xmm2,xmm6,0 movdqa [esp+20h],xmm2 movdqa xmm2,xmm3 paddw xmm2,xmm3 paddw xmm2,xmm4 paddw xmm2,[esp+50h] paddw xmm2,[esp+20h] psraw xmm2,2 movdqa xmm6,xmm0 pand xmm6,xmm2 movdqa xmm2,xmm0 pandn xmm2,xmm4 por xmm6,xmm2 movdqa xmm2,[esp+60h] movdqa xmm7,xmm2 paddw xmm7,xmm2 paddw xmm7,[esp+30h] paddw xmm7,[esp+70h] paddw xmm7,[esp+20h] movdqa xmm4,xmm1 movdqa xmm2,xmm1 pandn xmm2,[esp+30h] psraw xmm7,2 pand xmm4,xmm7 por xmm4,xmm2 movdqa xmm2,[esp+50h] packuswb xmm6,xmm4 movdqa [esp+90h],xmm6 movdqa xmm6,xmm2 paddw xmm6,xmm2 movdqa xmm2,[esp+20h] paddw xmm6,xmm5 paddw xmm6,xmm3 movdqa xmm4,xmm0 pandn xmm0,xmm5 paddw xmm6,xmm2 psraw xmm6,2 pand xmm4,xmm6 por xmm4,xmm0 movdqa xmm0,[esp+70h] movdqa xmm5,xmm0 paddw xmm5,xmm0 movdqa xmm0,[esp+40h] paddw xmm5,xmm0 paddw xmm5,[esp+60h] movdqa xmm3,xmm1 paddw xmm5,xmm2 psraw xmm5,2 pand xmm3,xmm5 pandn xmm1,xmm0 por xmm3,xmm1 packuswb xmm4,xmm3 movdqa [esp+0A0h],xmm4 mov esi,dword [esp+10h] movdqa xmm0,[esi] movdqa xmm1,[esi+10h] movdqa xmm2,[esi+20h] movdqa xmm3,[esi+30h] movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov esi,dword [esp+1Ch] mov ecx,dword [ebp+10h] mov edx,dword [esp+14h] mov edi,dword [esp+8] movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov esi,dword [esp+18h] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov edi,dword [esp+0Ch] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 pop edi pop esi mov esp,ebp pop ebp ret ;******************************************************************************* ; void DeblockChromaLt4H_sse2(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta, int8_t * pTC); ;******************************************************************************* WELS_EXTERN DeblockChromaLt4H_sse2 ALIGN 16 DeblockChromaLt4H_sse2: push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,108h mov ecx,dword [ebp+8] mov edx,dword [ebp+0Ch] mov eax,dword [ebp+10h] sub ecx,2 sub edx,2 push esi lea esi,[eax+eax*2] mov dword [esp+10h],ecx mov dword [esp+4],edx lea ecx,[ecx+eax*4] lea edx,[edx+eax*4] lea eax,[esp+6Ch] push edi mov dword [esp+0Ch],esi mov dword [esp+18h],ecx mov dword [esp+10h],edx mov dword [esp+1Ch],eax mov esi,dword [esp+14h] mov ecx,dword [ebp+10h] mov edx,dword [esp+0Ch] movd xmm0,dword [esi] movd xmm1,dword [esi+ecx] movd xmm2,dword [esi+ecx*2] movd xmm3,dword [esi+edx] mov esi,dword [esp+8] movd xmm4,dword [esi] movd xmm5,dword [esi+ecx] movd xmm6,dword [esi+ecx*2] movd xmm7,dword [esi+edx] punpckldq xmm0,xmm4 punpckldq xmm1,xmm5 punpckldq xmm2,xmm6 punpckldq xmm3,xmm7 mov esi,dword [esp+18h] mov edi,dword [esp+10h] movd xmm4,dword [esi] movd xmm5,dword [edi] punpckldq xmm4,xmm5 punpcklqdq xmm0,xmm4 movd xmm4,dword [esi+ecx] movd xmm5,dword [edi+ecx] punpckldq xmm4,xmm5 punpcklqdq xmm1,xmm4 movd xmm4,dword [esi+ecx*2] movd xmm5,dword [edi+ecx*2] punpckldq xmm4,xmm5 punpcklqdq xmm2,xmm4 movd xmm4,dword [esi+edx] movd xmm5,dword [edi+edx] punpckldq xmm4,xmm5 punpcklqdq xmm3,xmm4 movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov edi,dword [esp+1Ch] movdqa [edi],xmm0 movdqa [edi+10h],xmm5 movdqa [edi+20h],xmm1 movdqa [edi+30h],xmm6 mov eax,dword [ebp+1Ch] movsx cx,byte [eax+3] movsx dx,byte [eax+2] movsx si,byte [eax+1] movsx ax,byte [eax] movzx edi,cx movzx ecx,cx movd xmm2,ecx movzx ecx,dx movzx edx,dx movd xmm3,ecx movd xmm4,edx movzx ecx,si movzx edx,si movd xmm5,ecx pxor xmm0,xmm0 movd xmm6,edx movzx ecx,ax movdqa [esp+60h],xmm0 movzx edx,ax movsx eax,word [ebp+14h] punpcklwd xmm6,xmm2 movd xmm1,edi movd xmm7,ecx movsx ecx,word [ebp+18h] movd xmm0,edx punpcklwd xmm7,xmm3 punpcklwd xmm5,xmm1 movdqa xmm1,[esp+60h] punpcklwd xmm7,xmm5 movdqa xmm5,[esp+0A0h] punpcklwd xmm0,xmm4 punpcklwd xmm0,xmm6 movdqa xmm6, [esp+70h] punpcklwd xmm0,xmm7 movdqa xmm7,[esp+80h] movdqa xmm2,xmm1 psubw xmm2,xmm0 movdqa [esp+0D0h],xmm2 movd xmm2,eax movdqa xmm3,xmm2 punpcklwd xmm3,xmm2 pshufd xmm4,xmm3,0 movd xmm2,ecx movdqa xmm3,xmm2 punpcklwd xmm3,xmm2 pshufd xmm2,xmm3,0 movdqa xmm3, [esp+90h] movdqa [esp+50h],xmm2 movdqa xmm2,xmm6 punpcklbw xmm2,xmm1 punpckhbw xmm6,xmm1 movdqa [esp+40h],xmm2 movdqa [esp+0B0h],xmm6 movdqa xmm6,[esp+90h] movdqa xmm2,xmm7 punpckhbw xmm7,xmm1 punpckhbw xmm6,xmm1 punpcklbw xmm2,xmm1 punpcklbw xmm3,xmm1 punpcklbw xmm5,xmm1 movdqa [esp+0F0h],xmm7 movdqa [esp+0C0h],xmm6 movdqa xmm6, [esp+0A0h] punpckhbw xmm6,xmm1 movdqa [esp+0E0h],xmm6 mov edx,4 movsx eax,dx movd xmm6,eax movdqa xmm7,xmm6 punpcklwd xmm7,xmm6 pshufd xmm6,xmm7,0 movdqa [esp+30h],xmm6 movdqa xmm7, [esp+40h] psubw xmm7,xmm5 movdqa xmm6,xmm0 pcmpgtw xmm6,xmm1 movdqa [esp+60h],xmm6 movdqa xmm1, [esp+0D0h] movdqa xmm6,xmm3 psubw xmm6,xmm2 psllw xmm6,2 paddw xmm6,xmm7 paddw xmm6,[esp+30h] psraw xmm6,3 pmaxsw xmm1,xmm6 movdqa xmm7,[esp+50h] movdqa [esp+20h],xmm0 movdqa xmm6, [esp+20h] pminsw xmm6,xmm1 movdqa [esp+20h],xmm6 movdqa xmm6,xmm4 movdqa xmm1,xmm2 psubw xmm1,xmm3 pabsw xmm1,xmm1 pcmpgtw xmm6,xmm1 movdqa xmm1, [esp+40h] psubw xmm1,xmm2 pabsw xmm1,xmm1 pcmpgtw xmm7,xmm1 movdqa xmm1, [esp+50h] pand xmm6,xmm7 movdqa xmm7, [esp+50h] psubw xmm5,xmm3 pabsw xmm5,xmm5 pcmpgtw xmm1,xmm5 movdqa xmm5, [esp+0B0h] psubw xmm5,[esp+0E0h] pand xmm6,xmm1 pand xmm6, [esp+60h] movdqa xmm1, [esp+20h] pand xmm1,xmm6 movdqa xmm6, [esp+0C0h] movdqa [esp+40h],xmm1 movdqa xmm1, [esp+0F0h] psubw xmm6,xmm1 psllw xmm6,2 paddw xmm6,xmm5 paddw xmm6, [esp+30h] movdqa xmm5, [esp+0D0h] psraw xmm6,3 pmaxsw xmm5,xmm6 pminsw xmm0,xmm5 movdqa xmm5,[esp+0C0h] movdqa xmm6,xmm1 psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm4,xmm6 movdqa xmm6,[esp+0B0h] psubw xmm6,xmm1 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 movdqa xmm6, [esp+0E0h] pand xmm4,xmm7 movdqa xmm7, [esp+50h] psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 pand xmm4,xmm7 pand xmm4,[esp+60h] pand xmm0,xmm4 movdqa xmm4, [esp+40h] paddw xmm2,xmm4 paddw xmm1,xmm0 psubw xmm3,xmm4 psubw xmm5,xmm0 packuswb xmm2,xmm1 packuswb xmm3,xmm5 movdqa [esp+80h],xmm2 movdqa [esp+90h],xmm3 mov esi,dword [esp+1Ch] movdqa xmm0, [esi] movdqa xmm1, [esi+10h] movdqa xmm2, [esi+20h] movdqa xmm3, [esi+30h] movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov esi,dword [esp+14h] mov ecx,dword [ebp+10h] mov edx,dword [esp+0Ch] mov edi,dword [esp+8] movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov esi,dword [esp+18h] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov edi,dword [esp+10h] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 pop edi pop esi mov esp,ebp pop ebp ret ;******************************************************************************* ; void DeblockLumaLt4V_sse2(uint8_t * pPix, int32_t iStride, int32_t iAlpha, ; int32_t iBeta, int8_t * pTC) ;******************************************************************************* WELS_EXTERN DeblockLumaLt4V_sse2 ALIGN 16 DeblockLumaLt4V_sse2: push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 420 ; 000001a4H mov eax, dword [ebp+8] mov ecx, dword [ebp+12] pxor xmm0, xmm0 push ebx mov edx, dword [ebp+24] movdqa [esp+424-384], xmm0 push esi lea esi, [ecx+ecx*2] push edi mov edi, eax sub edi, esi movdqa xmm0, [edi] lea esi, [ecx+ecx] movdqa [esp+432-208], xmm0 mov edi, eax sub edi, esi movdqa xmm0, [edi] movdqa [esp+448-208], xmm0 mov ebx, eax sub ebx, ecx movdqa xmm0, [ebx] movdqa [esp+464-208], xmm0 movdqa xmm0, [eax] add ecx, eax movdqa [esp+480-208], xmm0 movdqa xmm0, [ecx] mov dword [esp+432-404], ecx movsx ecx, word [ebp+16] movdqa [esp+496-208], xmm0 movdqa xmm0, [esi+eax] movsx si, byte [edx] movdqa [esp+512-208], xmm0 movd xmm0, ecx movsx ecx, word [ebp+20] movdqa xmm1, xmm0 punpcklwd xmm1, xmm0 pshufd xmm0, xmm1, 0 movdqa [esp+432-112], xmm0 movd xmm0, ecx movsx cx, byte [edx+1] movdqa xmm1, xmm0 punpcklwd xmm1, xmm0 mov dword [esp+432-408], ebx movzx ebx, cx pshufd xmm0, xmm1, 0 movd xmm1, ebx movzx ebx, cx movd xmm2, ebx movzx ebx, cx movzx ecx, cx movd xmm4, ecx movzx ecx, si movd xmm5, ecx movzx ecx, si movd xmm6, ecx movzx ecx, si movd xmm7, ecx movzx ecx, si movdqa [esp+432-336], xmm0 movd xmm0, ecx movsx cx, byte [edx+3] movsx dx, byte [edx+2] movd xmm3, ebx punpcklwd xmm0, xmm4 movzx esi, cx punpcklwd xmm6, xmm2 punpcklwd xmm5, xmm1 punpcklwd xmm0, xmm6 punpcklwd xmm7, xmm3 punpcklwd xmm7, xmm5 punpcklwd xmm0, xmm7 movdqa [esp+432-400], xmm0 movd xmm0, esi movzx esi, cx movd xmm2, esi movzx esi, cx movzx ecx, cx movd xmm4, ecx movzx ecx, dx movd xmm3, esi movd xmm5, ecx punpcklwd xmm5, xmm0 movdqa xmm0, [esp+432-384] movzx ecx, dx movd xmm6, ecx movzx ecx, dx movzx edx, dx punpcklwd xmm6, xmm2 movd xmm7, ecx movd xmm1, edx movdqa xmm2, [esp+448-208] punpcklbw xmm2, xmm0 mov ecx, 4 movsx edx, cx punpcklwd xmm7, xmm3 punpcklwd xmm7, xmm5 movdqa xmm5, [esp+496-208] movdqa xmm3, [esp+464-208] punpcklbw xmm5, xmm0 movdqa [esp+432-240], xmm5 movdqa xmm5, [esp+512-208] punpcklbw xmm5, xmm0 movdqa [esp+432-352], xmm5 punpcklwd xmm1, xmm4 movdqa xmm4, [esp+432-208] punpcklwd xmm1, xmm6 movdqa xmm6, [esp+480-208] punpcklwd xmm1, xmm7 punpcklbw xmm6, xmm0 punpcklbw xmm3, xmm0 punpcklbw xmm4, xmm0 movdqa xmm7, xmm3 psubw xmm7, xmm4 pabsw xmm7, xmm7 movdqa [esp+432-272], xmm4 movdqa xmm4, [esp+432-336] movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-288], xmm5 movdqa xmm7, xmm6 psubw xmm7, [esp+432-352] pabsw xmm7, xmm7 movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-256], xmm5 movdqa xmm5, xmm3 pavgw xmm5, xmm6 movdqa [esp+432-304], xmm5 movdqa xmm5, [esp+432-400] psubw xmm5, [esp+432-288] psubw xmm5, [esp+432-256] movdqa [esp+432-224], xmm5 movdqa xmm5, xmm6 psubw xmm5, xmm3 movdqa [esp+432-32], xmm6 psubw xmm6, [esp+432-240] movdqa xmm7, xmm5 movdqa [esp+432-384], xmm5 movdqa xmm5, [esp+432-112] pabsw xmm7, xmm7 pcmpgtw xmm5, xmm7 pabsw xmm6, xmm6 movdqa xmm7, xmm4 pcmpgtw xmm7, xmm6 pand xmm5, xmm7 movdqa xmm6, xmm3 psubw xmm6, xmm2 pabsw xmm6, xmm6 movdqa xmm7, xmm4 pcmpgtw xmm7, xmm6 movdqa xmm6, [esp+432-400] pand xmm5, xmm7 movdqa xmm7, xmm6 pcmpeqw xmm6, xmm0 pcmpgtw xmm7, xmm0 por xmm7, xmm6 pand xmm5, xmm7 movdqa [esp+432-320], xmm5 movd xmm5, edx movdqa xmm6, xmm5 punpcklwd xmm6, xmm5 pshufd xmm5, xmm6, 0 movdqa [esp+432-336], xmm5 movdqa xmm5, [esp+432-224] movdqa [esp+432-368], xmm5 movdqa xmm6, xmm0 psubw xmm6, xmm5 movdqa xmm5, [esp+432-384] psllw xmm5, 2 movdqa xmm7, xmm2 psubw xmm7, [esp+432-240] paddw xmm7, xmm5 paddw xmm7, [esp+432-336] movdqa xmm5, [esp+432-368] psraw xmm7, 3 pmaxsw xmm6, xmm7 pminsw xmm5, xmm6 pand xmm5, [esp+432-320] movdqa xmm6, [esp+432-400] movdqa [esp+432-64], xmm5 movdqa [esp+432-384], xmm6 movdqa xmm5, xmm0 psubw xmm5, xmm6 movdqa [esp+432-368], xmm5 movdqa xmm6, xmm5 movdqa xmm5, [esp+432-272] paddw xmm5, [esp+432-304] movdqa xmm7, xmm2 paddw xmm7, xmm2 psubw xmm5, xmm7 psraw xmm5, 1 pmaxsw xmm6, xmm5 movdqa xmm5, [esp+432-384] pminsw xmm5, xmm6 pand xmm5, [esp+432-320] pand xmm5, [esp+432-288] movdqa xmm6, [esp+432-240] movdqa [esp+432-96], xmm5 movdqa xmm5, [esp+432-352] paddw xmm5, [esp+432-304] movdqa xmm7, xmm6 paddw xmm7, xmm6 movdqa xmm6, [esp+432-368] psubw xmm5, xmm7 movdqa xmm7, [esp+496-208] psraw xmm5, 1 pmaxsw xmm6, xmm5 movdqa xmm5, [esp+432-400] pminsw xmm5, xmm6 pand xmm5, [esp+432-320] pand xmm5, [esp+432-256] movdqa xmm6, [esp+448-208] punpckhbw xmm7, xmm0 movdqa [esp+432-352], xmm7 movdqa xmm7, [esp+512-208] punpckhbw xmm6, xmm0 movdqa [esp+432-48], xmm5 movdqa xmm5, [esp+432-208] movdqa [esp+432-368], xmm6 movdqa xmm6, [esp+464-208] punpckhbw xmm7, xmm0 punpckhbw xmm5, xmm0 movdqa [esp+432-384], xmm7 punpckhbw xmm6, xmm0 movdqa [esp+432-400], xmm6 movdqa xmm7, [esp+432-400] movdqa xmm6, [esp+480-208] psubw xmm7, xmm5 movdqa [esp+432-16], xmm5 pabsw xmm7, xmm7 punpckhbw xmm6, xmm0 movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-288], xmm5 movdqa xmm7, xmm6 psubw xmm7, [esp+432-384] pabsw xmm7, xmm7 movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-256], xmm5 movdqa xmm5, [esp+432-400] movdqa [esp+432-80], xmm6 pavgw xmm5, xmm6 movdqa [esp+432-304], xmm5 movdqa xmm5, xmm1 psubw xmm5, [esp+432-288] psubw xmm5, [esp+432-256] movdqa [esp+432-224], xmm5 movdqa xmm5, xmm6 psubw xmm5, [esp+432-400] psubw xmm6, [esp+432-352] movdqa [esp+432-272], xmm5 movdqa xmm7, xmm5 movdqa xmm5, [esp+432-112] pabsw xmm7, xmm7 pcmpgtw xmm5, xmm7 movdqa xmm7, xmm4 pabsw xmm6, xmm6 pcmpgtw xmm7, xmm6 movdqa xmm6, [esp+432-368] pand xmm5, xmm7 movdqa xmm7, [esp+432-400] psubw xmm7, xmm6 psubw xmm6, [esp+432-352] pabsw xmm7, xmm7 pcmpgtw xmm4, xmm7 pand xmm5, xmm4 paddw xmm2, [esp+432-96] movdqa xmm4, xmm1 pcmpgtw xmm4, xmm0 movdqa xmm7, xmm1 pcmpeqw xmm7, xmm0 por xmm4, xmm7 pand xmm5, xmm4 movdqa xmm4, [esp+432-224] movdqa [esp+432-320], xmm5 movdqa xmm5, [esp+432-272] movdqa xmm7, xmm0 psubw xmm7, xmm4 psubw xmm0, xmm1 psllw xmm5, 2 paddw xmm6, xmm5 paddw xmm6, [esp+432-336] movdqa xmm5, [esp+432-368] movdqa [esp+432-336], xmm0 psraw xmm6, 3 pmaxsw xmm7, xmm6 pminsw xmm4, xmm7 pand xmm4, [esp+432-320] movdqa xmm6, xmm0 movdqa xmm0, [esp+432-16] paddw xmm0, [esp+432-304] movdqa [esp+432-272], xmm4 movdqa xmm4, [esp+432-368] paddw xmm4, xmm4 psubw xmm0, xmm4 movdqa xmm4, [esp+432-64] psraw xmm0, 1 pmaxsw xmm6, xmm0 movdqa xmm0, [esp+432-400] movdqa xmm7, xmm1 pminsw xmm7, xmm6 movdqa xmm6, [esp+432-320] pand xmm7, xmm6 pand xmm7, [esp+432-288] paddw xmm5, xmm7 packuswb xmm2, xmm5 movdqa xmm5, [esp+432-272] paddw xmm0, xmm5 paddw xmm3, xmm4 packuswb xmm3, xmm0 movdqa xmm0, [esp+432-32] psubw xmm0, xmm4 movdqa xmm4, [esp+432-80] psubw xmm4, xmm5 movdqa xmm5, [esp+432-240] paddw xmm5, [esp+432-48] packuswb xmm0, xmm4 movdqa xmm4, [esp+432-384] paddw xmm4, [esp+432-304] movdqa [esp+480-208], xmm0 movdqa xmm0, [esp+432-352] movdqa xmm7, xmm0 paddw xmm0, xmm0 mov ecx, dword [esp+432-408] mov edx, dword [esp+432-404] psubw xmm4, xmm0 movdqa xmm0, [esp+432-336] movdqa [edi], xmm2 psraw xmm4, 1 pmaxsw xmm0, xmm4 pminsw xmm1, xmm0 movdqa xmm0, [esp+480-208] pop edi pand xmm1, xmm6 pand xmm1, [esp+428-256] movdqa [ecx], xmm3 paddw xmm7, xmm1 pop esi packuswb xmm5, xmm7 movdqa [eax], xmm0 movdqa [edx], xmm5 pop ebx mov esp, ebp pop ebp ret ;******************************************************************************* ; void DeblockLumaEq4V_sse2(uint8_t * pPix, int32_t iStride, int32_t iAlpha, ; int32_t iBeta) ;******************************************************************************* WELS_EXTERN DeblockLumaEq4V_sse2 ALIGN 16 DeblockLumaEq4V_sse2: push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 628 ; 00000274H mov eax, dword [ebp+8] mov ecx, dword [ebp+12] push ebx push esi lea edx, [ecx*4] pxor xmm0, xmm0 movdqa xmm2, xmm0 movdqa xmm0, [ecx+eax] mov esi, eax sub esi, edx movdqa xmm3, [esi] movdqa xmm5, [eax] push edi lea edi, [ecx+ecx] lea ebx, [ecx+ecx*2] mov dword [esp+640-600], edi mov esi, eax sub esi, edi movdqa xmm1, [esi] movdqa [esp+720-272], xmm0 mov edi, eax sub edi, ecx movdqa xmm4, [edi] add ecx, eax mov dword [esp+640-596], ecx mov ecx, dword [esp+640-600] movdqa xmm0, [ecx+eax] movdqa [esp+736-272], xmm0 movdqa xmm0, [eax+ebx] mov edx, eax sub edx, ebx movsx ebx, word [ebp+16] movdqa xmm6, [edx] add ecx, eax movdqa [esp+752-272], xmm0 movd xmm0, ebx movsx ebx, word [ebp+20] movdqa xmm7, xmm0 punpcklwd xmm7, xmm0 pshufd xmm0, xmm7, 0 movdqa [esp+640-320], xmm0 movd xmm0, ebx movdqa xmm7, xmm0 punpcklwd xmm7, xmm0 pshufd xmm0, xmm7, 0 movdqa xmm7, [esp+736-272] punpcklbw xmm7, xmm2 movdqa [esp+640-416], xmm7 movdqa [esp+640-512], xmm0 movdqa xmm0, xmm1 movdqa [esp+672-272], xmm1 movdqa xmm1, xmm4 movdqa [esp+704-272], xmm5 punpcklbw xmm5, xmm2 punpcklbw xmm1, xmm2 movdqa xmm7, xmm5 psubw xmm7, xmm1 pabsw xmm7, xmm7 movdqa [esp+640-560], xmm7 punpcklbw xmm0, xmm2 movdqa [esp+688-272], xmm4 movdqa xmm4, [esp+720-272] movdqa [esp+640-480], xmm0 movdqa xmm7, xmm1 psubw xmm7, xmm0 movdqa xmm0, [esp+640-512] pabsw xmm7, xmm7 punpcklbw xmm4, xmm2 pcmpgtw xmm0, xmm7 movdqa [esp+640-384], xmm4 movdqa xmm7, xmm5 psubw xmm7, xmm4 movdqa xmm4, [esp+640-512] movdqa [esp+656-272], xmm6 punpcklbw xmm6, xmm2 pabsw xmm7, xmm7 movdqa [esp+640-48], xmm2 movdqa [esp+640-368], xmm6 movdqa [esp+640-144], xmm1 movdqa [esp+640-400], xmm5 pcmpgtw xmm4, xmm7 pand xmm0, xmm4 movdqa xmm4, [esp+640-320] pcmpgtw xmm4, [esp+640-560] pand xmm0, xmm4 mov ebx, 2 movsx ebx, bx movd xmm4, ebx movdqa xmm7, xmm4 punpcklwd xmm7, xmm4 movdqa xmm4, [esp+640-320] psraw xmm4, 2 pshufd xmm7, xmm7, 0 paddw xmm4, xmm7 movdqa [esp+640-576], xmm4 pcmpgtw xmm4, [esp+640-560] movdqa [esp+640-560], xmm4 movdqa xmm4, [esp+640-512] movdqa [esp+640-624], xmm7 movdqa xmm7, xmm1 psubw xmm7, xmm6 pabsw xmm7, xmm7 pcmpgtw xmm4, xmm7 pand xmm4, [esp+640-560] movdqa [esp+640-544], xmm4 movdqa xmm4, [esp+640-512] movdqa xmm7, xmm5 psubw xmm7, [esp+640-416] pabsw xmm7, xmm7 pcmpgtw xmm4, xmm7 pand xmm4, [esp+640-560] movdqa [esp+640-560], xmm4 movdqa xmm4, [esp+640-544] pandn xmm4, xmm6 movdqa [esp+640-16], xmm4 mov ebx, 4 movsx ebx, bx movd xmm4, ebx movdqa xmm7, xmm4 punpcklwd xmm7, xmm4 movdqa xmm4, xmm3 punpcklbw xmm4, xmm2 psllw xmm4, 1 paddw xmm4, xmm6 paddw xmm4, xmm6 paddw xmm4, xmm6 paddw xmm4, [esp+640-480] movdqa xmm6, [esp+640-560] pshufd xmm7, xmm7, 0 paddw xmm4, xmm1 movdqa [esp+640-592], xmm7 paddw xmm4, xmm5 paddw xmm4, xmm7 movdqa xmm7, [esp+640-416] pandn xmm6, xmm7 movdqa [esp+640-80], xmm6 movdqa xmm6, [esp+752-272] punpcklbw xmm6, xmm2 psllw xmm6, 1 paddw xmm6, xmm7 paddw xmm6, xmm7 paddw xmm6, xmm7 paddw xmm6, [esp+640-384] movdqa xmm7, [esp+640-480] paddw xmm6, xmm5 paddw xmm6, xmm1 paddw xmm6, [esp+640-592] psraw xmm6, 3 pand xmm6, [esp+640-560] movdqa [esp+640-112], xmm6 movdqa xmm6, [esp+640-544] pandn xmm6, xmm7 movdqa [esp+640-336], xmm6 movdqa xmm6, [esp+640-544] movdqa [esp+640-528], xmm6 movdqa xmm6, [esp+640-368] paddw xmm6, xmm7 movdqa xmm7, xmm1 psraw xmm4, 3 pand xmm4, [esp+640-544] paddw xmm7, xmm5 paddw xmm6, xmm7 paddw xmm6, [esp+640-624] movdqa xmm7, [esp+640-528] paddw xmm5, xmm1 psraw xmm6, 2 pand xmm7, xmm6 movdqa xmm6, [esp+640-384] movdqa [esp+640-64], xmm7 movdqa xmm7, [esp+640-560] pandn xmm7, xmm6 movdqa [esp+640-304], xmm7 movdqa xmm7, [esp+640-560] movdqa [esp+640-528], xmm7 movdqa xmm7, [esp+640-416] paddw xmm7, xmm6 paddw xmm7, xmm5 paddw xmm7, [esp+640-624] movdqa xmm5, [esp+640-528] psraw xmm7, 2 pand xmm5, xmm7 movdqa [esp+640-32], xmm5 movdqa xmm5, [esp+640-544] movdqa [esp+640-528], xmm5 movdqa xmm5, [esp+640-480] movdqa xmm7, xmm5 paddw xmm7, xmm5 movdqa xmm5, xmm1 paddw xmm5, xmm6 paddw xmm6, [esp+640-592] paddw xmm7, xmm5 paddw xmm7, [esp+640-624] movdqa xmm5, [esp+640-528] psraw xmm7, 2 pandn xmm5, xmm7 movdqa xmm7, [esp+640-480] paddw xmm7, xmm1 paddw xmm7, [esp+640-400] movdqa xmm1, [esp+640-544] movdqa [esp+640-352], xmm5 movdqa xmm5, [esp+640-368] psllw xmm7, 1 paddw xmm7, xmm6 paddw xmm5, xmm7 movdqa xmm7, [esp+640-400] psraw xmm5, 3 pand xmm1, xmm5 movdqa xmm5, [esp+640-480] movdqa [esp+640-96], xmm1 movdqa xmm1, [esp+640-560] movdqa [esp+640-528], xmm1 movdqa xmm1, [esp+640-384] movdqa xmm6, xmm1 paddw xmm6, xmm1 paddw xmm1, [esp+640-400] paddw xmm1, [esp+640-144] paddw xmm7, xmm5 paddw xmm5, [esp+640-592] paddw xmm6, xmm7 paddw xmm6, [esp+640-624] movdqa xmm7, [esp+640-528] psraw xmm6, 2 psllw xmm1, 1 paddw xmm1, xmm5 movdqa xmm5, [esp+656-272] pandn xmm7, xmm6 movdqa xmm6, [esp+640-416] paddw xmm6, xmm1 movdqa xmm1, [esp+640-560] psraw xmm6, 3 pand xmm1, xmm6 movdqa xmm6, [esp+704-272] movdqa [esp+640-128], xmm1 movdqa xmm1, [esp+672-272] punpckhbw xmm1, xmm2 movdqa [esp+640-448], xmm1 movdqa xmm1, [esp+688-272] punpckhbw xmm1, xmm2 punpckhbw xmm6, xmm2 movdqa [esp+640-288], xmm7 punpckhbw xmm5, xmm2 movdqa [esp+640-496], xmm1 movdqa [esp+640-432], xmm6 movdqa xmm7, [esp+720-272] punpckhbw xmm7, xmm2 movdqa [esp+640-464], xmm7 movdqa xmm7, [esp+736-272] punpckhbw xmm7, xmm2 movdqa [esp+640-528], xmm7 movdqa xmm7, xmm6 psubw xmm6, [esp+640-464] psubw xmm7, xmm1 pabsw xmm7, xmm7 movdqa [esp+640-560], xmm7 por xmm4, [esp+640-16] pabsw xmm6, xmm6 movdqa xmm7, xmm1 psubw xmm7, [esp+640-448] movdqa xmm1, [esp+640-512] pabsw xmm7, xmm7 pcmpgtw xmm1, xmm7 movdqa xmm7, [esp+640-512] pcmpgtw xmm7, xmm6 movdqa xmm6, [esp+640-320] pand xmm1, xmm7 movdqa xmm7, [esp+640-560] pcmpgtw xmm6, xmm7 pand xmm1, xmm6 movdqa xmm6, [esp+640-576] pcmpgtw xmm6, xmm7 movdqa xmm7, [esp+640-496] punpckhbw xmm3, xmm2 movdqa [esp+640-560], xmm6 movdqa xmm6, [esp+640-512] psubw xmm7, xmm5 pabsw xmm7, xmm7 pcmpgtw xmm6, xmm7 pand xmm6, [esp+640-560] movdqa xmm7, [esp+640-432] psubw xmm7, [esp+640-528] psllw xmm3, 1 movdqa [esp+640-544], xmm6 movdqa xmm6, [esp+640-512] movdqa xmm2, [esp+640-544] paddw xmm3, xmm5 paddw xmm3, xmm5 paddw xmm3, xmm5 paddw xmm3, [esp+640-448] paddw xmm3, [esp+640-496] pabsw xmm7, xmm7 pcmpgtw xmm6, xmm7 pand xmm6, [esp+640-560] movdqa [esp+640-560], xmm6 movdqa xmm6, xmm0 pand xmm6, xmm4 movdqa xmm4, xmm0 pandn xmm4, [esp+640-368] por xmm6, xmm4 movdqa xmm4, [esp+640-432] paddw xmm3, xmm4 paddw xmm3, [esp+640-592] psraw xmm3, 3 pand xmm3, xmm2 pandn xmm2, xmm5 por xmm3, xmm2 movdqa xmm7, xmm1 pand xmm7, xmm3 movdqa xmm3, [esp+640-64] por xmm3, [esp+640-336] movdqa xmm2, xmm1 pandn xmm2, xmm5 por xmm7, xmm2 movdqa xmm2, xmm0 pand xmm2, xmm3 movdqa xmm3, xmm0 pandn xmm3, [esp+640-480] por xmm2, xmm3 packuswb xmm6, xmm7 movdqa [esp+640-336], xmm2 movdqa [esp+656-272], xmm6 movdqa xmm6, [esp+640-544] movdqa xmm2, xmm5 paddw xmm2, [esp+640-448] movdqa xmm3, xmm1 movdqa xmm7, [esp+640-496] paddw xmm7, xmm4 paddw xmm2, xmm7 paddw xmm2, [esp+640-624] movdqa xmm7, [esp+640-544] psraw xmm2, 2 pand xmm6, xmm2 movdqa xmm2, [esp+640-448] pandn xmm7, xmm2 por xmm6, xmm7 pand xmm3, xmm6 movdqa xmm6, xmm1 pandn xmm6, xmm2 paddw xmm2, [esp+640-496] paddw xmm2, xmm4 por xmm3, xmm6 movdqa xmm6, [esp+640-336] packuswb xmm6, xmm3 psllw xmm2, 1 movdqa [esp+672-272], xmm6 movdqa xmm6, [esp+640-96] por xmm6, [esp+640-352] movdqa xmm3, xmm0 pand xmm3, xmm6 movdqa xmm6, xmm0 pandn xmm6, [esp+640-144] por xmm3, xmm6 movdqa xmm6, [esp+640-544] movdqa [esp+640-352], xmm3 movdqa xmm3, [esp+640-464] paddw xmm3, [esp+640-592] paddw xmm2, xmm3 movdqa xmm3, [esp+640-448] paddw xmm5, xmm2 movdqa xmm2, [esp+640-496] psraw xmm5, 3 pand xmm6, xmm5 movdqa xmm5, [esp+640-464] paddw xmm2, xmm5 paddw xmm5, [esp+640-432] movdqa xmm4, xmm3 paddw xmm4, xmm3 paddw xmm4, xmm2 paddw xmm4, [esp+640-624] movdqa xmm2, [esp+640-544] paddw xmm3, [esp+640-592] psraw xmm4, 2 pandn xmm2, xmm4 por xmm6, xmm2 movdqa xmm7, xmm1 pand xmm7, xmm6 movdqa xmm6, [esp+640-496] movdqa xmm2, xmm1 pandn xmm2, xmm6 por xmm7, xmm2 movdqa xmm2, [esp+640-352] packuswb xmm2, xmm7 movdqa [esp+688-272], xmm2 movdqa xmm2, [esp+640-128] por xmm2, [esp+640-288] movdqa xmm4, xmm0 pand xmm4, xmm2 paddw xmm5, xmm6 movdqa xmm2, xmm0 pandn xmm2, [esp+640-400] por xmm4, xmm2 movdqa xmm2, [esp+640-528] psllw xmm5, 1 paddw xmm5, xmm3 movdqa xmm3, [esp+640-560] paddw xmm2, xmm5 psraw xmm2, 3 movdqa [esp+640-288], xmm4 movdqa xmm4, [esp+640-560] pand xmm4, xmm2 movdqa xmm2, [esp+640-464] movdqa xmm5, xmm2 paddw xmm5, xmm2 movdqa xmm2, [esp+640-432] paddw xmm2, [esp+640-448] movdqa xmm7, xmm1 paddw xmm5, xmm2 paddw xmm5, [esp+640-624] movdqa xmm6, [esp+640-560] psraw xmm5, 2 pandn xmm3, xmm5 por xmm4, xmm3 movdqa xmm3, [esp+640-32] por xmm3, [esp+640-304] pand xmm7, xmm4 movdqa xmm4, [esp+640-432] movdqa xmm5, [esp+640-464] movdqa xmm2, xmm1 pandn xmm2, xmm4 paddw xmm4, [esp+640-496] por xmm7, xmm2 movdqa xmm2, [esp+640-288] packuswb xmm2, xmm7 movdqa [esp+704-272], xmm2 movdqa xmm2, xmm0 pand xmm2, xmm3 movdqa xmm3, xmm0 pandn xmm3, [esp+640-384] por xmm2, xmm3 movdqa [esp+640-304], xmm2 movdqa xmm2, [esp+640-528] movdqa xmm3, xmm2 paddw xmm3, [esp+640-464] paddw xmm3, xmm4 paddw xmm3, [esp+640-624] psraw xmm3, 2 pand xmm6, xmm3 movdqa xmm3, [esp+640-560] movdqa xmm4, xmm3 pandn xmm4, xmm5 por xmm6, xmm4 movdqa xmm7, xmm1 pand xmm7, xmm6 movdqa xmm6, [esp+640-304] movdqa xmm4, xmm1 pandn xmm4, xmm5 por xmm7, xmm4 movdqa xmm4, xmm0 pandn xmm0, [esp+640-416] packuswb xmm6, xmm7 movdqa xmm7, [esp+640-112] por xmm7, [esp+640-80] pand xmm4, xmm7 por xmm4, xmm0 movdqa xmm0, [esp+752-272] punpckhbw xmm0, [esp+640-48] psllw xmm0, 1 paddw xmm0, xmm2 paddw xmm0, xmm2 paddw xmm0, xmm2 paddw xmm0, xmm5 paddw xmm0, [esp+640-432] paddw xmm0, [esp+640-496] paddw xmm0, [esp+640-592] psraw xmm0, 3 pand xmm0, xmm3 movdqa xmm7, xmm1 pandn xmm3, xmm2 por xmm0, xmm3 pand xmm7, xmm0 movdqa xmm0, [esp+656-272] movdqa [edx], xmm0 movdqa xmm0, [esp+672-272] mov edx, dword [esp+640-596] movdqa [esi], xmm0 movdqa xmm0, [esp+688-272] movdqa [edi], xmm0 movdqa xmm0, [esp+704-272] pop edi pandn xmm1, xmm2 movdqa [eax], xmm0 por xmm7, xmm1 pop esi packuswb xmm4, xmm7 movdqa [edx], xmm6 movdqa [ecx], xmm4 pop ebx mov esp, ebp pop ebp ret ;******************************************************************************** ; ; void DeblockLumaTransposeH2V_sse2(uint8_t * pPixY, int32_t iStride, uint8_t * pDst); ; ;******************************************************************************** WELS_EXTERN DeblockLumaTransposeH2V_sse2 ALIGN 16 DeblockLumaTransposeH2V_sse2: push ebp push ebx mov ebp, esp and esp,0FFFFFFF0h sub esp, 10h mov eax, [ebp + 0Ch] mov ecx, [ebp + 10h] lea edx, [eax + ecx * 8] lea ebx, [ecx*3] movq xmm0, [eax] movq xmm7, [edx] punpcklqdq xmm0, xmm7 movq xmm1, [eax + ecx] movq xmm7, [edx + ecx] punpcklqdq xmm1, xmm7 movq xmm2, [eax + ecx*2] movq xmm7, [edx + ecx*2] punpcklqdq xmm2, xmm7 movq xmm3, [eax + ebx] movq xmm7, [edx + ebx] punpcklqdq xmm3, xmm7 lea eax, [eax + ecx * 4] lea edx, [edx + ecx * 4] movq xmm4, [eax] movq xmm7, [edx] punpcklqdq xmm4, xmm7 movq xmm5, [eax + ecx] movq xmm7, [edx + ecx] punpcklqdq xmm5, xmm7 movq xmm6, [eax + ecx*2] movq xmm7, [edx + ecx*2] punpcklqdq xmm6, xmm7 movdqa [esp], xmm0 movq xmm7, [eax + ebx] movq xmm0, [edx + ebx] punpcklqdq xmm7, xmm0 movdqa xmm0, [esp] SSE2_TransTwo8x8B xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, [esp] ;pOut: m5, m3, m4, m8, m6, m2, m7, m1 mov eax, [ebp + 14h] movdqa [eax], xmm4 movdqa [eax + 10h], xmm2 movdqa [eax + 20h], xmm3 movdqa [eax + 30h], xmm7 movdqa [eax + 40h], xmm5 movdqa [eax + 50h], xmm1 movdqa [eax + 60h], xmm6 movdqa [eax + 70h], xmm0 mov esp, ebp pop ebx pop ebp ret ;******************************************************************************************* ; ; void DeblockLumaTransposeV2H_sse2(uint8_t * pPixY, int32_t iStride, uint8_t * pSrc); ; ;******************************************************************************************* WELS_EXTERN DeblockLumaTransposeV2H_sse2 ALIGN 16 DeblockLumaTransposeV2H_sse2: push ebp mov ebp, esp and esp, 0FFFFFFF0h sub esp, 10h mov eax, [ebp + 10h] mov ecx, [ebp + 0Ch] mov edx, [ebp + 08h] movdqa xmm0, [eax] movdqa xmm1, [eax + 10h] movdqa xmm2, [eax + 20h] movdqa xmm3, [eax + 30h] movdqa xmm4, [eax + 40h] movdqa xmm5, [eax + 50h] movdqa xmm6, [eax + 60h] movdqa xmm7, [eax + 70h] SSE2_TransTwo8x8B xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, [esp] ;pOut: m5, m3, m4, m8, m6, m2, m7, m1 lea eax, [ecx * 3] movq [edx], xmm4 movq [edx + ecx], xmm2 movq [edx + ecx*2], xmm3 movq [edx + eax], xmm7 lea edx, [edx + ecx*4] movq [edx], xmm5 movq [edx + ecx], xmm1 movq [edx + ecx*2], xmm6 movq [edx + eax], xmm0 psrldq xmm4, 8 psrldq xmm2, 8 psrldq xmm3, 8 psrldq xmm7, 8 psrldq xmm5, 8 psrldq xmm1, 8 psrldq xmm6, 8 psrldq xmm0, 8 lea edx, [edx + ecx*4] movq [edx], xmm4 movq [edx + ecx], xmm2 movq [edx + ecx*2], xmm3 movq [edx + eax], xmm7 lea edx, [edx + ecx*4] movq [edx], xmm5 movq [edx + ecx], xmm1 movq [edx + ecx*2], xmm6 movq [edx + eax], xmm0 mov esp, ebp pop ebp ret
bugs/bug17b.ada
daveshields/AdaEd
3
18294
with Buggy_Package; procedure Buggy_Package_Demo is function Func_INTEGER is new Buggy_Package.Func_INT( INTEGER ); procedure Proc_INTEGER is new Buggy_Package.Proc_INT( INTEGER ); begin NULL; end Buggy_Package_Demo;
Web/asm/examples/Bouncing Ball (LCD).asm
visrealm/vrcpu
102
102770
; ----------------------------------------------- ; Bounce a ball around the character LCD display ; ----------------------------------------------- ; ; Troy's 8-bit computer - Emulator ; ; Copyright (c) 2020 <NAME> ; ; This code is licensed under the MIT license ; ; https://github.com/visrealm/vrcpu ; ; =============================================== ; display mode flags DISPLAY_MODE = LCD_CMD_DISPLAY | LCD_CMD_DISPLAY_ON ; memory location constants ; ----------------------------- _PIXELX = 0x00 ; ball overall X position _DIR_X = _PIXELX + 1 ; ball X direction _PIXELY = 0x02 ; ball overall Y position _DIR_Y = _PIXELY + 1 ; ball Y direction _CHARX = 0x04 ; character offset within character LCD _PIXEL_OFFSETX = 0x06 ; pixel X offset within the character _LAST_CHARX = 0x08 ; character offset for the last frame _CHARSET = 0x0a ; character set (0 or 4) ; other constants ;------------------------------ CHAR_WIDTH = 5 ; character size (px) CHAR_HEIGHT = 8 BALL_HEIGHT = 4 ; ball bitmap size BALL_WIDTH = 4 SCREEN_WIDTH = 80 ; screen size (px) SCREEN_HEIGHT = 16 PLAYABLE_WIDTH = SCREEN_WIDTH - BALL_WIDTH PLAYABLE_HEIGHT = SCREEN_HEIGHT - BALL_HEIGHT NEXTLINE = 0x40 | LCD_CMD_SET_DRAM_ADDR main: clra ; initialise the display lcc #LCD_INITIALIZE lcc #DISPLAY_MODE lcc #LCD_CMD_CLEAR ; store some initial values ; all 0's sto Ra, _PIXELY ; all 1's inc Ra sto Ra, _PIXELX sto Ra, _DIR_Y sto Ra, _LAST_CHARX ; ensure last char positions are.. different (1) ; all 2's inc Ra sto Ra, _DIR_X ; ----------------------------------------------- ; nextFrame ; ----------------------------------------------- ; main program loop ; ----------------------------------------------- nextFrame: ; check X position is within bounds data Rb, PLAYABLE_WIDTH - 1 data Ra, _PIXELX call checkBounds ; check Y position is within bounds data Rb, PLAYABLE_HEIGHT data Ra, _PIXELY call checkBounds ; compute LCD X character location and pixel offset data Rb, CHAR_WIDTH lod Ra, _PIXELX call div8 sto Rc, _CHARX sto Ra, _PIXEL_OFFSETX ; which character set are we using for the current ; character offset? call determineCharset ; set up CGRAM address for current y offset and ; character set lod Ra, _PIXELY call setCgRamAddr ; output the first column of ball data to the CGRAM mov Ra, ballData call updateChar ; set up CGRAM address for current y offset and ; character set. For the 2nd column, the CGRAM has ; an addtional offset of 16 rows of character data lod Ra, _PIXELY data Rb, CHAR_HEIGHT * 2 add Ra call setCgRamAddr ; output the second column of ball data to the CGRAM ; column 2 has an offset of 2 byes into the ball data array mov Ra, ballData + 2 call updateChar ; output the current character set characters to the ; character LCD if character x position is different call outputCharacters ; update the ball location by adding the ball direction ; offsets lod Ra, _PIXELX lod Rb, _DIR_X add Ra sto Ra, _PIXELX lod Ra, _PIXELY lod Rb, _DIR_Y add Ra sto Ra, _PIXELY ; do it all again jmp nextFrame ; end nextFrame ; ----------------------------------------------- ; setCgRamAddr ; ----------------------------------------------- ; set the cgram address. if it's not 0, then ; go back one more and clear it too. The CGRAM ; address is computed: CHARSET * 4 + Y offset ; ; inputs: ; Ra = Y offset ; ----------------------------------------------- setCgRamAddr: ; get the current character set (0 or 4) lod Rb, _CHARSET ; multiply by 8 (8 rows per character) lsr lsr lsr clr Rc ; Flag to indicate if we are clearing previous row ; determine if we are are clearing the previous ; row of CGRAM add Ra jz .setAddr ; we are, so set RC as an indicator flag ; and decrement the CGRAM pointer (Ra) inc Rc dec Ra ; set the address .setAddr: data Rb, LCD_CMD_SET_CGRAM_ADDR add Ra lcc Ra ; now check our indicator. if set, we alos outpt a 0 ; to clear the previous row tst Rc jz .ret clr Rc lcd Rc .ret: ret ; end setCgRamAddr ; ----------------------------------------------- ; updateChar ; ----------------------------------------------- ; update CGRAM with character data. this function ; writes 5 bytes to the CGRAM: ; ; inputs: ; Ra = address of character data at offset 0 ; ----------------------------------------------- updateChar: ; compute the actual data address by adding ; 4 * PIXEL_OFFSETX lod Rb, _PIXEL_OFFSETX lsr lsr add Ra ; Ra now points to the first row of character ; data ; load the two rows of character data we need ; first byte into Rb, second into Ra. mov Rc, Ra lod Rb, Rc inc Rc lod Ra, Rc ; output the character rows: lcd Rb lcd Ra lcd Ra lcd Rb clr Rb lcd Rb ; clear the last row ret ; end updateChar ; ----------------------------------------------- ; checkBounds ; ----------------------------------------------- ; checks an axis is within bounds of the display ; if it's not, then adjust the position within ; display limits and also reverse the direction ; can be used to check either X or Y ; ; inputs: ; Ra = address of position variable ; Rb = maximum position value ; ----------------------------------------------- checkBounds: ; push position address for later use push Ra ; load and test the position lod Ra, Ra tst Ra ; if it's negative, set to 0 and reverse direction jn .fixNeg ; if it's greater than maximum position, set to maximum ; position (Rb) and reverse direction cmp Rb, Ra jnn .done .fixPos: jmp .reverse .fixNeg: ; new position: 0 clr Rb .reverse: ; position will now be set to value in Rb pop Ra sto Ra, Rb ; direction is at the next address after ; position. load it, reverse it, save it inc Ra lod Rb, Ra clr Rc sub Rc sto Ra, Rc inc Rd ret .done: pop Ra ret ; end checkBounds ; ----------------------------------------------- ; determineCharset ; ----------------------------------------------- ; sets CHARSET to 0 if CHARX is even, 4 if it's odd ; ----------------------------------------------- determineCharset: ; load character position lod Ra, _CHARX ; get first bit and multiply by 4 data Rb, 1 and Ra mov Rb, Ra lsr lsr ; Rb now contains 0 or 4 ; compare to current character set lod Ra, _CHARSET cmp Ra jz .ret ; character set has changed ; store it and clear the character data sto Rb, _CHARSET call clearChars .ret: ret ; end determineCharset ; ----------------------------------------------- ; outputCharacters ; ----------------------------------------------- ; output the required characters to the display ; if the chracter X position hasn't changed since ; the last frame, do nothing, otherwise: ; ; Charset 0 Charset 4 ; ' ' 0 2 ' ' ' ' 4 6 ' ' ; ' ' 1 3 ' ' ' ' 5 7 ' ' ; ; ----------------------------------------------- outputCharacters: ; check if we need to do anything lod Rb, _LAST_CHARX lod Ra, _CHARX cmp Ra jz .ret ; update last position to current position sto Ra, _LAST_CHARX ; if the offset isn't 0, we output a leading ; space character. adjust the offset accordingly clr Rc tst Ra jz .doOutput dec Rc .doOutput: ; at this point: ; Ra is the x offset ; Rc is the optional leading space offset (0 or -1) ; ; set up the dram address command data Rb, LCD_CMD_SET_DRAM_ADDR add Ra mov Rb, Rc add Ra lcc Ra ; set the dram location ; output the first row of characters lod Rb, _CHARSET call .outputChars ; set the dram address to the next line data Rb, NEXTLINE lod Ra, _CHARX add Ra mov Rb, Rc add Ra lcc Ra ; set the dram location ; output the 2nd row of characters lod Rb, _CHARSET inc Rb call .outputChars .ret: ret ; Rb will be initial character offset ; Rc will be 0 (no space) or -1 (leading space) .outputChars: tst Rc data Ra, 32 jz .skipSpace lcd Ra .skipSpace: lcd Rb inc Rb inc Rb lcd Rb lcd Ra ret ; end outputCharacters ; ----------------------------------------------- ; clearChars ; ----------------------------------------------- ; clear the cgram data for the current character ; set. ; ----------------------------------------------- clearChars: ; set the address to the beginning of the ; character set clr Ra call setCgRamAddr ; clear the data 8 x 4 = 32 bytes ; loop unrolled for minor performance win data Rb, 4 .next: lcd Rc lcd Rc lcd Rc lcd Rc lcd Rc lcd Rc lcd Rc lcd Rc dec Rb jnz .next ret ; end clearChars ; ----------------------------------------------- ; div8 ; ----------------------------------------------- ; divide two 8-bit integers ; ; inputs: ; Ra = dividend ; Rb = divisor ; ; returns: ; Rc = result ; Ra = remainder ; ----------------------------------------------- div8: clr Rc .step: cmp Ra, Rb jnc .return .add: inc Rc sub Ra jnz .step .return: ret ; end div8 ; ----------------------------------------------- ; The ball data ; ----------------------------------------------- ; Each 32-bit row contains the pixel data for the ; ball at a given X offset. ; The lowest significant 5 bits of each byte are ; used. The pixel data is arranged like this to ; form an image: ; ; B0 B2 ; B1 B3 ; B1 B3 ; B0 B2 ; ; so, the ball will be vertically symmetrical ; to switch ball images, comment out the old and ; uncomment the new ; ----------------------------------------------- ballData: ; empty ball ;#d32 0x0c120000 ;#d32 0x06090000 ;#d32 0x03080000 ;#d32 0x01020010 ;#d32 0x00011008 ; filled ball #d32 0x0c1e0000 #d32 0x060f0000 #d32 0x03070000 #d32 0x01030010 #d32 0x00011018
src/common/keccak-keccak_1600-rounds_14.ads
damaki/libkeccak
26
30499
<reponame>damaki/libkeccak<filename>src/common/keccak-keccak_1600-rounds_14.ads<gh_stars>10-100 ------------------------------------------------------------------------------- -- Copyright (c) 2019, <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: -- * 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. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Generic_Duplex; with Keccak.Generic_Sponge; pragma Elaborate_All (Keccak.Generic_Duplex); pragma Elaborate_All (Keccak.Generic_Sponge); -- @summary -- Instantiation of Keccak-p[1600,14], with a Sponge and Duplex built on top of it. package Keccak.Keccak_1600.Rounds_14 with SPARK_Mode => On is procedure Permute is new KeccakF_1600_Permutation.Permute (Num_Rounds => 14); package Sponge is new Keccak.Generic_Sponge (State_Size_Bits => KeccakF_1600.State_Size_Bits, State_Type => State, Init_State => KeccakF_1600.Init, Permute => Permute, XOR_Bits_Into_State => KeccakF_1600_Lanes.XOR_Bits_Into_State, Extract_Data => KeccakF_1600_Lanes.Extract_Bytes, Pad => Keccak.Padding.Pad101_Multi_Blocks); package Duplex is new Keccak.Generic_Duplex (State_Size_Bits => KeccakF_1600.State_Size_Bits, State_Type => State, Init_State => KeccakF_1600.Init, Permute => Permute, XOR_Bits_Into_State => KeccakF_1600_Lanes.XOR_Bits_Into_State, Extract_Bits => KeccakF_1600_Lanes.Extract_Bits, Pad => Keccak.Padding.Pad101_Single_Block, Min_Padding_Bits => Keccak.Padding.Pad101_Min_Bits); end Keccak.Keccak_1600.Rounds_14;
core/parser/src/main/antlr4/imports/JPQL_lexer.g4
cybernetics/blaze-persistence
1
7348
/* * Copyright 2014 Blazebit. * * 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. */ lexer grammar JPQL_lexer; Star_operator : '*'; Size_function : 'SIZE'; Empty_function : 'IS' ([ ]+ 'NOT' [ ]+)? 'EMPTY'; Member_of_function : ('NOT' [ ]+)? 'MEMBER' ([ ]+ 'OF')?; Outer_function : 'OUTER'; String_literal : '\'' ~[\']* '\''; Character_literal : '\''JavaLetter'\''; Input_parameter : ':'Identifier; //Enum_literal : (Identifier'.')+Identifier; Date_literal : '(' 'd' (' ' | '\t')+ '\'' Date_string '\'' (' ' | '\t')* ')'; Time_literal : '(' 't' (' ' | '\t')+ '\'' Time_string '\'' (' ' | '\t')* ')'; Timestamp_literal : '(' 'ts' (' ' | '\t')+ '\'' Date_string ' ' Time_string '\'' (' ' | '\t')* ')'; Date_string : DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT; Time_string : DIGIT DIGIT? ':' DIGIT DIGIT ':' DIGIT DIGIT '.' DIGIT*; Boolean_literal : 'TRUE' | 'true' | 'FALSE' | 'false' ; Not_equal_operator : '<>' | '!=' ; Numeric_literal : DIGIT+ ; Path_separator : '.' ; Identifier : JavaLetter JavaLetterOrDigit* ; WS: [ \n\t\r]+ -> channel(HIDDEN); fragment DIGIT: '0'..'9'; fragment DIGIT_NOT_ZERO: '1'..'9'; fragment JavaLetter : [a-zA-Z$_] // these are the "java letters" below 0xFF | // covers all characters above 0xFF which are not a surrogate ~[\u0000-\u00FF\uD800-\uDBFF] {Character.isJavaIdentifierStart(_input.LA(-1))}? | // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF [\uD800-\uDBFF] [\uDC00-\uDFFF] {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}? ; fragment JavaLetterOrDigit : [a-zA-Z0-9$_] // these are the "java letters or digits" below 0xFF | // covers all characters above 0xFF which are not a surrogate ~[\u0000-\u00FF\uD800-\uDBFF] {Character.isJavaIdentifierPart(_input.LA(-1))}? | // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF [\uD800-\uDBFF] [\uDC00-\uDFFF] {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}? ;
Cubical/HITs/RPn.agda
cmester0/cubical
1
3637
<filename>Cubical/HITs/RPn.agda {-# OPTIONS --cubical --safe #-} module Cubical.HITs.RPn where open import Cubical.HITs.RPn.Base public
libsrc/math/z88math/dge.asm
Toysoft/z88dk
8
4303
; ; Z88dk Z88 Maths Library ; ; ; $Id: dge.asm,v 1.4 2016-06-22 19:55:06 dom Exp $ SECTION code_fp PUBLIC dge EXTERN fsetup EXTERN stkequcmp INCLUDE "fpp.def" ; TOS >= FA? .dge call fsetup fpp(FP_GEQ) jp stkequcmp
libsrc/_DEVELOPMENT/l/sccz80/crt0_long_8080/l_long_asr_u.asm
yottatsa/z88dk
1
178567
<gh_stars>1-10 ; Z88 Small C+ Run Time Library ; Long functions ; "8080" mode ; SECTION code_crt0_sccz80 PUBLIC l_long_asr_u PUBLIC l_long_asr_uo ; Entry: dehl = long ; c = shift .l_long_asr_uo ld a,c jp entry ; Shift primary (on stack) right by secondary, .l_long_asr_u pop bc ld a,l ;temporary store for counter pop hl pop de push bc .entry and 31 ret z ld b,a IF __CPU_GBZ80__ ld a,e ;Primary = dahl ENDIF .loop IF __CPU_GBZ80__ srl d rra rr h rr l ELSE and a ld a,d rra ld d,a ld a,e rra ld e,a ld a,h rra ld h,a ld a,l rra ld l,a ENDIF dec b jp nz,loop IF __CPU_GBZ80__ ld e,a ENDIF ret
programs/oeis/011/A011893.asm
neoneye/loda
22
167422
; A011893: [ n(n-1)(n-2)/11 ]. ; 0,0,0,0,2,5,10,19,30,45,65,90,120,156,198,248,305,370,445,528,621,725,840,966,1104,1254,1418,1595,1786,1993,2214,2451,2705,2976,3264,3570,3894,4238,4601,4984,5389 bin $0,3 mul $0,36 div $0,66
programs/oeis/120/A120743.asm
karttu/loda
0
1999
; A120743: a(n) = (1/2)*(1 + 3*i)^n + (1/2)*(1 - 3*i)^n where i = sqrt(-1). ; 1,-8,-26,28,316,352,-2456,-8432,7696,99712,122464,-752192,-2729024,2063872,31417984,42197248,-229785344,-881543168,534767104,9884965888,14422260736,-70005137408,-284232882176,131585609728,3105500041216,4895143985152,-21264712441856,-91480864735232,29685394948096,974179437248512,1651504925016064,-6438784522452992 add $0,1 mov $1,2 mov $2,1 lpb $0,1 sub $0,1 mul $1,5 mul $2,2 sub $2,$1 add $1,$2 lpe sub $1,2 div $1,18 mul $1,9 add $1,1
3-mid/opengl/source/platform/glx/private/opengl-surface-privvy.ads
charlie5/lace
20
13968
<reponame>charlie5/lace with GLX; package openGL.Surface.privvy is function to_GLX (Self : in Surface.item'Class) return glx.Drawable; end openGL.Surface.privvy;
polynomial/spline/spline_tst_2.adb
jscparker/math_packages
30
23148
-- Spline_tst2 tests spline calculations on a subset of the Data_Vector. with Text_IO; use Text_IO; with Ada.Numerics.Generic_Elementary_Functions; with Spline; procedure Spline_tst_2 is type Real is digits 15; package Math is new Ada.Numerics.Generic_Elementary_Functions (Real); use Math; package flio is new Float_IO (Real); use flio; type Index is range 1 .. 128; type Data_Vector is array(Index) of Real; package Sin_Spline is new Spline (Real, Index, Data_Vector); use Sin_Spline; X_Data, Y_Data : Data_Vector := (others => 0.0); S : Spline_Coefficients; -- tst2 tests spline calculations on a subset of the Data_Vector: I_start : constant Index := Index'First + 2; I_finish : constant Index := Index'Last - 2; Pii : constant Real := Ada.Numerics.Pi; DeltaX : Real := Pii / (Real (I_finish) - Real (I_start)); X, Y : Real; Y_true : Real; dY, ddY : Real; DeltaX1, DeltaX2, DeltaX3 : Real; Integral_of_Sin, Err : Real; Bound_First, Bound_Last : Boundary; X_Stuff : X_Structure; -- Requires Text_IO. procedure Pause (s1,s2,s3,s4,s5,s6 : string := " ") is Continuation : Character := ' '; begin Text_IO.New_Line; if S1 /= " " then put_line (S1); end if; if S2 /= " " then put_line (S2); end if; if S3 /= " " then put_line (S3); end if; if S4 /= " " then put_line (S4); end if; if S5 /= " " then put_line (S5); end if; if S6 /= " " then put_line (S6); end if; Text_IO.New_Line; begin Text_IO.Put ("Type a character to continue: "); Text_IO.Get_Immediate (Continuation); exception when others => null; end; Text_IO.New_Line; end pause; begin -- Start by making natural splines DeltaX := Pii / (Real (I_finish) - Real (I_start)); for I in Index loop X := DeltaX * (Real (I) - Real(Index'First)); X_Data(I) := X; Y_Data(I) := Sin (X); end loop; -- Natural boundary conditions: Bound_First := (Alpha => 1.0, Beta => 0.0, Boundary_Val => 0.0); Bound_Last := (Alpha => 1.0, Beta => 0.0, Boundary_Val => 0.0); Prepare_X_Data (X_Stuff, X_Data, I_start, I_finish, Bound_First, Bound_Last); Get_Spline (S, X_Stuff, Y_Data); -- Check that Spline is continuous Pause ("Test 1: Check that the Spline is continuous at the knots.", "Recall that the spline equations were derived via this assumption", "(along with the assumption that the first 2 derivatives of the curve", "are also continuous at the knots.)"); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; Y := Y_Data(I) + S.F(1)(I)*DeltaX1 + S.F(2)(I)*DeltaX2 + S.F(3)(I)*DeltaX3; -- This is the Y at I+1 due to spline starting at point I. -- Compare with Y at I+1 = Y_Data(I+1) Put (Y - Y_Data(I+1)); New_Line; end loop; -- Check that derivative is continuous Pause ("Verify that the derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; dY := S.F(1)(I) + 2.0*S.F(2)(I)*DeltaX1 + 3.0*S.F(3)(I)*DeltaX2; -- This is the dY at I+1 due to spline starting at point I. -- Compare with dY at I+1 = S.F(1)(I+1) Put (dY - S.F(1)(I+1)); New_Line; end loop; -- Check that 2nd derivative is continuous Pause ("Verify that the 2nd derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; ddY := 2.0*S.F(2)(I) + 6.0*S.F(3)(I)*DeltaX1; -- This is the ddY at I+1 due to spline starting at point I. -- Compare with ddY at I+1 = 2.0*S.F(2)(I+1) Put (ddY - 2.0*S.F(2)(I+1)); New_Line; end loop; Pause ("Subtract Spline prediction from true value."); for I in I_start .. I_finish-1 loop X := X_Data(I) + DeltaX/2.0; Y := Value_At (X, X_Data, Y_Data, S); Y_true := Sin (X); Put (Y - Y_true); New_Line; end loop; New_line; -- Check quadrature: Pause ("Test 1b: Check numerical integration of area under the curve."); Integral_of_Sin := -(Cos (X_Data(I_finish)) - Cos (X_Data(I_start))); Err := Abs (Integral_of_Sin - Integral (X_Data, Y_Data, S)); New_Line; Put ("Error in numerical quadrature ="); Put (Err); --Put (Integral_of_Sin); Put (Integral (X_Data, Y_Data, S)); New_Line; -- make natural splines, test Cos. DeltaX := Pii / (Real (I_finish) - Real (I_start)); for I in I_start .. I_finish loop X := DeltaX * (Real (I) - Real(I_start)); X_Data(I) := X; Y_Data(I) := Cos (X); end loop; -- Natural boundary conditions: Bound_First := (Alpha => 1.0, Beta => 0.0, Boundary_Val => -1.0); Bound_Last := (Alpha => 1.0, Beta => 0.0, Boundary_Val => 1.0); Prepare_X_Data (X_Stuff, X_Data, I_start, I_finish, Bound_First, Bound_Last); Get_Spline (S, X_Stuff, Y_Data); --Check that Spline is continuous Pause ("Test 1c: Check that the Spline is continuous at the knots.", "In this test the boundary conditions are given by values of", "the second derivative at the end points, but this second derivative", "is not 0.0 as in the case of true natural splines."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; Y := Y_Data(I) + S.F(1)(I)*DeltaX1 + S.F(2)(I)*DeltaX2 + S.F(3)(I)*DeltaX3; -- This is the Y at I+1 due to spline starting at point I. -- Compare with Y at I+1 = Y_Data(I+1) Put (Y - Y_Data(I+1)); New_Line; end loop; -- Check that derivative is continuous Pause ("Verify that the derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; dY := S.F(1)(I) + 2.0*S.F(2)(I)*DeltaX1 + 3.0*S.F(3)(I)*DeltaX2; -- This is the dY at I+1 due to spline starting at point I. -- Compare with dY at I+1 = S.F(1)(I+1) Put (dY - S.F(1)(I+1)); New_Line; end loop; -- Check that 2nd derivative is continuous Pause ("Verify that the 2nd derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; ddY := 2.0*S.F(2)(I) + 6.0*S.F(3)(I)*DeltaX1; -- This is the ddY at I+1 due to spline starting at point I. -- Compare with ddY at I+1 = 2.0*S.F(2)(I+1) Put (ddY - 2.0*S.F(2)(I+1)); New_Line; end loop; Pause ("Subtract Spline prediction from true value."); for I in I_start .. I_finish-1 loop X := X_Data(I) + DeltaX/2.0; Y := Value_At (X, X_Data, Y_Data, S); Y_true := Cos (X); Put (Y - Y_true); New_Line; end loop; New_line; -- Make mixed splines: natural at one end, clamped at the other. DeltaX := 1.5 * Pii / (Real (I_finish) - Real (I_start)); for I in I_start .. I_finish loop X := DeltaX * (Real (I) - Real(I_start)); X_Data(I) := X; Y_Data(I) := Sin (X); end loop; -- Natural: Bound_First := (Alpha => 1.0, Beta => 0.0, Boundary_Val => 0.0); -- Clamped with derivative = 0.0: Bound_Last := (Alpha => 0.0, Beta => 1.0, Boundary_Val => 0.0); Prepare_X_Data (X_Stuff, X_Data, I_start, I_finish, Bound_First, Bound_Last); Get_Spline (S, X_Stuff, Y_Data); -- Check that Spline is continuous: Pause ("Test 2: Check that the mixed-boundary Spline is continuous at the knots.", "Recall that the spline equations were derived via this assumption", "(along with the assumption that the first 2 derivatives of the curve", "are also continuous at the knots.)"); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; Y := Y_Data(I) + S.F(1)(I)*DeltaX1 + S.F(2)(I)*DeltaX2 + S.F(3)(I)*DeltaX3; -- This is the Y at I+1 due to spline starting at point I. -- Compare with Y at I+1 = Y_Data(I+1) Put (Y - Y_Data(I+1)); New_Line; end loop; -- Check that derivative is continuous Pause ("Make sure that the derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; dY := S.F(1)(I) + 2.0*S.F(2)(I)*DeltaX1 + 3.0*S.F(3)(I)*DeltaX2; -- This is the dY at I+1 due to spline starting at point I. -- Compare with dY at I+1 = S.F(1)(I+1) Put (dY - S.F(1)(I+1)); New_Line; end loop; -- Check that 2nd derivative is continuous Pause ("Make sure that the 2nd derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; ddY := 2.0*S.F(2)(I) + 6.0*S.F(3)(I)*DeltaX1; -- This is the ddY at I+1 due to spline starting at point I. -- Compare with ddY at I+1 = 2.0*S.F(2)(I+1) Put (ddY - 2.0*S.F(2)(I+1)); New_Line; end loop; Pause ("Subtract Spline prediction from true value."); for I in I_start .. I_finish-1 loop X := X_Data(I) + DeltaX/2.0; Y := Value_At (X, X_Data, Y_Data, S); Y_true := Sin (X); Put (Y - Y_true); New_Line; end loop; New_line; -- Make mixed splines: natural at one end, clamped at the other. -- This time we get them wrong. DeltaX := 1.5 * Pii / (Real (I_finish) - Real (I_start)); for I in I_start .. I_finish loop X := DeltaX * (Real (I) - Real(I_start)); X_Data(I) := X; Y_Data(I) := Sin (X); end loop; -- Now we have the boundary conditions wrong for the Sin curve: -- Natural: Bound_First := (Alpha => 0.0, Beta => 1.0, Boundary_Val => 0.0); -- Clamped with derivative = 1.0: Bound_Last := (Alpha => 1.0, Beta => 0.0, Boundary_Val => 0.0); Prepare_X_Data (X_Stuff, X_Data, I_start, I_finish, Bound_First, Bound_Last); Get_Spline (S, X_Stuff, Y_Data); --Check that Spline is continuous Pause ("Test 3: Make sure the mixed-boundary Spline is continuous at the knots.", "Recall that the spline equations were derived via this assumption", "(along with the assumption that the first 2 derivatives of the curve", "are also continuous at the knots.)"); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; Y := Y_Data(I) + S.F(1)(I)*DeltaX1 + S.F(2)(I)*DeltaX2 + S.F(3)(I)*DeltaX3; -- This is the Y at I+1 due to spline starting at point I. -- Compare with Y at I+1 = Y_Data(I+1) Put (Y - Y_Data(I+1)); New_Line; end loop; -- Check that derivative is continuous Pause ("Make sure that the derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; dY := S.F(1)(I) + 2.0*S.F(2)(I)*DeltaX1 + 3.0*S.F(3)(I)*DeltaX2; -- This is the dY at I+1 due to spline starting at point I. -- Compare with dY at I+1 = S.F(1)(I+1) Put (dY - S.F(1)(I+1)); New_Line; end loop; -- Check that 2nd derivative is continuous Pause ("Make sure that the 2nd derivative of the spline is continuous."); for I in I_start .. I_finish-1 loop DeltaX1 := X_Data(I+1) - X_Data(I); DeltaX2 := DeltaX1*DeltaX1; DeltaX3 := DeltaX1*DeltaX2; ddY := 2.0*S.F(2)(I) + 6.0*S.F(3)(I)*DeltaX1; -- This is the ddY at I+1 due to spline starting at point I. -- Compare with ddY at I+1 = 2.0*S.F(2)(I+1) Put (ddY - 2.0*S.F(2)(I+1)); New_Line; end loop; Pause ("Subtract Spline prediction from true value.", "In this test we deliberately made the Boundary conditions", "wrong, so the answers should be bad at the end points."); for I in I_start .. I_finish-1 loop X := X_Data(I) + DeltaX/2.0; Y := Value_At (X, X_Data, Y_Data, S); Y_true := Sin (X); Put (Y - Y_true); New_Line; end loop; New_line; end;
StdLib/std_lib.32.asm
robertmuth/Cwerg
171
100818
############################################################ # std_lib.c ############################################################ .mem __static_2__malloc_end 4 RW .data 4 [0] .mem __static_1__malloc_start 4 RW .data 4 [0] .fun write_s NORMAL [S32] = [S32 A32] .reg S32 [%out] .bbl %start poparg fd:S32 poparg s:A32 .reg U32 [len] mov len = 0 bra while_1_cond .bbl while_1 add %U32_1:U32 = len 1 mov len = %U32_1 .bbl while_1_cond lea %A32_2:A32 = s len ld %S8_3:S8 = %A32_2 0 conv %S32_4:S32 = %S8_3 bne %S32_4 0 while_1 bra while_1_exit .bbl while_1_exit pusharg len pusharg s pusharg fd bsr write poparg %S32_5:S32 mov %out = %S32_5 pusharg %out ret .fun write_x NORMAL [S32] = [S32 U32] .reg S32 [%out] .bbl %start poparg fd:S32 poparg val:U32 .stk buffer 1 16 .reg U32 [pos] lea %A32_1:A32 = buffer mov pos = 16 .bbl while_1 sub %U32_2:U32 = pos 1 mov pos = %U32_2 .reg U32 [digit] rem %U32_3:U32 = val 16 mov digit = %U32_3 ble digit 9 if_2_true bra if_2_false .bbl if_2_true add %U32_4:U32 = 48:U32 digit conv %S8_5:S8 = %U32_4 lea %A32_6:A32 = buffer lea %A32_7:A32 = %A32_6 pos st %A32_7 0 = %S8_5 bra if_2_end .bbl if_2_false sub %S32_8:S32 = 97:S32 10 conv %U32_9:U32 = %S32_8 add %U32_10:U32 = %U32_9 digit conv %S8_11:S8 = %U32_10 lea %A32_12:A32 = buffer lea %A32_13:A32 = %A32_12 pos st %A32_13 0 = %S8_11 .bbl if_2_end div %U32_14:U32 = val 16 mov val = %U32_14 .bbl while_1_cond bne val 0 while_1 bra while_1_exit .bbl while_1_exit lea %A32_15:A32 = buffer lea %A32_16:A32 = %A32_15 pos lea %A32_17:A32 = buffer sub %U32_18:U32 = 16:U32 pos pusharg %U32_18 pusharg %A32_16 pusharg fd bsr write poparg %S32_19:S32 mov %out = %S32_19 pusharg %out ret .fun write_u NORMAL [S32] = [S32 U32] .reg S32 [%out] .bbl %start poparg fd:S32 poparg val:U32 .stk buffer 1 16 .reg U32 [pos] lea %A32_1:A32 = buffer mov pos = 16 .bbl while_1 sub %U32_2:U32 = pos 1 mov pos = %U32_2 rem %U32_3:U32 = val 10 add %U32_4:U32 = 48:U32 %U32_3 conv %S8_5:S8 = %U32_4 lea %A32_6:A32 = buffer lea %A32_7:A32 = %A32_6 pos st %A32_7 0 = %S8_5 div %U32_8:U32 = val 10 mov val = %U32_8 .bbl while_1_cond bne val 0 while_1 bra while_1_exit .bbl while_1_exit lea %A32_9:A32 = buffer lea %A32_10:A32 = %A32_9 pos lea %A32_11:A32 = buffer sub %U32_12:U32 = 16:U32 pos pusharg %U32_12 pusharg %A32_10 pusharg fd bsr write poparg %S32_13:S32 mov %out = %S32_13 pusharg %out ret .fun write_d NORMAL [S32] = [S32 S32] .reg S32 [%out] .bbl %start poparg fd:S32 poparg sval:S32 ble 0:S32 sval if_2_true bra if_2_end .bbl if_2_true conv %U32_1:U32 = sval pusharg %U32_1 pusharg fd bsr write_u poparg %S32_2:S32 mov %out = %S32_2 pusharg %out ret .bbl if_2_end .reg U32 [val] sub %S32_3:S32 = 0 sval conv %U32_4:U32 = %S32_3 mov val = %U32_4 .stk buffer 1 16 .reg U32 [pos] lea %A32_5:A32 = buffer mov pos = 16 .bbl while_1 sub %U32_6:U32 = pos 1 mov pos = %U32_6 rem %U32_7:U32 = val 10 add %U32_8:U32 = 48:U32 %U32_7 conv %S8_9:S8 = %U32_8 lea %A32_10:A32 = buffer lea %A32_11:A32 = %A32_10 pos st %A32_11 0 = %S8_9 div %U32_12:U32 = val 10 mov val = %U32_12 .bbl while_1_cond bne val 0 while_1 bra while_1_exit .bbl while_1_exit sub %U32_13:U32 = pos 1 mov pos = %U32_13 lea %A32_14:A32 = buffer lea %A32_15:A32 = %A32_14 pos mov %S8_16:S8 = 45 st %A32_15 0 = %S8_16 lea %A32_17:A32 = buffer lea %A32_18:A32 = %A32_17 pos lea %A32_19:A32 = buffer sub %U32_20:U32 = 16:U32 pos pusharg %U32_20 pusharg %A32_18 pusharg fd bsr write poparg %S32_21:S32 mov %out = %S32_21 pusharg %out ret .fun write_c NORMAL [S32] = [S32 U8] .reg S32 [%out] .bbl %start poparg fd:S32 poparg c:U8 .stk buffer 1 16 conv %S8_1:S8 = c lea %A32_2:A32 = buffer st %A32_2 0 = %S8_1 lea %A32_3:A32 = buffer mov %U32_5:U32 = 1 pusharg %U32_5 pusharg %A32_3 pusharg fd bsr write poparg %S32_4:S32 mov %out = %S32_4 pusharg %out ret .fun print_ln NORMAL [] = [A32 U32] .bbl %start poparg s:A32 poparg n:U32 mov %S32_2:S32 = 1 pusharg n pusharg s pusharg %S32_2 bsr write poparg %S32_1:S32 mov %S32_4:S32 = 1 mov %U8_5:U8 = 10 pusharg %U8_5 pusharg %S32_4 bsr write_c poparg %S32_3:S32 ret .fun print_s_ln NORMAL [] = [A32] .bbl %start poparg s:A32 mov %S32_2:S32 = 1 pusharg s pusharg %S32_2 bsr write_s poparg %S32_1:S32 mov %S32_4:S32 = 1 mov %U8_5:U8 = 10 pusharg %U8_5 pusharg %S32_4 bsr write_c poparg %S32_3:S32 ret .fun print_d_ln NORMAL [] = [S32] .bbl %start poparg n:S32 mov %S32_2:S32 = 1 pusharg n pusharg %S32_2 bsr write_d poparg %S32_1:S32 mov %S32_4:S32 = 1 mov %U8_5:U8 = 10 pusharg %U8_5 pusharg %S32_4 bsr write_c poparg %S32_3:S32 ret .fun print_u_ln NORMAL [] = [U32] .bbl %start poparg n:U32 mov %S32_2:S32 = 1 pusharg n pusharg %S32_2 bsr write_u poparg %S32_1:S32 mov %S32_4:S32 = 1 mov %U8_5:U8 = 10 pusharg %U8_5 pusharg %S32_4 bsr write_c poparg %S32_3:S32 ret .fun print_x_ln NORMAL [] = [U32] .bbl %start poparg n:U32 mov %S32_2:S32 = 1 pusharg n pusharg %S32_2 bsr write_x poparg %S32_1:S32 mov %S32_4:S32 = 1 mov %U8_5:U8 = 10 pusharg %U8_5 pusharg %S32_4 bsr write_c poparg %S32_3:S32 ret .fun print_x_x_ln NORMAL [] = [U32 U32] .bbl %start poparg a:U32 poparg b:U32 pusharg a pusharg 1:S32 bsr write_x poparg dummy:S32 pusharg 32:U8 pusharg 1:S32 bsr write_c poparg dummy pusharg b pusharg 1:S32 bsr write_x poparg dummy pusharg 10:U8 pusharg 1:S32 bsr write_c poparg dummy ret .fun print_x_x_x_ln NORMAL [] = [U32 U32 U32] .bbl %start poparg a:U32 poparg b:U32 poparg c:U32 pusharg a pusharg 1:S32 bsr write_x poparg dummy:S32 pusharg 32:U8 pusharg 1:S32 bsr write_c poparg dummy pusharg b pusharg 1:S32 bsr write_x poparg dummy pusharg 32:U8 pusharg 1:S32 bsr write_c poparg dummy pusharg c pusharg 1:S32 bsr write_x poparg dummy pusharg 10:U8 pusharg 1:S32 bsr write_c poparg dummy ret .fun print_c_ln NORMAL [] = [U8] .bbl %start poparg c:U8 mov %S32_2:S32 = 1 pusharg c pusharg %S32_2 bsr write_c poparg %S32_1:S32 mov %S32_4:S32 = 1 mov %U8_5:U8 = 10 pusharg %U8_5 pusharg %S32_4 bsr write_c poparg %S32_3:S32 ret .fun memset NORMAL [A32] = [A32 S32 U32] .reg A32 [%out] .bbl %start poparg ptr:A32 poparg value:S32 poparg n:U32 .reg U32 [i] mov i = 0 bra for_1_cond .bbl for_1 conv %S8_1:S8 = value lea %A32_2:A32 = ptr i st %A32_2 0 = %S8_1 .bbl for_1_next add %U32_3:U32 = i 1 mov i = %U32_3 .bbl for_1_cond blt i n for_1 bra for_1_exit .bbl for_1_exit mov %out = ptr pusharg %out ret .fun memcpy NORMAL [A32] = [A32 A32 U32] .reg A32 [%out] .bbl %start poparg dst:A32 poparg src:A32 poparg n:U32 .reg U32 [i] mov i = 0 bra for_1_cond .bbl for_1 lea %A32_1:A32 = src i ld %S8_2:S8 = %A32_1 0 lea %A32_3:A32 = dst i st %A32_3 0 = %S8_2 .bbl for_1_next add %U32_4:U32 = i 1 mov i = %U32_4 .bbl for_1_cond blt i n for_1 bra for_1_exit .bbl for_1_exit mov %out = dst pusharg %out ret .fun abort NORMAL [] = [] .bbl %start bsr getpid poparg %S32_1:S32 mov %S32_3:S32 = 3 pusharg %S32_3 pusharg %S32_1 bsr kill poparg %S32_2:S32 mov %S32_4:S32 = 1 pusharg %S32_4 bsr exit ret .fun malloc NORMAL [A32] = [U32] .reg A32 [%out] .bbl %start poparg size:U32 .reg U32 [page_size] shl %U32_1:U32 = 1:U32 20 mov page_size = %U32_1 lea %A32_2:A32 = __static_1__malloc_start ld %A32_3:A32 = %A32_2 0 beq %A32_3 0 if_1_true bra if_1_end .bbl if_1_true lea %A32_5:A32 = 0:A32 pusharg %A32_5 bsr xbrk poparg %A32_4:A32 lea %A32_6:A32 = __static_1__malloc_start st %A32_6 0 = %A32_4 lea %A32_7:A32 = __static_1__malloc_start ld %A32_8:A32 = %A32_7 0 lea %A32_9:A32 = __static_2__malloc_end st %A32_9 0 = %A32_8 .bbl if_1_end .reg U32 [rounded_size] add %U32_10:U32 = size 15 div %U32_11:U32 = %U32_10 16 mul %U32_12:U32 = %U32_11 16 mov rounded_size = %U32_12 lea %A32_13:A32 = __static_1__malloc_start ld %A32_14:A32 = %A32_13 0 lea %A32_15:A32 = %A32_14 rounded_size lea %A32_16:A32 = __static_2__malloc_end ld %A32_17:A32 = %A32_16 0 blt %A32_17 %A32_15 if_3_true bra if_3_end .bbl if_3_true .reg U32 [increment] add %U32_18:U32 = rounded_size page_size sub %U32_19:U32 = %U32_18 1 div %U32_20:U32 = %U32_19 page_size mul %U32_21:U32 = %U32_20 page_size mov increment = %U32_21 .reg A32 [new_end] lea %A32_22:A32 = __static_2__malloc_end ld %A32_23:A32 = %A32_22 0 lea %A32_24:A32 = %A32_23 increment mov new_end = %A32_24 pusharg new_end bsr xbrk poparg %A32_25:A32 lea %A32_26:A32 = __static_2__malloc_end st %A32_26 0 = %A32_25 lea %A32_27:A32 = __static_2__malloc_end ld %A32_28:A32 = %A32_27 0 bne %A32_28 new_end if_2_true bra if_3_end .bbl if_2_true bsr abort .bbl if_3_end .reg A32 [result] lea %A32_29:A32 = __static_1__malloc_start ld %A32_30:A32 = %A32_29 0 mov result = %A32_30 lea %A32_31:A32 = __static_1__malloc_start ld %A32_32:A32 = %A32_31 0 lea %A32_33:A32 = %A32_32 rounded_size lea %A32_34:A32 = __static_1__malloc_start st %A32_34 0 = %A32_33 mov %out = result pusharg %out ret .fun free NORMAL [] = [A32] .bbl %start poparg ptr:A32 ret
Project4/Sandbox/testinput.asm
orrinjelo/virtual-machine
0
103874
ret .BYT 10 str .BYT '*' rep TRP 4 TRP 3 LDB R0 ret CMP R0 R3 BRZ R0 end LDB R3 str TRP 3 JMP rep end TRP 0
libsrc/math/zxmath/f_yesno.asm
grancier/z180
0
24760
; ; ; ZX Maths Routines ; ; 23/05/06 - <NAME> ; ; $Id: f_yesno.asm,v 1.5 2016/06/22 19:59:18 dom Exp $ ; ; Support for boolean - save some byte IF FORzx INCLUDE "zxfp.def" ENDIF IF FORzx81 INCLUDE "81fp.def" ENDIF IF FORlambda INCLUDE "lambdafp.def" ENDIF SECTION code_fp PUBLIC f_yesno .f_yesno call ZXFP_FP_TO_BC IF FORzx ld h,b ld l,c ELSE ld h,c ld l,b ENDIF xor a or l ret z ;sets nc scf ret
alloy4fun_models/trashltl/models/1/NcdPrj4SLf8RyhhYP.als
Kaixi26/org.alloytools.alloy
0
4075
<filename>alloy4fun_models/trashltl/models/1/NcdPrj4SLf8RyhhYP.als<gh_stars>0 open main pred idNcdPrj4SLf8RyhhYP_prop2 { (historically (no File)) until (some File) } pred __repair { idNcdPrj4SLf8RyhhYP_prop2 } check __repair { idNcdPrj4SLf8RyhhYP_prop2 <=> prop2o }
programs/oeis/268/A268428.asm
karttu/loda
1
101920
; A268428: a(n) = (3*(n^2+n+99)+cos(Pi*n/2)-sin(Pi*n/2))/2. ; 149,151,157,167,179,193,211,233,257,283,313,347,383,421,463,509,557,607,661,719,779,841,907,977,1049,1123,1201,1283,1367,1453,1543,1637,1733,1831,1933,2039,2147,2257,2371,2489,2609,2731,2857,2987,3119,3253,3391,3533,3677,3823,3973,4127,4283,4441,4603,4769,4937,5107,5281,5459,5639,5821,6007,6197,6389,6583,6781,6983,7187,7393,7603,7817,8033,8251,8473,8699,8927,9157,9391,9629,9869,10111,10357,10607,10859,11113,11371,11633,11897,12163,12433,12707,12983,13261,13543,13829,14117,14407,14701,14999,15299,15601,15907,16217,16529,16843,17161,17483,17807,18133,18463,18797,19133,19471,19813,20159,20507,20857,21211,21569,21929,22291,22657,23027,23399,23773,24151,24533,24917,25303,25693,26087,26483,26881,27283,27689,28097,28507,28921,29339,29759,30181,30607,31037,31469,31903,32341,32783,33227,33673,34123,34577,35033,35491,35953,36419,36887,37357,37831,38309,38789,39271,39757,40247,40739,41233,41731,42233,42737,43243,43753,44267,44783,45301,45823,46349,46877,47407,47941,48479,49019,49561,50107,50657,51209,51763,52321,52883,53447,54013,54583,55157,55733,56311,56893,57479,58067,58657,59251,59849,60449,61051,61657,62267,62879,63493,64111,64733,65357,65983,66613,67247,67883,68521,69163,69809,70457,71107,71761,72419,73079,73741,74407,75077,75749,76423,77101,77783,78467,79153,79843,80537,81233,81931,82633,83339,84047,84757,85471,86189,86909,87631,88357,89087,89819,90553,91291,92033,92777,93523 add $0,1 bin $0,2 mul $0,6 div $0,4 mov $1,$0 mul $1,2 add $1,149
src/ht16k33.ads
JeremyGrosser/sensors
1
18719
<gh_stars>1-10 -- -- Copyright (C) 2021 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: BSD-3-Clause -- with HAL.I2C; use HAL.I2C; with HAL; use HAL; package HT16K33 is type Device (Port : not null Any_I2C_Port; Address : I2C_Address) is tagged limited record -- byte 0 is the address command Buffer : UInt8_Array (0 .. 16) := (0 => 0, others => 16#FF#); end record; subtype Brightness_Level is UInt8 range 0 .. 15; subtype Output_Index is Natural range 0 .. 127; procedure Initialize (This : in out Device); procedure Set_Brightness (This : in out Device; Level : Brightness_Level); procedure Set (This : in out Device; Num : Output_Index); procedure Clear (This : in out Device; Num : Output_Index); procedure Clear_All (This : in out Device); procedure Update (This : in out Device); end HT16K33;
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/fzero.lzh/fzero/set_back.asm
prismotizm/gigaleak
0
240048
<reponame>prismotizm/gigaleak Name: set_back.asm Type: file Size: 76162 Last-Modified: '1993-07-20T07:13:27Z' SHA-1: EC31BCCDAACDF30321D54345227128D3FD25AC2C Description: null
memory.asm
stormmmmm/AsmDynamicMemory
0
245288
<filename>memory.asm<gh_stars>0 .model small stack 100h MALLOC_ID = 00000001h _char equ 1 _short equ 2 _word equ 2 _int equ 4 _dword equ 4 _df equ 6 _long equ 8 _dt equ 10 _fpu equ 10 .code __setname macro mid, type_, val __malloc_&mid& type_ val mov ax, offset __malloc_&mid& endm movstack macro push bp mov bp, sp endm popstack macro pop bp endm param macro name, num &name& equ [bp+4+2*num] endm malloc proc param blocksize, 0 movstack push cx mov cx, blocksize cmp cx, 1 je equal_1 cmp cx, 2 je equal_2 cmp cx, 4 je equal_4 cmp cx, 6 je equal_6 cmp cx, 8 je equal_8 cmp cx, 10 je equal_10 jmp short equal_2 endcmp: pop cx MALLOC_ID = MALLOC_ID + 6 popstack ret 2 equal_1: __setname %MALLOC_ID, db, ? jmp short endcmp equal_2: __setname %MALLOC_ID+1, dw, ? jmp short endcmp equal_4: __setname %MALLOC_ID+2, dd, ? jmp short endcmp equal_6: __setname %MALLOC_ID+3, df, ? jmp short endcmp equal_8: __setname %MALLOC_ID+4, dq, ? jmp short endcmp equal_10: __setname %MALLOC_ID+5, dt, ? jmp short endcmp endp callocs proc param elsize, 1 param tablesize, 0 movstack push ax push bx push cx push dx push si mov bx, elsize mov dx, tablesize xor cx, cx mov si, di cloop: push bx call mallocs mov [si], ax inc cx cmp cx, dx jng cloop add si, 2 pop si pop dx pop cx pop bx pop ax popstack ret 4 endp start: ; выделить 2 байта: push 2 call malloc ; callocs работает похожим образом, но выделяет неограниченное количество памяти. ; аргументы: размер одного элемента, количество элементов. ; адреса находятся в ds:[di] ; и самое главное - не нужна функция освобождения памяти, ибо все реализовано на основе стека! .data end start
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt17.adb
best08618/asylo
7
11981
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt17.adb -- { dg-do compile } -- { dg-options "-O" } package body Opt17 is function Func return S is V : String (1 .. 6); begin V (1 .. 3) := "ABC"; return V (1 .. 5); end; end Opt17;
test/Fail/Issue3274.agda
cruhland/agda
1,989
8055
<filename>test/Fail/Issue3274.agda open import Agda.Builtin.Nat open import Agda.Builtin.Equality data Vec (A : Set) : Nat → Set where variable A : Set x : A n : Nat xs : Vec A n postulate IsHead : A → Vec A (suc n) → Set -- Should also work if there is pruning solve_==_by_ : (m n : Nat) → m ≡ n → Set solve_==_by_ _ _ _ = Nat mutual-block : Set meta : Nat meta = _ -- `n` gets pruned due to the meta == suc n constraint, so we can't generalize over it module _ (X : Set) where tricky : let n = _ _ = solve meta == suc n by refl in IsHead {n = n} x xs → Nat tricky h = 0 mutual-block = Nat
packages/x86-toolkit/x86-assembler/tests/asm/jumps.asm
Mati365/ts-c99-compiler-toolkit
66
176205
<filename>packages/x86-toolkit/x86-assembler/tests/asm/jumps.asm ;= test: explicit / implicit near / short jmp range test ;= bin: e9ee83e9f993e9f9ffeb06eb04e901009090 [bits 16] [org 0x7C00] jmp near -0xF jmp near 0x0FFF jmp near 0x7C02 jmp abc jmp short abc jmp near abc nop abc: nop ;= test: jmp relative addresses specified by user ;= bin: ffe0e9fd8390e9f683e9f583e9f282e9ed93e9eb83e9ea83ebe8ebe6ebe8 [bits 16] [org 0x7C00] jmp ax jmp -0xFFFFE nop abc: jmp 0xFFFF jmp -0xFFFF jmp -0xFF jmp 0xFFF jmp 0 jmp -0xFFFFFE jmp short -0xFFFFFE jmp short 0x2 jmp abc ;= test: problematic CALL reg instructions ;= bin: ffd5ffd4ffd0ffd6 [bits 16] call bp call sp call ax call si ;= test: long jumps / calls ;= bin: b8007c8ed83ec606527c7c3ec706807c87db3ec706507c807c3ec706527c007cff1e507cea00ff000f9a2301f00fff160000 [bits 16] [org 0x7C00] mov ax, 0x7C00 mov ds, ax mov [ds:0x7C50+2], byte 0x7C mov word [ds:0x7C80], 0xDB87 mov word [ds:0x7C50], 0x7C80 mov word [ds:0x7C50+2], 0x7C00 call far [0x7C50] jmp 0xF00:0xFF00 call 0xFF0:0x123 call [0x0] ;= test: handle digit nested labels ;= bin: eb0090f4 root: jmp .1 .1: nop hlt
programs/oeis/196/A196290.asm
neoneye/loda
22
173833
; A196290: n^9 + n. ; 0,2,514,19686,262148,1953130,10077702,40353614,134217736,387420498,1000000010,2357947702,5159780364,10604499386,20661046798,38443359390,68719476752,118587876514,198359290386,322687697798,512000000020,794280046602,1207269217814,1801152661486,2641807540248,3814697265650,5429503679002,7625597485014,10578455953436,14507145975898,19683000000030,26439622160702,35184372088864,46411484401986,60716992766498,78815638671910,101559956668452,129961739795114,165216101262886,208728361158798,262144000000040,327381934394002,406671383849514,502592611936886,618121839509548,756680642578170,922190162669102,1119130473102814,1352605460594736,1628413597910498,1953125000000050,2334165173090502,2779905883635764,3299763591802186,3904305912313398,4605366583984430,5416169448144952,6351461955384114,7427658739644986,8662995818654998,10077696000000060,11694146092834202,13537086546263614,15633814156853886,18014398509482048,20711912837890690,23762680013800002,27206534396295014,31087100296429636,35452087835576298,40353607000000070,45848500718449102,51998697814229064,58871586708267986,66540410775079498,75084686279296950,84590643846578252,95151694449171514,106868920913284686,119851595982618398,134217728000000080,150094635296999202,167619550409708114,186940255267540486,208215748530929748,231616946283203210,257327417311663702,285544154243029614,316478381828866136,350356403707485298,387420489000000090,427929800129788502,472161363286556764,520411082988487386,572994802228616798,630249409724609470,692533995824480352,760231058654565314,833747762130149986,913517247483640998 mov $1,$0 pow $0,9 add $0,$1
scripts/FuchsiaGoodRodHouse.asm
opiter09/ASM-Machina
1
3603
FuchsiaGoodRodHouse_Script: jp EnableAutoTextBoxDrawing FuchsiaGoodRodHouse_TextPointers: dw FuchsiaHouse3Text1 FuchsiaHouse3Text1: text_asm ld a, [wd728] bit 4, a ; got good rod? jr nz, .got_item ld hl, FuchsiaHouse3Text_561bd call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a jr nz, .refused lb bc, GOOD_ROD, 1 call GiveItem jr nc, .bag_full ld hl, wd728 set 4, [hl] ; got good rod ld hl, FuchsiaHouse3Text_561c2 jr .done .bag_full ld hl, FuchsiaHouse3Text_5621c jr .done .refused ld hl, FuchsiaHouse3Text_56212 jr .done .got_item ld hl, FuchsiaHouse3Text_56217 .done call PrintText jp TextScriptEnd FuchsiaHouse3Text_561bd: text_far _FuchsiaHouse3Text_561bd text_end FuchsiaHouse3Text_561c2: text_far _FuchsiaHouse3Text_561c2 sound_get_item_1 text_end UnusedText_561c8: para "つり こそ" line "おとこの ロマン だ!" para "へぼいつりざおは" line "コイキングしか つれ なんだが" line "この いいつりざおなら" line "もっと いいもんが つれるんじゃ!" done FuchsiaHouse3Text_56212: text_far _FuchsiaHouse3Text_56212 text_end FuchsiaHouse3Text_56217: text_far _FuchsiaHouse3Text_56217 text_end FuchsiaHouse3Text_5621c: text_far _FuchsiaHouse3Text_5621c text_end
data/jpred4/jp_batch_1613899824__Nc4kp5W/jp_batch_1613899824__Nc4kp5W.als
jonriege/predict-protein-structure
0
47
SILENT_MODE BLOCK_FILE jp_batch_1613899824__Nc4kp5W.concise.blc MAX_NSEQ 701 MAX_INPUT_LEN 703 OUTPUT_FILE jp_batch_1613899824__Nc4kp5W.concise.ps PORTRAIT POINTSIZE 8 IDENT_WIDTH 12 X_OFFSET 2 Y_OFFSET 2 DEFINE_FONT 0 Helvetica DEFAULT DEFINE_FONT 1 Helvetica REL 0.75 DEFINE_FONT 7 Helvetica REL 0.6 DEFINE_FONT 3 Helvetica-Bold DEFAULT DEFINE_FONT 4 Times-Bold DEFAULT DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT # DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose DEFINE_COLOUR 4 1 1 0 # Yellow DEFINE_COLOUR 5 1 0 0 # Red DEFINE_COLOUR 7 1 0 1 # Purple DEFINE_COLOUR 8 0 0 1 # Blue DEFINE_COLOUR 9 0 1 0 # Green DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix) DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand) NUMBER_INT 10 SETUP # # Highlight specific residues. # Avoid highlighting Lupas 'C' predictions by # limiting the highlighting to the alignments Scol_CHARS C 1 1 106 690 4 Ccol_CHARS H ALL 5 Ccol_CHARS P ALL 8 SURROUND_CHARS LIV ALL # # Replace known structure types with whitespace SUB_CHARS 1 691 106 700 H SPACE SUB_CHARS 1 691 106 700 E SPACE SUB_CHARS 1 691 106 700 - SPACE STRAND 3 694 4 COLOUR_TEXT_REGION 3 694 4 694 51 STRAND 25 694 27 COLOUR_TEXT_REGION 25 694 27 694 51 STRAND 31 694 35 COLOUR_TEXT_REGION 31 694 35 694 51 STRAND 44 694 47 COLOUR_TEXT_REGION 44 694 47 694 51 STRAND 54 694 56 COLOUR_TEXT_REGION 54 694 56 694 51 HELIX 62 694 77 COLOUR_TEXT_REGION 62 694 77 694 50 STRAND 3 699 4 COLOUR_TEXT_REGION 3 699 4 699 51 STRAND 25 699 27 COLOUR_TEXT_REGION 25 699 27 699 51 STRAND 32 699 34 COLOUR_TEXT_REGION 32 699 34 699 51 STRAND 44 699 45 COLOUR_TEXT_REGION 44 699 45 699 51 STRAND 47 699 47 COLOUR_TEXT_REGION 47 699 47 699 51 STRAND 54 699 56 COLOUR_TEXT_REGION 54 699 56 699 51 HELIX 43 699 43 COLOUR_TEXT_REGION 43 699 43 699 50 HELIX 46 699 46 COLOUR_TEXT_REGION 46 699 46 699 50 HELIX 63 699 77 COLOUR_TEXT_REGION 63 699 77 699 50 STRAND 3 700 4 COLOUR_TEXT_REGION 3 700 4 700 51 STRAND 25 700 26 COLOUR_TEXT_REGION 25 700 26 700 51 STRAND 31 700 35 COLOUR_TEXT_REGION 31 700 35 700 51 STRAND 44 700 46 COLOUR_TEXT_REGION 44 700 46 700 51 HELIX 62 700 77 COLOUR_TEXT_REGION 62 700 77 700 50 HELIX 101 700 101 COLOUR_TEXT_REGION 101 700 101 700 50
alloy4fun_models/trashltl/models/16/7LrK2TJZ4koLP6czA.als
Kaixi26/org.alloytools.alloy
0
4628
open main pred id7LrK2TJZ4koLP6czA_prop17 { all f: File |(always File' = File - f since eventually f in Trash) } pred __repair { id7LrK2TJZ4koLP6czA_prop17 } check __repair { id7LrK2TJZ4koLP6czA_prop17 <=> prop17o }
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_257.asm
ljhsiun2/medusa
9
13375
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r14 push %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1dd78, %r13 nop nop nop nop and $60312, %r8 vmovups (%r13), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %r14 nop nop nop nop nop inc %rcx lea addresses_WT_ht+0x1b89a, %r11 nop nop dec %rdx vmovups (%r11), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %r12 nop nop xor %r13, %r13 lea addresses_UC_ht+0x16cf2, %rsi lea addresses_UC_ht+0x1c39b, %rdi clflush (%rsi) clflush (%rdi) nop nop nop nop nop sub %r8, %r8 mov $17, %rcx rep movsl nop nop nop nop nop sub $35992, %r13 lea addresses_D_ht+0x3afa, %r11 nop sub %rcx, %rcx movw $0x6162, (%r11) nop xor $3508, %rdx lea addresses_UC_ht+0xc27a, %r11 nop nop add $15772, %r14 mov (%r11), %cx nop nop nop nop add $25479, %r12 lea addresses_WT_ht+0x1cb34, %r12 clflush (%r12) xor $26390, %rdi mov (%r12), %r11 nop xor $43334, %r13 lea addresses_D_ht+0xed7a, %rcx nop nop sub $26302, %rdi mov (%rcx), %r8d nop nop nop and $35928, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r14 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r15 push %r8 push %rbx // Faulty Load lea addresses_WT+0xdf7a, %r15 nop nop nop cmp %r14, %r14 mov (%r15), %r10d lea oracles, %r14 and $0xff, %r10 shlq $12, %r10 mov (%r14,%r10,1), %r10 pop %rbx pop %r8 pop %r15 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WT', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
programs/oeis/200/A200887.asm
jmorken/loda
1
100292
<filename>programs/oeis/200/A200887.asm ; A200887: Number of 0..n arrays x(0..3) of 4 elements without any interior element greater than both neighbors. ; 12,51,144,325,636,1127,1856,2889,4300,6171,8592,11661,15484,20175,25856,32657,40716,50179,61200,73941,88572,105271,124224,145625,169676,196587,226576,259869,296700,337311,381952,430881,484364,542675,606096,674917 mov $2,$0 add $0,2 mov $1,$0 mov $3,$2 add $3,1 mov $5,2 lpb $0 add $1,$3 add $4,$0 sub $0,1 add $4,6 add $3,$4 add $5,5 add $4,$5 lpe
programs/oeis/048/A048848.asm
neoneye/loda
22
16156
; A048848: a(n) = prime(phi(n)). ; 2,2,3,3,7,3,13,7,13,7,29,7,37,13,19,19,53,13,61,19,37,29,79,19,71,37,61,37,107,19,113,53,71,53,89,37,151,61,89,53,173,37,181,71,89,79,199,53,181,71,131,89,239,61,173,89,151,107,271,53,281,113,151,131,223,71,317,131,193,89,349,89,359,151,173,151,281,89,397,131,251,173,421,89,311,181,263,173,457,89,359,193,281,199,359,131,503,181,281,173 seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n. sub $0,1 seq $0,40 ; The prime numbers.
lib/scripts/get_first_track_state.itunes.applescript
swdotcom/music
11
1748
<reponame>swdotcom/music<filename>lib/scripts/get_first_track_state.itunes.applescript on escape_quotes(string_to_escape) set AppleScript's text item delimiters to the "\"" set the item_list to every text item of string_to_escape set AppleScript's text item delimiters to the "\\\"" set string_to_escape to the item_list as string set AppleScript's text item delimiters to "" return string_to_escape end escape_quotes tell application "iTunes" set trk to (first track in playlist "Library") set t_info to "{" set t_info to t_info & "\"artist\": \"" & my escape_quotes(artist of trk) & "\"" set t_info to t_info & ",\"album\": \"" & my escape_quotes(album of trk) & "\"" set t_info to t_info & ",\"genre\":\"" & genre of trk & "\"" set t_info to t_info & ",\"disc_number\": " & disc number of trk set t_info to t_info & ",\"duration\": " & (((duration of trk) * 1000) as integer) set t_info to t_info & ",\"played_count\": " & played count of trk set t_info to t_info & ",\"track_number\": " & track number of trk set t_info to t_info & ",\"id\": \"" & id of trk & "\"" set t_info to t_info & ",\"name\": \"" & my escape_quotes(name of trk) & "\"" set t_info to t_info & ",\"state\":\"" & player state & "\"" set t_info to t_info & ",\"volume\": " & sound volume set t_info to t_info & ",\"loved\": " & loved of trk set t_info to t_info & ",\"popularity\": " & rating of trk set t_info to t_info & "}" end tell
oeis/120/A120865.asm
neoneye/loda-programs
11
21141
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A120865: a(n) is the number k for which there exists a unique pair (j,k) of positive integers such that (j + k + 1)^2 - 4*k = 12*n^2. ; 1,4,9,1,6,13,22,4,13,24,37,9,22,37,1,16,33,52,6,25,46,69,13,36,61,88,22,49,78,4,33,64,97,13,46,81,118,24,61,100,141,37,78,121,9,52,97,144,22,69,118,169,37,88,141,1,54,109,166,16,73,132,193,33,94,157,222,52,117,184,6,73,142,213,25,96,169,244,46,121,198,277,69,148,229,13,94,177,262,36,121,208,297,61,150,241,334,88,181,276 add $0,1 pow $0,2 mul $0,3 seq $0,80883 ; Distance of n to next square.
source/asis/asis-gela-resolver.adb
faelys/gela-asis
4
20044
<reponame>faelys/gela-asis<gh_stars>1-10 ------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $: with Asis.Elements; with Asis.Gela.Iterator; with Asis.Gela.Overloads; with Asis.Gela.Visibility; with Asis.Gela.Implicit.Decl; with Asis.Gela.Resolver.Polish; with Asis.Gela.Private_Operations; package body Asis.Gela.Resolver is type State_Information is record Point : Visibility.Point; Stack : Private_Operations.Package_Data_Stack; end record; procedure Pre_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information); procedure Post_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information); package Iterator is new Asis.Gela.Iterator (State_Information); type Polish_State is null record; procedure Pre_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out Polish_State); procedure Post_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out Polish_State); package Polish_Iterator is new Asis.Gela.Iterator (Polish_State); -------------------------- -- Polish_Subexpression -- -------------------------- procedure Polish_Subexpression (Element : Asis.Expression) is State : Polish_State; Control : Traverse_Control := Continue; begin Polish_Iterator.Walk_Element (Element, Control, State); end Polish_Subexpression; -------------------- -- Post_Operation -- -------------------- procedure Post_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information) is use Asis.Elements; Inner : Visibility.Point := State.Point; begin Visibility.Leave_Construction (Element, State.Point); Implicit.Decl.Process (Element, State.Point, Inner); if not Is_Part_Of_Instance (Element.all) then Overloads.Resolve (Element); end if; case Declaration_Kind (Element) is when A_Type_Declaration => if Declaration_Kind (Enclosing_Element (Element)) = Asis.A_Package_Declaration then Private_Operations.Check_Type (Element => Element, Data => Private_Operations.Top (State.Stack), Point => State.Point); end if; when A_Package_Declaration => Private_Operations.Pop (State.Stack); when others => null; end case; end Post_Operation; -------------------- -- Post_Operation -- -------------------- procedure Post_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out Polish_State) is begin Polish.Each_Element (Element); end Post_Operation; ------------------- -- Pre_Operation -- ------------------- procedure Pre_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information) is use Asis.Elements; use Asis.Gela.Private_Operations; Expr : constant Expression_Kinds := Expression_Kind (Element); begin Visibility.Enter_Construction (Element, State.Point); if (Expr = An_Identifier or Expr = An_Operator_Symbol or Expr = A_Character_Literal) and not Is_Part_Of_Implicit (Element) and not Is_Part_Of_Instance (Element) then Visibility.Try_To_Resolve (Element, State.Point); end if; case Declaration_Kind (Element) is when A_Package_Declaration => Private_Operations.Push (State.Stack, Private_Operations.Create (Element)); when A_Package_Body_Declaration => Private_Operations.On_Package_Body (Element, State.Point); when others => null; end case; end Pre_Operation; ------------------- -- Pre_Operation -- ------------------- procedure Pre_Operation (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out Polish_State) is begin null; end Pre_Operation; ---------------------- -- Process_Instance -- ---------------------- procedure Process_Instance (Decl : Asis.Declaration; Point : Visibility.Point) is State : State_Information; Control : Traverse_Control := Continue; Instance : Asis.Declaration := Decl; begin State.Point := Point; Iterator.Walk_Element_And_Free (Instance, Control, State); pragma Assert (Is_Equal (Decl, Instance)); end Process_Instance; --------- -- Run -- --------- procedure Run (Unit : Asis.Compilation_Unit) is State : State_Information; Control : Traverse_Control := Continue; Decl : Asis.Element; P_State : Polish_State; begin State.Point := Visibility.Enter_Unit (Unit); declare List : constant Asis.Element_List := Context_Clause_Elements (Unit.all); begin for I in List'Range loop Iterator.Walk_Element (List (I), Control, State); end loop; end; Decl := Unit_Declaration (Unit.all); Iterator.Walk_Element_And_Free (Decl, Control, State); pragma Assert (Is_Equal (Decl, Unit_Declaration (Unit.all))); Polish_Iterator.Walk_Element (Decl, Control, P_State); end Run; end Asis.Gela.Resolver; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, <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: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the <NAME>, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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. ------------------------------------------------------------------------------
oeis/171/A171537.asm
neoneye/loda-programs
11
99850
; A171537: Decimal expansion of sqrt(3/7). ; Submitted by <NAME> ; 6,5,4,6,5,3,6,7,0,7,0,7,9,7,7,1,4,3,7,9,8,2,9,2,4,5,6,2,4,6,8,5,8,3,5,5,5,6,9,2,0,8,0,8,2,3,9,5,4,2,4,5,5,7,5,1,5,3,2,0,3,0,3,4,1,5,2,6,6,9,1,7,9,3,5,3,9,5,8,4,0,9,4,3,4,8,0,2,2,2,7,8,4,7,7,7,8,6,1,8 add $0,1 mov $1,1 mov $3,$0 mul $3,4 lpb $3 add $6,$2 add $1,$6 add $2,$6 add $1,$2 add $2,$1 sub $3,1 add $5,$2 add $6,$5 mov $5,$1 lpe mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 mod $0,10